Open
Description
There have been a few cases where users have wanted tweaking of a value or two in our configuration. Maybe we could satisfy such requests relatively easily.
To date we template out most settings using Jinja templates. For instance part of the Frontend config.js
looks like this:
baseUrl: "{{ scheme }}://{{ dns_domain }}/owntracks",
which, when rendered produces
baseUrl: "https://example.com/owntracks",
We could add an optional dict in configuration.yaml
which looked like this:
cf:
http_external: 9007
mqtt_broker: # --> Connect to and use an already existing MQTT broker within the network
storage: # --> Specifying an alternative storage directory
Adjusting the Jinja template to
baseUrl: "{{ scheme }}://{{ dns_domain }}{{ "" if cf.http_external is not defined else ":" ~ cf.http_external }}/owntracks",
would add the port number with the colon if the specified variable cf
and its element cf.http_external
are defined, else not, rendering the output as
baseUrl: "https://example.com:9007/owntracks",
Activity