feat(backup): capitalize Restic and surface the default engine in location dropdowns

- Display the restic engine as "Restic" to match BorgBackup/Kopia. The
  lowercase name lived in scripts/backup/engines/restic.json (drives the
  location-row engine pill, per-location engine select, and engine modal),
  the hardcoded per-location dropdown options, the engine-list fallback, and
  the config-option metadata. All set to "Restic".
- In each location's Engine dropdown, float the system-default engine
  (CFG_BACKUP_ENGINE) to the top and tag it "(default)", mirroring the
  retention-preset pattern.

Repo config metadata is the install template (add-only reconciliation), so
the live /docker/configs/backup/backup_engine label was updated in place too
for the global Configuration-tab dropdown on this install.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
librelad 2026-05-23 13:16:33 +01:00
parent 9ef3247246
commit 4e0b057277
6 changed files with 19 additions and 10 deletions

View File

@ -1,7 +1,7 @@
# ================================================================================
# Backup Engine - **ADVANCED** Engine-level knobs most users won't need to touch
# ================================================================================
CFG_BACKUP_ENGINE=restic # Default Backup Engine - Fallback engine for new locations (each location can override) [restic:restic|borg:BorgBackup|kopia:Kopia]
CFG_BACKUP_ENGINE=restic # Default Backup Engine - Fallback engine for new locations (each location can override) [restic:Restic|borg:BorgBackup|kopia:Kopia]
CFG_BACKUP_STRATEGY=stop-snapshot-start # Backup Strategy - How containers are quiesced before snapshotting [stop-snapshot-start:Stop → snapshot → start (safe default)|pause-snapshot-unpause:Pause → snapshot → unpause (less downtime)|live:Live — snapshot while running (only with DB dump hooks)]
CFG_BACKUP_VERIFY_AFTER=true # Verify After Backup - Run integrity check after each backup
CFG_BACKUP_VERIFY_DATA_PERCENT=5 # Verify Data Sample % - Percentage of repo data to checksum-verify weekly

View File

@ -2,7 +2,7 @@
# Edit via the Locations page on /backup, or directly here.
CFG_BACKUP_LOC_1_NAME="Local disk" # Location Name - Friendly label shown in the UI
CFG_BACKUP_LOC_1_ENABLED=true # Enabled - Snapshot to this location
CFG_BACKUP_LOC_1_ENGINE=restic # Engine - Backup engine used at this location [restic:restic|borg:BorgBackup|kopia:Kopia]
CFG_BACKUP_LOC_1_ENGINE=restic # Engine - Backup engine used at this location [restic:Restic|borg:BorgBackup|kopia:Kopia]
CFG_BACKUP_LOC_1_PASSWORD=RANDOMIZEDPASSWORD1 # Repository Password - Used to encrypt/decrypt snapshots — back up offline!
CFG_BACKUP_LOC_1_TYPE=local # Type - Backend [local:Local / mounted path|sftp:SFTP|rest:REST|s3:S3|b2:Backblaze B2|gs:Google Cloud Storage|azure:Azure|rclone:rclone]
CFG_BACKUP_LOC_1_PATH_MODE=auto # Path Mode - Where this location stores its data [auto:Automatic (/docker/backups/<id>)|custom:Custom path]

View File

@ -296,12 +296,12 @@ class BackupPage {
// Fallback so the dropdown never collapses to empty if the regen
// hasn't run yet — restic is always assumed available.
if (!this.engines.length) {
this.engines = [{ id: 'restic', name: 'restic', supported_types: ['local','sftp','rest','s3','b2','gs','azure','rclone'] }];
this.engines = [{ id: 'restic', name: 'Restic', supported_types: ['local','sftp','rest','s3','b2','gs','azure','rclone'] }];
}
}
engineDisplayName(id) {
if (!id) return 'restic';
if (!id) return 'Restic';
const match = (this.engines || []).find(e => e.id === id);
return match?.name || id;
}
@ -766,9 +766,18 @@ class BackupPage {
const compatible = this.enginesForType(type);
if (!compatible.length) return;
const want = compatible.find(e => e.id === preferred)?.id || compatible[0].id;
select.innerHTML = compatible
.map(e => `<option value="${this.escape(e.id)}" ${e.id === want ? 'selected' : ''}>${this.escape(e.name || e.id)}</option>`)
// Float the system-default engine (CFG_BACKUP_ENGINE) to the top and
// tag it "(default)" so it's the obvious pick for new locations.
const defaultId = (window.systemConfigs?.CFG_BACKUP_ENGINE || 'restic').trim();
const rank = e => (e.id === defaultId ? 0 : 1);
const ordered = [...compatible].sort((a, b) => rank(a) - rank(b));
const want = ordered.find(e => e.id === preferred)?.id || ordered[0].id;
select.innerHTML = ordered
.map(e => {
const label = (e.name || e.id) + (e.id === defaultId ? ' (default)' : '');
return `<option value="${this.escape(e.id)}" ${e.id === want ? 'selected' : ''}>${this.escape(label)}</option>`;
})
.join('');
select.value = want;
}

View File

@ -257,7 +257,7 @@ class ConfigOptions {
{ value: 'custom', label: 'Custom path' }
],
ENGINE: [
{ value: 'restic', label: 'restic' },
{ value: 'restic', label: 'Restic' },
{ value: 'borg', label: 'BorgBackup' },
{ value: 'kopia', label: 'Kopia' }
],

View File

@ -1,6 +1,6 @@
{
"id": "restic",
"name": "restic",
"name": "Restic",
"tagline": "Modern encrypted backup with native deduplication.",
"logo": "/icons/config/backup.svg",
"supported_types": ["local", "sftp", "rest", "s3", "b2", "gs", "azure", "rclone"],

View File

@ -32,7 +32,7 @@ locationAdd()
echo "# Edit via the Locations page on /backup, or directly here."
echo "CFG_BACKUP_LOC_${idx}_NAME=\"${name}\" # Location Name - Friendly label shown in the UI"
echo "CFG_BACKUP_LOC_${idx}_ENABLED=false # Enabled - Snapshot to this location"
echo "CFG_BACKUP_LOC_${idx}_ENGINE=${default_engine} # Engine - Backup engine used at this location [restic:restic|borg:BorgBackup|kopia:Kopia]"
echo "CFG_BACKUP_LOC_${idx}_ENGINE=${default_engine} # Engine - Backup engine used at this location [restic:Restic|borg:BorgBackup|kopia:Kopia]"
echo "CFG_BACKUP_LOC_${idx}_PASSWORD=RANDOMIZEDPASSWORD1 # Repository Password - Used to encrypt/decrypt snapshots — back up offline!"
echo "CFG_BACKUP_LOC_${idx}_TYPE=${type} # Type - Backend [local:Local / mounted path|sftp:SFTP|rest:REST|s3:S3|b2:Backblaze B2|gs:Google Cloud Storage|azure:Azure|rclone:rclone]"
echo "CFG_BACKUP_LOC_${idx}_PATH_MODE=${default_path_mode} # Path Mode - Where this location stores its data [auto:Automatic (/docker/backups/<id>)|custom:Custom path]"