fix(domains): use TLS challenge for custom domains
Build and publish Docker image / build-and-publish (push) Successful in 9s

This commit is contained in:
wfalkowski committed 2026-10-24 13:14:44 +00:00
1 parent ef3d045a51
commit ae4b230ee9
2 files changed
+43 -2

No files matched your search

+8 -2
View File
@@ -423,6 +423,12 @@ def create_traefik_ingressroute(domain: str, namespace: str, service_name: str,
logger.info(f" Namespace: {namespace}")
logger.info(f" Service: {service_name}:{service_port}")
# Public custom domains use TLS-ALPN-01 because inbound HTTP (port 80)
# is not reachable on the cluster's public address. Delegated
# AnchorHost domains continue using the existing HTTP-01 resolver.
is_custom_domain = '.' in domain and not domain.endswith(f'.{domain_manager.base_domain}')
cert_resolver = 'letsencrypttls' if is_custom_domain else 'letsencrypt'
# Create IngressRoute manifest
ingressroute_body = {
'apiVersion': 'traefik.io/v1alpha1',
@@ -434,7 +440,7 @@ def create_traefik_ingressroute(domain: str, namespace: str, service_name: str,
'app': service_name,
'managed-by': 'anchorhost',
'domain': domain,
'domain-type': 'custom' if '.' in domain and not domain.endswith(f'.{domain_manager.base_domain}') else 'delegated'
'domain-type': 'custom' if is_custom_domain else 'delegated'
},
'annotations': {
'anchorhost.eu/created-at': datetime.now().isoformat(),
@@ -456,7 +462,7 @@ def create_traefik_ingressroute(domain: str, namespace: str, service_name: str,
}
],
'tls': {
'certResolver': 'letsencrypt'
'certResolver': cert_resolver
}
}
}