Require apex and www TLS for storefront SSL status.

Per-row ensure and SSL refresh treat storefront as valid only when both names match, and toast messages list each host explicitly.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-09 17:57:24 +03:30
co-authored by Cursor
parent a9d5f2e48d
commit 158523df7b
3 changed files with 86 additions and 34 deletions
+10 -2
View File
@@ -88,12 +88,20 @@ export class InternalSslService implements OnModuleInit {
const started = Date.now();
try {
const domains = await this.listActiveDomains();
const sslByHost = await probeTlsHosts(domains.map((d) => d.host));
const hostsToProbe = domains.flatMap((d) => {
const apex = d.host.trim().toLowerCase();
if (!apex) return [];
const www = apex.startsWith('www.') ? apex : `www.${apex}`;
return [apex, www];
});
const sslByHost = await probeTlsHosts(hostsToProbe);
let updated = 0;
for (const domain of domains) {
const hostKey = domain.host.trim().toLowerCase();
const sslEnabled = sslByHost.get(hostKey) ?? false;
const wwwKey = hostKey.startsWith('www.') ? hostKey : `www.${hostKey}`;
const sslEnabled =
(sslByHost.get(hostKey) ?? false) && (sslByHost.get(wwwKey) ?? false);
if (sslEnabled === domain.sslEnabled) continue;
await this.prisma.domain.update({