diff --git a/config-example.yml b/config-example.yml index cf75d09..7e4065e 100644 --- a/config-example.yml +++ b/config-example.yml @@ -6,6 +6,9 @@ # this as "N0CALL" and it shouldn't do any harm, as we're not sending anything to the various networks, only receiving. server-owner-callsign: "N0CALL" +# The base URL at which the software runs. +base-url: "http://localhost:8080" + # Spot providers to use. This is an example set, tailor it to your liking by commenting and uncommenting. # RBN and APRS-IS are supported but have such a high data rate, you probably don't want them enabled. # Each provider needs a class, a name, and an enabled/disabled state. Some require more config such as hostnames/IP diff --git a/core/config.py b/core/config.py index 64265f2..59fe5a0 100644 --- a/core/config.py +++ b/core/config.py @@ -14,6 +14,7 @@ with open("config.yml") as f: config = yaml.safe_load(f) logging.info("Loaded config.") +BASE_URL = config["base-url"] MAX_SPOT_AGE = config["max-spot-age-sec"] MAX_ALERT_AGE = config["max-alert-age-sec"] SERVER_OWNER_CALLSIGN = config["server-owner-callsign"] diff --git a/server/handlers/pagetemplate.py b/server/handlers/pagetemplate.py index 8a96e35..3f18926 100644 --- a/server/handlers/pagetemplate.py +++ b/server/handlers/pagetemplate.py @@ -3,7 +3,7 @@ from datetime import datetime import pytz import tornado -from core.config import ALLOW_SPOTTING, WEB_UI_OPTIONS +from core.config import ALLOW_SPOTTING, WEB_UI_OPTIONS, BASE_URL from core.constants import SOFTWARE_VERSION from core.prometheus_metrics_handler import page_requests_counter @@ -24,4 +24,4 @@ class PageTemplateHandler(tornado.web.RequestHandler): # Load named template, and provide variables used in templates self.render(self._template_name + ".html", software_version=SOFTWARE_VERSION, allow_spotting=ALLOW_SPOTTING, - web_ui_options=WEB_UI_OPTIONS) + web_ui_options=WEB_UI_OPTIONS, baseurl = BASE_URL, current_path=self.request.path) \ No newline at end of file diff --git a/templates/about.html b/templates/about.html index 546314b..146217e 100644 --- a/templates/about.html +++ b/templates/about.html @@ -66,7 +66,7 @@
This software is dedicated to the memory of Tom G1PJB, SK, a friend and colleague who sadly passed away around the time I started writing it in Autumn 2025. I was looking forward to showing it to you when it was done.
- + {% end %} \ No newline at end of file diff --git a/templates/add_spot.html b/templates/add_spot.html index 1641404..3aeafef 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -69,8 +69,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/alerts.html b/templates/alerts.html index 97bd949..dc5a29d 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -56,8 +56,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/bands.html b/templates/bands.html index f3a100a..30df663 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -62,9 +62,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 3935bde..1e3b4ed 100644 --- a/templates/base.html +++ b/templates/base.html @@ -13,10 +13,10 @@ - - - - + + + + @@ -46,10 +46,10 @@ crossorigin="anonymous"> - - - - + + + + diff --git a/templates/map.html b/templates/map.html index 2c2377f..88d41e7 100644 --- a/templates/map.html +++ b/templates/map.html @@ -70,9 +70,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/spots.html b/templates/spots.html index 3e21804..bded96f 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -87,9 +87,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/status.html b/templates/status.html index 08e238c..d42cd5f 100644 --- a/templates/status.html +++ b/templates/status.html @@ -3,8 +3,8 @@ - - + + {% end %} \ No newline at end of file