The content repo now runs one preview per branch, for five days after its last push, behind its own router on 127.0.0.1:3066 (tomtervel/questions, .gitea/preview/). This is kasse's side of it: - dns: *.forhandsvisning beside the bare name, both unproxied to kasse. - host-caddy: the bare name and *.forhandsvisning go to 3066 instead of the single preview on 3065. A branch's name gets its certificate on demand, and only after the router says the branch has a preview, so made-up names cannot use up Let's Encrypt's limits. That needs the on_demand_tls ask option in kasse's global Caddyfile, described in the file. Also brings the file back in line with what kasse runs. - README: the Previews section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
3 files changed
+59
-19
No files matched your search
@@ -162,18 +162,32 @@ On a new host:
|
||||
Rauthy's mail leaves through kasse's postfix like gdo's, and Rauthy
|
||||
stops if it cannot reach it.
|
||||
|
||||
## Preview
|
||||
## Previews
|
||||
|
||||
`forhandsvisning.tomtervel.no` shows the content branch last pushed to
|
||||
tomtervel/questions, before it is merged. The content repo's
|
||||
`lint-and-reload` workflow runs it after the lint passes: a container
|
||||
`tomtervel-preview` from this site's own image
|
||||
(`localhost/tomtervel-portal:<PORTAL_RELEASE>`), beside a throwaway NATS
|
||||
(`tomtervel-preview-nats`), on 127.0.0.1:3065. It has no gdo, so nothing
|
||||
mails anyone, and no sign-in, so desks stay shut and the public pages
|
||||
show. A form sent on it lands in the throwaway NATS and nowhere else.
|
||||
The commit gets a "forhåndsvisning" status with the link, which a PR
|
||||
shows among its checks. Main is never previewed: it is the site.
|
||||
Every content branch pushed to tomtervel/questions gets its own preview
|
||||
before it is merged, on `https://<branch>.forhandsvisning.tomtervel.no`,
|
||||
for five days after its last push; `forhandsvisning.tomtervel.no` lists
|
||||
the ones there are. The content repo runs them
|
||||
(`.gitea/preview/preview.sh`, from `lint-and-reload` once the lint
|
||||
passes): a container `tomtervel-preview-<branch>` from this site's own
|
||||
image (`localhost/tomtervel-portal:<PORTAL_RELEASE>`), beside a throwaway
|
||||
NATS (`tomtervel-preview-nats`) where each branch has a `SITE_NAME` of its
|
||||
own, and a small Caddy, `tomtervel-preview-router` on 127.0.0.1:3066, that
|
||||
picks the container by the name asked for. At most five run at once; the
|
||||
one that expires first goes when a sixth arrives. The content repo's
|
||||
`preview-cleanup` workflow removes them when they expire (hourly) and when
|
||||
their branch is deleted.
|
||||
|
||||
A preview has no gdo, so nothing mails anyone, and no sign-in, so desks
|
||||
stay shut and the public pages show. A form sent on it lands in the
|
||||
throwaway NATS and nowhere else. The commit gets a "forhåndsvisning"
|
||||
status with the link, which a PR shows among its checks. Main is never
|
||||
previewed: it is the site.
|
||||
|
||||
On kasse this needs the DNS records in `dns/dnsconfig.js` (the bare name
|
||||
and `*.forhandsvisning`), the two blocks in `host-caddy/tomtervel.no`, and
|
||||
the `on_demand_tls` global option described there, in
|
||||
`/etc/caddy/Caddyfile`.
|
||||
|
||||
## Backups
|
||||
|
||||
|
||||
Reference in new issue
Block a user