nooks
GitHubInstall

Configure

Every flag, what it does, and the environment variable that sets it instead.

Every option is a flag, and every flag has an environment variable. The flag wins when both are set.

FlagEnvironmentDefaultMeaning
--addrNOOKS_ADDR:8081Host and port to listen on
--dataNOOKS_DATA./dataDirectory holding the SQLite file
--driverNOOKS_DRIVERsqlitesqlite or postgres
--dsnNOOKS_DSNConnection string, when the driver is postgres
--modeNOOKS_MODEprodprod or dev
--secure-cookiesNOOKS_SECURE_COOKIESoffMarks session cookies Secure. Turn it on behind TLS
--log-levelNOOKS_LOG_LEVELinfodebug, info, warn or error

Changing the port

--addr is host and port together, so the port lives there rather than in a flag of its own:

./nooks --addr :9090

Give it a host to stop it listening on every interface, which is worth doing when something else is already handling the outside world:

./nooks --addr 127.0.0.1:9090

In Docker the container keeps 8081 and the host side of -p is what you change:

docker run -d -p 9090:8081 -v nooks-data:/var/lib/nooks ghcr.io/hoshomoh/nooks

Postgres instead of SQLite

A flag, not a rewrite. The same schema runs on both, and the same binary serves either.

./nooks --driver postgres --dsn "postgres://nooks:nooks@localhost:5432/nooks?sslmode=disable"

Postgres is worth it when more than a household is using the instance, or when the machine already runs one. For a flat, SQLite is the better answer: one file, no server.

On this page