sidequest_common.settings#
Environment-driven settings shared by the API and the bot.
Each concern has its own env prefix: DB_, API_, DISCORD_, WEB_.
Attributes#
Classes#
API settings ( |
|
Database connection settings ( |
|
Discord bot settings ( |
|
Member hub / website settings ( |
Module Contents#
- class sidequest_common.settings.APISettings#
Bases:
pydantic_settings.BaseSettingsAPI settings (
API_*).KEYis the shared secret the bot sends asX-API-Key; both services must agree on it.URLis where the bot reaches the API.- DEBUG: bool = False#
- HOST: str = '127.0.0.1'#
- KEY: pydantic.SecretStr#
- PORT: int = 8000#
- URL: str = 'http://localhost:8000'#
- model_config#
- class sidequest_common.settings.DatabaseSettings#
Bases:
pydantic_settings.BaseSettingsDatabase connection settings (
DB_*).- ECHO: bool = False#
- POOL_DISABLE: bool = False#
- URL: str = 'postgresql+asyncpg://sidequest:sidequest@localhost:55432/sidequest'#
- model_config#
- class sidequest_common.settings.DiscordSettings#
Bases:
pydantic_settings.BaseSettingsDiscord bot settings (
DISCORD_*).GUILD_IDis optional; when set, slash commands sync to that guild instantly instead of globally.- GUILD_ID: int | None = None#
- TOKEN: pydantic.SecretStr#
- model_config#
- class sidequest_common.settings.WebSettings#
Bases:
pydantic_settings.BaseSettingsMember hub / website settings (
WEB_*).Discord OAuth2 login (scopes
identify guilds.members.read) for guild members, guild events, and addons.DISCORD_CLIENT_ID/DISCORD_CLIENT_SECRETare the OAuth application credentials (separate from the bot’sDISCORD_TOKEN); when either is unset the app still boots, but/auth/discord/loginreturns 503.BATTLENET_CLIENT_ID/BATTLENET_CLIENT_SECRET(a develop.battle.net API client) let signed-in members link their Battle.net account; when unset, linking redirects back to the account page with an explanation.- BASE_URL: str = 'http://localhost:8000'#
- BATTLENET_CLIENT_ID: str | None = None#
- BATTLENET_CLIENT_SECRET: pydantic.SecretStr | None = None#
- COOKIE_SECURE: bool = False#
- DISCORD_CLIENT_ID: str | None = None#
- DISCORD_CLIENT_SECRET: pydantic.SecretStr | None = None#
- GM_ROLE_IDS: Annotated[list[int], pydantic_settings.NoDecode] = [1564678042381586532]#
- GUILD_ID: int = 1564671275316543508#
- OFFICER_ROLE_IDS: Annotated[list[int], pydantic_settings.NoDecode] = [1564678042381586532, 1564678035117178960]#
- SESSION_SECRET: pydantic.SecretStr | None = None#
- property battlenet_configured: bool#
Whether both Battle.net OAuth client credentials are set.
- model_config#
- property oauth_configured: bool#
Whether both Discord OAuth app credentials are set.
- sidequest_common.settings.MIN_SESSION_SECRET_LENGTH = 32#