fix(engine)+docs: env overrides config for targeted runs; add full REFERENCE.md
- Engine: same targeted-run fix as apiscp-kopia (env BACKUP_SITES/SYSTEM/PATHS/ DATABASES now override the sourced config, so `run --site` scopes correctly instead of backing up every site). - docs/REFERENCE.md: exhaustive reference (every command, verb, config key, installer, automation, both GUIs, security model, recovery), plus a README Documentation section.
This commit is contained in:
parent
02403b72c0
commit
b9e8694c61
3 changed files with 785 additions and 0 deletions
|
|
@ -32,8 +32,21 @@ done
|
|||
|
||||
# --- configuration -------------------------------------------------------------
|
||||
CONFIG_FILE="${APISCP_BORG_CONFIG:-/etc/apiscp-borg/config}"
|
||||
# Capture run-scoped overrides passed via the environment (e.g. by
|
||||
# `borg-apiscp-repo run --site X`, which sets these via systemd-run) BEFORE
|
||||
# sourcing the config, then re-apply them AFTER, so a targeted run is not
|
||||
# clobbered by the persistent config defaults. `${VAR-x}` (single dash)
|
||||
# distinguishes unset (use config) from set-but-empty (an explicit override).
|
||||
_env_sites="${BACKUP_SITES-__unset__}"
|
||||
_env_system="${BACKUP_SYSTEM-__unset__}"
|
||||
_env_paths="${BACKUP_PATHS-__unset__}"
|
||||
_env_db="${BACKUP_DATABASES-__unset__}"
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "$CONFIG_FILE" ] && . "$CONFIG_FILE"
|
||||
[ "$_env_sites" != "__unset__" ] && BACKUP_SITES="$_env_sites"
|
||||
[ "$_env_system" != "__unset__" ] && BACKUP_SYSTEM="$_env_system"
|
||||
[ "$_env_paths" != "__unset__" ] && BACKUP_PATHS="$_env_paths"
|
||||
[ "$_env_db" != "__unset__" ] && BACKUP_DATABASES="$_env_db"
|
||||
|
||||
: "${APNSCP_ROOT:=/usr/local/apnscp}"
|
||||
: "${APNSCP_CMD:=/usr/local/apnscp/bin/cmd}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue