Phases 11, 12: mcrctl CLI tool and mcr-web UI
Phase 11 implements the admin CLI with dual REST/gRPC transport, global flags (--server, --grpc, --token, --ca-cert, --json), and all commands: status, repo list/delete, policy CRUD, audit tail, gc trigger/status/reconcile, and snapshot. Phase 12 implements the HTMX web UI with chi router, session-based auth (HttpOnly/Secure/SameSite=Strict cookies), CSRF protection (HMAC-SHA256 signed double-submit), and pages for dashboard, repositories, manifest detail, policy management, and audit log. Security: CSRF via signed double-submit cookie, session cookies with HttpOnly/Secure/SameSite=Strict, TLS 1.3 minimum on all connections, form body size limits via http.MaxBytesReader. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
80
web/templates/audit.html
Normal file
80
web/templates/audit.html
Normal file
@@ -0,0 +1,80 @@
|
||||
{{define "title"}}Audit Log{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<h1>Audit Log</h1>
|
||||
|
||||
{{if .Error}}
|
||||
<div class="error">{{.Error}}</div>
|
||||
{{end}}
|
||||
|
||||
<form method="GET" action="/audit" class="filters">
|
||||
<div class="form-group">
|
||||
<label for="event_type">Event Type</label>
|
||||
<select id="event_type" name="event_type">
|
||||
<option value="">All</option>
|
||||
<option value="manifest_pushed" {{if eq .FilterType "manifest_pushed"}}selected{{end}}>Manifest Pushed</option>
|
||||
<option value="manifest_deleted" {{if eq .FilterType "manifest_deleted"}}selected{{end}}>Manifest Deleted</option>
|
||||
<option value="blob_uploaded" {{if eq .FilterType "blob_uploaded"}}selected{{end}}>Blob Uploaded</option>
|
||||
<option value="blob_deleted" {{if eq .FilterType "blob_deleted"}}selected{{end}}>Blob Deleted</option>
|
||||
<option value="repo_deleted" {{if eq .FilterType "repo_deleted"}}selected{{end}}>Repo Deleted</option>
|
||||
<option value="gc_started" {{if eq .FilterType "gc_started"}}selected{{end}}>GC Started</option>
|
||||
<option value="gc_completed" {{if eq .FilterType "gc_completed"}}selected{{end}}>GC Completed</option>
|
||||
<option value="policy_created" {{if eq .FilterType "policy_created"}}selected{{end}}>Policy Created</option>
|
||||
<option value="policy_updated" {{if eq .FilterType "policy_updated"}}selected{{end}}>Policy Updated</option>
|
||||
<option value="policy_deleted" {{if eq .FilterType "policy_deleted"}}selected{{end}}>Policy Deleted</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="repository">Repository</label>
|
||||
<input type="text" id="repository" name="repository" value="{{.FilterRepo}}" placeholder="e.g. library/nginx">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="since">Since</label>
|
||||
<input type="date" id="since" name="since" value="{{.FilterSince}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="until">Until</label>
|
||||
<input type="date" id="until" name="until" value="{{.FilterUntil}}">
|
||||
</div>
|
||||
<button type="submit">Filter</button>
|
||||
</form>
|
||||
|
||||
{{if .Events}}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Type</th>
|
||||
<th>Actor</th>
|
||||
<th>Repository</th>
|
||||
<th>Digest</th>
|
||||
<th>IP Address</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Events}}
|
||||
<tr>
|
||||
<td>{{formatTime .EventTime}}</td>
|
||||
<td>{{.EventType}}</td>
|
||||
<td>{{.ActorId}}</td>
|
||||
<td>{{.Repository}}</td>
|
||||
<td class="truncated">{{truncate .Digest 24}}</td>
|
||||
<td>{{.IpAddress}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="pagination">
|
||||
{{if gt .Page 1}}
|
||||
<a href="{{.PrevURL}}">Previous</a>
|
||||
{{end}}
|
||||
<span>Page {{.Page}}</span>
|
||||
{{if .HasNext}}
|
||||
<a href="{{.NextURL}}">Next</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
<p>No audit events found.</p>
|
||||
{{end}}
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user