release 1.13.6: env-only machine paths and SSH hosts

Load ~/.config/taler-monitoring/env (taler-monitoring-env profiles)
before suite defaults. Drop hardcoded operator homes and host aliases
from scripts; apply/staging/www/secrets/wallet via env.
This commit is contained in:
Hernâni Marques 2026-07-19 03:33:12 +02:00
parent d7a0ceb90b
commit 0c94fb3d2e
No known key found for this signature in database
GPG key ID: CB5738652768F7E9
32 changed files with 175 additions and 157 deletions

View file

@ -15,7 +15,7 @@ Applies to all nine fronts (GOA + FP stage + FP prod) in the default `SITES` lis
| Host | Role |
|------|------|
| **optional outside runner** (SSH alias via `FIRECUDA_SSH`) | optional runner (public DNS) |
| **koopa-external** | deploy staging + Caddy (root service) |
| **deploy host (`DEPLOY_SSH`)** | deploy staging + Caddy (root service) |
| **host-agents** | primary: GOA + FP on-box (`../host-agent/`) |
No secrets in `settings.conf` — only hosts, paths, site list.

View file

@ -6,17 +6,17 @@ Host Caddy runs as **root/systemd** (`caddy` user). Static monitoring HTML is
After host-agent / `generate-monitoring-sites.sh` + deploy (as hernani), files live in:
```text
/home/hernani/monitoring-sites-staging/<hostname>/monitoring/index.html
/home/hernani/monitoring-sites-staging/<hostname>/monitoring_err/index.html
$DEPLOY_STAGING (or $HOME/monitoring-sites-staging)/<hostname>/monitoring/index.html
$DEPLOY_STAGING (or $HOME/monitoring-sites-staging)/<hostname>/monitoring_err/index.html
```
## One-shot as root (preferred)
```bash
# absolute path — as root, ~ is /root (script not found under ~/koopa-caddy/…)
sudo /home/hernani/koopa-caddy/apply-monitoring-live.sh
sudo $APPLY_MONITORING_LIVE
# same script is versioned in the suite:
# host-agent/apply-monitoring-live.sh → install/sync to /home/hernani/koopa-caddy/
# host-agent/apply-monitoring-live.sh → install/sync to $KOOPA_CADDY_DIR/
```
That rsyncs staging → `/var/www/monitoring-sites`, installs the prepared
@ -26,10 +26,10 @@ Caddyfile, reloads Caddy, and smokes mon URLs (including bare surface).
```bash
install -d -o hernani -g caddy -m 755 /var/www/monitoring-sites
rsync -a --delete /home/hernani/monitoring-sites-staging/ /var/www/monitoring-sites/
rsync -a --delete $DEPLOY_STAGING (or $HOME/monitoring-sites-staging)/ /var/www/monitoring-sites/
chown -R hernani:caddy /var/www/monitoring-sites
install -m 644 /home/hernani/koopa-caddy/Caddyfile /etc/caddy/Caddyfile
install -m 644 $KOOPA_CADDY_DIR/Caddyfile /etc/caddy/Caddyfile
caddy validate --config /etc/caddy/Caddyfile
systemctl reload caddy
systemctl is-active caddy

View file

@ -28,10 +28,10 @@
# /var/www/monitoring-sites/taler.hacktivism.ch/taler-monitoring-*/index.html
#
# Live apply on koopa (absolute path — ~ as root is /root):
# sudo /home/hernani/koopa-caddy/apply-monitoring-live.sh
# sudo ${APPLY_MONITORING_LIVE}
# Runtime-only (no sudo; hernani admin API):
# curl -g -X POST http://[::1]:2019/load -H 'Content-Type: text/caddyfile' \
# --data-binary @/home/hernani/koopa-caddy/Caddyfile
# --data-binary @${KOOPA_CADDY_DIR}/Caddyfile
# --- only inside taler.hacktivism.ch { ... } ---
@mon_bare path /monitoring /monitoring_err \

View file

@ -13,8 +13,8 @@ set +a
WORK_ROOT="${WORK_ROOT:-/tmp/taler-monitoring-sites-work}"
HTML_DIR="$WORK_ROOT/html"
DEPLOY_SSH="${DEPLOY_SSH:-koopa-external}"
DEPLOY_WWW_ROOT="${DEPLOY_WWW_ROOT:-/var/www/monitoring-sites}"
DEPLOY_SSH="${DEPLOY_SSH:-}"
DEPLOY_WWW_ROOT="${DEPLOY_WWW_ROOT:-}"
if [ ! -d "$HTML_DIR" ]; then
echo "no HTML_DIR $HTML_DIR — run generate-monitoring-sites.sh first" >&2
@ -23,7 +23,7 @@ fi
echo "deploy $HTML_DIR${DEPLOY_SSH}:${DEPLOY_WWW_ROOT}/"
# Prefer writing to a hernani-owned staging dir if /var/www not writable
STAGE_REMOTE="${DEPLOY_STAGING:-/home/hernani/monitoring-sites-staging}"
STAGE_REMOTE="${DEPLOY_STAGING:-${DEPLOY_STAGING:-$HOME/monitoring-sites-staging}}"
ssh -o BatchMode=yes -o ConnectTimeout=20 "$DEPLOY_SSH" \
"mkdir -p '$STAGE_REMOTE' '$DEPLOY_WWW_ROOT' 2>/dev/null || mkdir -p '$STAGE_REMOTE'"

View file

@ -43,8 +43,8 @@ SKIP_SSH=1
CONTINUE_ON_ERROR=1
PHASES_ERR=urls versions
PHASES_OK=urls versions
DEPLOY_SSH=koopa-external
DEPLOY_STAGING=/home/hernani/monitoring-sites-staging
DEPLOY_SSH=${DEPLOY_SSH:-}
DEPLOY_STAGING=${DEPLOY_STAGING:-$HOME/monitoring-sites-staging}
WORK_ROOT=
MONITORING_ROOT=..
SOURCE_REPO_WEB=https://git.hacktivism.ch/hernani/taler-monitoring

View file

@ -7,13 +7,13 @@ if [ -z "$FIRECUDA" ]; then
echo "Set FIRECUDA_SSH to your outside-runner SSH host alias" >&2
exit 2
fi
KOOPA="${DEPLOY_SSH:-koopa-external}"
KOOPA="${DEPLOY_SSH:?set DEPLOY_SSH in env}"
REMOTE_HTML="${FIRECUDA_HTML:-var/taler-monitoring-sites-work/html/}"
STAGE="${DEPLOY_STAGING:-/home/hernani/monitoring-sites-staging}"
STAGE="${DEPLOY_STAGING:-${DEPLOY_STAGING:-$HOME/monitoring-sites-staging}}"
echo "firecuda:$REMOTE_HTML$KOOPA:$STAGE"
ssh -o BatchMode=yes -o ConnectTimeout=20 "$KOOPA" "mkdir -p '$STAGE'"
rsync -az --delete \
"${FIRECUDA}:${REMOTE_HTML}" \
"${KOOPA}:${STAGE}/"
echo "OK staged. Root: rsync to /var/www/monitoring-sites (see ROOT-ON-KOOPA.md)"
echo "OK staged. Root: rsync to (see ROOT-ON-KOOPA.md)"

View file

@ -27,8 +27,8 @@ export PHASES_ERR="${PHASES_ERR:-urls versions}"
export PHASES_OK="${PHASES_OK:-urls versions}"
export WORK_ROOT="${WORK_ROOT:-$HOME/var/taler-monitoring-sites-work}"
export MONITORING_ROOT="${MONITORING_ROOT:-$ROOT/..}"
export DEPLOY_SSH="${DEPLOY_SSH:-koopa-external}"
export DEPLOY_STAGING="${DEPLOY_STAGING:-/home/hernani/monitoring-sites-staging}"
export DEPLOY_SSH="${DEPLOY_SSH:-}"
export DEPLOY_STAGING="${DEPLOY_STAGING:-${DEPLOY_STAGING:-$HOME/monitoring-sites-staging}}"
# Prefer full 9-site list from settings or defaults inside generate script
unset ONLY_HOSTS
@ -48,7 +48,7 @@ if [ -n "${DEPLOY_SSH:-}" ] && [ "${DEPLOY_FROM_FIRECUDA:-0}" = "1" ]; then
else
echo "note: HTML at ${WORK_ROOT}/html — pull from laptop:"
echo " rsync -az outside-runner:var/taler-monitoring-sites-work/html/ \\"
echo " koopa-external:monitoring-sites-staging/"
echo " $DEPLOY_SSH:monitoring-sites-staging/"
echo " # or: ./pull-firecuda-to-koopa.sh"
fi

View file

@ -13,15 +13,15 @@ MONITORING_ROOT=..
SKIP_SSH=1
# Deploy staging on koopa (host Caddy later — root copies to /var/www)
DEPLOY_SSH=koopa-external
DEPLOY_SSH= # set SSH host for deploy
DEPLOY_SSH_FALLBACKS=koopa
# Static files for Caddy file_server (created per hostname)
DEPLOY_WWW_ROOT=/var/www/monitoring-sites
DEPLOY_WWW_ROOT= # e.g. /var/www/monitoring-sites
DEPLOY_SUDO=sudo
CADDY_CONFIG=/etc/caddy/Caddyfile
CADDY_MIRROR_REL=configs/caddy/Caddyfile
# Working tree on deploy host for apply (optional)
KOOPA_CADDY_DIR=/home/hernani/koopa-caddy
KOOPA_CADDY_DIR= # absolute path to Caddy tree on mon host
# Source link for HTML footer (Forgejo)
SOURCE_REPO_WEB=https://git.hacktivism.ch/hernani/taler-monitoring