1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
"""Utilities for interacting with the config for King Arthur."""
from os import environ
import pydantic
from pydantic_settings import BaseSettings
class Config(
BaseSettings,
env_file=".env",
env_prefix="KING_ARTHUR_",
extra="ignore",
):
"""Configuration for King Arthur."""
token: pydantic.SecretStr
prefixes: tuple[str, ...] = ("arthur ", "M-x ")
cloudflare_token: pydantic.SecretStr | None = None
youtube_api_key: pydantic.SecretStr | None = None
grafana_url: str = "https://grafana.pydis.wtf"
grafana_token: pydantic.SecretStr | None = None
github_token: pydantic.SecretStr | None = None
github_org: str = "python-discord"
devops_role: int = 409416496733880320
guild_id: int = 267624335836053506
devops_channel_id: int = 675756741417369640
devops_vc_id: int = 881573757536329758
ldap_bootstrap_channel_id: int = 1266358923875586160
sentry_dsn: str = ""
numbers_url: str = "https://pydis.wtf/numbers"
# RCE as a service
ssh_username: str = "kingarthur"
ssh_host: str = "lovelace.box.pydis.wtf"
# LDAP & Directory
#
# FreeIPA accesses are generated off this information
enable_ldap: bool = False
ldap_host: pydantic.AnyUrl | None = None
ldap_bind_user: str = "uid=kingarthur,cn=users,cn=accounts,dc=box,dc=pydis,dc=wtf"
ldap_bind_password: pydantic.SecretStr | None = None
ldap_base_dn: str = "dc=box,dc=pydis,dc=wtf"
ldap_certificate_location: pydantic.FilePath | None = None
# Keycloak
keycloak_address: pydantic.AnyUrl | None = None
keycloak_username: str = "kingarthur"
keycloak_password: pydantic.SecretStr | None = None
keycloak_user_realm: str = "pydis"
GIT_SHA = environ.get("GIT_SHA", "development")
CONFIG = Config()
|