Compare commits
No commits in common. "1547d047c2ac1d6f3ff542699d2486a784d37a03" and "914185d42d172128590250783b8289252f7fec82" have entirely different histories.
1547d047c2
...
914185d42d
@ -93,9 +93,6 @@
|
|||||||
<h2>System config</h2>
|
<h2>System config</h2>
|
||||||
<span class="backup-card-hint">Global settings, WebUI login & backup-location credentials</span>
|
<span class="backup-card-hint">Global settings, WebUI login & backup-location credentials</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="backup-app-tile-meta" id="backup-system-status" style="margin:0 0 10px">
|
|
||||||
<span class="backup-status-dot none"></span><span>No backup yet</span>
|
|
||||||
</div>
|
|
||||||
<p class="backup-card-hint" style="margin:0 0 12px">
|
<p class="backup-card-hint" style="margin:0 0 12px">
|
||||||
Snapshot the LibrePortal system config to every enabled location so a bare-metal
|
Snapshot the LibrePortal system config to every enabled location so a bare-metal
|
||||||
restore is self-sufficient — without it, the credentials needed to reach your own
|
restore is self-sufficient — without it, the credentials needed to reach your own
|
||||||
|
|||||||
@ -550,16 +550,6 @@ class BackupPage {
|
|||||||
appGrid.innerHTML = apps.map(app => this.renderAppTile(app)).join('');
|
appGrid.innerHTML = apps.map(app => this.renderAppTile(app)).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
const sysStatus = document.getElementById('backup-system-status');
|
|
||||||
if (sysStatus) {
|
|
||||||
const sys = d.system || {};
|
|
||||||
const hasSys = !!sys.latest_snapshot;
|
|
||||||
sysStatus.innerHTML = `
|
|
||||||
<span class="backup-status-dot ${hasSys ? 'ok' : 'none'}"></span>
|
|
||||||
<span>${hasSys ? 'Last backed up ' + this.formatRelative(sys.latest_time) : 'No backup yet'}</span>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!locs.length) {
|
if (!locs.length) {
|
||||||
locSummary.innerHTML = `<div class="backup-empty-state">No locations enabled.</div>`;
|
locSummary.innerHTML = `<div class="backup-empty-state">No locations enabled.</div>`;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -53,7 +53,6 @@ engineRestoreSystemLatest() { local i="$1"; shift; engineDispatch "$(engineForL
|
|||||||
engineRestoreSnapshot() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")RestoreSnapshot" "$i" "$@"; }
|
engineRestoreSnapshot() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")RestoreSnapshot" "$i" "$@"; }
|
||||||
engineSnapshotLatestId() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")SnapshotLatestId" "$i" "$@"; }
|
engineSnapshotLatestId() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")SnapshotLatestId" "$i" "$@"; }
|
||||||
engineSnapshotsJson() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")SnapshotsJson" "$i" "$@"; }
|
engineSnapshotsJson() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")SnapshotsJson" "$i" "$@"; }
|
||||||
engineSystemSnapshotsJson() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")SystemSnapshotsJson" "$i" "$@"; }
|
|
||||||
engineSnapshotListFiles() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")SnapshotListFiles" "$i" "$@"; }
|
engineSnapshotListFiles() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")SnapshotListFiles" "$i" "$@"; }
|
||||||
engineForgetApp() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")ForgetApp" "$i" "$@"; }
|
engineForgetApp() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")ForgetApp" "$i" "$@"; }
|
||||||
engineCheckLocation() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")CheckLocation" "$i" "$@"; }
|
engineCheckLocation() { local i="$1"; shift; engineDispatch "$(engineForLocation "$i")CheckLocation" "$i" "$@"; }
|
||||||
|
|||||||
@ -18,22 +18,6 @@ resticSnapshotsJson()
|
|||||||
return $rc
|
return $rc
|
||||||
}
|
}
|
||||||
|
|
||||||
resticSystemSnapshotsJson()
|
|
||||||
{
|
|
||||||
local idx="$1"
|
|
||||||
local host_filter="$2"
|
|
||||||
|
|
||||||
resticEnvExport "$idx" || return 1
|
|
||||||
|
|
||||||
local args=(snapshots --json --no-lock --tag "system=config")
|
|
||||||
[[ -n "$host_filter" ]] && args+=(--host "$host_filter")
|
|
||||||
|
|
||||||
runBackupOp restic "${args[@]}" 2>/dev/null
|
|
||||||
local rc=$?
|
|
||||||
resticEnvUnset
|
|
||||||
return $rc
|
|
||||||
}
|
|
||||||
|
|
||||||
resticSnapshotLatestId()
|
resticSnapshotLatestId()
|
||||||
{
|
{
|
||||||
local idx="$1"
|
local idx="$1"
|
||||||
|
|||||||
@ -55,10 +55,6 @@ webuiGenerateBackupDashboard()
|
|||||||
primary_idx=$(resticEnabledLocations | head -1)
|
primary_idx=$(resticEnabledLocations | head -1)
|
||||||
while IFS= read -r app; do
|
while IFS= read -r app; do
|
||||||
[[ -z "$app" ]] && continue
|
[[ -z "$app" ]] && continue
|
||||||
# The WebUI app is reproducible and skipped by backupAllApps — its
|
|
||||||
# state rides in the system-config snapshot below, so don't show a
|
|
||||||
# perpetually-"No backup yet" tile for it.
|
|
||||||
[[ "$app" == "libreportal" ]] && continue
|
|
||||||
local latest_id="" latest_time=""
|
local latest_id="" latest_time=""
|
||||||
if [[ -n "$primary_idx" ]]; then
|
if [[ -n "$primary_idx" ]]; then
|
||||||
local snap_json
|
local snap_json
|
||||||
@ -73,17 +69,6 @@ webuiGenerateBackupDashboard()
|
|||||||
fi
|
fi
|
||||||
apps_json+="]"
|
apps_json+="]"
|
||||||
|
|
||||||
# System-config backup status (tag system=config) — its own tracked item.
|
|
||||||
local system_id="" system_time=""
|
|
||||||
local sys_idx
|
|
||||||
sys_idx=$(resticEnabledLocations | head -1)
|
|
||||||
if [[ -n "$sys_idx" ]]; then
|
|
||||||
local sys_json
|
|
||||||
sys_json=$(engineSystemSnapshotsJson "$sys_idx" "$CFG_INSTALL_NAME" 2>/dev/null)
|
|
||||||
system_id=$(echo "$sys_json" | grep -o '"short_id":"[^"]*"' | tail -1 | cut -d'"' -f4)
|
|
||||||
system_time=$(echo "$sys_json" | grep -o '"time":"[^"]*"' | tail -1 | cut -d'"' -f4)
|
|
||||||
fi
|
|
||||||
|
|
||||||
local content="{"
|
local content="{"
|
||||||
content+="\"generated_at\":\"$generated_at\","
|
content+="\"generated_at\":\"$generated_at\","
|
||||||
content+="\"install_name\":\"${CFG_INSTALL_NAME:-libreportal}\","
|
content+="\"install_name\":\"${CFG_INSTALL_NAME:-libreportal}\","
|
||||||
@ -91,8 +76,7 @@ webuiGenerateBackupDashboard()
|
|||||||
content+="\"verify_after\":${CFG_BACKUP_VERIFY_AFTER:-false},"
|
content+="\"verify_after\":${CFG_BACKUP_VERIFY_AFTER:-false},"
|
||||||
content+="\"strategy\":\"${CFG_BACKUP_STRATEGY:-auto}\","
|
content+="\"strategy\":\"${CFG_BACKUP_STRATEGY:-auto}\","
|
||||||
content+="\"locations\":$locations_json,"
|
content+="\"locations\":$locations_json,"
|
||||||
content+="\"apps\":$apps_json,"
|
content+="\"apps\":$apps_json"
|
||||||
content+="\"system\":{\"latest_snapshot\":\"$system_id\",\"latest_time\":\"$system_time\"}"
|
|
||||||
content+="}"
|
content+="}"
|
||||||
|
|
||||||
echo "$content" | runFileWrite "$output_file"
|
echo "$content" | runFileWrite "$output_file"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user