- Add Registry.UnsealAll() that rediscovers mounted engines from the barrier on unseal, using stored metadata at engine/_mounts/ with a fallback discovery scan for pre-existing mounts (migration path) - Registry.Mount() now persists mount metadata to the barrier; Registry.Unmount() cleans it up - Call UnsealAll() from both REST and web unseal handlers - Change Unmount() signature to accept context.Context - Default CA key size changed from P-384 to P-521 - Add build-time version stamp via ldflags; display in dashboard status bar - Make metacrypt target .PHONY so make devserver always rebuilds - Redirect /pki to /dashboard when no CA engine is mounted Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
64 lines
2.1 KiB
HTML
64 lines
2.1 KiB
HTML
{{define "title"}} - Dashboard{{end}}
|
|
{{define "content"}}
|
|
<h2>Dashboard</h2>
|
|
<div class="status-bar">
|
|
<span>Logged in as <strong>{{.Username}}</strong></span>
|
|
{{if .IsAdmin}}<span class="badge">Admin</span>{{end}}
|
|
<span>State: <strong>{{.State}}</strong></span>
|
|
<span class="version">v{{.Version}}</span>
|
|
<a href="/login" onclick="fetch('/v1/auth/logout',{method:'POST'})">Logout</a>
|
|
</div>
|
|
|
|
<h3>Engine Mounts</h3>
|
|
{{if .Mounts}}
|
|
<table>
|
|
<thead><tr><th>Name</th><th>Type</th><th>Path</th></tr></thead>
|
|
<tbody>
|
|
{{range .Mounts}}
|
|
<tr>
|
|
<td>{{if eq (printf "%s" .Type) "ca"}}<a href="/pki">{{.Name}}</a>{{else}}{{.Name}}{{end}}</td>
|
|
<td>{{.Type}}</td>
|
|
<td>{{.MountPath}}</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{else}}
|
|
<p>No engines mounted.</p>
|
|
{{end}}
|
|
|
|
{{if .IsAdmin}}
|
|
<h3>Mount CA Engine</h3>
|
|
{{if .MountError}}<div class="error">{{.MountError}}</div>{{end}}
|
|
<form method="post" action="/dashboard/mount-ca" enctype="multipart/form-data">
|
|
<div class="form-row">
|
|
<div class="form-group">
|
|
<label for="mount_name">Mount Name</label>
|
|
<input type="text" id="mount_name" name="name" placeholder="pki" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="organization">Organization</label>
|
|
<input type="text" id="organization" name="organization" placeholder="Metacircular">
|
|
</div>
|
|
</div>
|
|
<details>
|
|
<summary>Import existing root CA (optional)</summary>
|
|
<div class="form-group">
|
|
<label for="cert_file">Certificate PEM file</label>
|
|
<input type="file" id="cert_file" name="cert_file" accept=".pem,.crt">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="key_file">Private Key PEM file</label>
|
|
<input type="file" id="key_file" name="key_file" accept=".pem,.key">
|
|
</div>
|
|
</details>
|
|
<button type="submit">Mount</button>
|
|
</form>
|
|
|
|
<h3>Admin Actions</h3>
|
|
<div class="admin-actions">
|
|
<button hx-post="/v1/seal" hx-confirm="Are you sure you want to seal the service?">Seal Service</button>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|