From 80354ce85700e3e5af1567a22f0bd3e077c8bd02 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 30 Aug 2022 22:18:59 +0000 Subject: [PATCH 1/9] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20ef2be..8120a54 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,6 +46,28 @@ build-extrastats: # This job runs in the build stage, which runs first. only: - extrastats +build-testing: # This job runs in the build stage, which runs first. + stage: build + tags: + - buildx + script: + - echo "Compiling the code..." + - cd docker-configs + - docker buildx build --no-cache -f Dockerfile-proxy -t gitlab.hacknix.net:5050/hacknix/freedmr:testing --platform linux/arm64 --push . + only: + - testing + +build-debug: # This job runs in the build stage, which runs first. + stage: build + tags: + - buildx + script: + - echo "Compiling the code..." + - cd docker-configs + - docker buildx build --no-cache -f Dockerfile-proxy -t gitlab.hacknix.net:5050/hacknix/freedmr:debug --platform linux/arm64 --push . + only: + - debug + build-release: # This job runs in the build stage, which runs first. stage: build tags: From 1ef605bc6d1add78d5507d41e90f48d73f0bf4a4 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 31 Aug 2022 00:56:34 +0000 Subject: [PATCH 2/9] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8120a54..6ef8f26 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,7 +53,7 @@ build-testing: # This job runs in the build stage, which runs first. script: - echo "Compiling the code..." - cd docker-configs - - docker buildx build --no-cache -f Dockerfile-proxy -t gitlab.hacknix.net:5050/hacknix/freedmr:testing --platform linux/arm64 --push . + - docker buildx build --no-cache -f Dockerfile-proxy -t gitlab.hacknix.net:5050/hacknix/freedmr:testing --platform linux/amd64 --push . only: - testing @@ -64,7 +64,7 @@ build-debug: # This job runs in the build stage, which runs first. script: - echo "Compiling the code..." - cd docker-configs - - docker buildx build --no-cache -f Dockerfile-proxy -t gitlab.hacknix.net:5050/hacknix/freedmr:debug --platform linux/arm64 --push . + - docker buildx build --no-cache -f Dockerfile-proxy -t gitlab.hacknix.net:5050/hacknix/freedmr:debug --platform linux/amd64 --push . only: - debug From ded78fc6375e826fa861e606c60bf3b9d858975f Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 1 Sep 2022 18:25:16 +0100 Subject: [PATCH 3/9] Revert "don't allow setting a static on TS2 if it's already set on TS1" This reverts commit 4404fc797a432c29ae08640706039692cf4dc09d. --- bridge_master.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bridge_master.py b/bridge_master.py index 976a293..c7a3d6b 100644 --- a/bridge_master.py +++ b/bridge_master.py @@ -935,8 +935,8 @@ def options_config(): if CONFIG['SYSTEMS'][_system]['TS2_STATIC']: ts2 = CONFIG['SYSTEMS'][_system]['TS2_STATIC'].split(',') for tg in ts2: - if not tg or int(tg) == 0 or int(tg) >= 16777215 or tg == _options['DEFAULT_REFLECTOR'] or (tg and ts1 and tg in ts1): - logger.debug('(OPTIONS) %s not setting TS2 Static %s. Bad TG or conflict with DIAL or TS1',_system,tg) + if not tg or int(tg) == 0 or int(tg) >= 16777215 or tg == _options['DEFAULT_REFLECTOR']: + logger.debug('(OPTIONS) %s not setting TS2 Static %s. Bad TG or conflict DIAL',_system,tg) continue tg = int(tg) reset_static_tg(tg,2,_tmout,_system) From c9e94903595a25750308084d6b8961c7f570edda Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 1 Sep 2022 18:25:56 +0100 Subject: [PATCH 4/9] Revert "_" This reverts commit e836254c0db24110832c93cf06e846042322835f. --- bridge_master.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bridge_master.py b/bridge_master.py index c7a3d6b..dafa3de 100644 --- a/bridge_master.py +++ b/bridge_master.py @@ -923,7 +923,7 @@ def options_config(): if _options['TS1_STATIC']: ts1 = _options['TS1_STATIC'].split(',') for tg in ts1: - if not tg or int(tg) == 0 or int(tg) >= 16777215 or tg == _options['DEFAULT_REFLECTOR']: + if not tg or int(tg) == 0 or int(tg) >= 16777215 or tg == _options['_DEFAULT_REFLECTOR']: logger.debug('(OPTIONS) %s not setting TS1 Static %s. Bad TG or conflict with DIAL',_system,tg) continue tg = int(tg) @@ -935,7 +935,7 @@ def options_config(): if CONFIG['SYSTEMS'][_system]['TS2_STATIC']: ts2 = CONFIG['SYSTEMS'][_system]['TS2_STATIC'].split(',') for tg in ts2: - if not tg or int(tg) == 0 or int(tg) >= 16777215 or tg == _options['DEFAULT_REFLECTOR']: + if not tg or int(tg) == 0 or int(tg) >= 16777215 or tg == _options['_DEFAULT_REFLECTOR']: logger.debug('(OPTIONS) %s not setting TS2 Static %s. Bad TG or conflict DIAL',_system,tg) continue tg = int(tg) From 96d77ca68d5489b7d88236482f957c9db4bb6f2a Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 1 Sep 2022 18:25:59 +0100 Subject: [PATCH 5/9] Revert "Don't add an options static if it's default for DIAL" This reverts commit 43a04755def0ac29cea88e6d23bc3a5bbc582010. --- bridge_master.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bridge_master.py b/bridge_master.py index dafa3de..eb8899a 100644 --- a/bridge_master.py +++ b/bridge_master.py @@ -923,8 +923,7 @@ def options_config(): if _options['TS1_STATIC']: ts1 = _options['TS1_STATIC'].split(',') for tg in ts1: - if not tg or int(tg) == 0 or int(tg) >= 16777215 or tg == _options['_DEFAULT_REFLECTOR']: - logger.debug('(OPTIONS) %s not setting TS1 Static %s. Bad TG or conflict with DIAL',_system,tg) + if not tg: continue tg = int(tg) make_static_tg(tg,1,_tmout,_system) @@ -935,8 +934,7 @@ def options_config(): if CONFIG['SYSTEMS'][_system]['TS2_STATIC']: ts2 = CONFIG['SYSTEMS'][_system]['TS2_STATIC'].split(',') for tg in ts2: - if not tg or int(tg) == 0 or int(tg) >= 16777215 or tg == _options['_DEFAULT_REFLECTOR']: - logger.debug('(OPTIONS) %s not setting TS2 Static %s. Bad TG or conflict DIAL',_system,tg) + if not tg or int(tg) == 0 or int(tg) >= 16777215: continue tg = int(tg) reset_static_tg(tg,2,_tmout,_system) From 267a7f41f625d163360cf5c5ec135e1ee4cf840a Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 4 Sep 2022 00:49:14 +0100 Subject: [PATCH 6/9] Stop wrong server ID message from spamming the logs --- hblink.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hblink.py b/hblink.py index 2c0dd21..c57526d 100755 --- a/hblink.py +++ b/hblink.py @@ -287,7 +287,9 @@ class OPENBRIDGE(DatagramProtocol): if compare_digest(_hash, _ckhs) and (_sockaddr == self._config['TARGET_SOCK'] or self._config['RELAX_CHECKS']): _peer_id = _data[11:15] if self._config['NETWORK_ID'] != _peer_id: - logger.error('(%s) OpenBridge packet discarded because NETWORK_ID: %s Does not match sent Peer ID: %s', self._system, int_id(self._config['NETWORK_ID']), int_id(_peer_id)) + f _stream_id not in self._laststrid: + logger.error('(%s) OpenBridge packet discarded because NETWORK_ID: %s Does not match sent Peer ID: %s', self._system, int_id(self._config['NETWORK_ID']), int_id(_peer_id)) + self._laststrid.append(_stream_id) return #This is a v1 packet, so all the extended stuff we can set to default From 2f322c7fe76040224c0bd95e11686c13348b2f81 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 4 Sep 2022 01:18:47 +0100 Subject: [PATCH 7/9] typoy --- hblink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hblink.py b/hblink.py index c57526d..dfa41a4 100755 --- a/hblink.py +++ b/hblink.py @@ -287,7 +287,7 @@ class OPENBRIDGE(DatagramProtocol): if compare_digest(_hash, _ckhs) and (_sockaddr == self._config['TARGET_SOCK'] or self._config['RELAX_CHECKS']): _peer_id = _data[11:15] if self._config['NETWORK_ID'] != _peer_id: - f _stream_id not in self._laststrid: + if _stream_id not in self._laststrid: logger.error('(%s) OpenBridge packet discarded because NETWORK_ID: %s Does not match sent Peer ID: %s', self._system, int_id(self._config['NETWORK_ID']), int_id(_peer_id)) self._laststrid.append(_stream_id) return From f2494aec619d098adf80300b94cbbed569aa26cb Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 4 Sep 2022 01:35:31 +0100 Subject: [PATCH 8/9] For all proto --- hblink.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hblink.py b/hblink.py index dfa41a4..9fb887a 100755 --- a/hblink.py +++ b/hblink.py @@ -418,7 +418,9 @@ class OPENBRIDGE(DatagramProtocol): if compare_digest(_hash, _ckhs) and (_sockaddr == self._config['TARGET_SOCK'] or self._config['RELAX_CHECKS']): _peer_id = _data[11:15] if self._config['NETWORK_ID'] != _peer_id: - logger.error('(%s) OpenBridge packet discarded because NETWORK_ID: %s Does not match sent Peer ID: %s', self._system, int_id(self._config['NETWORK_ID']), int_id(_peer_id)) + if _stream_id not in self._laststrid: + logger.error('(%s) OpenBridge packet discarded because NETWORK_ID: %s Does not match sent Peer ID: %s', self._system, int_id(self._config['NETWORK_ID']), int_id(_peer_id)) + self._laststrid.append(_stream_id) return _seq = _data[4] _rf_src = _data[5:8] @@ -550,7 +552,9 @@ class OPENBRIDGE(DatagramProtocol): if compare_digest(_hash, _ckhs) and (_sockaddr == self._config['TARGET_SOCK'] or self._config['RELAX_CHECKS']): _peer_id = _data[11:15] if self._config['NETWORK_ID'] != _peer_id: - logger.error('(%s) OpenBridge packet discarded because NETWORK_ID: %s Does not match sent Peer ID: %s', self._system, int_id(self._config['NETWORK_ID']), int_id(_peer_id)) + if _stream_id not in self._laststrid: + logger.error('(%s) OpenBridge packet discarded because NETWORK_ID: %s Does not match sent Peer ID: %s', self._system, int_id(self._config['NETWORK_ID']), int_id(_peer_id)) + self._laststrid.append(_stream_id) return _seq = _data[4] _rf_src = _data[5:8] From 1e26e46e4bda788ae463720cd5495db6062b3c56 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 4 Sep 2022 01:52:46 +0100 Subject: [PATCH 9/9] Move stream ID further up --- hblink.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hblink.py b/hblink.py index 9fb887a..de5b253 100755 --- a/hblink.py +++ b/hblink.py @@ -414,6 +414,8 @@ class OPENBRIDGE(DatagramProtocol): _h.update(_packet[:69]) _ckhs = _h.digest() + + _stream_id = _data[16:20] if compare_digest(_hash, _ckhs) and (_sockaddr == self._config['TARGET_SOCK'] or self._config['RELAX_CHECKS']): _peer_id = _data[11:15] @@ -437,7 +439,6 @@ class OPENBRIDGE(DatagramProtocol): _call_type = 'group' _frame_type = (_bits & 0x30) >> 4 _dtype_vseq = (_bits & 0xF) # data, 1=voice header, 2=voice terminator; voice, 0=burst A ... 5=burst F - _stream_id = _data[16:20] #logger.debug('(%s) DMRD - Seqence: %s, RF Source: %s, Destination ID: %s', self._system, int_id(_seq), int_id(_rf_src), int_id(_dst_id)) #Don't do anything if we are STUNned