Black Branch/Docs
All sections

Settings that live on the server

This page is for an owner who wants to know what lives on the server rather than in the panel. After it, you will know the three kinds of setting, why some values are kept apart, and how to change a server value safely.

Most settings live in your site's database and are changed in the Admin Panel. A smaller set lives in one file on your server, /opt/blackbranch/.env (the .env file), and can only be changed there. What the installer writes into .env in the first place is on The install's settings file.

Three kinds of setting

Every setting the site knows is declared once, with its kind, its default and where it is kept. There are three places:

Kind Where it is kept Changed in Example
Server value .env on the server The server only. Locked (🔒) in the panel Site name, the site's addresses, the legal details
Setting The site's database, one row per setting with who saved it and when The Admin Panel Time zone, points earning, module switches
Credential The site's database, encrypted The Admin Panel (write-only) Stripe keys, platform app secrets, AI keys

Credentials are encrypted with a key that is itself a server value (INSTANCE_MASTER_KEY). Only the chat service holds it and decrypts them; the website and the ingest service ask the chat service for the credentials they need, over a connection that proves itself with another server secret.

On top of these, .env holds values the site never shows at all: the passwords and keys the services use to reach each other, and the install's own settings (below).

Which one wins

Each service works out every setting in the same order: the server's environment first, then the saved value, then the product's default. So a value on the server always wins, and the panel says "set on the server" under a setting whose value comes from there. A saved value is kept but ignored until the server's is removed.

On an install made with the Black Branch installer, each service is given only the variables it is listed to read, never the whole .env, so no service sees a secret it has no use for. One result: adding a line for a panel setting to .env (say MODULE_OBS=1 or SITE_TIME_ZONE=…) reaches no service and does nothing. Use the panel for those. The few settings the installer does set on the server show "set on the server" in the panel:

Setting Service Why
Matrix sign-in client secret website Made by the installer together with the homeserver's sign-in service
Voice clips folder chat service Points at a folder inside the chat service's own storage

Why some values live on the server

There are four reasons, and each server value has at least one of them.

The site trusts them. Your site's own addresses and your homeserver's address are where the site sends people back after sign-in, which other sites may call it, and which server it talks to without its usual protections. If they could be changed from a web page, anyone who ever got into the admin account could point your site at a server of their choosing. On the server, changing them needs access to the machine.

They are needed before the database is. A service needs the database password to reach the database, and the key that decrypts saved credentials cannot be kept in the database it unlocks. These have to be in the environment when the service starts.

They are read when the site starts. The display values (name, Home text, icons, legal details, points words) go into the first bytes of every page, including the very first page a visitor loads. The website reads them once at start, so the same program works for every install and each page needs no extra database lookup to know its own name.

A credential is sent there. An address that a stored password or token is sent to is a server value, because an address editable from the panel would let whoever edits it collect the credential at a host of their choosing.

What is in .env

Five groups of values, each listed one by one on The install's settings file:

Group How it changes
Identity: your site's addresses, the Matrix server name and the sign-in client Never. Every account id contains the server name, and a homeserver can never be renamed. Moving to another domain means a new install
Display values: the SITE_* names, LEGAL_*, CURRENCY_*, COMMUNITY_SCORE_NAME, YOUTUBE_VOD_PLAYLIST sudo blackbranch set <NAME> <value> (below). See Site name, theme and looks
Secrets: the database passwords and the keys that lock credentials, sign-ins and backups Do not change them. The installer makes each one at random, once, and never prints them. A new key makes what the old one locked unreadable
The install: the domain, the front door, the release and the update channel The installer and sudo blackbranch update manage them
First boot: the setup link's fingerprint Written by the installer; dead once the first admin exists

The Admin Panel shows the identity values, read-only, in the Install values card at the bottom of Site → Site (see Admin Panel: Site).

Sound clips

Sound clips for alerts and the Store are off on an install made with the installer, and the Store offers none; their switch is coming. See Known gaps → Alert sounds.

Spoken alerts and the subscription price are panel settings: see Admin Panel: Utility and Admin Panel: Payments.

Changing a server value

  1. Sign in to your server.
  2. Run sudo blackbranch set <NAME> "<value>", for example sudo blackbranch set LEGAL_CONTACT_EMAIL "legal@example.com".
  3. Wait for "applied". The site is briefly unavailable while it restarts.
  4. Reload your site and check the change.

If the command says the name "cannot be set here", it is either permanent (an address or the server name) or a secret. If it says the site did not come back healthy, nothing changed: the old value is back, and sudo blackbranch logs web shows why.

Next: Your site, feature by feature

← Customizing