Deploy forge-server (crates/forge-server) on your own infrastructure with SQLite or PostgreSQL 16 to centralize multi-repository health rollups, cross-repo vulnerability matrices, branch trend retention, HMAC-SHA256 webhooks, and append-only RBAC audit logs.
1. Server Architecture, RBAC Roles & Authentication Modes
Built on Rust, Axum, and SQLx with zero-panic guarantees and non-root container isolation (UID 10001 forge:forge), forge-server maintains $O(1)$ materialized organization rollups (organization_rollups) updated automatically whenever a repository pushes a snapshot.
Enterprise RBAC Privilege Tiers
• Viewer: Read project health, findings, and rollups (
can_read_findings)• Auditor: Viewer + query append-only
/api/v1/audit-events (can_read_audit)• Maintainer: Push snapshots & link projects (
can_write_snapshots)• Admin: Full org, webhook, and API key management (
can_manage_orgs)3 Supported Authentication Modes
• JWT / Bearer API Keys: Issued via
/api/v1/auth/token or EFORGE_ADMIN_API_KEY• Enterprise JWKS OIDC: External IdP verification via
EFORGE_JWKS_URL• Identity-Aware Reverse Proxy:
X-Forwarded-User, X-Forwarded-Role, X-Forwarded-Email (gated by EFORGE_TRUST_PROXY_HEADERS=true)2. Production Deployment Guides
Option A — Standalone Docker (Embedded SQLite)
1–15 Contributors • < 30 MB Alpine Imagemkdir -p /opt/eforge/data
docker run -d \
--name forge-server \
--restart unless-stopped \
-p 8080:8080 \
-v /opt/eforge/data:/var/lib/eforge \
-e EFORGE_SERVER_HOST="0.0.0.0" \
-e EFORGE_SERVER_PORT="8080" \
-e EFORGE_DATABASE_URL="sqlite:///var/lib/eforge/forge.db?mode=rwc" \
-e EFORGE_JWT_SECRET="replace-with-at-least-32-char-random-secret" \
-e EFORGE_ADMIN_API_KEY="ef_admin_bootstrap_secret_key" \
elcode/forge-server:v1.0.0
curl -sS http://localhost:8080/api/v1/healthOption B — Production Docker Compose (PostgreSQL 16 + MinIO + Dashboard)
docker-compose.ymlcp .env.example .env
# Edit .env to configure POSTGRES_PASSWORD, EFORGE_JWT_SECRET, and EFORGE_ADMIN_API_KEY
docker compose up -d
docker compose ps
# Dashboard: http://localhost:3000 | API: http://localhost:8080 | MinIO: http://localhost:9001Option C — Cloud-Native Kubernetes Cluster (Kustomize)
deploy/k8s/kubectl apply -k deploy/k8s/
kubectl rollout status deployment/forge-server -n forge
kubectl get pods,svc,ingress -n forge3. forge-server Environment Variables (ServerConfig::from_env)
| Environment Variable | Default | Description |
|---|---|---|
| EFORGE_SERVER_HOST | 127.0.0.1 | Bind address host (use 0.0.0.0 inside Docker/Kubernetes containers). |
| EFORGE_SERVER_PORT | 8080 | TCP port for the Axum HTTP API server. |
| EFORGE_DATABASE_URL | sqlite://forge.db?mode=rwc | SQLite (sqlite://...) or PostgreSQL 16 (postgres://user:pass@host:5432/db) connection URL (also reads fallback DATABASE_URL). |
| EFORGE_JWT_SECRET | (Dev secret) | 32+ character HMAC secret used to sign and verify issued JWT bearer tokens. |
| EFORGE_ADMIN_API_KEY | None | Optional bootstrap Admin API key provisioned automatically on server startup. |
| EFORGE_JWT_EXPIRATION_SECS | 604800 (7d) | Expiration lifetime in seconds for issued JWT access tokens. |
| EFORGE_TRUST_PROXY_HEADERS | false | When true or 1, accepts X-Forwarded-User, X-Forwarded-Role, and X-Forwarded-Email from an authenticated reverse proxy. Rejected with 401 when false. |
| EFORGE_JWKS_URL | None | Optional OIDC JWKS endpoint URL for validating external identity provider JWTs. |
4. CLI Team Sync Workflow
# 1. Authenticate & store credentials in ~/.eforge/credentials.yaml
eforge login --server http://localhost:8080 --token "$EFORGE_ADMIN_API_KEY"
eforge auth status
# 2. Push snapshot or pull remote baseline (.eforge/baseline.json)
eforge push --branch main
eforge pull --branch main
# 3. Compare local working tree against remote baseline
eforge diff --remote
# 4. Run full CI sync pipeline (pull -> delta -> push -> gate)
eforge sync --branch main --fail-on high5. Core REST API & Webhooks
- •
GET /api/v1/health— Liveness & DB backend probe - •
POST /api/v1/sync/push&GET /api/v1/sync/pull— Content-addressed BLAKE3 snapshot sync - •
GET /api/v1/projects&/api/v1/projects/:id/overview|branches|history - •
POST /api/v1/orgs&GET /api/v1/orgs/:id/summary|vulnerabilities - •
POST /api/v1/webhooks— Slack, Discord & HTTP webhooks signed withX-Forge-Signature: sha256=<hex> - •
GET /api/v1/audit-events— Append-only RBAC audit log stream