From 807692e26feba0c4af4e400d3fda5943d3f9ef27 Mon Sep 17 00:00:00 2001 From: OE5JFE Date: Sun, 19 May 2024 13:45:48 +0200 Subject: [PATCH 1/3] Update config.json.template Change name of parameters for telnet connection. Make it easier to used sed to set those parameters by scripting (for use in Docker container using env variables) --- cfg/config.json.template | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cfg/config.json.template b/cfg/config.json.template index a5a64a7..397ce04 100644 --- a/cfg/config.json.template +++ b/cfg/config.json.template @@ -12,15 +12,15 @@ "mail":"foo@bar.com", "enable_cq_filter":"n", "telnet": { - "host": "mysite", - "port": "7300", - "user": "myuser", - "password": "" + "telnet_host": "mysite", + "telnet_port": "7300", + "telnet_user": "myuser", + "telnet_password": "" }, "menu": { "menu_list": [ {"label":"Charts & stats", "link": "/plots.html", "external": false}, - {"label": "Propagation", "link": "/propagation.html", "external": false}, + {"label":"Propagation", "link": "/propagation.html", "external": false}, {"label":"Sources", "link": "https://github.com/coulisse/spiderweb/" , "external": true}, {"label":"Cookies", "link": "/cookies.html", "external": false}, {"label":"Privacy", "link": "/privacy.html", "external": false} From 78b2d12ee28b490fa96f916ca30aaa1ac1994b37 Mon Sep 17 00:00:00 2001 From: OE5JFE Date: Sun, 19 May 2024 15:08:26 +0200 Subject: [PATCH 2/3] Update webapp.py Read parameters correctly from config.json --- webapp.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp.py b/webapp.py index 40fd75b..463a551 100644 --- a/webapp.py +++ b/webapp.py @@ -173,10 +173,10 @@ def spotlist(): def who_is_connected(): - host=cfg["telnet"]["host"] - port=cfg["telnet"]["port"] - user=cfg["telnet"]["user"] - password=cfg["telnet"]["password"] + host=cfg["telnet"]["telnet_host"] + port=cfg["telnet"]["telnet_port"] + user=cfg["telnet"]["telnet_user"] + password=cfg["telnet"]["telnet_password"] response = who(host, port, user, password) logger.debug("list of connected clusters:") logger.debug(response) From 5016db9d1d8cc8aa2c463e66c344154ebf62a76c Mon Sep 17 00:00:00 2001 From: OE5JFE Date: Sun, 19 May 2024 15:52:37 +0200 Subject: [PATCH 3/3] Update webapp.py Telnet config now adjusted --- webapp.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/webapp.py b/webapp.py index 463a551..ebc4fae 100644 --- a/webapp.py +++ b/webapp.py @@ -208,7 +208,7 @@ def spots(): "index.html", inline_script_nonce=get_nonce(), mycallsign=cfg["mycallsign"], - telnet=cfg["telnet"]["host"]+":"+cfg["telnet"]["port"], + telnet=cfg["telnet"]["telnet_host"]+":"+cfg["telnet"]["telnet_port"], mail=cfg["mail"], menu_list=cfg["menu"]["menu_list"], visits=len(visits), @@ -266,7 +266,7 @@ def plots(): "plots.html", inline_script_nonce=get_nonce(), mycallsign=cfg["mycallsign"], - telnet=cfg["telnet"]["host"]+":"+cfg["telnet"]["port"], + telnet=cfg["telnet"]["telnet_host"]+":"+cfg["telnet"]["telnet_port"], mail=cfg["mail"], menu_list=cfg["menu"]["menu_list"], visits=len(visits), @@ -298,7 +298,7 @@ def propagation(): "propagation.html", inline_script_nonce=get_nonce(), mycallsign=cfg["mycallsign"], - telnet=cfg["telnet"]["host"]+":"+cfg["telnet"]["port"], + telnet=cfg["telnet"]["telnet_host"]+":"+cfg["telnet"]["telnet_port"], mail=cfg["mail"], menu_list=cfg["menu"]["menu_list"], visits=len(visits), @@ -316,7 +316,7 @@ def cookies(): "cookies.html", inline_script_nonce=get_nonce(), mycallsign=cfg["mycallsign"], - telnet=cfg["telnet"]["host"]+":"+cfg["telnet"]["port"], + telnet=cfg["telnet"]["telnet_host"]+":"+cfg["telnet"]["telnet_port"], mail=cfg["mail"], menu_list=cfg["menu"]["menu_list"], visits=len(visits), @@ -331,7 +331,7 @@ def privacy(): "privacy.html", inline_script_nonce=get_nonce(), mycallsign=cfg["mycallsign"], - telnet=cfg["telnet"]["host"]+":"+cfg["telnet"]["port"], + telnet=cfg["telnet"]["telnet_host"]+":"+cfg["telnet"]["telnet_port"], mail=cfg["mail"], menu_list=cfg["menu"]["menu_list"], visits=len(visits), @@ -353,7 +353,7 @@ def callsign(): "callsign.html", inline_script_nonce=get_nonce(), mycallsign=cfg["mycallsign"], - telnet=cfg["telnet"]["host"]+":"+cfg["telnet"]["port"], + telnet=cfg["telnet"]["telnet_host"]+":"+cfg["telnet"]["telnet_port"], mail=cfg["mail"], menu_list=cfg["menu"]["menu_list"], visits=len(visits),