Author SHA1 Message Date
blandClaude Fable 5.1 6d5e936f18 kron keeps an identity, and the Vipps keys may be given on the desk
A volume for kron's age identity (KRON_IDENTITY_FILE), KRON_LANG, and
kron.env written with only the VIPPS_* the deploy holds: none, and kron
asks for them through portal, sealed to that identity.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-11 22:41:19 +01:00
bl 48f286650b Merge pull request 'deploy-tomtervel: kron.env is one of the optional env files' (#14) from deploy-kron-env into main
deploy / deploy (push) Failing after 2s
Reviewed-on: #14
2026-11-10 22:31:01 +01:00
blandClaude Fable 5.1 99852cdce6 deploy-tomtervel: kron.env is one of the optional env files
The first deploy with the pay profile failed: compose wanted kron.env
in the checkout and the host script only moves the files it knows.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-10 22:27:40 +01:00
bl 3d7da36401 Merge pull request 'deploy: check out the repo, so its scripts are there' (#12) from deploy-checkout into main
deploy / deploy (push) Successful in 11s
Reviewed-on: #12
2026-11-10 22:07:49 +01:00
bl bd37ae5786 Merge pull request 'kron in the stack, auto_link for Vipps Login, and the vel's colours in Rauthy' (#13) from kron-pay into main
deploy / deploy (push) Failing after 1m39s
dns / dns (push) Successful in 4s
Reviewed-on: #13
2026-11-10 22:07:40 +01:00
blandClaude Fable 5.1 459f780049 deploy: check out the repo, so its scripts are there
The deploy of #10 failed at the Rauthy providers step with
"./rauthy-providers.sh: No such file or directory": the job wrote env
files and ran the host script, but never had the repo itself.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-10 22:05:03 +01:00
4 changed files with 49 additions and 18 deletions

No files matched your search

+19 -11
View File
@@ -80,15 +80,22 @@ jobs:
RAUTHY_API_KEY: ${{ secrets.RAUTHY_API_KEY }} RAUTHY_API_KEY: ${{ secrets.RAUTHY_API_KEY }}
RAUTHY_LANGUAGE: ${{ vars.RAUTHY_LANGUAGE }} RAUTHY_LANGUAGE: ${{ vars.RAUTHY_LANGUAGE }}
# The money service (README.md, "Payments"): Vipps's keys for the # The money service (README.md, "Payments"): Vipps's keys for the
# Medlemskap sales unit, read by kron alone. All five are needed # Medlemskap sales unit, read by kron alone. Unset, kron starts
# once COMPOSE_PROFILES has `pay`; VIPPS_WEBHOOK_SECRET may wait, # without them and asks for them on the treasurer's desk
# kron then settles by asking Vipps every minute instead. # ("Tjenester som venter"), sealed to its own identity; set, they
# are kron's from the env. VIPPS_WEBHOOK_SECRET may wait, kron
# then settles by asking Vipps every minute instead.
VIPPS_MSN: ${{ vars.VIPPS_MSN }} VIPPS_MSN: ${{ vars.VIPPS_MSN }}
VIPPS_CLIENT_ID: ${{ secrets.VIPPS_CLIENT_ID }} VIPPS_CLIENT_ID: ${{ secrets.VIPPS_CLIENT_ID }}
VIPPS_CLIENT_SECRET: ${{ secrets.VIPPS_CLIENT_SECRET }} VIPPS_CLIENT_SECRET: ${{ secrets.VIPPS_CLIENT_SECRET }}
VIPPS_SUBSCRIPTION_KEY: ${{ secrets.VIPPS_SUBSCRIPTION_KEY }} VIPPS_SUBSCRIPTION_KEY: ${{ secrets.VIPPS_SUBSCRIPTION_KEY }}
VIPPS_WEBHOOK_SECRET: ${{ secrets.VIPPS_WEBHOOK_SECRET }} VIPPS_WEBHOOK_SECRET: ${{ secrets.VIPPS_WEBHOOK_SECRET }}
steps: steps:
# The repo's own scripts (rauthy-providers.sh) run from the
# checkout; the stack itself is pulled on the host by
# deploy-tomtervel, not from here.
- uses: actions/checkout@v4
# A missing value stops here, by name, before anything on the host # A missing value stops here, by name, before anything on the host
# is touched. Only names are printed: the log is public. # is touched. Only names are printed: the log is public.
- name: Write the env files - name: Write the env files
@@ -170,15 +177,16 @@ jobs:
OAUTH2_CLIENT_ID=$CHAT_OAUTH2_CLIENT_ID OAUTH2_CLIENT_ID=$CHAT_OAUTH2_CLIENT_ID
OAUTH2_CLIENT_SECRET=$CHAT_OAUTH2_CLIENT_SECRET OAUTH2_CLIENT_SECRET=$CHAT_OAUTH2_CLIENT_SECRET
EOF EOF
# kron: Vipps's keys for the Medlemskap sales unit. Written even # kron: Vipps's keys for the Medlemskap sales unit, when the
# deploy holds them; none set, and kron asks for them through
# portal (kron refuses some set and some not). Written even
# without the profile, so the file compose names is there. # without the profile, so the file compose names is there.
cat > "$STAGE/kron.env" <<EOF {
VIPPS_MSN=$VIPPS_MSN echo "WEBHOOK_SECRET=$VIPPS_WEBHOOK_SECRET"
VIPPS_CLIENT_ID=$VIPPS_CLIENT_ID for name in VIPPS_MSN VIPPS_CLIENT_ID VIPPS_CLIENT_SECRET VIPPS_SUBSCRIPTION_KEY; do
VIPPS_CLIENT_SECRET=$VIPPS_CLIENT_SECRET if [ -n "${!name}" ]; then echo "$name=${!name}"; fi
VIPPS_SUBSCRIPTION_KEY=$VIPPS_SUBSCRIPTION_KEY done
WEBHOOK_SECRET=$VIPPS_WEBHOOK_SECRET } > "$STAGE/kron.env"
EOF
# Rauthy's secrets. The first admin is the vel's first person. # Rauthy's secrets. The first admin is the vel's first person.
cat > "$STAGE/rauthy.env" <<EOF cat > "$STAGE/rauthy.env" <<EOF
ENC_KEYS=$RAUTHY_ENC_KEY ENC_KEYS=$RAUTHY_ENC_KEY
+18 -5
View File
@@ -126,7 +126,7 @@ Run workflow**. Set them with `gt` (`gt variable set NAME --body ...`,
| `VIPPS_LOGIN_CLIENT_ID`, `VIPPS_LOGIN_CLIENT_SECRET` | variable, secret | repo | Vipps Login (the login sales unit's keys from portal.vippsmobilepay.no): the deploy keeps Vipps as a sign-in provider in Rauthy with them (`rauthy-providers.sh`) | | `VIPPS_LOGIN_CLIENT_ID`, `VIPPS_LOGIN_CLIENT_SECRET` | variable, secret | repo | Vipps Login (the login sales unit's keys from portal.vippsmobilepay.no): the deploy keeps Vipps as a sign-in provider in Rauthy with them (`rauthy-providers.sh`) |
| `PAY_HOST` | variable | repo | where the money service answers: `betaling.tomtervel.no` (DNS in `dns/`, a kasse Caddy block) | | `PAY_HOST` | variable | repo | where the money service answers: `betaling.tomtervel.no` (DNS in `dns/`, a kasse Caddy block) |
| `VIPPS_MSN` | variable | repo | the Medlemskap sales unit's merchant serial number, `1192072` | | `VIPPS_MSN` | variable | repo | the Medlemskap sales unit's merchant serial number, `1192072` |
| `VIPPS_CLIENT_ID`, `VIPPS_CLIENT_SECRET`, `VIPPS_SUBSCRIPTION_KEY` | secret | repo | the Medlemskap sales unit's ePayment keys (For developers, API keys, production), read by kron alone | | `VIPPS_CLIENT_ID`, `VIPPS_CLIENT_SECRET`, `VIPPS_SUBSCRIPTION_KEY` | secret | repo | optional: the Medlemskap sales unit's ePayment keys (For developers, API keys, production), read by kron alone. Unset (with `VIPPS_MSN` unset too), kron asks for them on the treasurer's desk instead |
| `VIPPS_WEBHOOK_SECRET` | secret | repo | what Vipps signs its webhooks with, from `vipps-webhook.sh register`; unset, kron refuses webhooks and asks Vipps about each open payment every minute instead | | `VIPPS_WEBHOOK_SECRET` | secret | repo | what Vipps signs its webhooks with, from `vipps-webhook.sh register`; unset, kron refuses webhooks and asks Vipps about each open payment every minute instead |
A variable is printed wherever a workflow echoes it, and this repo's run A variable is printed wherever a workflow echoes it, and this repo's run
@@ -157,15 +157,28 @@ the Medlemskap sales unit and sends the person into Vipps, and a fresh
one each time the last ran out (Vipps's own expire after ten minutes). one each time the last ran out (Vipps's own expire after ten minutes).
Once they have paid, kron captures the reserved amount and says `paid` Once they have paid, kron captures the reserved amount and says `paid`
on the bus; portal moves the household to `betalt`, grants `medlemmer`, on the bus; portal moves the household to `betalt`, grants `medlemmer`,
and mails them. Vipps's keys live in `kron.env` and nowhere else; portal and mails them. Vipps's keys live in `kron.env`, or, from kron 0.2, are
never calls Vipps. `PAY_URL` in `portal.env` is what lets the content given once on the treasurer's desk: started without them, kron asks on
the bus and portal shows the ask under "Tjenester som venter" to the
`kasserer` group (a passkey sign-in); the secret fields are sealed to
kron's own identity (`kron_data` volume, `KRON_IDENTITY_FILE`) before
anything else sees them, kron tries them against Vipps and keeps them
sealed in its own bucket. Portal never holds a value and never calls
Vipps. The identity volume is never copied or backed up with the data:
a lost host means giving the keys again, which is a form. `PAY_URL` in `portal.env` is what lets the content
leave `by_hand: true` out of a `payment:`; portal never calls that leave `by_hand: true` out of a `payment:`; portal never calls that
address either. address either.
Going live, in order: Going live, in order:
1. Set `PAY_HOST`, `VIPPS_MSN` and the three key secrets (table above). 1. Set `PAY_HOST`. The keys: either `VIPPS_MSN` and the three key
The keys are in `pass` as `tomtervel/vipps/medlemskap`. secrets (table above; in `pass` as `tomtervel/vipps/medlemskap`), or
none of them, and the treasurer gives them on their desk once kron
is up (step 3). The host
script must know `kron.env` (this repo's `deploy-tomtervel`, optional
files): on kasse, `sudo install -m 0755 -o root -g root
/srv/tomtervel/infrastructure/deploy-tomtervel /usr/local/bin/deploy-tomtervel`
after the pull, since the installed copy does not update itself.
2. Merge the DNS record (`dns/dnsconfig.js`, `betaling`) and run the DNS 2. Merge the DNS record (`dns/dnsconfig.js`, `betaling`) and run the DNS
workflow; add the `betaling.tomtervel.no` block from workflow; add the `betaling.tomtervel.no` block from
`host-caddy/tomtervel.no` to kasse's Caddy. `host-caddy/tomtervel.no` to kasse's Caddy.
+9
View File
@@ -166,6 +166,14 @@ services:
VIPPS_ENV: prod VIPPS_ENV: prod
PUBLIC_URL: https://${PAY_HOST:-no-host-set} PUBLIC_URL: https://${PAY_HOST:-no-host-set}
LISTEN_ADDR: 0.0.0.0:3000 LISTEN_ADDR: 0.0.0.0:3000
# kron's own identity, made on first start: what the Vipps keys
# given through portal (the treasurer's "Tjenester som venter")
# are sealed to. On its own volume, never copied anywhere. With
# no VIPPS_* in kron.env, kron waits to be given them.
KRON_IDENTITY_FILE: /var/lib/kron/identity
KRON_LANG: nb
volumes:
- kron_data:/var/lib/kron
ports: ports:
- "127.0.0.1:3080:3000" - "127.0.0.1:3080:3000"
depends_on: depends_on:
@@ -218,6 +226,7 @@ services:
volumes: volumes:
garage_data: garage_data:
kron_data:
caddy_data: caddy_data:
caddy_config: caddy_config:
nats_data: nats_data:
+3 -2
View File
@@ -18,8 +18,9 @@ set -euo pipefail
root=/srv/tomtervel/infrastructure root=/srv/tomtervel/infrastructure
stage=/var/lib/gitea-runner/tomtervel-env stage=/var/lib/gitea-runner/tomtervel-env
files=(.env portal.env nats.env chat.env) files=(.env portal.env nats.env chat.env)
# Written only when the site runs what needs it (Rauthy). # Written only when the site runs what needs it (Rauthy, the money
optional=(rauthy.env) # service under the pay profile).
optional=(rauthy.env kron.env)
[ -d "$root/.git" ] || { echo "no checkout at $root - bootstrap it first" >&2; exit 1; } [ -d "$root/.git" ] || { echo "no checkout at $root - bootstrap it first" >&2; exit 1; }
for f in "${files[@]}"; do for f in "${files[@]}"; do