import logging import os logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) ENV_KEY_PREFIX = 'CF_IV_' def load_secret(env_key: str) -> str: filepath = os.environ.get(ENV_KEY_PREFIX + env_key) if filepath is None: filepath = f'./secrets/{env_key.lower()}' try: with open(filepath) as f: value = f.read().strip() logger.info('Loaded secret: %s', env_key) return value except Exception: logger.exception('Could not load secret %s', env_key) return None # Crunchyroll CRUNCHYROLL_DEVICE_ID = load_secret('CRUNCHYROLL_DEVICE_ID') CRUNCHYROLL_AUTH =load_secret('CRUNCHYROLL_AUTH') # FFXIV FFXIV_CHARACTER_ID = load_secret('FFXIV_CHARACTER_ID') # Partisia Blockchain PBC_ACCOUNT_ADDRESS = load_secret('PBC_ACCOUNT_ADDRESS') # Email configuration MAILGUN_API_KEY = load_secret('MAILGUN_API_KEY') MAILGUN_DOMAIN = load_secret('MAILGUN_DOMAIN') MAILGUN_RECIPIENT = load_secret('MAILGUN_RECIPIENT')