1.4 KiB
Reporting Relay
report_sql.py can be the sole client of the FreeDMR TCP reporting socket and
provide a compatible downstream socket for the live dashboard. This avoids
placing multiple reporting consumers on the live server while retaining the
existing netstring protocol.
The existing six positional arguments are unchanged. Enable the relay with:
python report_sql.py freedmr 4321 dbhost dbuser dbpassword logs \
--relay-interface 127.0.0.1 --relay-port 4322
Configure FDMR Monitor to connect to relay port 4322. Use an explicit
container-facing interface instead of 127.0.0.1 when the dashboard runs in a
different container, and restrict access to that interface at the network
boundary. Report configuration and bridge-state messages contain trusted
Python pickle data and must not be exposed to untrusted clients.
The relay forwards upstream messages unchanged and caches only the latest configuration and bridge-state messages so a newly connected dashboard can be initialized immediately. SQL storage accepts both legacy events and extended events with trailing origin fields:
START: type,event,trx,system,streamid,peerid,subid,slot,dstid,source_server,source_rptr
END: type,event,trx,system,streamid,peerid,subid,slot,dstid,duration,source_server,source_rptr
Legacy events remain valid and are stored with null origin columns. The relay
is optional; omitting --relay-port preserves the previous importer behavior.