fix(certificates): не мониторить SSL без health-check с TLS verify
Build and Push CFDM Docker Image / build-and-push (push) Successful in 1m59s
Build and Push CFDM Docker Image / create-release (push) Skipped
Build and Push CFDM Docker Image / update-wiki (push) Successful in 6s

Биндинги с выключенным health-check (imsk/mmsk) исключаются из авто-мониторинга; sticky footer в редактировании сервиса.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-07-20 18:09:51 +07:00
co-authored by Cursor
parent 56f2ed78e5
commit 278a6b64b4
4 changed files with 119 additions and 15 deletions
+32 -6
View File
@@ -142,11 +142,27 @@ function bindingSubdomain(
return repos.findSubdomainByDomainAndName(db, domainId, hostname);
}
/** Health-check without TLS verify implies invalid certs — skip SSL monitoring. */
function skipsSslDueToHealthTls(
group: { health_check_enabled: boolean; health_check_verify_tls: boolean } | null,
type HealthTlsFlags = {
health_check_enabled: boolean;
health_check_verify_tls: boolean;
};
/**
* Auto SSL monitoring follows effective health-check with TLS verify.
* No health → no SSL. Health without verify_tls (self-signed) → no SSL.
* Binding inherits group health when its own health is off.
*/
function hasSslHealthGate(
own: HealthTlsFlags,
group: (HealthTlsFlags & { enabled: boolean }) | null,
): boolean {
return Boolean(group?.health_check_enabled && !group.health_check_verify_tls);
if (own.health_check_enabled) {
return own.health_check_verify_tls;
}
if (group?.enabled && group.health_check_enabled) {
return group.health_check_verify_tls;
}
return false;
}
export function buildServiceCertificateFqdns(
@@ -160,7 +176,17 @@ export function buildServiceCertificateFqdns(
? repos.getServiceGroup(db, service.service_group_id)
: null;
if (!shouldMonitorService(service, group)) continue;
if (skipsSslDueToHealthTls(group)) continue;
if (
!hasSslHealthGate(
{
health_check_enabled: binding.health_check_enabled,
health_check_verify_tls: binding.health_check_verify_tls,
},
group,
)
) {
continue;
}
const subdomain = bindingSubdomain(db, binding.domain_id, binding.hostname);
if (subdomain && !subdomain.enabled) continue;
@@ -176,7 +202,7 @@ export function buildServiceCertificateFqdns(
const knownZones = repos.listAllDomains(db).map((d) => d.zone_name);
for (const group of repos.listServiceGroups(db)) {
if (!group.enabled || !group.domain?.trim()) continue;
if (skipsSslDueToHealthTls(group)) continue;
if (!group.health_check_enabled || !group.health_check_verify_tls) continue;
const parsed = parseFqdn(group.domain, knownZones);
if (!parsed) continue;