A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys, Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun VPN routing, and a web dashboard to manage it all. Free & open forever to self-host; optional paid hosted services fund it. See PROMISE.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
48 lines
1.1 KiB
Bash
48 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
resticSnapshotsJson()
|
|
{
|
|
local idx="$1"
|
|
local app_filter="$2"
|
|
local host_filter="$3"
|
|
|
|
resticEnvExport "$idx" || return 1
|
|
|
|
local args=(snapshots --json --no-lock)
|
|
[[ -n "$app_filter" ]] && args+=(--tag "app=$app_filter")
|
|
[[ -n "$host_filter" ]] && args+=(--host "$host_filter")
|
|
|
|
sudo -E -u "$docker_install_user" restic "${args[@]}" 2>/dev/null
|
|
local rc=$?
|
|
resticEnvUnset
|
|
return $rc
|
|
}
|
|
|
|
resticSnapshotLatestId()
|
|
{
|
|
local idx="$1"
|
|
local app_name="$2"
|
|
local host="${3:-$CFG_INSTALL_NAME}"
|
|
|
|
resticEnvExport "$idx" || return 1
|
|
local id
|
|
id=$(sudo -E -u "$docker_install_user" restic snapshots \
|
|
--tag "app=$app_name" --host "$host" \
|
|
--latest 1 --json --no-lock 2>/dev/null | \
|
|
grep -o '"short_id":"[^"]*"' | head -1 | cut -d'"' -f4)
|
|
resticEnvUnset
|
|
echo "$id"
|
|
}
|
|
|
|
resticSnapshotListFiles()
|
|
{
|
|
local idx="$1"
|
|
local snapshot_id="$2"
|
|
|
|
resticEnvExport "$idx" || return 1
|
|
sudo -E -u "$docker_install_user" restic ls --json --no-lock "$snapshot_id" 2>/dev/null
|
|
local rc=$?
|
|
resticEnvUnset
|
|
return $rc
|
|
}
|