Update Proxy to allow control of debugging options from environment

Update docker config
This commit is contained in:
Simon 2021-10-02 11:24:58 +01:00
parent 1f854a6c71
commit 04d3fc0123
4 changed files with 32 additions and 5 deletions

View File

@ -40,8 +40,16 @@ services:
app_net:
ipv4_address: 172.16.238.10
ipv6_address: fd2a:70b6:9f54:29b6::10
#Control parameters inside container
environment:
#IPV6 support
- FDPROXY_IPV6=1
#Display connection stats in log
- FDPROXY_STATS=1
#Display conneting client info in log
- FDPROXY_CLIENTINFO=1
#Debug HBP session in log (lots of data!!)
- FDPROXY_DEBUG=0
read_only: "true"
ipv6nat:

View File

@ -24,7 +24,7 @@ services:
mem_reservation: 600m
volumes:
- '/etc/freedmr/freedmr.cfg:/opt/freedmr/freedmr.cfg'
- '/var/log/freedmr/freedmr.log:/opt/freedmr/freedmr.log'
# - '/var/log/freedmr/freedmr.log:/opt/freedmr/freedmr.log'
- '/etc/freedmr/rules.py:/opt/freedmr/rules.py'
#Write JSON files outside of container
- '/etc/freedmr/json/talkgroup_ids.json:/opt/freedmr/talkgroup_ids.json'
@ -39,6 +39,16 @@ services:
networks:
app_net:
ipv4_address: 172.16.238.10
#Control parameters inside container
environment:
#IPV6 support
- FDPROXY_IPV6=0
#Display connection stats in log
- FDPROXY_STATS=1
#Display conneting client info in log
- FDPROXY_CLIENTINFO=1
#Debug HBP session in log (lots of data!!)
- FDPROXY_DEBUG=0
read_only: "true"
freedmrmon:

View File

@ -69,7 +69,7 @@ REPORT_CLIENTS: *
[LOGGER]
LOG_FILE: freedmr.log
LOG_HANDLERS: file-timed
LOG_HANDLERS: console-timed
LOG_LEVEL: INFO
LOG_NAME: FreeDMR
@ -174,9 +174,9 @@ echo Set perms on config directory...
chown -R 54000 /etc/freedmr &&
echo Setup logging...
mkdir -p /var/log/freedmr &&
touch /var/log/freedmr/freedmr.log &&
chown -R 54000 /var/log/freedmr &&
#mkdir -p /var/log/freedmr &&
#touch /var/log/freedmr/freedmr.log &&
#chown -R 54000 /var/log/freedmr &&
mkdir -p /var/log/FreeDMRmonitor &&
touch /var/log/FreeDMRmonitor/lastheard.log &&
touch /var/log/FreeDMRmonitor/hbmon.log &&

View File

@ -215,6 +215,15 @@ if __name__ == '__main__':
#If IPv6 is enabled by enivornment variable...
if ListenIP == '' and 'FDPROXY_IPV6' in os.environ and bool(os.environ['FDPROXY_IPV6']):
ListenIP = '::'
#Override static config from Environment
if 'FDPROXY_STATS' in os.environ:
Stats = bool(os.environ['FDPROXY_STATS'])
if 'FDPROXY_DEBUG' in os.environ:
Debug = bool(os.environ['FDPROXY_DEBUG'])
if 'FDPROXY_CLIENTINFO' in os.environ:
ClientInfo = bool(os.environ['FDPROXY_CLIENTINFO'])
CONNTRACK = {}