Files
haproxy-wi/app/config.py
Aidaho 8c300a9f7d v8.2.0: Add centralized error handling and structured logging modules
Introduced a unified error handling module (`error_handler.py`) for consistent exception management across the app. Added a structured logging system (`logger.py`) to support JSON-formatted logs, improving log readability and analysis. Updated various modules to utilize these new components for better maintainability and tracing.
2025-05-19 09:24:35 +03:00

28 lines
937 B
Python

from datetime import timedelta
import logging
import app.modules.roxy_wi_tools as roxy_wi_tools
get_config = roxy_wi_tools.GetConfigVar()
class Configuration(object):
SECRET_KEY = 'very secret salt to protect your Roxy-WI sessions'
CACHE_TYPE = 'SimpleCache'
CACHE_DEFAULT_TIMEOUT = 3000
SCHEDULER_API_ENABLED = True
JWT_ACCESS_TOKEN_EXPIRES = timedelta(days=1)
JWT_ALGORITHM = 'RS256'
JWT_PRIVATE_KEY = open('/var/lib/roxy-wi/keys/roxy-wi-key').read()
JWT_PUBLIC_KEY = open('/var/lib/roxy-wi/keys/roxy-wi-key.pub').read()
JWT_TOKEN_LOCATION = ["headers", "cookies"]
JWT_IDENTITY_CLAIM = 'user_id'
JWT_ERROR_MESSAGE_KEY = 'error'
FLASK_PYDANTIC_VALIDATION_ERROR_RAISE = True
# Logging configuration
LOG_PATH = get_config.get_config_var('main', 'log_path')
LOG_FILE = 'roxy-wi.log'
LOG_LEVEL = logging.INFO
LOG_CONSOLE = False # Set to True to also log to console