-
Notifications
You must be signed in to change notification settings - Fork 406
Expand file tree
/
Copy pathcms.sample.toml
More file actions
201 lines (165 loc) · 6.83 KB
/
cms.sample.toml
File metadata and controls
201 lines (165 loc) · 6.83 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
[global]
# Whether to have a backdoor (see doc for the risks).
backdoor = false
# Whether to print debug-level messages into the per-service log file.
file_log_debug = false
# Whether to print more detailed logs on stdout.
# The detailed log contains the thread name, file and function name, in
# addition to the operation, if present.
stream_log_detailed = false
# Directories used by CMS. The default values are shown in the comments,
# with INSTALL_DIR representing the path of the virtual env that CMS was
# installed into.
# Short-lived temporary files.
temp_dir = "/tmp"
# Log files.
#log_dir = "INSTALL_DIR/log"
# Cached files.
#cache_dir = "INSTALL_DIR/cache"
# Miscellaneous files generated by CMS.
#data_dir = "INSTALL_DIR/lib"
# Run-time data (e.g. socket files).
#run_dir = "INSTALL_DIR/run"
[services]
# Each service has some number of shards, defined in this table. For
# most services, it only makes sense to have one shard, but there should
# be one ResourceService per host, and it's possible to have muliple
# Workers and ContestWebServers.
# For each shard of a service, the first element of the list specifies
# the hostname it will run on, and the second one its port for RPC
# communication with the rest of CMS. Each ResourceService will manage
# services with the same hostname. If you run services on different
# hosts, make sure they can connect to each other using the specified
# hostnames and ports.
LogService = [["localhost", 29000]]
ResourceService = [["localhost", 28000]]
ScoringService = [["localhost", 28500]]
Checker = [["localhost", 22000]]
EvaluationService = [["localhost", 25000]]
# NOTE: more than 64 workers on the same machine are not supported.
Worker = [
["localhost", 26000],
["localhost", 26001],
["localhost", 26002],
["localhost", 26003],
["localhost", 26004],
["localhost", 26005],
["localhost", 26006],
["localhost", 26007],
["localhost", 26008],
["localhost", 26009],
["localhost", 26010],
["localhost", 26011],
["localhost", 26012],
["localhost", 26013],
["localhost", 26014],
["localhost", 26015],
]
ContestWebServer = [["localhost", 21000]]
AdminWebServer = [["localhost", 21100]]
ProxyService = [["localhost", 28600]]
PrometheusExporter = []
TelegramBot = []
[database]
# Connection string for the database.
url = "postgresql+psycopg2://cmsuser:your_password_here@localhost:5432/cmsdb"
# Whether SQLAlchemy prints DB queries on stdout.
debug = false
# Whether to use two-phase commit.
twophase_commit = false
[worker]
# Don't delete the sandbox directory under /tmp/ when they are not
# needed anymore. Warning: this can easily eat GB of space very soon.
keep_sandbox = false
[sandbox]
# Do not allow contestants' solutions to write files bigger than this
# size (expressed in KB; defaults to 1 GB).
max_file_size = 1_048_576
# Max processes, CPU time (s), memory (KiB) for compilation runs.
compilation_sandbox_max_processes = 1000
compilation_sandbox_max_time_s = 10.0
compilation_sandbox_max_memory_kib = 524_288 # 512 MiB
# Max processes, CPU time (s), memory (KiB) for trusted (e.g. checker)
# runs.
trusted_sandbox_max_processes = 1000
trusted_sandbox_max_time_s = 10.0
trusted_sandbox_max_memory_kib = 4_194_304 # 4 GiB
[web_server]
# This key is used to encode information that can be seen by the user,
# namely cookies and auto-incremented numbers. It should be changed for
# each contest. Particularly, you should not use this example for other
# than testing. It must be a 16 bytes long hexadecimal number. You can
# easily create a key calling:
# python -c 'from cmscommon import crypto; print(crypto.get_hex_random_key())'
secret_key = "8e045a51e4b102ea803c06f92841a1fb"
# Whether Tornado prints debug information on stdout.
tornado_debug = false
[contest_web_server]
# Listening HTTP addresses and ports for the CWSs listed above in
# [services]. By default only listens on localhost, meaning you need a
# separate reverse proxy to access it from the web. Set to empty string
# to allow connecting from anywhere.
listen_address = ["127.0.0.1"]
listen_port = [8888]
# Login cookie duration in seconds. The duration is refreshed on every
# manual request.
cookie_duration = 10800
# The number of proxies that will be crossed before CWSs get the
# request. This is used to decide whether to assume that the real source
# IP address is the one listed in the request headers or not. For
# example, if you're using nginx as a load balancer, you will likely
# want to set this value to 1.
num_proxies_used = 0
# If CWSs write submissions to disk before storing them in the DB, and
# where to save them. %s = DATA_DIR.
submit_local_copy = true
submit_local_copy_path = "%s/submissions/"
# Same for user tests.
tests_local_copy = true
tests_local_copy_path = "%s/tests/"
# Maximum size of a submission in bytes. If you use a proxy and set
# these sizes to large values remember to change client_max_body_size in
# nginx.conf too.
max_submission_length = 100_000
# Maximum size of an input file for an user test.
max_input_length = 5_000_000
# Path to the documentation exposed by CWS. To show a documentation link
# add a folder for each language with index.html inside. For example for
# C++ add 'cpp/index.html', for Java 'java/index.html'.
docs_path = "/usr/share/cms/docs"
# An authentication token that can be used by the administrator to
# impersonate an arbitrary user and bypass submit restrictions.
#contest_admin_token = "CHANGE-ME"
[admin_web_server]
# Listening HTTP address and port for the AWS. By default only listens
# on localhost, meaning you need a separate reverse proxy to access it
# from the web. Set to empty string to allow connecting from anywhere.
listen_address = "127.0.0.1"
listen_port = 8889
# Login cookie duration for admins in seconds.
# The duration is refreshed on every manual request.
cookie_duration = 36000
# The number of proxies that will be crossed before AWS gets
# the request. This is used to determine the request's real
# source IP address. For example, if you're using nginx as
# a proxy, you will likely want to set this value to 1.
num_proxies_used = 0
[proxy_service]
# List of URLs (with embedded username and password) of the RWSs where
# the scores are to be sent. Don't include the load balancing proxy (if
# any), just the backends.
rankings = ["http://usern4me:passw0rd@localhost:8890/"]
# If any ranking uses HTTPS, specify a file with the certificates you
# trust. (this string is passed as the "verify" option to requests.put,
# see the documentation of requests for more info.)
#https_certfile = "..."
[prometheus]
# Listening HTTP address and port for the exporter. If exposed this may
# leak private information, make sure to secure this endpoint.
listen_address = "127.0.0.1"
listen_port = 8811
# Bot token and chat ID for the telegram bot. The Telegram bot will sync
# all questions with this chat, if present.
#[telegram_bot]
#bot_token = "..."
#chat_id = "..."