Tesria
Tesria.com

Security hardening

Tesria arrives set up for a private network. Before people can reach it from the internet, a few things need doing that the software cannot do for you: strong passwords, the stricter web server configuration, two-factor sign-in for the people who run it. This page is that list, with why each item matters.

On a private network, the accounts and operations items still apply.

Configuration

  • DOMAIN is a real name you control, and ACME_EMAIL, if you set it, is an address someone reads. See HTTPS and domains.

  • CADDYFILE=deploy/Caddyfile.public is set. The standard configuration makes a certificate for any name a stranger connects with.

  • No setting in .env still holds a change-me value from an old .env.example. Tesria warns in Admin, Security (Admin is in the top bar; in a narrower window or on a phone it is in the ☰ menu at the left of the top bar, and a tab that does not fit is under ••• at the end of the tabs) if one does; see Changing a secret, below. The backup key is saved somewhere other than the server.

  • Only ports 80 and 443 are open to the outside. Nothing publishes Tesria’s own port (8080), the database (5432) or the live editing service (8090).

  • If a proxy of your own sits in front, PROXY_TRUSTED_NETWORKS names exactly that proxy.

  • You have decided whether pages may show pictures from any website. If what your readers read is private, limit pictures in Admin, Settings (Admin is in the top bar; in a narrower window or on a phone it is in the ☰ menu at the left of the top bar, and a tab that does not fit is under ••• at the end of the tabs), under Images.

  • If single sign-on is on, OIDC_REQUIRE_HTTPS_METADATA is left out or true.

Accounts

  • The owner has two-factor sign-in on and has saved their recovery codes. Nobody else can reset the owner, so losing both locks the owner out. See Two-factor and recovery codes.

  • Every administrator has two-factor on, and Require Two-Factor for Administrators is on (Admin, Security, Kill Switches).

  • Each role has only what it needs: review Admin, Roles.

  • Allow Public Registration is off, so new accounts need an invite, unless you mean to run an open community.

  • Allow Public Spaces stays off until you mean to publish a space to people who are not signed in.

Operations

  • Backups run, a restore has been rehearsed, and there is at least one offsite copy.

  • The offsite passphrases in .env are kept somewhere other than the server.

  • Email works, so alerts reach administrators: Send Test Email to Me succeeds. See Email (SMTP).

  • Tesria’s log, which carries a copy of the audit log, is sent somewhere durable.

  • scripts/verify-audit-chain.sh runs on a schedule and someone watches its result. See Health checks and monitoring.

  • Someone watches for new releases and upgrades promptly. See Upgrading.

Changing a secret

Tesria makes its five secrets itself on the first start (see Configuration reference). You may still want to change one: because it leaked, or because an install from before 0.8.0 still has a change-me value from the old example settings. Tesria then starts as normal, but writes a warning to its log at every start and raises a critical alert in Admin, Security (Admin is in the top bar; in a narrower window or on a phone it is in the ☰ menu at the left of the top bar, and a tab that does not fit is under ••• at the end of the tabs): A secret is still the public example value. A new install whose .env has one does not start at all, and docker compose logs init names the setting: delete that line, so that Tesria makes its own, or set a long random value.

A value set in .env always wins over the stored one, so changing a secret means setting a new value there. Make a long random one with:

Bash / Shell
openssl rand -hex 32

APP_DB_PASSWORD

Put the new value in .env, then run:

Bash / Shell
docker compose up -d

Nothing needs restarting. Within a few seconds Tesria gives its database account the new password, and every part of Tesria switches over to it by itself. To see that it has, run docker compose logs migrate: it says APP_DB_PASSWORD changed.

COLLAB_SHARED_SECRET or PDF_SHARED_SECRET

Each of these is shared by Tesria and one helper service, and both read it when they start. Put the new value in .env, then run both commands, so that all of them start again with the new value together:

Bash / Shell
docker compose up -d docker compose restart app collab pdf

POSTGRES_PASSWORD

The database keeps the password it was created with, so change it in the database first, then in .env, then restart. Use your new value in place of the-new-password:

Bash / Shell
docker compose exec db psql -U tesria -d tesria -c "ALTER ROLE tesria PASSWORD 'the-new-password'"

Put the same value in .env as POSTGRES_PASSWORD, then run docker compose up -d. If you changed POSTGRES_USER or POSTGRES_DB from tesria, use those names in the command instead.

BACKUP_ENCRYPTION_KEY

This one cannot simply be changed. A different key in .env is refused when it does not open the backups already on the server: Tesria does not start, changes nothing, and docker compose logs init says which key is wrong. Every backup Tesria has taken stays encrypted with the old key, so changing it means starting a new backup history: a job to plan, not a one-line change. Until then, keep the old key safe, because every existing backup needs it. The steps are in docs/backup-recovery.md in Tesria’s source code, at github.com/Tesria/Tesria.

Afterwards

Once you have changed a secret, resolve its alert in Admin, Security (Admin is in the top bar; in a narrower window or on a phone it is in the ☰ menu at the left of the top bar, and a tab that does not fit is under ••• at the end of the tabs).

What Tesria does for you

Once those are done, Tesria covers a good deal by itself: limits on sign-in attempts from one address and lockouts for one account; alerts for patterns such as password spraying or mass deletion; a blocklist for addresses; strict browser security headers; attachments that cannot run scripts as the site; webhooks that cannot reach the server’s own network; and an audit log the running application cannot alter. The Security section explains each, and what it does not cover.


Applies to

Tesria 0.5 and later

Updated

September 29, 2026

Changes

Revised.