phase 0: project bootstrap

P0-01 Go module + cmd/server + cmd/agent skeletons + internal/ tree
P0-02 LICENSE (PolyForm NC 1.0.0), README, CONTRIBUTING
P0-03 golangci-lint, pre-commit, .editorconfig, .gitignore
P0-04 Gitea Actions CI: test (race+coverage), lint, cross-platform build matrix
P0-05 Dockerfile.server (multi-stage, distroless/static), docker-compose.yml
P0-06 Makefile with build/test/lint/fmt/run/release targets

build, vet, test, and cross-compile to linux/{amd64,arm64} + windows/amd64
all verified locally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-01 00:03:59 +01:00
parent ab02869d82
commit 25aa001135
26 changed files with 641 additions and 6 deletions
+3
View File
@@ -0,0 +1,3 @@
// Package runner spawns restic processes, parses their --json output
// stream, and forwards events to the server over WebSocket.
package runner
+4
View File
@@ -0,0 +1,4 @@
// Package scheduler runs the agent's local cron loop. The server is the
// source of truth for schedules; this package reconciles to whatever
// the server most recently pushed.
package scheduler
+3
View File
@@ -0,0 +1,3 @@
// Package service wires the agent into the host's service manager
// (systemd on Linux, the Service Control Manager on Windows).
package service
+4
View File
@@ -0,0 +1,4 @@
// Package api defines shared types for the control-plane API:
// REST request/response shapes (server ↔ browser) and WebSocket
// message envelopes (server ↔ agent). See spec.md §6.
package api
+3
View File
@@ -0,0 +1,3 @@
// Package auth handles password hashing (argon2id), session cookies,
// CSRF tokens, and bearer-token verification for agents.
package auth
+3
View File
@@ -0,0 +1,3 @@
// Package crypto wraps AEAD encryption used to protect repo passwords,
// REST-server credentials, and pre/post hook bodies at rest.
package crypto
+3
View File
@@ -0,0 +1,3 @@
// Package restic wraps the restic CLI: locating the binary, invoking
// it with --json, and parsing the streamed event payloads.
package restic
+2
View File
@@ -0,0 +1,2 @@
// Package http hosts the chi-based REST handlers for the control plane.
package http
+3
View File
@@ -0,0 +1,3 @@
// Package ui renders the HTMX/Tailwind frontend from server-side
// html/templates.
package ui
+3
View File
@@ -0,0 +1,3 @@
// Package ws hosts the WebSocket transport for agent ↔ server and the
// browser-facing live job log stream.
package ws
+3
View File
@@ -0,0 +1,3 @@
// Package store is the SQLite persistence layer
// (modernc.org/sqlite, no CGo).
package store