From e8e065659d0a4bfa6e22c1cd335ce463688bf1ce Mon Sep 17 00:00:00 2001 From: Shane Daley <76499782+ShaYmez@users.noreply.github.com> Date: Thu, 3 Sep 2026 23:19:13 +0100 Subject: [PATCH] Centralise dashboard and Docker versions. Read the dashboard label from this repo's VERSION file, and show the installer VERSION in the footer only on hblink3-docker-install hosts. --- .gitattributes | 1 + CHANGELOG.md | 10 +++++++ Dockerfile | 2 +- README.md | 13 ++++++-- VERSION | 1 + hbmon-config.py | 2 +- html/elements/footer.php | 4 +-- html/include/version.php | 64 ++++++++++++++++++++++++++++++++++++++-- monitor.py | 2 +- 9 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 VERSION diff --git a/.gitattributes b/.gitattributes index 4d39ec0..cfb9abf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,3 +9,4 @@ *.cfg text eol=lf *.conf text eol=lf *.php text eol=lf +VERSION text eol=lf diff --git a/CHANGELOG.md b/CHANGELOG.md index ba5b8e2..0d57b5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to HBMonv2 will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.1.0] - 2026-09-03 + +### Added +- Talkgroup Info reads `talkgroup_ids.json`; Talkgroup Manager CRUD with CLI users +- Dashboard version is the `VERSION` file; footer Docker version is read from hblink3-docker-install when that stack is present + +### Changed +- Standalone installs omit the footer Docker version line + ## [2.0.2] - 2025-12-14 ### Added @@ -63,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Version History +- **2.1.0** (2026-09-03): Talkgroup manager, live talkgroup info, central VERSION file - **2.0.2** (2025-12-14): HTML5 compliance, security improvements, code quality enhancements - **1.6.9** (2024-06-14): Previous stable release - **Original**: HBMonitor by N0MJS, further developed by KC1AWV, adapted by SP2ONG diff --git a/Dockerfile b/Dockerfile index a596d1e..4e8c892 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ############################################################################### # Copyright (C) 2024-2025 Shane aka, ShaYmez -# Version 2.0.2 +# Version 2.1.0 ############################################################################### FROM python:3.12-alpine3.21 diff --git a/README.md b/README.md index 07a1116..07d2957 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ **HBmonitor is a "web dashboard" for HBlink by N0MJS. Further developed by Steve KC1AWV** ***Version - HBMonV2 by SP2ONG 2019-2022*** -***Docker Version 2.0.2 by ShaYmez M0VUB 2020-2025*** +***Dashboard version: VERSION file in this repository*** +***Docker version (footer): VERSION from hblink3-docker-install, only when that stack is installed*** The main difference between HBMonitor v1 and v2 is the layout, i.e. the main page shows condensed information and on the subpages, you can see the individual content that was shown on v1 @@ -37,8 +38,14 @@ php support running on the server. the access will then be http://hbmon.dmrserver.org In the html/include/ directory there is a config.php file in which you - set the color theme and name for your Dashboard. - + set the color theme and name for your Dashboard. + + Dashboard Version (top of each page) is the VERSION file in this + repository (/opt/HBMonv2/VERSION). The footer still shows SP2ONG + as the dashboard author. The Docker Version line is shown only when + this host was installed with hblink3-docker-install (compose file or + .installer_path present) and is read from that repo's VERSION. + In the html/include/config.php you can defined height of Server Activity window: 45px; 1 row, 60px 2 rows, 80px 3 rows: define("HEIGHT_ACTIVITY","45px"); diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..7ec1d6d --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2.1.0 diff --git a/hbmon-config.py b/hbmon-config.py index c6f2770..27743c9 100644 --- a/hbmon-config.py +++ b/hbmon-config.py @@ -1,4 +1,4 @@ -##### Version 2.0.2 ##### +##### Version 2.1.0 ##### ##### DOCKER CONFIG ONLY USE THIS WHEN USING A DOCKERIZED ENVIROMENT ##### CONFIG_INC = True # Include HBlink stats HOMEBREW_INC = True # Display Homebrew Peers status diff --git a/html/elements/footer.php b/html/elements/footer.php index f063fc7..0658e86 100644 --- a/html/elements/footer.php +++ b/html/elements/footer.php @@ -1,8 +1,8 @@

-Cortney T. Buffington, N0MJS. HBlink3. Copyright © 2016-2025
The Regents of the K0USY Group. All Rights Reserved.
Version SP2ONG 2019-2025
Docker Version 2.0.2
+Cortney T. Buffington, N0MJS. HBlink3. Copyright © 2016-2025
The Regents of the K0USY Group. All Rights Reserved.
Version SP2ONG 2019-2025
Docker Version

-
\ No newline at end of file + diff --git a/html/include/version.php b/html/include/version.php index e9ed5bc..206b5f3 100644 --- a/html/include/version.php +++ b/html/include/version.php @@ -1,4 +1,62 @@ + +function hbmon_read_version_file($path) { + if ($path === '' || !is_readable($path)) { + return ''; + } + $raw = @file_get_contents($path); + if ($raw === false) { + return ''; + } + $raw = str_replace("\r", '', $raw); + $line = trim(strtok($raw, "\n")); + return $line; +} + +function hbmon_dashboard_version() { + $candidates = array( + '/opt/HBMonv2/VERSION', + ); + $repo = dirname(__DIR__, 2).'/VERSION'; + if (!in_array($repo, $candidates, true)) { + $candidates[] = $repo; + } + foreach ($candidates as $path) { + $ver = hbmon_read_version_file($path); + if ($ver !== '') { + return $ver; + } + } + return '2.1.0'; +} + +function hbmon_docker_version() { + $compose = '/etc/hblink3/docker-compose.yml'; + $marker = '/etc/hblink3/.installer_path'; + if (!is_file($compose) && !is_file($marker)) { + return ''; + } + $inst = hbmon_read_version_file($marker); + $candidates = array(); + if ($inst !== '') { + $candidates[] = rtrim($inst, '/').'/VERSION'; + } + $candidates[] = '/opt/hblink3-docker-install/VERSION'; + foreach ($candidates as $path) { + $ver = hbmon_read_version_file($path); + if ($ver !== '') { + return $ver; + } + } + return ''; +} + +if (!defined('DASH')) { + define('DASH', hbmon_dashboard_version()); +} +if (!defined('VERSION')) { + define('VERSION', 'Ver '.DASH); +} +if (!defined('DOCKER_VERSION')) { + define('DOCKER_VERSION', hbmon_docker_version()); +} diff --git a/monitor.py b/monitor.py index 53a1bde..781953d 100644 --- a/monitor.py +++ b/monitor.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Version 2.0.2 +# Version 2.1.0 ############################################################################### # Copyright (C) 2016-2019 Cortney T. Buffington, N0MJS #