"""TieMeasureFlow Client Configuration.""" import os from dotenv import load_dotenv load_dotenv(os.path.join(os.path.dirname(__file__), '..', '.env')) class Config: """Flask client configuration.""" # Flask SECRET_KEY = os.getenv("CLIENT_SECRET_KEY", "change-this-to-another-random-secret-key") DEBUG = os.getenv("FLASK_DEBUG", "0") == "1" # API Server connection API_SERVER_URL = os.getenv("API_SERVER_URL", "http://localhost:8000") # Session SESSION_COOKIE_HTTPONLY = True SESSION_COOKIE_SAMESITE = "Lax" SESSION_COOKIE_SECURE = not DEBUG # Only secure cookies in production (HTTPS) PERMANENT_SESSION_LIFETIME = 28800 # 8 hours WTF_CSRF_TIME_LIMIT = 3600 # 1 hour # Station identity: each deployed client container sets this to the station # code it belongs to. Empty/None means "not configured". STATION_CODE: str | None = os.getenv("STATION_CODE") or None # Allow switching the current station from the URL (?station=CODE), keeping the # override in the session. Meant for commissioning: it lets one PC exercise # several stations instead of needing one machine per station. # Off by default - on the shop floor the station identity comes from the local # install, and measuring against the wrong station's recipes would silently # break traceability. STATION_SWITCH_ENABLED: bool = os.getenv("STATION_SWITCH_ENABLED", "0") == "1" # Babel i18n BABEL_DEFAULT_LOCALE = "it" BABEL_DEFAULT_TIMEZONE = "Europe/Rome" LANGUAGES = {"it": "Italiano", "en": "English"}