Commit Graph

188 Commits

Author SHA1 Message Date
3f3bdf2d45 (feature) Add snapshot discovery action to host view
Add a staff-only POST action on host detail pages to discover existing snapshots
for that host and record them into SQL. Show success or failure feedback through
Django messages, and keep the action non-destructive before adding heavier
backup or retention controls.

Cover the action with view tests for successful discovery, redirect behavior,
and method safety.
2026-05-19 11:56:45 +02:00
b0c6afad09 (feature) Add staff-only Django dashboard views
Add a small template-based UI for inspecting pobsync state through Django. The
dashboard shows host, schedule, snapshot, and backup run summaries, while host
detail pages show config, schedule, recent runs, and discovered snapshots.

Keep the views read-only and staff-protected, document the new dashboard URL,
and cover the routes with focused view tests.
2026-05-19 11:53:32 +02:00
2778a589ea (feature) Add staff-only service status API
Add /api/status/ for quick inspection of database backend, object counts, latest
backup run, and latest scheduler activity. Link it from the API index and reuse
schedule serialization between host summaries and status output.

Cover the endpoint with a focused API test and document the new status URL.
2026-05-19 11:46:22 +02:00
ccd89119da (feature) Add staff-only JSON inspection API
Expose lightweight Django JSON endpoints for hosts, snapshots, and backup runs
using the existing admin/staff authentication boundary. Include filters for
snapshot and run inspection, return resolved snapshot base metadata, and document
the new /api/ entrypoint.

Add endpoint tests for authentication, host summaries, snapshot lineage payloads,
and run filtering.
2026-05-19 11:43:50 +02:00
d158644567 Improve Django admin navigation for backup data
Add linked admin summaries for hosts, snapshots, and backup runs so the SQL-first
backup state is easier to inspect from the Django admin. Hosts now link to their
filtered snapshot and run lists, backup runs link back to their snapshot, and
snapshots show base/run relationships without requiring filesystem inspection.

Cover the new admin display helpers with focused tests.
2026-05-19 11:39:10 +02:00
e16c13a1e7 Move Docker web admin port to 8010
Publish the Django web container on host port 8010 while keeping the internal
runserver port at 8000. Update the Docker README URL so the admin location
matches the running compose setup.
2026-05-19 11:34:42 +02:00
797619acd9 Run post-backup pruning through SQL retention
Stop passing prune options into the legacy scheduled backup engine from the
Django backup command. Record the completed snapshot first, then apply retention
through the SQL-backed retention service so pruning sees the same SnapshotRecord
state as the admin and retention command.

Also record prune failures on BackupRun.result instead of leaving the run in an
ambiguous state.
2026-05-19 11:32:32 +02:00
254f915051 Plan Django retention from snapshot records 2026-05-19 11:24:48 +02:00
659377d894 Track snapshot base lineage in Django 2026-05-19 11:19:22 +02:00
5808800981 feat: link backup runs to snapshot records
Add a nullable SnapshotRecord foreign key to BackupRun and populate it
when run_pobsync_backup records a completed or failed snapshot. Keep the
existing snapshot_path for audit compatibility while making run-to-snapshot
navigation explicit in the database and admin.
2026-05-19 11:13:06 +02:00
0a49c5719c feat: record backup snapshots during run completion
Upsert SnapshotRecord rows directly from run_pobsync_backup results so
new successful and failed backup runs are reflected in the database
without requiring a separate discovery pass. Keep discovery for existing
snapshots and repair workflows, and cover success, failure, and dry-run
behavior with tests.
2026-05-19 11:09:20 +02:00
336fb1a5be feat: discover snapshots into Django records
Add a Django-native snapshot discovery service and management command
that scans backup directories, reads snapshot metadata, and idempotently
upserts SnapshotRecord rows. Expose it through the pobsync command
wrapper, update admin/docs, and cover discovery behavior with tests.
2026-05-19 05:18:01 +02:00
e564262c72 refactor: replace legacy CLI with Django command surface
Retire the old YAML and cron oriented pobsync CLI commands and expose a
SQL-first Django-backed command surface instead. Add schedule and
retention management commands, move shared defaults/parsing out of legacy
commands, remove obsolete command modules, and update documentation and
tests for the new workflow.
2026-05-19 05:14:29 +02:00
6d9ddc4457 refactor: stop using legacy JSON for runtime config
Build runtime pobsync configuration exclusively from structured SQL
fields, leaving legacy JSON only for import and audit context. Add
SQL-first management commands for global and host configuration and
cover them with tests.
2026-05-19 05:08:37 +02:00
a0eb5dcc8f refactor: promote backup configuration to structured SQL fields
Add explicit Django model fields for global and host backup settings,
including SSH, rsync, source, excludes, and retention configuration.
Populate them from legacy JSON during migration, make the config
repository prefer structured fields, and update import/admin/tests around
the SQL-first configuration model.
2026-05-19 05:04:49 +02:00
100215bf11 refactor: use injected config sources for retention
Allow retention planning and pruning to use the same ConfigSource
abstraction as scheduled backups. This removes the remaining SQL-to-YAML
export dependency from Django backup runs with pruning, keeping YAML only
as a legacy CLI compatibility path.
2026-05-19 05:00:15 +02:00
bb44f8a09c refactor: inject config sources into scheduled backups
Introduce a ConfigSource interface so scheduled backups no longer need
to load host configuration directly from runtime YAML. Add a Django-backed
config source for SQL-driven backup runs, keep file-based config as the
CLI default, and make scheduled prune execution actually apply retention
after successful runs.
2026-05-19 04:57:10 +02:00
18082496e4 feat: make Django configs drive backups and scheduling
Treat SQL-backed Django models as the source of truth for pobsync
configuration, exporting runtime YAML only as a compatibility layer for
the existing engine. Add a database-driven scheduler command, Docker
scheduler services, schedule run-state fields, and tests for scheduler,
config export, and retention behavior.
2026-05-19 04:53:47 +02:00
1a51c3e448 feat: add Django backend foundation and Docker runtime
Add a Django admin-backed management layer for pobsync configs, runs,
snapshots, and schedules. Keep the existing CLI engine as the execution
source of truth, add import/run management commands, and provide SQLite
default plus optional MariaDB Docker Compose support.
2026-05-19 04:48:13 +02:00
27acd790bd fix an issue with link-dest pointing towards the wrong directory 2026-02-05 11:55:35 +01:00
2fc26df1e5 Update readme.md 2026-02-04 01:26:01 +01:00
1ac326eada remove some installation logic from install.py 2026-02-04 01:01:41 +01:00
7caaf46588 add new deploy script and cutting out pip as the installer 2026-02-03 22:39:13 +01:00
f30d37632b add new install commands so they align better with the doctor code and will set the bin to the correct path 2026-02-03 16:36:18 +01:00
795fe38888 add new doctor commands 2026-02-03 16:29:51 +01:00
4827889f26 feat(schedule): add scheduling commands & clarify create vs update in output 2026-02-03 14:30:55 +01:00
40b6418d7b feat(run-scheduled): add optional post-run pruning 2026-02-03 13:59:17 +01:00
93acc58770 feat(retention): add destructive apply command with safety guards 2026-02-03 12:50:35 +01:00
fdd292b1b6 feat(retention): add optional base protection to plan 2026-02-03 12:42:54 +01:00
1e5807790d feat(retention): show keep/delete details in human output 2026-02-03 12:28:09 +01:00
7a7c4ccaee feat(snapshots): add --tail option to show rsync log 2026-02-03 12:04:53 +01:00
27d7da17b2 feat(snapshots): sort list output by started_at across kinds 2026-02-03 11:58:24 +01:00
9a6d44ca21 feat(snapshots): add list/show commands and snapshot_meta helpers 2026-02-03 11:55:15 +01:00
bc1e2f5662 make meta.yml atomic and add a few things like schema_version, proper base and rsync.command 2026-02-03 11:43:24 +01:00
f67abdcc91 add a few extra commands 2026-02-03 11:11:37 +01:00
ce7eba9119 Add bytecode and build files to gitignore 2026-02-02 22:18:05 +01:00
42f7a6b3c7 Add gitignore to project 2026-02-02 22:16:22 +01:00
bc5fb21762 Commit first skeleton code for pobsync 2026-02-02 22:15:54 +01:00