Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation-specific configuration settings #58

Open
jpmens opened this issue Aug 20, 2024 · 0 comments
Open

Installation-specific configuration settings #58

jpmens opened this issue Aug 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jpmens
Copy link
Member

jpmens commented Aug 20, 2024

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",
@jpmens jpmens added the enhancement New feature or request label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant