Skip to content

Commit acec459

Browse files
committed
Merge branch 'oss'
2 parents d4f9d28 + 0934112 commit acec459

29 files changed

+2168
-695
lines changed

.github/workflows/ci.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
go-version: [1.15.x]
10+
platform: [ubuntu-latest, macos-latest]
11+
runs-on: ${{ matrix.platform }}
12+
steps:
13+
- name: Install Go
14+
uses: actions/setup-go@v2
15+
with:
16+
go-version: ${{ matrix.go-version }}
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
- name: Build
20+
run: |
21+
make notes
22+
- name: Archive build artifact
23+
uses: actions/upload-artifact@v2
24+
with:
25+
name: notes-${{ matrix.platform }}
26+
path: notes
27+
release:
28+
name: Create Release
29+
runs-on: ubuntu-latest
30+
needs: build
31+
if: startsWith(github.ref, 'refs/tags/v')
32+
steps:
33+
- uses: actions/download-artifact@v2
34+
- name: Create Release
35+
id: create_release
36+
uses: actions/create-release@v1
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
tag_name: ${{ github.ref }}
41+
release_name: Release ${{ github.ref }}
42+
draft: false
43+
prerelease: false
44+
- name: Upload Linux Build
45+
id: upload-linux-build
46+
uses: actions/upload-release-asset@v1
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
upload_url: ${{ steps.create_release.outputs.upload_url }}
51+
asset_path: notes-ubuntu-latest/notes
52+
asset_name: notes-linux-amd64
53+
asset_content_type: application/octet-stream
54+
- name: Upload Mac Build
55+
id: upload-mac-build
56+
uses: actions/upload-release-asset@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ steps.create_release.outputs.upload_url }}
61+
asset_path: notes-macos-latest/notes
62+
asset_name: notes-macos-amd64
63+
asset_content_type: application/octet-stream

.gitignore

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
/tasker
2-
/tasker.db
3-
/tasker-*.db.gz
1+
/notes
2+
/notes.db
3+
/notes-*.db.gz
44
/.env
5-
/internal/statik
65

LICENSE

+661
Large diffs are not rendered by default.

Makefile

+33-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,42 @@
1-
.PHONY: tasker run embeds.go
1+
.PHONY: notes run embeds.go
2+
LISTEN_ADDR?=localhost:3333
23

34
GIT_REVISION:=$(shell git describe --always --tags)
45

5-
all: tasker
6+
all: test todo notes
67

7-
tasker: embeds.go
8-
go build -ldflags="-X 'main.Version=$(GIT_REVISION)'" .
8+
todo:
9+
@grep --line-number TODO $(shell git ls-files | grep -v Makefile)
10+
11+
notes: embeds.go
12+
@go build -ldflags="-X 'main.Version=$(GIT_REVISION)'" .
13+
14+
test: lint
15+
@go test .
16+
17+
lint:
18+
@golangci-lint run .
919

1020
embeds.go:
11-
go run github.com/klingtnet/embed/cmd/embed --include assets --include migrations --include views
21+
@go run github.com/klingtnet/embed/cmd/embed --include assets --include migrations --include views
22+
23+
install: notes
24+
@install --strip -Dm700 notes $$HOME/.local/bin
25+
@install -Dm700 -d $$HOME/.config/notes
26+
@install -Dm600 dist/notes.systemd.service $$HOME/.config/systemd/user/notes.service
27+
@systemctl --user daemon-reload
28+
@echo Please copy dist/notes.env to $$HOME/.config/notes/notes.env and enter your database password
29+
@echo To start the service run: systemctl --user start notes.service
30+
@echo http://localhost:13333
31+
32+
run: notes
33+
@./notes run --database-passphrase $$DATABASE_PASSPHRASE --database-path=notes.db --listen-addr=$(LISTEN_ADDR)
34+
35+
renew:
36+
@./notes renew --database-passphrase $$DATABASE_PASSPHRASE --database-path=notes.db
1237

13-
run: tasker
14-
@./scripts/run
38+
rerun:
39+
@git ls-files --cached | grep -v embeds.go | entr -c -r make run
1540

1641
clean:
17-
git clean -fd
42+
@git clean -fd

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# notes - a journal server
2+
3+
- ![CI](https://github.com/klingtnet/notes/workflows/CI/badge.svg)
4+
- [Releases][releases]
5+
6+
`notes` is a web service equivalent to a notebook, you can store ideas and look for them with a full text search. The search makes it even better than a notebook.
7+
Notes are stored in a encrypted SQLite database using SQLCipher.
8+
It supports github flavored markdown and everything is contained in a single binary (execpt the database file).
9+
10+
I am happy to get pull requests and here a couple of improvement ideas:
11+
12+
- [ ] mark tasks as finished by clicking on a checkbox
13+
- [ ] only show open tasks
14+
- [ ] add pagination or date filtering
15+
16+
## Installation
17+
18+
For Linux users with a working Go setup the easiest way is to install the server and its systemd user service using by running `make install`.
19+
You can also [grab a prebuilt binary from the releases page][releases] and copy it into your `$PATH`.
20+
A database file is created on the first start at `$XDG_CONFIG_HOME/notes/notes.db` or wherever you set the argument of `--database-path` to.
21+
It is important to set a proper database password on the first run using `DATABASE_PASSPHRASE` environment variable (you can use the flag as well but [this comes with some security downsides][so-password].)
22+
At the moment there is no option to change the password but you should be able to achieve that in a db shell session (`scripts/dbshell` shows how to start such a session).
23+
24+
[releases]: https://github.com/klingtnet/notes/releases
25+
[so-password]: https://security.stackexchange.com/questions/14000/environment-variable-accessibility-in-linux/14009#14009

assets/Cantarell-Bold.woff2

48.1 KB
Binary file not shown.

assets/Cantarell-Regular.woff2

46.3 KB
Binary file not shown.

assets/JetBrainsMono-Regular.woff2

52.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)