-
Notifications
You must be signed in to change notification settings - Fork 1
Config
Eason0729 edited this page Feb 15, 2024
·
3 revisions
# address for backend to serve
bind_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 database
salt = "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 unnecessary
public_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 address
trust_host = ["255.255.255.255/32"]
[imgur]
# imgur secret to upload image.
# Leave it empty if image uploading isn't needed
client_id = "fffffffffffffff"
client_secret = "ffffffffffffffffffffffffffffffffffffffff"
log_level = 0
[runtime]
# temporary store for compiled artifacts
temp = ".temp"
# socket address for judger to listen
bind = "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 performance
accuracy = 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 case
available_memory = 1073741824
# Output limit for jailed process
output_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 root
rootless = false
# only useful for debugging
log = "/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 plugins
path = "plugins"
# Are about to be remove, remove it to use default
[kernel]
kernel_hz = 1000
tickless = false