-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.env.example
More file actions
85 lines (71 loc) · 3.78 KB
/
Copy path.env.example
File metadata and controls
85 lines (71 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# librtmp2-server configuration
# Copy this file to .env and adjust as needed.
# Set the same LRTMP2_API_TOKEN in librtmp2-server-panel's .env (server seeds DB on first startup).
# Optional shared API bearer token (recommended for Docker). When set, the server
# stores this value in SQLite on first startup instead of generating a new one.
# NOTE: this key is NOT read from this file — the config loader intentionally
# ignores LRTMP2_API_TOKEN here. It must be set as a real process environment
# variable (e.g. `export LRTMP2_API_TOKEN=...` or a docker-compose
# `environment:` entry), not just uncommented in a copied .env.
# LRTMP2_API_TOKEN=<generate-with-openssl-rand-hex-32>
# RTMP listener address (always active, regardless of TLS_ENABLED)
RTMP_BIND=0.0.0.0:1935
# Maximum concurrent RTMP connections (clamped to 1–10000, applied per listener)
RTMP_MAX_CONNECTIONS=100
# Maximum concurrent RTMP connections from a single remote IP. Unset (or a
# non-positive value) means no per-IP cap — only RTMP_MAX_CONNECTIONS above
# applies. Set this explicitly if you want to defend against one address
# hogging the connection pool; leave it unset behind NAT/a load balancer/a
# proxy where many legitimate clients share one source IP.
# RTMP_MAX_CONNECTIONS_PER_ADDR=100
# Maximum incomplete TLS handshakes retained per remote IP before the oldest
# is evicted. Unset (or non-positive) means no per-IP cap - RTMP_MAX_CONNECTIONS
# above still bounds the *global* number of pending handshakes, so this is a
# per-IP fairness knob on top of that, not the only defense against a
# handshake flood. Set it explicitly if one address monopolizing the
# pending-handshake budget is a concern.
# RTMP_MAX_PENDING_TLS_PER_ADDR=100
# .env-file keys above (RTMP_*) are read once at startup by the config file
# loader; the corresponding process environment variables use an
# LRTMP2_RTMP_* prefix instead (e.g. LRTMP2_RTMP_MAX_CONNECTIONS_PER_ADDR)
# and take precedence over the .env file when set.
# Close RTMP peers that never complete publish/play auth (seconds, 5–600)
RTMP_IDLE_TIMEOUT_SECS=30
# Per-connection / server memory limits (megabytes)
RTMP_MAX_REASSEMBLY_MB=32
RTMP_MAX_CACHE_MB=64
RTMP_MAX_RELAY_QUEUE_MB=8
# RTMPS (TLS) — disabled by default.
# When enabled, the server accepts BOTH plaintext RTMP (RTMP_BIND) and
# RTMPS (RTMPS_BIND) at the same time — RTMPS is an additional listener,
# not a replacement for RTMP_BIND.
TLS_ENABLED=false
TLS_CERT_FILE=/etc/librtmp2-server/fullchain.pem
TLS_KEY_FILE=/etc/librtmp2-server/privkey.pem
RTMPS_BIND=0.0.0.0:1936
# HTTP API and UI listener address
HTTP_BIND=0.0.0.0:8080
# Comma-separated proxy IPs that may set X-Forwarded-For for rate limiting
# Example behind Docker/nginx on the same host: 127.0.0.1,172.17.0.1
HTTP_TRUSTED_PROXIES=
# HTTP rate limiting (sliding window per client IP + route class)
# Window length in seconds for all buckets below
HTTP_RATE_LIMIT_WINDOW_SECS=60
# Max requests per window for /api/* requests that carry a valid Bearer
# token. Requests to /api/* without a valid token — including the public
# GET /api/v1/health — never draw from this budget; they are capped by
# HTTP_RATE_LIMIT_DEFAULT instead, so an unauthenticated client sharing an
# IP with an admin (NAT, reverse proxy) cannot exhaust the admin API budget.
HTTP_RATE_LIMIT_API=120
# Max requests per window for /stats and /stats-nginx (public stats by key),
# each tracked as its own independent budget
HTTP_RATE_LIMIT_STATS=30
# Max requests per window for all other HTTP routes, and for unauthenticated
# requests to /api/* (see HTTP_RATE_LIMIT_API)
HTTP_RATE_LIMIT_DEFAULT=60
# Maximum accepted HTTP request body size in bytes (POST /api/v1/streams, /players)
HTTP_MAX_BODY_BYTES=65536
# Log level: 0=error 1=warn 2=info 3=debug
LOG_LEVEL=2
# Log file path (empty = stderr only)
LOG_FILE=