Phase 8: back up & restore remote (agent) stacks (0.8.0)

- Agent: GET /agent/stacks/{id}/backup + POST /agent/stacks/restore (reuse
  backup_service). backup_service gains backup_basename/backup_filename helpers.
- Main proxy streams agent <-> main <-> destination (creds stay central):
  agent_service download_to_file/upload_file; routers/agents.py backup download,
  backup/push, restore upload, restore-from.
- Schedules: BackupSchedule.agent_id; schedule_service downloads from the agent
  when set; per-host filename prefix isolates retention across hosts.
- Frontend: agents api backup/restore; BackupButton/RestoreButton agent-aware
  (Backup on remote stack detail, Restore per host section); schedule form host
  selector (local or an online agent) + host shown on schedule rows.

Rough-verified (per request): py_compile, frontend tsc build, image imports
(main 99 / agent 16 routes). Full live agent round-trip to be tested post-deploy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
menzeljandClaude Opus 4.8 committed 2026-06-07 22:26:20 +00:00
1 parent 84ef3df59e
commit 5cd55382ed
16 files changed
+561 -59

No files matched your search

+3
View File
@@ -5,6 +5,8 @@ export interface BackupSchedule {
stack_id: string;
destination_id: number;
destination_name: string | null;
agent_id: number | null;
agent_name: string | null;
frequency: "hourly" | "daily" | "weekly";
hour: number;
minute: number;
@@ -22,6 +24,7 @@ export interface BackupSchedule {
export interface ScheduleInput {
stack_id: string;
destination_id: number;
agent_id?: number | null;
frequency: string;
hour: number;
minute: number;