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: app_net:
ipv4_address: 172.16.238.10 ipv4_address: 172.16.238.10
ipv6_address: fd2a:70b6:9f54:29b6::10 ipv6_address: fd2a:70b6:9f54:29b6::10
#Control parameters inside container
environment: environment:
#IPV6 support
- FDPROXY_IPV6=1 - 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" read_only: "true"
ipv6nat: ipv6nat:

View File

@ -24,7 +24,7 @@ services:
mem_reservation: 600m mem_reservation: 600m
volumes: volumes:
- '/etc/freedmr/freedmr.cfg:/opt/freedmr/freedmr.cfg' - '/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' - '/etc/freedmr/rules.py:/opt/freedmr/rules.py'
#Write JSON files outside of container #Write JSON files outside of container
- '/etc/freedmr/json/talkgroup_ids.json:/opt/freedmr/talkgroup_ids.json' - '/etc/freedmr/json/talkgroup_ids.json:/opt/freedmr/talkgroup_ids.json'
@ -39,6 +39,16 @@ services:
networks: networks:
app_net: app_net:
ipv4_address: 172.16.238.10 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" read_only: "true"
freedmrmon: freedmrmon:

View File

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

View File

@ -215,6 +215,15 @@ if __name__ == '__main__':
#If IPv6 is enabled by enivornment variable... #If IPv6 is enabled by enivornment variable...
if ListenIP == '' and 'FDPROXY_IPV6' in os.environ and bool(os.environ['FDPROXY_IPV6']): if ListenIP == '' and 'FDPROXY_IPV6' in os.environ and bool(os.environ['FDPROXY_IPV6']):
ListenIP = '::' 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 = {} CONNTRACK = {}