-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.env.example
More file actions
686 lines (507 loc) · 24.6 KB
/
.env.example
File metadata and controls
686 lines (507 loc) · 24.6 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
# VLog Configuration
# Copy this file to .env and modify as needed.
# All values shown are the defaults.
#
# =============================================================================
# SETTINGS MIGRATION NOTICE
# =============================================================================
# VLog now supports database-backed settings that can be configured via the
# Admin UI (Settings tab) or CLI (`vlog settings` commands).
#
# Settings are organized into two categories:
#
# BOOTSTRAP SETTINGS (keep in .env):
# - Storage paths, database URLs, server ports
# - Authentication secrets
# - Infrastructure settings (Redis, etc.)
# These MUST be in .env because they're needed before the app starts.
#
# RUNTIME SETTINGS (migrate to database):
# - Transcoding options (HLS segment duration, timeouts, etc.)
# - Watermark configuration
# - Worker tuning parameters
# - Analytics cache settings
# - Alert webhook configuration
# These CAN be moved to the database for dynamic configuration.
#
# To migrate runtime settings to the database:
# 1. Run: vlog settings migrate-from-env
# 2. The migrated settings will be listed
# 3. You can safely remove those env vars from .env
# 4. Settings in database take precedence over env vars
#
# The env vars continue to work as fallbacks if not in the database.
# =============================================================================
# =============================================================================
# Storage Paths
# =============================================================================
# Base storage path for all video files
VLOG_STORAGE_PATH=/mnt/nas/vlog-storage
# Subdirectories within storage path
VLOG_VIDEOS_SUBDIR=videos
VLOG_UPLOADS_SUBDIR=uploads
VLOG_ARCHIVE_SUBDIR=archive
# SQLite database path (keep local for performance)
VLOG_DATABASE_PATH=./vlog.db
# PostgreSQL database URL (recommended for production)
# VLOG_DATABASE_URL=postgresql://vlog:vlog_password@localhost/vlog
# =============================================================================
# Storage Health Check
# =============================================================================
# Timeout for health check storage access test (seconds)
# Reduced default for faster failure detection on stale NFS mounts
VLOG_STORAGE_CHECK_TIMEOUT=2
# =============================================================================
# Server Ports
# =============================================================================
# Public API port (video browsing, playback, analytics)
VLOG_PUBLIC_PORT=9000
# Admin API port (uploads, management - internal only)
VLOG_ADMIN_PORT=9001
# Admin API authentication secret (optional)
# When set, all /api/* endpoints require X-Admin-Secret header
# Generate with: python -c "import secrets; print(secrets.token_urlsafe(32))"
# VLOG_ADMIN_API_SECRET=your-secret-here
# Admin session expiry in hours (for browser-based authentication)
# Sessions use HTTP-only cookies and are stored server-side
VLOG_ADMIN_SESSION_EXPIRY_HOURS=24
# =============================================================================
# API Versioning (Issue #218)
# =============================================================================
# Current API version (format: v1, v2, etc.)
# All API routes will be available at /api/v1/*, /api/v2/*, etc.
VLOG_API_VERSION=v1
# Enable deprecation notices for older API versions
# When enabled, deprecated versions include Deprecation and Sunset headers
VLOG_API_DEPRECATION_NOTICE=true
# Sunset date for deprecated API versions.
# RFC 5322 format is recommended (e.g. Sat, 01 Jan 2028 00:00:00 GMT),
# but any format supported by the HTTP Sunset header specification may be used.
# VLOG_API_DEPRECATION_SUNSET=
# Include legacy unversioned routes (/api/videos) that alias to current version
# Set to false to require explicit version in all API requests
VLOG_API_INCLUDE_LEGACY_ROUTES=true
# =============================================================================
# OpenAPI Documentation
# =============================================================================
# OpenAPI documentation title
VLOG_OPENAPI_TITLE=VLog API
# OpenAPI documentation description
VLOG_OPENAPI_DESCRIPTION=Self-hosted video platform API with versioned endpoints
# Terms of service URL (optional)
# VLOG_OPENAPI_TERMS_OF_SERVICE=https://example.com/terms
# API contact information (optional)
# VLOG_OPENAPI_CONTACT_NAME=API Support
# VLOG_OPENAPI_CONTACT_EMAIL=api@example.com
# API license information (optional)
# VLOG_OPENAPI_LICENSE_NAME=MIT
# VLOG_OPENAPI_LICENSE_URL=https://opensource.org/licenses/MIT
# =============================================================================
# Worker Settings
# =============================================================================
# Use inotify-based filesystem watcher instead of polling
VLOG_WORKER_USE_FILESYSTEM_WATCHER=true
# Fallback poll interval in seconds (safety net)
VLOG_WORKER_FALLBACK_POLL_INTERVAL=60
# Debounce delay in seconds after file event
VLOG_WORKER_DEBOUNCE_DELAY=1.0
# Progress update rate limiting (prevents database overload during transcoding)
VLOG_PROGRESS_UPDATE_INTERVAL=5.0
# =============================================================================
# Remote Worker Settings (Distributed Transcoding)
# =============================================================================
# Worker API port (for remote transcoder registration and job claiming)
VLOG_WORKER_API_PORT=9002
# HTTP health server port for K8s liveness/readiness probes
VLOG_WORKER_HEALTH_PORT=8080
# Worker API URL (used by remote workers to connect to the server)
VLOG_WORKER_API_URL=http://localhost:9002
# Worker API key (issued when registering via `vlog worker register`)
# VLOG_WORKER_API_KEY=vlog_xxxx...
# Admin secret for worker management endpoints (register, list, revoke)
# Generate with: python -c "import secrets; print(secrets.token_urlsafe(32))"
# VLOG_WORKER_ADMIN_SECRET=your-secret-here
# [MIGRATABLE] These worker tuning settings can be moved to the database:
# Heartbeat interval in seconds (how often workers send status updates)
VLOG_WORKER_HEARTBEAT_INTERVAL=30
# How long a worker can claim a job before it expires (minutes)
VLOG_WORKER_CLAIM_DURATION=30
# How often remote workers poll for new jobs (seconds)
VLOG_WORKER_POLL_INTERVAL=10
# Local directory for remote workers to use during transcoding
VLOG_WORKER_WORK_DIR=/tmp/vlog-worker
# Minutes before a worker is considered offline (no heartbeat)
VLOG_WORKER_OFFLINE_THRESHOLD=2
# How often to check for stale jobs from offline workers (seconds)
VLOG_STALE_JOB_CHECK_INTERVAL=60
# =============================================================================
# Soft Delete
# =============================================================================
# Days to keep archived videos before permanent deletion
VLOG_ARCHIVE_RETENTION_DAYS=30
# =============================================================================
# HLS Settings [MIGRATABLE]
# =============================================================================
# Segment duration in seconds
VLOG_HLS_SEGMENT_DURATION=6
# =============================================================================
# Thumbnail Settings
# =============================================================================
# Maximum custom thumbnail upload size in bytes (10MB default)
VLOG_MAX_THUMBNAIL_SIZE=10485760
# Thumbnail width in pixels (height auto-calculated to maintain aspect ratio)
VLOG_THUMBNAIL_WIDTH=640
# =============================================================================
# Hardware Acceleration
# =============================================================================
# Hardware acceleration type: auto, nvidia, intel, none
VLOG_HWACCEL_TYPE=auto
# Preferred codec: h264, hevc, av1
VLOG_HWACCEL_PREFERRED_CODEC=h264
# Fall back to CPU if GPU encoding fails
VLOG_HWACCEL_FALLBACK_TO_CPU=true
# Maximum concurrent GPU encoding sessions (consumer GPUs have limits)
VLOG_HWACCEL_MAX_SESSIONS=3
# VAAPI device path (Intel GPU, leave empty for auto-detect)
# VLOG_HWACCEL_VAAPI_DEVICE=/dev/dri/renderD128
# =============================================================================
# Parallel Quality Encoding
# =============================================================================
# Number of qualities to encode simultaneously (1 = sequential)
# Recommended: 3 for GPUs, 1 for CPU-only
VLOG_PARALLEL_QUALITIES=1
# Auto-detect optimal parallelism based on GPU capabilities
# When true: uses min(3, gpu.max_sessions - 1) for GPUs
VLOG_PARALLEL_QUALITIES_AUTO=true
# =============================================================================
# Transcoding Settings
# =============================================================================
# Checkpoint interval in seconds
VLOG_CHECKPOINT_INTERVAL=30
# Seconds before a job is considered stale (30 min default)
VLOG_JOB_STALE_TIMEOUT=1800
# Maximum retry attempts for failed jobs
VLOG_MAX_RETRY_ATTEMPTS=3
# Backoff base in seconds (doubles each retry)
VLOG_RETRY_BACKOFF_BASE=60
# Clean up partial files on failure
VLOG_CLEANUP_PARTIAL_ON_FAILURE=true
# Clean up source files when transcoding permanently fails (after max retries)
VLOG_CLEANUP_SOURCE_ON_PERMANENT_FAILURE=true
# Keep completed qualities on retry (don't re-transcode)
VLOG_KEEP_COMPLETED_QUALITIES=true
# =============================================================================
# Streaming Format Settings (Issue #222)
# =============================================================================
# Output format: "hls_ts" (MPEG-TS segments) or "cmaf" (fMP4 segments)
# CMAF enables DASH streaming and better seeking performance
VLOG_STREAMING_FORMAT=cmaf
# Video codec for streaming: "h264", "hevc", or "av1"
# HEVC/AV1 require CMAF format and may not work on all devices
VLOG_STREAMING_CODEC=hevc
# Enable DASH manifest generation (only available with CMAF format)
VLOG_STREAMING_ENABLE_DASH=true
# =============================================================================
# FFmpeg Timeout Settings
# =============================================================================
# Base timeout multiplier (timeout = video_duration * multiplier * resolution_factor)
VLOG_FFMPEG_TIMEOUT_BASE_MULTIPLIER=2.0
# Minimum timeout in seconds (5 minutes)
VLOG_FFMPEG_TIMEOUT_MINIMUM=300
# Maximum timeout in seconds (1 hour)
VLOG_FFMPEG_TIMEOUT_MAXIMUM=3600
# =============================================================================
# Worker Reliability Settings
# =============================================================================
# Timeout for extracting TAR archives from remote workers (seconds)
# Default: 600 (10 minutes) - sufficient for large quality archives on slow NAS
VLOG_TAR_EXTRACTION_TIMEOUT=600
# Enable automatic cleanup of orphaned quality directories
# Orphans occur when workers crash mid-transcode, leaving partial directories
VLOG_ORPHAN_CLEANUP_ENABLED=true
# How often to run orphan cleanup check (seconds, default: 1 hour)
VLOG_ORPHAN_CLEANUP_INTERVAL=3600
# Minimum age before a directory is considered orphaned (seconds, default: 24 hours)
# Directories younger than this are not cleaned up to allow time for job completion
VLOG_ORPHAN_CLEANUP_MIN_AGE=86400
# =============================================================================
# Transcription Settings (Whisper) [MIGRATABLE]
# =============================================================================
# Whisper model: tiny, base, small, medium, large-v3
VLOG_WHISPER_MODEL=medium
# Enable/disable auto-transcription
VLOG_TRANSCRIPTION_ENABLED=true
# Language code for transcription (leave empty for auto-detect)
# VLOG_TRANSCRIPTION_LANGUAGE=en
# Auto-transcribe new uploads
VLOG_TRANSCRIPTION_ON_UPLOAD=true
# Compute type for faster-whisper: float16, int8, int8_float16
VLOG_TRANSCRIPTION_COMPUTE_TYPE=int8
# Transcription timeout in seconds (1 hour)
VLOG_TRANSCRIPTION_TIMEOUT=3600
# Audio extraction timeout in seconds (5 minutes)
VLOG_AUDIO_EXTRACTION_TIMEOUT=300
# =============================================================================
# Upload Limits
# =============================================================================
# Maximum upload size in bytes (100GB default)
VLOG_MAX_UPLOAD_SIZE=107374182400
# Upload chunk size in bytes (1MB default)
VLOG_UPLOAD_CHUNK_SIZE=1048576
# HLS archive extraction limits (tar bomb protection)
# Max files in HLS archive (50k supports ~8hr videos with all qualities)
VLOG_MAX_HLS_ARCHIVE_FILES=50000
# Max total extracted size in bytes (200GB)
VLOG_MAX_HLS_ARCHIVE_SIZE=214748364800
# Max single file size in bytes (500MB)
VLOG_MAX_HLS_SINGLE_FILE_SIZE=524288000
# =============================================================================
# CORS Configuration
# =============================================================================
# Allowed origins for public API (comma-separated)
# Leave empty for same-origin only
# VLOG_CORS_ORIGINS=http://localhost:9000,http://localhost:9001
# Allowed origins for admin API cross-origin requests (comma-separated)
# Defaults to empty (same-origin only) - no configuration needed for typical setups
# Only set this if admin UI is served from a different host than the API
# VLOG_ADMIN_CORS_ORIGINS=http://192.168.1.100:3000,http://devbox.local:3000
# =============================================================================
# Rate Limiting
# =============================================================================
# Enable/disable rate limiting
VLOG_RATE_LIMIT_ENABLED=true
# Public API rate limits
VLOG_RATE_LIMIT_PUBLIC_DEFAULT=100/minute
VLOG_RATE_LIMIT_PUBLIC_VIDEOS_LIST=60/minute
VLOG_RATE_LIMIT_PUBLIC_ANALYTICS=120/minute
# Admin API rate limits
VLOG_RATE_LIMIT_ADMIN_DEFAULT=200/minute
VLOG_RATE_LIMIT_ADMIN_UPLOAD=10/hour
# Worker API rate limits
VLOG_RATE_LIMIT_WORKER_DEFAULT=300/minute
VLOG_RATE_LIMIT_WORKER_REGISTER=5/hour
VLOG_RATE_LIMIT_WORKER_PROGRESS=600/minute
# Rate limit storage backend
# SECURITY: In-memory rate limiting doesn't work with multiple API instances.
# Attackers can bypass rate limits by distributing requests across instances.
#
# AUTO-DETECTION: If VLOG_REDIS_URL is set (below), rate limiting will
# automatically use Redis. No need to set this explicitly in most cases.
#
# Explicit override (takes precedence over auto-detection):
# VLOG_RATE_LIMIT_STORAGE_URL=redis://localhost:6379/0
#
# Force in-memory (single instance deployments only!):
# VLOG_RATE_LIMIT_STORAGE_URL=memory://
# Trusted proxy IPs for X-Forwarded-For header (comma-separated)
# Leave empty to never trust X-Forwarded-For (prevents rate limit bypass)
# VLOG_TRUSTED_PROXIES=127.0.0.1,10.0.0.1
# =============================================================================
# Metrics Configuration (Issue #436)
# =============================================================================
# Enable or disable the /metrics endpoint entirely
# Default: true (enabled for backwards compatibility)
VLOG_METRICS_ENABLED=true
# Require authentication for /metrics endpoint
# When true, requires X-Admin-Secret header (uses VLOG_ADMIN_API_SECRET for Admin API,
# VLOG_WORKER_ADMIN_SECRET for Worker API)
# Default: false (disabled for backwards compatibility with existing Prometheus configs)
# SECURITY NOTE: For production, enable this OR use network-level isolation
# to prevent metrics leaking system information to unauthorized users
VLOG_METRICS_AUTH_REQUIRED=false
# =============================================================================
# Video Downloads (Issue #202)
# Allow users to download videos
# =============================================================================
# Master switch for download feature - disabled by default for security
# Set to true to enable download buttons on the watch page
VLOG_DOWNLOADS_ENABLED=false
# Allow downloading original source files (as uploaded)
# Original files may be very large and not optimized for streaming
VLOG_DOWNLOADS_ALLOW_ORIGINAL=false
# Allow downloading transcoded quality variants (e.g., 1080p MP4)
# Note: Not yet implemented - planned for future release
VLOG_DOWNLOADS_ALLOW_TRANSCODED=true
# Rate limit for download requests per IP (requests per hour)
# Set to 0 to disable rate limiting for downloads
# NOTE: This rate limit is configured at startup. Changing it requires a restart.
VLOG_DOWNLOADS_RATE_LIMIT_PER_HOUR=10
# Maximum concurrent downloads per IP (prevents bandwidth abuse)
# This is tracked in-memory so resets on server restart
VLOG_DOWNLOADS_MAX_CONCURRENT=2
# =============================================================================
# Playback Settings (Issue #211) [MIGRATABLE]
# Autoplay and "Up Next" video suggestions
# =============================================================================
# Enable autoplay feature globally (can be overridden by user preferences)
# When enabled, the next video will automatically play after the current ends
VLOG_AUTOPLAY_ENABLED=true
# Enable "Up Next" suggestions after video ends
# Shows a countdown overlay with the next recommended video
VLOG_UPNEXT_ENABLED=true
# Countdown duration in seconds before autoplay starts (5-30)
VLOG_AUTOPLAY_COUNTDOWN_SECONDS=10
# =============================================================================
# Cookie Security
# =============================================================================
# Set secure flag on cookies (requires HTTPS)
# Disable for local development without HTTPS
VLOG_SECURE_COOKIES=true
# =============================================================================
# Analytics Caching [MIGRATABLE]
# =============================================================================
# Enable/disable analytics caching
VLOG_ANALYTICS_CACHE_ENABLED=true
# Server-side cache TTL in seconds
VLOG_ANALYTICS_CACHE_TTL=60
# Client-side Cache-Control max-age in seconds
VLOG_ANALYTICS_CLIENT_CACHE_MAX_AGE=60
# Analytics cache storage backend
# Use "memory://" for single instance, or Redis URL for multi-instance:
# VLOG_ANALYTICS_CACHE_STORAGE_URL=redis://localhost:6379/0
VLOG_ANALYTICS_CACHE_STORAGE_URL=memory://
# =============================================================================
# Audit Logging
# =============================================================================
# Enable/disable audit logging for administrative actions
VLOG_AUDIT_LOG_ENABLED=true
# Path to audit log file (directory will be created if it doesn't exist)
VLOG_AUDIT_LOG_PATH=/var/log/vlog/audit.log
# Audit log level (DEBUG, INFO, WARNING, ERROR)
VLOG_AUDIT_LOG_LEVEL=INFO
# Maximum audit log file size in bytes before rotation (10MB default)
VLOG_AUDIT_LOG_MAX_BYTES=10485760
# Number of backup audit log files to keep
VLOG_AUDIT_LOG_BACKUP_COUNT=5
# =============================================================================
# Error Message Settings
# =============================================================================
# Maximum length for brief error summaries (shown in API responses)
VLOG_ERROR_SUMMARY_MAX_LENGTH=100
# Maximum length for detailed error messages
VLOG_ERROR_DETAIL_MAX_LENGTH=500
# Maximum length for full error logs
VLOG_ERROR_LOG_MAX_LENGTH=2000
# =============================================================================
# Alerting Configuration [MIGRATABLE]
# =============================================================================
# Webhook URL for sending alerts (stale jobs, max retries exceeded, etc.)
# Leave empty to disable webhook alerts
# VLOG_ALERT_WEBHOOK_URL=https://hooks.slack.com/services/xxx
# Timeout for webhook requests in seconds
VLOG_ALERT_WEBHOOK_TIMEOUT=10
# Minimum interval between alerts for the same event type (seconds)
# Prevents alert flooding when multiple jobs fail in quick succession
VLOG_ALERT_RATE_LIMIT_SECONDS=300
# =============================================================================
# Redis Configuration
# =============================================================================
# Redis URL for job queue and pub/sub (leave empty to disable Redis features)
# Include password in URL: redis://:YOUR_PASSWORD@host:6379
# Generate a strong password: python -c "import secrets; print(secrets.token_urlsafe(32))"
# VLOG_REDIS_URL=redis://:YOUR_REDIS_PASSWORD@localhost:6379
# Redis connection pool size
VLOG_REDIS_POOL_SIZE=10
# Redis socket timeouts in seconds
VLOG_REDIS_SOCKET_TIMEOUT=5.0
VLOG_REDIS_SOCKET_CONNECT_TIMEOUT=5.0
# Redis health check interval in seconds
VLOG_REDIS_HEALTH_CHECK_INTERVAL=30
# Job queue mode: database (default), redis, or hybrid
VLOG_JOB_QUEUE_MODE=database
# Redis Streams settings
VLOG_REDIS_STREAM_MAX_LEN=10000
VLOG_REDIS_CONSUMER_GROUP=vlog-workers
VLOG_REDIS_CONSUMER_BLOCK_MS=5000
VLOG_REDIS_PENDING_TIMEOUT_MS=300000
# Redis Pub/Sub channel prefix
VLOG_REDIS_PUBSUB_PREFIX=vlog
# SSE (Server-Sent Events) settings
VLOG_SSE_HEARTBEAT_INTERVAL=30
VLOG_SSE_RECONNECT_TIMEOUT_MS=3000
# =============================================================================
# CLI Configuration
# =============================================================================
# Admin API URL for CLI (overrides VLOG_ADMIN_PORT if set)
# VLOG_ADMIN_API_URL=http://localhost:9001
# API request timeout in seconds
VLOG_API_TIMEOUT=30
# Upload timeout in seconds (2 hours default for large files)
VLOG_UPLOAD_TIMEOUT=7200
# Download timeout for yt-dlp in seconds
VLOG_DOWNLOAD_TIMEOUT=3600
# =============================================================================
# Watermark Settings [MIGRATABLE]
# =============================================================================
# Enable/disable client-side watermark overlay on video player
VLOG_WATERMARK_ENABLED=false
# Watermark type: image or text
VLOG_WATERMARK_TYPE=image
# Path to watermark image file (PNG, JPEG, WebP, SVG, GIF)
# Can be uploaded via Admin API or placed directly in storage
# VLOG_WATERMARK_IMAGE=watermark.png
# Text to display as watermark (used when VLOG_WATERMARK_TYPE=text)
# VLOG_WATERMARK_TEXT=© 2025 MyBrand
# Text watermark font size in pixels (8-72)
VLOG_WATERMARK_TEXT_SIZE=16
# Text watermark color (CSS color value)
VLOG_WATERMARK_TEXT_COLOR=white
# Watermark position: top-left, top-right, bottom-left, bottom-right, center
VLOG_WATERMARK_POSITION=bottom-right
# Watermark opacity (0.0-1.0)
VLOG_WATERMARK_OPACITY=0.5
# Padding from edge in pixels
VLOG_WATERMARK_PADDING=16
# Maximum watermark width as percentage of video width (1-50, images only)
VLOG_WATERMARK_MAX_WIDTH_PERCENT=15
# =============================================================================
# Sprite Sheet Settings
# =============================================================================
# Enable sprite sheet generation for video thumbnails (hover preview)
VLOG_SPRITE_SHEET_ENABLED=true
# Automatically generate sprite sheets for new videos
VLOG_SPRITE_SHEET_AUTO_GENERATE=false
# Seconds between frames in sprite sheets
VLOG_SPRITE_SHEET_FRAME_INTERVAL=5
# Width of each thumbnail in pixels
VLOG_SPRITE_SHEET_THUMBNAIL_WIDTH=160
# Number of thumbnails per row/column in each sprite sheet
VLOG_SPRITE_SHEET_TILE_SIZE=10
# JPEG quality for sprite sheets (lower = smaller files)
VLOG_SPRITE_SHEET_JPEG_QUALITY=60
# Maximum number of sprite sheets per video
VLOG_SPRITE_SHEET_MAX_SHEETS=100
# Maximum video duration to process for sprites (in seconds, default 4 hours)
# Videos longer than this will be skipped for sprite generation
VLOG_SPRITE_SHEET_MAX_VIDEO_DURATION=14400
# Timeout settings for sprite generation
# Timeout = video_duration * multiplier, clamped to min/max
VLOG_SPRITE_SHEET_TIMEOUT_MULTIPLIER=0.5
VLOG_SPRITE_SHEET_TIMEOUT_MINIMUM=60
VLOG_SPRITE_SHEET_TIMEOUT_MAXIMUM=600
# =============================================================================
# Streaming Upload Settings
# =============================================================================
# Enable streaming segment upload (uploads segments as they're encoded)
# Reduces memory usage and enables faster job completion detection
VLOG_WORKER_STREAMING_UPLOAD=false
# =============================================================================
# Testing
# =============================================================================
# Set to skip directory creation (for CI/tests)
# VLOG_TEST_MODE=1
# =============================================================================
# Structured Logging (Issue #208)
# =============================================================================
# Log format: "json" for production (log aggregation), "text" for development
VLOG_LOG_FORMAT=json
# Default log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
VLOG_LOG_LEVEL=INFO
# Module-specific log levels (comma-separated, e.g., "api.auth=DEBUG,worker=WARNING")
# VLOG_LOG_LEVELS=
# Optional log file output (in addition to stdout)
# Leave empty to only log to stdout
# VLOG_LOG_FILE=/var/log/vlog/app.log
# Log file rotation settings (only applies when VLOG_LOG_FILE is set)
VLOG_LOG_FILE_MAX_BYTES=10485760
VLOG_LOG_FILE_BACKUP_COUNT=5