-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path.env.example
More file actions
736 lines (674 loc) · 32.8 KB
/
Copy path.env.example
File metadata and controls
736 lines (674 loc) · 32.8 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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# Stream Daemon Environment Variables
# Copy this file to .env and fill in your values
# NEVER commit .env to git!
#
# ⚠️ CRITICAL: SECRETS MANAGER PRIORITY ⚠️
#
# If you're using Doppler, AWS Secrets Manager, or HashiCorp Vault:
#
# PRIORITY ORDER (for secrets/webhooks):
# 1. Secrets Manager (Doppler/AWS/Vault) - HIGHEST PRIORITY (overrides .env)
# 2. .env file - FALLBACK (used if secret not found in secrets manager)
#
# This means:
# ✅ Production secrets in Doppler/AWS/Vault will ALWAYS be used if available
# ✅ .env values serve as fallback/defaults for development
# ✅ You can safely keep credentials in .env for local dev
# ✅ Production environments automatically use secrets manager values
#
# WHAT GETS OVERRIDDEN BY SECRETS MANAGER:
# - API Keys (YOUTUBE_API_KEY)
# - Client IDs and Secrets (TWITCH_CLIENT_ID, TWITCH_CLIENT_SECRET, KICK_*)
# - Access Tokens (MASTODON_ACCESS_TOKEN, MASTODON_CLIENT_ID, MASTODON_CLIENT_SECRET)
# - App Passwords (BLUESKY_APP_PASSWORD)
# - Webhook URLs (DISCORD_WEBHOOK_URL, DISCORD_WEBHOOK_TWITCH, etc.)
#
# WHAT STAYS IN .ENV (configuration, not secrets):
# - Platform enables (TWITCH_ENABLE, MASTODON_ENABLE_POSTING)
# - Usernames (TWITCH_USERNAME, YOUTUBE_USERNAME, BLUESKY_HANDLE)
# - Public URLs (MASTODON_API_BASE_URL)
# - App names (MASTODON_APP_NAME)
# - Messages (DISCORD_ENDED_MESSAGE, DISCORD_ENDED_MESSAGE_TWITCH, etc.)
# - Settings (SETTINGS_CHECK_INTERVAL)
# - Secrets manager config (SECRETS_MANAGER, DOPPLER_TOKEN)
#
# DEVELOPMENT WORKFLOW:
# 1. Set all credentials in .env for local testing
# 2. Configure secrets manager for production
# 3. Deploy - secrets manager automatically takes priority
# 4. No need to remove .env values - they become safe fallbacks
#
# See DOPPLER_GUIDE.md for complete setup instructions!
# =====================================
# STREAMING PLATFORMS (At least ONE required)
# =====================================
# Twitch API Credentials
# HOW TO GET:
# 1. Go to https://dev.twitch.tv/console/apps
# 2. Click "Register Your Application"
# 3. Name: "Stream Daemon" (or your choice)
# 4. OAuth Redirect URL: http://localhost (required but not used by Stream Daemon)
# 5. Category: Choose relevant category (e.g., "Application Integration")
# 6. Click "Create" and copy your Client ID
# 7. Click "New Secret" to generate Client Secret (copy immediately, can't view again!)
#
# Seven fucking steps to get permission to check if someone is live.
# Remember when you could just... look at the website? Pepperidge Farm remembers.
TWITCH_ENABLE=True
# Twitch username to monitor (used for stream checks and tests)
TWITCH_USERNAME=your_twitch_username
# Option 1: Set credentials directly (for testing/local development)
TWITCH_CLIENT_ID=YOUR_TWITCH_CLIENT_ID
TWITCH_CLIENT_SECRET=YOUR_TWITCH_CLIENT_SECRET
# Option 2: Use secrets manager (RECOMMENDED - see DOPPLER_GUIDE.md)
# Comment out the credentials above and configure SECRETS section below
# YouTube Live API Credentials
# HOW TO GET:
# 1. Go to https://console.cloud.google.com/
# 2. Create New Project → Name it "Stream Daemon"
# 3. Go to "APIs & Services" → "Library"
# 4. Search "YouTube Data API v3" and click "Enable"
# 5. Go to "APIs & Services" → "Credentials"
# 6. Click "Create Credentials" → "API Key"
# 7. Copy the API key
# 8. (Optional but recommended) Click "Restrict Key" → Select "YouTube Data API v3"
#
# Eight steps through Google's bureaucratic nightmare of a cloud console.
# To check if someone is streaming. On a website. That already knows if they're streaming.
# But no, you need to create a PROJECT. With CREDENTIALS. And RESTRICT the key.
# Because God forbid someone steals your API key and... checks if streams are live? The horror.
#
# IMPORTANT: YouTube detection uses an optimized method (3 quota units per check vs 101).
# This works for 99% of streamers but has one limitation: it only detects streams that are
# the MOST RECENT video on your channel. If you upload VODs/Shorts during your stream, it
# may not be detected. Most streamers are unaffected. See docs/platforms/streaming/youtube.md
YOUTUBE_ENABLE=False
# YouTube channel handle to monitor (with or without @ prefix, used for stream checks and tests)
# Examples: "YourChannelHandle" or "@YourChannelHandle" both work - @ is auto-added if missing
YOUTUBE_USERNAME=@YourChannelHandle
# YOUTUBE_CHANNEL_ID is OPTIONAL - will be auto-resolved from username
# Only set this if you want to skip the channel lookup (slightly faster)
# YOUTUBE_CHANNEL_ID=YOUR_YOUTUBE_CHANNEL_ID
# Option 1: Set API key directly (for testing/local development)
YOUTUBE_API_KEY=YOUR_YOUTUBE_API_KEY
# Option 2: Use secrets manager (RECOMMENDED - see DOPPLER_GUIDE.md)
# Comment out the API key above and configure SECRETS section below
# Kick.com Credentials (REQUIRED)
# HOW TO GET:
# 1. Login to https://kick.com
# 2. Make sure 2FA is enabled (Settings → Security)
# 3. Go to Settings → Developer
# 4. Create a new application
# 5. Scopes/Permissions: Select "Read Access" (required for stream status checks)
# 6. Copy your Client ID and Client Secret
#
# NOTE: Kick API credentials are REQUIRED for stream monitoring.
# Or they would be, if the API actually worked consistently.
# Sometimes it does. Sometimes it returns 500. Sometimes it just... shrugs.
# That's why we fall back to scraping the website like it's 2005.
# Modern infrastructure, folks.
# The public API is no longer supported and will result in 403 errors.
KICK_ENABLE=False
# Your Kick username to monitor (used for stream checks and tests)
KICK_USERNAME=your_kick_username
# Kick API credentials (REQUIRED when KICK_ENABLE=True)
# Option 1: Set credentials directly (for testing/local development)
KICK_CLIENT_ID=YOUR_KICK_CLIENT_ID
KICK_CLIENT_SECRET=YOUR_KICK_CLIENT_SECRET
# Option 2: Use secrets manager (RECOMMENDED - see DOPPLER_GUIDE.md)
# Comment out the credentials above and configure SECRETS section below
# ===========================================
# MESSAGE FILES
# ===========================================
# MESSAGE FILES & POSTING STRATEGIES
# ===========================================
# Consolidated message files with platform sections
# Format: Use [PLATFORM] sections for platform-specific messages, or [DEFAULT] for all
# Example:
# [DEFAULT]
# Generic message 1
# [TWITCH]
# Twitch-specific message 1
MESSAGES_MESSAGES_FILE=messages.txt
MESSAGES_END_MESSAGES_FILE=end_messages.txt
# Control whether to use platform-specific sections or always use [DEFAULT]
# If true: Uses [TWITCH], [YOUTUBE], [KICK] sections when available, falls back to [DEFAULT]
# If false: Always uses [DEFAULT] section for all platforms (same message everywhere)
MESSAGES_USE_PLATFORM_SPECIFIC_MESSAGES=True
# ===========================================
# MULTI-PLATFORM POSTING STRATEGIES
# ===========================================
# LIVE_THREADING_MODE: How to handle "going live" posts when streaming to multiple platforms
# Options:
# - separate: Each platform gets its own standalone post (no threading)
# Example: "Live on Twitch!" then "Live on YouTube!" as separate posts
#
# - thread: Each platform announcement is threaded to the previous one
# Example: "Live on Twitch!" → "Also live on YouTube!" as a reply thread
#
# - combined: Single post announcing all platforms at once
# Example: "Live on Twitch, YouTube, and Kick!"
# Note: In this mode, the message will include all live platforms
MESSAGES_LIVE_THREADING_MODE=separate
# END_THREADING_MODE: How to handle "stream ended" posts
# Options:
# - disabled: Don't post any stream end messages
#
# - separate: Each platform end gets its own post (no threading to live announcement)
# Example: "Twitch stream ended!" "YouTube stream ended!" as separate posts
#
# - thread: Each end message is threaded as a reply to that platform's live announcement
# Example: "Live on Twitch!" → "Stream ended, thanks for watching!"
#
# - combined: Single post when each platform ends, listing that specific platform
# Example: "Twitch and YouTube streams ended!" (when both end simultaneously)
#
# - single_when_all_end: Wait until ALL enabled streaming platforms have ended,
# then post ONE final message
# Example: If streaming to Twitch, YouTube, and Kick, wait until
# all three have gone offline before posting "All streams ended!"
# Useful when platforms might fail at different times
MESSAGES_END_THREADING_MODE=thread
# Legacy option for backwards compatibility (if END_THREADING_MODE=disabled, this is ignored)
# Set to False to disable end messages (same as END_THREADING_MODE=disabled)
MESSAGES_POST_END_STREAM_MESSAGE=True
# =====================================
# SOCIAL PLATFORMS (At least ONE required)
# =====================================
# Mastodon API Credentials
# HOW TO GET:
# 1. Login to your Mastodon instance (e.g., mastodon.social)
# 2. Go to Settings → Development
# 3. Click "New Application"
# 4. Name: "Stream Daemon"
# 5. Scopes/Permissions:
# - Check "read:accounts" (REQUIRED - allows verifying your credentials)
# - Check "write:statuses" (REQUIRED - allows posting status updates)
# - Check "write:media" (optional - if you plan to attach images/videos)
# 6. Redirect URI: Leave default or use "urn:ietf:wg:oauth:2.0:oob"
# 7. Click "Submit"
# 8. Copy ALL THREE credentials from the Mastodon page:
# - "Client key" → Use as MASTODON_CLIENT_ID
# - "Client secret" → Use as MASTODON_CLIENT_SECRET
# - "Your access token" → Use as MASTODON_ACCESS_TOKEN
MASTODON_ENABLE_POSTING=True
MASTODON_APP_NAME=StreamDaemon
MASTODON_API_BASE_URL=https://mastodon.social
# Option 1: Set credentials directly (for testing/local development)
MASTODON_CLIENT_ID=your_mastodon_client_id
MASTODON_CLIENT_SECRET=your_mastodon_client_secret
MASTODON_ACCESS_TOKEN=your_mastodon_access_token
# Option 2: Use secrets manager (RECOMMENDED - see DOPPLER_GUIDE.md)
# Comment out the credentials above and configure SECRETS section below
# Bluesky API Credentials
# HOW TO GET:
# 1. Login to https://bsky.app
# 2. Go to Settings → App Passwords (or https://bsky.app/settings/app-passwords)
# 3. Click "Add App Password"
# 4. Name: "Stream Daemon"
# 5. Copy the generated password
# 6. IMPORTANT: This is an APP PASSWORD, NOT your main account password!
#
# NOTE FROM THE DEVELOPER:
# Bluesky's app password approach is functional but frustrating. I eagerly await
# proper OAuth 2.0 support for the masses. Currently, OAuth is only available to
# those who self-host their own Personal Data Servers (PDS), which is overkill
# for most users. Once Bluesky releases OAuth for everyone, we'll update to use it!
BLUESKY_ENABLE_POSTING=False
BLUESKY_HANDLE=yourname.bsky.social
# Option 1: Set app password directly (for testing/local development)
BLUESKY_APP_PASSWORD=your_bluesky_app_password
# Option 2: Use secrets manager (RECOMMENDED - see DOPPLER_GUIDE.md)
# Comment out the app password above and configure SECRETS section below
# Discord Webhook
# HOW TO GET:
# 1. Go to your Discord server (you must have admin/manage webhooks permission)
# 2. Right-click the channel where you want stream announcements
# 3. Click "Edit Channel" → "Integrations" → "Webhooks"
# 4. Click "Create Webhook" (or "New Webhook")
# 5. Customize name/avatar (optional)
# 6. Click "Copy Webhook URL"
#
# FLEXIBILITY OPTIONS:
# • Single webhook for all platforms: Set only discord_webhook_url
# • Per-platform webhooks: Set discord_webhook_twitch, discord_webhook_youtube, discord_webhook_kick
# • Mixed: Use discord_webhook_url as default, override specific platforms with per-platform webhooks
#
# DOPPLER/SECRETS MANAGER: Store each as a separate secret (not JSON):
# discord_webhook_url = "https://discord.com/api/webhooks/123/abc"
# discord_webhook_twitch = "https://discord.com/api/webhooks/456/def"
# discord_role = "1234567890"
# discord_role_twitch = "9876543210"
DISCORD_ENABLE_POSTING=False
# Default webhook (used for all platforms unless per-platform webhook is specified)
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN
# Per-platform webhooks (OPTIONAL - overrides default webhook for specific platforms)
# Leave commented out if you want all platforms to use the same webhook
#DISCORD_WEBHOOK_TWITCH=https://discord.com/api/webhooks/TWITCH_WEBHOOK_ID/TWITCH_WEBHOOK_TOKEN
#DISCORD_WEBHOOK_YOUTUBE=https://discord.com/api/webhooks/YOUTUBE_WEBHOOK_ID/YOUTUBE_WEBHOOK_TOKEN
#DISCORD_WEBHOOK_KICK=https://discord.com/api/webhooks/KICK_WEBHOOK_ID/KICK_WEBHOOK_TOKEN
# Discord Role Mentions (OPTIONAL)
# Pings specific roles when going live
# HOW TO GET ROLE IDs:
# 1. Enable Developer Mode: User Settings → Advanced → Developer Mode (ON)
# 2. Right-click any role in Server Settings → Roles → "Copy Role ID"
#
# FLEXIBILITY OPTIONS:
# • Single role for all platforms: Set only discord_role
# • Per-platform roles: Set discord_role_twitch, discord_role_youtube, discord_role_kick
# • Mixed: Use discord_role as default, override specific platforms with per-platform roles
# • No mentions: Leave all commented out
# Default role (used for all platforms unless per-platform role is specified)
#DISCORD_ROLE=1234567890123456789
# Per-platform roles (OPTIONAL - overrides default role for specific platforms)
#DISCORD_ROLE_TWITCH=1234567890123456789
#DISCORD_ROLE_YOUTUBE=9876543210987654321
#DISCORD_ROLE_KICK=5555555555555555555
# Stream Ended Messages (OPTIONAL)
# Customize the message shown when a stream ends
# The embed will be updated with this message while keeping the VOD link and final stats
#
# ⚠️ IMPORTANT: These are CONFIGURATION, not secrets - keep them in .env!
# DO NOT store these in Doppler/AWS/Vault - they're not sensitive data.
#
# FLEXIBILITY OPTIONS:
# • Single message for all platforms: Set only discord_ended_message
# • Per-platform messages: Set discord_ended_message_twitch, discord_ended_message_youtube, discord_ended_message_kick
# • Mixed: Use discord_ended_message as default, override specific platforms with per-platform messages
# • No ended messages: Leave all commented out to skip updating when stream ends
# Default stream ended message (used for all platforms unless per-platform message is specified)
DISCORD_ENDED_MESSAGE=Thanks for joining! Tune in next time 💜
# Per-platform stream ended messages (OPTIONAL - overrides default message for specific platforms)
#DISCORD_ENDED_MESSAGE_TWITCH=Thanks for the amazing stream! Catch the VOD below 💜
#DISCORD_ENDED_MESSAGE_YOUTUBE=Stream has ended! Watch the replay below 🎬
#DISCORD_ENDED_MESSAGE_KICK=That was epic! Check out the VOD 🎮
# Matrix Protocol
# NOTE: Matrix does NOT support editing messages (unlike Discord)
# Messages post once and stay static - no live viewer count updates
#
# HOW TO GET:
# 1. Create a Matrix account at https://app.element.io or your Matrix server
# 2. Create a room for stream announcements (e.g., "Stream Notifications")
# 3. Get Room ID:
# - Element: Room Settings → Advanced → Internal Room ID (looks like !abc123:matrix.org)
#
# TWO AUTHENTICATION METHODS (choose ONE):
#
# Method 1: Username/Password (RECOMMENDED for bot accounts)
# - Daemon logs in each time and gets fresh access token
# - Automatic token rotation on every startup
# - Best for dedicated bot accounts
# - If BOTH username/password AND access_token are set, username/password takes priority
#
# Method 2: Access Token (alternative - manual management)
# - Get from Element: Settings → Help & About → Advanced → Access Token → "Click to reveal"
# - Never expires (unless manually revoked)
# - No automatic rotation
# - Only used if username/password are NOT set
#
# AUTHENTICATION PRIORITY:
# 1. Username/Password (if both are set) - generates fresh token
# 2. Access Token (fallback if username/password not set) - static token
#
# DOPPLER/SECRETS MANAGER: Store each as a separate secret:
# MATRIX_HOMESERVER = "https://matrix.org"
# MATRIX_USERNAME = "@streambot:matrix.org" (Method 1 - RECOMMENDED)
# MATRIX_PASSWORD = "your_password" (Method 1 - RECOMMENDED)
# OR
# MATRIX_ACCESS_TOKEN = "syt_abc123..." (Method 2 - only if not using username/password)
# MATRIX_ROOM_ID = "!KHzbUMYDd0VnJyFqMXiPyfLipv4DKwn-stVz6RYD1VY:matrix.org"
MATRIX_ENABLE_POSTING=False
# Required: Homeserver and Room ID
MATRIX_HOMESERVER=https://matrix.org
MATRIX_ROOM_ID=!your_room_id:matrix.org
# Method 1: Username/Password (RECOMMENDED - auto-generates token on each startup)
# Use this for bot accounts with automatic token rotation
MATRIX_USERNAME=@your_bot:matrix.org
MATRIX_PASSWORD=your_bot_password
# Method 2: Access Token (alternative - only used if username/password NOT set)
# Comment out username/password above if you want to use a static access token
#MATRIX_ACCESS_TOKEN=your_access_token_here
# ===========================================
# SECRET MANAGER (Optional)
# ===========================================
# Options: None, aws, vault, doppler
SECRETS_MANAGER=None
# AWS Secrets Manager Configuration
# When enabled, credentials are loaded from AWS Secrets Manager
# The secret should be JSON with keys matching the credential names
# Example for Twitch: {"client_id": "abc123", "client_secret": "xyz789"}
SECRETS_AWS_TWITCH_SECRET_NAME=twitch-api-keys
SECRETS_AWS_YOUTUBE_SECRET_NAME=youtube-api-keys
SECRETS_AWS_KICK_SECRET_NAME=kick-api-keys
SECRETS_AWS_MASTODON_SECRET_NAME=mastodon-api-keys
SECRETS_AWS_BLUESKY_SECRET_NAME=bluesky-api-keys
SECRETS_AWS_DISCORD_SECRET_NAME=discord-webhook
SECRETS_AWS_MATRIX_SECRET_NAME=matrix-credentials
# HashiCorp Vault Configuration
# When enabled, credentials are loaded from Vault KV v2
# The secret should have data fields matching the credential names
SECRETS_VAULT_URL=https://vault.example.com
SECRETS_VAULT_TOKEN=your_vault_token
SECRETS_VAULT_TWITCH_SECRET_PATH=secret/twitch
SECRETS_VAULT_YOUTUBE_SECRET_PATH=secret/youtube
SECRETS_VAULT_KICK_SECRET_PATH=secret/kick
SECRETS_VAULT_MASTODON_SECRET_PATH=secret/mastodon
SECRETS_VAULT_BLUESKY_SECRET_PATH=secret/bluesky
SECRETS_VAULT_DISCORD_SECRET_PATH=secret/discord
SECRETS_VAULT_MATRIX_SECRET_PATH=secret/matrix
# Doppler Configuration
# When enabled, Doppler fetches secrets by name from your Doppler project/config
#
# IMPORTANT: Doppler Token is ENVIRONMENT-SPECIFIC
# - Tokens are tied to a specific Doppler environment (dev, stg, prd)
# - A 'dev' token only accesses 'dev' secrets
# - Generate separate tokens for different environments
# - For most users, the 'dev' environment is sufficient
#
# How to get your Doppler token:
# 1. Go to Doppler dashboard → Access → Service Tokens
# 2. Click "Generate Service Token"
# 3. Select environment: 'dev' (recommended) or 'prd' for production
# 4. Copy the token (starts with dp.st.)
#
# See DOPPLER_GUIDE.md for complete setup instructions
DOPPLER_TOKEN=dp.st.your_token_here
DOPPLER_PROJECT=stream-daemon
DOPPLER_CONFIG=dev
SECRETS_DOPPLER_TWITCH_SECRET_NAME=twitch
SECRETS_DOPPLER_YOUTUBE_SECRET_NAME=youtube
SECRETS_DOPPLER_KICK_SECRET_NAME=kick
SECRETS_DOPPLER_MASTODON_SECRET_NAME=mastodon
SECRETS_DOPPLER_BLUESKY_SECRET_NAME=bluesky
SECRETS_DOPPLER_DISCORD_SECRET_NAME=discord
SECRETS_DOPPLER_MATRIX_SECRET_NAME=matrix
SECRETS_DOPPLER_LLM_SECRET_NAME=llm
# ===========================================
# AI MESSAGE GENERATION (LLM)
# ===========================================
# OPTIONAL: Use AI to generate personalized stream messages
# instead of static start/end messages.
#
# FEATURES:
# - Platform-specific character limits (Bluesky: 300, Mastodon: 500)
# - Automatic hashtag generation based on stream title
# - Engaging, dynamic messages for each stream
# - Includes stream URL automatically
# - Falls back to standard messages if API fails
#
# TWO PROVIDER OPTIONS:
#
# Option 1: Ollama (Local LLM - RECOMMENDED for privacy & cost)
# - Run AI models locally on your own hardware
# - No API costs, unlimited usage
# - Full privacy - your data never leaves your network
# - Fast response times with proper hardware
# - Setup: https://ollama.com/
# - Multi-GPU setup: https://github.com/ChiefGyk3D/FrankenLLM
#
# Option 2: Google Gemini (Cloud API - easier setup)
# - No local hardware required
# - Pay-per-use API costs
# - Rate limits apply (10-30 RPM depending on model)
# - Setup: Get API key from https://aistudio.google.com/app/apikey
# Enable/disable LLM message generation
# Set to True to let a computer pretend to be excited about your streams
# Set to False to manually copy-paste the same message you've used for 3 years
# (At least that's honest dishonesty)
LLM_ENABLE=False
# Choose LLM provider: "ollama" (local) or "gemini" (cloud)
LLM_PROVIDER=ollama
# ===========================================
# OLLAMA CONFIGURATION (LLM_PROVIDER=ollama)
# ===========================================
# Ollama server configuration
# Replace with your Ollama server IP address (or localhost if running locally)
LLM_OLLAMA_HOST=http://192.168.1.100
LLM_OLLAMA_PORT=11434
# Model to use - CHOOSE BASED ON YOUR GPU VRAM
#
# RECOMMENDED MODELS BY VRAM (see docs/features/llm-model-recommendations.md):
#
# | VRAM | Model | Quality | Speed | Notes |
# |-------|----------------|--------------|---------|------------------------------|
# | 4GB | gemma3:2b | ⭐⭐⭐ | ~1.5s | Entry-level |
# | 6GB | gemma3:4b | ⭐⭐⭐⭐ | ~1.0s 🏆| RECOMMENDED - fast & good |
# | 8GB | gemma3:4b | ⭐⭐⭐⭐⭐ | ~1.0s 🏆| RECOMMENDED - sweet spot |
# | 12GB | gemma3:4b | ⭐⭐⭐⭐⭐ | ~1.0s | Fast with headroom |
# | 16GB | gemma3:12b | ⭐⭐⭐⭐⭐+ | ~1.3s 🏆| PREMIUM - excellent quality |
# | 24GB+ | gemma3:27b | ⭐⭐⭐⭐⭐+ | ~2s | Maximum quality |
#
# 🏆 JANUARY 2026 BENCHMARK WINNER: GEMMA3
# - gemma3:4b: ~1 second response time (6-10x faster than Qwen2.5!)
# - gemma3:12b: ~1.3 seconds with premium quality
# - No "thinking mode" overhead like Qwen3
# - Clean, single-post output
#
# ALTERNATIVE MODELS (good for specific use cases):
# QWEN3 MODELS (EXPERIMENTAL - requires LLM_ENABLE_THINKING_MODE=True):
# - qwen3:4b (2.5GB) - Rivals Qwen2.5-72B performance! But has "thinking mode"
# - qwen3:8b (5.2GB) - Very capable
# - qwen3:14b (9.3GB) - Premium quality
# ⚠️ Qwen3 models output reasoning in a 'thinking' field before the response.
# Enable LLM_ENABLE_THINKING_MODE=True and increase LLM_MAX_TOKENS if using Qwen3.
#
# OTHER GOOD OPTIONS:
# - llama3.1:8b (Meta's model, good general purpose)
# - mistral:7b (Fast, good quality)
#
# Browse available models: https://ollama.com/library
# List installed: ollama list
# Pull new model: ollama pull gemma3:12b
LLM_MODEL=gemma3:4b
# OLLAMA SETUP INSTRUCTIONS:
#
# 1. Install Ollama on your server:
# curl -fsSL https://ollama.com/install.sh | sh
#
# Multi-GPU setup? See: https://github.com/ChiefGyk3D/FrankenLLM
#
# 2. Pull a model (based on your VRAM - see table above):
# ollama pull gemma3:4b # For 6GB GPUs (recommended - fast!)
# ollama pull gemma3:12b # For 12GB GPUs (excellent quality)
# ollama pull qwen2.5:7b # For 8GB GPUs (if you prefer Qwen)
#
# 3. Start Ollama (if not running as service):
# OLLAMA_HOST=0.0.0.0 ollama serve
#
# 4. Test from Stream Daemon host:
# curl http://YOUR_SERVER_IP:11434/api/tags
#
# 5. Update LLM_OLLAMA_HOST above with your server IP
#
# For detailed model recommendations, see: docs/features/llm-model-recommendations.md
# ===========================================
# GOOGLE GEMINI CONFIGURATION (LLM_PROVIDER=gemini)
# ===========================================
# Google Gemini API Key
# HOW TO GET:
# 1. Go to https://aistudio.google.com/app/apikey
# 2. Click "Create API Key"
# 3. Copy the API key
# 4. Store in secrets manager OR set GEMINI_API_KEY below
#
# SECRETS MANAGER:
# Doppler: Store as GEMINI_API_KEY in "llm" config
# AWS: Store in secret named by SECRETS_AWS_LLM_SECRET_NAME as {"gemini_api_key": "your-key"}
# Vault: Store in path from SECRETS_VAULT_LLM_SECRET_PATH as {"gemini_api_key": "your-key"}
GEMINI_API_KEY=your_gemini_api_key_here
# Gemini model to use (default: gemini-2.0-flash-lite)
# Recommended: gemini-2.0-flash-lite (30 RPM, perfect for concurrent posts to multiple platforms)
# Other options: gemini-2.5-flash (10 RPM), gemini-2.0-flash (15 RPM), gemini-2.5-pro (5 RPM)
# Note: When using LLM_PROVIDER=gemini, set LLM_MODEL to one of the gemini models above
#LLM_MODEL=gemini-2.0-flash-lite
# ===========================================
# LLM GENERATION PARAMETERS
# ===========================================
# Fine-tune AI output for better instruction following (especially for small models)
# Temperature: Controls randomness (0.0 = deterministic, 1.0 = creative)
# For stream messages, lower is better for following strict rules
# Recommended: 0.3 for small models (gemma2:4b, phi3:mini)
# Default: 0.3
LLM_TEMPERATURE=0.3
# Top P: Nucleus sampling threshold (0.0-1.0)
# Controls diversity of token selection
# Recommended: 0.9 (good balance)
# Default: 0.9
LLM_TOP_P=0.9
# Max Tokens: Maximum length of generated output
# Higher = more verbose, lower = more concise
# Recommended: 150 (enough for posts + hashtags)
# Range: 100-200 depending on platform
# Default: 150
LLM_MAX_TOKENS=150
# ===========================================
# QWEN3 THINKING MODE SUPPORT (EXPERIMENTAL)
# ===========================================
# Qwen3 models have a unique "thinking" mode where they output their reasoning
# in a separate 'thinking' field before generating the final response.
#
# When enabled, Stream Daemon will:
# 1. Increase token limit to allow for reasoning (multiplied by thinking_token_multiplier)
# 2. Extract the actual post from the thinking output
# 3. Handle cases where content field is empty but thinking field has the answer
#
# IMPORTANT: This is experimental and may not work perfectly with all prompts.
# If you're using Qwen3 models (qwen3:4b, qwen3:8b, qwen3:14b, etc.), enable this.
# For non-thinking models (gemma3, qwen2.5, llama3, etc.), leave disabled.
#
# Default: False
LLM_ENABLE_THINKING_MODE=False
# Token multiplier for thinking mode
# Qwen3 needs more tokens to complete its reasoning before outputting the answer
# The base max_tokens is multiplied by this value when thinking mode is enabled
# Recommended: 4.0-6.0 (150 tokens * 4 = 600 tokens for thinking + response)
# Default: 4.0
LLM_THINKING_TOKEN_MULTIPLIER=4.0
# ===========================================
# LLM GUARDRAILS & QUALITY CONTROLS
# ===========================================
# Because even robots need rules, apparently.
# We built machines that can think, now we need machines to watch the thinking machines.
# It's supervision turtles all the way down. George would be so fucking proud.
#
# IMPORTANT: These guardrails control WHAT THE AI GENERATES, not the code commentary.
# The AI generates normal, professional stream announcements.
# George Carlin's humor is in the CODE, not in your "Going live!" posts.
# We're not turning your stream bot into a profane comedian (unless you disable the profanity filter, you madman).
# Message Deduplication: Prevent identical messages across platforms (True/False)
# If enabled, caches recent messages and forces retry if duplicate detected
# Useful when streaming to multiple platforms (Twitch + YouTube + Kick)
#
# "Oh no, the AI used the same words twice! Better waste CPU cycles fixing that."
# Although to be fair, humans do this shit manually all the time:
# "Going live on Twitch!" "Going live on YouTube!" "Going live on Kick!"
# At least the robot TRIES to be creative. That's more than most streamers can say.
# Default: True
LLM_ENABLE_DEDUPLICATION=True
# Deduplication cache size (how many recent messages to remember)
# Higher = better dedup, more memory usage
# Default: 20 (covers ~10 streams worth of start+end messages)
LLM_DEDUP_CACHE_SIZE=20
# Quality Scoring: Rate generated messages 1-10 and retry if too low (True/False)
# Checks for: generic words, poor grammar, lack of personality, too short/long
#
# "We're literally grading the AI's homework. In 2026. This is fine."
#
# Think about this: We spent billions on AI research so we could build a system
# that generates social media posts, then we built ANOTHER system to grade those posts,
# and if it gets a bad grade, we make it do the assignment again.
#
# This is peak civilization. We've automated mediocrity AND the quality control for it.
# George would write a 20-minute bit about this horseshit.
# Default: False (enable if you're picky about quality)
LLM_ENABLE_QUALITY_SCORING=False
# Minimum quality score (1-10) to accept a message
# Below this = automatic retry with stricter prompt
# Recommended: 6-7 (not too strict, not too lenient)
# Default: 6
LLM_MIN_QUALITY_SCORE=6
# Emoji Limits: Maximum emoji count in generated messages (0-10)
# Too many emojis = looks like a teenager's Instagram post
# Too few = boring corporate speak
#
# The sweet spot: 0-1 emoji. Maybe 2 if you're feeling wild.
#
# We created hieroglyphics 5,000 years ago, evolved past them to alphabets,
# built computers, connected the world with the internet... and now we're back
# to communicating with tiny pictures. 🎮💪🔥😂
#
# But sure, let's police how many the ROBOT uses. Because THAT'S the problem.
# Default: 1
LLM_MAX_EMOJI_COUNT=1
# Profanity Filter: Block generated messages with profanity (True/False)
#
# Ironic, considering this entire fucking codebase is profane.
# But hey, maybe you don't want the AI dropping F-bombs about your Minecraft stream.
#
# George Carlin spent his career fighting censorship and defending the seven words
# you can't say on television. Now we're programming robots not to say them.
# He'd either laugh his ass off or haunt us. Probably both.
#
# Note: This blocks GENERATED ANNOUNCEMENTS, not our beautiful Carlin commentary.
# The code can curse. Your "Going live!" posts? That's between you and your audience.
# Default: False (we're adults here)
LLM_ENABLE_PROFANITY_FILTER=False
# Profanity severity threshold (mild/moderate/severe)
# mild: blocks hard profanity (f*ck, sh*t, etc.)
# moderate: + sexual references, slurs
# severe: + mild profanity (damn, hell, crap)
# "Choose your censorship level! Democracy in action!"
# Default: moderate
LLM_PROFANITY_SEVERITY=moderate
# Platform-Specific Validation: Extra checks per platform (True/False)
# Discord: Validates mentions, embeds, markdown
# Bluesky: Validates facets, link cards, AT Protocol formatting
# Mastodon: Validates CW, visibility, HTML entities
#
# "Because one set of rules wasn't enough. Every platform needs special treatment."
#
# In the old days, you wrote something and people read it. Simple.
# Now? Discord wants its mentions formatted JUST SO. Bluesky has "facets" (whatever
# the fuck those are). Mastodon needs HTML entities validated. Matrix has its own
# special snowflake requirements.
#
# We built a global communication network and spent the next 20 years fragmenting it
# into incompatible bullshit. Congratulations, humanity. We played ourselves.
# Default: True
LLM_ENABLE_PLATFORM_VALIDATION=True
# ===========================================
# LLM RETRY CONFIGURATION (both providers)
# ===========================================
# Handles transient API errors like 503 overload
# Maximum number of retry attempts for API calls (default: 3)
LLM_MAX_RETRIES=3
# Base delay for exponential backoff in seconds (default: 2)
# Actual delays: 2s, 4s, 8s for attempts 1, 2, 3
LLM_RETRY_DELAY_BASE=2
# ===========================================
# OLLAMA AUTO-RECONNECT CONFIGURATION
# ===========================================
# When Ollama server becomes unreachable (restart, network issue),
# automatically attempt to reconnect instead of staying broken.
# This is especially useful for remote Ollama servers that might
# restart occasionally.
# Enable/disable automatic reconnection (default: True)
LLM_ENABLE_AUTO_RECONNECT=True
# Minimum interval between reconnection attempts in seconds (default: 60)
# Prevents hammering a down server
LLM_RECONNECT_INTERVAL=60
# Maximum reconnection attempts before giving up (default: 0 = unlimited)
# Set to 0 for unlimited retries, or a positive number to cap attempts
LLM_MAX_RECONNECT_ATTEMPTS=0
# ===========================================
# SETTINGS
# ===========================================
# CHECK_INTERVAL: How often to check stream status when OFFLINE (in minutes)
# Lower = faster detection when you go live, but more API calls
# Recommended: 3-5 minutes (balance between speed and API usage)
SETTINGS_CHECK_INTERVAL=5
# POST_INTERVAL: How often to check stream status when LIVE (in minutes)
# Lower = faster detection when stream ends, but more API calls
# Recommended: 2-5 minutes (you want to know quickly when stream ends!)
# NOTE: This should typically be SAME or LOWER than CHECK_INTERVAL
SETTINGS_POST_INTERVAL=5