Update app/main.py

This commit is contained in:
2026-06-12 09:26:16 +00:00
parent 9313c830d1
commit 305347e1f6
+9 -1
View File
@@ -52,11 +52,19 @@ def get_app_services():
for row in rows: for row in rows:
app_id = row["id"] app_id = row["id"]
health_url = row["health_url"] or "/health" health_url = (row["health_url"] or "/health").strip()
# Interní monitor nesmí používat https://appfactory-caddy,
# protože certifikát není vystavený pro docker hostname appfactory-caddy.
if health_url.startswith("https://appfactory-caddy"):
health_url = health_url.replace("https://appfactory-caddy", "http://appfactory-caddy", 1)
if health_url.startswith("http://") or health_url.startswith("https://"): if health_url.startswith("http://") or health_url.startswith("https://"):
services[app_id] = health_url services[app_id] = health_url
else: else:
if not health_url.startswith("/"):
health_url = "/" + health_url
services[app_id] = f"http://appfactory-caddy/apps/{app_id}{health_url}" services[app_id] = f"http://appfactory-caddy/apps/{app_id}{health_url}"
return services return services