Skip to content

Commit 04a5d66

Browse files
committed
feat(status): Display external-url in juju status when configured
Enhance the status message to show the configured external-url instead of the auto-detected IP:PORT when external-url is set. Changes: - Modified _get_web_url() to prioritize external-url configuration - Falls back to auto-detected http://IP:PORT when external-url is empty - Maintains backward compatibility with existing deployments Behavior: - When external-url is set: Shows 'Web server ready (v7.14.2) <external-url>' - When external-url is empty: Shows 'Web server ready (v7.14.2) http://IP:PORT' This ensures the status message reflects the actual external URL that Concourse uses for webhooks and OAuth redirects, improving visibility and reducing confusion when running behind proxies or with custom domains.
1 parent b53a543 commit 04a5d66

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/charm.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,9 +1792,17 @@ def _get_installed_concourse_version(self) -> Optional[str]:
17921792
return None
17931793

17941794
def _get_web_url(self) -> Optional[str]:
1795-
"""Get the web server URL (http://IP:PORT) for status display"""
1795+
"""Get the web server URL for status display
1796+
1797+
Prioritizes external-url config, falls back to auto-detected IP:PORT
1798+
"""
17961799
try:
1797-
# Get the unit's IP address from network binding
1800+
# Check if external-url is configured
1801+
external_url = self.config.get("external-url", "").strip()
1802+
if external_url:
1803+
return external_url
1804+
1805+
# Auto-detect: Get the unit's IP address from network binding
17981806
# Try multiple bindings in order of preference
17991807
binding = None
18001808
for binding_name in ["tsa", "peers", ""]:

0 commit comments

Comments
 (0)