Skip to main content
On this page

Configuration

Piping's backend reads configuration from three layers, later layers winning:

  1. config/default.toml — required defaults, relative to the process working directory
  2. config/local.toml — optional local overrides, relative to that same directory
  3. PIPING_* 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

VariableDefaultDescription
PIPING_RUN_MODEbackendbackend — full API runtime. proxy — edge proxy only, no database required; see Proxy nodes.

Database

VariableDefaultDescription
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_CONNECTIONS10Maximum pool size. Increase for high-concurrency deployments.

Migrations run automatically on backend startup. They are forward-only — always back up before upgrading.

Authentication

VariableDefaultDescription
PIPING_AUTH__LOCAL_ENABLEDtrueLocal 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_LENGTH8Minimum password length for local accounts.
PIPING_AUTH__COOKIE_SECUREfalseSet true when serving over HTTPS (the production Compose file does).
PIPING_AUTH__SESSION_TTL_SECONDS86400Session 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:

VariableDescription
PIPING_AUTH__OIDC_ENABLEDtrue / false
PIPING_AUTH__OIDC_ISSUER_URLIssuer URL, e.g. https://keycloak.your-company.com/realms/piping; discovery is fetched from <issuer>/.well-known/openid-configuration
PIPING_AUTH__OIDC_CLIENT_IDClient ID registered with your IdP
PIPING_AUTH__OIDC_REDIRECT_URLMust match the redirect URI registered in the IdP, e.g. https://piping.your-company.com/api/v1/auth/oidc/callback
PIPING_AUTH__OIDC_SCOPESRequested scopes; default openid, profile, email
PIPING_AUTH__OIDC_GROUP_CLAIMClaim 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

VariableDescription
PIPING_SECRETS__CIPHER_KEY_B64Required. 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

VariableDefaultDescription
PIPING_REDIS__URL—Redis connection URL. Format: redis://:password@host:6379/0. The bundled Compose stacks derive it from REDIS_PASSWORD.

Proxy and sessions

VariableDefaultDescription
PIPING_PROXY__GUACD_HOST127.0.0.1Host of the RDP daemon. The canonical stack uses embedded guacd by default; set another host only when deploying an external daemon.
PIPING_PROXY__GUACD_PORT4822Port of the guacd daemon.
PIPING_START_EMBEDDED_GUACDautoContainer-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_BYTES536870912SSH file upload cap in bytes (512 MiB).
PIPING_PROXY__SSH_FILE_TRANSFER__MAX_DOWNLOAD_BYTES536870912SSH 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.

VariableDefaultDescription
PIPING_CCTV__FFMPEG_PATHffmpegPath 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_STREAMS8Concurrent 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_SECS15How long a starting live stream may take to deliver its first frame.
PIPING_CCTV__LIVE_STALL_TIMEOUT_SECS30How long a running live stream may go without a frame before it is torn down.
PIPING_CCTV__LIVE_MAX_SESSION_SECS43200Hard 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_SUBSTREAMfalseOpt-in: try the channel's lower-resolution substream first for live view.
PIPING_CCTV__STILL_MAX_GRABS8Concurrent snapshot grabs through the RTSP keyframe fallback.
PIPING_CCTV__STILL_TIMEOUT_SECS12Deadline for one snapshot grab.
PIPING_CCTV__CLIP_MAX_EXPORTS3Concurrent RTSP clip copies — the realtime export/playback path.
PIPING_CCTV__CLIP_FIRST_CHUNK_TIMEOUT_SECS90How long a clip copy may take to produce its first bytes.
PIPING_CCTV__DOWNLOAD_MAX_EXPORTS3Concurrent native file downloads with remux — the fast path, where the device family exposes one.
PIPING_CCTV__DOWNLOAD_FIRST_CHUNK_TIMEOUT_SECS90How long a native download may take to produce its first bytes.
PIPING_CCTV__DOWNLOAD_IDLE_TIMEOUT_SECS90Idle gap tolerated mid-download before the transfer is abandoned.
PIPING_CCTV__DOWNLOAD_MAX_DURATION_SECS3600Overall ceiling on one native download and remux (1 hour).
PIPING_CCTV__MEDIA_BUDGET_TOTAL_MB2400Shared memory budget for all four planes.
PIPING_CCTV__MEDIA_BUDGET_UNIT_MB10Size 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_SECS7200Longest 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_STREAMS alone makes the shared budget refuse streams with 429 below 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

VariableDefaultDescription
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_SECRETSfalseSet 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

VariableDefaultDescription
PIPING_SERVER__BIND0.0.0.0:8080Address and port the backend HTTP server listens on. The bundled Compose stacks set 0.0.0.0:7000.
PIPING_HTTP_PORT / PIPING_HTTPS_PORT80 / 443Host ports published by the nginx edge in the production stack.
PIPING_FRONTEND_PORT9080Host 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)

VariableDefaultDescription
PIPING_OBSERVABILITY__OTEL_ENABLEDfalseOpt-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_PROTOCOLhttp/protobufOTLP transport protocol
OTEL_SERVICE_NAMEpiping-backendService name reported in traces and metrics
OTEL_SDK_DISABLEDfalseSet true to disable all OpenTelemetry instrumentation
PIPING_LOG_LEVELinfoLog verbosity (trace … error)
PIPING_LOG_OUTPUT_FORMATjsontext 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.