Goal: Aegis runs on a VPS and serves a web dashboard on a configurable port. From that page, an operator can manage everything they can manage today from the CLI, plus live resource control: deploy, roll back, start/stop/restart apps, read logs, watch CPU/memory, and change each app’s CPU and memory limits with sliders.
Status: Phases 0–6 complete (several Phase 6 parts are experimental; the multi-node fleet is later) · Releases: v0.5.0 (web MVP), v0.6.0 (resource control), v0.7.0 (self-serve ops)
| Check | Result |
|---|---|
cargo build --workspace --all-targets |
✅ passes |
cargo fmt --all -- --check |
✅ passes |
cargo clippy --workspace --all-targets -- -D warnings |
✅ passes |
cargo test --workspace --all-targets |
✅ all pass |
CI smoke flow (daemon → init → deploy → status) |
✅ passes after the fixes below |
The foundation is sound and worth building on: the event store, event bus, projection engine, scheduler, detector pipeline, release switcher, and gRPC API all work and have tests.
| Bug | Impact | Fix |
|---|---|---|
The daemon wrote a daemon-only aegis.toml into its working directory on startup |
aegis init saw an “existing” config and skipped writing [project], so every aegis deploy invented a new random project ID. The CI smoke test hit this. |
The daemon no longer creates aegis.toml. init appends [project] to an existing file that lacks one. [daemon] is now optional in aegis.toml. |
ProcessStarted always recorded "pid": 9000 |
Wrong PID in the audit trail and projections | Records the real OS PID |
The daemon reported a hardcoded version "0.1.0" |
Version drifts from the release | Uses CARGO_PKG_VERSION |
These passed tests but didn’t do what the docs and CLI claimed. Phase 0 fixed them; each row says how.
| Area | Before | After Phase 0 |
|---|---|---|
| Deploy saga starts the app | Spawned echo Deploy success |
Runs build.start_command from the release’s aegis.toml, supervised, with PORT and [env] set |
| Health checks | Never ran; the target was hardcoded to 127.0.0.1:8080 |
deploy.health_check_url (HTTP path, tcp://, or “stays up”) is polled until health_check_timeout_secs |
| Previous release / drain | previous_release was always None |
The old process is stopped with SIGTERM and a drain timeout; if the new release is unhealthy, the old one is started again |
| Release versions | Every deploy was v1.0.0 |
Unique, sortable versions (20260928-051203) or --release <name>; names are validated so they can’t escape the releases directory |
| Build stages | Clone and Test only logged | Git clone or git-aware copy; install/build/test commands with timeouts and a build log per deployment |
| Artifact store | Hashed the path string and didn’t copy directories | Hashes file contents; copies directory trees; checksum verification detects tampering |
stop / restart / rollback |
Appended events nothing acted on | Typed commands that the daemon executes, recording both the request and the outcome |
| Restart policy | Restarted once, then gave up | Exponential backoff (1 s → 30 s); crash-loop detection marks the process Failed |
| Process logs | Only in the daemon’s tracing output | Per-process log files (rotated at 10 MiB), aegis logs [-f] |
| Event ordering | Replayed by created_at text |
Explicit seq column (migrated); the projection is updated synchronously in seq order |
| Daemon restart | Apps were orphaned (SIGTERM wasn’t handled) and never restarted | SIGTERM/SIGINT stop apps cleanly; on boot, apps the operator didn’t stop are restarted; interrupted deployments are marked failed |
| Runtime trait | start/stop/health returned fake PIDs |
Reduced to runtime detection; the supervisor owns process lifecycle |
| CLI | Required the daemon even for init/doctor; list, releases and timeline showed only event counts |
Offline commands work without the daemon; the list/query commands show real data |
examples/node-app, and several seconds for slow-starting apps such as JVM services. It will be removed by the Phase 5 proxy, which also enables Rolling/BlueGreen.deployment/strategy and deployment/rollback were removed in Phase 1.ssh, state, analytics, action and github are still stubs. (metrics, auth and secrets were implemented in Phases 2–5, and docker in Phase 6.)replay, incident, investigate, inspect [--at], migrate and upgrade now work from the real event history (or GitHub releases for upgrade). They are still labelled experimental until used in production.The web control plane lives inside the existing daemon as a second listener. It keeps the single-binary, no-external-dependencies promise.
Browser (operator)
│ HTTPS :8420 (cookie session + CSRF)
▼
┌───────────────────────── aegis-daemon ─────────────────────────┐
│ │
│ ┌───────────────┐ ┌────────────────┐ ┌─────────────────┐ │
│ │ gRPC :50051 │ │ HTTP :8420 │ │ Webhook │ │
│ │ (CLI / TUI) │ │ REST + SSE + │ │ POST /hooks/* │ │
│ │ localhost │ │ embedded UI │ │ (HMAC-verified) │ │
│ └──────┬────────┘ └───────┬────────┘ └────────┬────────┘ │
│ └────────────┬───────┴─────────────────────┘ │
│ ▼ │
│ ┌──────────────────────┐ single command/query API, │
│ │ ControlPlane core │ shared by every transport │
│ └───┬──────────┬───────┘ │
│ commands │ │ queries │
│ ▼ ▼ │
│ Event Store ──► Projection Engine │
│ │ │
│ ▼ │
│ Deployment saga ─► Process Supervisor ─► cgroup v2 / systemd │
│ │ (CPU, memory) │
│ ▼ │
│ Log store + Metrics sampler │
└────────────────────────────────────────────────────────────────┘
| Decision | Choice | Why |
|---|---|---|
| HTTP server | axum inside the daemon (same Tokio runtime as tonic) |
Same ecosystem as tonic; no second process |
| Business logic | Extract a ControlPlane service used by gRPC, HTTP and webhooks |
Today, logic sits in the gRPC handler and a 200-line saga closure in main.rs; a third transport would duplicate it |
| Live updates | Server-Sent Events (SSE) for events, deploy progress, metrics and logs | One-directional, works through proxies, auto-reconnects, simpler than WebSockets |
| Frontend | A dependency-free vanilla JavaScript single-page app (core/web/ui/), embedded in the binary with include_str! and built on the same /api/v1 endpoints as the CLI (changed in Phase 3; the original plan was askama + htmx) |
Still no build step and no Node toolchain for source builds, so it stays a single binary. Talking to the JSON API directly means the dashboard can’t drift from it, live views use the existing SSE streams, and a strict content security policy (no inline code, same-origin only) is easy to keep. Node is only needed to run the Playwright browser tests. |
| Resource limits | Linux cgroups: one cgroup per supervised process, with cpu.max, memory.max/memory.high (and pids.max) on v2, or the v1 equivalents. The child joins its cgroup between fork and exec. (Changed in Phase 4: per process rather than per app, and a cgroup v1 backend instead of the systemd-run fallback.) |
Limits can be changed live, without restarting the app, which is what the sliders need. A cgroup per process means both copies of an app during a graceful switch each get the full limit, instead of sharing one and risking an OOM mid-deploy. Delegation (Delegate=yes) covers systemd hosts; running as root covers the rest, including v1-only hosts that systemd-run wouldn’t help with. |
| Metrics | sysinfo crate for the host; /proc/<pid> and cgroup cpu.stat / memory.current for each app; in-memory ring buffer plus 1-minute rollups in SQLite |
No Prometheus required. A /metrics Prometheus endpoint is optional later. |
| Config | New [web] section in aegis.toml |
See §3 |
Each phase ends in a shippable, tested state. Acceptance criteria are what CI or a manual VPS test must show.
Delivered:
build.start_command, the port, the health URL and [env] from the release’s own aegis.toml.ReleasePromoted, graceful drain, and retention pruning driven by release history.stop, start, restart and rollback are typed gRPC commands. Requests (Process*Requested, RollbackRequested) and outcomes (ProcessStopped, RollbackCompleted, …) are both recorded.seq column with migration; ordered, synchronous projection updates.ListProjects, ListReleases, ListDeployments, GetDeployment, ListProcesses, GetLogs, StreamLogs and ListEvents. These back the CLI now and will back the web API later.core/control (ControlPlane), which Phase 1 exposes over HTTP.Evidence:
scripts/e2e-smoke.sh, run in CI, drives the real binaries through the same scenarios with examples/node-app.Delivered:
core/web (aegis-web): an axum HTTP/JSON API served by the daemon next to gRPC. It is enabled with [web] enabled = true and is loopback-only: the daemon refuses any other bind until Phase 2 adds authentication. Every handler calls ControlPlane, so gRPC and HTTP share one implementation.Host check blocks DNS rebinding; an Origin/Sec-Fetch-Site check blocks cross-site requests; and state-changing requests require JSON, which forces a CORS preflight that is never granted.utoipa, served at /api/v1/openapi.json, and checked in as docs/openapi.json. A test fails if the two drift apart.ConfigureSchedule command (gRPC, HTTP and CLI) replaces raw event emission; schedules are visible on projects; aegis status shows the API URL.rollback could pick the wrong release, and retention could delete the release that had just been live. Both now use ReleasePromoted order, with a regression test.deployment/strategy and deployment/rollback crates were removed; the daemon now warns when the (also unauthenticated) gRPC API is bound to a non-loopback address.Evidence: 7 HTTP API tests (guard rules, validation and errors, a full deploy → restart → stop/start → logs → rollback lifecycle against a real app, SSE filtering, shutdown ending streams, log follow) and new HTTP steps in scripts/e2e-smoke.sh (run in CI).
Delivered (details in security.md):
core/auth): an admin account created on first start, with the password written once to a 0600 file and deleted after it is changed. Passwords are Argon2id-hashed. aegis-daemon admin reset-password / create-token work locally through database file access.HttpOnly, SameSite=Strict, and Secure over HTTPS. Sessions have idle and absolute expiry; a CSRF token is required on every change; a password change ends all sessions.X-Forwarded-For entry is trusted.read or deploy scope, hashed at rest, revocable. Tokens can never manage tokens, passwords or webhook secrets./api/v1 route returns 401 without credentials except sign-in; a test enumerates all routes. /healthz is the only other public route.actor (user:…, token:…, webhook:github, cli). Sign-ins, failed sign-ins (never the password), sign-outs, password and token changes are recorded.behind_proxy turns on Secure cookies and HSTS.aegis-daemon check-config) refuses a public API without TLS, public access without allowed_hosts, half-configured TLS, and gRPC on a non-loopback address. A config file that doesn’t parse is now an error instead of being silently replaced by defaults. CI checks these refusals against the real binary.default-src 'none', X-Frame-Options: DENY, nosniff, no-referrer, no-store, and HSTS over HTTPS.POST /hooks/github/{project} with HMAC-SHA256 (checked against GitHub’s published test vector), per-project rotatable secrets, redelivery de-duplication, and push-to-branch → deploy of the pushed commit from the project’s configured repository.install.sh --server [--domain …] creates an aegis system user, /etc/aegis/aegis.toml (0640), /var/lib/aegis (0750, database 0600), and a hardened systemd unit (ProtectSystem=strict, NoNewPrivileges, Delegate=yes, ExecStartPre=check-config, KillMode=mixed). It verifies cleanly with systemd-analyze and was exercised as a real install in a container.Independent security review. It found no authentication bypass, and it checked routing and path normalisation, CSRF, sessions, timing, webhook HMAC and config validation. It reported nine lower-severity issues, all fixed in this phase:
--, --branch=, and rejecting -… and ext:: URLs. Credentials in URLs are redacted from build logs.--domain newline bypass.0600 before SQLite opens it.X-Forwarded-For requirement, and the fact that a deploy token is admin-equivalent.Deliberately not included in Phase 2: built-in ACME. (Added in Phase 5 with the built-in proxy; Caddy or certbot with [web.tls] still work.) Multiple users and roles remain Phase 6.
Evidence: 12 security tests in core/web/tests/auth.rs (route-by-route 401, cookie flags and CSRF, throttling, scopes, password change, streams closing on revocation, Host allowlist, signed webhooks deploying a real commit and ignoring replays, HTTPS over HTTP/1.1 and HTTP/2 with certificate renewal), 7 in core/auth (including 50 parallel sign-in attempts → exactly 5 allowed), config refusal tests, an independent security review of the diff, and new end-to-end steps (authentication, read-only token, unsafe-config refusals) in scripts/e2e-smoke.sh.
Delivered: the daemon serves the dashboard at / when [web] enabled = true. It is a vanilla-JS SPA with no build step (see “Frontend” in the decisions table), with these additions to the API:
GET /host: CPU, memory, swap, disk and load, sampled every 5 s.POST /detect: runtime detection for a server directory or a git URL (shallow clone into scratch space).PUT /projects/{p}/settings: dashboard overrides for install/build/test/start commands, port and health URL. They are stored as a ProjectSettingsUpdated event and merged into each new release’s aegis.toml, so rollbacks keep the settings a release was built with.GET /deployments/{id}/log and GET /deployments/{id}/events: the build log and the stage events of one deployment.Playwright tests (ui-tests/, run in CI) drive a real daemon through the scenario below, on desktop and on a phone-sized screen. Every test also fails on any CSP violation or uncaught script error.
Planned scope (all delivered):
DetectorPipeline) → edit build/start commands, port and health path → save.UX: responsive (usable on a phone for incident response), light and dark themes, keyboard shortcuts, and confirmation dialogs for destructive actions.
Done when: everything in the Phase 0 “done” scenario can be done from the browser without SSH, with Playwright end-to-end tests in CI.
Delivered:
runtime/resources (new): detects cgroup v2 (delegated under systemd, or as root) or v1 (as root), else “none” with a reason. It creates a cgroup per process and writes limits to all of an app’s live cgroups at once. It reads usage, throttling, OOM-kill and memory-event counters, and removes cgroups when processes end.exec, so everything it forks is limited. The parent re-checks placement and logs any failure in the app’s log.runtime/metrics:
/proc sampling for threads, open files, and CPU/RSS where no cgroup exists.metrics_rollup) with configurable retention and hourly pruning.set_resource_limits validates ranges and asks for confirmation when a limit is below current use or would over-commit memory. It applies limits without a restart, restores them on every start, and records ResourceLimitsChanged.ResourcePressureDetected: OOM kill, sustained throttling, memory near its limit, and low disk.GET /resources, GET|PUT /projects/{p}/resources, GET /projects/{p}/metrics, GET /host/metrics, and the SSE stream /metrics/stream.[notifications] slack_webhook_url posts deploy outcomes, crash loops and resource alerts. The plugin was previously a logging stub./sys/fs/cgroup writable (ReadWritePaths) despite ProtectKernelTunables.The “done when” scenario is tested end to end in the browser (ui-tests/tests/resources.spec.js), against the real kernel:
CI runs the kernel and HTTP tests on cgroup v2 both delegated (a transient systemd service with Delegate=yes, unprivileged) and as root, and the browser suite as root, with AEGIS_REQUIRE_CGROUPS=1 so that none of them can skip. Until then they skipped silently in CI: under sudo the tests inherited the runner service’s INVOCATION_ID, took that service’s cgroup for a delegated one, and found no controllers there. Detection now refuses a service cgroup that holds other processes and falls back to /sys/fs/cgroup/aegis as root. Locally they also passed on a cgroup v1 host.
Not done, deferred:
io.max.Original plan:
This is the “drag CPU and memory” feature.
runtime/metrics: sample every 2 s from /proc and the cgroup files: CPU %, RSS/memory, threads, open file descriptors, network I/O, restarts, and OOM kills. Keep 1 h at full resolution in memory and 1-minute rollups for 7 days in SQLite (retention is configurable).aegis.slice/<project>.scope (cgroup v2, delegated). Limits:
cpu.max: CPU quota, shown as a CPU slider from 0.1 to the number of host cores.memory.max: hard limit, shown as a memory slider, with memory.high as a soft limit set to 90% of it.pids.max and io.max.PUT /api/v1/projects/{id}/resources → validation (reject a limit below current usage without a confirmation, and reject over-commit beyond host capacity unless forced) → write to the cgroup → ResourceLimitsChanged event. No restart needed. Limits are re-applied on every restart and deploy.memory.events high/oom), crash loops, and disk space, shown in the UI and sent through the existing plugin system (Slack).systemd-run --scope with systemctl set-property. If neither is available (macOS/dev), show metrics and disable the sliders with a clear explanation.Done when: on a VPS, dragging the memory slider on a running app changes memory.max within 1 s without a restart; a test app that exceeds it gets OOM-killed, restarted by the supervisor, and the event shows in the UI; the CPU limit visibly caps a busy-loop app’s CPU % on the chart.
core/secrets seals values with ChaCha20-Poly1305 under a key in <data_dir>/secrets.key (0600, outside the database), bound to their project and name. Secrets are write-only in the API and UI, injected when the process starts (never written to a release or an event), and a restart picks up changes; the UI offers it. Plain variables are dashboard settings, merged over [env] and written into each release.runtime/ingress (aegis-ingress): a hyper reverse proxy embedded in the daemon, enabled with [proxy]. It routes by Host to each app’s live process, with a 404 page for unknown hosts and 502 when the app is down. It sets X-Forwarded-For/-Proto/-Host and strips hop-by-hop headers. Upgrades (WebSocket) pass through, bodies stream, and it has connect, header and response timeouts.instant-acme; the challenge is answered on port 80) or from PEM files that are reloaded when they change. ACME certificates are stored in data_dir/certs (keys 0600) and renewed in the background when fewer than 30 days remain. Once a domain has a certificate, HTTP redirects to HTTPS. Optionally the dashboard can be served on its own domain ([proxy.dashboard]).DomainMapped/DomainUnmapped (validated RFC 1123 names, unique across apps) in the projection. API: GET/POST /projects/{p}/domains, DELETE /projects/{p}/domains/{d} (users only; tokens are refused) and GET /proxy. A Domains card in the app’s Settings tab shows the certificate state.PORT), and the health check is pointed at it. The new release starts next to the old one. Once it is healthy, the proxy’s upstream flips in one step; the old process finishes its in-flight requests and is then stopped. An unhealthy release never receives traffic. Ports are recorded in ProcessStarted/ReleasePromoted, so routes come back after a daemon restart.Rolling/BlueGreen (they need several instances per app), wildcard domains (DNS-01) and TLS-ALPN-01. ACME issuance against a real CA is untested in CI (no public domain); the challenge handler and renewal logic are unit-tested.ScheduleConfigured and restored from the event log when the daemon starts.WebhookReceived), and a “Send test delivery” button that pushes a signed ping through the real endpoint. Secrets are shown once, on rotation.aegis.toml the next release will get (POST /projects/{p}/settings/preview); “View aegis.toml” shows and copies the whole file so it can be committed back to the repository. Aegis never writes to the repository itself.viewer (read), deployer (also deploy, roll back, start/stop/restart) and admin (everything). Enforced per request by the server (required_role in core/web/src/auth.rs); role changes apply to open sessions at once; there is always at least one admin. Users are managed under Account → Users, through /api/v1/users, or with aegis-daemon admin create-user|set-role|list-users. Events: UserCreated, UserRoleChanged, UserDeleted.aegis.db and releases from the UI; scheduled backups. Done: one .tar.gz per backup (a VACUUM INTO snapshot of the database, secrets.key, certificates and, optionally, releases, with a SHA-256 manifest), created from the dashboard (Account → Backups), the API (/api/v1/backups, signed-in users only), aegis-daemon admin backup or on a [backup] schedule, with retention. Restores are offline by design (aegis-daemon admin restore, refused while the daemon holds <data_dir>/aegis.lock); the dashboard shows the command. See disaster_recovery.md.aegis upgrade). The daemon checks GitHub’s latest stable release every 12 h ([update] check, off = no requests) and shows everyone a banner; admins get “Upgrade now”: backup, download, SHA-256 check against the release’s SHA256SUMS, --version check, atomic swap keeping aegis-daemon.previous, then a restart (exit 75 under systemd, re-exec otherwise); the dashboard reconnects and shows “Updated to vX”. On install.sh --server hosts a root-owned aegis-update.path/.service helper does the install from a version-only request; otherwise admins are shown the aegis-daemon self-update command. Never downgrades or crosses a major version from the dashboard. Release builds now report the tag’s version (AEGIS_VERSION). Shared code lives in core/update (also used by aegis upgrade). Events: UpdateAvailable, UpdateStarted, UpdateApplied, UpdateFailed. See upgrading.md. Not yet tested end to end: the systemd restart and the root helper on a real server. Releases are signed with minisign (SHA256SUMS.minisig, key in core/update/keys/release.pub) and every installer verifies the signature; the maintainers still have to generate the key (see releasing.md).ratatui TUI. aegis-tui talks to the daemon over the local gRPC API, like the CLI (the web UI’s REST API exposes the same control-plane queries). Screens: an apps table (status, live release, uptime, restarts, CPU/memory, PID), an app view (releases, recent deployments, live log tail with follow/pause/scroll/filter), a live event stream with a type filter, and a help overlay. Start/stop/restart, deploy and rollback (to the previous or a selected release) ask for confirmation first. It reconnects with backoff and shows a “disconnected” banner instead of exiting. ProjectInfo gained an optional usage field (CPU/memory sample) for the CPU and memory columns; older daemons leave it unset. Evidence: reducer, filter and worker unit tests, plus TestBackend render tests, in ui/tui. Two opt-in --ignored tests run the gRPC worker against a real daemon (including a reconnect after a restart). They are not in CI, and nothing tests the interactive terminal end to end..github/workflows/perf.yml). Benchmarks (event store append and replay, projection rebuild, request overhead of the built-in proxy versus direct, wall time of whole deploys and rollbacks of a tiny app) run on every PR and push to main and are compared with the latest main run; a regression beyond 30% is flagged in the job summary and as a warning but doesn’t fail the build (a repository variable makes it blocking). scripts/soak.sh runs the release daemon with an app on a proxy domain under steady load while it deploys, rolls back, restarts the app, changes resource limits and restarts the daemon, and fails on failed requests during deploys, failed operations, crashes, leak-like RSS/fd growth or ERROR log lines: 5 minutes on every push to main (and PRs labelled soak), 60 minutes nightly. Numbers come from shared GitHub runners, so they show trends, not capacity; no soak longer than an hour has run. The first 15-minute soak found an fd leak (the daemon keeps every finished app process’s log file open), which the nightly soak will report until it is fixed. See benchmarks.md.integrations/docker, guide). An app opts in with [run] runtime = "docker" and a dockerfile (built from the release directory) or a prebuilt image. The image is tagged aegis/<project>:<release>, and rollbacks reuse it without a rebuild. Containers run under the existing supervisor through a small Launcher abstraction: each start creates a fresh container and the supervisor runs docker start --attach. Restart policy, backoff, crash loops, logs, health checks, the graceful switch, proxy cutover and rollback therefore work unchanged. The environment and secrets reach the container through a 0600 env file deleted right after docker create. Ports are published on 127.0.0.1 only. [run] accepts only an allowlist of options (no privileged mode, host network, capabilities or bind mounts; named volumes are scoped to the app). The CPU/memory/process sliders map to --cpus/--memory/--memory-swap/--pids-limit at start and to docker update live, and metrics come from the container’s cgroup. The PID shown is the container’s main process. Containers are removed when they stop, and release images are removed with their releases. On daemon restart, containers are recreated rather than re-adopted. aegis doctor, the deploy’s Build stage and GET /api/v1/resources report “not installed”, “daemon not running” and “no permission” clearly. Evidence: unit tests (config validation, argument building, secrets never in argv, limit mapping) and an end-to-end test against the real Docker daemon on CI. It uses the Docker CLI, not the Engine API, and the dashboard settings form does not edit [run].[run] instances = N (1-16, or Instances in the dashboard settings) runs N supervised processes of the live release, each with its own PORT, log file, restart policy and cgroup (resource limits apply per instance). The built-in proxy spreads requests over them round robin and skips an instance that refuses connections (bodyless requests are retried on another one). Rolling replaces instances rolling_batch at a time (start, health-check, add to the proxy, drain and stop an old one) and restores the old set when a new instance fails; BlueGreen switches the whole set at once and keeps the old set running for blue_green_keep_secs, so a rollback in that window is an instant switch back. Both need a domain on the built-in proxy and are refused with a clear message otherwise; GracefulSwitch stays the default. Restarts of multi-instance apps are rolling; a daemon restart brings back the recorded number of instances. New events: RolloutStepCompleted, RolloutAborted, TrafficSwitched, StandbyKept, StandbyStopped, InstanceSetChanged. The API, gRPC (ProjectInfo.instances), CLI (aegis list), TUI and dashboard (instance list, strategy choice, rollout steps in the deployment timeline) show instances. Evidence: planning and balancing unit tests, and core/control/tests/strategies.rs (3 instances: Rolling and BlueGreen under a client loop with no failed request, a mid-rollout failure restoring the old set, an instant BlueGreen rollback, a rollout interrupted by a daemon stop, rolling restart, daemon restart). See configuration.ControlPlane API, and the dashboard gets a server selector.[daemon]
host = "127.0.0.1"
port = 50051 # gRPC, localhost only (CLI/TUI)
[web]
enabled = true
host = "127.0.0.1" # "0.0.0.0" requires tls or behind_proxy
port = 8420
behind_proxy = false # trust X-Forwarded-* from 127.0.0.1 only
session_ttl_minutes = 720
[web.tls]
mode = "acme" # "off" | "files" | "acme"
domain = "aegis.example.com"
email = "ops@example.com"
# cert_path / key_path when mode = "files"
[resources.defaults] # applied to new apps; per-app overrides in the UI
cpu_cores = 1.0
memory_mb = 512
ProcessStopRequested, ProcessRestartRequested, RollbackRequested, ResourceLimitsChanged, ResourcePressureDetected, UserLoggedIn, UserLoginFailed, ApiTokenCreated, ApiTokenRevoked, SecretUpdated (the value is never stored in the event), DomainMapped / DomainUnmapped (done). Every event triggered from the web gains an actor field. Add each to docs/event_catalog.md when it is implemented.
| Risk | Mitigation |
|---|---|
| A public dashboard becomes a remote-code-execution vector | Phase 2 is a hard gate before any public bind; safe defaults; the daemon refuses unsafe configurations |
| cgroup v2 delegation varies by distro and VPS provider | Detect at startup and show capability status in the UI; systemd fallback; test matrix of Ubuntu 22.04/24.04 and Debian 12 |
| Daemon restart kills managed apps | Run apps in their own cgroup scopes so they survive a daemon restart; re-adopt them by PID and cgroup on boot |
| Metrics storage growth in SQLite | Rollups plus retention pruning; metrics in a separate table/DB file from events |
| Scope creep | Phases 0 → 3 are the MVP; Phases 4+ ship incrementally behind the MVP |
| Milestone | Phases | Outcome |
|---|---|---|
| M-Core ✅ | 0 | Deploy/stop/restart/rollback do real work |
| M-API ✅ | 1 + 2 | Secure HTTP API reachable on the VPS |
| v0.5.0 — Web MVP ✅ | 3 | Manage all apps from the browser |
| v0.6.0 — Resource Control ✅ | 4 | Live CPU/memory monitoring and slider limits |
| v0.7.0 — Self-serve Ops ✅ | 5 | Env/secrets, domains + TLS, webhooks, schedules in the UI |