9 Configuration

The configuration of the OptServer is stored in a single flat JSON file. Following keys are recognized:

address <string>

Host and port, in the format HOST:PORT. If HOST is left blank then localhost is used

basedir <string>

Work directory.

certdir <string>

Directory containing key.pem and cert.pem.

externdir <string>

Directory containing passive files (css, javascript, images etc.) that is required by the web pages

enable-login <true|false>

Enable login and management.

enable-management <true|false>

Enable management, even when login is disabled. Forced to true if enable-login is true

enable-anonymous-submit <true|false>

Allow submitting tasks without authentication.

login-expiry <integer>

Expiry of login session in seconds.

password-salt <string>

Name of the file used for password salting.

cmd <string>

The command executed to solve problems.

The cmd key allows for variable substitution using ${...}. Following variables are recognized:

  • TASK Name of the problem file.
  • WORKDIR Name of the working directory for the task.

If a key is not specified, then its default value, if any, is used.

The default configuration is stored in the server.conf file and reported in Listing 14.

Listing 14 The OptServer default configuration.
 "address"       : ":30080",
 "basedir"       : "run",
 "externdir"     : "../management/extern",
 "logfile"       : "run/server.log",
 "pidfile"       : "run/PID",
 "cmd"           : "${CONFIGDIR}/script/solve.py ${TASK}",
 "enable-login"  : true,
 "certdir"       : "security/cert",
 "password-salt" : "./run/salt"