Skip to content

backups - configuration snapshots ingest and management #83

@edospadoni

Description

@edospadoni

Overview

Implement the Configuration Backup subsystem alongside the existing heartbeat and inventory paths: ingest on collect, managed reads on backend, S3-compatible object storage, retention + GDPR purge, security hardening, legacy-client transition via the nethinfra proxy, and the admin UI.

Requirements

Core features

  • End-to-end GPG ciphertext round-trip through collect / S3 / backend.
  • Per-system retention: default 10 backups / 500 MB, optional per-org aggregate cap.
  • RBAC cascade: Owner → Distributor → Reseller → Customer.
  • GDPR Article 17 purge on DestroySystem.

collect (ingest + appliance-facing read)

  • POST /api/systems/backups — streaming upload with SHA-256 tee, metadata sanitised, inline retention under Redis lock, per-system rate limit.
  • GET /api/systems/backups — list for the authenticated system (paginated internally — never truncated at S3's 1000-item cap).
  • GET /api/systems/backups/:id — download for the authenticated system.
  • Cross-service auth invalidation bus on Redis pub/sub so backend-side secret rotation propagates to collect within ~30 s.

backend (UI-facing read + GDPR)

  • GET /api/systems/:id/backups with aggregate counters (slots_used, quota_used_bytes).
  • GET /api/systems/:id/backups/:backup_id/download — short-lived presigned URL.
  • DELETE /api/systems/:id/backups/:backup_id.
  • RBAC gated as GET /api/systems/:id.

Storage abstraction

  • Shared storage/s3.go between backend + collect.
  • Works with DigitalOcean Spaces, AWS S3, Cloudflare R2, MinIO, Garage — no hard dependency on a specific provider.
  • Optional split credentials (write-only for collect, read-only for backend).

Frontend

  • Backups tab on the system detail page.
  • Table with kebab menu; Delete marked destructive (red).
  • Retention / quota tiles sourced from the backend payload.
  • Alerts + Backups indicators on the Overview Status card.

Docs

  • User-facing page under docs/systems/backups (EN + IT).
  • collect/README.md, backend/README.md — setup, env vars, bucket layout, split credentials.
  • AGENTS.md — new endpoint family, key layout, naming convention (plural vs singular).

PRs


Design mockup: #82


Remaining work to go live

Blocking

Operational (at production cutover)

  • Configure BACKUP_S3_* env on the Render prod environment (endpoint, region, bucket, access key, secret).
  • Decide the prod bucket (dedicated e.g. my-backups-prod vs. shared with QA).
  • Decide whether to split S3 credentials between collect (write-only) and backend (read-only). Documented as an option in collect/README.md.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions