Operations & deploy
Production operational guide for running arks serve behind a TLS reverse proxy, monitoring health and metrics, reloading configuration without downtime, and backing up repositories.
Responsibility boundary
| Layer | Owner |
|---|---|
Git Smart HTTP, SSH, LFS, SSR Web UI, REST API, PBKDF2/2FA/RBAC, audit logs, /healthz, /metrics |
arks serve (single binary) |
| Firewall rules, DNS, external TLS certificates (ACME), reverse-proxy routing, off-host backup retention | Operator infrastructure |
Prefer normative ports (22 / 80 / 443 / 9418) in production; 2222 / 8080 are demo defaults. See Ports.
Shipped deploy/ templates
The repository includes ready-to-adapt operational templates under deploy/:
| File | Purpose |
|---|---|
Dockerfile |
Multi-stage source container build for arks serve |
deploy/Dockerfile.release |
Prebuilt multi-arch runtime container image (ubuntu:24.04, non-root arks user) |
deploy/docker-compose.yml |
Containerized arks serve --root stack with persistent volume |
deploy/Caddyfile |
Automatic HTTPS reverse proxy with HSTS and base_path support |
deploy/nginx.conf |
nginx reverse proxy with streaming Git/LFS body handling |
deploy/systemd/arks-serve.service |
Hardened Linux systemd unit with graceful shutdown |
deploy/backup-restore.sh |
Consistent repository and forge metadata backup/restore script |
Prebuilt multi-arch server images (linux/amd64, linux/arm64, non-root arks user, build-provenance attested) publish directly to GHCR on v* releases:
docker pull ghcr.io/modootoday/arks:latest
Health checks and Prometheus metrics
# Liveness probe:
curl -fsS http://127.0.0.1:8080/healthz
# Prometheus scrape endpoint:
curl -fsS http://127.0.0.1:8080/metrics
Configure Prometheus to scrape /metrics on your internal interface only, and route /healthz to your load balancer or systemd watchdog.
Zero-downtime configuration reload
arks serve supports dual-bind overlap across HTTP, SSH, and forge modules when reloading configuration managed by arks serve config:
# Inspect or update server configuration:
arks serve config show
# Trigger zero-downtime reload on Unix (SIGHUP):
kill -HUP "$(pidof arks)"
On Windows (where SIGHUP is unavailable), arks serve monitors the config file modification time and rebinds automatically (verified in Windows CI).
Graceful shutdown, soak verification, and SBOM
- Sends clean shutdown draining active connections on
SIGTERM/SIGINT. - Protects memory and concurrency with pre-spawn connection capping (
503 Service Unavailable+Retry-After: 1), bounded HTTP/1.1 Keep-Alive (up to 64 requests/connection, 5s idle read timeout), request & gzip decompression body caps (413 Payload Too Large), and login rate limits (429). - Accelerates concurrent reads with an
(mtime, len)-validated in-memoryRwLockcache holding sharedArc<ForgeStore>snapshots (zero deep-clone on reads, lock-freeGETREST/Web UI dispatch, direct JSON streaming,TCP_NODELAY, and single-buffer HTTP response writes; verified under 256 concurrent reads + 16 interleaved writes and 5-minute mixed endurance soak with0.0 kBRSS growth andp95: 1.52ms → 1.18ms; Round 1 receipt · final stress receipt). - Control self-hosted registration and audit retention via
ARKS_DISABLE_REGISTRATION=1,ARKS_DEFAULT_REGISTER_ROLE, andARKS_AUDIT_MAX_ENTRIES. - Crash-safe atomic persistence: All 68 Web UI write paths (
ForgeStoreTx, 60-thread stress) plusarks-lease, loose objects, LFS uploads, credentials wallet, andauthorized_keysuse unique sibling atomic write-and-rename transactions (verified under 32-threadarks-lease/arks-objectand 16-thread LFS contention; atomic store receipt · Round 2 receipt). - All-in-one soak, Keep-Alive soak, CVE-zero & SBOM: Clean-room Docker verification exercises
arks servewith TLS, SSH, Web UI, and Git LFS under a 128-request all-in-one soak (fd_delta: 0, soak receipt) and a 256-request HTTP/1.1 Keep-Alive soak (fd_delta: 0, Round 2 receipt), backed by nightly clean-room regression,0/135OSV.dev CVE scanning, and CycloneDX SBOM generation (.github/workflows/nightly-cleanroom.yml). - Overload, 10k-monorepo, endurance soak & chaos hardening (6/6 PASS · 0 open findings): Cgroup-capped Docker runs (
--cpus=1.5,--memory=512m) verified 5× concurrency backpressure (1,090/1,090503 Retry-After: 1, atomic pre-spawn cap,fd_delta=0), Slowloris cumulative header-timeout eviction (ARKS_HTTP_HEADER_TIMEOUT_SECS, default10s, 48/48 HTTP408), a 340-client mixed Forge/Push/LFS/SSH storm (0lost updates), 10,002-file monorepo cap (63.1 MiBpeak RSS,diff --stat0.91×Git),SIGKILL×3 crash persistence (86/86,orphan_tmps=0),ENOSPCsafe fail-closed,RLIMIT_NOFILE=128transientEMFILEbackoff survival, 10 liveSIGHUPreloads (5,623/5,623HTTP 200), and a 5-minute sustained mixed soak (46,898/46,898 HTTP 200,1,308Forge writes,0lost updates,0.0 kBRSS growth,fd_delta=0). Full receipts and charts: Stress & resilience (final receipt).
Next
Stress & resilience Self-host Ports Forge security & auth REST API reference