Repository navigation
Studio redesign, audit log, backups, collections, encryption at rest and promotion - #10
Conversation
- Sidebar: 232px width, 10px item padding and gap, panel background, solid active item in dark mode. - Add StatCard/StatGrid and use them for summary tiles on Overview, Indexes and Backups, all fed by real engine values. - API Keys: four role cards on top, explanation note below the list. - Settings: left sub-menu (General, Storage, Networking, Security, Limits); card definitions moved to settings/SettingsCards.tsx. - Logs: Time/Level/Event header row and Export CSV (toLogCsv, tested). - docs: add studio-figma-gap-plan.md with the phased plan for the Figma features the engine does not back yet.
Server: - metrics: in-memory History ring and RequestMetrics.Total; the web server samples gauges every 10s for 24h and serves them at GET /api/metrics/history (admin only, window capped at 24h). - auth: TokenStore tracks last use in memory only, so authenticating never writes to the engine; List reports last_used_at. - logbuf: entries carry a source derived from the message text; /api/logs accepts source=. Studio: - Keys: Last used column. - Logs: Source column, source and time-range filters, source in the text and CSV exports. - Metrics: Live / 1h / 24h range picker backed by the server history. - Overview: requests-per-second chart for the last hour. - docs: record the Phase 1 differences in studio-figma-gap-plan.md.
- audit: append-only, hash-chained audit.log in the data directory. Records sign-ins, key and record changes, user deletes, checkpoints, settings changes and backup actions; never values or secrets. The server refuses to start if the existing chain is broken. Served at GET /api/audit and shown on a new Audit tab on the Logs page. - runtimecfg: WAL checkpoint threshold, sign-in rate limit and backup schedule can be changed live at /api/settings/runtime, are validated, saved to runtime-settings.json (overriding the flags on restart) and audited. Engine and rate limiter gain runtime setters. - backup: create, verify, list and download (tar) backups of a running node, with an optional schedule and retention. Built on Engine.CreateSnapshot, so reads and writes pause for the copy. Bundles match beastctl's format; a test proves beastctl verify and restore accept them. Restore stays an offline beastctl step. - Studio: Backups table with Back up now, Verify, Download and a copy restore command; editable settings cards; Audit tab. - docs: record Phase 2 in studio-figma-gap-plan.md.
Persisted catalog binding names to key prefixes; create/list/drop in the engine, gRPC and /api/collections; Table Editor rail shows and manages them. Existing uint64 keys are unchanged; catalog key is protected from plain writes.
Persisted epoch and role, epoch carried in replication RPCs, Fence RPC, stale-epoch rejection by followers, leader step-down on a higher epoch, admin promote endpoint with audit entry, and a Studio Promote action gated on the node being caught up. Promotion is manual; no automatic election and not high availability.
AES-256-GCM on data pages, checkpoint journal, spill file and WAL records; key file plus wrapped data key in <db>.keyring; format flag in page 0; beastctl keygen/encrypt/decrypt/rekey; encrypted backups with keyed verify and restore; Studio Settings reports the running engine's state. Tests cover crash recovery, wrong key, tamper detection and migration.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a00500d071
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| w.Header().Set("Content-Type", "application/x-tar") | ||
| w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s.tar"`, id)) | ||
| tw := tar.NewWriter(w) | ||
| for _, name := range []string{"manifest.json", "data.bin"} { |
There was a problem hiding this comment.
Include the keyring in encrypted backup downloads
When a server-managed backup is encrypted, Create stores keyring.json in the bundle, but this tar loop includes only manifest.json and data.bin. beastctl restore requires that keyring for encrypted bundles, so a downloaded backup cannot be restored even with the correct master key. Include keyring.json when it exists.
Useful? React with 👍 / 👎.
…rage format v2 Encrypted pages replace the v2 checksum trailer with the AES-GCM tag (usable page end 4064 instead of 4092); chains, the free list and new pages take the end from DiskManager.PageEnd. Page 0 flags move to bytes 64..68. The encrypted WAL gets torn-tail trimming, ErrCorruptLog and the truncate option. Tests cover encrypted v2 page reuse and saved maps, v1 migration with and without a key, WAL rotation and truncation with the cipher. ADR 0003 records the decisions.
Summary
Brings the Studio redesign and the engine features behind it to
main.govulncheckandbun auditfindings (Go 1.27.4).Supersedes #7, whose commits are included here.
Known limits
beastctl.Status
maingained storage format v2 (#8, #9) after this branch was cut. It conflicts with the encryption page layout in 10 files. The resolution is in progress and will be pushed to this branch before merge.Test plan
go build ./... && go vet ./... && go test ./... -raceon this branch before themainmergebun test,bun run build,govulncheck,bun auditmain(format v2 with encryption)