README
Deploying showcase
Three stages. Each one works on its own.
- code.danieldaum.net: the container on the server, behind your reverse proxy. Gitea is still public at git.danieldaum.net.
- Gitea on the tailnet: only
gitea_urlchanges. - danieldaum.net/projects: saturn's Pages Function serves showcase's
pages. Clone,
go getanddocker pullstay on code.danieldaum.net.
Release an image
Tagging, building, pushing and pinning a version are in the main README.
1. code.danieldaum.net
On the server, in a folder holding compose.yaml and config.json from
here:
docker compose up -d
docker compose logs -f # the first build mirrors every repo
curl -s 127.0.0.1:8080/healthz # "ok" once the first build is live (503 until then)
- Point your reverse proxy for
code.danieldaum.netat127.0.0.1:8080(plain HTTP; the proxy does TLS). - Optional: put the proxy's address in
trusted_proxies, so logs show visitors' IPs. Behind Cloudflare,CF-Connecting-IPis used. - Gitea must allow anonymous reads (
REQUIRE_SIGNIN_VIEW = false, HTTP git on), or the site is empty and clones fail. images: ["showcase"]lists the image on the packages page and letsdocker pull code.danieldaum.net/daniel/showcase:0.1.0through.
Saturn: apply saturn/saturn.patch (git apply in the saturn repo). It:
- shares the palette with code.danieldaum.net through a
themecookie (theme.js), so both sites show the same one; - adds
social/functions/projects/, which redirects/projects/…to code.danieldaum.net (so/projects/saturn/lands on the saturn repo); - takes
/projects/out of likes and comments (isLikeable). The email worker uses it too, so runmise run social-emailafter deploying.
The old pages in saturn's projects/ are never served after this. Delete
them when you like.
2. Gitea on the tailnet
Set gitea_url to the tailnet address (for example
https://code.aardvark-halibut.ts.net) and restart the container. Mirrors
follow the new address on the next build. Nothing else changes: Gitea's
address never reaches a page.
The container has to reach that address, and *.ts.net names often don't
resolve inside Docker. In order of preference:
- Gitea on the same host: put both on one Docker network and use
http://gitea:3000. No tailnet hop. - A Tailscale sidecar container, sharing its network
(
network_mode: service:tailscale). - The Gitea machine's 100.x tailnet IP. Only plain HTTP works this way, since the HTTPS certificate is for the name.
Check from the server:
docker compose exec showcase wget -qO- <gitea_url>/api/v1/version.
Once Gitea is internal, the server pulls the image from the tailnet name
(code.aardvark-halibut.ts.net/daniel/showcase), or from showcase itself
(code.danieldaum.net/daniel/showcase).
3. danieldaum.net/projects
- In
config.json, add"base_path": "/projects"and restart. Pages move tocode.danieldaum.net/projects/…, and old addresses redirect there. Clone,go get,docker pulland/healthzstay at the root. - In saturn's
social/functions/projects/[[path]].js, setMODE = "proxy"and deploy. danieldaum.net/projects now serves showcase.
Check: curl -sI https://danieldaum.net/projects/ (200, showcase's
Content-Security-Policy), and git clone https://code.danieldaum.net/<repo>.git.
Each page view is a Functions request (100k a day on the free plan). Waiting on code.danieldaum.net doesn't count toward the CPU limit.