feat: finalize server architecture and real-time status badge

This commit is contained in:
2026-04-26 14:59:46 +02:00
parent 05a116b338
commit 90c18a3669
2 changed files with 271 additions and 105 deletions
+127 -105
View File
@@ -1,4 +1,4 @@
# 📡 Fleet Control Console (Server) # 📡 Fleet Control Console - Server (Central Hub)
🌍 *[Read in English](#english) | 🇮🇹 [Leggi in Italiano](#italiano)* 🌍 *[Read in English](#english) | 🇮🇹 [Leggi in Italiano](#italiano)*
@@ -7,138 +7,160 @@
<a name="english"></a> <a name="english"></a>
## 🇬🇧 English ## 🇬🇧 English
**Fleet Control Console** is a professional, real-time command and control (C2) dashboard designed for amateur radio repeater networks (MMDVM). **Fleet Control Console** is a professional, real-time command and control (C2) dashboard designed for amateur radio repeater networks (MMDVM). This repository contains the **Server (Central Hub)** component, which provides a centralized web interface to monitor and manage a fleet of remote digital voice nodes (DMR, NXDN, YSF, P25).
![Dashboard Screenshot](images/dashboard.png) > ️ **Note:** This is the Central Server repository. To monitor remote repeaters, you must install the [Fleet Control Agent](link_al_repo_agent_qui) on each node.
### 🤖 Remote Agent ### 🏗️ Architecture & Technology Stack
To monitor your remote nodes (Raspberry Pi), download the dedicated lightweight agent here: The server acts as the brain of the network:
`https://git.arifvg.it/iv3jdv/web-console-agent.git` * **Backend:** Flask (Python) with `gevent` for high-concurrency handling.
* **Database:** SQLite (WAL mode) for robust User Management, Audit Logs, and Radio Traffic storage.
* **Communication:** MQTT for instant data routing + WebSockets (SocketIO) for zero-latency UI updates.
* **Frontend:** Vanilla JS with a modern *Glassmorphism* NOC (Network Operations Center) design.
### ✨ Features ### ✨ Ultimate Features
* **Zero-Latency Real-Time UI:** Powered by WebSockets (Socket.IO).
* **Web Push Notifications:** Instant alerts on desktop or mobile.
* **Centralized Telemetry & Service Management.**
* **Global Operations:** Switch profiles instantly.
### 🚀 Installation & Setup #### ⚡ Zero-Latency Real-Time Dashboard
* **WebSocket Powered:** The dashboard updates instantly upon radio traffic or telemetry changes. No heavy HTTP polling, no page reloads.
* **Live MQTT Status:** A real-time badge continuously monitors the connection to the MQTT broker, instantly alerting you if the backend loses connectivity.
* **PWA Ready:** Install the dashboard as a Progressive Web App on iOS/Android for a native, full-screen mobile experience.
------------------------------------------------------------ #### 🔔 Web Push Notifications
1. PRE-REQUISITES (CRITICAL) * Get instant, native alerts directly on your desktop or mobile device when:
------------------------------------------------------------ * A node goes offline or comes back online.
Before installing Python dependencies, you must install * A critical system daemon crashes (Auto-healing failed).
system compilers and development libraries. * Works securely even when the web app is closed or in the background.
Debian/Ubuntu: #### 🛠️ Advanced Remote Control & Maintenance
sudo apt update * **Remote .INI Editor:** Edit daemon configuration files (e.g., MMDVMHost.ini) directly from the web interface without SSH access.
sudo apt install build-essential python3-dev libssl-dev libffi-dev * **Service Management:** Start, Stop, or Restart remote system daemons with a single click.
* **Global Overrides:** Switch profiles (e.g., Profile A/B) or force updates simultaneously on all nodes in the fleet.
* **Hardware Interventions:** Trigger a physical OS reboot or a hard GPIO reset of the MMDVM HAT directly from the web panel.
Upgrade base pip tools: #### 📊 Unified Monitoring & Statistics
pip install --upgrade pip setuptools wheel * **Live Heard Log:** A centralized view of radio traffic across the entire network, auto-resolving DMR and NXDN IDs into callsigns.
* **Real-Time Telemetry:** Monitor CPU, RAM, Disk, and Temperature for every connected node.
* **Daily Analytics:** Automatically tracks Top Talkgroups, Top Callsigns, Average duration, and daily transit counts.
Create a virtual environment (Recommended): #### 🔐 Security & Access Control
python3 -m venv venv * **Role-Based Access Control (RBAC):** Create `admin` and `operator` accounts.
source venv/bin/activate * **Granular Permissions:** Restrict operators to view/control only specific repeaters.
pip install -r requirements.txt * **Audit Trail:** Every critical action (reboots, config edits, daemon restarts) is logged with the username, timestamp, and target node.
------------------------------------------------------------ ### 🚀 Installation Guide
2. SERVER SETUP (CENTRAL HUB)
------------------------------------------------------------
The server handles the web interface and user permissions.
Steps: #### 1. System Pre-requisites (Critical)
1. Configure 'config.json' using 'config.example.json'. Before installing Python dependencies, install the necessary system compilers and pip/venv tools. On Debian/Ubuntu:
2. Enter MQTT credentials and VAPID keys. ```bash
3. Define repeaters in the 'clients.json' file. sudo apt update
4. Install production WSGI server packages (if not in requirements): sudo apt install build-essential python3-dev libssl-dev libffi-dev python3-pip python3-venv
pip install gunicorn gevent gevent-websocket ```
5. Start the production server:
gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" -w 1 --bind 0.0.0.0:9000 app:app
------------------------------------------------------------ #### 2. Virtual Environment Setup (Recommended)
3. GENERATING VAPID KEYS (PUSH NOTIFICATIONS) To prevent conflicts with OS packages (PEP 668), create an isolated environment:
------------------------------------------------------------ ```bash
⚠️ WARNING: Web Push Notifications strictly require the cd /opt/web-control-server
dashboard to be accessed via a secure HTTPS connection. python3 -m venv venv
They will NOT work over standard HTTP. source venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
```
1. Go to https://vapidkeys.com/ and generate the keys. #### 3. Configuration
2. Copy 'Public Key' and 'Private Key' into 'config.json'. 1. Copy `config.example.json` to `config.json`.
3. Set 'vapid_claim_email' (e.g., "mailto:your@email.com"). 2. Configure your MQTT broker credentials.
3. Define your repeaters in `clients.json`.
4. Generate VAPID keys at [vapidkeys.com](https://vapidkeys.com/) and add them to `config.json` to enable Web Push notifications. *(Note: Push notifications require HTTPS).*
------------------------------------------------------------ #### 4. Running as a Service
4. RUNNING AS A SERVICE (SYSTEMD) To run the server continuously in production using Gunicorn:
------------------------------------------------------------ ```bash
Configuration: sudo cp fleet-control.service /etc/systemd/system/
1. Copy .service file to '/etc/systemd/system/': sudo systemctl daemon-reload
sudo cp fleet-console.service /etc/systemd/system/ sudo systemctl enable fleet-control
2. Reload systemd: sudo systemctl daemon-reload sudo systemctl start fleet-control
3. Enable on boot: sudo systemctl enable fleet-console ```
4. Start service: sudo systemctl start fleet-console *(Ensure the `.service` file points to the `gunicorn` executable inside your `venv`)*.
---
<a name="italiano"></a> <a name="italiano"></a>
## 🇮🇹 Italiano ## 🇮🇹 Italiano
**Fleet Control Console** è una dashboard di comando e controllo (C2) professionale in tempo reale per le reti di ripetitori radioamatoriali (MMDVM). **Fleet Control Console** è una dashboard di comando e controllo (C2) professionale in tempo reale, progettata per le reti di ripetitori radioamatoriali (MMDVM). Questo repository contiene il **Server (Central Hub)**, che fornisce un'interfaccia web centralizzata per monitorare e gestire una flotta di nodi digitali remoti (DMR, NXDN, YSF, P25).
![Schermata Dashboard](images/dashboard.png) > ️ **Nota:** Questo è il repository del Server Centrale. Per monitorare i ripetitori, devi installare il [Fleet Control Agent](link_al_repo_agent_qui) su ciascun nodo remoto.
### 🤖 Agente Remoto ### 🏗️ Architettura e Tecnologie
Per monitorare i tuoi nodi remoti (Raspberry Pi), scarica l'agente dedicato qui: Il server agisce da cervello della rete:
`https://git.arifvg.it/iv3jdv/web-console-agent.git` * **Backend:** Flask (Python) con `gevent` per la gestione ad alta concorrenza.
* **Database:** SQLite (in modalità WAL) per gestire in sicurezza Utenti, Log operativi e traffico radio.
* **Comunicazione:** MQTT per il routing istantaneo dei dati + WebSockets (SocketIO) per aggiornare la UI a latenza zero.
* **Frontend:** Vanilla JS con un moderno design *Glassmorphism* in stile NOC (Network Operations Center).
### ✨ Funzionalità ### ✨ Funzionalità Principali
* **Interfaccia Real-Time a Latenza Zero** tramite WebSockets.
* **Notifiche Push Web** per allarmi critici.
* **Telemetria Centralizzata e Gestione Servizi.**
* **Operazioni Globali** su tutta la rete.
### 🚀 Installazione #### ⚡ Dashboard Real-Time a Latenza Zero
* **Motore WebSocket:** La dashboard scatta all'istante al passaggio di traffico radio o ai cambi di telemetria. Nessun polling HTTP pesante, nessun refresh della pagina.
* **Stato MQTT Live:** Un badge in tempo reale monitora continuamente la connessione al broker MQTT, avvisandoti istantaneamente in caso di problemi di rete.
* **PWA Ready:** Installabile su smartphone Android e iOS come Progressive Web App per un'esperienza nativa a schermo intero.
------------------------------------------------------------ #### 🔔 Notifiche Web Push
1. REQUISITI PRELIMINARI (CRITICI) * Ricevi avvisi nativi e immediati su PC o smartphone quando:
------------------------------------------------------------ * Un nodo va offline o torna operativo.
Prima di installare le dipendenze Python, è necessario * Un demone di sistema remoto si blocca (fallimento auto-healing).
installare i compilatori di sistema. Senza questi, * Funzionano in modo sicuro anche quando la web app è chiusa o in background.
l'installazione di 'gevent' fallirà su VPS vergini.
Esegui su Debian/Ubuntu: #### 🛠️ Controllo Remoto & Manutenzione Avanzata
sudo apt update * **Editor .INI Remoto:** Modifica i file di configurazione (es. MMDVMHost.ini) direttamente dal pannello web, senza bisogno di accessi SSH.
sudo apt install build-essential python3-dev libssl-dev libffi-dev * **Gestione Demoni:** Avvia, arresta o riavvia i servizi di sistema remoti con un clic.
* **Override Globali:** Cambia i profili operativi (es. Profilo A/B) simultaneamente su tutta la rete.
* **Interventi Hardware:** Innesca un riavvio del sistema operativo o un reset fisico (tramite pin GPIO) della scheda MMDVM direttamente dall'interfaccia web.
Aggiorna gli strumenti di base di pip: #### 📊 Monitoraggio & Statistiche
pip install --upgrade pip setuptools wheel * **Log Ascolti Live:** Vista unificata in tempo reale del traffico radio di tutta la rete, con traduzione automatica degli ID DMR e NXDN in nominativi.
* **Telemetria in Diretta:** Monitora l'utilizzo di CPU, RAM, Disco e le Temperature per ogni nodo connesso.
* **Analisi Giornaliera:** Statistiche automatiche su Top Talkgroups, Top Callsign, durata media e numero totale di transiti.
Crea un ambiente virtuale (consigliato): #### 🔐 Sicurezza e Controllo Accessi
python3 -m venv venv * **Gestione Ruoli (RBAC):** Creazione di account `admin` e `operator`.
source venv/bin/activate * **Permessi Granulari:** Limita un operatore al controllo e alla visualizzazione di specifici ripetitori.
pip install -r requirements.txt * **Audit Trail:** Ogni azione critica (riavvii, modifiche file, gestione demoni) viene registrata con data, ora, utente e nodo di destinazione.
------------------------------------------------------------ ### 🚀 Guida all'Installazione
2. SETUP DEL SERVER
------------------------------------------------------------
Passaggi:
1. Configura 'config.json' partendo da 'config.example.json'.
2. Inserisci credenziali MQTT e chiavi VAPID.
3. Definisci i ripetitori in 'clients.json'.
4. Avvia il server di produzione:
gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" -w 1 --bind 0.0.0.0:9000 app:app
------------------------------------------------------------ #### 1. Requisiti di Sistema (Critici)
3. GENERAZIONE CHIAVI VAPID Prima di installare le dipendenze Python, installa i compilatori di base e gli strumenti per gli ambienti virtuali. Su Debian/Ubuntu:
------------------------------------------------------------ ```bash
⚠️ ATTENZIONE: Le notifiche push richiedono HTTPS. sudo apt update
sudo apt install build-essential python3-dev libssl-dev libffi-dev python3-pip python3-venv
```
1. Vai su https://vapidkeys.com/ e genera le chiavi. #### 2. Setup Ambiente Virtuale (Consigliato)
2. Copia 'Public Key' e 'Private Key' nel 'config.json'. Per evitare conflitti con i pacchetti di sistema (regola PEP 668), crea una "bolla" isolata:
3. Imposta 'vapid_claim_email' (es. "mailto:tua@email.com"). ```bash
cd /opt/web-control-server
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
```
#### 3. Configurazione Base
1. Copia `config.example.json` in `config.json`.
2. Inserisci le credenziali del broker MQTT.
3. Definisci i ripetitori nel file `clients.json`.
4. Genera le chiavi VAPID su [vapidkeys.com](https://vapidkeys.com/) e inseriscile in `config.json` per attivare le notifiche Push. *(Attenzione: le notifiche Push richiedono obbligatoriamente un certificato HTTPS).*
#### 4. Esecuzione come Servizio (systemd)
Per eseguire il server in produzione in modo continuo e stabile con Gunicorn:
```bash
sudo cp fleet-control.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable fleet-control
sudo systemctl start fleet-control
```
*(Assicurati che il file `.service` punti all'eseguibile `gunicorn` situato all'interno della cartella `venv`).*
------------------------------------------------------------
4. ESECUZIONE COME SERVIZIO
------------------------------------------------------------
1. sudo cp fleet-console.service /etc/systemd/system/
2. sudo systemctl daemon-reload
3. sudo systemctl enable fleet-console
4. sudo systemctl start fleet-console
--- ---
*Created by IV3JDV @ ARIFVG - 2026* *Created by IV3JDV @ ARIFVG - 2026*
+144
View File
@@ -0,0 +1,144 @@
# 📡 Fleet Control Console (Server)
🌍 *[Read in English](#english) | 🇮🇹 [Leggi in Italiano](#italiano)*
---
<a name="english"></a>
## 🇬🇧 English
**Fleet Control Console** is a professional, real-time command and control (C2) dashboard designed for amateur radio repeater networks (MMDVM).
![Dashboard Screenshot](images/dashboard.png)
### 🤖 Remote Agent
To monitor your remote nodes (Raspberry Pi), download the dedicated lightweight agent here:
`https://git.arifvg.it/iv3jdv/web-console-agent.git`
### ✨ Features
* **Zero-Latency Real-Time UI:** Powered by WebSockets (Socket.IO).
* **Web Push Notifications:** Instant alerts on desktop or mobile.
* **Centralized Telemetry & Service Management.**
* **Global Operations:** Switch profiles instantly.
### 🚀 Installation & Setup
------------------------------------------------------------
1. PRE-REQUISITES (CRITICAL)
------------------------------------------------------------
Before installing Python dependencies, you must install
system compilers and development libraries.
Debian/Ubuntu:
sudo apt update
sudo apt install build-essential python3-dev libssl-dev libffi-dev
Upgrade base pip tools:
pip install --upgrade pip setuptools wheel
Create a virtual environment (Recommended):
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
------------------------------------------------------------
2. SERVER SETUP (CENTRAL HUB)
------------------------------------------------------------
The server handles the web interface and user permissions.
Steps:
1. Configure 'config.json' using 'config.example.json'.
2. Enter MQTT credentials and VAPID keys.
3. Define repeaters in the 'clients.json' file.
4. Install production WSGI server packages (if not in requirements):
pip install gunicorn gevent gevent-websocket
5. Start the production server:
gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" -w 1 --bind 0.0.0.0:9000 app:app
------------------------------------------------------------
3. GENERATING VAPID KEYS (PUSH NOTIFICATIONS)
------------------------------------------------------------
⚠️ WARNING: Web Push Notifications strictly require the
dashboard to be accessed via a secure HTTPS connection.
They will NOT work over standard HTTP.
1. Go to https://vapidkeys.com/ and generate the keys.
2. Copy 'Public Key' and 'Private Key' into 'config.json'.
3. Set 'vapid_claim_email' (e.g., "mailto:your@email.com").
------------------------------------------------------------
4. RUNNING AS A SERVICE (SYSTEMD)
------------------------------------------------------------
Configuration:
1. Copy .service file to '/etc/systemd/system/':
sudo cp fleet-console.service /etc/systemd/system/
2. Reload systemd: sudo systemctl daemon-reload
3. Enable on boot: sudo systemctl enable fleet-console
4. Start service: sudo systemctl start fleet-console
<a name="italiano"></a>
## 🇮🇹 Italiano
**Fleet Control Console** è una dashboard di comando e controllo (C2) professionale in tempo reale per le reti di ripetitori radioamatoriali (MMDVM).
![Schermata Dashboard](images/dashboard.png)
### 🤖 Agente Remoto
Per monitorare i tuoi nodi remoti (Raspberry Pi), scarica l'agente dedicato qui:
`https://git.arifvg.it/iv3jdv/web-console-agent.git`
### ✨ Funzionalità
* **Interfaccia Real-Time a Latenza Zero** tramite WebSockets.
* **Notifiche Push Web** per allarmi critici.
* **Telemetria Centralizzata e Gestione Servizi.**
* **Operazioni Globali** su tutta la rete.
### 🚀 Installazione
------------------------------------------------------------
1. REQUISITI PRELIMINARI (CRITICI)
------------------------------------------------------------
Prima di installare le dipendenze Python, è necessario
installare i compilatori di sistema. Senza questi,
l'installazione di 'gevent' fallirà su VPS vergini.
Esegui su Debian/Ubuntu:
sudo apt update
sudo apt install build-essential python3-dev libssl-dev libffi-dev
Aggiorna gli strumenti di base di pip:
pip install --upgrade pip setuptools wheel
Crea un ambiente virtuale (consigliato):
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
------------------------------------------------------------
2. SETUP DEL SERVER
------------------------------------------------------------
Passaggi:
1. Configura 'config.json' partendo da 'config.example.json'.
2. Inserisci credenziali MQTT e chiavi VAPID.
3. Definisci i ripetitori in 'clients.json'.
4. Avvia il server di produzione:
gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" -w 1 --bind 0.0.0.0:9000 app:app
------------------------------------------------------------
3. GENERAZIONE CHIAVI VAPID
------------------------------------------------------------
⚠️ ATTENZIONE: Le notifiche push richiedono HTTPS.
1. Vai su https://vapidkeys.com/ e genera le chiavi.
2. Copia 'Public Key' e 'Private Key' nel 'config.json'.
3. Imposta 'vapid_claim_email' (es. "mailto:tua@email.com").
------------------------------------------------------------
4. ESECUZIONE COME SERVIZIO
------------------------------------------------------------
1. sudo cp fleet-console.service /etc/systemd/system/
2. sudo systemctl daemon-reload
3. sudo systemctl enable fleet-console
4. sudo systemctl start fleet-console
---
*Created by IV3JDV @ ARIFVG - 2026*