Commit Graph
7 Commits
Author SHA1 Message Date
dasemuandClaude Sonnet 5.5 4b3c8f213a feat: add a panel button to update the manager itself
The manager clones SELF_UPDATE_REPO_URL, builds a new image in the shared build queue and
hands over to a short-lived updater container (new image) that swaps the manager container,
health-checks it and rolls back on failure. Exposed as GET/POST /api/system behind requireAuth;
installation changes answer 409 while an update runs. Session cookie is now SameSite=Lax.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 05:45:25 +02:00
dasemuandClaude Sonnet 5.5 5fb1d6b0b4 fix: address review findings on the memory safeguards
- kill the whole process group on git/nixpacks timeout so a hung docker build
  cannot block the build queue
- mark interrupted cloning/building/starting installations as error on boot
- keep a running installation served while it rebuilds, including failed builds
- time out Docker image calls inside the build queue
- make session touch best-effort

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 05:31:08 +02:00
dasemuandClaude Sonnet 5.5 eb24e21df7 fix: bound memory and sockets in the manager to prevent host-wide OOM
- proxy: inactivity timeouts and a cap on concurrent requests (503 beyond it)
- docker: cache/coalesce container IP lookups and time out inspect calls
- sessions: SQLite-backed store instead of the leaking MemoryStore
- memory guard: exit when heap+external passes MANAGER_MEMORY_LIMIT_MB so the
  restart policy replaces the process before the host swaps
- builds: serialize them and time out hung git/nixpacks processes
- redeploy with rebuild no longer deploys the old image after a failed build
- /health reports memory and in-flight proxy requests; handle SIGTERM

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 05:23:18 +02:00
dasemuandClaude Sonnet 5 8eaccfbc47 fix: scope express.json() to /api so the MCP proxy stops hanging
A global body parser drained every incoming request body, including
on the /mcp/:slug proxy route, before http-proxy could forward it —
every proxied POST reached the backend with zero body bytes and hung
forever. This broke the proxy for every real MCP call, caught only
once a container was actually tested through it end-to-end.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-08 04:43:49 +02:00
dasemuandClaude Sonnet 5 359d4369e8 fix: session cookie secure flag was never true-to-request
cookie.secure was tied to NODE_ENV=production instead of whether the
request actually arrived over HTTPS, so in a production build the
admin login cookie was never stored at all when accessed over plain
HTTP (e.g. direct container access, or a proxy that doesn't terminate
TLS in front of the admin panel) — confirmed while deploying to
production, login returned 200 but no session persisted. "auto" uses
req.secure via the existing trust-proxy setting instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-08 04:25:06 +02:00
dasemuandClaude Sonnet 5 b8f5d8253f feat: SQLite-backed installations, REST API, admin auth and web UI
Replaces the slice-2 hardcoded installation with a full install/deploy
pipeline:

- SQLite persistence (better-sqlite3) with a single `installations`
  table and a draft -> cloning -> building -> built -> starting ->
  running/error/stopped state machine; env vars and bearer tokens are
  encrypted at rest (AES-256-GCM, key derived from MASTER_KEY).
- Build/run orchestration: git clone (+ .env.example key detection),
  `nixpacks build` as a logged subprocess, dockerode container
  run/stop with forced host/port env vars and a TCP-connect health
  check before flipping an installation to "running".
- REST API (installations CRUD, build/deploy/redeploy, logs, token
  regeneration) behind single-operator session-cookie auth with a
  basic login lockout.
- Vite+React admin SPA: login, installation list, install wizard, and
  a detail page to configure env vars, trigger build/deploy/redeploy,
  view the build log, and copy the authenticated /mcp/<slug> URL.
- Dockerfile (multi-stage, pulls in nixpacks + the Docker CLI) and
  docker-compose.yml for production deployment.

Validated end-to-end against a real cloned repo: draft creation with
env-key detection, build, the error path on a failed health check, and
delete, all through the live API.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-08 01:42:06 +02:00
dasemuandClaude Sonnet 5 309e6aedc3 feat: scaffold manager server with docker lifecycle and bearer-auth proxy
Lays the groundwork for remote-mcp-manager: an Express server that
runs installed MCP containers via dockerode (forcing host/port env
vars, no published ports, shared bridge network) and reverse-proxies
/mcp/:slug requests behind a per-installation Bearer token, resolving
the upstream target by inspecting the container's network IP rather
than relying on container-name DNS.

Validated end-to-end against a real cloned MCP repo (nixpacks build +
container run + authenticated proxy roundtrip); installations are
still a hardcoded in-memory list, replaced by SQLite in the next slice.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-08 01:15:41 +02:00