Commit Graph

17 Commits

Author SHA1 Message Date
Piers Cockram
46c6e5a9c3 breakglass-sync: per-owner soft budget (OWNER_BUDGET_SEC, default 2h)
Once an owner consumes more than OWNER_BUDGET_SEC seconds, the script
stops starting new repos for that owner and moves on to the next.
The in-flight repo finishes naturally — we never kill mid-push.
ONLY_REPO mode bypasses the budget (single-repo runs are intentional).

Surfaced via a new OWNERS_DEFERRED counter in the summary line + an
OWNER_BUDGET_EXCEEDED audit event per owner.

Originally added after signalapp was starved by openclaw repeatedly
consuming the whole window. With 12 owners and a 16h sync timeout,
2h/owner gives ample headroom while preventing any single owner from
monopolising the run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 12:57:01 +10:00
mineracks
100c4cacfe Auto-trust repo paths to prevent dubious ownership errors 2026-04-07 22:03:12 +10:00
mineracks
6532898cbb Embed gitea creds in remote URL for both http and https GITEA_URL 2026-04-07 15:15:03 +10:00
mineracks
4f805447ef ONLY_REPO: synthesize owner if missing from sources.yml 2026-04-07 15:06:19 +10:00
mineracks
9075fb1a8b Add ONLY_REPO filter for targeted single-repo sync 2026-04-07 15:00:57 +10:00
mineracks
2f97e9097a fix: prevent credential prompts hanging sync, fix LFS pushing to wrong host, add REVERSE_SYNC_ONLY mode 2026-04-06 19:24:58 +10:00
mineracks
a0e1dec091 feat: add reverse sync (Gitea → GitHub) for public backup 2026-04-06 18:03:44 +10:00
mineracks
8f1add8346 feat: add repo metadata sync, wiki/release mirroring, disk alerts, and updated README 2026-04-03 00:02:55 +10:00
mineracks
f6b3bde95d fix: wiki push needs credential helper for localhost Gitea 2026-04-02 15:18:34 +10:00
mineracks
2b99fb8bb4 feat: wiki mirroring + release asset downloads
- Wiki: clones {repo}.wiki.git, pushes to Gitea (renders natively)
- Releases: downloads latest N releases per repo (RELEASE_KEEP=3)
  including all binary assets + source archives (tar.gz, zip)
- Release metadata (name, prerelease flag) preserved
- Assets uploaded to matching Gitea releases via API
- Both features toggleable via SYNC_WIKIS and SYNC_RELEASES env vars
- Skips repos with no wiki/releases silently
2026-04-02 15:12:02 +10:00
mineracks
a2bfbcdfaa fix: time-box LFS to 10min/repo, prevent buildroot blocking seedhammer
seedsigner/buildroot LFS push was taking hours, hitting the systemd
timeout, causing restart loop that never reached seedhammer.

- LFS fetch/push now wrapped in timeout (LFS_TIMEOUT=600s default)
- Systemd timeout raised to 8h for safety
- Git refs always push first (the critical data), LFS is best-effort
2026-04-01 14:52:10 +10:00
mineracks
eec3f54983 feat: add disk space monitoring to healthcheck (warn 80%, critical 90%) 2026-03-31 13:08:36 +10:00
mineracks
a1d28e0d8c feat: autopilot systemd timers + ntfy push notifications
- Sync timer: daily at 02:00 AEST + on boot
- Healthcheck timer: daily at 08:00 AEST
- Service timeout raised to 4h for large repos
- Restart on failure with 5 min backoff
- ntfy.sh push notifications with priority levels:
  - urgent: wipe detection (red alert)
  - high: sync errors
  - low: successful sync summary
  - healthcheck results with stethoscope tag
- All notifications work via free ntfy.sh (no SMTP needed)
2026-03-31 12:58:57 +10:00
mineracks
7582391e3f fix: set -e killing script at new orgs + correct avatar API endpoint
- gitea_api GET returning 404 for new orgs/repos caused set -e to
  kill the script before error handling could run. Added || true.
- Avatar upload was using wrong endpoint (PATCH /orgs/{org} with
  avatar_base64). Corrected to POST /orgs/{org}/avatar with image
  field containing raw base64, per Gitea 1.22 API.
2026-03-31 09:37:29 +10:00
mineracks
97456f00a7 fix: arithmetic increment exits script when counter is 0
(( SYNCED++ )) returns exit code 1 when SYNCED=0, because the
post-increment evaluates to 0 which is falsy in arithmetic context.
With set -euo pipefail this kills the script after the first repo.

Also disable LFS lock verification (one-way mirror doesn't need it)
to suppress noisy stderr messages.
2026-03-30 22:59:38 +10:00
mineracks
87e7979927 Fix Gitea API calls for localhost, add org/repo avatar sync 2026-03-30 21:59:55 +10:00
mineracks
f862776e2a Breakglass FOSS Git Mirror v2 — append-only, tamper-resistant 2026-03-30 21:16:24 +10:00