Files
infrastructure/move-1.0/README.md
T

107 lines
5.5 KiB
Markdown
Raw Normal View History

# The move to portal 1.0
Portal 0.19 keeps the vel's records on NATS. Portal 1.0 keeps them in one
file of its own, and starts empty. This folder is what carries the records
across, on kasse, and the order the whole switch goes in.
| | |
|---|---|
| `move.sh rehearse` | the whole middle of the move beside the running site, into a volume it removes again |
| `move.sh move` | the same for real: stops the 0.19 site first, and fills `tomtervel_portal_data`, the volume the 1.0 stack starts on |
| `compare.py` | holds a 1.0 store to the export: every record, its state, its fields, its files, and the sign-ups in the order they came |
| `sink.py` | takes what the site would have sent while the sign-ups are taken again, and lets it go |
Everything is run as root on kasse. The export holds names and addresses:
it stays in `/srv/tomtervel/move-1.0` (root only) and nothing here prints
a name, an address or a text, only counts and the names of fields.
## What `move.sh` does
1. **Export** with portal 0.19.3 (`portal export`), reading NATS only.
2. **Rewrite** for the 1.0 content with `flytting/fra-0.19.py` from
tomtervel/questions: the committees become `gruppe` on each record.
3. **Import** with portal 1.0 into the volume, after a dry run.
4. **A 1.0 site on the store** that only kasse can reach (127.0.0.1:3997),
with the stack's garage for the files and no sign-in.
5. **The sign-ups** again, through their form
(`flytting/pameldinger.py`), in the order they came. A sign-up cannot
be imported: in 1.0 a seat is taken through the event's own count.
6. **Compare**, with every picture and document fetched as a visitor
would. Anything that differs is counted and the run ends non-zero.
7. **Stop** the site again.
### No mail leaves
Taking a sign-up again makes the mail the form makes ("Dere har plass"),
and what the site says in the chat's rooms. With no mail service beside
it, the site does not drop them: they wait in the store, and go out the
moment gdo dials it. A store filled on a preview and then started on in
production would mail every sign-up on its first start.
So while the site of step 4 runs, its `mail`, `rooms` and `answers`
outboxes are posted to `sink.py` (`DHD_HOOKS`), which acknowledges each
row and delivers nothing. The run says how many mails it took, and fails
if that is not one per sign-up. `payments` is left alone: nothing the
move does asks for money.
The cost: nobody gets a new link to withdraw by, and the links in the
mail 0.19 sent stop working at the move. Someone who cannot come tells
the board, who takes them off on the event's page.
## The switch, in order
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.
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.
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
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.
### What does not come across
- **Sign-ins.** Everyone signs in again. Their accounts and groups are in
Rauthy and are not touched.
- **Invites nobody has answered yet** stay valid in Rauthy, but the
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).