Phase 0: project scaffold and build pipeline

Go module (codeberg.org/mix/selfpost), two command skeletons (panel,
selfpost-backup) sharing internal/buildinfo for the -ldflags version stamp,
Makefile (static CGO_ENABLED=0 build), AGPL-3.0 LICENSE, README skeleton and
.gitattributes forcing LF (container scripts must not get CRLF).

Verified on the dev server: go vet clean, make build produces statically
linked binaries, version stamping works.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 14:50:51 +03:00
parent 87388b4209
commit 4e589e1080
10 changed files with 834 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
// Command selfpost-backup produces (and helps restore) the full persistent-state
// archive from inside the container, invoked via `docker exec` for scripted/cron
// backups — the CLI equivalent of the panel's backup button (spec 7.5.A, 11.6).
//
// This is the Phase 0 skeleton: it only reports its version. The actual archive
// logic lands in Phase 9.
package main
import (
"flag"
"fmt"
"codeberg.org/mix/selfpost/internal/buildinfo"
)
func main() {
showVersion := flag.Bool("version", false, "print version and exit")
flag.Parse()
if *showVersion {
fmt.Println(buildinfo.Version)
return
}
fmt.Printf("selfpost-backup %s (skeleton)\n", buildinfo.Version)
}