From 4a4a9cd0ad717d6b5fd54eef7065b792957cb8f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A2ni=20Marques?= Date: Sun, 19 Jul 2026 00:30:34 +0200 Subject: [PATCH] release 1.7.0: --ver/--version/-V prints version, commit, repo --- README.md | 3 ++- VERSION | 2 +- VERSIONS.md | 11 ++++---- taler-monitoring.sh | 62 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2db24f3..73f19fa 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ Mattermost chat: `./taler-monitoring.sh mattermost` (default `https://mattermost Mail (firefly/pixel): `./taler-monitoring.sh mail` Full local GOA example: `./taler-monitoring.sh -d hacktivism.ch urls inside versions` -Repo: https://git.hacktivism.ch/hernani/taler-monitoring · tree: `~/src/taler-monitoring` +Repo: https://git.hacktivism.ch/hernani/taler-monitoring · tree: `~/src/taler-monitoring` +Version: `./taler-monitoring.sh --ver` (or `--version` / `-V`) Host packages (koopa / runners): **[DEPENDENCIES.md](./DEPENDENCIES.md)**. Host-agents (GOA + FP; shared report pipeline): **[host-agent/README.md](./host-agent/README.md)**. diff --git a/VERSION b/VERSION index ce6a70b..9dbb0c0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.0 \ No newline at end of file +1.7.0 \ No newline at end of file diff --git a/VERSIONS.md b/VERSIONS.md index 43140f7..2d163d4 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -13,11 +13,12 @@ Tags and `VERSION` use **MAJOR.FEATURE.FIX** (three components): | **FEATURE** | New capabilities (phases, HTML features, i18n packs, …) | | **FIX** | Bugfixes and docs that do not add a feature | -Git tags: `vMAJOR.FEATURE.FIX` (e.g. `v1.6.0`). File `VERSION` omits the `v` prefix. +Git tags: `vMAJOR.FEATURE.FIX` (e.g. `v1.7.0`). File `VERSION` omits the `v` prefix. | Tag | Date (UTC) | Notes | |-----|------------|--------| -| **v1.7.0** | *planned* | **L10n** packs for user-facing strings that need localization: **fr-CH** (FrancPaysan) and **de-CH** (hacktivism / Taler CH German). | +| **v1.8.0** | *planned* | **L10n** packs for user-facing strings that need localization: **fr-CH** (FrancPaysan) and **de-CH** (hacktivism / Taler CH German). | +| **v1.7.0** | 2026-07-18 | **CLI version:** `./taler-monitoring.sh --ver` / `--version` / `-V` prints suite version, git commit, branch, and repo/tag/commit URLs. | | **v1.6.0** | 2026-07-18 | **Mail monitoring:** phase `mail` (`check_mail.sh` + `mail-catalog.conf`) for **firefly** (taler.net, gnunet.org) and **pixel**/TSA (taler-systems.com, mail.anastasis.lu); MX/SMTP/IMAP/SPF/DMARC; host-agent `/taler-monitoring-mail*`. | | **v1.5.0** | 2026-07-18 | **Mattermost monitoring:** phase `mattermost` (`check_mattermost.sh`) for `mattermost.taler.net` (SPA + `/api/v4/system/ping` + TLS); host-agent HTML `/taler-monitoring-mattermost*`; hourly timer. | | **v1.4.1** | 2026-07-18 | **Docs/versioning:** canonical tree `~/src/taler-monitoring`; docs use generic ops/outside-runner wording (no client hostnames); tags always **MAJOR.FEATURE.FIX**. | @@ -34,7 +35,7 @@ Older short tags (`v1`, `v1.0`, `v1.1`, `v1.2`, `v1.3`) are obsolete; use the th ## Sticky bar version (v1.3.0+) -Generated HTML shows the installed release tag (e.g. `v1.6.0`) next to the host line. +Generated HTML shows the installed release tag (e.g. `v1.7.0`) next to the host line. Clicking opens the tag page on Forgejo: `https://git.hacktivism.ch/hernani/taler-monitoring/src/tag/` @@ -66,11 +67,11 @@ sudo ~/koopa-caddy/apply-monitoring-live.sh | Env | `TALER_MON_LANG=en` or `fr` | | Auto | `*lefrancpaysan*` → fr, else en | -Full locale packs (fr-CH / de-CH) are scheduled for **v1.7.0**. +Full locale packs (fr-CH / de-CH) are scheduled for **v1.8.0**. ## Pin a release ```bash git clone https://git.hacktivism.ch/hernani/taler-monitoring.git ~/src/taler-monitoring -cd ~/src/taler-monitoring && git checkout v1.6.0 +cd ~/src/taler-monitoring && git checkout v1.7.0 ``` diff --git a/taler-monitoring.sh b/taler-monitoring.sh index 24d77e1..e149fd7 100755 --- a/taler-monitoring.sh +++ b/taler-monitoring.sh @@ -12,6 +12,66 @@ set -euo pipefail ROOT=$(cd "$(dirname "$0")" && pwd) +# --- suite identity (also: --ver / --version / -V) --- +SOURCE_REPO_WEB="${SOURCE_REPO_WEB:-https://git.hacktivism.ch/hernani/taler-monitoring}" +SOURCE_REPO_GIT="${SOURCE_REPO_GIT:-https://git.hacktivism.ch/hernani/taler-monitoring.git}" + +print_version() { + local ver tag commit commit_full dirty branch + ver="unknown" + if [ -f "$ROOT/VERSION" ]; then + ver=$(tr -d "[:space:]" <"$ROOT/VERSION" | sed "s/^v//") + fi + tag="" + commit="unknown" + commit_full="" + branch="" + dirty="" + if git -C "$ROOT" rev-parse --git-dir >/dev/null 2>&1; then + tag=$(git -C "$ROOT" describe --tags --exact-match 2>/dev/null || true) + if [ -z "$tag" ]; then + tag=$(git -C "$ROOT" describe --tags --abbrev=0 2>/dev/null || true) + fi + commit=$(git -C "$ROOT" rev-parse --short=12 HEAD 2>/dev/null || echo unknown) + commit_full=$(git -C "$ROOT" rev-parse HEAD 2>/dev/null || true) + branch=$(git -C "$ROOT" rev-parse --abbrev-ref HEAD 2>/dev/null || true) + if [ -n "$(git -C "$ROOT" status --porcelain 2>/dev/null)" ]; then + dirty=" (dirty)" + fi + fi + if [ -n "$tag" ] && [ "$tag" = "v$ver" ]; then + printf "taler-monitoring %s\n" "$tag" + else + printf "taler-monitoring v%s\n" "$ver" + fi + printf "version: %s\n" "$ver" + if [ -n "$tag" ]; then + if [ "$tag" = "v$ver" ]; then + printf "tag: %s\n" "$tag" + else + printf "git-tag: %s (tree; VERSION file is %s)\n" "$tag" "$ver" + fi + fi + printf "commit: %s%s\n" "$commit" "$dirty" + [ -n "$branch" ] && [ "$branch" != "HEAD" ] && printf "branch: %s\n" "$branch" + printf "repo: %s\n" "$SOURCE_REPO_WEB" + printf "clone: %s\n" "$SOURCE_REPO_GIT" + if [ -n "$commit_full" ]; then + printf "commit-url: %s/src/commit/%s\n" "$SOURCE_REPO_WEB" "$commit_full" + fi + if [ -n "$tag" ]; then + printf "tag-url: %s/src/tag/%s\n" "$SOURCE_REPO_WEB" "$tag" + fi +} + +# Fast path: version before loading lib.sh / phases +case "${1:-}" in + --ver|--version|-V) + print_version + exit 0 + ;; +esac + # Line-buffered stdout/stderr so redirected logs (tee/host-agent) flush each line. if [ "${_TALER_MON_STDBUF:-0}" != "1" ] && command -v stdbuf >/dev/null 2>&1; then export _TALER_MON_STDBUF=1 @@ -61,6 +121,7 @@ Options: --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) + --ver, --version, -V print suite version, git commit, and repo URLs -h, --help Add a stack: edit domains.conf (name + bank + exchange + merchant + currency). @@ -159,6 +220,7 @@ while [ $# -gt 0 ]; do i18n_init 2>/dev/null || true ;; -h|--help) usage; exit 0 ;; + --ver|--version|-V) print_version; exit 0 ;; -d|--domain) [ $# -ge 2 ] || { echo "missing arg for $1" >&2; exit 2; } apply_taler_domain "$2"