Dockingjudge docs

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.

host class-attribute instance-attribute

host = 'localhost'

port class-attribute instance-attribute

port = 5501

username class-attribute instance-attribute

username = 'pguser'

password class-attribute instance-attribute

password = 'pgpass'

database class-attribute instance-attribute

database = 'contest_db'

RabbitMQConfig dataclass

RabbitMQConfig(
    host="localhost", port=5672, username="rm_user", password="rm_password"
)

RMQ configuration.

host class-attribute instance-attribute

host = 'localhost'

port class-attribute instance-attribute

port = 5672

username class-attribute instance-attribute

username = 'rm_user'

password class-attribute instance-attribute

password = 'rm_password'

AvailableCompiler dataclass

AvailableCompiler(id, syntax_highlighting)

A compiler definition available to use.

id instance-attribute

id

syntax_highlighting instance-attribute

syntax_highlighting

AppConfig dataclass

AppConfig(available_compilers, allow_contest_creation_to)

App configuration.

available_compilers instance-attribute

available_compilers

allow_contest_creation_to instance-attribute

allow_contest_creation_to

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: ['*'])

secret_key class-attribute instance-attribute

secret_key = (
    "django-insecure-3&uwud=s#&0(uz**lf5$fi+m#)gf40l+s!v84l&afvi5bxqjr!"
)

OtherServicesConfig dataclass

OtherServicesConfig(account_service='http://localhost:8001/api/v1/accounts')

Other services connections config.

account_service class-attribute instance-attribute

account_service = 'http://localhost:8001/api/v1/accounts'

Config dataclass

Config(postgres, rabbit, security, app, services, mode='local')

Main configuration.

postgres instance-attribute

postgres

rabbit instance-attribute

rabbit

security instance-attribute

security

app instance-attribute

app

services instance-attribute

services

mode class-attribute instance-attribute

mode = 'local'
search