Initial commit
This commit is contained in:
31
config.py
Normal file
31
config.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
|
||||
|
||||
class Config:
|
||||
# LAN / kiosk deployments typically don't need strong cookie security.
|
||||
SECRET_KEY = os.environ.get("SECRET_KEY", "dev-secret-key-change-me")
|
||||
|
||||
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
DB_PATH = os.path.join(BASE_DIR, "syncplayer.db")
|
||||
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL", f"sqlite:///{DB_PATH}")
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||
|
||||
MEDIA_DIR = os.environ.get("MEDIA_DIR", os.path.join(BASE_DIR, "media"))
|
||||
MAX_CONTENT_LENGTH = int(os.environ.get("MAX_CONTENT_LENGTH", str(2 * 1024 * 1024 * 1024))) # 2GB
|
||||
|
||||
# Socket.IO tuning for LAN
|
||||
SOCKETIO_PING_INTERVAL = float(os.environ.get("SOCKETIO_PING_INTERVAL", "5"))
|
||||
SOCKETIO_PING_TIMEOUT = float(os.environ.get("SOCKETIO_PING_TIMEOUT", "10"))
|
||||
|
||||
# Client drift correction thresholds (ms)
|
||||
DRIFT_SOFT_MS = float(os.environ.get("DRIFT_SOFT_MS", "15"))
|
||||
DRIFT_HARD_MS = float(os.environ.get("DRIFT_HARD_MS", "100"))
|
||||
|
||||
# When an event triggers we schedule playback this many ms into the future.
|
||||
EVENT_LEAD_TIME_MS = int(os.environ.get("EVENT_LEAD_TIME_MS", "5000"))
|
||||
|
||||
# If video duration isn't known, keep event state alive for this many seconds.
|
||||
EVENT_FALLBACK_TTL_SECONDS = int(os.environ.get("EVENT_FALLBACK_TTL_SECONDS", "3600"))
|
||||
|
||||
# CORS: allow everything within LAN. Tighten if needed.
|
||||
CORS_ORIGINS = os.environ.get("CORS_ORIGINS", "*")
|
||||
Reference in New Issue
Block a user