Merge jayReflector additions: per-trunk filters, node-list, PTY mute

Ports DJ1JAY / FM-Funknetz' jayReflector features (https://github.com/dj1jay/jayReflector)
into GeuReflector while keeping the in-process MqttPublisher.

Per-trunk config (TrunkLink): BLACKLIST_TGS, ALLOW_TGS, TG_MAP (with
explicit-route bypass of the prefix routing check), PEER_ID. New helpers
TgFilter.h provide exact / "24*" / "10-20" syntax shared across keys.

Wire protocol (additive, backward compatible — older peers ignore unknown
types): MsgTrunkNodeList (type 121) carries callsign + current_tg + optional
lat/lon/QTH; MsgTrunkFilter (type 122) reserved for satellite TG filters.

Reflector emits debounced (500 ms) MsgTrunkNodeList to all trunk peers on
local client login/logout/TG change. Inbound lists are republished via MQTT
under nodes/<peer_id>; the local list under nodes/local. New MQTT_NAME global
key inserts a path component so several reflectors can share a TOPIC_PREFIX.

PTY commands (Reflector): TRUNK MUTE|UNMUTE <section> <callsign>,
TRUNK RELOAD [<section>] re-reads BLACKLIST_TGS/ALLOW_TGS/TG_MAP without
restart, TRUNK STATUS [<section>] dumps a one-line summary per link.
Mute is applied on the inbound audio path.

Tests: 8 new integration tests (19-27) plus a TEST_PEER_FILTER fixture in
topology.py. Tests cover PEER_ID hello, BLACKLIST/ALLOW/TG_MAP semantics,
PTY MUTE/RELOAD/STATUS via docker exec, MQTT_NAME topic namespacing, and
node-list emission. Total now 27 tests.

Docs: docs/JAY-additions.md credits DJ1JAY / FM-Funknetz and lists every
merged feature with file pointers and the filter-evaluation order.
README.md links it. svxreflector.conf.in documents every new key.

Bumps SVXREFLECTOR to 1.3.99.13+trunk.
This commit is contained in:
Audric committed 2026-04-14 23:48:03 +02:00
1 parent 6f5138cd11
commit 5708e2d0e8
17 files changed
+1287 -58

No files matched your search

+31 -1
View File
@@ -16,7 +16,7 @@ bash run_tests.sh
This will:
1. Generate configs and `docker-compose.test.yml` from `topology.py`
2. Build and start the 3-reflector mesh
3. Run 17 automated tests
3. Run 27 automated tests
4. Enter an interactive prompt to manually test any TG number
5. Tear down the mesh on exit (or Ctrl-C)
@@ -126,6 +126,36 @@ Simulates a V2 SvxLink client. Performs the full TCP authentication handshake (P
|---|------|-----------------|
| 17 | Bidirectional trunk conversation | Client-A on reflector-a talks on a TG owned by reflector-b, Client-B on reflector-b receives it; Client-B replies, Client-A receives the return audio (peer interest tracking) |
### MQTT Publishing
| # | Test | What it verifies |
|---|------|-----------------|
| 18 | MQTT talker event | Talker start/stop on a trunk publishes to `<prefix>/talker/<tg>/(start|stop)` |
| 26 | `MQTT_NAME` in topic | Reflector with `MQTT_NAME=mqname-c` publishes node-list under `<prefix>/c/mqname-c/nodes/local` |
### Per-Trunk Filters and Mapping (jayReflector additions)
A third test peer `TRUNK_TEST_FILTER` (prefix `7`, secret `test_secret_filter`)
is configured with `PEER_ID=filter-peer`, `BLACKLIST_TGS=12345`,
`ALLOW_TGS=7*,1220`, and `TG_MAP=7000:1220` so these tests can verify
each filter independently of the other trunk fixtures.
| # | Test | What it verifies |
|---|------|-----------------|
| 19 | `PEER_ID` in hello | Reflector advertises the configured `PEER_ID` (not the section name) in `MsgTrunkHello` |
| 20 | `BLACKLIST_TGS` drops TG | TalkerStart on a blacklisted TG is dropped (not in `/status` active talkers) |
| 21 | `ALLOW_TGS` whitelist | TG matching the whitelist passes; TG outside is dropped |
| 22 | `TG_MAP` remap | TalkerStart on wire TG `7000` is remapped and tracked as local TG `1220` |
| 23 | PTY `TRUNK STATUS` | Command is accepted; `TRUNK_TEST_FILTER` is loaded by the reflector |
| 24 | PTY `TRUNK MUTE` | Audio from a muted callsign is dropped before reaching local clients |
| 25 | PTY `TRUNK RELOAD` | After live `CFG` update of `BLACKLIST_TGS`, `TRUNK RELOAD` re-reads it and the formerly-allowed TG is now blocked |
### Trunk Node-List Exchange
| # | Test | What it verifies |
|---|------|-----------------|
| 27 | `MsgTrunkNodeList` emission | Connecting a V2 client triggers a debounced node-list send to trunk peers; the harness receives a `MsgTrunkNodeList` (type 121) containing the new client |
## Interactive Mode
After the automated tests pass, an interactive prompt lets you test any TG number: