Compare commits

...
4 Commits
Author SHA1 Message Date
blandClaude 4fc2966b89 An access log for tomtervel.no on kasse's Caddy
The portal's own log says nothing of a request that was slow or never
answered, and the host Caddy kept none for the site. Each request is now
written with its duration and status, rolled at 20 MiB and kept two
weeks.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5fbDjRr9xfrtcDzcdJNr2
2026-11-25 14:11:00 +01:00
bl e7c6ac6124 Merge pull request 'gdo from the registry again: 0.4.0 is published' (#20) from gdo-0-4 into main
deploy / deploy (push) Successful in 58s
2026-11-24 19:13:14 +01:00
blandClaude eab1f55cf7 gdo from the registry again: 0.4.0 is published
The stack built gdo from a commit while the gdo that dials a 1.0 site
was held back from the [uhhm] registry. It is there now, so the image
installs the package as before and the deploy no longer compiles gdo.
The build checks that the installed version is the one GDO_RELEASE
names.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5fbDjTQg4CJsNqEo7hhE7
2026-11-24 19:13:04 +01:00
bl 3763271852 Merge pull request 'The stack for portal 1.0 (merging this is the switch)' (#19) from stack-1-0 into main
deploy / deploy (push) Successful in 13m51s
2026-11-24 18:30:59 +01:00
3 changed files with 47 additions and 31 deletions

No files matched your search

+1 -1
View File
@@ -128,7 +128,7 @@ Run workflow**. Set them with `gt` (`gt variable set NAME --body ...`,
|---|---|---|---| |---|---|---|---|
| `PORTAL_HOST`, `RAUTHY_HOST` | variable | repo | the site, the login; each needs DNS (`dns/`) and a kasse Caddy block | | `PORTAL_HOST`, `RAUTHY_HOST` | variable | repo | the site, the login; each needs DNS (`dns/`) and a kasse Caddy block |
| `PORTAL_RELEASE` | variable | **org** | a uhhm/portal tag; the content repo's lint reads the same one | | `PORTAL_RELEASE` | variable | **org** | a uhhm/portal tag; the content repo's lint reads the same one |
| `GDO_RELEASE`, `KRON_RELEASE` | variable | repo | the mailer, a tag or a commit of uhhm/gdo that the image is built from (`gdo/Dockerfile` says why), and the money service's image tag (`0.3.0` and on): the ones that dial a 1.0 site | | `GDO_RELEASE`, `KRON_RELEASE` | variable | repo | the mailer's version as the [uhhm] registry has it (`v0.4.0` and on; the build fails when the registry's is another), and the money service's image tag (`0.3.0` and on): the ones that dial a 1.0 site |
| `COMPOSE_PROFILES` | variable | repo | `pay` | | `COMPOSE_PROFILES` | variable | repo | `pay` |
| `DHD_KEYS`, `PORTAL_DHD` | variable | repo | the programs' keys and what each may do, and the site's key and address ([The site's own network](#the-sites-own-network)) | | `DHD_KEYS`, `PORTAL_DHD` | variable | repo | the programs' keys and what each may do, and the site's key and address ([The site's own network](#the-sites-own-network)) |
| `PORTAL_BACKUP_TO`, `GARAGE_BACKUPS_BUCKET` | variable | repo | optional: an age public key and a bucket, for sealed copies of the store ([Backups](#backups)) | | `PORTAL_BACKUP_TO`, `GARAGE_BACKUPS_BUCKET` | variable | repo | optional: an age public key and a bucket, for sealed copies of the store ([Backups](#backups)) |
+34 -30
View File
@@ -1,37 +1,41 @@
# gdo, the mailer, built from uhhm/gdo at GDO_RELEASE: a tag, or a commit. # gdo, the mailer, from the [uhhm] Arch registry - the same package the
# bare-metal hosts install. Arch base rather than Debian because that is
# how every uhhm binary is published; portal ships a release tarball and
# is built from that instead.
# #
# Built here rather than installed from the [uhhm] Arch registry, as it # GDO_RELEASE is the version the site runs (v0.4.0 or later: 0.4 is the
# was while the site ran portal 0.19: the gdo that dials a portal 1.0 # first that dials a portal 1.0 site). The registry serves one version,
# site (0.4, which reads no NATS) is not in the registry yet, and is # its newest, so the build checks that what it installed is the one
# held back from it on purpose. A host that upgraded to it while it # named, and fails when the variable has fallen behind the registry.
# still has a 0.x site would stop sending that site's mail. Once 0.4 is
# published, this can install the package again (uhhm-registry.asc
# beside this file is the registry's key, kept for then).
#
# Arch for both stages, because that is what every uhhm binary is built
# on and run on: the runtime's glibc is then never older than the
# builder's.
FROM archlinux:base AS build
ARG GDO_RELEASE
# -Syu, never -Sy: a partial upgrade pulls a library newer than what the
# base image's own pacman was built against and refuses to install.
RUN pacman -Syu --noconfirm --needed git rust gcc \
&& pacman -Scc --noconfirm
WORKDIR /src
# The ref by name, so a tag and a commit both do; --locked, so the build
# is the one the repo's own lock file describes.
RUN test -n "$GDO_RELEASE" \
&& git init -q . \
&& git fetch -q --depth 1 https://project.uhhm.no/uhhm/gdo.git "$GDO_RELEASE" \
&& git checkout -q FETCH_HEAD \
&& cargo build --release --locked \
&& install -Dm755 target/release/gdo /out/gdo
FROM archlinux:base FROM archlinux:base
RUN pacman -Syu --noconfirm --needed ca-certificates \ ARG GDO_RELEASE
# The registry's signing key, vendored beside this file. A fresh
# container trusts nothing, and the key is on no public keyserver, so
# `pacman-key --recv-keys` cannot find it - which is why this is here
# rather than fetched. It is a public key: checked in, not a secret.
#
# Vendored rather than turning the signature check off: the packages
# come over HTTPS from a host we run, and it would be easy to call that
# good enough, but then nothing would notice a package that host did
# not sign. Locally signed, the check stays real.
COPY uhhm-registry.asc /tmp/uhhm-registry.asc
RUN test -n "$GDO_RELEASE" \
&& pacman-key --init \
&& pacman-key --populate archlinux \
&& pacman-key --add /tmp/uhhm-registry.asc \
&& pacman-key --lsign-key 1BCBE90F04AD9859D7BCC9BB53CBF90AA4C56211 \
&& rm /tmp/uhhm-registry.asc \
&& printf '%s\n' \
'[uhhm]' \
'SigLevel = Required DatabaseOptional' \
'Server = https://project.uhhm.no/api/packages/bl/arch/$repo/$arch' \
>> /etc/pacman.conf \
&& pacman -Syu --noconfirm --needed ca-certificates gdo \
&& have=$(pacman -Q gdo | cut -d' ' -f2 | cut -d- -f1) \
&& { [ "$have" = "${GDO_RELEASE#v}" ] || { echo "the registry has gdo $have, GDO_RELEASE says $GDO_RELEASE" >&2; exit 1; }; } \
&& pacman -Scc --noconfirm \ && pacman -Scc --noconfirm \
&& rm -rf /var/cache/pacman/pkg/* /var/lib/pacman/sync/* && rm -rf /var/cache/pacman/pkg/* /var/lib/pacman/sync/*
COPY --from=build /out/gdo /usr/bin/gdo
# A non-root user. gdo keeps its key on dhd/1 in /var/lib/gdo, a volume # A non-root user. gdo keeps its key on dhd/1 in /var/lib/gdo, a volume
# (GDO_KEY in compose.yml); what it has not yet delivered waits with the # (GDO_KEY in compose.yml); what it has not yet delivered waits with the
+12
View File
@@ -6,6 +6,18 @@
tomtervel.no { tomtervel.no {
reverse_proxy 127.0.0.1:3050 reverse_proxy 127.0.0.1:3050
# Every request, with how long it took and what it was answered:
# what to read when the site was slow or a page said it could not
# reach the server. Addresses and what was asked for are in it, so
# it is kept two weeks and no longer. Caddy runs as `caddy`:
# `sudo install -d -o caddy -g caddy /var/log/caddy` once.
log {
output file /var/log/caddy/tomtervel.no.log {
roll_size 20MiB
roll_keep 5
roll_keep_for 336h
}
}
} }
www.tomtervel.no { www.tomtervel.no {