From 45bd8212d7f575d0a265e01eadccaefd50a5ba3b Mon Sep 17 00:00:00 2001 From: Dakota Walsh Date: Wed, 21 Aug 2024 15:32:50 +1200 Subject: [PATCH] add usage instructions to readme --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 1eeabf1..4c3a848 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,31 @@ A webserver for keeping lists. The database is a sqlite database where each list had a name and body text. The site has a create list page and an edit list page. +# usage + +A `go` compiler is required to compile this application. Check `go.mod` for the +oldest supported version of [go](https://go.dev/). Then run `make` to compile +the project. + +You will probably want to install this database migration tool in order to +create your sqlite database: https://github.com/golang-migrate/migrate + +Once installed you can spin up a new database, or update an existing one with +the following command. This should be run every time you pull new updates for +the server. +```sh +migrate -path=./migrations -database=sqlite://lists.db up +``` + +Run with the `-help` flag for current options. The `-addr` argument is used to +select a port / address to bind to and the `-dsn` argument is used to provide a +path to your sqlite database file along with any database options you wish to +use. + +If you're actually trying to host this on the internet make sure you put it +behind a proxy (caddy, nginx, openbsd httpd, apache, etc) as the application +does not serve https by itself. + # author Written and maintained by Dakota Walsh. Up-to-date sources can be found at https://git.sr.ht/~kota/lists/ -- 2.45.2