README: indicate change to ENV for configuration, refresh systemd unit file, introduce Gorm and db migration tool

This commit is contained in:
Gerdriaan Mulder 2021-05-05 22:29:08 +02:00
parent 1fe9553cc9
commit 5cb0a59f00

View File

@ -34,6 +34,9 @@ https://rushlink.local` to the binary (e.g. in the `systemd` unit file).
## Sample `systemd` unit file
As of 1fe9553cc9, `rushlink` expects its database and file store configuration
in environment variables.
```
[Install]
WantedBy=nginx.service
@ -42,7 +45,8 @@ WantedBy=nginx.service
Type=simple
User=rushlink
Group=nogroup
ExecStart=/var/lib/rushlink/rushlink -database /var/lib/rushlink/db -file-store /var/lib/rushlink/filestore -root_url https://rushlink.local
Environment=RUSHLINK_DATABASE_DRIVER=sqlite RUSHLINK_DATABASE_PATH=/var/lib/rushlink/rushlink.sqlite3 RUSHLINK_FILE_STORE_PATH=/var/lib/rushlink/filestore/
ExecStart=/var/lib/rushlink/rushlink -root_url https://rushlink.local
```
---
@ -65,10 +69,16 @@ are the exceptions:
## Database
We use [`go.etcd.io/bbolt`]. This file should be the *only* file
Before 1fe9553cc9 we used [`go.etcd.io/bbolt`]. This file should be the *only* file
apart from our monolithic binary. All settings and keys should go in here.
Any read-only data resides in the binary file (possibly compressed).
Now, we use Gorm and support SQLite and PostgreSQL as backends.
We provide a migration binary in `cmd/rushlink-migrate-db/`. In environment
variables, the destination database is configured, and the binary itself
expects a few flags. Refer to the source for the exact flags.
[`go.etcd.io/bbolt`]: `go.etcd.io/bbolt`
## Namespacing