Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/common/gen/Configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(
self.__compiled_regexes = {}

# Pre-defined exclusion sets for config processing
self.__excluded_prefixes = ("_", "PYTHON", "KUBERNETES_", "SVC_", "LB_", "SUPERVISOR_")
self.__excluded_prefixes = ("PYTHON", "KUBERNETES_", "NOMAD_", "SVC_", "LB_", "SUPERVISOR_")
self.__excluded_vars = frozenset(
{
"DOCKER_HOST",
Expand Down Expand Up @@ -111,6 +111,21 @@ def __init__(
else:
self.__variables = variables

# Allow a leading underscore prefix on env var names so that domain names
# starting with a digit can be configured (bash forbids var names starting
# with a digit, e.g. 1nteresting.io). Users write _1nteresting.io_USE_...
# and we strip the single leading underscore here before any other processing.
stripped: Dict[str, str] = {}
for k, v in self.__variables.items():
new_key = k.removeprefix("_")
if not new_key:
# Skip bare "_" or similar empty-after-strip keys
continue
if new_key in stripped:
self.__logger.warning(f"Variable collision after stripping leading underscore: both {k!r} and {new_key!r} exist, keeping last value")
stripped[new_key] = v
self.__variables = stripped

self.__multisite = self.__variables.get("MULTISITE", "no") == "yes"
self.__servers = self.__map_servers()

Expand Down