release 1.2: selectable language en|fr
This commit is contained in:
parent
334594c423
commit
7a9e93290d
7 changed files with 38 additions and 55 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
1.1.0
|
1.2.0
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
# FrancPaysan PROD host-agent (user francpaysan on francpaysan-host).
|
# FrancPaysan PROD host-agent (user francpaysan on francpaysan-host).
|
||||||
# Shared reporting: run-host-report.sh (timeout, line-buffered log, first-run HTML).
|
# Shared reporting: run-host-report.sh (timeout, line-buffered log, first-run HTML).
|
||||||
set -uo pipefail
|
set -uo pipefail
|
||||||
|
|
||||||
|
# Language: en|fr (selectable). Default for this wrapper: fr
|
||||||
|
export TALER_MON_LANG="${TALER_MON_LANG:-fr}"
|
||||||
|
export TALER_MON_LANG_SET=1
|
||||||
AGENT_DIR=$(cd "$(dirname "$0")" && pwd)
|
AGENT_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||||
|
|
||||||
export AGENT_LABEL="${AGENT_LABEL:-fp-prod-host-agent}"
|
export AGENT_LABEL="${AGENT_LABEL:-fp-prod-host-agent}"
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
# FrancPaysan STAGE host-agent (user stagepaysan on francpaysan-host).
|
# FrancPaysan STAGE host-agent (user stagepaysan on francpaysan-host).
|
||||||
# Shared reporting: run-host-report.sh (timeout, line-buffered log, first-run HTML).
|
# Shared reporting: run-host-report.sh (timeout, line-buffered log, first-run HTML).
|
||||||
set -uo pipefail
|
set -uo pipefail
|
||||||
|
|
||||||
|
# Language: en|fr (selectable). Default for this wrapper: fr
|
||||||
|
export TALER_MON_LANG="${TALER_MON_LANG:-fr}"
|
||||||
|
export TALER_MON_LANG_SET=1
|
||||||
AGENT_DIR=$(cd "$(dirname "$0")" && pwd)
|
AGENT_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||||
|
|
||||||
export AGENT_LABEL="${AGENT_LABEL:-fp-stage-host-agent}"
|
export AGENT_LABEL="${AGENT_LABEL:-fp-stage-host-agent}"
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
# GOA / hacktivism host-agent on koopa (hernani).
|
# GOA / hacktivism host-agent on koopa (hernani).
|
||||||
# Stack defaults only — reporting pipeline is shared: run-host-report.sh
|
# Stack defaults only — reporting pipeline is shared: run-host-report.sh
|
||||||
set -uo pipefail
|
set -uo pipefail
|
||||||
|
|
||||||
|
# Language: en|fr (selectable). Default for this wrapper: en
|
||||||
|
export TALER_MON_LANG="${TALER_MON_LANG:-en}"
|
||||||
|
export TALER_MON_LANG_SET=1
|
||||||
AGENT_DIR=$(cd "$(dirname "$0")" && pwd)
|
AGENT_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||||
|
|
||||||
export AGENT_LABEL="${AGENT_LABEL:-hacktivism-host-agent}"
|
export AGENT_LABEL="${AGENT_LABEL:-hacktivism-host-agent}"
|
||||||
|
|
|
||||||
|
|
@ -72,12 +72,19 @@ export CONTINUE_ON_ERROR="${CONTINUE_ON_ERROR:-1}"
|
||||||
export AUTH401_CONTINUE="${AUTH401_CONTINUE:-${CONTINUE_ON_ERROR}}"
|
export AUTH401_CONTINUE="${AUTH401_CONTINUE:-${CONTINUE_ON_ERROR}}"
|
||||||
export RUN_TIMEOUT="${RUN_TIMEOUT:-600}"
|
export RUN_TIMEOUT="${RUN_TIMEOUT:-600}"
|
||||||
export TALER_DOMAIN="${TALER_DOMAIN:-hacktivism.ch}"
|
export TALER_DOMAIN="${TALER_DOMAIN:-hacktivism.ch}"
|
||||||
# UI language: en default; fr for FrancPaysan (override with TALER_MON_LANG)
|
# UI language: selectable via TALER_MON_LANG / --lang (en|fr).
|
||||||
if [ -z "${TALER_MON_LANG:-}" ]; then
|
# If unset, auto: FrancPaysan domains → fr, else en.
|
||||||
|
if [ "${TALER_MON_LANG_SET:-0}" != "1" ] && [ -z "${TALER_MON_LANG:-}" ]; then
|
||||||
case "$TALER_DOMAIN" in
|
case "$TALER_DOMAIN" in
|
||||||
*lefrancpaysan*|*francpaysan*) export TALER_MON_LANG=fr ;;
|
*lefrancpaysan*|*francpaysan*) export TALER_MON_LANG=fr ;;
|
||||||
*) export TALER_MON_LANG=en ;;
|
*) export TALER_MON_LANG=en ;;
|
||||||
esac
|
esac
|
||||||
|
elif [ -n "${TALER_MON_LANG:-}" ]; then
|
||||||
|
case "$TALER_MON_LANG" in
|
||||||
|
fr|FR|fra|french) export TALER_MON_LANG=fr ;;
|
||||||
|
*) export TALER_MON_LANG=en ;;
|
||||||
|
esac
|
||||||
|
export TALER_MON_LANG_SET=1
|
||||||
fi
|
fi
|
||||||
export TALER_MON_LANG
|
export TALER_MON_LANG
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
# monitoring site-gen — non-secret settings (safe as example)
|
|
||||||
# Copy: cp settings.conf.example settings.conf
|
|
||||||
# Never put passwords/tokens here.
|
|
||||||
|
|
||||||
# Runner: public DNS path (firecuda-external)
|
|
||||||
RUNNER_SSH=
|
|
||||||
RUNNER_SSH_FALLBACKS=
|
|
||||||
RUNNER_REMOTE_WORKDIR=/tmp/taler-monitoring-site-gen
|
|
||||||
MONITORING_ROOT=..
|
|
||||||
|
|
||||||
# Deploy: host Caddy on koopa (root service — not in container)
|
|
||||||
DEPLOY_SSH=koopa-external
|
|
||||||
DEPLOY_SSH_FALLBACKS=koopa
|
|
||||||
# Static files for Caddy file_server (created per hostname)
|
|
||||||
DEPLOY_WWW_ROOT=/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
|
|
||||||
|
|
||||||
# Source link for HTML footer (Forgejo)
|
|
||||||
SOURCE_REPO_WEB=https://git.hacktivism.ch/hernani/koopa-admin-log
|
|
||||||
SOURCE_COMMIT_URL_TMPL={repo}/src/commit/{commit}
|
|
||||||
SOURCE_SUITE_PATH=scripts/taler-monitoring
|
|
||||||
|
|
||||||
CONTINUE_ON_ERROR=1
|
|
||||||
PHASES_ERR=urls versions
|
|
||||||
PHASES_OK=urls versions
|
|
||||||
SKIP_E2E=1
|
|
||||||
|
|
||||||
# Local work dir for logs + HTML
|
|
||||||
WORK_ROOT=/tmp/taler-monitoring-sites-work
|
|
||||||
|
|
||||||
# Sites: hostname|domain_profile (9 fronts)
|
|
||||||
# Start with hacktivism; stage + prod LFP follow
|
|
||||||
SITES="
|
|
||||||
bank.hacktivism.ch|hacktivism.ch
|
|
||||||
exchange.hacktivism.ch|hacktivism.ch
|
|
||||||
taler.hacktivism.ch|hacktivism.ch
|
|
||||||
stage.bank.lefrancpaysan.ch|stage.lefrancpaysan.ch
|
|
||||||
stage.exchange.lefrancpaysan.ch|stage.lefrancpaysan.ch
|
|
||||||
stage.monnaie.lefrancpaysan.ch|stage.lefrancpaysan.ch
|
|
||||||
bank.lefrancpaysan.ch|lefrancpaysan.ch
|
|
||||||
exchange.lefrancpaysan.ch|lefrancpaysan.ch
|
|
||||||
monnaie.lefrancpaysan.ch|lefrancpaysan.ch
|
|
||||||
"
|
|
||||||
|
|
||||||
# Only process this subset (space-separated hostnames). Empty = all SITES.
|
|
||||||
# Example for first deploy: ONLY_HOSTS=bank.hacktivism.ch exchange.hacktivism.ch taler.hacktivism.ch
|
|
||||||
ONLY_HOSTS=
|
|
||||||
|
|
@ -55,6 +55,8 @@ Options:
|
||||||
--merchant URL merchant-backend base — overrides profile
|
--merchant URL merchant-backend base — overrides profile
|
||||||
--currency CODE expected currency (GOA, KUDOS, CHF, …); empty = report only
|
--currency CODE expected currency (GOA, KUDOS, CHF, …); empty = report only
|
||||||
--no-probe do not probe alternate hosts (unknown domains only)
|
--no-probe do not probe alternate hosts (unknown domains only)
|
||||||
|
--lang en|fr UI/console language (sticky bar + badges)
|
||||||
|
overrides auto (FrancPaysan→fr, else en)
|
||||||
-h, --help
|
-h, --help
|
||||||
|
|
||||||
Add a stack: edit domains.conf (name + bank + exchange + merchant + currency).
|
Add a stack: edit domains.conf (name + bank + exchange + merchant + currency).
|
||||||
|
|
@ -95,7 +97,7 @@ Env (same meaning):
|
||||||
SURFACE_CVE_LEVEL=warn|error bare Server-header versions default warn
|
SURFACE_CVE_LEVEL=warn|error bare Server-header versions default warn
|
||||||
(Debian package versions default error)
|
(Debian package versions default error)
|
||||||
SURFACE_CATALOG=path override surface-catalog.conf
|
SURFACE_CATALOG=path override surface-catalog.conf
|
||||||
TALER_MON_LANG=en|fr console+HTML language (default en; auto fr for *lefrancpaysan*)
|
TALER_MON_LANG=en|fr same as --lang (default en; auto fr for *lefrancpaysan*)
|
||||||
|
|
||||||
Full load (GOA / hacktivism):
|
Full load (GOA / hacktivism):
|
||||||
./taler-monitoring.sh -d hacktivism.ch full
|
./taler-monitoring.sh -d hacktivism.ch full
|
||||||
|
|
@ -137,6 +139,19 @@ NO_PROBE=0
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
--lang)
|
||||||
|
[ $# -ge 2 ] || { echo "error: --lang needs en|fr" >&2; exit 2; }
|
||||||
|
_lang="$2"
|
||||||
|
case "$_lang" in
|
||||||
|
fr|FR|fra|french) TALER_MON_LANG=fr ;;
|
||||||
|
en|EN|eng|english) TALER_MON_LANG=en ;;
|
||||||
|
*) echo "error: unknown language '$_lang' (use en or fr)" >&2; exit 2 ;;
|
||||||
|
esac
|
||||||
|
TALER_MON_LANG_SET=1
|
||||||
|
export TALER_MON_LANG TALER_MON_LANG_SET
|
||||||
|
shift 2
|
||||||
|
i18n_init 2>/dev/null || true
|
||||||
|
;;
|
||||||
-h|--help) usage; exit 0 ;;
|
-h|--help) usage; exit 0 ;;
|
||||||
-d|--domain)
|
-d|--domain)
|
||||||
[ $# -ge 2 ] || { echo "missing arg for $1" >&2; exit 2; }
|
[ $# -ge 2 ] || { echo "missing arg for $1" >&2; exit 2; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue