Commit graph

6 commits

Author SHA1 Message Date
Laurence Horrocks-Barlow
5c2da48c64 feat(gui): group menu under a shared 'Backups' category with a per-plugin icon
Move the admin and site menu entries into a shared 'Backups' sidebar category
(created idempotently by each sibling plugin) with a distinct icon per engine,
instead of a top-level link. Each plugin tags its category+link lines with an
apiscp-borg marker so its uninstaller removes only its own, leaving the shared
category for any other backup plugin still installed.
2026-07-26 05:15:15 +01:00
Laurence Horrocks-Barlow
b9e8694c61 fix(engine)+docs: env overrides config for targeted runs; add full REFERENCE.md
- Engine: same targeted-run fix as apiscp-kopia (env BACKUP_SITES/SYSTEM/PATHS/
  DATABASES now override the sourced config, so `run --site` scopes correctly
  instead of backing up every site).
- docs/REFERENCE.md: exhaustive reference (every command, verb, config key,
  installer, automation, both GUIs, security model, recovery), plus a README
  Documentation section.
2026-07-24 23:38:08 +01:00
Laurence Horrocks-Barlow
02403b72c0 feat(borg): Layer 2 panel integration (module + two GUIs + hooks + installers)
Native ApisCP integration, adapted from apiscp-kopia's Layer 2 against the real
borg Layer 1 subcommands:
- Borg_Module_Surrogate: admin + PRIVILEGE_SITE verbs, sudo boundary, config
  whitelist (now enforced), site-owner verbs derive the site from the auth
  context only, ownsDatabase gate, confirm-guarded destructive import.
- Admin GUI (apps/borg, "Borg Backups"): repository (BORG_REPO/passphrase/
  encryption/RSH, check-access, init, one-time recovery-key panel + download +
  irrecoverable tick), backup selection, retention + excludes + prune-now,
  schedule, maintenance (compact) + verify (check), notifications, tabbed layout,
  running overlay, double-submit guard, consolidated Restore workflow.
- Site-owner GUI (apps/myborgbackups, "My Borg Backups"): restore files / whole
  account / databases, run own backup, scoped to the caller's own site.
- Account hooks, install-layer2.sh, uninstall.sh (safe default, --purge).

Borg differences vs kopia are handled: no backend types/sftp/server, no browse/
subpath or point-in-time (restores newest archive; archive dates shown for info),
retention via config + `borg prune` (no global policy), import-db takes no
dumpfile. All PHP lints clean; controller verb calls all resolve to the module.
2026-07-24 23:18:35 +01:00
Laurence Horrocks-Barlow
3ce5bf1a47 feat(borg): repository and restore tools (Layer 1 complete)
- borg-apiscp-repo: status/init/check-access/gen-passphrase/key-status/
  backup-key/key-bundle/config-get/set/sites/run/running/prune/maintenance
  (borg compact)/verify (borg check [--data])/set-schedule/notify-test/
  list-databases. Config whitelist + single-quote escaping + newline guard,
  mirroring apiscp-kopia's security boundary.
- borg-apiscp-restore: list/list-json/site (+ --subpath)/account/system/
  restore-db/import-db and site-owner variants (owner-files/-account/
  -restore-db/-import-db) that land under /.borg-restore chowned to the owner.
  All restores are `borg extract` with computed --strip-components to rebase
  archived paths under a staging target; ACLs/xattrs come back natively.
2026-07-24 22:49:24 +01:00
Laurence Horrocks-Barlow
9b741e9dec chore: enforce LF line endings via .gitattributes 2026-07-24 22:33:56 +01:00
Laurence Horrocks-Barlow
2f0d93a0ae Initial scaffold: Borg engine + docs (Layer 1 milestone)
apiscp-borg is a sibling of apiscp-kopia built on BorgBackup. This first
milestone lands the project scaffold and the Layer 1 engine:
- borg-apiscp-backup: per-site named archives (siteN-shadow/info/db), fresh
  per-site DB dumps via ApisCP site-context export, system + custom archives,
  borg prune retention per prefix, Prometheus metrics, email notifications.
- apiscp-borg-common.sh: logging, mail, site/owner helpers.
- config example, systemd service+timer, install.sh, README, DESIGN.

Borg preserves POSIX ACLs and xattrs natively, so (unlike the kopia engine) no
metadata sidecar is required; DESIGN.md records how Borg reshapes the design.
Repository/restore tools, Layer 2 panel integration, hooks, uninstall, and the
full reference are the next milestones.
2026-07-24 22:33:37 +01:00