From 3027bb885e822426b1b5d37ebff027fda0342970 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 29 Jun 2026 15:30:48 +0100 Subject: [PATCH] Tidy release Docker and config artifacts --- .gitlab-ci.yml | 4 +- FreeDMR.cfg | 4 +- docker-configs/Dockerfile-ci | 8 +- docker-configs/Dockerfile-hbmonv2 | 35 ---- docker-configs/Dockerfile-hdstack | 35 ---- docker-configs/Dockerfile-noproxy | 35 ---- docker-configs/Dockerfile-proxy | 6 +- docker-configs/docker-compose_install.sh | 119 +---------- docker-configs/entrypoint-hbmonv2 | 23 --- docker-configs/entrypoint-hdstack | 25 --- docker-configs/entrypoint-noproxy | 22 --- docker-configs/freedmr.cfg | 35 ++-- docs/bridge-peer-examples.md | 150 ++++++++++++++ docs/v1x-codex-changelog.md | 25 ++- freedmr.cfg | 52 +++-- hblink-SAMPLE.cfg | 241 ----------------------- install.sh | 6 - 17 files changed, 244 insertions(+), 581 deletions(-) delete mode 100644 docker-configs/Dockerfile-hbmonv2 delete mode 100644 docker-configs/Dockerfile-hdstack delete mode 100644 docker-configs/Dockerfile-noproxy delete mode 100755 docker-configs/entrypoint-hbmonv2 delete mode 100755 docker-configs/entrypoint-hdstack delete mode 100755 docker-configs/entrypoint-noproxy create mode 100644 docs/bridge-peer-examples.md mode change 100755 => 100644 freedmr.cfg delete mode 100755 hblink-SAMPLE.cfg delete mode 100755 install.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85259fe..44fc813 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,14 +34,14 @@ build-dev: # This job runs in the build stage, which runs first. only: - master -build-extrastats: # This job runs in the build stage, which runs first. +build-extrastats: # Frozen reporting/export variant for global lastheard importer compatibility. stage: build tags: - buildx script: - echo "Compiling the code..." - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker buildx build --no-cache -f Dockerfile-ci -t gitlab.hacknix.net:5050/hacknix/freedmr:extrastats-development-latest --platform linux/amd64 --push . + - docker buildx build --no-cache -f docker-configs/Dockerfile-ci -t gitlab.hacknix.net:5050/hacknix/freedmr:extrastats-development-latest --platform linux/amd64 --push . - echo "Compile complete." only: - extrastats2 diff --git a/FreeDMR.cfg b/FreeDMR.cfg index ff592ca..01feabf 100644 --- a/FreeDMR.cfg +++ b/FreeDMR.cfg @@ -83,8 +83,8 @@ PORT: 54916 MASTER_IP: 127.0.0.1 MASTER_PORT: 54915 PASSPHRASE: passw0rd -CALLSIGN: ECHO -RADIO_ID: 1000001 +CALLSIGN: M0XFD +RADIO_ID: 2340210 RX_FREQ: 449000000 TX_FREQ: 444000000 TX_POWER: 25 diff --git a/docker-configs/Dockerfile-ci b/docker-configs/Dockerfile-ci index c70954f..d6297d9 100644 --- a/docker-configs/Dockerfile-ci +++ b/docker-configs/Dockerfile-ci @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ############################################################################### -FROM python:3.11-alpine +FROM python:3.11.15-alpine3.24 #ENTRYPOINT [ "/entrypoint" ] ENTRYPOINT ["/sbin/tini", "-g", "--", "/entrypoint"] @@ -24,12 +24,9 @@ COPY . /opt/freedmr RUN addgroup -g 54000 freedmr && \ adduser -D -u 54000 -G freedmr freedmr && \ - apk update && \ - apk add git gcc musl-dev supervisor && \ - apk add --no-cache tini && \ + apk add --no-cache git gcc musl-dev supervisor tini && \ cd /opt && \ cd /opt/freedmr && \ - ls -lah && \ pip install --no-cache-dir -r requirements.txt && \ apk del git gcc musl-dev && \ chown -R freedmr:freedmr /opt/freedmr && \ @@ -40,4 +37,3 @@ COPY docker-configs/entrypoint-proxy /entrypoint COPY docker-configs/supervisord.conf /etc/supervisor/conf.d/supervisord.conf USER freedmr - diff --git a/docker-configs/Dockerfile-hbmonv2 b/docker-configs/Dockerfile-hbmonv2 deleted file mode 100644 index 7e9a258..0000000 --- a/docker-configs/Dockerfile-hbmonv2 +++ /dev/null @@ -1,35 +0,0 @@ -############################################################################### -# Copyright (C) 2020 Simon Adlem, G7RZU -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -############################################################################### - -FROM python:3.7-alpine - -COPY entrypoint-proxy /entrypoint - -RUN adduser -D -u 54001 hbmon && \ - apk update && \ - apk add git gcc musl-dev libffi-dev libssl-dev cargo && \ - cd /opt && \ - git clone https://github.com/sp2ong/HBMonv2.git && \ - cd /opt/HBmonv2 && \ - pip install --no-cache-dir -r requirements.txt && \ - apk del git gcc musl-dev && \ - chown -R radio: /opt/HBMonv2 - -USER hbmon - -ENTRYPOINT [ "/entrypoint" ] diff --git a/docker-configs/Dockerfile-hdstack b/docker-configs/Dockerfile-hdstack deleted file mode 100644 index b27d1ad..0000000 --- a/docker-configs/Dockerfile-hdstack +++ /dev/null @@ -1,35 +0,0 @@ -############################################################################### -# Copyright (C) 2020 Simon Adlem, G7RZU -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -############################################################################### - -FROM python:3.7-alpine - -COPY entrypoint-proxy /entrypoint - -RUN adduser -D -u 54000 radio && \ - apk update && \ - apk add git gcc musl-dev && \ - cd /opt && \ - git clone https://github.com/hacknix/freedmr && \ - cd /opt/freedmr && \ - pip install --no-cache-dir -r requirements.txt && \ - apk del git gcc musl-dev && \ - chown -R radio: /opt/freedmr - -USER radio - -ENTRYPOINT [ "/entrypoint" ] diff --git a/docker-configs/Dockerfile-noproxy b/docker-configs/Dockerfile-noproxy deleted file mode 100644 index 4cd053b..0000000 --- a/docker-configs/Dockerfile-noproxy +++ /dev/null @@ -1,35 +0,0 @@ -############################################################################### -# Copyright (C) 2020 Simon Adlem, G7RZU -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -############################################################################### - -FROM python:3.7-alpine - -COPY entrypoint-noproxy /entrypoint - -RUN adduser -D -u 54000 radio && \ - apk update && \ - apk add git gcc musl-dev && \ - cd /opt && \ - git clone https://github.com/hacknix/freedmr && \ - cd /opt/freedmr && \ - pip install --no-cache-dir -r requirements.txt && \ - apk del git gcc musl-dev && \ - chown -R radio: /opt/freedmr - -USER radio - -ENTRYPOINT [ "/entrypoint" ] diff --git a/docker-configs/Dockerfile-proxy b/docker-configs/Dockerfile-proxy index bb5378b..af35ce2 100644 --- a/docker-configs/Dockerfile-proxy +++ b/docker-configs/Dockerfile-proxy @@ -15,13 +15,12 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ############################################################################### -FROM python:3.11-alpine +FROM python:3.11.15-alpine3.24 ENTRYPOINT [ "/entrypoint" ] RUN adduser -D -u 54000 radio && \ - apk update && \ - apk add git gcc musl-dev && \ + apk add --no-cache git gcc musl-dev && \ cd /opt && \ git clone https://gitlab.hacknix.net/hacknix/FreeDMR.git freedmr && \ cd /opt/freedmr && \ @@ -31,4 +30,3 @@ RUN adduser -D -u 54000 radio && \ COPY entrypoint-proxy /entrypoint USER radio - diff --git a/docker-configs/docker-compose_install.sh b/docker-configs/docker-compose_install.sh index 7b74b39..0df9060 100644 --- a/docker-configs/docker-compose_install.sh +++ b/docker-configs/docker-compose_install.sh @@ -59,7 +59,7 @@ echo Restart docker... systemctl restart docker && echo Make config directory... -mkdir /etc/freedmr && +mkdir -p /etc/freedmr && mkdir -p /etc/freedmr/acme.sh && mkdir -p /etc/freedmr/certs && chmod -R 755 /etc/freedmr && @@ -68,115 +68,8 @@ echo make json directory... mkdir -p /etc/freedmr/json && chown 54000:54000 /etc/freedmr/json && -echo Install /etc/freedmr/freedmr.cfg ... -cat << EOF > /etc/freedmr/freedmr.cfg -#This empty config file will use defaults for everything apart from OBP and HBP config -#This is usually a sensible choice. - -#I have moved to a config like this to encourage servers to use the accepted defaults -#unless you really know what you are doing. - -[GLOBAL] -#If you join the FreeDMR network, you need to add your ServerID Here. -SERVER_ID: 0 - -[REPORTS] - -[LOGGER] - -[ALIASES] - -[ALLSTAR] - -#This is an example OpenBridgeProtocol (OBP) or FreeBridgeProtocol (FBP) configuration -#If you joing FreeDMR, you will be given a config like this to paste in -[OBP-TEST] -MODE: OPENBRIDGE -ENABLED: False -IP: -PORT: 62044 -#The ID which you expect to see sent from the other end of the link. -NETWORK_ID: 1 -PASSPHRASE: mypass -TARGET_IP: -TARGET_PORT: 62044 -USE_ACL: True -SUB_ACL: DENY:1 -TGID_ACL: PERMIT:ALL -#Should always be true if using docker. -RELAX_CHECKS: True -#True for FBP, False for OBP -ENHANCED_OBP: True -#PROTO_VER should be 5 for FreeDMR servers using FBP -#1 for other servers using OBP -PROTO_VER: 5 - -#This defines parameters for repeater/hotspot connections -#via HomeBrewProtocol (HBP) -#I don't recommend changing most of this unless you know what you are doing -[SYSTEM] -MODE: MASTER -ENABLED: True -REPEAT: True -MAX_PEERS: 1 -EXPORT_AMBE: False -IP: 127.0.0.1 -PORT: 54000 -PASSPHRASE: -GROUP_HANGTIME: 5 -USE_ACL: True -REG_ACL: DENY:1 -SUB_ACL: DENY:1 -TGID_TS1_ACL: PERMIT:ALL -TGID_TS2_ACL: PERMIT:ALL -DEFAULT_UA_TIMER: 10 -SINGLE_MODE: True -VOICE_IDENT: True -TS1_STATIC: -TS2_STATIC: -DEFAULT_DIAL_TS1: 0 -DEFAULT_DIAL_TS2: 0 -DEFAULT_REFLECTOR: 0 -ANNOUNCEMENT_LANGUAGE: en_GB -GENERATOR: 100 -ALLOW_UNREG_ID: False -PROXY_CONTROL: True -OVERRIDE_IDENT_TG: - -#Echo (Loro / Parrot) server -[ECHO] -MODE: PEER -ENABLED: True -LOOSE: False -EXPORT_AMBE: False -IP: 127.0.0.1 -PORT: 54916 -MASTER_IP: 127.0.0.1 -MASTER_PORT: 54915 -PASSPHRASE: passw0rd -CALLSIGN: ECHO -RADIO_ID: 1000001 -RX_FREQ: 449000000 -TX_FREQ: 444000000 -TX_POWER: 25 -COLORCODE: 1 -SLOTS: 1 -LATITUDE: 00.0000 -LONGITUDE: 000.0000 -HEIGHT: 0 -LOCATION: Earth -DESCRIPTION: ECHO -URL: www.freedmr.uk -SOFTWARE_ID: 20170620 -PACKAGE_ID: MMDVM_FreeDMR -GROUP_HANGTIME: 5 -OPTIONS: -USE_ACL: True -SUB_ACL: DENY:1 -TGID_TS1_ACL: PERMIT:ALL -TGID_TS2_ACL: PERMIT:ALL -ANNOUNCEMENT_LANGUAGE: en_GB -EOF +echo Install /etc/freedmr/freedmr.cfg ... +curl -fsSL https://gitlab.hacknix.net/hacknix/FreeDMR/-/raw/master/FreeDMR.cfg -o /etc/freedmr/freedmr.cfg && echo Set perms on config directory... @@ -184,9 +77,11 @@ chown -R 54000 /etc/freedmr && echo Get docker-compose.yml... cd /etc/freedmr && -curl https://gitlab.hacknix.net/hacknix/FreeDMR/-/raw/master/docker-configs/docker-compose.yml -o docker-compose.yml && +curl -fsSL https://gitlab.hacknix.net/hacknix/FreeDMR/-/raw/master/docker-configs/docker-compose.yml -o docker-compose.yml && -chmod 755 /etc/cron.daily/lastheard +if [ -e /etc/cron.daily/lastheard ]; then + chmod 755 /etc/cron.daily/lastheard +fi echo Tune network stack... cat << EOF > /etc/sysctl.conf && diff --git a/docker-configs/entrypoint-hbmonv2 b/docker-configs/entrypoint-hbmonv2 deleted file mode 100755 index c7d3b0b..0000000 --- a/docker-configs/entrypoint-hbmonv2 +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -############################################################################### -# Copyright (C) 2020 Simon Adlem, G7RZU -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -############################################################################### - - -cd /opt/HBMonv2 -python /opt/HBMonv2/monitor.py & diff --git a/docker-configs/entrypoint-hdstack b/docker-configs/entrypoint-hdstack deleted file mode 100755 index 915df70..0000000 --- a/docker-configs/entrypoint-hdstack +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -############################################################################### -# Copyright (C) 2020 Simon Adlem, G7RZU -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -############################################################################### - -cd /opt/freedmr -python /opt/freedmr/hdstack/hotspot_proxy_v2.py & -python /opt/freedmr/bridge_master.py -c freedmr.cfg -r rules.py & -python /opt/freedmr/bridge_master.py -c hdstack/hdstack1.cfg -r rules.py & -python /opt/freedmr/bridge_master.py -c hdstack/hdstack2.cfg -r rules.py & diff --git a/docker-configs/entrypoint-noproxy b/docker-configs/entrypoint-noproxy deleted file mode 100755 index 2cab8e8..0000000 --- a/docker-configs/entrypoint-noproxy +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -############################################################################### -# Copyright (C) 2020 Simon Adlem, G7RZU -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -############################################################################### - -cd /opt/freedmr -python /opt/freedmr/bridge_master.py -c freedmr.cfg -r rules.py diff --git a/docker-configs/freedmr.cfg b/docker-configs/freedmr.cfg index 4b92631..01feabf 100644 --- a/docker-configs/freedmr.cfg +++ b/docker-configs/freedmr.cfg @@ -1,11 +1,11 @@ -#This empty config file will use defaults for everything apart from OBP and HBP config -#This is usually a sensible choice. +# This minimal config file uses defaults for everything apart from OBP/FBP and +# HBP config. This is usually a sensible choice. -#I have moved to a config like this to encourage servers to use the accepted defaults -#unless you really know what you are doing. +# Servers should normally use the accepted defaults unless there is a specific +# reason to change them. [GLOBAL] -#If you join the FreeDMR network, you need to add your ServerID Here. +# If you join the FreeDMR network, add your server ID here. SERVER_ID: 0 [REPORTS] @@ -16,14 +16,15 @@ SERVER_ID: 0 [ALLSTAR] -#This is an example OpenBridgeProtocol (OBP) or FreeBridgeProtocol (FBP) configuration -#If you joing FreeDMR, you will be given a config like this to paste in +# Example OpenBridge Protocol (OBP) or FreeDMR Bridge Protocol (FBP) +# configuration. If you join FreeDMR, you will be given a config like this to +# paste in. [OBP-TEST] MODE: OPENBRIDGE ENABLED: False IP: PORT: 62044 -#The ID which you expect to see sent from the other end of the link. +# The ID which you expect to see sent from the other end of the link. NETWORK_ID: 1 PASSPHRASE: mypass TARGET_IP: @@ -31,17 +32,15 @@ TARGET_PORT: 62044 USE_ACL: True SUB_ACL: DENY:1 TGID_ACL: PERMIT:ALL -#Should always be true if using docker. +# Should usually be true when using Docker or NAT. RELAX_CHECKS: True -#True for FBP, False for OBP +# True for FBP, False for OBP. ENHANCED_OBP: True -#PROTO_VER should be 5 for FreeDMR servers using FBP -#1 for other servers using OBP +# PROTO_VER should be 5 for FreeDMR servers using FBP. +# Use 1 for other servers using OBP. PROTO_VER: 5 -#This defines parameters for repeater/hotspot connections -#via HomeBrewProtocol (HBP) -#I don't recommend changing most of this unless you know what you are doing +# Repeater/hotspot connections via HomeBrew Protocol (HBP). [SYSTEM] MODE: MASTER ENABLED: True @@ -73,7 +72,7 @@ ALLOW_UNREG_ID: False PROXY_CONTROL: True OVERRIDE_IDENT_TG: -#Echo (Loro / Parrot) server +# Echo (Loro / Parrot) server. [ECHO] MODE: PEER ENABLED: True @@ -84,8 +83,8 @@ PORT: 54916 MASTER_IP: 127.0.0.1 MASTER_PORT: 54915 PASSPHRASE: passw0rd -CALLSIGN: ECHO -RADIO_ID: 1000001 +CALLSIGN: M0XFD +RADIO_ID: 2340210 RX_FREQ: 449000000 TX_FREQ: 444000000 TX_POWER: 25 diff --git a/docs/bridge-peer-examples.md b/docs/bridge-peer-examples.md new file mode 100644 index 0000000..a4b31fd --- /dev/null +++ b/docs/bridge-peer-examples.md @@ -0,0 +1,150 @@ +# Bridge Instance PEER and XLXPEER Examples + +`PEER` and `XLXPEER` are bridge-instance features. They should normally be +configured on a `bridge.py` instance, not on the main `bridge_master.py` +FreeDMR master. + +The main FreeDMR master intentionally skips non-echo `PEER` and `XLXPEER` +sections. Use a bridge instance when connecting external systems, then route +selected traffic between that bridge instance and the main FreeDMR server. + +The FreeDMR wiki has the operator guidance: + +- `Making PEER connections (XLX and HBP)` +- `Setup a Bridge instance` +- `Optimise performance and CPU on a busy system connected to FreeDMR Network` + +## XLXPEER + +`XLXPEER` connects a bridge instance to an XLX module. In FreeDMR deployments +this is primarily used for links to D-Star and AMBE-stick transcoder systems. +It creates the XLX connection only; routing is still controlled by `rules.py`. + +```ini +[XLX-1] +MODE: XLXPEER +ENABLED: False +LOOSE: True +EXPORT_AMBE: False +IP: +PORT: 54002 +MASTER_IP: 172.16.1.1 +MASTER_PORT: 62030 +PASSPHRASE: passw0rd +CALLSIGN: W1ABC +RADIO_ID: 312000 +RX_FREQ: 449000000 +TX_FREQ: 444000000 +TX_POWER: 25 +COLORCODE: 1 +SLOTS: 1 +LATITUDE: 38.0000 +LONGITUDE: -095.0000 +HEIGHT: 75 +LOCATION: Anywhere, USA +DESCRIPTION: XLX bridge +URL: www.example.org +SOFTWARE_ID: 20170620 +PACKAGE_ID: MMDVM_FreeDMR +GROUP_HANGTIME: 5 +# 4000 + module letter position, e.g. A = 4001, D = 4004. +XLXMODULE: 4004 +USE_ACL: True +SUB_ACL: DENY:1 +TGID_TS1_ACL: PERMIT:ALL +TGID_TS2_ACL: PERMIT:ALL +``` + +Example local bridge rule: + +```python +BRIDGES = { + 235: [ + {'SYSTEM': 'XLX-1', 'TS': 2, 'TGID': 9, 'ACTIVE': True, + 'TIMEOUT': 2, 'TO_TYPE': 'NONE', 'ON': [], 'OFF': [], 'RESET': []}, + ], +} +``` + +To carry the same traffic onward over an FBP/OBP link, include that link in the +same bridge rule using the FreeDMR talkgroup as the target. + +## PEER + +`PEER` connects outward using HomeBrew Protocol as a peer. Consider this +carefully. For network-to-network links, OpenBridge/FBP is usually the better +fit. Always make sure you have permission to connect to the external system. + +```ini +[PEER-1] +MODE: PEER +ENABLED: False +LOOSE: False +EXPORT_AMBE: False +IP: +PORT: 54001 +MASTER_IP: 172.16.1.1 +MASTER_PORT: 54000 +PASSPHRASE: homebrew +CALLSIGN: W1ABC +RADIO_ID: 312000 +RX_FREQ: 449000000 +TX_FREQ: 444000000 +TX_POWER: 25 +COLORCODE: 1 +SLOTS: 1 +LATITUDE: 38.0000 +LONGITUDE: -095.0000 +HEIGHT: 75 +LOCATION: Anywhere, USA +DESCRIPTION: HBP peer bridge +URL: www.example.org +SOFTWARE_ID: 20170620 +PACKAGE_ID: MMDVM_FreeDMR +GROUP_HANGTIME: 5 +OPTIONS: +USE_ACL: True +SUB_ACL: DENY:1 +TGID_TS1_ACL: PERMIT:ALL +TGID_TS2_ACL: PERMIT:ALL +``` + +Example local bridge rule: + +```python +BRIDGES = { + 235: [ + {'SYSTEM': 'PEER-1', 'TS': 2, 'TGID': 235, 'ACTIVE': True, + 'TIMEOUT': 2, 'TO_TYPE': 'NONE', 'ON': [], 'OFF': [], 'RESET': []}, + ], +} +``` + +Generally, do not route `PEER` connections onward to OpenBridge/FBP. If you want +to bridge networks, use OpenBridge/FBP for that connection. + +## Bridge Instance Pattern + +A bridge instance usually has its own config and rules file, for example: + +```yaml +freedmr-bridge: + container_name: freedmr-bridge + depends_on: + - freedmr + volumes: + - '/etc/freedmr/freedmr-bridge.cfg:/opt/freedmr/freedmr.cfg' + - '/etc/freedmr/rules-bridge.py:/opt/freedmr/rules.py' + - '/etc/freedmr/json/:/opt/freedmr/json/' + image: 'gitlab.hacknix.net:5050/hacknix/freedmr:latest' + restart: "unless-stopped" + environment: + - 'BRIDGE_SERVER=1' +``` + +On the main FreeDMR instance, add one FBP/OBP link to the bridge instance. Then +put the external `PEER` / `XLXPEER` definitions and matching `rules.py` routes +on the bridge instance. + +This keeps external connectors away from the main HBP access server and matches +the FreeDMR operational guidance for busy systems. diff --git a/docs/v1x-codex-changelog.md b/docs/v1x-codex-changelog.md index bc490db..db3ab54 100644 --- a/docs/v1x-codex-changelog.md +++ b/docs/v1x-codex-changelog.md @@ -85,11 +85,32 @@ trunk bursts, using a sustained over-rate threshold and logging peer/source metadata. The OBP path no longer calls HBP proxy blacklist handling. - Removed obsolete top-level sample configs with invalid `PROTO_VER: 2` - examples, and removed the old non-compose Docker installer. Docker Compose is - the recommended Docker install path. + examples, the stale HBLink-era sample config, and old non-compose install + helpers. Docker Compose is the recommended Docker install path. +- Added a concise FreeDMR bridge-instance `PEER` / `XLXPEER` example document + so the useful bridge-mode notes from the old HBLink sample remain available + in FreeDMR terminology, including the common XLX/D-Star and AMBE transcoder + use case. - Renamed the minimal top-level config to `FreeDMR.cfg`, aligned its default timer with the Docker Compose install config, and added current OBP/FBP and ECHO examples. +- Aligned the runtime-default `freedmr.cfg` files with `FreeDMR.cfg`, removing + stale debug-oriented defaults such as `LOG_LEVEL: TRACE`, `DEBUG_BRIDGES: + True` and `DEFAULT_UA_TIMER: 60` from the shipped default config. +- Changed the Docker Compose installer to install the maintained `FreeDMR.cfg` + from the repository instead of carrying a duplicated embedded config block. +- Tidied the Docker Compose installer so `/etc/freedmr` creation is idempotent, + downloads fail clearly, and the optional `lastheard` cron chmod is only run + when that file exists. +- Removed obsolete unreferenced legacy Dockerfile/entrypoint pairs for + `noproxy`, `hdstack` and `hbmonv2`; the active Docker path uses the proxy + image, supervisor and `BRIDGE_SERVER=1` for bridge instances. +- Pinned active Python 3.11 Dockerfiles to the Alpine 3.24 based image and + removed unnecessary `apk update` / debug listing steps from the release build + Dockerfile. +- Documented the `extrastats2` CI job as a frozen reporting/export variant used + for global lastheard importer compatibility; this should be folded back into + the main reporting/export model rather than removed as stale. - Added tests for FBP keepalive gating, wrong network ID, bad hashes, stale timestamps, max-hop handling, v4 characterization and v1 refusal on v5 links. diff --git a/freedmr.cfg b/freedmr.cfg old mode 100755 new mode 100644 index 792bc58..01feabf --- a/freedmr.cfg +++ b/freedmr.cfg @@ -1,29 +1,54 @@ -#This empty config file will use defaults for everything apart from OBP and HBP config -#This is usually a sensible choice. +# This minimal config file uses defaults for everything apart from OBP/FBP and +# HBP config. This is usually a sensible choice. +# Servers should normally use the accepted defaults unless there is a specific +# reason to change them. [GLOBAL] -SERVER_ID: 0000 -DEBUG_BRIDGES: True -ENABLE_API: True +# If you join the FreeDMR network, add your server ID here. +SERVER_ID: 0 [REPORTS] [LOGGER] -LOG_LEVEL: TRACE [ALIASES] [ALLSTAR] +# Example OpenBridge Protocol (OBP) or FreeDMR Bridge Protocol (FBP) +# configuration. If you join FreeDMR, you will be given a config like this to +# paste in. +[OBP-TEST] +MODE: OPENBRIDGE +ENABLED: False +IP: +PORT: 62044 +# The ID which you expect to see sent from the other end of the link. +NETWORK_ID: 1 +PASSPHRASE: mypass +TARGET_IP: +TARGET_PORT: 62044 +USE_ACL: True +SUB_ACL: DENY:1 +TGID_ACL: PERMIT:ALL +# Should usually be true when using Docker or NAT. +RELAX_CHECKS: True +# True for FBP, False for OBP. +ENHANCED_OBP: True +# PROTO_VER should be 5 for FreeDMR servers using FBP. +# Use 1 for other servers using OBP. +PROTO_VER: 5 + +# Repeater/hotspot connections via HomeBrew Protocol (HBP). [SYSTEM] MODE: MASTER ENABLED: True REPEAT: True MAX_PEERS: 1 EXPORT_AMBE: False -IP: -PORT: 62031 +IP: 127.0.0.1 +PORT: 54000 PASSPHRASE: GROUP_HANGTIME: 5 USE_ACL: True @@ -31,7 +56,7 @@ REG_ACL: DENY:1 SUB_ACL: DENY:1 TGID_TS1_ACL: PERMIT:ALL TGID_TS2_ACL: PERMIT:ALL -DEFAULT_UA_TIMER: 60 +DEFAULT_UA_TIMER: 10 SINGLE_MODE: True VOICE_IDENT: True DIAL_A_TG: True @@ -42,11 +67,12 @@ DEFAULT_DIAL_TS1: 0 DEFAULT_DIAL_TS2: 0 DEFAULT_REFLECTOR: 0 ANNOUNCEMENT_LANGUAGE: en_GB -GENERATOR: 0 +GENERATOR: 100 ALLOW_UNREG_ID: False PROXY_CONTROL: True OVERRIDE_IDENT_TG: +# Echo (Loro / Parrot) server. [ECHO] MODE: PEER ENABLED: True @@ -66,10 +92,10 @@ COLORCODE: 1 SLOTS: 1 LATITUDE: 00.0000 LONGITUDE: 000.0000 -HEIGHT: 75 -LOCATION: United Kingdom +HEIGHT: 0 +LOCATION: Earth DESCRIPTION: ECHO -URL: www.w1abc.org +URL: www.freedmr.uk SOFTWARE_ID: 20170620 PACKAGE_ID: MMDVM_FreeDMR GROUP_HANGTIME: 5 diff --git a/hblink-SAMPLE.cfg b/hblink-SAMPLE.cfg deleted file mode 100755 index a3b616c..0000000 --- a/hblink-SAMPLE.cfg +++ /dev/null @@ -1,241 +0,0 @@ -# PROGRAM-WIDE PARAMETERS GO HERE -# PATH - working path for files, leave it alone unless you NEED to change it -# PING_TIME - the interval that peers will ping the master, and re-try registraion -# - how often the Master maintenance loop runs -# MAX_MISSED - how many pings are missed before we give up and re-register -# - number of times the master maintenance loop runs before de-registering a peer -# -# ACLs: -# -# Access Control Lists are a very powerful tool for administering your system. -# But they consume packet processing time. Disable them if you are not using them. -# But be aware that, as of now, the configuration stanzas still need the ACL -# sections configured even if you're not using them. -# -# REGISTRATION ACLS ARE ALWAYS USED, ONLY SUBSCRIBER AND TGID MAY BE DISABLED!!! -# -# The 'action' May be PERMIT|DENY -# Each entry may be a single radio id, or a hypenated range (e.g. 1-2999) -# Format: -# ACL = 'action:id|start-end|,id|start-end,....' -# --for example-- -# SUB_ACL: DENY:1,1000-2000,4500-60000,17 -# -# ACL Types: -# REG_ACL: peer radio IDs for registration (only used on HBP master systems) -# SUB_ACL: subscriber IDs for end-users -# TGID_TS1_ACL: destination talkgroup IDs on Timeslot 1 -# TGID_TS2_ACL: destination talkgroup IDs on Timeslot 2 -# -# ACLs may be repeated for individual systems if needed for granularity -# Global ACLs will be processed BEFORE the system level ACLs -# Packets will be matched against all ACLs, GLOBAL first. If a packet 'passes' -# All elements, processing continues. Packets are discarded at the first -# negative match, or 'reject' from an ACL element. -# -# If you do not wish to use ACLs, set them to 'PERMIT:ALL' -# TGID_TS1_ACL in the global stanza is used for OPENBRIDGE systems, since all -# traffic is passed as TS 1 between OpenBridges -[GLOBAL] -PATH: ./ -PING_TIME: 5 -MAX_MISSED: 3 -USE_ACL: True -REG_ACL: PERMIT:ALL -SUB_ACL: DENY:1 -TGID_TS1_ACL: PERMIT:ALL -TGID_TS2_ACL: PERMIT:ALL - - -# NOT YET WORKING: NETWORK REPORTING CONFIGURATION -# Enabling "REPORT" will configure a socket-based reporting -# system that will send the configuration and other items -# to a another process (local or remote) that may process -# the information for some useful purpose, like a web dashboard. -# -# REPORT - True to enable, False to disable -# REPORT_INTERVAL - Seconds between reports -# REPORT_PORT - TCP port to listen on if "REPORT_NETWORKS" = NETWORK -# REPORT_CLIENTS - comma separated list of IPs you will allow clients -# to connect on. Entering a * will allow all. -# -# ****FOR NOW MUST BE TRUE - USE THE LOOPBACK IF YOU DON'T USE THIS!!!**** -[REPORTS] -REPORT: True -REPORT_INTERVAL: 60 -REPORT_PORT: 4321 -REPORT_CLIENTS: 127.0.0.1 - - -# SYSTEM LOGGER CONFIGURAITON -# This allows the logger to be configured without chaning the individual -# python logger stuff. LOG_FILE should be a complete path/filename for *your* -# system -- use /dev/null for non-file handlers. -# LOG_HANDLERS may be any of the following, please, no spaces in the -# list if you use several: -# null -# console -# console-timed -# file -# file-timed -# syslog -# LOG_LEVEL may be any of the standard syslog logging levels, though -# as of now, DEBUG, INFO, WARNING and CRITICAL are the only ones -# used. -# -[LOGGER] -LOG_FILE: /tmp/hblink.log -LOG_HANDLERS: console-timed -LOG_LEVEL: DEBUG -LOG_NAME: HBlink - -# DOWNLOAD AND IMPORT SUBSCRIBER, PEER and TGID ALIASES -# Ok, not the TGID, there's no master list I know of to download -# This is intended as a facility for other applcations built on top of -# HBlink to use, and will NOT be used in HBlink directly. -# STALE_DAYS is the number of days since the last download before we -# download again. Don't be an ass and change this to less than a few days. -[ALIASES] -TRY_DOWNLOAD: True -PATH: ./ -PEER_FILE: peer_ids.json -SUBSCRIBER_FILE: subscriber_ids.json -TGID_FILE: talkgroup_ids.json -PEER_URL: https://www.radioid.net/static/rptrs.json -SUBSCRIBER_URL: https://www.radioid.net/static/users.json -STALE_DAYS: 7 - -# OPENBRIDGE INSTANCES - DUPLICATE SECTION FOR MULTIPLE CONNECTIONS -# OpenBridge is a protocol originall created by DMR+ for connection between an -# IPSC2 server and Brandmeister. It has been implemented here at the suggestion -# of the Brandmeister team as a way to legitimately connect HBlink to the -# Brandemiester network. -# It is recommended to name the system the ID of the Brandmeister server that -# it connects to, but is not necessary. TARGET_IP and TARGET_PORT are of the -# Brandmeister or IPSC2 server you are connecting to. PASSPHRASE is the password -# that must be agreed upon between you and the operator of the server you are -# connecting to. NETWORK_ID is a number in the format of a DMR Radio ID that -# will be sent to the other server to identify this connection. -# other parameters follow the other system types. -# -# ACLs: -# OpenBridge does not 'register', so registration ACL is meaningless. -# OpenBridge passes all traffic on TS1, so there is only 1 TGID ACL. -# Otherwise ACLs work as described in the global stanza -[OBP-1] -MODE: OPENBRIDGE -ENABLED: True -IP: -PORT: 62035 -NETWORK_ID: 3129100 -PASSPHRASE: password -TARGET_IP: 1.2.3.4 -TARGET_PORT: 62035 -USE_ACL: True -SUB_ACL: DENY:1 -TGID_ACL: PERMIT:ALL - -# MASTER INSTANCES - DUPLICATE SECTION FOR MULTIPLE MASTERS -# HomeBrew Protocol Master instances go here. -# IP may be left blank if there's one interface on your system. -# Port should be the port you want this master to listen on. It must be unique -# and unused by anything else. -# Repeat - if True, the master repeats traffic to peers, False, it does nothing. -# -# MAX_PEERS -- maximun number of peers that may be connect to this master -# at any given time. This is very handy if you're allowing hotspots to -# connect, or using a limited computer like a Raspberry Pi. -# -# ACLs: -# See comments in the GLOBAL stanza -[MASTER-1] -MODE: MASTER -ENABLED: True -REPEAT: True -MAX_PEERS: 10 -EXPORT_AMBE: False -IP: -PORT: 54000 -PASSPHRASE: s3cr37w0rd -GROUP_HANGTIME: 5 -USE_ACL: True -REG_ACL: DENY:1 -SUB_ACL: DENY:1 -TGID_TS1_ACL: PERMIT:ALL -TGID_TS2_ACL: PERMIT:ALL - -# PEER INSTANCES - DUPLICATE SECTION FOR MULTIPLE PEERS -# There are a LOT of errors in the HB Protocol specifications on this one! -# MOST of these items are just strings and will be properly dealt with by the program -# The TX & RX Frequencies are 9-digit numbers, and are the frequency in Hz. -# Latitude is an 8-digit unsigned floating point number. -# Longitude is a 9-digit signed floating point number. -# Height is in meters -# Setting Loose to True relaxes the validation on packets received from the master. -# This will allow HBlink to connect to a non-compliant system such as XLXD, DMR+ etc. -# -# ACLs: -# See comments in the GLOBAL stanza -[REPEATER-1] -MODE: PEER -ENABLED: True -LOOSE: False -EXPORT_AMBE: False -IP: -PORT: 54001 -MASTER_IP: 172.16.1.1 -MASTER_PORT: 54000 -PASSPHRASE: homebrew -CALLSIGN: W1ABC -RADIO_ID: 312000 -RX_FREQ: 449000000 -TX_FREQ: 444000000 -TX_POWER: 25 -COLORCODE: 1 -SLOTS: 1 -LATITUDE: 38.0000 -LONGITUDE: -095.0000 -HEIGHT: 75 -LOCATION: Anywhere, USA -DESCRIPTION: This is a cool repeater -URL: www.w1abc.org -SOFTWARE_ID: 20170620 -PACKAGE_ID: MMDVM_HBlink -GROUP_HANGTIME: 5 -OPTIONS: -USE_ACL: True -SUB_ACL: DENY:1 -TGID_TS1_ACL: PERMIT:ALL -TGID_TS2_ACL: PERMIT:ALL - -[XLX-1] -MODE: XLXPEER -ENABLED: True -LOOSE: True -EXPORT_AMBE: False -IP: -PORT: 54002 -MASTER_IP: 172.16.1.1 -MASTER_PORT: 62030 -PASSPHRASE: passw0rd -CALLSIGN: W1ABC -RADIO_ID: 312000 -RX_FREQ: 449000000 -TX_FREQ: 444000000 -TX_POWER: 25 -COLORCODE: 1 -SLOTS: 1 -LATITUDE: 38.0000 -LONGITUDE: -095.0000 -HEIGHT: 75 -LOCATION: Anywhere, USA -DESCRIPTION: This is a cool repeater -URL: www.w1abc.org -SOFTWARE_ID: 20170620 -PACKAGE_ID: MMDVM_HBlink -GROUP_HANGTIME: 5 -XLXMODULE: 4004 -USE_ACL: True -SUB_ACL: DENY:1 -TGID_TS1_ACL: PERMIT:ALL -TGID_TS2_ACL: PERMIT:ALL diff --git a/install.sh b/install.sh deleted file mode 100755 index c47b9db..0000000 --- a/install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash - -# Install the required support programs -apt-get install python3 python3-pip -y -pip3 install -r requirements.txt -