fix(semaphore): make host-agnostic by omitting SEMAPHORE_WEB_ROOT

The SPA was rendering <base href="https://semaphore.local.mk-labs.cloud/">
regardless of which hostname served the page, causing the imagineering
alias to load the same UI but rewrite all in-page navigation back to the
semaphore hostname. Confusing for users hitting either Traefik alias.

Leave SEMAPHORE_WEB_ROOT empty so Semaphore emits relative URLs and is
fully host-agnostic. Both DNS names (semaphore + imagineering) now serve
cleanly without preference between them.

The template only emits SEMAPHORE_WEB_ROOT when the variable is set, so
the env-var is absent from the container when not needed.
This commit is contained in:
Hermes Agent service account
2026-05-29 21:52:33 -05:00
parent d05cfcf317
commit 9e68802090
2 changed files with 9 additions and 2 deletions

View File

@@ -39,7 +39,10 @@ Environment=SEMAPHORE_PLAYBOOK_PATH=/var/lib/semaphore/playbooks
Environment=SEMAPHORE_ACCESS_KEY_ENCRYPTION={{ semaphore_access_key_encryption }}
# Public-facing URL used for OIDC redirects, webhooks, etc.
# Empty string keeps Semaphore host-agnostic (relative URLs).
{% if semaphore_web_url | length > 0 %}
Environment=SEMAPHORE_WEB_ROOT={{ semaphore_web_url }}
{% endif %}
# Timezone matches host baseline
Environment=TZ=America/Chicago