Skip to content
Eason0729 edited this page Feb 15, 2024 · 3 revisions

Backend

# address for backend to servebind_address = "0.0.0.0:8081"# log level, set to 5 for minimal log, 0 for all the log# 1 is recommended for deployment for application with opentelemetry# 2 is recommended otherwise log_level = 0# whether to use opentelemetry(grpc)opentelemetry = true
[database]
# path to sqlite(WAL)path = "database/backend.sqlite"# salt for secrets in databasesalt = "be sure to change it"# example for manual judger# you must fill the uri(not domain name)# multiple manual judger with different plugin(language support) is allowed, backend is able to figure out which judger to send
[[judger]]
name = "http://127.0.0.1:8080"type = "static"# example for docker(swarm)# by default it will use port 80
[[judger]]
name = "your-docker-container"type = "docker"# example for judger behind loadbalanced# If there is multiple judger, and one judger is set to loadbalanced, all request will be sent to it# note that it require all judger behind loadbalancer to provide same plugin(language support)
[[judger]]
name = "http://127.0.0.1:8078"type = "loadbalanced"
[grpc]
# SSL identity for backend, just remove it if SSL is unnecessarypublic_pem = "cert.pem"private_pem = "key.pem"# list of submask to trust, trusted means "X-Forwarded-For" will be processed if request originate from submask on the list # IP are used to mitigate DDoS.# remove it to use remote socket addresstrust_host = ["255.255.255.255/32"]
[imgur]
# imgur secret to upload image.# Leave it empty if image uploading isn't neededclient_id = "fffffffffffffff"client_secret = "ffffffffffffffffffffffffffffffffffffffff"

Judger

log_level = 0
[runtime]
# temporary store for compiled artifactstemp = ".temp"# socket address for judger to listenbind = "0.0.0.0:8080"# we monitor jailed process every ${accuracy} nanoseconds, kill and report TLE# changing it doesn't affect accuracy of running time, but change system performanceaccuracy = 50000# cgroup name# not really necessary to change it unless you want to setup multiple judger on same host(docker swarm aren't considered same host)root_cgroup = "mdoj/c."
[platform]
# How many extra/less time should be given# Only useful if you want to setup multiple judger# If you have multiple processor(with different speed) across your distributed system, change it to value above 1 for extra time on slower machine cpu_time_multiplier = 1.0# How many memory should be use to run jailed process and collect output# recommend value is 80% of you memory# Cause OOM(jailed process would likely to be kill first) if value too large, and NA(Unknown) would be send for result of execution in this caseavailable_memory = 1073741824# Output limit for jailed processoutput_limit = 33554432
[nsjail]
# Be CAREFUL to ONLY USE patched nsjail from download release# Path to nsjail, which is use to apply permission limit(not resource limit)runtime = "./nsjail-3.1"# use user namespace and user owned cgroup instead of rootrootless = false# only useful for debugginglog = "/dev/null"# cgroup version# currently ONLY cgroup v2 is tested and supported# application refused to run under cgroup v1.(this was intentional)cgroup_version = "v2"# plugins are use to extend supported language(only lua is included in docker by default)
[plugin]
# Directory(Folder) storing pluginspath = "plugins"# Are about to be remove, remove it to use default
[kernel]
kernel_hz = 1000tickless = false

Clone this wiki locally