from os import getenv trues = ("t", "true", "yes", "y", "1") # URLs DOMAIN = getenv("DOMAIN", "example.com") URL = getenv("URL", f"https://{DOMAIN}") # Access control ALLOWED_HOSTS = getenv("ALLOWED_HOSTS", f"127.0.0.1,{DOMAIN}").split(",") # CSRF CSRF_TRUSTED_ORIGINS = getenv("CSRF_TRUSTED_ORIGINS", URL).split(",") # Stripe STRIPE_ENABLED = getenv("STRIPE_ENABLED", "false").lower() in trues STRIPE_TEST = getenv("STRIPE_TEST", "true").lower() in trues STRIPE_API_KEY_TEST = getenv("STRIPE_API_KEY_TEST", "") STRIPE_PUBLIC_API_KEY_TEST = getenv("STRIPE_PUBLIC_API_KEY_TEST", "") STRIPE_API_KEY_PROD = getenv("STRIPE_API_KEY_PROD", "") STRIPE_PUBLIC_API_KEY_PROD = getenv("STRIPE_PUBLIC_API_KEY_PROD", "") STRIPE_ENDPOINT_SECRET = getenv("STRIPE_ENDPOINT_SECRET", "") STATIC_ROOT = getenv("STATIC_ROOT", "") SECRET_KEY = getenv("SECRET_KEY", "") STRIPE_ADMIN_COUPON = getenv("STRIPE_ADMIN_COUPON", "") REGISTRATION_OPEN = getenv("REGISTRATION_OPEN", "false").lower() in trues ASSET_FILTER = [ "LINK/USDT", "PAXG/USD", "PAXG/USDT", "SHIB/USD", "TRX/USD", "TRX/USDT", "UNI/BTC", "UNI/USD", "UNI/USDT", "USDT/USD", "WBTC/USD", "YFI/BTC", "NEAR/USDT", "SUSHI/USDT", "DOGE/USDT", "LINK/BTC", "LINK/USD", "GRT/USD", "AVAX/BTC", "AVAX/USD", "AVAX/USDT", "SOL/BTC", "SOL/USD", "SOL/USDT", "BTC/USDT", "SUSHI/BTC", "SUSHI/USD", "BCH/BTC", "BCH/USD", "YFI/USD", "ETH/USD", "ETH/USDT", "YFI/USDT", "AAVE/USD", "AAVE/USDT", "ALGO/USD", "BAT/USD", "DAI/USDT", "ALGO/USDT", "MATIC/BTC", "MATIC/USD", "DOGE/USD", "MKR/USD", "BTC/USD", "DOGE/BTC", "LTC/BTC", "LTC/USD", "LTC/USDT", "ETH/BTC", "BCH/USDT", "DAI/USD", "NEAR/USD", ] # Hook URL, do not include leading or trailing slash HOOK_PATH = "hook" DEBUG = getenv("DEBUG", "false").lower() in trues PROFILER = getenv("PROFILER", "false").lower() in trues if DEBUG: import socket # only if you haven't already imported this hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) INTERNAL_IPS = [ip[: ip.rfind(".")] + ".1" for ip in ips] + [ "127.0.0.1", "10.0.2.2", ] SETTINGS_EXPORT = ["STRIPE_ENABLED", "URL", "HOOK_PATH"]