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:
parent
d7a0ceb90b
commit
0c94fb3d2e
32 changed files with 175 additions and 157 deletions
|
|
@ -21,7 +21,7 @@ Thin wrappers only set stack defaults:
|
|||
| `run-fp-stage-monitoring.sh` | FP stage | `stagepaysan` |
|
||||
| `run-fp-prod-monitoring.sh` | FP prod | `francpaysan` |
|
||||
| `run-host-report.sh` + `taler-monitoring-mytops-stage.{service,timer}` | mytops **stage / betel** only | `taler-monitoring` @ betel (4h) |
|
||||
| `run-aptdeploy.sh` | CLI: ensure + **aptdeploy** (no HTML) | local if hostname=koopa, else **ssh koopa-external** |
|
||||
| `run-aptdeploy.sh` | CLI: ensure + **aptdeploy** (no HTML) | local if hostname=koopa, else **ssh $DEPLOY_SSH** |
|
||||
| `run-aptdeploy-monitoring.sh` | apt-src tests → `/taler-monitoring-aptdeploy*` | `hernani` @ koopa (4h) |
|
||||
| `run-surface-monitoring.sh` | **surface** → only `/taler-monitoring-surface*` (ecosystem + mail + mattermost + versions) | `hernani` @ koopa (hourly) |
|
||||
| `run-mail-monitoring.sh` / `run-mattermost-monitoring.sh` | **deprecated v1.8.0** — aliases of surface | disabled timers |
|
||||
|
|
@ -110,7 +110,7 @@ cp ~/src/taler-monitoring/host-agent/env.example \
|
|||
~/.config/taler-monitoring/env
|
||||
|
||||
# ops workstation:
|
||||
./host-agent/install-host-agent.sh --remote koopa-external
|
||||
./host-agent/install-host-agent.sh --remote $DEPLOY_SSH
|
||||
|
||||
# or on koopa:
|
||||
~/src/taler-monitoring/host-agent/install-host-agent.sh
|
||||
|
|
|
|||
|
|
@ -17,15 +17,15 @@ Public URLs return **merchant/bank JSON** like:
|
|||
or a **404 HTML** page from the app reverse_proxy.
|
||||
|
||||
Cause: live `/etc/caddy/Caddyfile` has **no** `handle /monitoring*` (falls through to
|
||||
API). Prepared config is only under **`/home/hernani/koopa-caddy/Caddyfile`**.
|
||||
API). Prepared config is only under **`$KOOPA_CADDY_DIR/Caddyfile`**.
|
||||
|
||||
## One-shot as root (recommended)
|
||||
|
||||
```bash
|
||||
# absolute path required: as root, ~ is /root (not /home/hernani)
|
||||
sudo /home/hernani/koopa-caddy/apply-monitoring-live.sh
|
||||
sudo $APPLY_MONITORING_LIVE
|
||||
# or already root:
|
||||
# /home/hernani/koopa-caddy/apply-monitoring-live.sh
|
||||
# $APPLY_MONITORING_LIVE
|
||||
```
|
||||
|
||||
**Caddy bare-path redir (v1.9.2+):** inside a `handle` block use
|
||||
|
|
@ -52,14 +52,14 @@ There is **no** public page `/taler-monitoring`. Each family needs **bare and sl
|
|||
| **taler-monitoring-aptdeploy** | bare + slash + `_err` | **taler.hacktivism.ch only** | `taler-monitoring-aptdeploy.timer` (4h) |
|
||||
|
||||
HTML is generated as **hernani** into
|
||||
`/home/hernani/monitoring-sites-staging/`.
|
||||
`$DEPLOY_STAGING (or $HOME/monitoring-sites-staging)/`.
|
||||
|
||||
## Manual equivalent
|
||||
|
||||
```bash
|
||||
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 && chmod -R g+rwX /var/www/monitoring-sites
|
||||
sudo /home/hernani/koopa-caddy/apply.sh # or apply-monitoring-live.sh
|
||||
sudo $KOOPA_CADDY_DIR/apply.sh # or apply-monitoring-live.sh
|
||||
```
|
||||
|
||||
Expect **200** (HTML with sticky bar). Not merchant JSON `code:21`.
|
||||
|
|
@ -67,7 +67,7 @@ Expect **200** (HTML with sticky bar). Not merchant JSON `code:21`.
|
|||
## After each monitoring run (if www is not hernani-writable)
|
||||
|
||||
```bash
|
||||
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 caddy:caddy /var/www/monitoring-sites
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
# ONE-SHOT as root: publish monitoring HTML + enable Caddy handles
|
||||
#
|
||||
# Suite copy (taler-monitoring host-agent). Live install path on koopa:
|
||||
# /home/hernani/koopa-caddy/apply-monitoring-live.sh
|
||||
# ${KOOPA_CADDY_DIR}/apply-monitoring-live.sh
|
||||
# Prefer absolute path ( ~ expands to /root when already root ):
|
||||
# sudo /home/hernani/koopa-caddy/apply-monitoring-live.sh
|
||||
# /home/hernani/koopa-caddy/apply-monitoring-live.sh # if already root
|
||||
# sudo ${KOOPA_CADDY_DIR}/apply-monitoring-live.sh
|
||||
# ${KOOPA_CADDY_DIR}/apply-monitoring-live.sh # if already root
|
||||
#
|
||||
# After editing here: rsync to koopa ~/koopa-caddy/ before root apply.
|
||||
set -euo pipefail
|
||||
|
|
@ -13,9 +13,9 @@ if [[ "$(id -u)" -ne 0 ]]; then
|
|||
exec sudo -E "$0" "$@"
|
||||
fi
|
||||
|
||||
STAGING=/home/hernani/monitoring-sites-staging
|
||||
WWW=/var/www/monitoring-sites
|
||||
SRC=/home/hernani/koopa-caddy/Caddyfile
|
||||
STAGING="${DEPLOY_STAGING:-${HTML_OUT:-$HOME/monitoring-sites-staging}}"
|
||||
WWW="${DEPLOY_WWW_ROOT:?set DEPLOY_WWW_ROOT in env}"
|
||||
SRC="${KOOPA_CADDY_DIR:?set KOOPA_CADDY_DIR in env}/Caddyfile"
|
||||
DST=/etc/caddy/Caddyfile
|
||||
|
||||
if [[ ! -f "$SRC" ]]; then
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
# koopa-taler-deploy-test-apt-src-trixie-upgrade
|
||||
# koopa-taler-deploy-test-apt-src-trixie-testing-upgrade
|
||||
#
|
||||
# Run as hernani on koopa. From elsewhere use run-aptdeploy.sh (ssh koopa-external).
|
||||
# Run as hernani on koopa. From elsewhere use run-aptdeploy.sh (ssh $DEPLOY_SSH or $APT_DEPLOY_SSH).
|
||||
#
|
||||
set -euo pipefail
|
||||
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@
|
|||
# # on koopa as hernani:
|
||||
# ~/src/taler-monitoring/host-agent/install-host-agent.sh
|
||||
# # or from laptop:
|
||||
# ./install-host-agent.sh --remote koopa-external
|
||||
# ./install-host-agent.sh --remote $DEPLOY_SSH
|
||||
#
|
||||
# Suite tree is ONLY ~/src/taler-monitoring (standalone repo). No koopa-admin-log.
|
||||
#
|
||||
set -euo pipefail
|
||||
ROOT=$(cd "$(dirname "$0")" && pwd)
|
||||
REMOTE="${1:-}"
|
||||
[ "${1:-}" = "--remote" ] && REMOTE="${2:-koopa-external}"
|
||||
[ "${1:-}" = "--remote" ] && REMOTE="${2:-${DEPLOY_SSH:-}}"
|
||||
|
||||
SUITE_URL="${SUITE_GIT_URL:-https://git.hacktivism.ch/hernani/taler-monitoring.git}"
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ set -euo pipefail
|
|||
AGENT_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
BOOT_MON=$(cd "$AGENT_DIR/.." && pwd)
|
||||
MODE="${1:-all}"
|
||||
APT_DEPLOY_SSH="${APT_DEPLOY_SSH:-koopa-external}"
|
||||
APT_DEPLOY_SSH="${APT_DEPLOY_SSH:-${DEPLOY_SSH:-}}"
|
||||
OVERLAY_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/taler-monitoring/suite-overlay"
|
||||
|
||||
on_koopa() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
# FrancPaysan PROD host-agent (user francpaysan on francpaysan-host).
|
||||
# FrancPaysan PROD host-agent (user francpaysan on ).
|
||||
# Shared reporting: run-host-report.sh (timeout, line-buffered log, first-run HTML).
|
||||
set -uo pipefail
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
# FrancPaysan STAGE host-agent (user stagepaysan on francpaysan-host).
|
||||
# FrancPaysan STAGE host-agent (user stagepaysan on ).
|
||||
# Shared reporting: run-host-report.sh (timeout, line-buffered log, first-run HTML).
|
||||
set -uo pipefail
|
||||
|
||||
|
|
|
|||
|
|
@ -439,11 +439,11 @@ if [ -n "$DEPLOY_WWW" ]; then
|
|||
elif [ -e "$DEPLOY_WWW" ]; then
|
||||
echo "ERROR: DEPLOY_WWW_ROOT=$DEPLOY_WWW exists but is not writable by $(id -un)" >&2
|
||||
echo " public FQDN pages will stay missing/stale — fix ownership or run:" >&2
|
||||
echo " sudo /home/hernani/koopa-caddy/apply-monitoring-live.sh" >&2
|
||||
echo " sudo ${APPLY_MONITORING_LIVE}" >&2
|
||||
ec=1
|
||||
else
|
||||
echo "ERROR: DEPLOY_WWW_ROOT=$DEPLOY_WWW missing — public pages not published" >&2
|
||||
echo " create tree + Caddy handles: sudo /home/hernani/koopa-caddy/apply-monitoring-live.sh" >&2
|
||||
echo " create tree + Caddy handles: sudo ${APPLY_MONITORING_LIVE}" >&2
|
||||
ec=1
|
||||
fi
|
||||
else
|
||||
|
|
@ -479,7 +479,7 @@ if [ "$_monpages_failed" = "1" ]; then
|
|||
{
|
||||
echo ""
|
||||
echo "ERROR monpages: public FQDN monitoring HTML missing or merchant JSON code 21"
|
||||
echo "ERROR monpages: fix with sudo /home/hernani/koopa-caddy/apply-monitoring-live.sh (www + Caddy handles)"
|
||||
echo "ERROR monpages: fix with sudo ${APPLY_MONITORING_LIVE} (www + Caddy handles)"
|
||||
} >>"$LOG"
|
||||
for host in $MON_HOSTS; do
|
||||
htmlify_host "$host"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue