English
Production Deployment
Rust-Srec runs as a self-hosted, single-node service. If clustering or failover is a requirement, read Scope and Limits before going further.
Reference Topology
The topology is the same for both supported deployments; only the private hop between the frontend and the API differs. In Docker it is the Compose network; on a systemd host it is loopback or a private interface.
Keep the backend, database, configuration, and output paths on one trusted host. Publish only the frontend through a TLS reverse proxy unless an API integration specifically requires direct API access.
Deployment Baseline
- Pin the version you deploy. With the Docker deployment, set
VERSION=v0.5.1for both images; avoidlatestwhere changes must be reviewed before rollout. With the systemd service, install a release binary rather than an ad-hoc build and record which release it is. - Generate unique values for
JWT_SECRETandSESSION_SECRET; store the.envfile with restrictive permissions. On a systemd host the backend secret lives in/etc/rust-srec/rust-srec.envat mode0640, ownedroot:rust-srec. - Bind host ports to a private address or loopback. In Compose, a loopback-only mapping takes the form
127.0.0.1:15275:80and127.0.0.1:12555:8080. The systemd unit shipsAPI_BIND_ADDRESS=0.0.0.0; setAPI_BIND_ADDRESS=127.0.0.1in/etc/rust-srec/rust-srec.envwhen the API must not leave the host. - Terminate HTTPS at a maintained reverse proxy and forward
Host,X-Forwarded-For, andX-Forwarded-Proto. The session cookie is markedSecureautomatically once the proxy sendsX-Forwarded-Proto: https. If the proxy cannot send that header, setCOOKIE_SECURE=trueexplicitly. - Put
DATA_DIR,CONFIG_DIR,OUTPUT_DIR, andLOG_DIRon persistent storage. Size and monitor the output volume separately from the system disk. On a systemd host this step applies only to the recording volume:StateDirectory=andLogsDirectory=already create and own/var/lib/rust-srecand/var/log/rust-srec. Keep a large collection off/var/lib/rust-srecand list its volume underReadWritePaths=. - Set resource and application concurrency limits for the host. Start conservatively and load-test the expected number and bitrate of simultaneous streams.
- Configure notifications for recording failures, pipeline failures, credential expiry, and output-root write failures.
- Complete a backup and restore drill before adding production channels.
Network Boundary
The frontend reaches the API over BACKEND_URL=http://rust-srec:8080 on the private Compose network, or over http://127.0.0.1:12555 when the backend runs as a systemd service on the same host. The host API port is useful for local administration and integrations, but it does not need to be Internet-facing for ordinary browser use.
If direct API access is required, proxy it through HTTPS, restrict source networks, and use individual credentials. Swagger exposes the complete attack surface and should not be public by default.
Capacity and Reliability
- SQLite, output files, and pipeline work make storage latency material. Do not use an unreliable network filesystem without testing locking, atomic rename, and sustained write behavior.
- Recording and transcode peaks are different workloads. Limit
max_concurrent_downloads, CPU jobs, IO jobs, and uploads independently. - Docker restart policies recover a failed process, but do not provide host failover. Monitor the host as well as the container.
- Keep enough free space for an active recording, temporary pipeline files, and rollback snapshots. See Storage and Capacity.
Go-Live Checklist
- Default password changed and unused accounts disabled.
- Secrets replaced, protected, and absent from logs and tickets.
- TLS and secure cookies verified from the user-facing URL.
- Backend and Swagger not publicly exposed without a requirement.
- Persistent volume ownership and free-space alerts verified.
- Liveness and authenticated readiness checks monitored.
- Restore drill and rollback procedure completed.
- Platform recording permission, retention, and privacy requirements approved.
On a systemd host, also verify:
systemctl is-enabled rust-srecreturnsenabled, so the service comes back after a reboot./etc/rust-srec/rust-srec.envis mode0640ownedroot:rust-srec, and containsJWT_SECRET.- Settings → Global → Output Folder names a writable directory, and
RUST_SREC_OUTPUT_ROOTSnames the same one. - An external recording volume is listed under
ReadWritePaths=, already exists, and is owned byrust-srec. TimeoutStopSec=exceedsRUST_SREC_SHUTDOWN_TIMEOUT_SECS, so recordings finalize beforeSIGKILL.
Continue with Security, Backup and Restore, and Monitoring.