feat(tls): issue server certificate from internal root CA

Generate a 10-year root CA in entrypoint.sh and sign the server leaf with it. Only the root CA is distributed to clients (including GPO); the leaf is served by the app and is reissued automatically when CERT_HOSTNAMES changes. Update the Windows installer, ZIP package, settings UI and docs for the two-tier scheme.
This commit is contained in:
dev
2026-10-22 18:09:30 +03:00
parent b5eeb5fbdf
commit ba32234217
9 changed files with 272 additions and 122 deletions
+13
View File
@@ -967,6 +967,11 @@ function renderTlsInfo(tls) {
const daysCls = days == null ? 'warn' : days <= 0 ? 'err' : days <= 30 ? 'warn' : 'on';
const daysTxt = days == null ? 'срок неизвестен' : days <= 0 ? 'срок истёк' : `осталось ${days} дн.`;
const root = tls.root_ca && tls.root_ca.fingerprint_sha256 ? tls.root_ca : null;
const rootDays = root ? root.days_left : null;
const rootDaysCls = rootDays == null ? 'warn' : rootDays <= 0 ? 'err' : rootDays <= 30 ? 'warn' : 'on';
const rootDaysTxt = rootDays == null ? 'срок неизвестен' : rootDays <= 0 ? 'срок истёк' : `осталось ${rootDays} дн.`;
const sanList = Array.isArray(tls.san) ? tls.san : [];
const shown = sanList.slice(0, 14);
const chips = shown.length
@@ -994,6 +999,14 @@ function renderTlsInfo(tls) {
${stackRow('Порты', `HTTP ${esc(String(tls.http_port))} · HTTPS ${esc(String(tls.https_port))}`)}
${stackRow('Отпечаток', `<code title="${esc(tls.fingerprint_sha256 || '')}">${esc(String(tls.fingerprint_sha256 || '—').replace(/^.{16}(.{16}).*$/, '$1…'))}</code>`)}
</div>
${root ? `
<div class="sys-card">
<div class="sys-title">Корневой CA для политик</div>
${stackRow('Тема', esc(root.subject || '—'))}
${stackRow('Действует до', `${esc(fmtDateFull(root.valid_to_iso))} ${stackState(rootDaysCls, rootDaysTxt)}`)}
${stackRow('Отпечаток', `<code title="${esc(root.fingerprint_sha256 || '')}">${esc(String(root.fingerprint_sha256 || '—').replace(/^.{16}(.{16}).*$/, '$1…'))}</code>`)}
${tlsNote('on', 'Этот сертификат добавляйте в «Доверенные корневые центры сертификации» или в GPO. Серверный сертификат в доверенные добавлять не нужно.')}
</div>` : ''}
<div class="sys-card">
<div class="sys-title">Проверка</div>
${checkNote}