Files
virarepo/mqtt-cert-manager/app/templates/index.html
T
eta 9472cfff8d
build-and-push / check-branch (push) Successful in 11s
build-and-push / build (amd64, linux/amd64) (push) Successful in 10m57s
Decouple certificate CN from device_id
- ca.sign_csr's identity parameter renamed to `common_name`, fully
  decoupled from device_id.
- New resolve_common_name(): CN comes from the device's own CSR: falls
  back to device_id only if the CSR has no CN (malformed request).
- Renewal unaffected: a renewed cert always keeps the CN of the
  device's current, still-valid cert, regardless of what the renewal
  CSR claims (verified against an adversarial CSR asserting a
  different CN).
- device_id remains the sole storage key (pending/issued/revoked) and
  MQTT topic routing key, and must still be unique per physical
  device even when CN is deliberately shared across many.
- /api/pending and /api/issued now also expose the CSR-resolved CN for
  display, without changing what's actually stored.

No topic structure changes. No new MQTT payload fields.
2026-08-27 16:34:42 +03:30

50 lines
1.6 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>MQTT Certificate Manager</title>
<link rel="stylesheet" href="static/style.css">
</head>
<body>
<h1>MQTT certificate manager</h1>
<section>
<h2>Pending requests</h2>
<table id="pending-table">
<thead><tr><th>Device</th><th>CN</th><th>Requested</th><th>Info</th><th></th></tr></thead>
<tbody></tbody>
</table>
<p id="pending-empty" class="empty" style="display:none">No pending requests. Nodes that ask for a certificate will show up here.</p>
</section>
<section>
<h2>Issued certificates</h2>
<table id="issued-table">
<thead><tr><th>Device</th><th>CN</th><th>Issued</th><th>Expires</th><th></th></tr></thead>
<tbody></tbody>
</table>
<p id="issued-empty" class="empty" style="display:none">No certificates issued yet.</p>
</section>
<section>
<h2>Revoked certificates</h2>
<p class="note">Revocation takes effect after Mosquitto is restarted — it reloads the CRL file on start, not live.</p>
<table id="revoked-table">
<thead><tr><th>Device</th><th>Revoked</th><th>Reason</th></tr></thead>
<tbody></tbody>
</table>
<p id="revoked-empty" class="empty" style="display:none">Nothing revoked.</p>
</section>
<section>
<h2>Broker TLS certificate</h2>
<div id="broker-cert-status"></div>
<p>Paste this into the Mosquitto add-on's config (files live in the shared <code>/ssl</code> folder):</p>
<pre id="broker-cert-config"></pre>
<button id="reissue-broker-cert">Reissue broker certificate</button>
</section>
<script src="static/app.js"></script>
</body>
</html>