forked from bogdan2412/infoarena
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConfig.php.sample
More file actions
209 lines (175 loc) · 6.6 KB
/
Config.php.sample
File metadata and controls
209 lines (175 loc) · 6.6 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
201
202
203
204
205
206
207
208
209
<?php
require_once __DIR__ . '/lib/Request.php';
class Config {
// database connection
const DB_HOST = 'localhost';
const DB_NAME = 'nerdarena';
const DB_TEST_NAME = 'nerdarena_test';
const DB_USER = 'root';
const DB_PASSWORD = '';
const DB_KEEP_ALIVE = false;
const DB_UNBUFFERED = false;
const DB_COMMAND = 'mariadb';
const DB_DUMP_COMMAND = 'mariadb-dump';
// The concatenation URL_HOST + URL_PREFIX should yield the URL of the home
// page of your installation.
// protocol://host[:port] . No trailing slash.
const URL_HOST = 'http://localhost';
// URL path relative to URL_HOST. Include a trailing slash.
const URL_PREFIX = '/infoarena/www/';
// Filesystem root of this installation. Include a trailing slash.
const ROOT = __DIR__ . '/';
// Display settings. Database dates are always UTC.
const LOCALE = 'ro_RO.utf8';
const TIMEZONE = 'Europe/Bucharest';
const DATE_FORMAT = 'd MMMM yyyy HH:mm:ss';
// Replace all pages with a "maintenance mode" notice.
const MAINTENANCE_MODE = false;
// Activate some debugging tools and disable some external resources.
const DEVELOPMENT_MODE = true;
// Set to true while running functional tests.
const TESTING_MODE = false;
// Session duration in seconds.
const SESSION_DURATION = 5 * 86400;
// Logging and error settings.
const ERROR_REPORTING = E_ALL & ~E_USER_NOTICE;
const FATAL_ERROR_MASK = E_ALL & ~E_USER_NOTICE & ~E_USER_WARNING;
const LOG_SECURITY = false;
const LOG_DISK_CACHE = false;
const LOG_SQL_QUERIES = false;
const LOG_SQL_QUERIES_EXPLAIN = false;
const LOG_TIMESTAMP_FORMAT = 'Y-m-d H:i:s'; // empty for no timestamps
// Image resize info
const GEOMETRY = [
'big' => '150x150',
'normal' => '50x50',
'small' => '32x32',
'tiny' => '16x16',
'gallery' => 'x80',
];
// Security: roles needed for certains actions.
const SEC_VIEW_PRIVATE = ['admin'];
const SEC_REV_EDIT_PUBLIC = ['admin', 'helper'];
const SEC_REV_EDIT_OTHER = ['admin'];
const ROUND_TEXTBLOCK_PREFIX = 'runda/';
const TASK_TEXTBLOCK_PREFIX = 'problema/';
const USER_TEXTBLOCK_PREFIX = 'utilizator/';
// If true, prevent deleting tasks with attachments. Instead, require the
// user to explicitly delete all attachments first.
const SECURE_DELETION = true;
// Job monitor autorefresh options.
const MONITOR_AUTOREFRESH = false;
const MONITOR_AUTOREFRESH_INTERVAL = 5000; // milliseconds
// Page sizes for task tables.
const PAGE_SIZES = [ 20, 50, 100, 200 ];
const PAGE_SIZE = 50;
// Set this to something random.
const RESET_PASSWORD_SALT = '';
// Mail settings.
const SMTP_ENABLED = false;
const CONTACT_EMAIL = 'contact@your-site.com';
const SMTP_SERVER = 'tls://your-site.com:587'; // for outgoing emails
const EMAIL_IDENTITIES = [
'contact@your-site.com' => [
'username' => 'contact@your-site.com',
'name' => 'Your Site',
'password' => '1234',
],
];
// Engine ID of the Google custom search engine.
const GOOGLE_CSE_TOKEN = '';
// Various credits.
const SITE_NAME = 'NerdArena';
const COPYRIGHT_FIRST_YEAR = 2012;
const COPYRIGHT_OWNER = 'NerdArena';
const ABOUT_PAGE = 'despre-nerdarena';
// Settings for isolate, the IOI sandbox.
const ISOLATE_COMMAND = '/usr/local/bin/isolate';
const ISOLATE_BOX = '/var/local/lib/isolate/0/box/';
const ISOLATE_META_FILE = self::ISOLATE_BOX . 'meta';
const ISOLATE_EXTRA_WALL_TIME_SEC = 0.5;
// Give programs some extra memory for page cache so they can read the input
// files. IsolateJail will find the page cache memory used and subtract it
// from the reported usage.
const ISOLATE_PAGE_CACHE_MEMORY = 4 * 1024; // 4 MB
const ISOLATE_STDOUT = 'isolate-stdout';
const ISOLATE_STDERR = 'isolate-stderr';
const CGROUP_MEMORY_STAT_FILE = '/sys/fs/cgroup/isolate/box-0/memory.stat';
/**
* Settings for the eval system.
**/
// Credentials for an admin account used via basic HTTP authentication to
// download tests and graders.
const EVAL_USERNAME = 'eval';
const EVAL_PASSWORD = 'eval';
// How often to poll the server for things to do, in seconds.
const EVAL_POLL_INTERVAL = 0.3;
// Where to save evaluated jobs. %d will be replaced by the job ID.
const EVAL_SAVE_DIR = self::ROOT . 'eval/jail/%d/';
// How many times to retry fetching files from the server.
const EVAL_DOWNLOAD_RETRIES = 5;
// Limits for compiler processes, in seconds / kilobytes.
const EVAL_COMPILE_TIME_LIMIT = 15.0;
const EVAL_COMPILE_MEMORY_LIMIT = 1024 * 1024; // 1 GiB
// Limits for grader processes, in seconds / kilobytes.
const EVAL_GRADER_TIME_LIMIT = 5.0;
const EVAL_GRADER_MEMORY_LIMIT = 1024 * 1024; // 1 GiB
// Should custom graders have access to the user source code? Useful when
// some tasks have syntax requirements (e.g. the solution may not use
// arrays).
const EVAL_GRADER_NEEDS_SOURCE = true;
// The most points a job can receive.
const EVAL_MAX_SCORE = 100;
// Maximum length allowed for a grader's feedback message.
const EVAL_MAX_GRADER_MESSAGE = 100;
// Compiler settings.
// enabled: Whether to accept new jobs for this language.
// mounts: Used for compilation only; not used for running the user program.
const COMPILERS = [
'c' => [
'enabled' => true,
'desc' => 'GNU C - 64bit',
'cmd' => '/usr/bin/gcc -m64 -DINFOARENA -Wall -O2 -static -std=c11 %src% -o %bin% -lm',
'extension' => 'c',
'mounts' => [
'lib', 'lib64', 'usr/bin', 'usr/include', 'usr/lib',
],
],
'cpp' => [
'enabled' => true,
'desc' => 'GNU C++ - 64bit',
'cmd' => '/usr/bin/g++ -m64 -DINFOARENA -Wall -O2 -static -std=c++14 %src% -o %bin% -lm',
'extension' => 'cpp',
'mounts' => [
'lib', 'lib64', 'usr/bin', 'usr/include', 'usr/lib',
],
],
'c-32' => [
'enabled' => true,
'desc' => 'GNU C - 32bit',
'cmd' => '/usr/bin/gcc -m32 -DINFOARENA -Wall -O2 -static -std=c11 %src% -o %bin% -lm',
'extension' => 'c',
'mounts' => [
'lib', 'lib64', 'usr/bin', 'usr/include', 'usr/lib', 'usr/lib32',
],
],
'cpp-32' => [
'enabled' => true,
'desc' => 'GNU C++ - 32bit',
'cmd' => '/usr/bin/g++ -m32 -DINFOARENA -Wall -O2 -static -std=c++14 %src% -o %bin% -lm',
'extension' => 'cpp',
'mounts' => [
'lib', 'lib64', 'usr/bin', 'usr/include', 'usr/lib', 'usr/lib32',
],
],
'pas' => [
'enabled' => true,
'desc' => 'Free Pascal',
'cmd' => '/usr/bin/fpc -O2 -Xs %src% -o%bin% -dINFOARENA',
'extension' => 'pas',
'mounts' => [
'lib', 'lib64', 'usr/bin', 'usr/lib',
],
],
];
}