@lifeaitools/regen-deploy-mgr
v0.1.8
Published
Standalone deployment operations manager (PM2 + Coolify) for the LIFEAI fleet. Separate from clauth on purpose: clauth is a pure credential vault; PM2 is AGPL-3.0 and must never be a direct dependency of a distributed vault package. This app fetches its b
Readme
regen-deploy-mgr
Standalone PM2 + Coolify deployment-operations manager for the LIFEAI fleet.
Why this exists
clauth is a credential vault and must stay distributable. PM2 is
AGPL-3.0 — a direct pm2 dependency inside a published, distributable
package makes the whole package non-distributable under AGPL's copyleft
terms. This app owns ALL deployment orchestration (PM2 and Coolify —
clauth shouldn't be dual-purpose) and fetches its bearer token from a
local clauth daemon at call time instead of holding any credential
itself. It runs unchanged on Vultr (Linux) and a local Windows box — pm2
itself is genuinely cross-platform.
Full background and decision record: RESTART.md.
What it does
- Bearer-authenticated HTTP API (two roles:
adminviavultr-ops-admin-token,agentviavultr-ops-api-token) over the local PM2 daemon: list/describe/start/stop/restart/reload/delete/scale/reset, plus every rawpm2_*method. - Coolify read-only status (
GET /v1/ops/coolify/:uuid) and promote-and-wait (POST /v1/ops/promotions— trigger, poll to terminal, verify HTTP 200 +Cache-Control: no-cachein one call). - Git-fetch-and-reload dev deploys (
POST /v1/ops/deployments). - Every mutating PM2/Coolify action returns a job id; poll
GET /v1/ops/jobs/:idto a terminal phase (succeeded/failed/rejected) — deterministic, scriptable, no free-form error text.
Run it
npm install
pm2 start ecosystem.config.cjs # or: node src/server.jsConfig is env-var driven (see ecosystem.config.cjs). Nothing here holds a
credential — CLAUTH_LOCAL_URL (default http://127.0.0.1:52437) points at
the local clauth daemon, and every request fetches its bearer token fresh.
Registry
Registered as regen-deploy-mgr in the fleet's apps / app_deployments
tables — SELECT get_deployment('regen-deploy-mgr').
Status
See RESTART.md for exactly what's proven working, what's
untested, and what's still to build (CLI, MCP server, test suite, Vultr
deploy).
