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

@@ -38,8 +38,12 @@ semaphore_postgres_volume: semaphore_postgres_data
semaphore_listen_address: "0.0.0.0" semaphore_listen_address: "0.0.0.0"
semaphore_listen_port: 3000 semaphore_listen_port: 3000
# Public URL (used by Semaphore for OIDC redirects, webhook URLs, etc.) # Public URL used for Semaphore-generated absolute URLs (webhooks, OIDC
semaphore_web_url: "https://semaphore.local.mk-labs.cloud" # callbacks, etc). Leave EMPTY to make Semaphore host-agnostic — the SPA
# then uses relative URLs and serves cleanly under any hostname Traefik
# points at it. Set to a fully-qualified URL only if a specific feature
# requires an absolute base.
semaphore_web_url: ""
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# PostgreSQL configuration # PostgreSQL configuration

View File

@@ -39,7 +39,10 @@ Environment=SEMAPHORE_PLAYBOOK_PATH=/var/lib/semaphore/playbooks
Environment=SEMAPHORE_ACCESS_KEY_ENCRYPTION={{ semaphore_access_key_encryption }} Environment=SEMAPHORE_ACCESS_KEY_ENCRYPTION={{ semaphore_access_key_encryption }}
# Public-facing URL used for OIDC redirects, webhooks, etc. # 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 }} Environment=SEMAPHORE_WEB_ROOT={{ semaphore_web_url }}
{% endif %}
# Timezone matches host baseline # Timezone matches host baseline
Environment=TZ=America/Chicago Environment=TZ=America/Chicago