Configuration
Piping's backend reads configuration from three layers, later layers winning:
config/default.toml— required defaults, relative to the process working directoryconfig/local.toml— optional local overrides, relative to that same directoryPIPING_*environment variables — the primary production mechanism
Source files live under apps/api/config/. For nested TOML keys, use __ in the environment variable name: database.url becomes PIPING_DATABASE__URL, auth.local_enabled becomes PIPING_AUTH__LOCAL_ENABLED.
The canonical Compose stack maps deployment variables from .env (POSTGRES_PASSWORD, PIPING_AUTH_LOCAL_ADMIN_PASSWORD, PIPING_AUTH_PASSWORD_PEPPER, …) onto nested backend keys — see Deployment. Proxy-node credentials are configured separately; see Proxy nodes.
Keep deployment secrets out of version control.
Run mode
| Variable | Default | Description |
|---|---|---|
PIPING_RUN_MODE | backend | backend — full API runtime. proxy — edge proxy only, no database required; see Proxy nodes. |
Database
| Variable | Default | Description |
|---|---|---|
PIPING_DATABASE__URL | — | PostgreSQL connection DSN. Format: postgresql://user:password@host:5432/dbname. The bundled Compose stacks derive it automatically from POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB. |
PIPING_DATABASE__MAX_CONNECTIONS | 10 | Maximum pool size. Increase for high-concurrency deployments. |
Migrations run automatically on backend startup. They are forward-only — always back up before upgrading.
Authentication
| Variable | Default | Description |
|---|---|---|
PIPING_AUTH__LOCAL_ENABLED | true | Local username/password login. Can be disabled once OIDC SSO is the only entry point. |
PIPING_AUTH__PASSWORD_PEPPER | — | Required in production. Random bytes combined with passwords before hashing. Generate with openssl rand -hex 32. Generate once; never change. |
PIPING_AUTH__LOCAL_ADMIN_PASSWORD | — | Required strong production bootstrap password when local auth is enabled. Compose maps PIPING_AUTH_LOCAL_ADMIN_PASSWORD from the protected installation .env. Startup reapplies it to admin; do not log its value. |
PIPING_AUTH__PASSWORD_MIN_LENGTH | 8 | Minimum password length for local accounts. |
PIPING_AUTH__COOKIE_SECURE | false | Set true when serving over HTTPS (the production Compose file does). |
PIPING_AUTH__SESSION_TTL_SECONDS | 86400 | Session lifetime in seconds. Default is 24 hours. |
PIPING_AUTH__COOKIE_DOMAIN | — | Set to your domain if you need cross-subdomain cookie sharing. |
OIDC (SSO)
OIDC is configured at runtime under Access Control → SSO — settings are stored in the database and the client secret in the encrypted secret store, so no restart is needed. The environment variables below provide the base configuration that the runtime settings override:
| Variable | Description |
|---|---|
PIPING_AUTH__OIDC_ENABLED | true / false |
PIPING_AUTH__OIDC_ISSUER_URL | Issuer URL, e.g. https://keycloak.your-company.com/realms/piping; discovery is fetched from <issuer>/.well-known/openid-configuration |
PIPING_AUTH__OIDC_CLIENT_ID | Client ID registered with your IdP |
PIPING_AUTH__OIDC_REDIRECT_URL | Must match the redirect URI registered in the IdP, e.g. https://piping.your-company.com/api/v1/auth/oidc/callback |
PIPING_AUTH__OIDC_SCOPES | Requested scopes; default openid, profile, email |
PIPING_AUTH__OIDC_GROUP_CLAIM | Claim used for group mapping; default groups |
OIDC client secrets are set through the admin UI or API and stored encrypted in the database. See Access control.
Secrets storage
| Variable | Description |
|---|---|
PIPING_SECRETS__CIPHER_KEY_B64 | Required. AES-256-GCM key for encrypting stored credentials. Base64-encoded, 32 decoded bytes. Generate with openssl rand -base64 32. Generate once; never change without a migration plan. |
Key loss is unrecoverable. If you lose
PIPING_SECRETS__CIPHER_KEY_B64, everything in the secret store becomes unreadable. Keep it in a secrets manager (HashiCorp Vault, AWS Secrets Manager, etc.) and include it in your backup.
Redis
| Variable | Default | Description |
|---|---|---|
PIPING_REDIS__URL | — | Redis connection URL. Format: redis://:password@host:6379/0. The bundled Compose stacks derive it from REDIS_PASSWORD. |
Proxy and sessions
| Variable | Default | Description |
|---|---|---|
PIPING_PROXY__GUACD_HOST | 127.0.0.1 | Host of the RDP daemon. The canonical stack uses embedded guacd by default; set another host only when deploying an external daemon. |
PIPING_PROXY__GUACD_PORT | 4822 | Port of the guacd daemon. |
PIPING_START_EMBEDDED_GUACD | auto | Container-image toggle: auto starts the bundled guacd when PIPING_PROXY__GUACD_HOST is loopback; true / false force it on or off. |
PIPING_PROXY__SSH_FILE_TRANSFER__MAX_UPLOAD_BYTES | 536870912 | SSH file upload cap in bytes (512 MiB). |
PIPING_PROXY__SSH_FILE_TRANSFER__MAX_DOWNLOAD_BYTES | 536870912 | SSH file download cap in bytes (512 MiB). |
CCTV media limits
CCTV device access runs four media planes inside the backend process: the live MJPEG restream, snapshot grabs, RTSP clip copies, and native file downloads with remux. Each plane has its own concurrency ceiling and all four draw on one shared process-wide memory budget — an operation starts only when both admit it, otherwise the request is refused with 429.
These are flat PIPING_CCTV__* environment variables read directly by the backend process. They have no default.toml counterpart and are not part of the Compose .env sample below — set them on the backend container. Each is read once at first use, so a change takes effect on backend restart.
| Variable | Default | Description |
|---|---|---|
PIPING_CCTV__FFMPEG_PATH | ffmpeg | Path to the ffmpeg binary every media plane uses. ffmpeg ships in the backend image; override only for an image that carries it under another name. |
PIPING_CCTV__LIVE_MAX_STREAMS | 8 | Concurrent live transcodes. Memory-bound rather than CPU-bound: each transcode holds roughly 300 MB. Raise it together with the shared budget. |
PIPING_CCTV__LIVE_FIRST_FRAME_TIMEOUT_SECS | 15 | How long a starting live stream may take to deliver its first frame. |
PIPING_CCTV__LIVE_STALL_TIMEOUT_SECS | 30 | How long a running live stream may go without a frame before it is torn down. |
PIPING_CCTV__LIVE_MAX_SESSION_SECS | 43200 | Hard ceiling on a single live stream (12 hours) — a backstop against a lingering half-open connection. Lower it for tighter resource control. |
PIPING_CCTV__LIVE_PREFER_SUBSTREAM | false | Opt-in: try the channel's lower-resolution substream first for live view. |
PIPING_CCTV__STILL_MAX_GRABS | 8 | Concurrent snapshot grabs through the RTSP keyframe fallback. |
PIPING_CCTV__STILL_TIMEOUT_SECS | 12 | Deadline for one snapshot grab. |
PIPING_CCTV__CLIP_MAX_EXPORTS | 3 | Concurrent RTSP clip copies — the realtime export/playback path. |
PIPING_CCTV__CLIP_FIRST_CHUNK_TIMEOUT_SECS | 90 | How long a clip copy may take to produce its first bytes. |
PIPING_CCTV__DOWNLOAD_MAX_EXPORTS | 3 | Concurrent native file downloads with remux — the fast path, where the device family exposes one. |
PIPING_CCTV__DOWNLOAD_FIRST_CHUNK_TIMEOUT_SECS | 90 | How long a native download may take to produce its first bytes. |
PIPING_CCTV__DOWNLOAD_IDLE_TIMEOUT_SECS | 90 | Idle gap tolerated mid-download before the transfer is abandoned. |
PIPING_CCTV__DOWNLOAD_MAX_DURATION_SECS | 3600 | Overall ceiling on one native download and remux (1 hour). |
PIPING_CCTV__MEDIA_BUDGET_TOTAL_MB | 2400 | Shared memory budget for all four planes. |
PIPING_CCTV__MEDIA_BUDGET_UNIT_MB | 10 | Size of one budget unit. A live stream costs 30 units; a snapshot, clip copy or native download costs 1 unit each. |
PIPING_CCTV__MAX_EXPORT_WINDOW_SECS | 7200 | Longest window an export or playback request may span (2 hours). Recording search is capped separately at 30 days and has no override. |
Tip: Raise concurrency and budget together. At the defaults, 8 live streams × 30 units × 10 MB fills the 2400 MB budget exactly. Raising
PIPING_CCTV__LIVE_MAX_STREAMSalone makes the shared budget refuse streams with429below the new ceiling — the backend logs a warning at startup when a plane's ceiling exceeds the budget.
The 2-hour export/playback window is also hardcoded in the web client, so raising PIPING_CCTV__MAX_EXPORT_WINDOW_SECS widens what the API accepts but not what the browser will request — a longer window has to be requested through the API.
Licensing
| Variable | Default | Description |
|---|---|---|
PIPING_LICENSE__BASE_URL | (empty) | Optional licensing control-plane URL for activation/refresh of additional seats. Empty leaves an unactivated installation on its included 10 seats without license calls. The verification key is compiled into the binary, not supplied by an environment variable. |
PIPING_SECURITY__ALLOW_WEAK_DEV_SECRETS | false | Set true in dev/CI only to relax weak-secret startup checks. Never set in production. Does not affect licensing or seat limits. |
Seat limits and activation are covered in Licensing.
Networking and server
| Variable | Default | Description |
|---|---|---|
PIPING_SERVER__BIND | 0.0.0.0:8080 | Address and port the backend HTTP server listens on. The bundled Compose stacks set 0.0.0.0:7000. |
PIPING_HTTP_PORT / PIPING_HTTPS_PORT | 80 / 443 | Host ports published by the nginx edge in the production stack. |
PIPING_FRONTEND_PORT | 9080 | Host port published by the frontend container in the development stack. |
Integrations
NetBox
NetBox access is not configured globally. Each sync provider carries its own base URL, API token, and page size, managed under Inventory → Sync; tokens are kept in the encrypted secret store. See Inventory sync.
Observability (OpenTelemetry)
| Variable | Default | Description |
|---|---|---|
PIPING_OBSERVABILITY__OTEL_ENABLED | false | Opt-in OpenTelemetry export. Enable explicitly and configure a collector endpoint. Compose reads PIPING_OBSERVABILITY_OTEL_ENABLED. |
OTEL_EXPORTER_OTLP_ENDPOINT | — | OTLP collector endpoint, e.g. https://otel-collector.your-company.com:4318 |
OTEL_EXPORTER_OTLP_PROTOCOL | http/protobuf | OTLP transport protocol |
OTEL_SERVICE_NAME | piping-backend | Service name reported in traces and metrics |
OTEL_SDK_DISABLED | false | Set true to disable all OpenTelemetry instrumentation |
PIPING_LOG_LEVEL | info | Log verbosity (trace … error) |
PIPING_LOG_OUTPUT_FORMAT | json | text or json; the bundled Compose stacks set text |
Metrics endpoints, Prometheus service discovery, and inspector query sources are covered in Observability.
Installation environment
The installer generates the protected .env consumed by the canonical docker-compose.yml. Do not copy fixed sample secrets. Complete image references use PIPING_BACKEND_IMAGE, PIPING_FRONTEND_IMAGE and PIPING_ANSIBLE_RUNNER_IMAGE; pin them to the same version rather than assuming a shared image-tag variable.
Outside Compose, set the backend's nested variables directly. Deployment filenames, ports and TLS are covered in Deployment.