diff --git a/README.md b/README.md index 63871da..cf61654 100644 --- a/README.md +++ b/README.md @@ -364,3 +364,8 @@ LADDER_LOAD=0 ./taler-monitoring.sh ladder ## Languages (i18n) Default **English**. FrancPaysan stacks use **French** (`TALER_MON_LANG=fr`, auto for `*lefrancpaysan*`). See `VERSIONS.md` and `i18n.sh`. + +## Version on monitoring pages (v1.3.0+) + +The sticky bar shows the suite **tag** (e.g. `v1.3.0`) and links to that tag on Forgejo. +Planned **v1.4.0**: fuller L10n (fr-CH for FrancPaysan, de-CH for hacktivism/Taler CH). diff --git a/VERSION b/VERSION index 867e524..589268e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.0 \ No newline at end of file +1.3.0 \ No newline at end of file diff --git a/VERSIONS.md b/VERSIONS.md index 21ddb28..3c100cd 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -5,10 +5,21 @@ Release history for the standalone **taler-monitoring** suite | Tag | Date (UTC) | Notes | |-----|------------|--------| +| **v1.4.0** | *planned* | **L10n** for user-facing outputs that need localization: **fr-CH** (FrancPaysan, Suisse romande) and **de-CH** (hacktivism / Taler CH German). Not implemented yet — after **1.3**. | +| **v1.3.0** | 2026-07-18 | Sticky bar shows **suite version** and links to the Forgejo **tag** (`…/src/tag/vX.Y.Z`). | | **v1.2** | 2026-07-18 | Language selection: `--lang` / `TALER_MON_LANG` (en\|fr). | | **v1.1** | 2026-07-18 | i18n chrome: English default; French for FrancPaysan. | | **v1.0** / **v1** | 2026-07-18 | Initial standalone release (split from `koopa-admin-log`). | +## Sticky bar version (v1.3.0+) + +Generated HTML shows the installed release tag (e.g. `v1.3.0`) next to the host line. +Clicking opens the tag page on Forgejo: + +`https://git.hacktivism.ch/hernani/taler-monitoring/src/tag/` + +Resolved via `git describe --tags` after `update-suite.sh`, with fallback to the `VERSION` file. + ## Language (v1.2+) | Method | Example | @@ -17,9 +28,11 @@ Release history for the standalone **taler-monitoring** suite | Env | `TALER_MON_LANG=en` or `fr` | | Auto | `*lefrancpaysan*` → fr, else en | +**Note:** Full locale packs (fr-CH / de-CH) for all check messages are scheduled for **v1.4.0**, not 1.3. + ## Pin a release ```bash git clone https://git.hacktivism.ch/hernani/taler-monitoring.git ~/src/taler-monitoring -cd ~/src/taler-monitoring && git checkout v1.2 +cd ~/src/taler-monitoring && git checkout v1.3.0 ``` diff --git a/host-agent/run-host-report.sh b/host-agent/run-host-report.sh index 81d06bb..ee74302 100755 --- a/host-agent/run-host-report.sh +++ b/host-agent/run-host-report.sh @@ -103,6 +103,23 @@ HTML_ERR_DIR="${HTML_ERR_DIR:-monitoring_err}" HTML_URL_OK="${HTML_URL_OK:-/monitoring/}" HTML_URL_ERR="${HTML_URL_ERR:-/monitoring_err/}" PAGE_LABEL="${PAGE_LABEL:-monitoring}" +SUITE_VERSION="${SUITE_VERSION:-}" +SUITE_VERSION_URL="${SUITE_VERSION_URL:-}" +if [ -z "$SUITE_VERSION" ] && [ -d "${ROOT:-$AGENT_MON}/.git" ]; then + _vd="${ROOT:-$AGENT_MON}" + SUITE_VERSION=$(git -C "$_vd" describe --tags --exact-match 2>/dev/null || git -C "$_vd" describe --tags --abbrev=0 2>/dev/null || true) +fi +if [ -z "$SUITE_VERSION" ] && [ -f "${ROOT:-$AGENT_MON}/VERSION" ]; then + SUITE_VERSION="v$(tr -d '[:space:]' <"${ROOT:-$AGENT_MON}/VERSION" | sed 's/^v//')" +fi +[ -z "$SUITE_VERSION" ] && SUITE_VERSION="unknown" +case "$SUITE_VERSION" in unknown|v*) ;; *) SUITE_VERSION="v$SUITE_VERSION" ;; esac +if [ -z "$SUITE_VERSION_URL" ] && [ "$SUITE_VERSION" != "unknown" ]; then + _web="${SOURCE_REPO_WEB:-https://git.hacktivism.ch/hernani/taler-monitoring}" + SUITE_VERSION_URL="${_web}/src/tag/${SUITE_VERSION}" +fi +export SUITE_VERSION SUITE_VERSION_URL + # Sensible MON_HOSTS from domain if not set if [ -z "$MON_HOSTS" ]; then @@ -308,6 +325,8 @@ htmlify_host() { --mode err \ --commit "${COMMIT:-}" \ --commit-url "${COMMIT_URL:-}" \ + --suite-version "${SUITE_VERSION:-unknown}" \ + --suite-version-url "${SUITE_VERSION_URL:-}" \ --suite-path "$SUITE_PATH" \ --page-label "$PAGE_LABEL" \ --path-err "$HTML_URL_ERR" \ @@ -321,6 +340,8 @@ htmlify_host() { --mode ok \ --commit "${COMMIT:-}" \ --commit-url "${COMMIT_URL:-}" \ + --suite-version "${SUITE_VERSION:-unknown}" \ + --suite-version-url "${SUITE_VERSION_URL:-}" \ --suite-path "$SUITE_PATH" \ --page-label "$PAGE_LABEL" \ --path-err "$HTML_URL_ERR" \ @@ -336,6 +357,8 @@ htmlify_host() { --mode redirect \ --commit "${COMMIT:-}" \ --commit-url "${COMMIT_URL:-}" \ + --suite-version "${SUITE_VERSION:-unknown}" \ + --suite-version-url "${SUITE_VERSION_URL:-}" \ --suite-path "$SUITE_PATH" \ --page-label "$PAGE_LABEL" \ --path-err "$HTML_URL_ERR" diff --git a/host-agent/update-suite.sh b/host-agent/update-suite.sh index 883079e..37393cb 100755 --- a/host-agent/update-suite.sh +++ b/host-agent/update-suite.sh @@ -39,6 +39,33 @@ COMMIT_SHORT=$(git rev-parse --short=12 HEAD) SOURCE_REPO_WEB="${SOURCE_REPO_WEB:-https://git.hacktivism.ch/hernani/taler-monitoring}" COMMIT_URL="${SOURCE_REPO_WEB}/src/commit/${COMMIT}" export COMMIT COMMIT_SHORT COMMIT_URL SOURCE_REPO_WEB + +# Release tag for sticky bar (exact tag if HEAD is tagged, else nearest) +SUITE_VERSION="" +if command -v git >/dev/null 2>&1; then + SUITE_VERSION=$(git describe --tags --exact-match 2>/dev/null || true) + if [ -z "$SUITE_VERSION" ]; then + SUITE_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || true) + fi +fi +if [ -z "$SUITE_VERSION" ] && [ -f "$SUITE_DIR/VERSION" ]; then + SUITE_VERSION="v$(tr -d '[:space:]' <"$SUITE_DIR/VERSION" | sed 's/^v//')" + case "$SUITE_VERSION" in v*) ;; *) SUITE_VERSION="v${SUITE_VERSION#v}" ;; esac +fi +[ -z "$SUITE_VERSION" ] && SUITE_VERSION="unknown" +# normalize: ensure leading v for tags +case "$SUITE_VERSION" in + unknown) ;; + v*) ;; + *) SUITE_VERSION="v${SUITE_VERSION}" ;; +esac +SUITE_VERSION_URL="" +if [ -n "$SOURCE_REPO_WEB" ] && [ "$SUITE_VERSION" != "unknown" ]; then + SUITE_VERSION_URL="${SOURCE_REPO_WEB}/src/tag/${SUITE_VERSION}" +fi +export SUITE_VERSION SUITE_VERSION_URL +echo " version=$SUITE_VERSION ${SUITE_VERSION_URL:+· $SUITE_VERSION_URL}" + echo "suite @ $COMMIT_SHORT $COMMIT_URL" echo " dir=$SUITE_DIR" ln -sfn "$SUITE_DIR" "$HOME/taler-monitoring" 2>/dev/null || true diff --git a/site-gen/console_to_html.py b/site-gen/console_to_html.py index 4c4927f..d9bb75e 100755 --- a/site-gen/console_to_html.py +++ b/site-gen/console_to_html.py @@ -32,6 +32,8 @@ def ui(lang: str, key: str, **kwargs) -> str: "jump_first_error": "Jump to first error", "jump_first_warn": "Jump to first warning", "generated": "generated", + "version": "version", + "source": "source", "what_monitors": "What this monitors", "what_monitors_title": "Expand: what this page checks", @@ -83,6 +85,8 @@ def ui(lang: str, key: str, **kwargs) -> str: "jump_first_error": "Aller à la première erreur", "jump_first_warn": "Aller au premier avertissement", "generated": "généré", + "version": "version", + "source": "source", "what_monitors": "Ce que cette page contrôle", "what_monitors_title": "Déplier : ce que cette page vérifie", @@ -412,6 +416,8 @@ def sticky_bar_html( first_err_href: str | None, first_warn_href: str | None, scope: dict[str, object] | None = None, + suite_version: str = "", + suite_version_url: str = "", ) -> str: level = status_level(n_err, n_warn) lang = "en" @@ -469,6 +475,20 @@ def sticky_bar_html( f" · {html.escape(suite_path)}" if suite_path else "" ) + # Version badge (linked to Forgejo tag when available) + ver = (suite_version or "").strip() + ver_url = (suite_version_url or "").strip() + if ver: + if ver_url: + version_html = ( + f'{html.escape(ver)}' + ) + else: + version_html = f'{html.escape(ver)}' + else: + version_html = "" # Compact sticky row always visible; "Was geprüft wird" expands inside sticky-bar return f"""