From 01c4ccb316e04066d2306347cdd6cbbb0e850336 Mon Sep 17 00:00:00 2001 From: Peter van Arkel Date: Thu, 21 May 2026 11:13:10 +0200 Subject: [PATCH] (ui) Remove legacy-facing labels from operator pages Replace refactor-era wording such as Source, Source root, SQL records, database, runtime, and Django generation labels with operator-facing copy around backup source, tracking records, changelog files, active config, and pobsync-managed SSH keys. Add view assertions so the old source/SQL labels do not quietly return. Refs #24 --- src/pobsync_backend/forms.py | 2 +- src/pobsync_backend/self_check.py | 4 ++-- .../templates/pobsync_backend/changelog.html | 2 +- .../templates/pobsync_backend/global_form.html | 2 +- .../templates/pobsync_backend/host_detail.html | 6 +++--- .../templates/pobsync_backend/retention_plan.html | 3 +-- .../templates/pobsync_backend/run_detail.html | 1 - .../templates/pobsync_backend/snapshot_detail.html | 4 ++-- src/pobsync_backend/tests/test_views.py | 10 ++++++++++ 9 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/pobsync_backend/forms.py b/src/pobsync_backend/forms.py index 174ca00..0fa1c71 100644 --- a/src/pobsync_backend/forms.py +++ b/src/pobsync_backend/forms.py @@ -192,7 +192,7 @@ class SshCredentialForm(forms.ModelForm): if not raw_private_key.strip(): if self.instance and self.instance.pk and self.instance.key_path: return self.instance.private_key - raise forms.ValidationError("Paste a private key, upload a private key file, or generate a key from Django.") + raise forms.ValidationError("Paste a private key, upload a private key file, or generate a key in pobsync.") private_key = normalize_private_key(raw_private_key) public_key = validate_ssh_private_key(private_key) diff --git a/src/pobsync_backend/self_check.py b/src/pobsync_backend/self_check.py index f8bde76..3388929 100644 --- a/src/pobsync_backend/self_check.py +++ b/src/pobsync_backend/self_check.py @@ -266,13 +266,13 @@ def _config_checks() -> list[SelfCheck]: message = "Default global config exists." if global_config.backup_root != settings.POBSYNC_BACKUP_ROOT: status = "warning" - message = "Global config backup root differs from the runtime backup root." + message = "Saved backup root differs from the active backup root." return [ SelfCheck( "Global config", status, message, - f"database={global_config.backup_root} runtime={settings.POBSYNC_BACKUP_ROOT}", + f"saved={global_config.backup_root} active={settings.POBSYNC_BACKUP_ROOT}", ) ] diff --git a/src/pobsync_backend/templates/pobsync_backend/changelog.html b/src/pobsync_backend/templates/pobsync_backend/changelog.html index 87570fb..0e5b38a 100644 --- a/src/pobsync_backend/templates/pobsync_backend/changelog.html +++ b/src/pobsync_backend/templates/pobsync_backend/changelog.html @@ -12,7 +12,7 @@
Installed version: {{ app_version }}
-
Source: {{ changelog_path }}
+
Changelog file: {{ changelog_path }}
{% if missing %}
missing
{% endif %} diff --git a/src/pobsync_backend/templates/pobsync_backend/global_form.html b/src/pobsync_backend/templates/pobsync_backend/global_form.html index 6ebad3b..135f8cd 100644 --- a/src/pobsync_backend/templates/pobsync_backend/global_form.html +++ b/src/pobsync_backend/templates/pobsync_backend/global_form.html @@ -13,7 +13,7 @@

{% if global_config %}Edit Global Config{% else %}Create Global Config{% endif %}

Backup root: {{ backup_root }}
-
This path comes from the runtime environment and is written back when the config is saved.
+
This path is managed by the service environment and is saved with the config.
{% csrf_token %} diff --git a/src/pobsync_backend/templates/pobsync_backend/host_detail.html b/src/pobsync_backend/templates/pobsync_backend/host_detail.html index dae7006..ae530e2 100644 --- a/src/pobsync_backend/templates/pobsync_backend/host_detail.html +++ b/src/pobsync_backend/templates/pobsync_backend/host_detail.html @@ -44,7 +44,7 @@
Enabled: {{ host.enabled|yesno:"yes,no" }}
SSH key: {{ host.ssh_credential|default:"global default" }}
SSH: {{ host.ssh_user|default:"global" }}{% if host.ssh_port %}:{{ host.ssh_port }}{% endif %}
-
Source: {{ host.source_root|default:"global default" }}
+
Backup source: {{ host.source_root|default:"global default" }}
Retention: daily {{ host.retention_daily }}, weekly {{ host.retention_weekly }}, monthly {{ host.retention_monthly }}, yearly {{ host.retention_yearly }}
@@ -101,7 +101,7 @@

Effective Config

-
Source root: {{ effective_config.source_root }}
+
Backup source: {{ effective_config.source_root }}
Destination subdir: {{ effective_config.destination_subdir|default:"none" }}
SSH: {{ effective_config.ssh.user }}@{{ host.address }}:{{ effective_config.ssh.port }}
SSH key: {{ effective_config.ssh.credential|default:"none selected" }}
@@ -237,7 +237,7 @@
Status: {% if last_preflight.ok %}ok{% else %}failed{% endif %}
Target: {{ last_preflight.target }}
-
Source root: {{ last_preflight.source_root }}
+
Backup source: {{ last_preflight.source_root }}
Remote rsync: {{ last_preflight.rsync_binary }}
diff --git a/src/pobsync_backend/templates/pobsync_backend/retention_plan.html b/src/pobsync_backend/templates/pobsync_backend/retention_plan.html index 617b7dc..ba88c9c 100644 --- a/src/pobsync_backend/templates/pobsync_backend/retention_plan.html +++ b/src/pobsync_backend/templates/pobsync_backend/retention_plan.html @@ -14,7 +14,6 @@
-
Source
{{ plan.source }}
Kind
{{ plan.kind }}
Keep
{{ plan.keep|length }}
Would Delete
{{ plan.delete|length }}
@@ -42,7 +41,7 @@

After inspection, use the dedicated cleanup form below to delete only incomplete snapshot directories and their - SQL records. Successful scheduled and manual snapshots are not touched by this cleanup. + tracking records. Successful scheduled and manual snapshots are not touched by this cleanup.

{% endif %} diff --git a/src/pobsync_backend/templates/pobsync_backend/run_detail.html b/src/pobsync_backend/templates/pobsync_backend/run_detail.html index b9722c7..4fbf6aa 100644 --- a/src/pobsync_backend/templates/pobsync_backend/run_detail.html +++ b/src/pobsync_backend/templates/pobsync_backend/run_detail.html @@ -193,7 +193,6 @@

Retention

Status: {% if prune_result.ok %}ok{% else %}warning{% endif %}
- {% if prune_result.source %}
Source: {{ prune_result.source }}
{% endif %} {% if prune_result.kind %}
Kind: {{ prune_result.kind }}
{% endif %} {% if prune_result.planned_delete_count is not None %}
Planned deletions: {{ prune_result.planned_delete_count }}
{% endif %} {% if prune_result.deleted %}
Deleted: {{ prune_result.deleted|length }}
{% endif %} diff --git a/src/pobsync_backend/templates/pobsync_backend/snapshot_detail.html b/src/pobsync_backend/templates/pobsync_backend/snapshot_detail.html index f09d0f8..c37b5ee 100644 --- a/src/pobsync_backend/templates/pobsync_backend/snapshot_detail.html +++ b/src/pobsync_backend/templates/pobsync_backend/snapshot_detail.html @@ -63,7 +63,7 @@

Restore Guidance

-
Snapshot data source: {{ restore.source_path }}
+
Snapshot data path: {{ restore.source_path }}
Example staging destination: {{ restore.destination_path }}
Restore from the snapshot's data/ directory. Start with a dry run, restore to a staging path first, @@ -93,7 +93,7 @@
Replace {{ restore.example_file_relative_path }} with the file you want to restore.
-
Dry-run restore back to the source host:
+
Dry-run restore back to the original host:
{{ restore.remote_dry_run_command }}

diff --git a/src/pobsync_backend/tests/test_views.py b/src/pobsync_backend/tests/test_views.py index f65f82a..a731ba5 100644 --- a/src/pobsync_backend/tests/test_views.py +++ b/src/pobsync_backend/tests/test_views.py @@ -59,6 +59,8 @@ class ViewTests(TestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "Installed version:") + self.assertContains(response, "Changelog file:") + self.assertNotContains(response, "Source:") self.assertContains(response, "1.0.0 - 2026-05-21") self.assertContains(response, "Django control panel") self.assertContains(response, "Native systemd installer") @@ -868,6 +870,8 @@ class ViewTests(TestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "Effective Config") + self.assertContains(response, "Backup source:") + self.assertNotContains(response, "Source root:") self.assertContains(response, "root@web-01.example.test:2222") self.assertContains(response, "default-key") self.assertContains(response, "-oBatchMode=yes") @@ -1426,6 +1430,7 @@ class ViewTests(TestCase): self.assertContains(response, "Check network connectivity.") self.assertContains(response, "Retention") self.assertContains(response, "Planned deletions") + self.assertNotContains(response, "Source: sql") self.assertContains(response, "Max delete") self.assertContains(response, "Protect bases") self.assertContains(response, "Incomplete ignored") @@ -1616,6 +1621,10 @@ class ViewTests(TestCase): self.assertContains(response, "Files seen: 100") self.assertContains(response, "Hardlinked files: 9") self.assertContains(response, "Restore Guidance") + self.assertContains(response, "Snapshot data path:") + self.assertNotContains(response, "Snapshot data source:") + self.assertContains(response, "Dry-run restore back to the original host:") + self.assertNotContains(response, "Dry-run restore back to the source host:") self.assertContains(response, f"{base.path}/data") self.assertContains(response, f"/restore/{host.host}") self.assertContains(response, "rsync -aHAX --numeric-ids --info=progress2 --dry-run") @@ -1694,6 +1703,7 @@ class ViewTests(TestCase): self.assertContains(response, "newest") self.assertContains(response, "Would Delete") self.assertContains(response, "outside retention policy") + self.assertNotContains(response, "

Source
", html=True) self.assertContains(response, "Confirm delete count") self.assertContains(response, "Type 1 to confirm the current number of planned deletions.") -- 2.43.0