The stack for portal 1.0: a store of its own, gdo and kron dialling the site

Portal 1.0 keeps everything in one file (portal_data) and has no NATS.
gdo and kron dial it over dhd/1 from loopback, so the three share one
network namespace, held by a container of its own: held by portal, a
restart of portal cut the other two off. NATS stays behind a profile
nothing turns on, for going back; the chat (cnats) is out.

The deploy writes DHD_KEYS and the hash of LOAD_TOKEN, and no NATS or
chat settings. gdo is built from uhhm/gdo at GDO_RELEASE, since the gdo
that dials a site is not in the registry. move.sh reads the programs'
keys and prints what the deploy wants.

Run on kasse beside the live stack, on other ports, with made-up
records: mail out, a payment settled, content loaded over /dhd/1/load,
and both programs back after portal was restarted and made anew.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5fbDjTQg4CJsNqEo7hhE7
This commit is contained in:
blandClaude committed 2026-11-24 12:40:41 +01:00
1 parent d1106dc1b8
commit 1f37681696
8 files changed
+368 -260

No files matched your search

+45 -36
View File
@@ -52,48 +52,52 @@ the board, who takes them off on the event's page.
Rehearsed on 2026-11-24 against the live site: 91 records and 15 sign-ups
(25 guests) across, all 53 files fetched, 15 mails taken by the sink,
nothing differing. Steps 1 to 3 are done or can be done any time; 4 on
are the switch itself, with the site down from 4 to 6.
nothing differing. The 1.0 stack was run the same day beside the live
one, with made-up records: mail out, a payment settled, content loaded,
and gdo and kron back after portal was restarted and made anew.
1. **Programs that speak to a 1.0 site.** 1.0 has no NATS; the programs
beside the site dial it over `dhd/1`. As of 2026-11-24 none of what
the stack runs can:
- **gdo** (mail): v0.3.1 is NATS only. The `one-oh` branch dials a
site, built against portal v1.0.0-rc.10.
- **kron** (Vipps): 0.2.0 is NATS only. `one-oh` likewise.
- **cnats** (the chat) is NATS only. Its successor kino 0.1.1 dials a
site, but is published as an Arch package, not an image, and takes
no history over.
The site is down from step 4 until step 7 is done.
Until gdo has a release, a 1.0 site here sends no mail at all: no
invites, no confirmations. That is what the switch waits for.
2. **The stack for 1.0** (`compose.yml`, `deploy.yml`, a pull request of
its own once step 1 has releases to try it with): a volume for the
store, `PORTAL_STORE`, `DHD_KEYS` naming each program's key,
`DHD_TOKENS` with the hash of `LOAD_TOKEN` named `load`, the programs
in portal's network namespace (they dial loopback), sealed backups
(`PORTAL_BACKUP_TO`), and NATS out.
3. **`LOAD_TOKEN`** as a secret of the tomtervel org: the content repo's
reload posts it to `/dhd/1/load`.
4. **`move.sh rehearse`** once more on the day, then **`move.sh move`**.
The 0.19 site is down from here.
5. **The 1.0 stack up**: `PORTAL_RELEASE=v1.0.2` (the org's variable),
questions#48 merged so `main` is the 1.0 content, then the deploy.
The reload that merge sets off fails while the site is down; the site
reads `main` as it starts.
6. **Look**: `/hva-skjer` says 25 of 100 seats, a document opens, a
sign-in lands on `/styret` with its lists, and a test invite arrives.
7. **Rauthy's groups**: from `komiteer_<id>_medlem` and `_leder` to the
1. **Programs that dial a 1.0 site**: kron's image `0.3.0`, and a
commit of uhhm/gdo with its NATS mode gone, which the stack builds
gdo from. The chat does not come along: cnats speaks NATS only, and
kino has no image.
2. **Org secret `LOAD_TOKEN`** (`openssl rand -hex 24`, `gt secret set
LOAD_TOKEN -o tomtervel`), and this repo's variables `GDO_RELEASE`
(that commit), `KRON_RELEASE=0.3.0`, `COMPOSE_PROFILES=pay`.
3. **On kasse, the images the stack will run**, so the move can read
their keys: from a checkout of this branch, `podman build -t
localhost/tomtervel-gdo:<GDO_RELEASE> --build-arg
GDO_RELEASE=<GDO_RELEASE> gdo`, and `podman pull
project.uhhm.no/uhhm/kron:0.3.0`. And the new `deploy-tomtervel` in
`/usr/local/bin` (its first lines say how).
4. **`move.sh rehearse`** once more, then **`move.sh move`**, both with
`GDO_IMAGE` and `KRON_IMAGE` naming those images. `move` stops the
0.19 site, and ends with `DHD_KEYS` and `PORTAL_DHD`.
5. **Those two** as variables of this repo, and the org's
`PORTAL_RELEASE=v1.0.2`.
6. **The content**: questions#48 merged, so `main` is the 1.0 content.
Its reload fails, since the site is down; the site reads `main` as it
starts.
7. **The stack**: this merged, which deploys it. `podman stop
tomtervel-cnats-1` afterwards; `tomtervel-nats-1` is left running.
8. **Look**: `/hva-skjer` says 25 of 100 seats, a document opens, a
sign-in lands on `/styret` with its lists, the log says gdo and kron
are beside the site, and a test invite arrives.
9. **Rauthy's groups**: from `komiteer_<id>_medlem` and `_leder` to the
group named as its page (questions' README has the names).
### Going back
- **Before step 5**: `podman start tomtervel-portal-1`, and remove
`tomtervel_portal_data`. Nothing else was touched.
- **After**: `PORTAL_RELEASE` and the stack back to what they were, and
the content's `main` reverted. NATS still holds everything 0.19 had as
long as `tomtervel_nats_data` is kept, so keep it for some weeks. What
people did on 1.0 in between does not go back with it.
- **After**: the stack's merge and the content's reverted, the old
`deploy-tomtervel` installed, and the variables back to what they
were (`PORTAL_RELEASE=v0.19.2`, `GDO_RELEASE=v0.2.0`,
`KRON_RELEASE=0.1.0`, `COMPOSE_PROFILES=chat,pay`), then the deploy.
NATS still holds everything 0.19 had as long as `tomtervel_nats_data`
is kept, so keep it for some weeks. What people did on 1.0 in between
does not go back with it.
### What does not come across
@@ -103,5 +107,10 @@ are the switch itself, with the site down from 4 to 6.
site's list of them starts empty.
- **Each record's history.** A record arrives with one event saying it
was imported, and its date.
- **The chat's history,** and **payments under way in kron** (none may be
open when the switch is made: a fee paid in between would not be seen).
- **The chat,** and its history.
- **Payments under way in kron.** The new kron starts with none open: a
pay link mailed before the move no longer settles. A household that
owed its fee is marked paid by the treasurer when the money is seen,
or signs up again for a new link.
- **The site's backups** are off until `PORTAL_BACKUP_TO` is set
(README.md, "Backups").