levineuwirth.org/systemd
Levi Neuwirth 5711aafa78
infra: forgejo sync tooling and a nightly backup timer
Two problems this session surfaced on the Forgejo box, both now addressed
in tracked source rather than in shell history.

forgejo-sync.sh pushes the local repositories to git.levineuwirth.org over
HTTPS. It exists because the only Forgejo remote anywhere used
ssh://…:2222, which is filtered on most public networks, so eight of nine
repos had drifted three to four months behind while the CV cited them as
canonical. Dry-run by default, never force-pushes, never touches `origin`,
creates new repos private, and refuses to push when the remote holds
commits the local machine does not — the check that caught `levshell`,
where Forgejo's copy turned out to be the abandoned prototype rather than
an older version of the current project.

The divergence check authenticates via GIT_ASKPASS. An earlier version ran
ls-remote unauthenticated, which fails silently on private repositories and
returned empty — indistinguishable from "remote has nothing we lack", i.e.
a false all-clear on exactly the repos where the check matters. A failed
listing now blocks instead of passing.

forgejo-backup.sh plus its timer close the other gap: there were no backups
at all, of an instance holding nine repositories, four of them cited by URL
in a CV PDF already in circulation. Nightly, no downtime, SQLite `.backup`
for a consistent snapshot rather than cp, integrity-checked before it is
trusted, archive verified readable before retention prunes anything, and 14
days kept. Aborts non-zero on any of those checks so a bad run surfaces as
a failed unit instead of a corrupt archive displacing a good one.

Both are still local to that box. Copying an archive off-site remains the
open half of the backup story.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SUGesXiMmACsLBTGG1xuEU
2026-08-11 13:37:34 +02:00
..
archive-check.service Archive: close out the audit-pass refinements 2026-06-19 16:23:14 -04:00
archive-check.timer Archive: close out the audit-pass refinements 2026-06-19 16:23:14 -04:00
forgejo-backup.service infra: forgejo sync tooling and a nightly backup timer 2026-08-11 13:37:34 +02:00
forgejo-backup.timer infra: forgejo sync tooling and a nightly backup timer 2026-08-11 13:37:34 +02:00