README.md

kukicha infra #

Server operations tools for the kukicha.org infrastructure (Hetzner ARM64).

Tools #

git-mirror (cmd/git-mirror) #

Minimal git smart-HTTP server wrapping git http-backend as CGI. Serves bare repo mirrors over HTTP/1.1 so the Go module proxy and checksum database can fetch modules hosted on Tangled (knot1.tangled.sh serves HTTP/2 which breaks Google's git client).

backup-server (cmd/backup-server) #

Backs up non-recreatable server state to Cloudflare R2 via the stdlib/blob (S3-compatible) package:

  • PostgreSQL database (pg_dump)
  • Valkey data (BGSAVE)
  • Config files (Caddyfile, quadlets, env files, crontab, SSH keys)
  • Git mirror repos (bare clones)

Build #

Both are cross-compiled for ARM64:

# From the kukicha compiler repo (has the stdlib):
cd ~/repos/go/kukicha
GOARCH=arm64 CGO_ENABLED=0 go build -o /tmp/git-mirror ~/repos/kukicha/infra/cmd/git-mirror/
GOARCH=arm64 CGO_ENABLED=0 go build -o /tmp/backup-server ~/repos/kukicha/infra/cmd/backup-server/

Build from the compiler repo so stdlib/blob and other kukicha stdlib packages resolve. The infra repo's go.mod depends on kukicha.org/blob for the backup-server.

Deploy #

scp -i ~/.ssh/hetzner-kibigia /tmp/git-mirror kibigia@xx.xx.xx.xxx:~/git-mirror/git-mirror
scp -i ~/.ssh/hetzner-kibigia /tmp/backup-server kibigia@xx.xx.xx.xxx:~/backup-server