Repository navigation
Expand file tree
/
Copy pathsample.env
More file actions
217 lines (170 loc) · 10.2 KB
/
Copy pathsample.env
File metadata and controls
217 lines (170 loc) · 10.2 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# Copy this file to .env and edit as needed
# Port the app listens on (host port when bridge mode, uvicorn port when host mode)
# Set a unique APP_PORT per folder if you want to run multiple instances
APP_PORT=5005
# Resource limits — prevents a single container from consuming all host memory/CPU.
# MEMORY_LIMIT: Docker memory cap (default: 512m). Accepts: 256m, 512m, 1g, 2g, etc.
# After the SQLite cache rewrite, steady-state RAM is ~80–100 MB per instance.
# A 512 m ceiling gives plenty of headroom for cache builds and leaves room for
# multiple instances on the same host. Lower to 256m if you are tight on RAM.
# CPU_LIMIT: Max CPU cores (default: 1.0). Use 0.5 for half a core, 2.0 for two.
# MEMORY_LIMIT=512m
# CPU_LIMIT=1.0
# Live streaming: "engine" = one shared engine per channel (FFmpeg-normalized, viewers always
# start on a keyframe, one provider connection per channel no matter how many viewers);
# "legacy" = original proxies (default). See docs/env_vars.md → Streaming Engine.
# STREAM_ENGINE=engine
# ENGINE_AUDIO_CODEC=ac3
# Engine reconnects slow (< ENGINE_MIN_SPEED × real time), silent or rewinding provider
# connections and stitches the new one on seamlessly; ends the stream after ENGINE_OUTAGE_SECS.
# ENGINE_MIN_SPEED=0.7
# ENGINE_STALL_SECS=8
# ENGINE_OUTAGE_SECS=45
# Channels whose feed keeps failing switch to a backup copy of the same channel on the same
# account (US: FOX NEWS HD → TV: FOX NEWS CHANNEL ᴿᴬᵂ → …). ENGINE_FAILOVER=0 turns it off.
# ENGINE_FAILOVER=1
# ENGINE_FAILOVER_PREFIXES=US,AT&T,PRIME,TV
# Never use these copies as backups (stream ids or exact names), e.g. one that turned out Spanish:
# ENGINE_FAILOVER_EXCLUDE=1954624
# Docker restart policy (default: unless-stopped)
# Set to "no" to prevent the container from auto-restarting (e.g. for maintenance).
# Valid values: no, always, unless-stopped, on-failure
# After changing, run: docker compose up -d (re-reads the compose file)
# RESTART_POLICY=no
# Timezone for log timestamps (default: UTC)
# Use a tz database name: America/New_York, America/Chicago, America/Los_Angeles, Europe/London, etc.
# TZ=America/New_York
# Log verbosity (default: INFO)
# INFO — normal operation: startup, stream start/end, M3U fetches, VPN/MQTT connect
# DEBUG — everything: per-request timing, channel loading, EPG matching, stream reconnect details
# WARNING — only problems and errors
# LOG_LEVEL=INFO
# Docker container name (default: iptv-app)
# Change this when running multiple instances to avoid name conflicts.
CONTAINER_NAME=iptv-app
# Advertised host that Plex will use to reach the app
# If Plex is on the SAME Mac, set to 127.0.0.1 (recommended)
# If Plex is on ANOTHER machine, set to this Mac's LAN IP (e.g., 192.168.1.50)
# Note: host.docker.internal only resolves INSIDE containers; Plex (on host) won't resolve it.
HDHR_ADVERTISE_HOST=127.0.0.1
HDHR_SCHEME=http
# Port advertised to Plex (default: APP_PORT). Override only when the port Plex reaches
# differs from APP_PORT (e.g. behind a reverse proxy on a different external port).
# HDHR_ADVERTISE_PORT=5005
# Model number shown in Plex (default: "HDHR3-US")
# Common HDHomeRun models: HDHR3-US, HDHR4-2US, HDHR5-4US, HDTC-2US
HDHR_MODEL=HDHR3-US
# Friendly name shown in Plex for this HDHomeRun device (default: "IPTV HDHomeRun")
# Useful for distinguishing multiple instances (e.g., "IPTV Sports", "IPTV News")
HDHR_FRIENDLY_NAME=IPTV HDHomeRun
# Number of concurrent tuners to advertise to Plex (default: 2)
# Set higher (e.g., 4, 6, 10) if you want Plex to record/stream more channels simultaneously
HDHR_TUNER_COUNT=2
# HDHR_DISABLE_SSDP: 1 = disabled (default, works on all platforms)
# 0 = enabled (Linux only; also uncomment 1900:1900/udp in docker-compose.yml)
HDHR_DISABLE_SSDP=0
# --- Stream proxy tuning (channel browser player) ---
# STREAM_CHUNK_KB: Chunk size for the in-browser player path (default: 256 KB).
# Larger values (128–1024) reduce overhead for the browser player. Does NOT affect
# the hub producer — use HUB_CHUNK_KB for that.
# STREAM_CHUNK_KB=256
# HUB_CHUNK_KB: Chunk size for the per-channel hub producer (default: falls back to STREAM_CHUNK_KB).
# Keep this small (64–256) for live streams — large values (1024) add ~1s of live latency
# per chunk and make ring-buffer seeding lag more visible to the player.
# HUB_CHUNK_KB=256
# STREAM_PREBUFFER_KB: How many KB to buffer server-side before sending to the browser (default: 512)
# Increase (e.g. 1024, 2048) if streams stutter shortly after starting.
# Set to 0 to disable pre-buffering.
# STREAM_PREBUFFER_KB=512
# PLAYER_STASH_KB: mpegts.js client-side stash buffer in KB (default: 1024)
# Larger values absorb more upstream jitter at the cost of startup latency.
# PLAYER_STASH_KB=1024
# PLAYER_LATENCY_MAX: Max live buffer latency in seconds before mpegts.js skips ahead (default: 30)
# PLAYER_LATENCY_MAX=30
# PLAYER_LATENCY_MIN: Minimum buffer to keep in seconds (default: 5)
# PLAYER_LATENCY_MIN=5
# HEALTH_CHECK_TVG_ID: Channel TVG-ID used by GET /api/health for automated monitoring (Uptime Kuma, Home Assistant).
# Pick a reliable channel you rarely watch so probes don't clash with live viewing.
# Find the ID on the stream_test page or in your provider's channel list.
# HEALTH_CHECK_TVG_ID=325020
# STREAM_MAX_RETRIES: How many times to reconnect to the upstream source if the stream drops (default: 10)
# Increase for more resilient streams on unstable providers; set to 0 to disable reconnects.
# STREAM_MAX_RETRIES=10
# STREAM_RETRY_DELAY: Seconds to wait between reconnect attempts (default: 3)
# STREAM_RETRY_DELAY=3
# STREAM_READ_TIMEOUT: Seconds without data before the proxy treats the stream as stale and reconnects (default: 60)
# Lower values (e.g. 15) catch silent hangs faster; higher values tolerate more upstream jitter.
# STREAM_READ_TIMEOUT=60
# STREAM_SESSION_STALE_SECONDS: Seconds after the last received chunk before a session is considered dead (default: 30)
# Used by the health check to avoid false "stream active" reports after a client disconnects.
# STREAM_SESSION_STALE_SECONDS=30
# --- Bandwidth cap mitigation ---
# If your IPTV provider caps upstream delivery (e.g. ~15 Mbps), these settings help reduce buffering
# on high-quality channels.
# XTREAM_PREBUFFER_KB: Server-side prebuffer for Xtream/TiviMate live streams (default: 0 = disabled)
# Raise to 2048 to give clients a reservoir that absorbs momentary delivery dips.
# XTREAM_PREBUFFER_KB=2048
# HUB_RING_CHUNKS: Ring buffer depth for the per-channel upstream hub (default: 250, ~16 MB at 64 KB chunks)
# Raise to 200 (~12.8 MB) when streams frequently buffer due to bursty delivery.
# HUB_RING_CHUNKS=200
# HUB_CONSUMER_Q: Per-client queue depth (default: 180, ~8 MB at 64 KB chunks)
# Raise alongside HUB_RING_CHUNKS (e.g. 200) so fast producers don't overflow slow consumers.
# HUB_CONSUMER_Q=200
# HUB_SEED_CHUNKS: How many ring buffer chunks to pre-seed into a new consumer's queue (default: 8, ~512 KB).
# Keeping this small prevents live streams from jumping back on connect/reconnect.
# Apple TV probes still get immediate data; only the catch-up depth changes.
# HUB_SEED_CHUNKS=8
# HUB_IDLE_SECS: Seconds to keep the per-channel hub alive after the last consumer disconnects (default: 30).
# Prevents tearing down the upstream connection for brief gaps between client reconnects.
# HUB_IDLE_SECS=30
# HLS_MAX_BANDWIDTH_KBPS: Auto-select a lower-bitrate HLS variant when the provider serves a
# multi-bitrate HLS master playlist. Set to the max delivery bandwidth in kbps (e.g. 8000 for 8 Mbps).
# 0 = disabled (default). Has no effect on MPEG-TS streams — only applies when the upstream URL
# is an HLS master playlist (.m3u8 with multiple #EXT-X-STREAM-INF entries).
# HLS_MAX_BANDWIDTH_KBPS=8000
# EPG (Electronic Program Guide) source
# Uses epg.pw — a free XMLTV service with AI-generated US channel guide data.
# To use a different source, set EPG_XML_SOURCES to a comma-separated list of XMLTV URLs.
# Leave unset to use the default: https://epg.pw/xmltv/epg_US.xml
# EPG_XML_SOURCES=https://epg.pw/xmltv/epg_US.xml
# How long (in hours) to cache the downloaded EPG before re-fetching (default: 12)
# EPG_CACHE_HOURS=12
# Shift all EPG times by N hours (default: 0)
# Only needed when the source sends bare non-UTC times with no timezone tag.
# EPG_TIME_OFFSET_HOURS=0
# Also use the provider's own xmltv.php EPG as a fallback source (default: 1)
# Set to 0 to skip provider EPG files (e.g. when provider EPG is non-English).
# EPG_USE_PROVIDER_DATA=1
# Minimum seconds between EPG rebuild triggers (default: 60)
# EPG_REFRESH_COOLDOWN_S=60
# Allow downloading the full M3U playlist from your IPTV provider (default: 1)
# Set to 0 to disable the Fetch M3U button in the UI (e.g. to prevent accidental re-fetches
# or hitting provider rate limits on a shared/production deployment).
# ALLOW_FULL_M3U_DOWNLOAD=1
# --- Generic IPTV Player (Xtream Codes / M3U server) ---
# Credentials that IPTV apps (TiviMate, IPTV Smarters, VLC, etc.) use to connect TO this manager.
# These are NOT your upstream provider credentials — those are stored per-config in the UI.
# Connect with: server=http://<this-host>:<APP_PORT> username=iptv password=iptv
# IPTV_USERNAME=iptv
# IPTV_PASSWORD=iptv
# Pre-build VOD/series SQLite catalog on startup (default: 0 = disabled)
# Set to 1 if you want TiviMate VOD/series lists available immediately after restart (CPU heavy).
# XTREAM_PREWARM=0
# Seconds after startup before prewarm begins (default: 15)
# Delays the CPU spike so the app finishes initializing first.
# XTREAM_PREWARM_DELAY_S=15
# --- Plex integration (optional) ---
# When set, enables webhook-driven stream release so Plex can signal the proxy to free idle streams.
# PLEX_URL=http://192.168.1.10:32400
# PLEX_TOKEN=
# --- Logging & diagnostics ---
# LOG_LEVEL is set above. These are advanced diagnostic knobs.
# Warn when the async event loop stalls this long (ms, default: 250)
# EVENT_LOOP_LAG_MS=250
# Dump faulthandler stacks when event loop lags (default: 0)
# Set to 1 to diagnose blocking coroutines; generates verbose output.
# DUMP_STACKS_ON_LAG=0
# Minimum seconds between stack dumps when DUMP_STACKS_ON_LAG=1 (default: 30)
# DUMP_STACKS_MIN_INTERVAL_S=30
# Warn on requests slower than this threshold (ms, default: 2000)
# SLOW_REQUEST_MS=2000