What the stack is, in git: .env committed, the secrets on the host

.env is what `podman compose` reads as is: the hosts, the versions and
where the content comes from, so moving to tomtervel.no or bumping portal
is a commit that the deploy workflow brings up. Nothing in it is secret.

The secrets stay on kasse in secrets.env (the old .env's NATS password,
OAuth2 secret and first person), and what the scripts render from it.
gdo and the chat get NATS_URL from nats.env instead of interpolating
the password, and portal takes its URLs and content settings from .env
over portal.env, so a new host name reaches it without re-running
bootstrap.sh. The deploy script on kasse is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5fbDmSQSb6u27EiEuwzoM
This commit is contained in:
blandClaude Opus 5.5 committed 2026-11-07 16:29:55 +01:00
1 parent 213ef712c7
commit a76e6321ee
9 files changed
+125 -83

No files matched your search

+24 -5
View File
@@ -25,7 +25,7 @@ i.e. as root, so Caddy can bind 80/443 and Kanidm sees a stable source IP):
```sh
git clone https://prosjekt.klingenbergbygg.no/tomtervel/infrastructure /srv/tomtervel/infrastructure
cd /srv/tomtervel/infrastructure
cp .env.example .env # set PORTAL_HOST and ID_HOST; DNS must point here
cp secrets.env.example secrets.env # the hosts are in .env, committed; DNS must point here
sudo sh bootstrap.sh # renders configs, makes the internal cert, starts, recovers Kanidm admin
sh kanidm-setup.sh # logs in, creates the portal client and desk groups, restarts portal
```
@@ -80,7 +80,7 @@ and is safe to rerun:
- **Onboarding.** The `portal-onboarding` service account manages
every desk group, so an invite from a desk and a `grants:` can add
people to them. Its token goes into `portal.env`.
- **The first person in.** `SEED_ADMIN_EMAIL` in `.env`: at start,
- **The first person in.** `SEED_ADMIN_EMAIL` in `secrets.env`: at start,
portal invites them into the most privileged group (the board) and
mails the link, once. Everyone else they invite from their desk.
- **The people who ask the questions.** Everyone a page names as
@@ -124,9 +124,28 @@ Until then, `podman compose restart portal` picks up new content.
## Upgrading portal
Bump `PORTAL_RELEASE` in `.env` (a tag of uhhm/portal) and
`podman compose up -d --build portal`. Keep `IRIS_RELEASE` in the
content repo's workflow matched to it.
Bump `PORTAL_RELEASE` in `.env` (a tag of uhhm/portal), commit and push
to main: the deploy workflow brings it up. Keep `PORTAL_RELEASE` in the
content repo's `lint-and-reload.yml` matched to it.
## What is in git, and what is on the host
`.env` is committed: the hosts, the versions, where the content comes
from - everything the stack *is*. `podman compose` reads it as it is,
so a change to it is a commit, and a push to main deploys it. The repo is
public, so nothing secret goes there.
The secrets stay on the host, made there and never in CI: `secrets.env`
(the NATS password, the OAuth2 secret, the first person's address; see
`secrets.env.example`), and what the scripts render from it - `portal.env`,
`nats.env`, `chat.env`, `nats/nats.conf`, `kanidm/server.toml`.
`bootstrap.sh` and `kanidm-setup.sh` read `.env` and then `secrets.env`.
`kanidm/server.toml` takes `ID_HOST` when `bootstrap.sh` renders it, not on
a deploy: Kanidm's domain is renamed on purpose, once (see dns/README.md).
The one secret in Gitea is the repo secret `CLOUDFLARE_API_TOKEN`, for
the DNS workflow.
## Backups