You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+34-2Lines changed: 34 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,27 @@
2
2
3
3
All notable changes to this project will be documented in this file.
4
4
5
+
## [3.0.0] - 2025-11-09
6
+
### Added
7
+
- Dynamic WAN selection and runtime orchestration via `azctl wan-manager`:
8
+
- Evaluates candidate uplink interfaces and selects the healthiest WAN at boot and runtime.
9
+
- Writes health snapshots to `runtime/wan_state.json` (production path `/var/run/azazel/wan_state.json`); path can be overridden with `AZAZEL_WAN_STATE_PATH`.
- On WAN change, the manager reapplies traffic control (`bin/azazel-traffic-init.sh`), refreshes NAT, and restarts dependent services (Suricata, `azctl-unified`).
12
+
13
+
- Universal runtime interface resolution for consumers:
14
+
- CLI/TUI, scripts, and services now prefer explicit CLI args → environment variables (`AZAZEL_WAN_IF` / `AZAZEL_LAN_IF`) → WAN manager state → configuration values → final fallback.
15
+
- Added `AZAZEL_WAN_CANDIDATES` and `AZAZEL_WAN_STATE_PATH` environment variables for operational control and testing.
16
+
17
+
### Changed
18
+
- Scripts and documentation updated to use parameterized interface references (`${AZAZEL_WAN_IF:-<fallback>}` and `${AZAZEL_LAN_IF:-<fallback>}`) in help text and examples. Where safe, runtime resolution now uses the WAN manager helper instead of hard-coded interface names.
19
+
20
+
### Notes
21
+
- Backwards-compatible: explicit CLI flags and environment variables still override runtime selection. Existing deployments should continue to work; review scripts that assume literal interface names before automating deployment.
22
+
- Tests and shell syntax checks were run after edits; no regressions detected in the unit test suite.
23
+
- QoS features are opt-in via systemd service enablement.
24
+
- All changes maintain backward compatibility with existing configurations.
25
+
5
26
## [2.2.0] - 2025-11-07
6
27
### Added
7
28
-**Internal Network QoS Control**: Comprehensive privilege-based traffic shaping and security enforcement for LAN devices.
@@ -20,6 +41,7 @@ All notable changes to this project will be documented in this file.
20
41
### Changed
21
42
- QoS scripts support DRY_RUN mode (print commands without execution, no root required).
22
43
- All QoS scripts are idempotent (safe to re-run).
44
+
- Dynamic WAN selection: `wan-manager` now determines the active WAN interface at runtime and writes runtime/wan_state.json. Consumers (CLI, TUI, scripts) will use that selection by default when `--wan-if` is omitted. Environment variables `AZAZEL_WAN_IF` and `AZAZEL_LAN_IF` may be used to override defaults where needed.
23
45
24
46
### Security
25
47
- MAC address verification prevents ARP spoofing for privileged devices.
@@ -34,8 +56,6 @@ All notable changes to this project will be documented in this file.
34
56
35
57
### Notes
36
58
- Minor version bump (2.1.0 → 2.2.0) adds significant new QoS feature without breaking existing functionality.
37
-
- QoS features are opt-in via systemd service enablement.
38
-
- All changes maintain backward compatibility with existing configurations.
39
59
40
60
## [2.1.0] - 2025-11-07
41
61
### Added
@@ -84,6 +104,18 @@ Semantic versioning: MAJOR.MINOR.PATCH. Deprecations queued for removal after at
84
104
## [1.0.0] - 2025-10-05
85
105
### Initial release
86
106
- Initial public baseline of Azazel-Pi with core features:
107
+
108
+
## [3.1.0] - 2025-11-09
109
+
### Added
110
+
- Display: clear and force a full E-Paper refresh when the active WAN interface changes (e.g. eth0 -> wlan1) to avoid ghosting and show the updated interface/IP immediately. (commit 478b8ee)
111
+
- Status collection: prefer kernel default route when runtime WAN state is missing and provide a `wan_state_path` injection point for testing/overrides.
112
+
- Renderer: improve network line formatting by removing the redundant "WAN" prefix and suppressing non-actionable "[WAN] unknown" messages; reserve footer area to prevent text overlap.
113
+
114
+
### Changed
115
+
- Backwards-compatible `StatusCollector` initialization handling in `epd_daemon` — older installs without the new `wan_state_path` parameter are tolerated.
116
+
117
+
### Notes
118
+
- These are backward-compatible improvements (minor release). See commit 478b8ee for details and files changed: `azazel_pi/core/display/status_collector.py`, `epd_daemon.py`, `renderer.py`.
87
119
- Suricata integration for network threat detection
88
120
- AI-based threat evaluation pipeline and scoring
89
121
- Basic TUI and CLI utilities for status and control
See [`docs/en/EPD_SETUP.md`](docs/en/EPD_SETUP.md) for complete E-Paper configuration instructions.
205
215
216
+
## Running tests (developer)
217
+
218
+
This project uses a local virtual environment at `.venv` for development tests. To run the unit tests that exercise E-Paper rendering in emulation mode, do the following:
219
+
220
+
1. Activate or create the virtual environment (example):
221
+
222
+
```bash
223
+
python3 -m venv .venv
224
+
source .venv/bin/activate
225
+
pip install -U pip
226
+
pip install -r requirements-dev.txt
227
+
```
228
+
229
+
2. Install optional dependencies used by E-Paper rendering (Pillow) if not included in `requirements-dev.txt`:
230
+
231
+
```bash
232
+
pip install pillow
233
+
```
234
+
235
+
3. Run tests (example):
236
+
237
+
```bash
238
+
.venv/bin/pytest tests/core/test_epd_daemon.py -q
239
+
```
240
+
241
+
Notes:
242
+
- The E-Paper renderer supports `--emulate` which avoids hardware access and writes a PNG file when run in `--mode test`.
243
+
- Use `--wan-state-path` to point the renderer/collector at a custom WAN state file for integration testing.
244
+
206
245
### Optional: Front Mattermost with Nginx
207
246
208
247
To serve Mattermost via Nginx reverse proxy (recommended), use the provided template and setup script:
@@ -229,7 +268,7 @@ The interactive Terminal User Interface (TUI) menu provides comprehensive system
229
268
python3 -m azctl.cli menu
230
269
231
270
# With specific interface configuration
232
-
python3 -m azctl.cli menu --lan-if wlan0 --wan-if wlan1
271
+
python3 -m azctl.cli menu --lan-if ${AZAZEL_LAN_IF:-wlan0} --wan-if ${AZAZEL_WAN_IF:-wlan1}
1.**Edit Core Configuration**: Modify `/etc/azazel/azazel.yaml` to adjust delay values, bandwidth controls, and lockdown allowlists (template at `configs/network/azazel.yaml`).
389
-
- By default, `wlan0` is treated as the internal LAN (AP), and both `wlan1` and `eth0` are considered external (WAN/uplink) interfaces. See `interfaces.external: ["eth0", "wlan1"]` in `configs/network/azazel.yaml` and adjust as needed.
433
+
- Interface defaults: `${AZAZEL_LAN_IF:-wlan0}` is typically treated as the internal LAN (AP); `${AZAZEL_WAN_IF:-wlan1}` and `${AZAZEL_WAN_IF:-eth0}` are common external (WAN/uplink) candidates and are listed under `interfaces.external` in `configs/network/azazel.yaml`.
434
+
Note: Azazel now prefers a runtime WAN selection produced by the WAN manager when `--wan-if` is not provided. To explicitly override the chosen interfaces, set the environment variables `AZAZEL_WAN_IF` and/or `AZAZEL_LAN_IF` before running commands or scripts.
435
+
- Override options:
436
+
- CLI: pass `--lan-if` and/or `--wan-if` to `azctl` commands to explicitly set interfaces.
437
+
- Environment: set `AZAZEL_LAN_IF` or `AZAZEL_WAN_IF` to change defaults for scripts and services.
438
+
- Dynamic: if `--wan-if` is omitted, `azctl` will query the WAN manager (recommended) to pick the active WAN interface based on runtime health checks.
390
439
391
440
2.**Generate Suricata Rules**: Use `scripts/suricata_generate.py` to render environment-specific IDS configurations
5.**Monitor Operations**: Analyze scoring results in `decisions.log` and use `azctl` for manual mode switching during incidents
398
447
448
+
### Dynamic WAN Selection (NEW)
449
+
450
+
- The `azctl wan-manager` service evaluates all candidate WAN interfaces (from `interfaces.external`) after boot and continuously during runtime.
451
+
- Health snapshots (link status, IP presence, estimated speed) are written to `runtime/wan_state.json` (or `/var/run/azazel/wan_state.json` on deployed systems) and surfaced on the E-Paper display. You can override the default path with the `AZAZEL_WAN_STATE_PATH` environment variable when testing or for non-standard deployments.
452
+
- The WAN manager reads candidate lists in order of precedence: explicit CLI `--candidate` arguments, the `AZAZEL_WAN_CANDIDATES` environment variable (comma-separated), values declared in `configs/network/azazel.yaml` (`interfaces.external` or `interfaces.wan`), then safe fallbacks. Use `AZAZEL_WAN_CANDIDATES` to force a specific candidate ordering without changing config files.
453
+
- When the active interface changes, the manager reapplies `bin/azazel-traffic-init.sh`, refreshes NAT (`iptables -t nat`), and restarts dependent services (Suricata and `azctl-unified`) so they immediately consume the new interface.
454
+
- Suricata now launches through `azazel_pi.core.network.suricata_wrapper`, which reads the same WAN state file, so restarting the service is sufficient to follow the latest selection.
455
+
456
+
Developer note — non-root testing and fallback behavior
457
+
458
+
- The WAN manager will attempt to write the runtime state file to a system runtime path (for example `/var/run/azazel/wan_state.json`) when running as a system service. On systems where the process does not have permission to create `/var/run/azazel`, the manager now falls back automatically to a repository-local path `runtime/wan_state.json` so developers can run and test `azctl wan-manager` without root.
459
+
- For explicit control in tests or non-standard deployments, set `AZAZEL_WAN_STATE_PATH` to a writable path before running the manager. Example (development):
460
+
461
+
```bash
462
+
# write state into the repository runtime directory (no root required)
- For production systems, run the WAN manager via systemd (root) so that traffic-init, iptables/nft, and service restarts run with the required privileges. Example (recommended for deployed systems):
0 commit comments