Skip to content

Installation-specific configuration settings #58

Open
@jpmens

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions