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#

APISettings

API settings (API_*).

DatabaseSettings

Database connection settings (DB_*).

DiscordSettings

Discord bot settings (DISCORD_*).

WebSettings

Member hub / website settings (WEB_*).

Module Contents#

class sidequest_common.settings.APISettings#

Bases: pydantic_settings.BaseSettings

API settings (API_*).

KEY is the shared secret the bot sends as X-API-Key; both services must agree on it. URL is 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.BaseSettings

Database 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.BaseSettings

Discord bot settings (DISCORD_*).

GUILD_ID is 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.BaseSettings

Member hub / website settings (WEB_*).

Discord OAuth2 login (scopes identify guilds.members.read) for guild members, guild events, and addons. DISCORD_CLIENT_ID/DISCORD_CLIENT_SECRET are the OAuth application credentials (separate from the bot’s DISCORD_TOKEN); when either is unset the app still boots, but /auth/discord/login returns 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#