feat(databases): backup import — upload .tar.gz as a restore point

D5. POST /databases/:id/backups/import accepts a gzipped tar archive
(multipart `file` field or raw application/gzip body, 2 GiB ceiling),
stages it to a temp file, streams it into the backup volume via the
started holder container, and registers a completed backup row — a
first-class restore point that also ships offsite when a target is
assigned. External databases rejected.

Also fixes `containr databases restore` — it never sent database_id,
which the API requires, so every CLI restore failed validation.

CLI: databases import-backup <id> <file|-> (stdin support via new
client.DoRaw). UI: Import button in the backups row. OpenAPI + docs.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomas DvorakandDevin committed 2026-10-08 23:07:27 +02:00
1 parent 109f79268f
commit 15045b8dd3
11 files changed
+409 -10

No files matched your search

+19 -7
View File
@@ -347,13 +347,25 @@ and wired refs, one click or one CLI call.
## 9b. Phase I — Companion surfaces
- [ ] **Phone app** — read-heavy mobile client over the existing API
(PAT auth already works). Scope v1: project/service list, status,
deploy trigger + log tail, restart/stop, notifications push via
existing notification rows (APNs/FCM relay optional, self-hosted
webhook → ntfy/Gotify as zero-infra alternative). React Native or
native-lean PWA; the API surface is already agent-shaped so the app
is a thin client. Design: dark UI, deploy status as first-class view.
- [ ] **Phone app** — fully-featured companion, not a read-only viewer.
The target: a user on the go can see a problem, understand it, and
fix it without a laptop. PAT + profile auth (multi-instance like the
CLI).
- **Dashboard** — project/service status at a glance, deploy
activity, node health, resource usage (cpu/mem from existing
metrics endpoints).
- **Operate** — deploy, redeploy, restart/stop/start, rollback to a
prior deployment, cancel a running deploy, scale replicas.
- **Observe** — live log tail (SSE), deployment step logs, backup
status, cron execution history.
- **Fix** — env var edit + apply-redeploy, domain add/remove,
maintenance-mode toggle, database backup/restore trigger.
- **Notifications** — push via existing notification rows; zero-infra
path = self-hosted ntfy/Gotify relay (no Firebase dependency),
FCM/APNs optional.
- **Stack** — React Native (Expo) thin client over the agent-shaped
API; dark UI mirroring the web design system; deploy status as the
first-class view. Ships with `app/` workspace in this repo.
- [ ] **Status/offline resilience** — app + CLI degrade gracefully when
the instance is unreachable (cached last-known state, clear banner).