Administration
The admin page
Section titled “The admin page”/admin asks for the administrator password (there is no username) and shows the server’s settings:
- its public address, and link or accounts mode;
- password sign-in and sign-up;
- email (SMTP);
- Google and OpenID Connect sign-in;
- Android app links;
- maps and the privacy notice;
- plans and payments, when turned on;
- accounts, which the administrator can find and delete.
Changes apply at once, on every server process that shares the database. Nothing in the app links to /admin: open it by typing the address.
Settings from the environment
Section titled “Settings from the environment”Every setting can also be an environment variable in .env. A variable that is set wins: /admin shows its value but marks it as fixed. Leave a variable out to manage that setting from /admin instead. .env.example marks with [admin] which settings /admin can change.
Settings from .env only
Section titled “Settings from .env only”To keep the whole configuration in one file, set:
BALNANA_ENV_ONLY=trueThe server then reads every [admin] setting from its environment alone. What was saved at /admin is ignored, though it stays in the database, and a setting .env leaves out takes its default. /admin still shows the settings, but dimmed: under Environment file, Read settings from .env only is on, and nothing can be changed there. Change a setting in .env and restart the server instead.
Plans, products, accounts and payments are not settings. They stay at /admin either way.
Only .env turns this on or off. With it on, a setting the server cannot accept stops it from starting, and the log says which one. Take the line out again and restart, and the settings saved at /admin are back in force.
Export as .env
Section titled “Export as .env”/admin writes the settings it saved as lines for .env, so nothing has to be typed again before turning BALNANA_ENV_ONLY on:
-
At
/admin, choose Export as .env: the download button in the top bar, or the entry under Environment file. -
Enter the administrator password again.
/adminthen saves a file namedbalnana.env. -
Add the file’s lines to the server’s
.env. -
Add
BALNANA_ENV_ONLY=trueto.env. -
Restart the server so it reads the file again:
Terminal window docker compose up -d
The file holds every setting saved at /admin, with its secrets: the SMTP password, sign-in provider secrets and payment keys. Settings the environment already sets are left out, as they are in .env already. Values are quoted the way both Docker Compose’s env_file and systemd’s EnvironmentFile read them, and a JSON key, such as the Google Play service account, is put on one line.
Lost the administrator password
Section titled “Lost the administrator password”Run:
docker compose exec balnana /balnana reset-adminIt signs everyone out of /admin and prints a new setup code. Open /admin and choose a new password with that code.
Backups
Section titled “Backups”The PostgreSQL database holds everything: groups, expenses, receipts, accounts, the settings made at /admin and the key that signs push notifications. Only your .env lives outside it, so keep a copy of that too. Back the database up regularly:
docker compose exec -T db pg_dump -U balnana -Fc balnana > balnana.dumpTo bring a copy back, on this server or on a new one set up with the same .env:
docker compose stop balnanadocker compose exec -T db pg_restore -U balnana -d balnana --clean --if-exists --no-owner < balnana.dumpdocker compose up -dRunning more than one server
Section titled “Running more than one server”Run one. Several servers can share a database, but each keeps its own count of requests, password guesses, tries at claiming a payment and live connections, so with N servers those limits are N times what is set.