From 5cb0a59f00fb4652e191822b5359e0515084443c Mon Sep 17 00:00:00 2001 From: Gerdriaan Mulder Date: Wed, 5 May 2021 22:29:08 +0200 Subject: [PATCH] README: indicate change to ENV for configuration, refresh systemd unit file, introduce Gorm and db migration tool --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 64fdf03..ac8c0ef 100644 --- a/README.md +++ b/README.md @@ -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