Example config
mode: local
rabbit:
host: localhost
username: rm_user
password: rm_password
postgres:
host: localhost
port: 5501
username: pguser
password: pgpass
security:
allowed_hosts:
- "*"
- "contest.service:8000"
- "contest.service"
- "dockingjudge.tapeline.dev"
- "localhost"
- "127.0.0.1"
services:
account_service: "http://localhost:8001/api/v1/accounts"
app:
available_compilers:
- id: python
syntax_highlighting: python
- id: cpp17
syntax_highlighting: cpp
allow_contest_creation_to:
- "*"
Configuration reference
service_config_loader
module-attribute
service_config_loader = config_loader(
YamlSource("contest_service.yml"),
EnvSource(prefix="CONTEST_SVC_", sep="__"),
config=Config,
)
PostgresConfig
dataclass
PostgresConfig(
host="localhost",
port=5501,
username="pguser",
password="pgpass",
database="contest_db",
)
Postgres configuration.
RabbitMQConfig
dataclass
AvailableCompiler
dataclass
AppConfig
dataclass
SecurityConfig
dataclass
SecurityConfig(
allowed_hosts=(lambda: ["*"])(),
secret_key="django-insecure-3&uwud=s#&0(uz**lf5$fi+m#)gf40l+s!v84l&afvi5bxqjr!",
)
Security configuration.
allowed_hosts
class-attribute
instance-attribute
allowed_hosts = field(default_factory=lambda: ['*'])