- 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. |
||
|---|---|---|
| bin | ||
| docs | ||
| etc | ||
| lib | ||
| systemd | ||
| .gitattributes | ||
| .gitignore | ||
| install.sh | ||
| LICENSE | ||
| README.md | ||
apiscp-borg
A BorgBackup backup engine for ApisCP, plus native panel/CLI integration, packaged so it survives ApisCP upgrades. Sibling project to apiscp-kopia: same architecture, different backend.
Why Borg, and why a plugin
Borg is a fast, deduplicating, compressing, encrypted backup tool. Unlike kopia, Borg preserves POSIX ACLs and extended attributes natively, which is exactly the metadata ApisCP encodes account permissions in. So a plugin is not needed to work around lost metadata (the reason apiscp-kopia exists). The value here is:
- runs ApisCP's
backup_dbs.phpbefore archiving, so per-site database dumps are current instead of a day stale; - archives each site as its own named set (
siteN-shadow-...,siteN-db-...), enabling single-site restore and per-site retention; - captures per-site databases through ApisCP's site-context export (a host-level dump cannot see them);
- wires retention (
borg prune), maintenance (borg compact), integrity (borg check), scheduling, email notifications, one-time key backup, and both an appliance-admin and a site-owner GUI into ApisCP.
See docs/DESIGN.md for how Borg changes the design relative to apiscp-kopia.
Architecture
Two decoupled layers, both upgrade-safe:
- Layer 1: the engine. A standalone POSIX-sh program on a systemd timer,
with no coupling to ApisCP's PHP internals.
bin/borg-apiscp-backupplusborg-apiscp-repoandborg-apiscp-restore. - Layer 2: native integration. An ApisCP module, GUI apps, and account hooks
under
/usr/local/apnscp/config/custom, which surviveupcp.
Requirements
- ApisCP (any recent release)
borgbackup(borg) 1.2+ on the host (and on the remote for ssh backends)- a filesystem that carries ACLs and xattrs (default on ext4/xfs/btrfs)
Status
Early scaffold. The Layer 1 engine is the first milestone; the repository and restore tools, Layer 2 panel integration (module + two GUIs + hooks), install / uninstall, and full reference documentation are being built out to track the apiscp-kopia feature set. Not yet ready for production use.
License
MIT. See LICENSE.