mirror of
https://git.meshkee.com/Meshkee/backend.git
synced 2026-08-11 22:30:59 +04:30
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:
co-authored by
Cursor
parent
a9d5f2e48d
commit
158523df7b
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user