%% Generated by Sphinx.
\def\sphinxdocclass{report}
\documentclass[a4paper,10pt,english,openany]{sphinxmanual}
\ifdefined\pdfpxdimen
   \let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
\fi \sphinxpxdimen=.75bp\relax
\ifdefined\pdfimageresolution
    \pdfimageresolution= \numexpr \dimexpr1in\relax/\sphinxpxdimen\relax
\fi
%% let collapsible pdf bookmarks panel have high depth per default
\PassOptionsToPackage{bookmarksdepth=5}{hyperref}

\PassOptionsToPackage{booktabs}{sphinx}
\PassOptionsToPackage{colorrows}{sphinx}

\PassOptionsToPackage{warn}{textcomp}
\usepackage[utf8]{inputenc}
\ifdefined\DeclareUnicodeCharacter
% support both utf8 and utf8x syntaxes
  \ifdefined\DeclareUnicodeCharacterAsOptional
    \def\sphinxDUC#1{\DeclareUnicodeCharacter{"#1}}
  \else
    \let\sphinxDUC\DeclareUnicodeCharacter
  \fi
  \sphinxDUC{00A0}{\nobreakspace}
  \sphinxDUC{2500}{\sphinxunichar{2500}}
  \sphinxDUC{2502}{\sphinxunichar{2502}}
  \sphinxDUC{2514}{\sphinxunichar{2514}}
  \sphinxDUC{251C}{\sphinxunichar{251C}}
  \sphinxDUC{2572}{\textbackslash}
\fi
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amstext}
\usepackage{babel}



\usepackage{tgtermes}
\usepackage{tgheros}
\renewcommand{\ttdefault}{txtt}



\usepackage[Bjarne]{fncychap}
\usepackage{sphinx}

\fvset{fontsize=auto}
\usepackage{geometry}


% Include hyperref last.
\usepackage{hyperref}
% Fix anchor placement for figures with captions.
\usepackage{hypcap}% it must be loaded after hyperref.
% Set up styles of URL: it should be placed after hyperref.
\urlstyle{same}

\addto\captionsenglish{\renewcommand{\contentsname}{Contents:}}

\usepackage{sphinxmessages}
\setcounter{tocdepth}{2}


\definecolor{VerbatimColor}{rgb}{0.95,0.95,0.95}
\definecolor{OuterLinkColor}{rgb}{0,0,1}
\definecolor{noteBgColor}{rgb}{1,0,1}

\definecolor{sphinxnoteBgColor}{RGB}{221,233,239}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\familydefault}{\sfdefault}

% Begin new paragraphs without indentation but vertical space.
\setlength{\parindent}{0pt}
\setlength{\parskip}{1.5ex plus 0.5ex minus 0.2ex}
\usepackage{titlesec}

% No chapter numbers.
\renewcommand{\thesection}{\arabic{section}}



\title{DOMjudge Documentation}
\date{2024}
\release{8.3.1}
\author{DOMjudge Team}
\newcommand{\sphinxlogo}{\vbox{}}
\renewcommand{\releasename}{Release}
\makeindex
\begin{document}

\ifdefined\shorthandoff
  \ifnum\catcode`\=\string=\active\shorthandoff{=}\fi
  \ifnum\catcode`\"=\active\shorthandoff{"}\fi
\fi

\pagestyle{empty}

\pagestyle{plain}

\pagestyle{normal}
\phantomsection\label{\detokenize{index::doc}}


\sphinxstepscope


\section{Overview}
\label{\detokenize{overview:overview}}\label{\detokenize{overview::doc}}
\sphinxAtStartPar
DOMjudge is a system for running programming contests, like the ICPC
regional and world finals programming contests.

\sphinxAtStartPar
This usually means that teams are on\sphinxhyphen{}site and have a fixed time period (mostly
5 hours) and one computer to solve a number of problems (mostly 8\sphinxhyphen{}12). Problems
are solved by writing a program in one of the allowed languages, that reads
input according to the problem input specification and writes the correct,
corresponding output.

\sphinxAtStartPar
The judging is done by submitting the source code of the solution to the jury.
There the jury system automatically compiles and runs the program and compares
the program output with the expected output.

\sphinxAtStartPar
This software can be used to handle the submission and judging during such
contests. It also handles feedback to the teams and communication on problems
(clarification requests). It has web interfaces for the jury, the teams (their
submissions and clarification requests) and the public (scoreboard).


\subsection{Features}
\label{\detokenize{overview:features}}
\sphinxAtStartPar
A global overview of the features that DOMjudge provides:
\begin{itemize}
\item {} 
\sphinxAtStartPar
Automatic judging with distributed (scalable) judge hosts

\item {} 
\sphinxAtStartPar
Web interface for portability and simplicity

\item {} 
\sphinxAtStartPar
Modular system for plugging in languages/compilers and validators

\item {} 
\sphinxAtStartPar
Detailed jury information (submissions, judgings, diffs)
and options (rejudge, clarifications, resubmit)

\item {} 
\sphinxAtStartPar
Designed with security in mind

\end{itemize}

\sphinxAtStartPar
DOMjudge has been used in many live contests
(see \sphinxurl{https://www.domjudge.org/about} for an overview) and
is Open Source, Free Software.


\subsection{Requirements and contest planning}
\label{\detokenize{overview:requirements-and-contest-planning}}
\sphinxAtStartPar
DOMjudge requires the following to be available to run. Please refer to the
{\hyperref[\detokenize{install-domserver::doc}]{\sphinxcrossref{\DUrole{doc}{DOMserver}}}} and {\hyperref[\detokenize{install-judgehost::doc}]{\sphinxcrossref{\DUrole{doc}{Judgehost}}}}
chapters for detailed software requirements.
\begin{itemize}
\item {} 
\sphinxAtStartPar
At least one machine to act as the \sphinxstyleemphasis{DOMjudge server} (or \sphinxstyleemphasis{domserver} for
brevity). The machine needs to be running Linux (or possibly a Unix
variant) and a webserver with PHP 8.1.0 or newer. A MySQL or MariaDB
database is also needed.

\item {} 
\sphinxAtStartPar
A number of machines to act as \sphinxstyleemphasis{judgehosts} (at least one). They need to run
Linux with (sudo) root access. Required software is the PHP commandline
client and compilers for the languages you want to support.

\item {} 
\sphinxAtStartPar
\sphinxstyleemphasis{Team workstations}, one for each team. They require only a modern
web browser to interface with DOMjudge, but of course need a local
development environment for teams to develop and test solutions. Optionally
these have the DOMjudge submit client installed.

\item {} 
\sphinxAtStartPar
\sphinxstyleemphasis{Jury / admin workstations}. The jury members (persons) that want to
configure and monitor the contest need just any workstation with a web
browser to access the web interface. No DOMjudge software runs on these
machines.

\end{itemize}

\sphinxAtStartPar
One (virtual) machine is required to run the DOMserver. The minimum amount of
judgehosts is also one, but preferably more: depending on configured timelimits,
and the amount of testcases per problem, judging one solution can tie up a
judgehost for several minutes, and if there’s a problem with one judgehost it
can be resolved while judging continues on the others.

\sphinxAtStartPar
As a rule of thumb, we recommend one judgehost per 20 teams.

\sphinxAtStartPar
However, overprovisioning does not hurt: DOMjudge scales easily in the number
of judgehosts, so if hardware is available, by all means use it. But running a
contest with fewer machines will equally work well, only the waiting time for
teams to receive an answer may increase.

\sphinxAtStartPar
Each judgehost should be a dedicated (virtual) machine that performs no other
tasks. For example, although running a judgehost on the same machine as the
domserver is possible, it’s not recommended except for testing purposes.
Judgehosts should also not double as local workstations for jury members.
Having all judgehosts be of uniform hardware configuration helps in creating a
fair, {\hyperref[\detokenize{judging:judging-consistency}]{\sphinxcrossref{\DUrole{std,std-ref}{reproducible setup}}}}; in the ideal case
they are run on the same type of machines that the teams use.

\sphinxAtStartPar
DOMjudge supports running {\hyperref[\detokenize{config-advanced:multiple-judgedaemons}]{\sphinxcrossref{\DUrole{std,std-ref}{multiple judgedaemons}}}}
in parallel on a single judgehost machine. This might be useful on multi\sphinxhyphen{}core
machines.

\begin{sphinxadmonition}{warning}{Warning:}
\sphinxAtStartPar
The judgehost requires Linux cgroup support for memory and swap accounting.
Platforms that do not provide this support (some virtualization environments,
for example WSL 1) will not work with the judgehost. See our \sphinxhref{https://github.com/DOMjudge/domjudge/wiki/Running-DOMjudge-in-WSL}{wiki} for information about DOMjudge and WSL.
\end{sphinxadmonition}


\subsection{Copyright and licencing}
\label{\detokenize{overview:copyright-and-licencing}}
\sphinxAtStartPar
DOMjudge is Copyright (c) 2004 \sphinxhyphen{} 2024 by the DOMjudge developers and contributors.

\sphinxAtStartPar
DOMjudge, including its documentation, is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at your
option) any later version. See the file COPYING for details.

\sphinxAtStartPar
Please see the file CONTRIBUTORS.md in the code repository for a list
of people who have contributed to DOMjudge.

\sphinxAtStartPar
This software is partly based on code by other people. Please refer to
individual files for acknowledgements.


\subsection{About the name and logo}
\label{\detokenize{overview:about-the-name-and-logo}}
\noindent{\hspace*{\fill}\sphinxincludegraphics[width=100\sphinxpxdimen]{{DOMjudgelogo}.pdf}}

\sphinxAtStartPar
The name of this judging system is inspired by a very important and well known
landmark in the city of Utrecht: the Dom tower.  The logo of the 2004 Dutch
Programming Championships (for which this system was originally developed)
depicts a representation of the Dom in zeros and ones. We based the name and
logo of DOMjudge on that.

\sphinxAtStartPar
We would like to thank Erik van Sebille, the original creator of the logo. The
logo is under a GPL licence, although Erik first suggested a “free as in beer”
licence first: you’re allowed to use it, but you owe Erik a free beer in case
might you encounter him.


\subsection{Contact}
\label{\detokenize{overview:contact}}
\sphinxAtStartPar
The DOMjudge homepage can be found at: \sphinxurl{https://www.domjudge.org/}

\sphinxAtStartPar
We have a low volume \sphinxhref{https://www.domjudge.org/mailman/postorius/lists/domjudge-announce.domjudge.org/}{mailing list for announcements}
of new releases.
The authors can be reached through the development mailing list.
You need to be subscribed before you can post. See the
\sphinxhref{https://www.domjudge.org/mailman/postorius/lists/domjudge-devel.domjudge.org/}{development list information page}
for subscription and more details.

\sphinxAtStartPar
There is a wiki which collects other pieces of information about
specific configurations or integrations:
\sphinxurl{https://github.com/DOMjudge/domjudge/wiki}

\sphinxAtStartPar
DOMjudge has a \sphinxhref{https://www.domjudge.org/chat}{Slack workspace}
where a number of developers and users of
DOMjudge linger. Feel free to drop by with your questions and comments,
but note that it may sometimes take a bit longer than a few minutes to
get a response, partly because people might be in different timezones.

\sphinxstepscope


\section{Installation of the DOMserver}
\label{\detokenize{install-domserver:installation-of-the-domserver}}\label{\detokenize{install-domserver::doc}}
\sphinxAtStartPar
The DOMjudge server (short DOMserver) is the central entity that runs
the DOMjudge web interface and API that teams, jury members and the
judgehosts connect to.


\subsection{Requirements}
\label{\detokenize{install-domserver:requirements}}\label{\detokenize{install-domserver:domserver-requirements}}

\subsubsection{System requirements}
\label{\detokenize{install-domserver:system-requirements}}\begin{itemize}
\item {} 
\sphinxAtStartPar
The operating system is Linux or another Unix variant. DOMjudge has mostly
been tested with Debian and Ubuntu on AMD64, but should work on other environments.
See our \sphinxhref{https://github.com/DOMjudge/domjudge/wiki/Running-DOMjudge-in-WSL}{wiki} for information about DOMjudge and WSLv2.

\item {} 
\sphinxAtStartPar
It is probably necessary that you have root access to be able to install
the necessary components, but it’s not required for actually running the
DOMserver.

\item {} 
\sphinxAtStartPar
A TCP/IP network which connects the DOMserver and the judgehosts, and
DOMjudge and the team workstations. All of these machines only need HTTP(S)
access to the DOMserver.

\end{itemize}


\subsubsection{Software requirements}
\label{\detokenize{install-domserver:software-requirements}}\begin{itemize}
\item {} 
\sphinxAtStartPar
A web server with support for PHP \textgreater{}= 8.1.0 and the \sphinxcode{\sphinxupquote{mysqli}}, \sphinxcode{\sphinxupquote{curl}}, \sphinxcode{\sphinxupquote{gd}},
\sphinxcode{\sphinxupquote{mbstring}}, \sphinxcode{\sphinxupquote{intl}}, \sphinxcode{\sphinxupquote{zip}}, \sphinxcode{\sphinxupquote{xml}} and \sphinxcode{\sphinxupquote{json}} extensions for PHP.

\item {} 
\sphinxAtStartPar
MySQL or MariaDB database. This can be on the same machine, but for
advanced setups can also run on a dedicated machine.

\item {} 
\sphinxAtStartPar
An NTP daemon, for keeping the clocks between jury system and team
workstations in sync.

\end{itemize}

\sphinxAtStartPar
For your convenience, the following command will install the necessary
software on the DOMjudge server as mentioned above when using Debian
GNU/Linux, or one of its derivative distributions like Ubuntu:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{apt} \PYG{n}{install} \PYG{n}{libcgroup}\PYG{o}{\PYGZhy{}}\PYG{n}{dev} \PYG{n}{make} \PYG{n}{acl} \PYG{n+nb}{zip} \PYG{n}{unzip} \PYG{n}{pv} \PYG{n}{mariadb}\PYG{o}{\PYGZhy{}}\PYG{n}{server} \PYG{n}{apache2} \PYGZbs{}
      \PYG{n}{php} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{fpm} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{gd} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{cli} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{intl} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{mbstring} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{mysql} \PYGZbs{}
      \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{curl} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{json} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{xml} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n+nb}{zip} \PYG{n}{composer} \PYG{n}{ntp} \PYG{n}{python3}\PYG{o}{\PYGZhy{}}\PYG{n}{yaml}
\end{sphinxVerbatim}

\sphinxAtStartPar
The following command can be used on Fedora, and related distributions like
Red Hat Enterprise Linux and Rocky Linux (before V9):

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{dnf} \PYG{n}{install} \PYG{n}{libcgroup}\PYG{o}{\PYGZhy{}}\PYG{n}{devel} \PYG{n}{make} \PYG{n}{acl} \PYG{n+nb}{zip} \PYG{n}{unzip} \PYG{n}{pv} \PYG{n}{mariadb}\PYG{o}{\PYGZhy{}}\PYG{n}{server} \PYG{n}{httpd} \PYGZbs{}
      \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{gd} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{cli} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{intl} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{mbstring} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{mysqlnd} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{fpm} \PYGZbs{}
      \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{xml} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n+nb}{zip} \PYG{n}{composer} \PYG{n}{chronyd} \PYG{n}{python3}\PYG{o}{\PYGZhy{}}\PYG{n}{pyyaml}
\end{sphinxVerbatim}

\sphinxAtStartPar
\sphinxtitleref{nginx} can be used as an alternate web server.

\sphinxAtStartPar
The packages \sphinxtitleref{libcgroup\sphinxhyphen{}dev} (\sphinxtitleref{libcgroup\sphinxhyphen{}devel} on Fedora) and \sphinxtitleref{make} are
{\hyperref[\detokenize{install-judgehost:judgehost-software}]{\sphinxcrossref{\DUrole{std,std-ref}{judgehost software requirements}}}}, but also
needed here due to \sphinxtitleref{issue 862 \textless{}https://github.com/DOMjudge/domjudge/issues/862\textgreater{}}.


\subsection{Installation}
\label{\detokenize{install-domserver:installation}}
\sphinxAtStartPar
These instructions assume a \sphinxhref{https://www.domjudge.org/download}{tarball}, see {\hyperref[\detokenize{develop:bootstrap}]{\sphinxcrossref{\DUrole{std,std-ref}{this section}}}}
for instructions to build from git sources.

\sphinxAtStartPar
The DOMjudge build/install system consists of a \sphinxcode{\sphinxupquote{configure}}
script and makefiles, but when installing it, some more care has to be
taken than simply running \sphinxcode{\sphinxupquote{./configure \&\& make \&\& make install}}.

\sphinxAtStartPar
After installing the required software as described above, run configure.
In this example to install DOMjudge in the directory \sphinxcode{\sphinxupquote{domjudge}} under
\sphinxtitleref{/opt}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{.}\PYG{o}{/}\PYG{n}{configure} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{prefix}\PYG{o}{=}\PYG{o}{/}\PYG{n}{opt}\PYG{o}{/}\PYG{n}{domjudge}
\PYG{n}{make} \PYG{n}{domserver}
\PYG{n}{sudo} \PYG{n}{make} \PYG{n}{install}\PYG{o}{\PYGZhy{}}\PYG{n}{domserver}
\end{sphinxVerbatim}

\sphinxAtStartPar
Note that root privileges are required to set permissions and user and
group ownership of password files and a few directories. If you run
the installation targets as non\sphinxhyphen{}root, you will be shown how to perform
these steps manually.


\subsection{Database configuration}
\label{\detokenize{install-domserver:database-configuration}}
\sphinxAtStartPar
DOMjudge uses a MySQL or MariaDB database server for information storage.
Where this document talks about MySQL, it can be understood to also apply
to MariaDB.

\sphinxAtStartPar
Installation of the database is done with \sphinxcode{\sphinxupquote{bin/dj\_setup\_database}}.
For this, you need an installed and configured MySQL server and
administrator access to it. Run:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{dj\PYGZus{}setup\PYGZus{}database} \PYG{n}{genpass}
\PYG{n}{dj\PYGZus{}setup\PYGZus{}database} \PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{n}{u} \PYG{o}{\PYGZlt{}}\PYG{n}{mysql} \PYG{n}{admin} \PYG{n}{user}\PYG{o}{\PYGZgt{}}\PYG{p}{]} \PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{n}{p} \PYG{o}{\PYGZlt{}}\PYG{n}{password}\PYG{o}{\PYGZgt{}}\PYG{o}{|}\PYG{o}{\PYGZhy{}}\PYG{n}{r}\PYG{p}{]} \PYG{n}{install}
\end{sphinxVerbatim}

\sphinxAtStartPar
This first creates the DOMjudge database credentials file
\sphinxcode{\sphinxupquote{etc/dbpasswords.secret}} if it does not exist already.

\sphinxAtStartPar
Then it creates the database and user and inserts some
default/example data into the domjudge database. The option
\sphinxcode{\sphinxupquote{\sphinxhyphen{}r}} will prompt for a password for mysql; when no user is
specified, the mysql client will try to read
credentials from \sphinxcode{\sphinxupquote{\$HOME/.my.cnf}} as usual. The command
\sphinxcode{\sphinxupquote{uninstall}} can be passed to \sphinxcode{\sphinxupquote{dj\_setup\_database}} to
remove the DOMjudge database and users; \sphinxstyleemphasis{this deletes all data}!

\sphinxAtStartPar
The script also creates the initial “admin” user with password
stored in \sphinxcode{\sphinxupquote{etc/initial\_admin\_password.secret}}.


\subsection{Web server configuration}
\label{\detokenize{install-domserver:web-server-configuration}}
\sphinxAtStartPar
For the web interface, you need to have a web server (e.g. nginx or Apache)
installed on the DOMserver and made sure that PHP correctly works
with it. Refer to the documentation of your web server and PHP for
details. In the examples below, replace {\color{red}\bfseries{}|phpversion|} with the PHP version
you’re installing.

\sphinxAtStartPar
To configure the Apache web server for DOMjudge, use the Apache
configuration snippet from \sphinxcode{\sphinxupquote{etc/apache.conf}}. It contains
examples for configuring the DOMjudge pages with an alias directive,
or as a virtualhost, optionally with TLS; it also contains PHP and security
settings. Reload the web server for changes to take effect.
\begin{sphinxalltt}
ln \sphinxhyphen{}s \textless{}DOMSERVER\_INSTALL\_PATH\textgreater{}/etc/apache.conf /etc/apache2/conf\sphinxhyphen{}available/domjudge.conf
ln \sphinxhyphen{}s \textless{}DOMSERVER\_INSTALL\_PATH\textgreater{}/etc/domjudge\sphinxhyphen{}fpm.conf /etc/php/{\color{red}\bfseries{}|phpversion|}/fpm/pool.d/domjudge.conf
a2enmod proxy\_fcgi setenvif rewrite
a2enconf php{\color{red}\bfseries{}|phpversion|}\sphinxhyphen{}fpm domjudge
\# Edit the file /etc/apache2/conf\sphinxhyphen{}available/domjudge.conf and
\# /etc/php/{\color{red}\bfseries{}|phpversion|}/fpm/pool.d/domjudge.conf to your needs
service php{\color{red}\bfseries{}|phpversion|}\sphinxhyphen{}fpm reload
service apache2 reload
\end{sphinxalltt}

\sphinxAtStartPar
An nginx webserver configuration snippet is also provided in
\sphinxcode{\sphinxupquote{etc/nginx\sphinxhyphen{}conf}}.  You still need \sphinxcode{\sphinxupquote{htpasswd}} from \sphinxcode{\sphinxupquote{apache2\sphinxhyphen{}utils}}
though. To use this configuration, perform the following steps:
\begin{sphinxalltt}
ln \sphinxhyphen{}s \textless{}DOMSERVER\_INSTALL\_PATH\textgreater{}/etc/nginx\sphinxhyphen{}conf /etc/nginx/sites\sphinxhyphen{}enabled/domjudge
ln \sphinxhyphen{}s \textless{}DOMSERVER\_INSTALL\_PATH\textgreater{}/etc/domjudge\sphinxhyphen{}fpm.conf /etc/php/{\color{red}\bfseries{}|phpversion|}/fpm/pool.d/domjudge.conf
\# Edit the files /etc/nginx/sites\sphinxhyphen{}enabled/domjudge and
\# /etc/php/{\color{red}\bfseries{}|phpversion|}/fpm/pool.d/domjudge.conf to your needs
service php{\color{red}\bfseries{}|phpversion|}\sphinxhyphen{}fpm reload
service nginx reload
\end{sphinxalltt}

\sphinxAtStartPar
On Fedora, use the following nginx configuration steps:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{ln} \PYG{o}{\PYGZhy{}}\PYG{n}{s} \PYG{o}{\PYGZlt{}}\PYG{n}{DOMSERVER\PYGZus{}INSTALL\PYGZus{}PATH}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n}{etc}\PYG{o}{/}\PYG{n}{nginx}\PYG{o}{\PYGZhy{}}\PYG{n}{conf} \PYG{o}{/}\PYG{n}{etc}\PYG{o}{/}\PYG{n}{nginx}\PYG{o}{/}\PYG{n}{conf}\PYG{o}{.}\PYG{n}{d}\PYG{o}{/}\PYG{n}{nginx}\PYG{o}{\PYGZhy{}}\PYG{n}{conf}\PYG{o}{.}\PYG{n}{conf}
\PYG{n}{ln} \PYG{o}{\PYGZhy{}}\PYG{n}{s} \PYG{o}{\PYGZlt{}}\PYG{n}{DOMSERVER\PYGZus{}INSTALL\PYGZus{}PATH}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n}{etc}\PYG{o}{/}\PYG{n}{domjudge}\PYG{o}{\PYGZhy{}}\PYG{n}{fpm}\PYG{o}{.}\PYG{n}{conf} \PYG{o}{/}\PYG{n}{etc}\PYG{o}{/}\PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{fpm}\PYG{o}{.}\PYG{n}{d}\PYG{o}{/}\PYG{n}{domjudge}\PYG{o}{\PYGZhy{}}\PYG{n}{fpm}\PYG{o}{.}\PYG{n}{conf}
\PYG{c+c1}{\PYGZsh{} Edit the files \PYGZlt{}DOMSERVER\PYGZus{}INSTALL\PYGZus{}PATH\PYGZgt{}/etc/nginx\PYGZhy{}conf and}
\PYG{c+c1}{\PYGZsh{} \PYGZlt{}DOMSERVER\PYGZus{}INSTALL\PYGZus{}PATH\PYGZgt{}/etc/domjudge\PYGZhy{}fpm.conf to your needs}
\PYG{n}{systemctl} \PYG{n}{restart} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{fpm}\PYG{o}{.}\PYG{n}{service}
\PYG{n}{systemctl} \PYG{n}{restart} \PYG{n}{nginx}\PYG{o}{.}\PYG{n}{service}
\end{sphinxVerbatim}

\sphinxAtStartPar
The judgehosts connect to DOMjudge via the DOMjudge API so need
to be able to access at least this part of the web interface.


\subsection{Running behind a proxy or loadbalancer}
\label{\detokenize{install-domserver:running-behind-a-proxy-or-loadbalancer}}
\sphinxAtStartPar
When running the DOMserver behind a proxy or loadbalancer, you might still want
to have the webserver and/or the DOMserver know the original client IP. By
default DOMjudge and the webserver (both nginx and Apache) will not use the
client IP, but rather the IP of the proxy / loadbalancer.

\sphinxAtStartPar
The preferred way to do this is in the webserver configuration. See
\sphinxcode{\sphinxupquote{/etc/apache2/conf\sphinxhyphen{}available/domjudge.conf}} for Apache and
\sphinxcode{\sphinxupquote{/etc/nginx/sites\sphinxhyphen{}enabled/domjudge}} for nginx. Look for \sphinxcode{\sphinxupquote{loadbalancer}}
in the file. When using this approach both the webserver and DOMjudge itself
will know the actual IP of the client.

\sphinxAtStartPar
If you cannot edit the webserver configuration for some reason, there is an
alternative way to configure this. Edit the file \sphinxcode{\sphinxupquote{webapp/.env.local}} (create
it if it does not exist) and add a line in the form of:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{TRUSTED\PYGZus{}PROXIES}\PYG{o}{=}\PYG{l+m+mf}{1.2}\PYG{l+m+mf}{.3}\PYG{l+m+mf}{.4}
\end{sphinxVerbatim}

\sphinxAtStartPar
Where \sphinxcode{\sphinxupquote{1.2.3.4}} is the IP address of the proxy or loadbalancer. You can set
multiple IP addresses by separating them by a comma (\sphinxcode{\sphinxupquote{,}}). The drawback to
this approach is that the webserver is not aware of the actual client IP. This
means that access logs for the webserver will still report the IP of the proxy
or loadbalancer.


\subsection{Log in to DOMjudge}
\label{\detokenize{install-domserver:log-in-to-domjudge}}
\sphinxAtStartPar
The DOMserver should now be operational. You can access the web application
at your configured base URL. There’s an \sphinxcode{\sphinxupquote{admin}} user with initial password
found in \sphinxcode{\sphinxupquote{etc/initial\_admin\_password.secret}}.

\sphinxAtStartPar
You can continue now with
{\hyperref[\detokenize{install-judgehost::doc}]{\sphinxcrossref{\DUrole{doc}{installing one or more judgehosts}}}}.

\sphinxstepscope


\section{Installation of the judgehosts}
\label{\detokenize{install-judgehost:installation-of-the-judgehosts}}\label{\detokenize{install-judgehost::doc}}
\sphinxAtStartPar
A DOMjudge installation requires one or more judgehosts which will perform
the actual compilation and evaluation of submissions.


\subsection{Requirements}
\label{\detokenize{install-judgehost:requirements}}\label{\detokenize{install-judgehost:judgehost-requirements}}

\subsubsection{System requirements}
\label{\detokenize{install-judgehost:system-requirements}}\begin{itemize}
\item {} 
\sphinxAtStartPar
The operating system is a Linux variant. DOMjudge has mostly
been tested with Debian and Ubuntu on AMD64, but should work on other environments.
See our \sphinxhref{https://github.com/DOMjudge/domjudge/wiki/Running-DOMjudge-in-WSL}{wiki} for information about DOMjudge and WSLv2.

\item {} 
\sphinxAtStartPar
It is necessary that you have root access.

\item {} 
\sphinxAtStartPar
A TCP/IP network which connects the DOMserver and the judgehosts.
The machines only need HTTP(S) access to the DOMserver.

\end{itemize}


\subsubsection{Software requirements}
\label{\detokenize{install-judgehost:software-requirements}}\label{\detokenize{install-judgehost:judgehost-software}}\begin{itemize}
\item {} 
\sphinxAtStartPar
Sudo

\item {} 
\sphinxAtStartPar
Debootstrap

\item {} 
\sphinxAtStartPar
PHP command line interface with the \sphinxcode{\sphinxupquote{curl}}, \sphinxcode{\sphinxupquote{json}}, \sphinxcode{\sphinxupquote{xml}},
\sphinxcode{\sphinxupquote{zip}} extensions.

\item {} 
\sphinxAtStartPar
A C/C++ compiler, the instructions below suggest \sphinxcode{\sphinxupquote{gcc}}/\sphinxcode{\sphinxupquote{g++}} but something
else such as \sphinxcode{\sphinxupquote{clang}} will also work.

\end{itemize}

\sphinxAtStartPar
For Debian:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{apt} \PYG{n}{install} \PYG{n}{make} \PYG{n}{pkg}\PYG{o}{\PYGZhy{}}\PYG{n}{config} \PYG{n}{sudo} \PYG{n}{debootstrap} \PYG{n}{libcgroup}\PYG{o}{\PYGZhy{}}\PYG{n}{dev} \PYGZbs{}
      \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{cli} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{curl} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{json} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{xml} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n+nb}{zip} \PYG{n}{lsof} \PYG{n}{procps} \PYG{n}{gcc} \PYG{n}{g}\PYG{o}{+}\PYG{o}{+}
\end{sphinxVerbatim}

\sphinxAtStartPar
For RHEL 7/Fedora %
\begin{footnote}[*]\sphinxAtStartFootnote
Building on RHEL8, RHEL9 (or the CentOS, Rockylinux \& Almalinux versions)
requires packages which are currently not in the repositories.
%
\end{footnote}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{dnf} \PYG{n}{install} \PYG{n}{make} \PYG{n}{pkgconfig} \PYG{n}{sudo} \PYG{n}{libcgroup}\PYG{o}{\PYGZhy{}}\PYG{n}{devel} \PYG{n}{lsof} \PYGZbs{}
      \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{cli} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{mbstring} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{xml} \PYG{n}{php}\PYG{o}{\PYGZhy{}}\PYG{n}{process} \PYG{n}{procps}\PYG{o}{\PYGZhy{}}\PYG{n}{ng} \PYG{n}{gcc} \PYG{n}{g}\PYG{o}{+}\PYG{o}{+} \PYGZbs{}
      \PYG{n}{glibc}\PYG{o}{\PYGZhy{}}\PYG{n}{static} \PYG{n}{libstdc}\PYG{o}{+}\PYG{o}{+}\PYG{o}{\PYGZhy{}}\PYG{n}{static}
\end{sphinxVerbatim}


\subsection{Removing apport}
\label{\detokenize{install-judgehost:removing-apport}}
\sphinxAtStartPar
Some systems (like Ubuntu) ship with \sphinxcode{\sphinxupquote{apport}}, which conflicts with judging.
To uninstall it, run:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{apt} \PYG{n}{remove} \PYG{n}{apport}
\end{sphinxVerbatim}


\subsection{Building and installing}
\label{\detokenize{install-judgehost:building-and-installing}}\label{\detokenize{install-judgehost:installing-judgehost}}
\sphinxAtStartPar
These instructions assume a release \sphinxhref{https://www.domjudge.org/download}{tarball}, see {\hyperref[\detokenize{develop:bootstrap}]{\sphinxcrossref{\DUrole{std,std-ref}{this section}}}}
for instructions to build from git sources.

\sphinxAtStartPar
After installing the software listed above, run configure. In this
example to install DOMjudge in the directory \sphinxcode{\sphinxupquote{domjudge}} under \sphinxtitleref{/opt}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{.}\PYG{o}{/}\PYG{n}{configure} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{prefix}\PYG{o}{=}\PYG{o}{/}\PYG{n}{opt}\PYG{o}{/}\PYG{n}{domjudge}
\PYG{n}{make} \PYG{n}{judgehost}
\PYG{n}{sudo} \PYG{n}{make} \PYG{n}{install}\PYG{o}{\PYGZhy{}}\PYG{n}{judgehost}
\end{sphinxVerbatim}

\sphinxAtStartPar
The judgedaemon can be run on various hardware configurations;
\begin{itemize}
\item {} 
\sphinxAtStartPar
A virtual machine, typically these have 1 or 2 cores and no hyperthreading, because the kernel will schedule its own tasks on CPU 0, we advice CPU 1,

\item {} 
\sphinxAtStartPar
A default office machine, these sometimes have hyperthreading. Verify if the machine has hyperthreading and consider turning it off and as a rule of thumb pick CPU 2 as CPU 1 could be a hyperthreading core, be on the same die as CPU 0 and therefore share memory with that CPU. If more cores available as a rule of thumb moving to the highest CPU should be considered.

\item {} 
\sphinxAtStartPar
Multiple on a single high\sphinxhyphen{}grade server with multiple CPUs or a CPU with multiple cores. Check for hyperthreading and if possible run the judgedaemons on separate CPU packages/dies both from each other and when possible different from CPU 0. See the section {\hyperref[\detokenize{config-advanced:multiple-judgedaemons}]{\sphinxcrossref{\DUrole{std,std-ref}{Multiple judgedaemons per machine}}}} for running multiple judgedaemons on a single host.

\end{itemize}

\sphinxAtStartPar
For the next section we assume a machine with possibly hyperthreading and 3 or more CPUs. This can be checked with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{lscpu} \PYG{o}{|} \PYG{n}{grep} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Thread(s) per core}\PYG{l+s+s2}{\PYGZdq{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
having a value above 1 indicates hyperthreading or:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{cat} \PYG{o}{/}\PYG{n}{sys}\PYG{o}{/}\PYG{n}{devices}\PYG{o}{/}\PYG{n}{system}\PYG{o}{/}\PYG{n}{cpu}\PYG{o}{/}\PYG{n}{smt}\PYG{o}{/}\PYG{n}{active}
\end{sphinxVerbatim}

\sphinxAtStartPar
a value of \sphinxtitleref{1} or \sphinxtitleref{on}. The target CPU core to restrict the judgedaemon to below should be in the range of:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{cat} \PYG{o}{/}\PYG{n}{sys}\PYG{o}{/}\PYG{n}{devices}\PYG{o}{/}\PYG{n}{system}\PYG{o}{/}\PYG{n}{cpu}\PYG{o}{/}\PYG{n}{online}
\end{sphinxVerbatim}

\sphinxAtStartPar
For running solution programs under a non\sphinxhyphen{}privileged user, a user and group have
to be added to the system that acts as judgehost. This user does not
need a home\sphinxhyphen{}directory or password, so the following command would
suffice to add a user and group \sphinxcode{\sphinxupquote{domjudge\sphinxhyphen{}run\sphinxhyphen{}2}} with minimal privileges
with the judgedaemon restricted to CPU core 2:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{groupadd} \PYG{n}{domjudge}\PYG{o}{\PYGZhy{}}\PYG{n}{run}
\PYG{n}{sudo} \PYG{n}{useradd} \PYG{o}{\PYGZhy{}}\PYG{n}{d} \PYG{o}{/}\PYG{n}{nonexistent} \PYG{o}{\PYGZhy{}}\PYG{n}{g} \PYG{n}{domjudge}\PYG{o}{\PYGZhy{}}\PYG{n}{run} \PYG{o}{\PYGZhy{}}\PYG{n}{M} \PYG{o}{\PYGZhy{}}\PYG{n}{s} \PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{false} \PYG{n}{domjudge}\PYG{o}{\PYGZhy{}}\PYG{n}{run}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}
\end{sphinxVerbatim}

\sphinxAtStartPar
The \sphinxcode{\sphinxupquote{\sphinxhyphen{}2}} suffix corresponds to a judgedaemon bound to CPU core 2
with the option \sphinxcode{\sphinxupquote{\sphinxhyphen{}n 2}}, see {\hyperref[\detokenize{install-judgehost:start-judgedaemon}]{\sphinxcrossref{\DUrole{std,std-ref}{Starting the judgedaemon}}}}. If you do not
want to bind the judgedaemon to a core, create a user \sphinxcode{\sphinxupquote{domjudge\sphinxhyphen{}run}}
and start the judgedaemon without \sphinxcode{\sphinxupquote{\sphinxhyphen{}n}} option.
See the section {\hyperref[\detokenize{config-advanced:multiple-judgedaemons}]{\sphinxcrossref{\DUrole{std,std-ref}{Multiple judgedaemons per machine}}}} for running multiple
judgedaemons on a single host.


\subsection{Sudo permissions}
\label{\detokenize{install-judgehost:sudo-permissions}}
\sphinxAtStartPar
The judgedaemon uses a wrapper to isolate programs when compiling
or running the submissions called \sphinxcode{\sphinxupquote{runguard}}. This wrapper needs
to be able to become root for certain operations like changing to the
runuser and performing a chroot. Also, the default
\sphinxcode{\sphinxupquote{chroot\sphinxhyphen{}startstop.sh}} script uses sudo to gain privileges for
certain operations. There’s a pregenerated snippet
in \sphinxcode{\sphinxupquote{etc/sudoers\sphinxhyphen{}domjudge}} that contains all required rules. You can
put this snippet in \sphinxcode{\sphinxupquote{/etc/sudoers.d/}}.

\sphinxAtStartPar
If you change the user you start the judgedaemon as, or the installation
paths, be sure to update the sudoers rules accordingly.


\subsection{Creating a chroot environment}
\label{\detokenize{install-judgehost:creating-a-chroot-environment}}\label{\detokenize{install-judgehost:make-chroot}}
\sphinxAtStartPar
The judgedaemon compiles and executes submissions inside a chroot
environment for security reasons. By default it mounts parts of a
prebuilt chroot tree read\sphinxhyphen{}only during this judging process (using
the script \sphinxcode{\sphinxupquote{lib/judge/chroot\sphinxhyphen{}startstop.sh}}). The chroot needs
to contain the compilers, interpreters and support libraries that
are needed at compile\sphinxhyphen{} and at runtime for the supported languages.

\sphinxAtStartPar
This chroot tree can be built using the script
\sphinxcode{\sphinxupquote{bin/dj\_make\_chroot}}. On Debian and Ubuntu the same
distribution and version as the host system are used, on other Linux
distributions the latest stable Debian release will be used to build
the chroot. Any extra packages to support languages (compilers and
runtime environments) can be passed with the option \sphinxcode{\sphinxupquote{\sphinxhyphen{}i}} or be
added to the \sphinxcode{\sphinxupquote{INSTALLDEBS}} variable in the script. The script
\sphinxcode{\sphinxupquote{bin/dj\_run\_chroot}} runs an interactive shell or a command inside
the chroot. This can be used for example to install new or upgrade
existing packages inside the chroot.
Run these scripts with option \sphinxcode{\sphinxupquote{\sphinxhyphen{}h}} for more information.

\sphinxAtStartPar
Finally, if necessary edit the script \sphinxcode{\sphinxupquote{lib/judge/chroot\sphinxhyphen{}startstop.sh}}
and adapt it to work with your local system. In case you changed the
default pre\sphinxhyphen{}built chroot directory, make sure to also update the sudo
rules and the \sphinxcode{\sphinxupquote{CHROOTORIGINAL}} variable in \sphinxcode{\sphinxupquote{chroot\sphinxhyphen{}startstop.sh}}.


\subsection{Linux Control Groups}
\label{\detokenize{install-judgehost:linux-control-groups}}
\sphinxAtStartPar
DOMjudge uses Linux Control Groups or \sphinxstyleemphasis{cgroups} for process isolation in
the judgedaemon. Linux cgroups give more accurate measurement of
actually allocated memory than traditional resource limits (which is
helpful with interpreters like Java that reserve but do not actually use
lots of memory). Also, cgroups are used to restrict network access so
no separate measures are necessary, and they allow running
{\hyperref[\detokenize{config-advanced:multiple-judgedaemons}]{\sphinxcrossref{\DUrole{std,std-ref}{multiple judgedaemons}}}}
on a multi\sphinxhyphen{}core machine by using CPU binding.

\sphinxAtStartPar
The judgedaemon needs to run a recent Linux kernel (at least 3.2.0). The
following steps configure cgroups on Debian. Instructions for other
distributions may be different (send us your feedback!).

\sphinxAtStartPar
Edit grub config to add cgroup memory and swap accounting to the boot
options. Edit \sphinxcode{\sphinxupquote{/etc/default/grub}} and change the default
commandline to
\sphinxcode{\sphinxupquote{GRUB\_CMDLINE\_LINUX\_DEFAULT="quiet cgroup\_enable=memory swapaccount=1"}}
Optionally the timings can be made more stable by not letting the OS schedule
any other tasks on the same CPU core the judgedaemon is using:
\sphinxcode{\sphinxupquote{GRUB\_CMDLINE\_LINUX\_DEFAULT="quiet cgroup\_enable=memory swapaccount=1 isolcpus=2"}}

\sphinxAtStartPar
On modern distros (e.g. Debian bullseye and Ubuntu Jammy Jellyfish) which have
cgroup v2 enabled by default, you need to add \sphinxcode{\sphinxupquote{systemd.unified\_cgroup\_hierarchy=0}}
as well. Then run \sphinxcode{\sphinxupquote{update\sphinxhyphen{}grub}} and reboot.
After rebooting check that \sphinxcode{\sphinxupquote{/proc/cmdline}} actually contains the
added kernel options. On VM hosting providers such as Google Cloud or
DigitalOcean, \sphinxcode{\sphinxupquote{GRUB\_CMDLINE\_LINUX\_DEFAULT}} may be overwritten
by other files in \sphinxcode{\sphinxupquote{/etc/default/grub.d/}}.

\sphinxAtStartPar
You have now configured the system to use cgroups. To create
the actual cgroups that DOMjudge will use, run:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{systemctl} \PYG{n}{enable} \PYG{n}{create}\PYG{o}{\PYGZhy{}}\PYG{n}{cgroups} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{now}
\end{sphinxVerbatim}

\sphinxAtStartPar
Note that this service will automatically be started if you use the
\sphinxcode{\sphinxupquote{domjudge\sphinxhyphen{}judgehost}} service, see below. Alternatively, you can
customize the script \sphinxcode{\sphinxupquote{judge/create\_cgroups}} as required and run it
after each boot.

\sphinxAtStartPar
The script \sphinxtitleref{jvm\_footprint} can be used to measure the memory overhead of the JVM for languages such as Kotlin and Java.


\subsection{REST API credentials}
\label{\detokenize{install-judgehost:rest-api-credentials}}
\sphinxAtStartPar
The judgehost connects to the domserver via a REST API. You need to
create an account in the DOMjudge web interface for the judgedaemons
to use (this may be a shared account between all judgedaemons) with
a difficult, random password and the ‘judgehost’ role.

\sphinxAtStartPar
On each judgehost, copy from the domserver (or create) a file
\sphinxcode{\sphinxupquote{etc/restapi.secret}} containing the id, URL,
username and password whitespace\sphinxhyphen{}separated on one line, for example:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{default} \PYG{n}{http}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{example}\PYG{o}{.}\PYG{n}{edu}\PYG{o}{/}\PYG{n}{domjudge}\PYG{o}{/}\PYG{n}{api}\PYG{o}{/}  \PYG{n}{judgehost}  \PYG{n}{MzfJYWF5agSlUfmiGEy5mgkfqU}
\end{sphinxVerbatim}

\sphinxAtStartPar
The exact URL to use can be found in the Config Checker in the
admin web interface; the password here must be identical to that of the
\sphinxcode{\sphinxupquote{judgehost}} user. Multiple lines may be specified to allow a
judgedaemon to work for multiple domservers. The id in the first column
is used to differentiate between multiple domservers, and should be
unique within the \sphinxcode{\sphinxupquote{restapi.secret}} file.


\subsection{Starting the judgedaemon}
\label{\detokenize{install-judgehost:starting-the-judgedaemon}}\label{\detokenize{install-judgehost:start-judgedaemon}}
\sphinxAtStartPar
Finally start the judgedaemon:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{judgedaemon} \PYG{o}{\PYGZhy{}}\PYG{n}{n} \PYG{l+m+mi}{2}
\end{sphinxVerbatim}

\sphinxAtStartPar
Upon its first connection to the domserver API, the judgehost will be
auto\sphinxhyphen{}registered and will be by default enabled. If you wish to
add a new judgehost but have it initially disabled, you can change the config
setting to automatically pause judges on first connection or manually add it
through the DOMjudge web interface and set it to disabled before starting
the judgedaemon.

\sphinxAtStartPar
The judgedaemon can also be run as a service by running:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{systemctl} \PYG{n}{enable} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{now} \PYG{n}{domjudge}\PYG{o}{\PYGZhy{}}\PYG{n}{judgehost}
\end{sphinxVerbatim}

\sphinxstepscope


\section{Installation of the team workstations}
\label{\detokenize{install-workstation:installation-of-the-team-workstations}}\label{\detokenize{install-workstation::doc}}
\sphinxAtStartPar
To access DOMjudge, a team workstation needs nothing more than a modern
webbrowser, like a recent version of Chrome, Firefox or Edge. We do not
support legacy browsers like Internet Explorer. Of course the machine
also needs the appropriate development tools for the languages you want
to support.

\sphinxAtStartPar
The web browser needs to access the domserver via HTTP(S). It may be
convenient to teams if the URL of DOMjudge is set as the default homepage,
and if using a self\sphinxhyphen{}signed HTTPS certificate, that the browser is made
to trust this certificate.


\subsection{Command line submit client}
\label{\detokenize{install-workstation:command-line-submit-client}}\label{\detokenize{install-workstation:submit-client-requirements}}
\sphinxAtStartPar
DOMjudge comes with a command line submit client which makes it really
convenient for teams to submit their solutions to DOMjudge.

\sphinxAtStartPar
In order to use the submit client, you need Python, the python requests
library and optionally the python magic library installed on the team’s
workstation. To install this on Debian\sphinxhyphen{}like distributions:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{apt} \PYG{n}{install} \PYG{n}{python3} \PYG{n}{python3}\PYG{o}{\PYGZhy{}}\PYG{n}{requests} \PYG{n}{python3}\PYG{o}{\PYGZhy{}}\PYG{n}{magic}
\end{sphinxVerbatim}

\sphinxAtStartPar
Or on RedHat/CentOS/Fedora:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{yum} \PYG{n}{install} \PYG{n}{python3} \PYG{n}{python3}\PYG{o}{\PYGZhy{}}\PYG{n}{requests} \PYG{n}{python3}\PYG{o}{\PYGZhy{}}\PYG{n}{magic}
\end{sphinxVerbatim}

\sphinxAtStartPar
You can now copy this client from \sphinxcode{\sphinxupquote{submit/submit}} to the workstations.

\sphinxAtStartPar
The submit client needs to know the base URL of the domserver where it should
submit to. You have three options to configure this:
\begin{itemize}
\item {} 
\sphinxAtStartPar
Set it as an environment variable called \sphinxcode{\sphinxupquote{SUBMITBASEURL}}, e.g. in
\sphinxcode{\sphinxupquote{/etc/profile.d/}}.

\item {} 
\sphinxAtStartPar
Modify the \sphinxcode{\sphinxupquote{submit/submit}} file and set the variable of \sphinxcode{\sphinxupquote{baseurl}}
at the top.

\item {} 
\sphinxAtStartPar
Let teams pass it using the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}url}} argument.

\end{itemize}

\sphinxAtStartPar
Note that the environment variable overrides the hardcoded variable at
the top of the file and the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}url}} argument overrides both other options.

\sphinxAtStartPar
The submit client will need to know to which contest to submit to. If there
is only one active contest, that will be used. If not, you have two options
to configure this:
\begin{itemize}
\item {} 
\sphinxAtStartPar
Set it as an environment variable called \sphinxcode{\sphinxupquote{SUBMITCONTEST}}, e.g. in
\sphinxcode{\sphinxupquote{/etc/profile.d/}}.

\item {} 
\sphinxAtStartPar
Let teams pass it using the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}contest}} argument.

\end{itemize}

\sphinxAtStartPar
Note that the \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}contest}} argument overrides the environment variable.

\sphinxAtStartPar
In order for the client to authenticate to DOMjudge, credentials can be
pre\sphinxhyphen{}provisioned in the file \sphinxcode{\sphinxupquote{\textasciitilde{}/.netrc}} in the user’s homedir, with example
content:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{machine} \PYG{n}{yourhost}\PYG{o}{.}\PYG{n}{example}\PYG{o}{.}\PYG{n}{edu} \PYG{n}{login} \PYG{n}{user0123} \PYG{n}{password} \PYG{n}{Fba}\PYG{o}{\PYGZca{}}\PYG{l+m+mi}{2}\PYG{n}{bHzz}
\end{sphinxVerbatim}

\sphinxAtStartPar
See the \sphinxhref{https://ec.haxx.se/usingcurl/usingcurl-netrc}{netrc manual page} for more details. You can run \sphinxcode{\sphinxupquote{./submit \sphinxhyphen{}\sphinxhyphen{}help}}
to inspect its configuration and options.


\subsection{Rebuilding team documentation}
\label{\detokenize{install-workstation:rebuilding-team-documentation}}
\sphinxAtStartPar
The source of the team manual can be found in \sphinxcode{\sphinxupquote{doc/manual/team.rst}}.
The team manual can incorporate specific settings of your environment,
most notably the URL of the DOMjudge installation. To achieve this,
rebuild the team manual \sphinxstyleemphasis{after} configuration of the system.

\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
A prebuilt team manual is included, but this contains
default/example values for site\sphinxhyphen{}specific configuration settings such
as the team web interface URL and judging settings such as the memory
limit. We strongly recommend rebuilding the team manual to include
site\sphinxhyphen{}specific settings and also to revise it to reflect your contest
specific environment and rules.
\end{sphinxadmonition}

\sphinxAtStartPar
When DOMjudge is configured and site\sphinxhyphen{}specific configuration set,
the team manual can be generated with the command \sphinxcode{\sphinxupquote{make docs}}.
The following should do it on a Debian\sphinxhyphen{}like system:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{apt} \PYG{n}{install} \PYG{n}{python}\PYG{o}{\PYGZhy{}}\PYG{n}{sphinx} \PYG{n}{python}\PYG{o}{\PYGZhy{}}\PYG{n}{sphinx}\PYG{o}{\PYGZhy{}}\PYG{n}{rtd}\PYG{o}{\PYGZhy{}}\PYG{n}{theme} \PYG{n}{rst2pdf} \PYG{n}{fontconfig} \PYG{n}{python3}\PYG{o}{\PYGZhy{}}\PYG{n}{yaml}
\PYG{n}{cd} \PYG{o}{\PYGZlt{}}\PYG{n}{INSTALL\PYGZus{}PATH}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n}{doc}\PYG{o}{/}
\PYG{n}{make} \PYG{n}{docs}
\end{sphinxVerbatim}

\sphinxAtStartPar
On Debian 11 and above, install
\sphinxcode{\sphinxupquote{python3\sphinxhyphen{}sphinx python3\sphinxhyphen{}sphinx\sphinxhyphen{}rtd\sphinxhyphen{}theme rst2pdf fontconfig python3\sphinxhyphen{}yaml}} instead.

\sphinxAtStartPar
The resulting manual will then be found in the \sphinxcode{\sphinxupquote{team/}} subdirectory.

\sphinxstepscope


\section{Upgrading}
\label{\detokenize{upgrading:upgrading}}\label{\detokenize{upgrading::doc}}
\sphinxAtStartPar
There is support to upgrade an existing DOMjudge installation to
a newer version.

\begin{sphinxadmonition}{warning}{Warning:}
\sphinxAtStartPar
Before you begin, it is always advised to backup the DOMjudge
database. We also advise to check the \sphinxcode{\sphinxupquote{ChangeLog}} file for
important changes.
\end{sphinxadmonition}

\sphinxAtStartPar
Upgrading the filesystem installation is probably best done by
installing the new version of DOMjudge in a separate place and
transferring the configuration settings from the old version.

\sphinxAtStartPar
After upgrading the files, you can run \sphinxcode{\sphinxupquote{dj\_setup\_database upgrade}}
to migrate the database.

\sphinxAtStartPar
If you have any active contests, we recommend to run “Refresh
scoreboard cache” from the DOMjudge web interface after the upgrade.


\subsection{Upgrading from pre\sphinxhyphen{}7.0 versions}
\label{\detokenize{upgrading:upgrading-from-pre-7-0-versions}}
\sphinxAtStartPar
The upgrade procedure described above works from DOMjudge 7.0
and above. This means that if you run an older DOMjudge version,
you first need to complete an upgrade to 7.0 before upgrading to
a newer version. See \sphinxurl{https://github.com/DOMjudge/domjudge/tree/7.0/sql/upgrade}
for instructions for upgrading to 7.0. When you have successfully
upgraded to 7.0, you can run the procedure above to reach the
current version.

\sphinxstepscope


\section{Configuring the system}
\label{\detokenize{config-basic:configuring-the-system}}\label{\detokenize{config-basic::doc}}
\sphinxAtStartPar
Configuration of the judge system is done by logging in as administrator
to the web interface.
The default username is \sphinxcode{\sphinxupquote{admin}} with initial password stored in
\sphinxcode{\sphinxupquote{etc/initial\_admin\_password.secret}}.

\sphinxAtStartPar
The general system settings can be accessed under
\sphinxstyleemphasis{Configuration settings}. Changes take effect immediately.


\subsection{Setting up users and teams}
\label{\detokenize{config-basic:setting-up-users-and-teams}}
\sphinxAtStartPar
Under \sphinxstyleemphasis{Users} from the homepage you can add user accounts for the
people accessing your system. There are several roles possible:
\begin{itemize}
\item {} 
\sphinxAtStartPar
Administrative user: can configure and change everything in DOMjudge.

\item {} 
\sphinxAtStartPar
Jury user: can view submissions and judgings. Can view
{\hyperref[\detokenize{running:clarifications}]{\sphinxcrossref{\DUrole{std,std-ref}{clarification requests}}}} and send clarifications.
Can {\hyperref[\detokenize{judging:rejudging}]{\sphinxcrossref{\DUrole{std,std-ref}{rejudge}}}} non\sphinxhyphen{}correct judgings (submissions judged
\sphinxstyleemphasis{correct} can only be rejudged by an administrator).

\item {} 
\sphinxAtStartPar
Balloon runner: can only view the {\hyperref[\detokenize{running:balloons}]{\sphinxcrossref{\DUrole{std,std-ref}{balloon queue}}}} and mark
balloons as delivered.

\item {} 
\sphinxAtStartPar
Team member: can view its own team interface and submit solutions
(see below).

\item {} 
\sphinxAtStartPar
Several system roles: they are for {\hyperref[\detokenize{develop:api}]{\sphinxcrossref{\DUrole{std,std-ref}{API}}}} access. The most important
one is \sphinxstyleemphasis{judgehost} which means the account credentials can be used by a
judgedaemon.

\end{itemize}

\sphinxAtStartPar
To set up teams, you can start in the \sphinxstyleemphasis{Teams} page and add teams there.
You then have the option to automatically create a corresponding user
account that is associated with the team.

\sphinxAtStartPar
It is also possible to use the \sphinxstyleemphasis{Import / Export} page to import
\sphinxhref{https://ccs-specs.icpc.io/2021-11/ccs\_system\_requirements\#teamstsv}{ICPC\sphinxhyphen{}compatible teams.tsv files} with teams.

\sphinxAtStartPar
A jury or administrative user can also be associated with a team. This
will enable that user to submit solutions to the system, or resubmit
edited team solutions.


\subsection{Resetting the password for a user}
\label{\detokenize{config-basic:resetting-the-password-for-a-user}}
\sphinxAtStartPar
If you do not have access anymore to any admin user, you can use the following
command to reset the password of a user to a random value:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{webapp}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{domjudge}\PYG{p}{:}\PYG{n}{reset}\PYG{o}{\PYGZhy{}}\PYG{n}{user}\PYG{o}{\PYGZhy{}}\PYG{n}{password} \PYG{n}{admin}
\end{sphinxVerbatim}

\sphinxAtStartPar
Replace \sphinxcode{\sphinxupquote{admin}} with the username of the user you want to reset the password for.
The password will be displayed.


\subsection{Adding a contest}
\label{\detokenize{config-basic:adding-a-contest}}
\sphinxAtStartPar
You configure a new contest by adding it under the Contests link
from the main page.

\sphinxAtStartPar
Besides the name the most important configuration about a contest
are the various time milestones.

\sphinxAtStartPar
A contest can be selected for viewing after its \sphinxstyleemphasis{activate time}, but
the scoreboard will only become visible to public and teams once the
contest \sphinxstyleemphasis{starts}. Thus no data such as problems and teams is revealed
before then.

\sphinxAtStartPar
When the contest \sphinxstyleemphasis{ends}, the scores will remain displayed until the
\sphinxstyleemphasis{deactivate time} passes.

\sphinxAtStartPar
DOMjudge has the option to ‘freeze’ the public and team scoreboards
at some point during the contest. This means that scores are no longer
updated and remain to be displayed as they were at the time of the
freeze. This is often done to keep the last hour interesting for all.
The scoreboard freeze time can be set with the \sphinxstyleemphasis{freezetime} milestone.

\sphinxAtStartPar
The scoreboard freezing works by looking at the time a submission is
made. Therefore it’s possible that submissions from (just) before the
freezetime but judged after it can still cause updates to the public
scoreboard. A rejudging during the freeze may also cause such updates.
The jury interface will however always show the actual
scoreboard.

\sphinxAtStartPar
Once the contest is over, the scores are not directly ‘unfrozen’.
You can release the final scores to team and public interfaces when the
time is right. You can do this either by setting a predefined
\sphinxstyleemphasis{unfreezetime} in the contest table, or you push the ‘unfreeze
now’ button in the jury web interface, under contests.

\sphinxAtStartPar
All events happen at the first moment of the defined time. That is:
for a contest with starttime “12:00:00” and endtime “17:00:00”, the
first submission will be accepted at 12:00:00 and the last one at
16:59:59.


\subsection{Setting up problems}
\label{\detokenize{config-basic:setting-up-problems}}
\sphinxAtStartPar
When this is done, you can upload the intended
problems that teams need to solve under \sphinxstyleemphasis{Problems}. DOMjudge supports
uploading them as {\hyperref[\detokenize{problem-format::doc}]{\sphinxcrossref{\DUrole{doc}{a zip file}}}} or configuring
each problem manually via the interface. You can add a problem to a
contest while uploading, or associate it by editing the contest
from the Contests page later.

\sphinxAtStartPar
It is possible to change whether teams can submit solutions for that
problem (using the toggle switch ‘allow submit’). If disallowed,
submissions for that problem will be rejected, but more importantly,
teams will not see that problem on the scoreboard. Disallow judge
will make DOMjudge accept submissions, but leave them queued; this
is useful in case an unexpected problem shows up with one of the
problems. Timelimit is the maximum number of seconds a submission
for this problem is allowed to run before a ‘TIMELIMIT’ response
is given (to be multiplied possibly by a language factor). A
‘timelimit overshoot’ can be configured to let submissions run a
bit longer. Although DOMjudge will use the actual limit to
determine the verdict, this allows judges to see if a submission
is close to the timelimit.

\sphinxAtStartPar
Problems can have special \sphinxstyleemphasis{compare} and
\sphinxstyleemphasis{run} scripts associated to them, to deal with problem
statements that require non\sphinxhyphen{}standard evaluation.


\subsection{Checking your configuration}
\label{\detokenize{config-basic:checking-your-configuration}}
\sphinxAtStartPar
From the front page the \sphinxstyleemphasis{Config checker} is available. This tool will
do a basic check of your DOMjudge setup and gives helpful hints to
improve it. Be sure to run it when you’ve set up your contest.


\subsection{Testing jury solutions}
\label{\detokenize{config-basic:testing-jury-solutions}}
\sphinxAtStartPar
Before a contest, you will want to have tested your reference
solutions on the system to see whether those are judged as expected
and maybe use their runtimes to set timelimits for the problems.

\sphinxAtStartPar
The simplest way to do this is to include the jury solutions in a
problem zip file and upload this. You can also upload a zip file
containing just solutions to an existing problem. The zip
archive has to adhere to the {\hyperref[\detokenize{problem-format::doc}]{\sphinxcrossref{\DUrole{doc}{problem format}}}}.
For this to work, the jury/admin user who uploads the problem has to
have an associated team to which the solutions will be assigned. The
solutions will automatically be judged if the contest is active (but
it need not have started yet). You can verify whether the submissions
gave the expected answer in the Judging Verifier, available from
the jury index page.

\sphinxstepscope


\section{Adding contest data in bulk}
\label{\detokenize{import:adding-contest-data-in-bulk}}\label{\detokenize{import::doc}}
\sphinxAtStartPar
DOMjudge offers three ways to add or update contest data in bulk: using API
endpoints, using the CLI (which wraps the API) and using the jury interface.
In general, we follow the \sphinxhref{https://ccs-specs.icpc.io/2022-07/ccs\_system\_requirements\#appendix-file-formats}{CCS specification} for all file formats involved.

\sphinxAtStartPar
For using the API, the following examples require you to set up admin credentials
in your \sphinxhref{https://www.gnu.org/software/inetutils/manual/html\_node/The-\_002enetrc-file.html}{.netrc} file. You need to install \sphinxhref{https://httpie.org/}{httpie} and replace the
\sphinxcode{\sphinxupquote{\textless{}API\_URL\textgreater{}}} in the examples below with the API URL of your local DOMjudge
installation.

\sphinxAtStartPar
To use the CLI, you need to replace \sphinxcode{\sphinxupquote{\textless{}WEBAPP\_DIR\textgreater{}}} with the path to
the \sphinxcode{\sphinxupquote{webapp}} directory of the DOMserver.


\subsection{Importing team categories}
\label{\detokenize{import:importing-team-categories}}
\sphinxAtStartPar
There are two formats to import team categories: a JSON format and a legacy TSV format.


\subsubsection{Using JSON}
\label{\detokenize{import:using-json}}
\sphinxAtStartPar
Prepare a file called \sphinxcode{\sphinxupquote{groups.json}} which contains the team categories.
It should be a JSON array with objects, each object should contain the following
fields:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{id}}: the category ID to use. Must be unique

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{icpc\_id}} (optional): an ID from an external system, e.g. from the ICPC CMS, may be empty

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{name}}: the name of the team category as shown on the scoreboard

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{hidden}} (defaults to \sphinxcode{\sphinxupquote{false}}): if \sphinxcode{\sphinxupquote{true}}, teams in this category will
not be shown on the scoreboard

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{sortorder}} (defaults to \sphinxcode{\sphinxupquote{0}}): the sort order of the team category to use
on the scoreboard. Categories with the same sortorder will be grouped together.

\end{itemize}

\sphinxAtStartPar
If the \sphinxcode{\sphinxupquote{data\_source}} setting of DOMjudge is set to external, the \sphinxcode{\sphinxupquote{id}} field will be the
ID used for the group. Otherwise, it will be exposed as \sphinxcode{\sphinxupquote{externalid}} and a group ID will be
generated by DOMjudge.

\sphinxAtStartPar
Example \sphinxcode{\sphinxupquote{groups.json}}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{p}{[}\PYG{p}{\PYGZob{}}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{13337}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{icpc\PYGZus{}id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{123}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Companies}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{hidden}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{n}{true}
\PYG{p}{\PYGZcb{}}\PYG{p}{,} \PYG{p}{\PYGZob{}}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{47}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Participants}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{p}{\PYGZcb{}}\PYG{p}{,} \PYG{p}{\PYGZob{}}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{23}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Spectators}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{p}{\PYGZcb{}}\PYG{p}{]}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the jury interface, go to \sphinxtitleref{Import / export}, select
\sphinxtitleref{groups} under \sphinxtitleref{Import JSON / YAML}, select your file and click \sphinxtitleref{Import}.

\sphinxAtStartPar
To import the file using the API run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{http} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{check}\PYG{o}{\PYGZhy{}}\PYG{n}{status} \PYG{o}{\PYGZhy{}}\PYG{n}{b} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{POST} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}API\PYGZus{}URL\PYGZgt{}/users/groups}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{json}\PYG{n+nd}{@groups}\PYG{o}{.}\PYG{n}{json}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the CLI run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZlt{}}\PYG{n}{WEBAPP\PYGZus{}DIR}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{api}\PYG{p}{:}\PYG{n}{call} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{POST} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{json}\PYG{o}{=}\PYG{n}{groups}\PYG{o}{.}\PYG{n}{json} \PYG{n}{users}\PYG{o}{/}\PYG{n}{groups}
\end{sphinxVerbatim}


\subsubsection{Using the legacy TSV format}
\label{\detokenize{import:using-the-legacy-tsv-format}}
\sphinxAtStartPar
Prepare a file called \sphinxcode{\sphinxupquote{groups.tsv}} which contains the team categories.
The first line should contain \sphinxcode{\sphinxupquote{File\_Version 1}} (tab\sphinxhyphen{}separated).
Each of the following lines must contain the following elements separated by tabs:
\begin{itemize}
\item {} 
\sphinxAtStartPar
the category ID. Must be unique

\item {} 
\sphinxAtStartPar
the name of the team category as shown on the scoreboard

\end{itemize}

\sphinxAtStartPar
If the \sphinxcode{\sphinxupquote{data\_source}} setting of DOMjudge is set to external, the category ID field will be
the ID used for the group. Otherwise, it will be exposed as \sphinxcode{\sphinxupquote{externalid}} and a group ID will
be generated by DOMjudge.

\sphinxAtStartPar
Example \sphinxcode{\sphinxupquote{groups.tsv}}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{File\PYGZus{}Version}   \PYG{l+m+mi}{1}
\PYG{l+m+mi}{13337}        \PYG{n}{Companies}
\PYG{l+m+mi}{47}   \PYG{n}{Participants}
\PYG{l+m+mi}{23}   \PYG{n}{Spectators}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the jury interface, go to \sphinxtitleref{Import / export}, select
\sphinxtitleref{groups} under \sphinxtitleref{Tab\sphinxhyphen{}separated import}, select your file and click \sphinxtitleref{Import}.

\sphinxAtStartPar
To import the file using the API run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{http} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{check}\PYG{o}{\PYGZhy{}}\PYG{n}{status} \PYG{o}{\PYGZhy{}}\PYG{n}{b} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{POST} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}API\PYGZus{}URL\PYGZgt{}/users/groups}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{tsv}\PYG{n+nd}{@groups}\PYG{o}{.}\PYG{n}{tsv}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the CLI run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZlt{}}\PYG{n}{WEBAPP\PYGZus{}DIR}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{api}\PYG{p}{:}\PYG{n}{call} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{POST} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{tsv}\PYG{o}{=}\PYG{n}{groups}\PYG{o}{.}\PYG{n}{tsv} \PYG{n}{users}\PYG{o}{/}\PYG{n}{groups}
\end{sphinxVerbatim}


\subsection{Importing team affiliations}
\label{\detokenize{import:importing-team-affiliations}}
\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
The team TSV import automatically imports team affiliations as well.
\end{sphinxadmonition}

\sphinxAtStartPar
Prepare a file called \sphinxcode{\sphinxupquote{organizations.json}} which contains the affiliations.
It should be a JSON array with objects, each object should contain the following
fields:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{id}}: the affiliation ID. Must be unique

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{icpc\_id}} (optional): an ID from an external system, e.g. from the ICPC CMS, may be empty

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{name}}: the affiliation short name as used in the jury interface and certain
exports

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{formal\_name}}: the affiliation name as used on the scoreboard

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{country}}: the country code in form of ISO 3166\sphinxhyphen{}1 alpha\sphinxhyphen{}3

\end{itemize}

\sphinxAtStartPar
If the \sphinxcode{\sphinxupquote{data\_source}} setting of DOMjudge is set to external, the \sphinxcode{\sphinxupquote{id}} field will be the
ID used for the affiliation. Otherwise, it will be exposed as \sphinxcode{\sphinxupquote{externalid}} and an affiliation
ID will be generated by DOMjudge.

\sphinxAtStartPar
Example \sphinxcode{\sphinxupquote{organizations.json}}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{p}{[}\PYG{p}{\PYGZob{}}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{INST\PYGZhy{}42}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{icpc\PYGZus{}id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{42}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{LU}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{formal\PYGZus{}name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Lund University}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{country}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{SWE}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{p}{\PYGZcb{}}\PYG{p}{,} \PYG{p}{\PYGZob{}}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{INST\PYGZhy{}43}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{icpc\PYGZus{}id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{43}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{FAU}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{formal\PYGZus{}name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Friedrich\PYGZhy{}Alexander\PYGZhy{}University Erlangen\PYGZhy{}Nuremberg}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{country}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{DEU}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{p}{\PYGZcb{}}\PYG{p}{]}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the jury interface, go to \sphinxtitleref{Import / export}, select
\sphinxtitleref{organizations} under \sphinxtitleref{Import JSON / YAML}, select your file and click \sphinxtitleref{Import}.

\sphinxAtStartPar
To import the file using the API run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{http} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{check}\PYG{o}{\PYGZhy{}}\PYG{n}{status} \PYG{o}{\PYGZhy{}}\PYG{n}{b} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{POST} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}API\PYGZus{}URL\PYGZgt{}/users/organizations}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{json}\PYG{n+nd}{@organizations}\PYG{o}{.}\PYG{n}{json}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the CLI run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZlt{}}\PYG{n}{WEBAPP\PYGZus{}DIR}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{api}\PYG{p}{:}\PYG{n}{call} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{POST} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{json}\PYG{o}{=}\PYG{n}{organizations}\PYG{o}{.}\PYG{n}{json} \PYG{n}{users}\PYG{o}{/}\PYG{n}{organizations}
\end{sphinxVerbatim}


\subsection{Importing teams}
\label{\detokenize{import:importing-teams}}
\sphinxAtStartPar
There are two formats to import teams: a JSON format and a legacy TSV format.


\subsubsection{Using JSON}
\label{\detokenize{import:id1}}
\sphinxAtStartPar
Prepare a file called \sphinxcode{\sphinxupquote{teams.json}} which contains the teams.
It should be a JSON array with objects, each object should contain the following
fields:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{id}}: the team ID. Must be unique

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{icpc\_id}} (optional): an ID from an external system, e.g. from the ICPC CMS, may be empty

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{label}}: (optional): the label, for example the seat number

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{group\_ids}}: an array with one element: the category ID this team belongs to

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{name}}: the team name as used in the web interface

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{members}} (optional): Members of the team as one long string

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{display\_name}} (optional): the team display name. If provided, will display
this instead of the team name in certain places, like the scoreboard

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{organization\_id}}: the ID of the team affiliation this team belongs to

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{location.description}} (optional): the location of the team

\end{itemize}

\sphinxAtStartPar
If the \sphinxcode{\sphinxupquote{data\_source}} setting of DOMjudge is set to external, the \sphinxcode{\sphinxupquote{id}} field will be the
ID used for the team and the \sphinxcode{\sphinxupquote{group\_ids}} and \sphinxcode{\sphinxupquote{organization\_id}} fields are the values as
provided during the import of the other files listed above. Otherwise, the \sphinxcode{\sphinxupquote{id}} will be
exposed as \sphinxcode{\sphinxupquote{externalid}}, a team ID will be generated by DOMjudge and you need to use the
ID’s as generated by DOMjudge for \sphinxcode{\sphinxupquote{group\_ids}} as well as \sphinxcode{\sphinxupquote{organization\_id}}.

\sphinxAtStartPar
Example \sphinxcode{\sphinxupquote{teams.json}}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{p}{[}\PYG{p}{\PYGZob{}}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{icpc\PYGZus{}id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{447047}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{label}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{1}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{group\PYGZus{}ids}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{24}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{¡i¡i¡}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{organization\PYGZus{}id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{INST\PYGZhy{}42}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{location}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{\PYGZob{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{description}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{AUD 10}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{\PYGZcb{}}
\PYG{p}{\PYGZcb{}}\PYG{p}{,} \PYG{p}{\PYGZob{}}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{icpc\PYGZus{}id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{447837}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{label}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{2}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{group\PYGZus{}ids}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{25}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{]}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{name}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{Pleading not FAUlty}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,}
  \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{organization\PYGZus{}id}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{:} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{INST\PYGZhy{}43}\PYG{l+s+s2}{\PYGZdq{}}
\PYG{p}{\PYGZcb{}}\PYG{p}{]}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the jury interface, go to \sphinxtitleref{Import / export}, select
\sphinxtitleref{teams} under \sphinxtitleref{Import JSON / YAML}, select your file and click \sphinxtitleref{Import}.

\sphinxAtStartPar
To import the file using the API run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{http} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{check}\PYG{o}{\PYGZhy{}}\PYG{n}{status} \PYG{o}{\PYGZhy{}}\PYG{n}{b} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{POST} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}API\PYGZus{}URL\PYGZgt{}/users/teams}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{json}\PYG{n+nd}{@teams}\PYG{o}{.}\PYG{n}{json}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the CLI run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZlt{}}\PYG{n}{WEBAPP\PYGZus{}DIR}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{api}\PYG{p}{:}\PYG{n}{call} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{POST} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{json}\PYG{o}{=}\PYG{n}{teams}\PYG{o}{.}\PYG{n}{json} \PYG{n}{users}\PYG{o}{/}\PYG{n}{teams}
\end{sphinxVerbatim}


\subsubsection{Using the legacy TSV format}
\label{\detokenize{import:id2}}
\sphinxAtStartPar
Prepare a file called \sphinxcode{\sphinxupquote{teams2.tsv}} which contains the teams.
The first line should contain \sphinxcode{\sphinxupquote{File\_Version    2}} (tab\sphinxhyphen{}separated).
Each of the following lines must contain the following elements separated by tabs:
\begin{itemize}
\item {} 
\sphinxAtStartPar
the team ID. Must be unique

\item {} 
\sphinxAtStartPar
an ID from an external system, e.g. from the ICPC CMS, may be empty

\item {} 
\sphinxAtStartPar
the category ID this team belongs to

\item {} 
\sphinxAtStartPar
the team name as used in the web interface

\item {} 
\sphinxAtStartPar
the institution name as used on the scoreboard

\item {} 
\sphinxAtStartPar
the institution short name as used in the jury interface and certain exports

\item {} 
\sphinxAtStartPar
a country code in form of ISO 3166\sphinxhyphen{}1 alpha\sphinxhyphen{}3

\item {} 
\sphinxAtStartPar
an external institution ID, e.g. from the ICPC CMS, may be empty

\end{itemize}

\sphinxAtStartPar
If the \sphinxcode{\sphinxupquote{data\_source}} setting of DOMjudge is set to external, the team ID field will be the
ID used for the team and the category ID field is the value as provided during the import of
the other files listed above. Otherwise, the team ID will be exposed as \sphinxcode{\sphinxupquote{externalid}}, a
team ID will be generated by DOMjudge and you need to use the ID as generated by DOMjudge
for the category ID.

\sphinxAtStartPar
Example \sphinxcode{\sphinxupquote{teams2.tsv}}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
File\PYGZus{}Version   2
1    447047  24      ¡i¡i¡   Lund University LU      SWE     INST\PYGZhy{}42
2    447837  25      Pleading not FAUlty     Friedrich\PYGZhy{}Alexander\PYGZhy{}University Erlangen\PYGZhy{}Nuremberg       FAU     DEU     INST\PYGZhy{}43
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the jury interface, go to \sphinxtitleref{Import / export}, select
\sphinxtitleref{teams} under \sphinxtitleref{Tab\sphinxhyphen{}separated import}, select your file and click \sphinxtitleref{Import}.

\sphinxAtStartPar
To import the file using the API run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{http} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{check}\PYG{o}{\PYGZhy{}}\PYG{n}{status} \PYG{o}{\PYGZhy{}}\PYG{n}{b} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{POST} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}API\PYGZus{}URL\PYGZgt{}/users/teams}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{tsv}\PYG{n+nd}{@teams2}\PYG{o}{.}\PYG{n}{tsv}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the CLI run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZlt{}}\PYG{n}{WEBAPP\PYGZus{}DIR}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{api}\PYG{p}{:}\PYG{n}{call} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{POST} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{tsv}\PYG{o}{=}\PYG{n}{teams2}\PYG{o}{.}\PYG{n}{tsv} \PYG{n}{users}\PYG{o}{/}\PYG{n}{teams}
\end{sphinxVerbatim}


\subsection{Importing accounts}
\label{\detokenize{import:importing-accounts}}
\sphinxAtStartPar
There are two formats to import accounts: a YAML format and a legacy TSV format.


\subsubsection{Using YAML}
\label{\detokenize{import:using-yaml}}
\sphinxAtStartPar
Prepare a file called \sphinxcode{\sphinxupquote{accounts.yaml}} which contains the accounts.
It should be a YAML array with objects, each object should contain the following
fields:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{id}}: the account ID. Must be unique

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{username}}: the account username. Must be unique

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{password}}: the password to use for the account

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{type}}: the user type, one of \sphinxcode{\sphinxupquote{team}}, \sphinxcode{\sphinxupquote{judge}}, \sphinxcode{\sphinxupquote{admin}} or \sphinxcode{\sphinxupquote{balloon}}, \sphinxcode{\sphinxupquote{jury}} will be interpret as \sphinxcode{\sphinxupquote{judge}}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{team\_id}}: (optional) the ID of the team this account belongs to

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{name}}: (optional) the full name of the account

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{ip}} (optional): IP address to link to this account

\end{itemize}

\sphinxAtStartPar
If the \sphinxcode{\sphinxupquote{data\_source}} setting of DOMjudge is set to external, the \sphinxcode{\sphinxupquote{id}} field will be the ID
used for the user and the \sphinxcode{\sphinxupquote{team\_id}} field is the value as provided during the team import.
Otherwise, the \sphinxcode{\sphinxupquote{id}} will be exposed as \sphinxcode{\sphinxupquote{externalid}}, a user ID will be generated by DOMjudge
and you need to use the ID as generated by DOMjudge for \sphinxcode{\sphinxupquote{team\_id}}.

\sphinxAtStartPar
Example \sphinxcode{\sphinxupquote{accounts.yaml}}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZhy{}} \PYG{n+nb}{id}\PYG{p}{:} \PYG{n}{team001}
  \PYG{n}{username}\PYG{p}{:} \PYG{n}{team001}
  \PYG{n}{password}\PYG{p}{:} \PYG{n}{P3xm33imve}
  \PYG{n+nb}{type}\PYG{p}{:} \PYG{n}{team}
  \PYG{n}{name}\PYG{p}{:} \PYG{n}{team001}
  \PYG{n}{ip}\PYG{p}{:} \PYG{l+m+mf}{10.10}\PYG{l+m+mf}{.2}\PYG{l+m+mf}{.1}

\PYG{o}{\PYGZhy{}} \PYG{n+nb}{id}\PYG{p}{:} \PYG{n}{team002}
  \PYG{n}{username}\PYG{p}{:} \PYG{n}{team002}
  \PYG{n}{password}\PYG{p}{:} \PYG{n}{qd4WHeJXbd}
  \PYG{n+nb}{type}\PYG{p}{:} \PYG{n}{team}
  \PYG{n}{name}\PYG{p}{:} \PYG{n}{team002}
  \PYG{n}{ip}\PYG{p}{:} \PYG{l+m+mf}{10.10}\PYG{l+m+mf}{.2}\PYG{l+m+mf}{.2}

\PYG{o}{\PYGZhy{}} \PYG{n+nb}{id}\PYG{p}{:} \PYG{n}{john}
  \PYG{n}{username}\PYG{p}{:} \PYG{n}{john}
  \PYG{n}{password}\PYG{p}{:} \PYG{n}{Uf4PYRA7mJ}
  \PYG{n+nb}{type}\PYG{p}{:} \PYG{n}{judge}
  \PYG{n}{name}\PYG{p}{:} \PYG{n}{John} \PYG{n}{Doe}
\end{sphinxVerbatim}

\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
You can also use a JSON file instead of YAML. Make sure to name it
\sphinxcode{\sphinxupquote{accounts.json}} in that case.
\end{sphinxadmonition}

\sphinxAtStartPar
To import the file using the jury interface, go to \sphinxtitleref{Import / export}, select
\sphinxtitleref{accounts} under \sphinxtitleref{Import JSON / YAML}, select your file and click \sphinxtitleref{Import}.

\sphinxAtStartPar
To import the file using the API run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{http} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{check}\PYG{o}{\PYGZhy{}}\PYG{n}{status} \PYG{o}{\PYGZhy{}}\PYG{n}{b} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{POST} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}API\PYGZus{}URL\PYGZgt{}/users/accounts}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{yaml}\PYG{n+nd}{@accounts}\PYG{o}{.}\PYG{n}{yaml}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the CLI run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZlt{}}\PYG{n}{WEBAPP\PYGZus{}DIR}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{api}\PYG{p}{:}\PYG{n}{call} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{POST} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{yaml}\PYG{o}{=}\PYG{n}{accounts}\PYG{o}{.}\PYG{n}{yaml} \PYG{n}{users}\PYG{o}{/}\PYG{n}{accounts}
\end{sphinxVerbatim}


\subsubsection{Using the legacy TSV format}
\label{\detokenize{import:id3}}
\sphinxAtStartPar
Prepare a file called \sphinxcode{\sphinxupquote{accounts.tsv}} which contains the team credentials.
The first line should contain \sphinxcode{\sphinxupquote{accounts  1}} (tab\sphinxhyphen{}separated).
Each of the following lines must contain the following elements separated by tabs:
\begin{itemize}
\item {} 
\sphinxAtStartPar
the user type, one of \sphinxcode{\sphinxupquote{team}}, \sphinxcode{\sphinxupquote{judge}}, \sphinxcode{\sphinxupquote{admin}} or \sphinxcode{\sphinxupquote{balloon}}, \sphinxcode{\sphinxupquote{jury}} will be interpret as \sphinxcode{\sphinxupquote{judge}}

\item {} 
\sphinxAtStartPar
the full name of the user

\item {} 
\sphinxAtStartPar
the username

\item {} 
\sphinxAtStartPar
the password

\item {} 
\sphinxAtStartPar
(optional) the IP address to the user

\end{itemize}

\sphinxAtStartPar
Example \sphinxcode{\sphinxupquote{accounts.tsv}}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{accounts}     \PYG{l+m+mi}{1}
\PYG{n}{team} \PYG{n}{team001} \PYG{n}{team001} \PYG{n}{P3xm33imve}      \PYG{l+m+mf}{10.10}\PYG{l+m+mf}{.2}\PYG{l+m+mf}{.1}
\PYG{n}{team} \PYG{n}{team002} \PYG{n}{team002} \PYG{n}{qd4WHeJXbd}      \PYG{l+m+mf}{10.10}\PYG{l+m+mf}{.2}\PYG{l+m+mf}{.2}
\PYG{n}{judge}        \PYG{n}{John} \PYG{n}{Doe}        \PYG{n}{john}    \PYG{n}{Uf4PYRA7mJ}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the jury interface, go to \sphinxtitleref{Import / export}, select
\sphinxtitleref{accounts} under \sphinxtitleref{Tab\sphinxhyphen{}separated import}, select your file and click \sphinxtitleref{Import}.

\sphinxAtStartPar
To import the file using the API run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{http} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{check}\PYG{o}{\PYGZhy{}}\PYG{n}{status} \PYG{o}{\PYGZhy{}}\PYG{n}{b} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{POST} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}API\PYGZus{}URL\PYGZgt{}/users/accounts}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{tsv}\PYG{n+nd}{@accounts}\PYG{o}{.}\PYG{n}{tsv}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the CLI run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZlt{}}\PYG{n}{WEBAPP\PYGZus{}DIR}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{api}\PYG{p}{:}\PYG{n}{call} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{POST} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{tsv}\PYG{o}{=}\PYG{n}{accounts}\PYG{o}{.}\PYG{n}{tsv} \PYG{n}{users}\PYG{o}{/}\PYG{n}{accounts}
\end{sphinxVerbatim}


\subsection{Importing contest metadata}
\label{\detokenize{import:importing-contest-metadata}}
\sphinxAtStartPar
Prepare a file called \sphinxcode{\sphinxupquote{contest.yaml}} which contains the contest information.

\sphinxAtStartPar
Example \sphinxcode{\sphinxupquote{contest.yaml}}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n+nb}{id}\PYG{p}{:}                         \PYG{n}{practice}
\PYG{n}{name}\PYG{p}{:}                       \PYG{n}{DOMjudge} \PYG{n+nb}{open} \PYG{n}{practice} \PYG{n}{session}
\PYG{n}{start\PYGZus{}time}\PYG{p}{:}                 \PYG{l+m+mi}{2020}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{04}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{30}\PYG{n}{T10}\PYG{p}{:}\PYG{l+m+mi}{00}\PYG{p}{:}\PYG{l+m+mi}{00}\PYG{o}{+}\PYG{l+m+mi}{01}\PYG{p}{:}\PYG{l+m+mi}{00}
\PYG{n}{duration}\PYG{p}{:}                   \PYG{l+m+mi}{2}\PYG{p}{:}\PYG{l+m+mi}{00}\PYG{p}{:}\PYG{l+m+mi}{00}
\PYG{n}{scoreboard\PYGZus{}freeze\PYGZus{}duration}\PYG{p}{:} \PYG{l+m+mi}{0}\PYG{p}{:}\PYG{l+m+mi}{30}\PYG{p}{:}\PYG{l+m+mi}{00}
\PYG{n}{penalty\PYGZus{}time}\PYG{p}{:}               \PYG{l+m+mi}{20}
\end{sphinxVerbatim}

\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
You can also use a JSON file instead of YAML. Make sure to name it
\sphinxcode{\sphinxupquote{contest.json}} in that case.
\end{sphinxadmonition}

\sphinxAtStartPar
To import the file using the jury interface, go to \sphinxtitleref{Import / export}, then
\sphinxtitleref{Contest \sphinxhyphen{}\textgreater{} Import JSON / YAML}, select your file under \sphinxtitleref{File}
and click \sphinxtitleref{Import}.

\sphinxAtStartPar
To import the file using the API run the following commands:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{http} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{check}\PYG{o}{\PYGZhy{}}\PYG{n}{status} \PYG{o}{\PYGZhy{}}\PYG{n}{b} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{POST} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}API\PYGZus{}URL\PYGZgt{}/contests}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{yaml}\PYG{n+nd}{@contest}\PYG{o}{.}\PYG{n}{yaml}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the CLI run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZlt{}}\PYG{n}{WEBAPP\PYGZus{}DIR}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{api}\PYG{p}{:}\PYG{n}{call} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{POST} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{yaml}\PYG{o}{=}\PYG{n}{contest}\PYG{o}{.}\PYG{n}{yaml} \PYG{n}{contests}
\end{sphinxVerbatim}

\sphinxAtStartPar
This call returns the new contest ID, which you need to import problems.


\subsection{Importing problem metadata}
\label{\detokenize{import:importing-problem-metadata}}
\sphinxAtStartPar
Prepare a file called \sphinxcode{\sphinxupquote{problems.yaml}} which contains the problemset information.

\sphinxAtStartPar
Example \sphinxcode{\sphinxupquote{problems.yaml}}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZhy{}} \PYG{n+nb}{id}\PYG{p}{:}     \PYG{n}{hello}
  \PYG{n}{label}\PYG{p}{:}  \PYG{n}{A}
  \PYG{n}{name}\PYG{p}{:}   \PYG{n}{Hello} \PYG{n}{World}
  \PYG{n}{color}\PYG{p}{:}  \PYG{n}{Orange}
  \PYG{n}{rgb}\PYG{p}{:}    \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsh{}FF7109}\PYG{l+s+s1}{\PYGZsq{}}

\PYG{o}{\PYGZhy{}} \PYG{n+nb}{id}\PYG{p}{:}     \PYG{n}{boolfind}
  \PYG{n}{label}\PYG{p}{:}  \PYG{n}{B}
  \PYG{n}{name}\PYG{p}{:}   \PYG{n}{Boolfind}
  \PYG{n}{color}\PYG{p}{:}  \PYG{n}{Forest} \PYG{n}{Green}
  \PYG{n}{rgb}\PYG{p}{:}    \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{\PYGZsh{}008100}\PYG{l+s+s1}{\PYGZsq{}}
\end{sphinxVerbatim}

\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
You can also use a JSON file instead of YAML. Make sure to name it
\sphinxcode{\sphinxupquote{problems.json}} in that case.

\sphinxAtStartPar
The minimum required fields are \sphinxtitleref{id} and \sphinxtitleref{label}.
\end{sphinxadmonition}

\sphinxAtStartPar
To import the file using the jury interface, go to \sphinxtitleref{Import / export}, then
\sphinxtitleref{Problems \sphinxhyphen{}\textgreater{} Import JSON / YAML}, select your file under \sphinxtitleref{File}
and click \sphinxtitleref{Import}.

\sphinxAtStartPar
To import the file using the API run the following commands:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{http} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{check}\PYG{o}{\PYGZhy{}}\PYG{n}{status} \PYG{o}{\PYGZhy{}}\PYG{n}{b} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{POST} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}API\PYGZus{}URL\PYGZgt{}/contests/\PYGZlt{}CID\PYGZgt{}/problems}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{data}\PYG{n+nd}{@problems}\PYG{o}{.}\PYG{n}{yaml}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the CLI run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZlt{}}\PYG{n}{WEBAPP\PYGZus{}DIR}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{api}\PYG{p}{:}\PYG{n}{call} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{POST} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{data}\PYG{o}{=}\PYG{n}{problems}\PYG{o}{.}\PYG{n}{yaml} \PYG{n}{contests}\PYG{o}{/}\PYG{o}{\PYGZlt{}}\PYG{n}{CID}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n}{problems}
\end{sphinxVerbatim}

\sphinxAtStartPar
Replace \sphinxcode{\sphinxupquote{\textless{}CID\textgreater{}}} with the contest ID that was returned when importing the
contest metadata.


\subsection{Importing problems}
\label{\detokenize{import:importing-problems}}
\sphinxAtStartPar
Prepare your problems in the {\hyperref[\detokenize{problem-format::doc}]{\sphinxcrossref{\DUrole{doc}{ICPC problem format}}}} and
create a ZIP file for each problem.

\sphinxAtStartPar
To import the file using the jury interface, go to \sphinxtitleref{Problems}, select the contest
you want to import the problems into, select your file under \sphinxtitleref{Problem archive(s)}
and click \sphinxtitleref{Upload}.

\sphinxAtStartPar
To import the file using the API run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{http} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{check}\PYG{o}{\PYGZhy{}}\PYG{n}{status} \PYG{o}{\PYGZhy{}}\PYG{n}{b} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{POST} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}API\PYGZus{}URL\PYGZgt{}/contests/\PYGZlt{}CID\PYGZgt{}/problems}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n+nb}{zip}\PYG{n+nd}{@problem}\PYG{o}{.}\PYG{n}{zip} \PYG{n}{problem}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}PROBID\PYGZgt{}}\PYG{l+s+s2}{\PYGZdq{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
To import the file using the CLI run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZlt{}}\PYG{n}{WEBAPP\PYGZus{}DIR}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{api}\PYG{p}{:}\PYG{n}{call} \PYG{o}{\PYGZhy{}}\PYG{n}{m} \PYG{n}{POST} \PYG{o}{\PYGZhy{}}\PYG{n}{d} \PYG{n}{problem}\PYG{o}{=}\PYG{o}{\PYGZlt{}}\PYG{n}{PROBID}\PYG{o}{\PYGZgt{}} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n+nb}{zip}\PYG{o}{=}\PYG{n}{problem}\PYG{o}{.}\PYG{n}{zip} \PYG{n}{contest}\PYG{o}{/}\PYG{o}{\PYGZlt{}}\PYG{n}{CID}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n}{problems}
\end{sphinxVerbatim}

\sphinxAtStartPar
Replace \sphinxcode{\sphinxupquote{\textless{}CID\textgreater{}}} with the contest ID that the previous command returns and
\sphinxcode{\sphinxupquote{\textless{}PROBID\textgreater{}}} with the problem ID (you can get that from the web interface or
the API).


\subsection{Putting all API imports together}
\label{\detokenize{import:putting-all-api-imports-together}}
\sphinxAtStartPar
If you prepare your contest configuration as we described in the previous
subsections, you can also use the script that we provide in
\sphinxtitleref{misc\sphinxhyphen{}tools/import\sphinxhyphen{}contest}.

\sphinxAtStartPar
Call it from your contest folder like this:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{misc}\PYG{o}{\PYGZhy{}}\PYG{n}{tools}\PYG{o}{/}\PYG{n}{import}\PYG{o}{\PYGZhy{}}\PYG{n}{contest} \PYG{o}{\PYGZlt{}}\PYG{n}{API\PYGZus{}URL}\PYG{o}{\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
to use the API, or simply:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{misc}\PYG{o}{\PYGZhy{}}\PYG{n}{tools}\PYG{o}{/}\PYG{n}{import}\PYG{o}{\PYGZhy{}}\PYG{n}{contest}
\end{sphinxVerbatim}

\sphinxAtStartPar
to use the CLI. In this case you must run it from the DOMserver.


\subsection{Importing from ICPC CMS API}
\label{\detokenize{import:importing-from-icpc-cms-api}}
\sphinxAtStartPar
DOMjudge also offers a direct import/refresh of teams from the ICPC CMS API from
within the DOMjudge web interface. You need a  a team category named ‘Participants’
where they will be placed and a ICPC Web Services Token.

\sphinxAtStartPar
To create a Web Services Token, log into the ICPC CMS and click “Export \textgreater{} Web
Services Tokens”. Make sure you add the scopes “Export”, “Standings Upload”,
and “MyICPC”.  Under the \sphinxtitleref{Import / Export} menu, enter the token as specified.
Use the contest abbreviation and year as Contest ID (see the URL in the ICPC
CMS).

\sphinxAtStartPar
Based on the ‘ICPC ID’, teams and their affiliations will be added if they do not
exist or updated when they do. Teams will be set to ‘enabled’ if their ICPC CMS
status is ‘ACCEPTED’, of disabled otherwise. Affiliations are not updated or
deleted even when all teams cancel.


\subsection{Importing DOMjudge configuration}
\label{\detokenize{import:importing-domjudge-configuration}}
\sphinxAtStartPar
DOMjudge exposes its configuration at the \sphinxtitleref{\textless{}API\_URL\textgreater{}/config} endpoint in JSON
form and accepts a \sphinxtitleref{PUT} request to load/update configuration.

\sphinxAtStartPar
You can retrieve the current configuration using the API via:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{http} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{check}\PYG{o}{\PYGZhy{}}\PYG{n}{status} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{pretty}\PYG{o}{=}\PYG{n+nb}{format} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZlt{}API\PYGZus{}URL\PYGZgt{}/config}\PYG{l+s+s2}{\PYGZdq{}} \PYG{o}{\PYGZgt{}} \PYG{n}{config}\PYG{o}{.}\PYG{n}{json}
\end{sphinxVerbatim}

\sphinxAtStartPar
or via the CLI using:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{\PYGZlt{}}\PYG{n}{WEBAPP\PYGZus{}DIR}\PYG{o}{\PYGZgt{}}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{api}\PYG{p}{:}\PYG{n}{call} \PYG{n}{config} \PYG{o}{\PYGZgt{}} \PYG{n}{config}\PYG{o}{.}\PYG{n}{json}
\end{sphinxVerbatim}

\sphinxAtStartPar
For your convenience, we added a script to update configuration from a file
called \sphinxtitleref{config.json} in your current directory:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{misc}\PYG{o}{\PYGZhy{}}\PYG{n}{tools}\PYG{o}{/}\PYG{n}{configure}\PYG{o}{\PYGZhy{}}\PYG{n}{domjudge} \PYG{o}{\PYGZlt{}}\PYG{n}{API\PYGZus{}URL}\PYG{o}{\PYGZgt{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
to use the API, or simply:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{misc}\PYG{o}{\PYGZhy{}}\PYG{n}{tools}\PYG{o}{/}\PYG{n}{configure}\PYG{o}{\PYGZhy{}}\PYG{n}{domjudge}
\end{sphinxVerbatim}

\sphinxAtStartPar
to use the CLI. In this case you must run it from the DOMserver.

\sphinxstepscope


\section{Advanced configuration topics}
\label{\detokenize{config-advanced:advanced-configuration-topics}}\label{\detokenize{config-advanced::doc}}

\subsection{Adding graphics, custom styling and custom JavaScript}
\label{\detokenize{config-advanced:adding-graphics-custom-styling-and-custom-javascript}}
\sphinxAtStartPar
DOMjudge can optionally present country flags, affiliation logos,
team pictures and a page\sphinxhyphen{}wide banner on the public interface.

\sphinxAtStartPar
You can place the images under the path \sphinxtitleref{public/images/} (see
the Config checker in the admin interface for the full filesystem
path of your installation) as follows:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstyleemphasis{Country flags} are shown when the \sphinxcode{\sphinxupquote{show\_flags}} configuration option
is enabled. The \sphinxhref{https://github.com/lipis/flag-icon-css}{flag\sphinxhyphen{}icon\sphinxhyphen{}css}
is used for the flag images.

\item {} 
\sphinxAtStartPar
\sphinxstyleemphasis{Affiliation logos}: these will be shown with the teams that are
part of the affiliation, if the \sphinxcode{\sphinxupquote{show\_affiliation\_logos}} configuration
option is enabled. They can be placed in
\sphinxtitleref{public/images/affiliations/1234.png} where \sphinxstyleemphasis{1234} is the numeric ID
of the affiliation as shown in the DOMjudge interface. There is a
separate option \sphinxcode{\sphinxupquote{show\_affiliations}} that independently controls where
the affiliation \sphinxstyleemphasis{names} are shown on the scoreboard. These logos should be
square and be at least 64x64 pixels, but not much bigger.

\item {} 
\sphinxAtStartPar
\sphinxstyleemphasis{Team pictures}: a photo of the team will be shown in the team details
page if \sphinxtitleref{public/images/teams/456.jpg} exists, where \sphinxstyleemphasis{456} is the
team’s numeric ID as shown in the DOMjudge interface. DOMjudge will not
modify the photos in any way or form, so make sure you don’t upload photos
that are too big, since that will incur a lot of network traffic.

\item {} 
\sphinxAtStartPar
\sphinxstyleemphasis{Contest Banners}: a page\sphinxhyphen{}wide banner can be shown on the public scoreboard
if that image is placed in \sphinxtitleref{public/images/banners/1.png} where \sphinxstyleemphasis{1} is the
contest’s numeric ID as shown in the DOMjudge interface. Alternatively, you
can place a file at \sphinxtitleref{public/images/banner.png} which will be used as a banner
for all contests. Contest\sphinxhyphen{}specific banners always have priority. Contest
banners usually are rectangular, having a width of around 1920 pixels and a
height of around 300 pixels. Other ratio’s and sizes are supported, but check
the public scoreboard to see how it looks.

\end{itemize}

\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
The IDs for affiliations, teams and contests need to be the \sphinxstyleemphasis{external ID}
if the \sphinxcode{\sphinxupquote{data\_source}} setting of DOMjudge is set to external.
\end{sphinxadmonition}

\sphinxAtStartPar
It is also possible to load custom CSS and/or JavaScript files. To do so, place
files ending in \sphinxtitleref{.css} under \sphinxtitleref{public/css/custom/} and/or files ending in \sphinxtitleref{.js}
under \sphinxtitleref{public/js/custom/}. See the Config checker in the admin interface for the
full filesystem path of your installation. Note that there is no guaranteed
order in which the files will be loaded, but they will all be loaded after the
main DOMjudge CSS and JavaScript files. If you have a lot of custom CSS/JavaScript
files in these directories, the response time of DOMjudge might decrease, so it
is recommended to only place a few files there.

\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
If you add or remove any of the above files, you need to
{\hyperref[\detokenize{config-advanced:clear-cache}]{\sphinxcrossref{\DUrole{std,std-ref}{clear the cache}}}} for changes to be detected.
\end{sphinxadmonition}


\subsection{Adding links to documentation to the team interface}
\label{\detokenize{config-advanced:adding-links-to-documentation-to-the-team-interface}}
\sphinxAtStartPar
DOMjudge supports adding links to documentation to the team interface.
First, on the DOMserver, copy the file \sphinxcode{\sphinxupquote{etc/docs.yaml.dist}} to
\sphinxcode{\sphinxupquote{etc/docs.yaml}} and modify its contents. The \sphinxcode{\sphinxupquote{.dist}} file contains
comments as to what each field in the file means and how to use it. If you
want to link to files served by the webserver of the DOMserver, place them
under \sphinxtitleref{/public/docs/}. See the Config checker in the admin interface for
the full filesystem path of your installation. All links open in a new
tab / window.


\subsection{Authentication and registration}
\label{\detokenize{config-advanced:authentication-and-registration}}\label{\detokenize{config-advanced:authentication}}
\sphinxAtStartPar
Out of the box users are able to authenticate using username and password.

\sphinxAtStartPar
Two other native authentication methods are available:
\begin{itemize}
\item {} 
\sphinxAtStartPar
IP Address \sphinxhyphen{} authenticates users based on the IP address they are accessing
the system from;

\item {} 
\sphinxAtStartPar
X\sphinxhyphen{}Headers \sphinxhyphen{} authenticates users based on some HTTP header values.

\end{itemize}

\sphinxAtStartPar
Besides this, DOMjudge can be configured with any provider that can set
the environment variable \sphinxcode{\sphinxupquote{REMOTE\_USER}} to an existing username,
for example LDAP, SAML, CAS or OpenID connect modules for Apache.

\sphinxAtStartPar
There’s an option to let teams register themselves in the system.


\subsubsection{IP Address}
\label{\detokenize{config-advanced:ip-address}}
\sphinxAtStartPar
To enable the IP Address authentication method, you will need to edit
the configuration option \sphinxcode{\sphinxupquote{auth\_methods}} to include \sphinxcode{\sphinxupquote{ipaddress}}.

\sphinxAtStartPar
Once this is done, when a user first logs in their IP address will be
associated with their account, and subsequent logins will allow them to log
in without authenticating.

\sphinxAtStartPar
If desired, you can edit or pre\sphinxhyphen{}fill the IP address associated with an
account from the Users page. When using IPv6, ensure that you enter the
address in the exact representation as the webserver reports it (e.g.
as visible in the webserver logs) \sphinxhyphen{} no canonicalization is performed.


\subsubsection{X\sphinxhyphen{}Headers}
\label{\detokenize{config-advanced:x-headers}}
\sphinxAtStartPar
To enable the X\sphinxhyphen{}Headers authentication method, you will need to edit
the configuration option \sphinxcode{\sphinxupquote{auth\_methods}} to include \sphinxcode{\sphinxupquote{xheaders}}.

\sphinxAtStartPar
To use this method, the following HTTP headers need to be sent to the
\sphinxcode{\sphinxupquote{/login}} URL. This can be done using the squid proxy for example, to
prevent teams from needing to know their own log in information but in an
environment where IP address based auth is not feasible (multi site over the
internet contest).
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{X\sphinxhyphen{}DOMjudge\sphinxhyphen{}Login}} \sphinxhyphen{} Contains the username

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{X\sphinxhyphen{}DOMjudge\sphinxhyphen{}Pass}}  \sphinxhyphen{} Contains the user’s password, base64 encoded

\end{itemize}

\sphinxAtStartPar
Squid configuration for this might look like:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{acl} \PYG{n}{autologin} \PYG{n}{url\PYGZus{}regex} \PYG{o}{\PYGZca{}}\PYG{n}{http}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{localhost}\PYG{o}{/}\PYG{n}{domjudge}\PYG{o}{/}\PYG{n}{login}
\PYG{n}{request\PYGZus{}header\PYGZus{}add} \PYG{n}{X}\PYG{o}{\PYGZhy{}}\PYG{n}{DOMjudge}\PYG{o}{\PYGZhy{}}\PYG{n}{Login} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdl{}USERNAME}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{autologin}
\PYG{n}{request\PYGZus{}header\PYGZus{}add} \PYG{n}{X}\PYG{o}{\PYGZhy{}}\PYG{n}{DOMjudge}\PYG{o}{\PYGZhy{}}\PYG{n}{Pass} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{\PYGZdl{}BASE64\PYGZus{}PASSWORD}\PYG{l+s+s2}{\PYGZdq{}} \PYG{n}{autologin}
\end{sphinxVerbatim}


\subsubsection{Using REMOTE\sphinxhyphen{}USER}
\label{\detokenize{config-advanced:using-remote-user}}
\sphinxAtStartPar
DOMjudge supports generic authentication by various existing providers that
can authenticate a user and set the \sphinxcode{\sphinxupquote{REMOTE\_USER}} environment variable
to the authenticated username.

\sphinxAtStartPar
Examples of this are several Apache modules: mod LDAP, Shibboleth or
Mod Mellon for SAML 2.0, mod Auth CAS, mod OpenID Connect, or mod Kerb for
Kerberos.

\sphinxAtStartPar
This does not currently allow for auto\sphinxhyphen{}provisioning or self\sphinxhyphen{}registration,
the users must already exist in DOMjudge and their DOMjudge username must
match what is in the \sphinxcode{\sphinxupquote{REMOTE\_USER}} variable.

\sphinxAtStartPar
Set up the respective module to authenticate incoming users for the URL
path of your installation. Then, in \sphinxcode{\sphinxupquote{webapp/config/packages/security.yaml}}
change the \sphinxcode{\sphinxupquote{main}} section of your source tree to add a \sphinxcode{\sphinxupquote{remote\_user}}
key after \sphinxcode{\sphinxupquote{form\_login}} that looks like this:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
main:
    pattern: \PYGZca{}/
    …
    form\PYGZus{}login:
        login\PYGZus{}path: login
        check\PYGZus{}path: login
        csrf\PYGZus{}token\PYGZus{}generator: security.csrf.token\PYGZus{}manager
        use\PYGZus{}referer: true
    remote\PYGZus{}user:
        provider: domjudge\PYGZus{}db\PYGZus{}provider
\end{sphinxVerbatim}

\sphinxAtStartPar
And re\sphinxhyphen{}run the “make install” command to deploy this change.
Or alternatively remove the entire \sphinxcode{\sphinxupquote{var/cache/prod/}} directory when
editing \sphinxcode{\sphinxupquote{security.yaml}} on an already deployed location.

\sphinxAtStartPar
If the thus authenticated user is not found in DOMjudge, the application
will present the standard username/password login screen as a fallback.


\subsubsection{Changing the User password hashing cost}
\label{\detokenize{config-advanced:changing-the-user-password-hashing-cost}}
\sphinxAtStartPar
The hashing cost can be changed in \sphinxcode{\sphinxupquote{webapp/config/packages/security.yaml}}, change the encoder section:
\begin{quote}
\begin{description}
\sphinxlineitem{encoders:}\begin{description}
\sphinxlineitem{AppEntityUser:}
\sphinxAtStartPar
algorithm: ‘bcrypt’
cost: 7

\end{description}

\end{description}
\end{quote}

\sphinxAtStartPar
For bcrypt (current encoder) each increase in cost will double the time per password.

\sphinxAtStartPar
See the \sphinxhref{https://symfony.com/doc/current/reference/configuration/security.html}{Symfony docs} for more info on this subject.


\subsubsection{Self\sphinxhyphen{}registration}
\label{\detokenize{config-advanced:self-registration}}
\sphinxAtStartPar
Teams can be allowed to self\sphinxhyphen{}register with the system. To enable it, go to
the team category you want the self\sphinxhyphen{}registered teams to become part of and
enable self\sphinxhyphen{}registration for that category. The option will be shown on the
login screen if it has been enabled for at least one category. When multiple
categories are set to allow, teams can choose one of them during registration.
You can assign the respective categories to the contest(s) these teams may
participarte in.

\sphinxAtStartPar
During registration, teams can also specify their affiliation,
if the global configuration option ‘show affiliations’ is enabled.


\subsection{Executables}
\label{\detokenize{config-advanced:executables}}
\sphinxAtStartPar
DOMjudge supports executable archives (uploaded and stored in ZIP
format) for configuration of languages, special run and compare
programs. The archive must contain an executable file named
\sphinxcode{\sphinxupquote{build}} or \sphinxcode{\sphinxupquote{run}}. When deploying a new (or changed)
executable to a judgehost \sphinxcode{\sphinxupquote{build}} is executed \sphinxstyleemphasis{once} if
present (inside the chroot environment that is also used for
compiling and running submissions). Afterwards an executable
file \sphinxcode{\sphinxupquote{run}} must exist (it may have existed before), that is
called to execute the compile, compare, or run script. The
specific formats are detailed below.

\sphinxAtStartPar
Executables may be changed via the web interface in an online editor
or by uploading a replacement zip file. Changes apply immediately to
all further uses of that executable.


\subsection{Programming languages}
\label{\detokenize{config-advanced:programming-languages}}
\sphinxAtStartPar
Compilers can be configured by creating or selecting/editing an executable in
the web interface. When compiling a set of source files, the \sphinxcode{\sphinxupquote{run}}
executable is invoked with the following arguments: destination file name,
memory limit (in kB), main (first) source file, other source files.
For more information, see for example the executables \sphinxcode{\sphinxupquote{c}} or
\sphinxcode{\sphinxupquote{java\_javac\_detect}} in the web interface. For many common languages
compile scripts are already included.

\sphinxAtStartPar
Interpreted languages and non\sphinxhyphen{}statically linked binaries (for example,
Python or Java) can in also be used, but require that all
runtime dependencies are added to the chroot environment. For details,
see the section {\hyperref[\detokenize{install-judgehost:make-chroot}]{\sphinxcrossref{\DUrole{std,std-ref}{Creating a chroot environment}}}}.

\sphinxAtStartPar
Interpreted languages do not generate an executable and in principle
do not need a compilation step. However, to be able to use interpreted
languages (also Python and Java), during the compilation step a script
must be generated that will function as the executable: the script
must run the interpreter on the source. See for example \sphinxcode{\sphinxupquote{pl}}
and \sphinxcode{\sphinxupquote{java\_javac\_detect}} in the list of executables.


\subsection{Special run and compare programs}
\label{\detokenize{config-advanced:special-run-and-compare-programs}}
\sphinxAtStartPar
To allow for problems that do not fit within the standard scheme of
fixed input and/or output, DOMjudge has the possibility to change the
way submissions are run and checked for correctness.

\sphinxAtStartPar
The back end script \sphinxcode{\sphinxupquote{testcase\_run.sh}} that handles
the running and checking of submissions, calls separate programs
for running submissions and comparison of the results. These can be
specialised and adapted to the requirements per problem. For this, one
has to create executable archives as described above.
Then the executable must be
selected in the \sphinxcode{\sphinxupquote{special\_run}} and/or \sphinxcode{\sphinxupquote{special\_compare}}
fields of the problem (an empty value means that the default run and
compare scripts should be used; the defaults can be set in the global
configuration settings). When creating custom run and compare
programs, we recommend re\sphinxhyphen{}using wrapper scripts that handle the
tedious, standard part. See the boolfind example for details.


\subsection{Compare programs}
\label{\detokenize{config-advanced:compare-programs}}
\sphinxAtStartPar
Compare scripts/programs should follow the \sphinxhref{https://icpc.io/problem-package-format/spec/output\_validators}{Output Validators format}
DOMjudge uses the \sphinxhref{https://icpc.io/problem-package-format/spec/problem\_package\_format\#default-output-validator-specification}{default output validator} from the problem package
format as its default.

\sphinxAtStartPar
Note that DOMjudge only supports a subset of the functionality
described there. In particular, the calling syntax is:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{/}\PYG{n}{path}\PYG{o}{/}\PYG{n}{to}\PYG{o}{/}\PYG{n}{compare\PYGZus{}script}\PYG{o}{/}\PYG{n}{run} \PYG{o}{\PYGZlt{}}\PYG{n}{testdata}\PYG{o}{.}\PYG{o+ow}{in}\PYG{o}{\PYGZgt{}} \PYG{o}{\PYGZlt{}}\PYG{n}{testdata}\PYG{o}{.}\PYG{n}{ans}\PYG{o}{\PYGZgt{}} \PYG{o}{\PYGZlt{}}\PYG{n}{feedbackdir}\PYG{o}{\PYGZgt{}} \PYG{o}{\PYGZlt{}}\PYG{n}{compare\PYGZus{}args}\PYG{o}{\PYGZgt{}} \PYG{o}{\PYGZlt{}} \PYG{o}{\PYGZlt{}}\PYG{n}{program}\PYG{o}{.}\PYG{n}{out}\PYG{o}{\PYGZgt{}}\PYG{p}{;}
\end{sphinxVerbatim}

\sphinxAtStartPar
where \sphinxcode{\sphinxupquote{testdata.in}} \sphinxcode{\sphinxupquote{testdata.ans}} are the jury
reference input and output files, \sphinxcode{\sphinxupquote{feedbackdir}} the directory
containing the judging response files \sphinxcode{\sphinxupquote{judgemessage.txt}}
and \sphinxcode{\sphinxupquote{judgeerror.txt}},
\sphinxcode{\sphinxupquote{compare\_args}} a list of arguments that can set when
configuring a contest problem, and \sphinxcode{\sphinxupquote{program.out}} the team’s
output. The validator program should not make any assumptions on its
working directory.

\sphinxAtStartPar
For more details on writing and modifying a compare (or validator)
script, see the \sphinxcode{\sphinxupquote{boolfind\_cmp}} example and the comments at the
top of the file \sphinxcode{\sphinxupquote{testcase\_run.sh}}.


\subsection{Run programs}
\label{\detokenize{config-advanced:run-programs}}
\sphinxAtStartPar
Special run programs can be used, for example, to create an interactive
problem, where the contestants’ program exchanges information with a
jury program and receives data depending on its own output. The
problem \sphinxcode{\sphinxupquote{boolfind}} is included as an example interactive
problem, see \sphinxcode{\sphinxupquote{doc/examples/boolfind.pdf}} for the description.

\sphinxAtStartPar
The calling syntax is:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{o}{/}\PYG{n}{path}\PYG{o}{/}\PYG{n}{to}\PYG{o}{/}\PYG{n}{run\PYGZus{}script}\PYG{o}{/}\PYG{n}{run} \PYG{o}{\PYGZlt{}}\PYG{n}{testdata}\PYG{o}{.}\PYG{o+ow}{in}\PYG{o}{\PYGZgt{}} \PYG{o}{\PYGZlt{}}\PYG{n}{testdata}\PYG{o}{.}\PYG{n}{ans}\PYG{o}{\PYGZgt{}} \PYG{o}{\PYGZlt{}}\PYG{n}{feedbackdir}\PYG{o}{\PYGZgt{}} \PYG{o}{\PYGZlt{}}\PYG{n}{run} \PYG{n}{args}\PYG{o}{\PYGZgt{}} \PYG{o}{\PYGZlt{}} \PYG{o}{\PYGZlt{}}\PYG{n}{program}\PYG{o}{.}\PYG{n}{out}\PYG{o}{\PYGZgt{}}\PYG{p}{;}
\end{sphinxVerbatim}

\sphinxAtStartPar
Usage is similar to compare programs. DOMjudge wraps the run program to handle
bi\sphinxhyphen{}directional communication between the run program and the contestants’
program. Anything you write to stdout is forwarded to the contestants’ program,
anything the contestants’ program writes is forwarded to your stdin.

\sphinxAtStartPar
See the \sphinxcode{\sphinxupquote{validate.h}} file in the \sphinxcode{\sphinxupquote{boolfind\_run}} executable for some
convenience functions you might want to use when implementing your own run
program.


\subsection{Printing}
\label{\detokenize{config-advanced:printing}}\label{\detokenize{config-advanced:id1}}
\sphinxAtStartPar
It is recommended to configure the local desktop printing of team
workstations where ever possible: this has the most simple interface
and allows teams to print from within their editor.

\sphinxAtStartPar
If this is not feasible, DOMjudge includes support for printing via
the DOMjudge web interface: the DOMjudge server then needs to be
able to deliver the uploaded files to the printer. It can be
enabled via the \sphinxcode{\sphinxupquote{print\_command}} configuration option in
the administrator interface. Here you can enter a command that will
be run to print the files. The command you enter can have the
following placeholders:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{{[}file{]}}}: the location on disk of the file to print.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{{[}original{]}}}: the original name of the file.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{{[}language{]}}}: the ID of the language of the file. Useful for syntax highlighting.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{{[}username{]}}}: the username of the user who is printing.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{{[}teamname{]}}}: the teamname of the user who is printing.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{{[}teamid{]}}}: the team ID of the user who is printing.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{{[}location{]}}}: the location of the user’s team.

\end{itemize}

\sphinxAtStartPar
\sphinxcode{\sphinxupquote{{[}language{]}}}, \sphinxcode{\sphinxupquote{{[}teamname{]}}}, \sphinxcode{\sphinxupquote{{[}teamid{]}}} and
\sphinxcode{\sphinxupquote{{[}location{]}}} can be empty. Placeholders will be shell\sphinxhyphen{}escaped before
passing them to the command. The standard output of the command will
be shown in the web interface. If you also want to show standard error,
add \sphinxcode{\sphinxupquote{2\textgreater{}\&1}} to the command.

\sphinxAtStartPar
For example, to send the first 10 pages of the file to the default printer
using \sphinxcode{\sphinxupquote{enscript}} and add the username in the page header,
you can use this command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{enscript} \PYG{o}{\PYGZhy{}}\PYG{n}{b} \PYG{p}{[}\PYG{n}{username}\PYG{p}{]} \PYG{o}{\PYGZhy{}}\PYG{n}{a} \PYG{l+m+mi}{0}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{10} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{Courier9} \PYG{p}{[}\PYG{n}{file}\PYG{p}{]} \PYG{l+m+mi}{2}\PYG{o}{\PYGZgt{}}\PYG{o}{\PYGZam{}}\PYG{l+m+mi}{1}
\end{sphinxVerbatim}


\subsection{Multiple judgedaemons per machine}
\label{\detokenize{config-advanced:multiple-judgedaemons-per-machine}}\label{\detokenize{config-advanced:multiple-judgedaemons}}
\sphinxAtStartPar
You can run multiple judgedaemons on one multi\sphinxhyphen{}CPU or multi\sphinxhyphen{}core
machine, dedicating one CPU core to each judgedaemon using Linux
cgroups.

\sphinxAtStartPar
To that end, add extra unprivileged users to the system, i.e. add users
\sphinxcode{\sphinxupquote{domjudge\sphinxhyphen{}run\sphinxhyphen{}X}} (where \sphinxcode{\sphinxupquote{X}} runs through \sphinxcode{\sphinxupquote{1,2,3,...}}) with
\sphinxcode{\sphinxupquote{useradd}} as described in the section {\hyperref[\detokenize{install-judgehost:installing-judgehost}]{\sphinxcrossref{\DUrole{std,std-ref}{Building and installing}}}}.

\sphinxAtStartPar
You can then start each of the judgedaemons with:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{judgedaemon} \PYG{o}{\PYGZhy{}}\PYG{n}{n} \PYG{n}{X}
\end{sphinxVerbatim}

\sphinxAtStartPar
to bind it to core \sphinxcode{\sphinxupquote{X}} and user \sphinxcode{\sphinxupquote{domjudge\sphinxhyphen{}run\sphinxhyphen{}X}}. If you use
systemd, then edit the \sphinxcode{\sphinxupquote{domjudge\sphinxhyphen{}judgehost.target}} unit file and add
more judgedaemons there.

\sphinxAtStartPar
Although each judgedaemon process will be bound to one single CPU
core, shared use of other resources such as disk I/O might
still have effect on run times.


\subsection{Multi\sphinxhyphen{}site contests}
\label{\detokenize{config-advanced:multi-site-contests}}
\sphinxAtStartPar
This manual assumed you are running a singe\sphinxhyphen{}site contest; that is, the teams
are located closely together, probably in a single physical location. In a
multi\sphinxhyphen{}site or distributed contest, teams from several remote locations use the
same DOMjudge installation. An example is a national contest where teams can
participate at their local institution.

\sphinxAtStartPar
One option is to run a central installation of
DOMjudge to which the teams connect over the internet. It is here where
all submission processing and judging takes place. Because DOMjudge uses a web
interface for all interactions, teams and judges will interface with the system
just as if it were local.  Still, there are some specific considerations for a
multi\sphinxhyphen{}site contest.

\sphinxAtStartPar
Network: there must be a relatively reliable network connection between the
locations and the central DOMjudge installation, because teams cannot submit or
query the scoreboard if the network is down. Because of traversing an unsecured
network, you should consider HTTPS for encrypting the traffic.  If you
want to limit teams’ internet access, it must be done in such a way that the remote
DOMjudge installation can still be reached.

\sphinxAtStartPar
Team authentication: the IP\sphinxhyphen{}based authentication will still work as long as
each team workstation has a different public IP address. If some teams are
behind a NAT\sphinxhyphen{}router and thus all present themselves to DOMjudge with the same
IP\sphinxhyphen{}address, another authentication scheme must be used (e.g. PHP sessions).

\sphinxAtStartPar
Judges: if the people reviewing the submissions will be located remotely as
well, it’s important to agree beforehand on who\sphinxhyphen{}does\sphinxhyphen{}what, using the
submissions claim feature and how responding to incoming clarification requests
is handled. Having a shared chat/IM channel may help when unexpected issues
arise.

\sphinxAtStartPar
Scoreboard: by default DOMjudge presents all teams in the same scoreboard.
Per\sphinxhyphen{}site scoreboards can be implemented either by using team categories or
team affiliations in combination with the scoreboard filtering option.

\sphinxAtStartPar
As an alternative, each site can run their own DOMjudge installation, and
each site will have a local scoreboard with their own teams. It is possible
to create a merged scoreboard out of these individual installations with the
console command \sphinxcode{\sphinxupquote{scoreboard:merge}}. You need to know for each site which
contest ID to use, and the IDs of the team categories you want to include
(comma separated). You can then run it like this:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{webapp}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{scoreboard}\PYG{p}{:}\PYG{n}{merge} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Combined Scoreboard Example}\PYG{l+s+s1}{\PYGZsq{}} \PYGZbs{}
   \PYG{n}{https}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{judge}\PYG{o}{.}\PYG{n}{example1}\PYG{o}{.}\PYG{n}{edu}\PYG{o}{/}\PYG{n}{api}\PYG{o}{/}\PYG{n}{v4}\PYG{o}{/}\PYG{n}{contests}\PYG{o}{/}\PYG{l+m+mi}{3}\PYG{o}{/} \PYG{l+m+mi}{3} \PYGZbs{}
   \PYG{n}{https}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{chipcie}\PYG{o}{.}\PYG{n}{example2}\PYG{o}{.}\PYG{n}{org}\PYG{o}{/}\PYG{n}{api}\PYG{o}{/}\PYG{n}{v4}\PYG{o}{/}\PYG{n}{contests}\PYG{o}{/}\PYG{l+m+mi}{2}\PYG{o}{/} \PYG{l+m+mi}{2}\PYG{p}{,}\PYG{l+m+mi}{3}  \PYGZbs{}
   \PYG{n}{https}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{domjudge}\PYG{o}{.}\PYG{n}{aapp}\PYG{o}{.}\PYG{n}{example}\PYG{o}{.}\PYG{n}{nl}\PYG{o}{/}\PYG{n}{api}\PYG{o}{/}\PYG{n}{v4}\PYG{o}{/}\PYG{n}{contests}\PYG{o}{/}\PYG{l+m+mi}{6}\PYG{o}{/} \PYG{l+m+mi}{3}
\end{sphinxVerbatim}


\subsection{Clearing the PHP/Symfony cache}
\label{\detokenize{config-advanced:clearing-the-php-symfony-cache}}\label{\detokenize{config-advanced:clear-cache}}
\sphinxAtStartPar
Some operations require you to clear the PHP/Symfony cache. To do this, execute
the \sphinxtitleref{webapp/bin/console} (see the Config checker in the admin interface for the
full filesystem path of your installation) binary with the \sphinxtitleref{cache:clear} subcommand:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{webapp}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{console} \PYG{n}{cache}\PYG{p}{:}\PYG{n}{clear}
\end{sphinxVerbatim}

\sphinxAtStartPar
Note that this is different than clearing the scoreboard cache.


\subsection{Sending errors to Sentry}
\label{\detokenize{config-advanced:sending-errors-to-sentry}}
\sphinxAtStartPar
DOMjudge has the possibility to send any errors to \sphinxhref{http://sentry.io}{Sentry}. First, create an
organization and project in Sentry and copy the Sentry DSN. Then create the file
\sphinxcode{\sphinxupquote{webapp/.env.local}} and add to it the setting \sphinxcode{\sphinxupquote{SENTRY\_DSN=\textless{}dsn\textgreater{}}} where
\sphinxcode{\sphinxupquote{\textless{}dsn\textgreater{}}} is the Sentry DSN you copied. Then {\hyperref[\detokenize{config-advanced:clear-cache}]{\sphinxcrossref{\DUrole{std,std-ref}{clear the cache}}}}
for this change to take effect. Now all errors should appear in Sentry
automatically.

\sphinxstepscope


\section{Running the contest}
\label{\detokenize{running:running-the-contest}}\label{\detokenize{running::doc}}

\subsection{Team status}
\label{\detokenize{running:team-status}}
\sphinxAtStartPar
Under the Teams menu option, you can get a general impression of the
status of each team: a traffic light will show either of the
following:
\begin{itemize}
\item {} 
\sphinxAtStartPar
gray: the team has not (yet) connected to the web interface at all;

\item {} 
\sphinxAtStartPar
red: the team has connected but not submitted anything yet;

\item {} 
\sphinxAtStartPar
yellow: one or more submissions have been made, but none correct;

\item {} 
\sphinxAtStartPar
green: the team has made at least one submission that has
been judged as correct.

\end{itemize}

\sphinxAtStartPar
This is especially useful during the practice session, where it is
expected that every team can make at least one correct submission. A
team with any other colour than green near the end of the session
might be having difficulties.


\subsection{Clarification Requests}
\label{\detokenize{running:clarification-requests}}\label{\detokenize{running:clarifications}}
\sphinxAtStartPar
Communication between teams and jury happens through Clarification
Requests. Everything related to that is handled under the
Clarifications menu item.

\sphinxAtStartPar
Teams can use their web interface to send a clarification request to
the jury. The jury can send a response to that team specifically, or
send it to all teams. The latter is done to ensure that all teams have
the same information about the problem set. The jury can also send a
clarification that does not correspond to a specific request. These
will be termed \sphinxstyleemphasis{general clarification}.


\subsubsection{Handling clarification requests}
\label{\detokenize{running:handling-clarification-requests}}
\sphinxAtStartPar
Under Clarifications, three lists are shown: new clarifications,
answered clarifications and general clarifications. Click the excerpt
for details about that clarification request.

\sphinxAtStartPar
Every incoming clarification request will initially be marked as
unanswered. The menu bar shows the number of unanswered requests. A
request will be marked as answered when a response has been sent.
Additionally it’s possible to mark a clarification request as answered
with the button that can be found when viewing the request. The latter
can be used when the request has been dealt with in some other way,
for example by sending a general message to all teams.

\sphinxAtStartPar
An answer to a clarification request is made by putting the text in the
input box under the request text. The original text is quoted. You can
choose to either send it to the team that requested the clarification,
or to all teams. In the latter case, make sure you phrase it in such a
way that the message is self\sphinxhyphen{}contained (e.g. by keeping the quoted
text), since the other teams cannot view the original request.

\sphinxAtStartPar
In the DOMjudge configuration under \sphinxcode{\sphinxupquote{clar\_answers}} you can set predefined
clarification responses that can be selected when processing incoming
clarifications.


\subsubsection{Clarification categories and queues}
\label{\detokenize{running:clarification-categories-and-queues}}
\sphinxAtStartPar
When sending a clarification request, the team needs to select an
appropriate \sphinxstyleemphasis{category} (or \sphinxstyleemphasis{subject}). DOMjudge will generate a category
for every problem in every active contest. You can define additional
categories in the DOMjudge configuration under \sphinxcode{\sphinxupquote{clar\_categories}}.

\sphinxAtStartPar
Categories are hence visible to the teams and they need to select one.
In addition to this there’s the concept of \sphinxstyleemphasis{queues}. Queues are purely
internal to the jury, not visible to the outside world and can be used
for internal workload assignment. In the DOMjudge configuration you can
define in \sphinxcode{\sphinxupquote{clar\_queues}} the available queues and a
\sphinxcode{\sphinxupquote{clar\_default\_problem\_queue}} where newly created requests will end up in.
On the clarification overview page, you can quickly assign incoming
clarifications to a queue by pressing the queue’s button in the table row.


\subsection{Balloon handling}
\label{\detokenize{running:balloon-handling}}\label{\detokenize{running:balloons}}
\sphinxAtStartPar
According to ICPC tradition, every solved problem earns the team a
balloon in colour specific to that problem. This can be facilitated
with the balloons interface reachable from the main menu.

\sphinxAtStartPar
The interface can be accessed by administrators and any user with
the \sphinxstyleemphasis{Balloon runner} role. It’s possible to assign a user only this
role; they will be able to access the jury interface but only see
and handle balloons. You need to enable balloons processing for a
contest in the configuration under the Contests menu option.

\sphinxAtStartPar
For each first correct submission of a problem by a team, an entry
is created in the table on the balloons interface. A runner can then
be dispatched to hand out the inflatable award. The entry can be
marked as ‘done’ by clicking the running person at the end of the row.

\sphinxAtStartPar
Each row will also list the total amount of balloons that team has
earned so the runner can compare the resulting situation at the
team’s workplace with the expected one. Where applicable there’s
also an indication of whether this balloon is the first in the entire
contest, or the first for that problem to be handed out, should
you wish to do something special with these cases.

\sphinxAtStartPar
Normally balloon distribution stops when the scoreboard is frozen.
This will be indicated in the interface and no new entries will
show for submissions after the freeze. It is possible that new
entries appear for some times after the freeze, if the result of
a submission before the freeze is only known after (this can also
happen in case of a {\hyperref[\detokenize{judging:rejudging}]{\sphinxcrossref{\DUrole{std,std-ref}{Rejudging}}}}).
The global configuration option \sphinxcode{\sphinxupquote{show\_balloons\_postfreeze}} will
ignore a contest freeze for purposes of balloons and new correct
submissions will trigger a balloon entry in the table.


\subsection{Static scoreboard}
\label{\detokenize{running:static-scoreboard}}
\sphinxAtStartPar
The public scoreboard can be output in ‘static’ form meaning it does
not contain any interactive elements or refresh facilities. This you
can use if you need to publish the scoreboard as an HTML webpage
somewhere externally.

\sphinxAtStartPar
To get the static version, add \sphinxcode{\sphinxupquote{?static=1}} as an URL parameter to
the \sphinxcode{\sphinxupquote{public/}} scoreboard URL. You can additionally add a
\sphinxcode{\sphinxupquote{\&contest=}} with the contest ID of a specific contest to output.
The contest ID can also be the special value \sphinxcode{\sphinxupquote{auto}} which selects
the most recently activated contest.

\sphinxstepscope


\section{Judging topics}
\label{\detokenize{judging:judging-topics}}\label{\detokenize{judging::doc}}

\subsection{Flow of a submission}
\label{\detokenize{judging:flow-of-a-submission}}
\sphinxAtStartPar
The flow of an incoming submission is as follows.
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{.}%
\item {} 
\sphinxAtStartPar
Team submits solution. It will either be rejected after basic
checks, or accepted and stored as a \sphinxstyleemphasis{submission}.

\item {} 
\sphinxAtStartPar
The first available \sphinxstyleemphasis{judgehost} compiles, runs and checks
the submission. The outcome and outputs are stored as a
\sphinxstyleemphasis{judging} of this submission. If parallel judging is enabled,
multiple judgehosts may pick up and work on the same submission
(if there is no queue of pending submissions).

\item {} 
\sphinxAtStartPar
To avoid starving other teams from judgehost resources,
submissions from teams that submit while they have other submissions
in the judge queue will get lower priority than a submission from a team that has no earlier submission being judged yet.

\item {} 
\sphinxAtStartPar
If verification is not required, the result is automatically
recorded and the team can view the result and the scoreboard is
updated (unless after the scoreboard freeze). A judge can
optionally inspect the submission and judging and mark it
verified.

\item {} 
\sphinxAtStartPar
If verification is required, a judge inspects the judging. Only
after it has been approved (marked as \sphinxstyleemphasis{verified}) will
the result be visible outside the jury interface. This option
can be enabled by setting \sphinxcode{\sphinxupquote{verification\_required}} on
the \sphinxstyleemphasis{configuration settings} admin page.

\end{enumerate}


\subsection{Rejudging}
\label{\detokenize{judging:rejudging}}\label{\detokenize{judging:id1}}
\sphinxAtStartPar
In some situations it is necessary to rejudge one or more submissions. This means
that the submission will re\sphinxhyphen{}enter the flow as if it had not been
judged before. The submittime will be the original time, but the
program will be compiled, run and tested again.

\sphinxAtStartPar
This can be useful when there was some kind of problem: a compiler
that was broken and later fixed, or testdata that was incorrect and
later changed. When a submission is rejudged, the old judging data is
kept but marked as \sphinxstyleemphasis{invalid}.

\sphinxAtStartPar
You can rejudge a single submission by pressing the ‘Rejudge’ button
when viewing the submission details. It is also possible to rejudge
all submissions for a given language, problem, team or judgehost; to
do so, go to the page of the respective language, problem, team or
judgehost, press the ‘Rejudge all’ button and confirm.

\sphinxAtStartPar
There are two different ways to run a rejudging, depending on whether
the \sphinxstyleemphasis{create rejudging} button is enabled:
\begin{itemize}
\item {} 
\sphinxAtStartPar
Without this button toggled, an instant rejudging is
performed where the results are directly made effective.

\item {} 
\sphinxAtStartPar
When toggled, a “rejudging” set is created, and all affected
submissions are rejudged, but the new judgings are not made
effective yet. Instead, the jury can inspect the results of the
rejudging (under the rejudging tab). Based on that the whole
rejudging, as a set, can be applied or cancelled, keeping the old
judgings as is.

\end{itemize}

\sphinxAtStartPar
Submissions that have been marked as ‘CORRECT’ will not be rejudged.
Only DOMjudge admins can override this restriction using a tickbox.

\sphinxAtStartPar
Teams will not get explicit notifications of rejudgings, other than a
potentially changed outcome of their submissions. It might be desirable
to combine rejudging with a clarification to the team or all teams
explaining what has been rejudged and why.


\subsection{Ignoring a submission}
\label{\detokenize{judging:ignoring-a-submission}}
\sphinxAtStartPar
There is the option to \sphinxstyleemphasis{ignore} specific submissions
using the button on the submission page. When a submission is being
ignored, it is as if was never submitted: it will show strike\sphinxhyphen{}through
in the jury’s and affected team’s submission list, and it is not
visible on the scoreboard. This can be used to effectively
delete a submission for some reason, e.g. when a team erroneously sent
it for the wrong problem. The submission can also be unignored again.


\subsection{Enforcement of time limits}
\label{\detokenize{judging:enforcement-of-time-limits}}
\sphinxAtStartPar
Time limits within DOMjudge are enforced primarily in CPU time, and
secondly a more lax wall clock time limit is used to make sure that
submissions cannot idle and hog judgedaemons. The way that time limits
are calculated and passed through the system involves a number of
steps.

\sphinxAtStartPar
Time limits are set per problem in seconds. Each language in turn may
define a time factor (defaulting to 1) that multiplies it to get a
specific time limit for that problem/language combination. This is
the ‘soft timelimit’. The configuration setting \sphinxtitleref{timelimit
overshoot} is then used to calculate a ‘hard timelimit’.
This overshoot can be specified in terms of an absolute and relative
margin.

\sphinxAtStartPar
The \sphinxtitleref{soft:hard} timelimit pair is passed to \sphinxtitleref{runguard}, the wrapper
program that applies restrictions to submissions when they are being
run, as both wall clock and CPU limit. This is used by \sphinxtitleref{runguard} when
reporting whether the soft, actual timelimit has been surpassed. The
submitted program gets killed when either the hard wall clock or CPU
time has passed.


\subsection{Judging consistency}
\label{\detokenize{judging:judging-consistency}}\label{\detokenize{judging:id2}}
\sphinxAtStartPar
The following issues can be considered to improve consistency in
judging.

\sphinxAtStartPar
Disable CPU frequency scaling and Intel “Turbo Boost” to
prevent fluctuations in CPU power.

\sphinxAtStartPar
Disable address\sphinxhyphen{}space randomization to make programs with
memory addressing bugs give more reproducible results. To
do that, you can add the following line to \sphinxcode{\sphinxupquote{/etc/sysctl.conf}}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{kernel}\PYG{o}{.}\PYG{n}{randomize\PYGZus{}va\PYGZus{}space}\PYG{o}{=}\PYG{l+m+mi}{0}
\end{sphinxVerbatim}

\sphinxAtStartPar
Then run the following command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{sysctl} \PYG{o}{\PYGZhy{}}\PYG{n}{p}
\end{sphinxVerbatim}

\sphinxAtStartPar
to directly activate this setting.


\subsection{Lazy judging and results priority}
\label{\detokenize{judging:lazy-judging-and-results-priority}}
\sphinxAtStartPar
In order to increase capacity, you can set the DOMjudge configuration option
\sphinxcode{\sphinxupquote{lazy\_eval\_results}}. When enabled, judging of a submission will stop when
a highest priority result has been found for any testcase. You can find these
priorities under the \sphinxcode{\sphinxupquote{results\_prio}} setting. In the default configuration,
when enabling this, judging will stop with said verdict when a testcase
results in e.g. \sphinxstyleemphasis{run\sphinxhyphen{}error}, \sphinxstyleemphasis{timelimit} or \sphinxstyleemphasis{wrong\sphinxhyphen{}answer}. When a testcase
is \sphinxstyleemphasis{correct} (lower priority), judging will continue to the next test case.
In other words, to arrive at a verdict of \sphinxstyleemphasis{correct}, all testcases will have
been evaluated, while any of the ‘error’ verdicts will immediately return this
answer for the submission and the other testcases will never be tested, since
the submission can never become correct anymore if one has failed.

\sphinxAtStartPar
Since many of the submissions are expected to have some kind of error, this
will significantly save on judging time.

\sphinxAtStartPar
When not using lazy judging, all testcases will always be ran for each
submission. The \sphinxcode{\sphinxupquote{results\_prio}} list will then determine which of the
individual testcase results will be the overall submission result:
the highest priority one. In case of a tie, the first occurring testcase
result with highest priority is returned.


\subsection{Disk space and cleanup}
\label{\detokenize{judging:disk-space-and-cleanup}}
\sphinxAtStartPar
The judgehost caches testcase and executable data and stores various
logs, compiled submissions, etc. on disk. Depending on the amount of
disk space available and size and length of the contest, you may run
out of free space. By default, the judgehost will start cleaning up
old judging data until there’s at least the amount of space free as
that is indicated in the configuration setting \sphinxcode{\sphinxupquote{diskspace\_error}}.

\sphinxAtStartPar
Do disable automatic cleanup, start the judgedaemon with the
\sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}diskspace\sphinxhyphen{}error}} commandline parameter. When that is set, the
judgehost will send back an internal error and disable itself until
it has been manually cleaned up. The script \sphinxcode{\sphinxupquote{dj\_judgehost\_cleanup}}
can be used for this task.

\sphinxAtStartPar
If for some reason a judgedaemon crashes, it can leave stale
bind\sphinxhyphen{}mounts to the chroot environment. Run
\sphinxcode{\sphinxupquote{dj\_judgehost\_cleanup mounts}} to clean these up. Run
\sphinxcode{\sphinxupquote{dj\_judgehost\_cleanup help}} for a list of all
commands.


\subsection{Solutions to common issues}
\label{\detokenize{judging:solutions-to-common-issues}}

\subsubsection{JVM and memory limits}
\label{\detokenize{judging:jvm-and-memory-limits}}
\sphinxAtStartPar
DOMjudge imposes memory limits on submitted solutions. These limits
are imposed before the compiled submissions are started. On the other
hand, the Java virtual machine is started via a compile\sphinxhyphen{}time generated
script which is run as a wrapper around the program. This means that
the memory limits imposed by DOMjudge are for the jvm and the running
program within it. As the jvm uses approximately 300MB, this reduces
the limit by this significant amount. See the \sphinxtitleref{java\_javac} and
\sphinxtitleref{java\_javac\_detect} compile executable scripts for the
implementation details.

\sphinxAtStartPar
If you see error messages of the form:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{Error} \PYG{n}{occurred} \PYG{n}{during} \PYG{n}{initialization} \PYG{n}{of} \PYG{n}{VM}
\PYG{n}{java}\PYG{o}{.}\PYG{n}{lang}\PYG{o}{.}\PYG{n}{OutOfMemoryError}\PYG{p}{:} \PYG{n}{unable} \PYG{n}{to} \PYG{n}{create} \PYG{n}{new} \PYG{n}{native} \PYG{n}{thread}
\end{sphinxVerbatim}

\sphinxAtStartPar
or:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{Error} \PYG{n}{occurred} \PYG{n}{during} \PYG{n}{initialization} \PYG{n}{of} \PYG{n}{VM}
\PYG{n}{Could} \PYG{o+ow}{not} \PYG{n}{reserve} \PYG{n}{enough} \PYG{n}{space} \PYG{k}{for} \PYG{n+nb}{object} \PYG{n}{heap}
\end{sphinxVerbatim}

\sphinxAtStartPar
Then the problem is likely that the jvm needs more memory than what is
reserved by the Java compile script. You should try to increase the
\sphinxtitleref{MEMRESERVED} variable in the java compile executable and check that
the configuration variable \sphinxtitleref{memory limit} is set larger than
\sphinxtitleref{MEMRESERVED}. If that does not help, you should try to increase the
configuration variable \sphinxtitleref{process limit} (since the JVM uses a lot of
processes for garbage collection).


\subsubsection{‘runguard: root privileges not dropped’}
\label{\detokenize{judging:runguard-root-privileges-not-dropped}}
\sphinxAtStartPar
When this error occurs on submitting any source:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{Compiling} \PYG{n}{failed} \PYG{k}{with} \PYG{n}{exitcode} \PYG{l+m+mi}{255}\PYG{p}{,} \PYG{n}{compiler} \PYG{n}{output}\PYG{p}{:}
\PYG{o}{/}\PYG{n}{home}\PYG{o}{/}\PYG{n}{domjudge}\PYG{o}{/}\PYG{n}{system}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{runguard}\PYG{p}{:} \PYG{n}{root} \PYG{n}{privileges} \PYG{o+ow}{not} \PYG{n}{dropped}
\end{sphinxVerbatim}

\sphinxAtStartPar
this indicates that you are running the \sphinxtitleref{judgedaemon} as root user. You should
not run any part of DOMjudge as root; the parts that require it will gain root
by themselves through sudo. Either run it as yourself or, probably better,
create dedicated a user \sphinxtitleref{domjudge} under which to install and run everything.

\begin{sphinxadmonition}{attention}{Attention:}
\sphinxAtStartPar
Do not confuse this with the \sphinxtitleref{domjudge\sphinxhyphen{}run} user:
this is a special user to run submissions as and should also not
be used to run normal DOMjudge processes; this user is only for
internal use.
\end{sphinxadmonition}


\subsubsection{‘found processes still running … apport’}
\label{\detokenize{judging:found-processes-still-running-apport}}
\sphinxAtStartPar
If you see error messages of the form:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{error}\PYG{p}{:} \PYG{n}{found} \PYG{n}{processes} \PYG{n}{still} \PYG{n}{running} \PYG{k}{as} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{domjudge\PYGZhy{}run}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{n}{check} \PYG{n}{manually}\PYG{p}{:}
\PYG{l+m+mi}{2342} \PYG{n}{apport}
\end{sphinxVerbatim}

\sphinxAtStartPar
Then you still have \sphinxcode{\sphinxupquote{apport}} installed and running. This error message occurs when
judging submissions that trigger a segmentation fault. Disable or uninstall the apport
daemon on all judgehosts.

\sphinxstepscope


\section{Development}
\label{\detokenize{develop:development}}\label{\detokenize{develop::doc}}

\subsection{API}
\label{\detokenize{develop:api}}\label{\detokenize{develop:id1}}
\sphinxAtStartPar
DOMjudge comes with a fully featured REST API. It is based on the
\sphinxhref{https://ccs-specs.icpc.io/2021-11/contest\_api}{CCS Contest API specification}
to which some DOMjudge\sphinxhyphen{}specific API endpoints have been added. Full documentation
on the available API endpoints can be found at
\sphinxtitleref{http(s)://yourhost.example.edu/domjudge/api/doc}.

\sphinxAtStartPar
DOMjudge also offers an \sphinxhref{https://swagger.io/specification/}{OpenAPI Specification ver. 3}
compatible JSON file, which can be found at
\sphinxtitleref{http(s)://yourhost.example.edu/domjudge/api/doc.json}.


\subsection{Bootstrapping from Git repository sources}
\label{\detokenize{develop:bootstrapping-from-git-repository-sources}}\label{\detokenize{develop:bootstrap}}
\sphinxAtStartPar
The installation steps in this document assume that you are using a
downloaded tarball from the DOMjudge website. If you want to install
from Git repository sources, because you want to use the bleeding edge
code or consider to send a patch to the developers, the
configure/build system first has to be bootstrapped.

\sphinxAtStartPar
You can either spin up a development \sphinxhref{https://hub.docker.com/r/domjudge/domjudge-contributor}{Docker container} or install locally.

\sphinxAtStartPar
The local install requires the GNU autoconf/automake toolset to be installed,
and various tools to build the documentation.

\sphinxAtStartPar
On Debian(\sphinxhyphen{}based) systems, the following apt command should
install the packages that are required (additionally to the ones
already listed under
{\hyperref[\detokenize{install-domserver:domserver-requirements}]{\sphinxcrossref{\DUrole{std,std-ref}{domserver}}}},
{\hyperref[\detokenize{install-judgehost:judgehost-requirements}]{\sphinxcrossref{\DUrole{std,std-ref}{judgehost}}}} and
{\hyperref[\detokenize{install-workstation:submit-client-requirements}]{\sphinxcrossref{\DUrole{std,std-ref}{submit client}}}} requirements):

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{apt} \PYG{n}{install} \PYG{n}{autoconf} \PYG{n}{automake} \PYG{n}{bats} \PYGZbs{}
  \PYG{n}{python}\PYG{o}{\PYGZhy{}}\PYG{n}{sphinx} \PYG{n}{python}\PYG{o}{\PYGZhy{}}\PYG{n}{sphinx}\PYG{o}{\PYGZhy{}}\PYG{n}{rtd}\PYG{o}{\PYGZhy{}}\PYG{n}{theme} \PYG{n}{rst2pdf} \PYG{n}{fontconfig} \PYG{n}{python3}\PYG{o}{\PYGZhy{}}\PYG{n}{yaml} \PYG{n}{latexmk}
\end{sphinxVerbatim}

\sphinxAtStartPar
On Debian 11 (Bullseye) and above, instead install:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{sudo} \PYG{n}{apt} \PYG{n}{install} \PYG{n}{autoconf} \PYG{n}{automake} \PYG{n}{bats} \PYGZbs{}
  \PYG{n}{python3}\PYG{o}{\PYGZhy{}}\PYG{n}{sphinx} \PYG{n}{python3}\PYG{o}{\PYGZhy{}}\PYG{n}{sphinx}\PYG{o}{\PYGZhy{}}\PYG{n}{rtd}\PYG{o}{\PYGZhy{}}\PYG{n}{theme} \PYG{n}{rst2pdf} \PYG{n}{fontconfig} \PYG{n}{python3}\PYG{o}{\PYGZhy{}}\PYG{n}{yaml} \PYGZbs{}
  \PYG{n}{latexmk} \PYG{n}{texlive}\PYG{o}{\PYGZhy{}}\PYG{n}{latex}\PYG{o}{\PYGZhy{}}\PYG{n}{recommended} \PYG{n}{texlive}\PYG{o}{\PYGZhy{}}\PYG{n}{latex}\PYG{o}{\PYGZhy{}}\PYG{n}{extra} \PYG{n}{tex}\PYG{o}{\PYGZhy{}}\PYG{n}{gyre}
\end{sphinxVerbatim}

\sphinxAtStartPar
When this software is present, bootstrapping can be done by running
\sphinxcode{\sphinxupquote{make dist}}, which creates the \sphinxcode{\sphinxupquote{configure}} script,
downloads and installs the PHP dependencies via composer and
generates documentation from RST/LaTeX sources.


\subsection{Maintainer mode installation}
\label{\detokenize{develop:maintainer-mode-installation}}
\sphinxAtStartPar
DOMjudge provides a special maintainer mode installation.
This method does an in\sphinxhyphen{}place installation within the source
tree. This allows one to immediately see effects when modifying
code.

\sphinxAtStartPar
This method requires some special steps which can most easily
be run via makefile rules as follows:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{make} \PYG{n}{maintainer}\PYG{o}{\PYGZhy{}}\PYG{n}{conf} \PYG{p}{[}\PYG{n}{CONFIGURE\PYGZus{}FLAGS}\PYG{o}{=}\PYG{o}{\PYGZlt{}}\PYG{n}{extra} \PYG{n}{options} \PYG{k}{for} \PYG{o}{.}\PYG{o}{/}\PYG{n}{configure}\PYG{o}{\PYGZgt{}}\PYG{p}{]}
\PYG{n}{make} \PYG{n}{maintainer}\PYG{o}{\PYGZhy{}}\PYG{n}{install}
\end{sphinxVerbatim}

\sphinxAtStartPar
Note that these targets have to be executed \sphinxstyleemphasis{separately} and
they replace the steps described in the chapters on installing
the DOMserver or Judgehost.


\subsection{Makefile structure}
\label{\detokenize{develop:makefile-structure}}
\sphinxAtStartPar
The Makefiles in the source tree use a recursion mechanism to run make
targets within the relevant subdirectories. The recursion is handled
by the \sphinxcode{\sphinxupquote{REC\_TARGETS}} and \sphinxcode{\sphinxupquote{SUBDIRS}} variables and the
recursion step is executed in \sphinxcode{\sphinxupquote{Makefile.global}}. Any target
added to the \sphinxcode{\sphinxupquote{REC\_TARGETS}} list will be recursively called in
all directories in \sphinxcode{\sphinxupquote{SUBDIRS}}. Moreover, a local variant of the
target with \sphinxcode{\sphinxupquote{\sphinxhyphen{}l}} appended is called after recursing into the
subdirectories, so recursion is depth\sphinxhyphen{}first.

\sphinxAtStartPar
The targets \sphinxcode{\sphinxupquote{dist}}, \sphinxcode{\sphinxupquote{clean}}, \sphinxcode{\sphinxupquote{distclean}}, \sphinxcode{\sphinxupquote{maintainer\sphinxhyphen{}clean}}
are recursive by default, which means that these call their local
\sphinxcode{\sphinxupquote{\sphinxhyphen{}l}} variants in all directories containing a Makefile. This
allows for true depth\sphinxhyphen{}first traversal, which is necessary to correctly
run the \sphinxcode{\sphinxupquote{*clean}} targets: otherwise e.g. \sphinxcode{\sphinxupquote{paths.mk}} will
be deleted before subdirectory \sphinxcode{\sphinxupquote{*clean}} targets are called that
depend on information in it.


\subsection{Debugging and developing}
\label{\detokenize{develop:debugging-and-developing}}
\sphinxAtStartPar
While working on DOMjudge, it is useful to run the Symfony webapp in
development mode to have access to the profiling and debugging
interfaces and extended logging. To run in development mode, create
the file \sphinxcode{\sphinxupquote{webapp/.env.local}} and add to it the setting
\sphinxcode{\sphinxupquote{APP\_ENV=dev}}. This is automatically done when running \sphinxcode{\sphinxupquote{make
maintainer\sphinxhyphen{}install}} when the file did not exist before.
For more details see the \sphinxhref{https://symfony.com/doc/current/configuration/dot-env-changes.html}{Symfony documentation}.

\sphinxAtStartPar
The \sphinxcode{\sphinxupquote{webapp/.env.local}} file can also be used to overwrite the database
version. This is needed to automatically generate migrations based on the
current database compared to the models. To set the correct version, add a line
to \sphinxcode{\sphinxupquote{webapp/.env.local}} with the following contents:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
DATABASE\PYGZus{}URL=mysql://\PYGZlt{}user\PYGZgt{}:\PYGZlt{}password\PYGZgt{}@\PYGZlt{}host\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYGZlt{}database\PYGZgt{}?serverVersion=\PYGZlt{}version\PYGZgt{}
\end{sphinxVerbatim}

\sphinxAtStartPar
Replace the following:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{\textless{}user\textgreater{}}} with the database user.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{\textless{}password\textgreater{}}} with the database password.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{\textless{}host\textgreater{}}} with the database host.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{\textless{}port\textgreater{}}} with the database port, probably 3306.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{\textless{}version\textgreater{}}} with the server version. For MySQL use the server version
like \sphinxcode{\sphinxupquote{5.7.0}}. For MariaDB use something like \sphinxcode{\sphinxupquote{mariadb\sphinxhyphen{}10.5.9}}.

\end{itemize}

\sphinxAtStartPar
Everything except \sphinxcode{\sphinxupquote{\textless{}version\textgreater{}}} can be found in \sphinxcode{\sphinxupquote{etc/dbpasswords.secret}}.

\sphinxAtStartPar
For the judgeadaemon, use the \sphinxcode{\sphinxupquote{\sphinxhyphen{}v}} commandline option to increase
verbosity. It takes a numeric argument corresponding to the syslog
loglevels. Use \sphinxcode{\sphinxupquote{\sphinxhyphen{}v 7}} to enable loglevel debug. This will also show
detailed debugging information from the scripts invoked by the
judgedaemon.

\sphinxAtStartPar
A special case is the API user with only the \sphinxstyleemphasis{judgedaemon} role. For
this user, Symfony profiling is disabled on the API for performance
reasons even in dev mode. If you should wish to profile these API calls
specifically, change \sphinxcode{\sphinxupquote{webapp/src/EventListener/ProfilerDisableListener.php}}
to enable it.


\subsection{Running the test suite}
\label{\detokenize{develop:running-the-test-suite}}
\sphinxAtStartPar
The DOMjudge sources ship with a comprehensive test\sphinxhyphen{}suite that contains
unit, integration and functional tests to make sure the system works.

\sphinxAtStartPar
These tests live in the \sphinxcode{\sphinxupquote{webapp/tests}} directory.

\sphinxAtStartPar
To run them, follow the following steps:
\begin{itemize}
\item {} 
\sphinxAtStartPar
Make sure you have a working DOMjudge installation.

\item {} 
\sphinxAtStartPar
Create a new database with the same name as your normal database, but then
postfixed with \sphinxcode{\sphinxupquote{\_test}}. Make sure your database user has the same permissions
on it as the normal database.

\item {} 
\sphinxAtStartPar
Make sure your test database contains only the sample data. This can be done by
first dropping any existing database and then running
\sphinxcode{\sphinxupquote{APP\_ENV=test bin/dj\_setup\_database \sphinxhyphen{}u root \sphinxhyphen{}r install}}.

\end{itemize}

\sphinxAtStartPar
Note that you don’t have to drop and recreate the database every time you run the
tests; the tests are written in such a way that they keep working, even if you
run them multiple times.

\sphinxAtStartPar
The file \sphinxcode{\sphinxupquote{webapp/.env.test}} (and \sphinxcode{\sphinxupquote{webapp/.env.test.local}} if it
exists) are loaded when you run the unit tests. You can thus place any
test\sphinxhyphen{}specific settings in there.

\sphinxAtStartPar
Now to run the tests, execute the command:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{webapp}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{phpunit} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{n}{webapp}\PYG{o}{/}\PYG{n}{phpunit}\PYG{o}{.}\PYG{n}{xml}\PYG{o}{.}\PYG{n}{dist}
\end{sphinxVerbatim}

\sphinxAtStartPar
This command can take an argument \sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}filter}} to which you can pass a string
which will be used to filter which tests to run. For example, to run only the
jury print controller tests, run:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{webapp}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{phpunit} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{n}{webapp}\PYG{o}{/}\PYG{n}{phpunit}\PYG{o}{.}\PYG{n}{xml}\PYG{o}{.}\PYG{n}{dist} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n+nb}{filter} \PYGZbs{}
  \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{App}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{Tests}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{Controller}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{Jury}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{PrintControllerTest}\PYG{l+s+s1}{\PYGZsq{}}
\end{sphinxVerbatim}

\sphinxAtStartPar
Or to run only one test in that class, you can run:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{webapp}\PYG{o}{/}\PYG{n+nb}{bin}\PYG{o}{/}\PYG{n}{phpunit} \PYG{o}{\PYGZhy{}}\PYG{n}{c} \PYG{n}{webapp}\PYG{o}{/}\PYG{n}{phpunit}\PYG{o}{.}\PYG{n}{xml}\PYG{o}{.}\PYG{n}{dist} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n+nb}{filter} \PYGZbs{}
  \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{App}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{Tests}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{Controller}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{Jury}\PYG{l+s+se}{\PYGZbs{}\PYGZbs{}}\PYG{l+s+s1}{PrintControllerTest::testPrintingDisabledJuryIndexPage}
\end{sphinxVerbatim}

\sphinxAtStartPar
Note that most IDEs have support for running tests inside of them, so you don’t
have to type these filters manually. If you use such an IDE, just make sure to
specify the \sphinxtitleref{webapp/phpunit.xml.dist} file as a PHPUnit configuration file and
it should work.


\subsection{Loading development fixture data}
\label{\detokenize{develop:loading-development-fixture-data}}
\sphinxAtStartPar
To debug failing Unit tests the fixtures can be loaded with:
\sphinxcode{\sphinxupquote{./webapp/bin/console domjudge:load\sphinxhyphen{}development\sphinxhyphen{}data SampleSubmissionsFixture}} in the current database.


\section{Appendices}
\label{\detokenize{index:appendices}}
\sphinxstepscope


\subsection{Appendix: Quick installation checklist}
\label{\detokenize{quick-install:appendix-quick-installation-checklist}}\label{\detokenize{quick-install::doc}}
\begin{sphinxadmonition}{note}{Note:}
\sphinxAtStartPar
This is not a replacement for the thorough installation
instructions, but more a cheat\sphinxhyphen{}sheet for those who’ve already
installed DOMjudge before and need a few hints. When in doubt, always
consult the full installation instruction.
\end{sphinxadmonition}


\subsubsection{DOMserver}
\label{\detokenize{quick-install:domserver}}\begin{itemize}
\item {} 
\sphinxAtStartPar
Install the MySQL\sphinxhyphen{} or MariaDB\sphinxhyphen{}server and set a root password for it.

\item {} 
\sphinxAtStartPar
Install either nginx or Apache and PHP.

\item {} 
\sphinxAtStartPar
Make sure PHP works for the web server and command line scripts.

\item {} 
\sphinxAtStartPar
Extract the \sphinxhref{https://www.domjudge.org/download}{source tarball} and run
\sphinxcode{\sphinxupquote{./configure \sphinxhyphen{}\sphinxhyphen{}with\sphinxhyphen{}baseurl=\textless{}url\textgreater{} \&\& make domserver}}.

\item {} 
\sphinxAtStartPar
Run \sphinxcode{\sphinxupquote{sudo make install\sphinxhyphen{}domserver}} to install the system.

\item {} 
\sphinxAtStartPar
Install the MySQL database using e.g.
\sphinxcode{\sphinxupquote{bin/dj\_setup\_database \sphinxhyphen{}u root \sphinxhyphen{}r install}}.

\item {} 
\sphinxAtStartPar
For Apache: add \sphinxcode{\sphinxupquote{etc/apache.conf}} to your Apache configuration and
add \sphinxcode{\sphinxupquote{etc/domjudge\sphinxhyphen{}fpm.conf}} to your PHP FPM pool directory, edit
it to your needs, reload web server
\begin{sphinxalltt}
sudo ln \sphinxhyphen{}s \textless{}DOMSERVER\_INSTALL\_PATH\textgreater{}/etc/apache.conf /etc/apache2/conf\sphinxhyphen{}available/domjudge.conf
sudo ln \sphinxhyphen{}s \textless{}DOMSERVER\_INSTALL\_PATH\textgreater{}/etc/domjudge\sphinxhyphen{}fpm.conf /etc/php/{\color{red}\bfseries{}|phpversion|}/fpm/pool.d/domjudge.conf
sudo a2enmod proxy\_fcgi setenvif rewrite
sudo a2enconf php{\color{red}\bfseries{}|phpversion|}\sphinxhyphen{}fpm domjudge
sudo service php{\color{red}\bfseries{}|phpversion|}\sphinxhyphen{}fpm reload
sudo service apache2 reload
\end{sphinxalltt}

\item {} 
\sphinxAtStartPar
For nginx: add \sphinxcode{\sphinxupquote{etc/nginx\sphinxhyphen{}conf}} to your nginx configuration and
add \sphinxcode{\sphinxupquote{etc/domjudge\sphinxhyphen{}fpm.conf}} to your PHP FPM pool directory, edit
it to your needs, reload web server
\begin{sphinxalltt}
sudo ln \sphinxhyphen{}s \textless{}DOMSERVER\_INSTALL\_PATH\textgreater{}/etc/nginx\sphinxhyphen{}conf /etc/nginx/sites\sphinxhyphen{}enabled/domjudge
sudo ln \sphinxhyphen{}s \textless{}DOMSERVER\_INSTALL\_PATH\textgreater{}/etc/domjudge\sphinxhyphen{}fpm.conf /etc/php/{\color{red}\bfseries{}|phpversion|}/fpm/pool.d/domjudge.conf
sudo service php{\color{red}\bfseries{}|phpversion|}\sphinxhyphen{}fpm reload
sudo service nginx reload
\end{sphinxalltt}

\item {} 
\sphinxAtStartPar
Check that the web interface works (/team, /public and /jury).

\item {} 
\sphinxAtStartPar
Check that the API (/api) works and create credentials for the judgehosts.

\item {} 
\sphinxAtStartPar
Create teams, user accounts and add useful contest data.

\item {} 
\sphinxAtStartPar
Run the config checker in the jury web interface.

\end{itemize}


\subsubsection{Judgehosts}
\label{\detokenize{quick-install:judgehosts}}\begin{itemize}
\item {} 
\sphinxAtStartPar
Extract the \sphinxhref{https://www.domjudge.org/download}{source tarball} and run
\sphinxcode{\sphinxupquote{./configure \sphinxhyphen{}\sphinxhyphen{}with\sphinxhyphen{}baseurl=\textless{}url\textgreater{} \&\& make judgehost}}.

\item {} 
\sphinxAtStartPar
Run \sphinxcode{\sphinxupquote{sudo make install\sphinxhyphen{}judgehost}} to install the system.

\item {} 
\sphinxAtStartPar
Create one or more unprivileged users:
\sphinxcode{\sphinxupquote{sudo useradd \sphinxhyphen{}d /nonexistent \sphinxhyphen{}U \sphinxhyphen{}M \sphinxhyphen{}s /bin/false domjudge\sphinxhyphen{}run\sphinxhyphen{}2}}.

\item {} 
\sphinxAtStartPar
Add to \sphinxcode{\sphinxupquote{/etc/sudoers.d/}} or append to \sphinxcode{\sphinxupquote{/etc/sudoers}} the
sudoers configuration as in \sphinxcode{\sphinxupquote{etc/sudoers\sphinxhyphen{}domjudge}}.

\item {} 
\sphinxAtStartPar
Set up cgroup support: enable kernel parameters in
\sphinxcode{\sphinxupquote{/etc/default/grub}} and reboot, then run
\sphinxcode{\sphinxupquote{systemctl enable create\sphinxhyphen{}cgroups \sphinxhyphen{}\sphinxhyphen{}now}} to create cgroups for DOMjudge.

\item {} 
\sphinxAtStartPar
Put the right credentials in the file \sphinxcode{\sphinxupquote{etc/restapi.secret}}.

\item {} 
\sphinxAtStartPar
Create the pre\sphinxhyphen{}built chroot tree: \sphinxcode{\sphinxupquote{sudo bin/dj\_make\_chroot}}

\item {} 
\sphinxAtStartPar
Start the judge daemon: either manually with \sphinxcode{\sphinxupquote{bin/judgedaemon \sphinxhyphen{}n 2}}
or as a service with \sphinxcode{\sphinxupquote{systemctl enable \sphinxhyphen{}\sphinxhyphen{}now domjudge\sphinxhyphen{}judgedaemon@2}}.

\end{itemize}


\subsubsection{Submit client}
\label{\detokenize{quick-install:submit-client}}\begin{itemize}
\item {} 
\sphinxAtStartPar
Install the provided \sphinxcode{\sphinxupquote{submit}} in your path and on the team machines.

\item {} 
\sphinxAtStartPar
Add a \sphinxcode{\sphinxupquote{.netrc}} file with valid team credentials.

\item {} 
\sphinxAtStartPar
Run \sphinxcode{\sphinxupquote{submit \sphinxhyphen{}\sphinxhyphen{}help}} to see if it can connect successfully.

\end{itemize}


\subsubsection{Checking if it works}
\label{\detokenize{quick-install:checking-if-it-works}}
\sphinxAtStartPar
It should be done by now. As a check that (almost) everything works,
the set of test sources can be submitted on the DOMserver, on
a system that has a working submit client installed:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{cd} \PYG{n}{tests}
\PYG{n}{make} \PYG{n}{check}
\end{sphinxVerbatim}

\sphinxAtStartPar
Then, in the main jury web interface, select the admin link
\sphinxstyleemphasis{judging verifier} to automatically verify most of the
test sources. Read the test sources for a description of
what should (not) happen.

\sphinxstepscope


\subsection{DOMjudge team manual}
\label{\detokenize{team:domjudge-team-manual}}\label{\detokenize{team::doc}}
\noindent{\hspace*{\fill}\sphinxincludegraphics[width=60bp,height=132bp]{{DOMjudgelogo}.png}}

\sphinxAtStartPar
This is the manual for the DOMjudge programming contest control system
version 8.3.
The summary below outlines the working of the system interface. It
is meant as a quick introduction, to be able to start using the system.
It is however strongly advised that your team reads the entire document.
There are specific details of this contest control system that might
become of importance when you run into problems.

\begin{sphinxadmonition}{note}{Summary}

\sphinxAtStartPar
The web interface of DOMjudge can be found at
\sphinxurl{https://example.com/domjudge/team}. See the two figures on the next page for
an impression.

\sphinxAtStartPar
Solutions have to read all input from ‘standard in’ and write all
output to ‘standard out’ (also known as console). You will never have
to open (other) files. Also see our {\hyperref[\detokenize{team:codeexamples}]{\sphinxcrossref{\DUrole{std,std-ref}{code examples}}}}.

\sphinxAtStartPar
You can submit solutions in two ways:
\begin{quote}
\begin{description}
\sphinxlineitem{Command\sphinxhyphen{}line}
\sphinxAtStartPar
Use \sphinxcode{\sphinxupquote{submit \textless{}filename\textgreater{}}}. If your filename is of the form
\sphinxcode{\sphinxupquote{\textless{}problem\textgreater{}.\textless{}extension\textgreater{}}} where \sphinxcode{\sphinxupquote{\textless{}problem\textgreater{}}} is the
label of the problem and \sphinxcode{\sphinxupquote{\textless{}extension\textgreater{}}} is a standard extension for
your language, then these will automatically be detected.
It will also try to auto\sphinxhyphen{}detect the main class (for Java and Kotlin) or the
main file (for Python). You can override these auto\sphinxhyphen{}detections;
for a complete reference of all options and examples, see \sphinxcode{\sphinxupquote{submit \sphinxhyphen{}\sphinxhyphen{}help}}.

\sphinxlineitem{Web interface}
\sphinxAtStartPar
From your team page, \sphinxurl{https://example.com/domjudge/team}, click the green \sphinxstylestrong{Submit}
button in the menu bar. Select the files you want to submit.
By default, the problem is selected from the base of the (first)
filename and the language from the extension. The web interface tries
to auto\sphinxhyphen{}detect the main class (for Java and Kotlin) or the main file (for
Python) from the file name. Double check that the guess is correct
before submitting.

\end{description}
\end{quote}

\sphinxAtStartPar
Viewing scores, submissions and sending and reading clarification
requests and replies is done through the web interface at
\sphinxurl{https://example.com/domjudge/team}.
\end{sphinxadmonition}



\clearpage


\subsubsection{Overview of the interface}
\label{\detokenize{team:overview-of-the-interface}}
\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics[width=0.800\linewidth]{{team-overview}.png}
\caption{The team web interface overview page.}\label{\detokenize{team:id3}}\end{figure}

\begin{figure}[htbp]
\centering
\capstart

\noindent\sphinxincludegraphics[width=0.800\linewidth]{{team-scoreboard}.png}
\caption{The scoreboard webpage.}\label{\detokenize{team:id4}}\end{figure}




\subsubsection{Submitting solutions}
\label{\detokenize{team:submitting-solutions}}\label{\detokenize{team:submitting}}
\sphinxAtStartPar
Submitting solutions can be done in two ways: with the command\sphinxhyphen{}line
program \sphinxcode{\sphinxupquote{submit}} (if installed) or using the web interface.


\paragraph{Command\sphinxhyphen{}line: \sphinxstyleliteralintitle{\sphinxupquote{submit}}}
\label{\detokenize{team:command-line-submit}}
\sphinxAtStartPar
Syntax:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{submit} \PYG{p}{[}\PYG{n}{options}\PYG{p}{]} \PYG{n}{filename}\PYG{o}{.}\PYG{n}{ext} \PYG{o}{.}\PYG{o}{.}\PYG{o}{.}
\end{sphinxVerbatim}

\sphinxAtStartPar
The submit program takes the name (label) of the problem from
\sphinxcode{\sphinxupquote{filename}} and the programming language from the extension
\sphinxcode{\sphinxupquote{ext}}.

\sphinxAtStartPar
For Java it uses the filename as a guess for the
main class; for Kotlin it capitalizes filename and appends
\sphinxcode{\sphinxupquote{Kt}} to compute the guess for the main class name. For Python,
the first filename is used as a guess for the main file.
These guesses can be overruled with the options
\sphinxcode{\sphinxupquote{\sphinxhyphen{}p problemname}}, \sphinxcode{\sphinxupquote{\sphinxhyphen{}l languageextension}} and
\sphinxcode{\sphinxupquote{\sphinxhyphen{}e entry\_point}}.

\sphinxAtStartPar
See \sphinxcode{\sphinxupquote{submit \sphinxhyphen{}\sphinxhyphen{}help}} for a complete list of all options,
extensions and some examples.

\sphinxAtStartPar
\sphinxcode{\sphinxupquote{submit}} will check your file and warns you for some problems:
for example when the file has not been modified for a long time or
when it’s larger than the maximum source code size
(see {\hyperref[\detokenize{team:runlimits}]{\sphinxcrossref{\DUrole{std,std-ref}{the section on restrictions}}}}).

\sphinxAtStartPar
Filenames must start with an alphanumerical character and may contain only
alphanumerical characters and \sphinxcode{\sphinxupquote{+.\textbackslash{}\_\sphinxhyphen{}}}. You can specify multiple files
to be part of this submission (see section
“{\hyperref[\detokenize{team:judgingprocess}]{\sphinxcrossref{\DUrole{std,std-ref}{How are submissions being judged?}}}}”).

\sphinxAtStartPar
Then \sphinxcode{\sphinxupquote{submit}} displays a summary with all details of your
submission and asks for confirmation. Check whether you are submitting
the right file for the right problem and language and press \sphinxcode{\sphinxupquote{y}} to
confirm. \sphinxcode{\sphinxupquote{submit}} will report a successful submission or give
an error message otherwise.


\paragraph{Web interface}
\label{\detokenize{team:web-interface}}
\sphinxAtStartPar
Solutions can be submitted from the web interface at \sphinxurl{https://example.com/domjudge/team}.
Click the green \sphinxstyleemphasis{Submit} button at the menu bar on every page.
Click the file selection button and select one or
multiple files for submission. DOMjudge will try to determine the
problem, language and main class (in case of Java and Kotlin) or main file
(in case of Python) from the base and extension of the first filename.
Otherwise, select the appropriate values.
Filenames must start with an alphanumerical character and may contain only
alphanumerical characters and \sphinxcode{\sphinxupquote{+.\textbackslash{}\_\sphinxhyphen{}}}.

\sphinxAtStartPar
After you hit the submit button and confirm the submission, you will
be redirected back to your submission list page. On this page, a message
will be displayed that your submission was successful and the
submission will be present in the list. An error message will be
displayed if something went wrong.


\subsubsection{Viewing the results of submissions}
\label{\detokenize{team:viewing-the-results-of-submissions}}
\sphinxAtStartPar
The left column of your team web page shows an overview of your submissions.
It contains all relevant information: submission time, programming
language, problem and status. The address of your team page is
\sphinxurl{https://example.com/domjudge/team}.

\sphinxAtStartPar
The top of the page shows your team’s row in the scoreboard: your position and
which problems you attempted and solved. Via the menu you can view the public
scoreboard page with the scores of all teams. Many cells will show
additional “title text” information when hovering over them. The
score column lists the number of solved problems and the total time including
penalty time. Each cell in a problem column lists the number of submissions,
and if the problem was solved, the time of the first correct
submission in minutes since contest start. This is included in your
total time together with any penalty time incurred for previous
incorrect submissions.

\sphinxAtStartPar
Optionally the scoreboard can be ‘frozen’ some time before the end of the
contest. The full scoreboard view will not be updated anymore, but your
team row on your overview page will be. Your team’s rank will then be
displayed as ‘?’.

\sphinxAtStartPar
Finally, via the top menu you can also view the list of problems and
view/download problem texts and sample data, if provided by the judges.


\paragraph{Possible results}
\label{\detokenize{team:possible-results}}
\sphinxAtStartPar
A submission can have the following results (not all of these may be
available depending on configuration of the system):
\begin{description}
\sphinxlineitem{CORRECT}
\sphinxAtStartPar
The submission passed all tests: you solved this problem!
\sphinxstyleemphasis{Correct submissions do not incur penalty time.}

\sphinxlineitem{COMPILER\sphinxhyphen{}ERROR}
\sphinxAtStartPar
There was an error when compiling your program. On the submission
details page you can inspect the exact error (this option might be
disabled).
Note that when compilation takes more than 30 seconds,
it is aborted and this counts as a compilation error.
\sphinxstyleemphasis{Compilation errors do not incur penalty time. The administrator of
the contest can change this scoring.}

\sphinxlineitem{TIMELIMIT}
\sphinxAtStartPar
Your program took longer than the maximum allowed time for this
problem. Therefore it has been aborted. This might indicate that your
program hangs in a loop or that your solution is not efficient
enough.

\sphinxlineitem{RUN\sphinxhyphen{}ERROR}
\sphinxAtStartPar
There was an error during the execution of your program. This can have
a lot of different causes like division by zero, incorrectly
addressing memory (e.g. by indexing arrays out of bounds), trying to
use more memory than the limit, reading or writing to files, etc.
Also check that your program exits with exit code 0!

\sphinxlineitem{NO\sphinxhyphen{}OUTPUT}
\sphinxAtStartPar
Your program did not generate any output. Check that you write to
standard out.

\sphinxlineitem{OUTPUT\sphinxhyphen{}LIMIT}
\sphinxAtStartPar
Your program generated more output than the allowed limit. The solution
is considered incorrect.

\sphinxlineitem{WRONG\sphinxhyphen{}ANSWER}
\sphinxAtStartPar
The output of your program was incorrect. This can happen simply
because your solution is not correct, but remember that your output
must comply exactly with the specifications of the judges. See
{\hyperref[\detokenize{team:testing}]{\sphinxcrossref{\DUrole{std,std-ref}{testing}}}} below for more details.

\sphinxlineitem{TOO\sphinxhyphen{}LATE}
\sphinxAtStartPar
Bummer, you submitted after the contest ended! Your submission is
stored but will not be processed anymore.

\end{description}

\sphinxAtStartPar
The judges may have prepared multiple test files for each problem.
DOMjudge will report back the first highest priority non\sphinxhyphen{}correct result as verdict.
\sphinxstyleemphasis{Your administrator can decide on different priorities for non\sphinxhyphen{}correct results.}


\subsubsection{Clarifications}
\label{\detokenize{team:clarifications}}
\sphinxAtStartPar
All communication with the judges is to be done through clarification
messages.
These can be found in the right column on your team page. Both
clarification replies from the judges and requests sent by you
are displayed there.

\sphinxAtStartPar
There is also a button to submit a new clarification request to the
judges; you can associate a specific problem or one of the general
categories to a request. This clarification request is only readable
for the judges. The judges can answer specifically to your team or send a
reply to everyone if it is relevant for all.


\subsubsection{How are submissions being judged?}
\label{\detokenize{team:how-are-submissions-being-judged}}\label{\detokenize{team:judgingprocess}}
\sphinxAtStartPar
The DOMjudge contest control system is fully automated.
Judging is done in the following way:


\paragraph{Submitting solutions}
\label{\detokenize{team:id1}}
\sphinxAtStartPar
With the \sphinxcode{\sphinxupquote{submit}} program or the web interface (see
{\hyperref[\detokenize{team:submitting}]{\sphinxcrossref{\DUrole{std,std-ref}{the section on submitting}}}}) you
can submit a solution to a problem to the judges. Note that you have to submit
the source code of your program (and not a compiled program or the output of
your program).

\sphinxAtStartPar
On the contest control system your program enters a queue, awaiting compilation,
execution and testing on one of the autojudges.


\paragraph{Compilation}
\label{\detokenize{team:compilation}}
\sphinxAtStartPar
Your program will be compiled on an autojudge machine running Linux.
All submitted source files will be passed to the compiler which
generates a single program to run. For Java and Kotlin the given
main class will be checked; for Python we do a
syntax check using the \sphinxcode{\sphinxupquote{py\_compile}} module.


\paragraph{Testing}
\label{\detokenize{team:testing}}\label{\detokenize{team:id2}}
\sphinxAtStartPar
After your program has compiled successfully it will be executed and
its output compared to the output of the judges. Before comparing the
output, the exit status of your program is checked: if your program
exits with a non\sphinxhyphen{}zero exit code, the result will be a run\sphinxhyphen{}error
even if the output of the program is correct!
There are some restrictions during execution. If your program violates
these it will also be aborted with a run\sphinxhyphen{}error,
see {\hyperref[\detokenize{team:runlimits}]{\sphinxcrossref{\DUrole{std,std-ref}{the section on restrictions}}}}.

\sphinxAtStartPar
When comparing program output, it has to exactly match to output of
the judges, except that some extra whitespace may be ignored (this
depends on the system configuration of the problems). So take care
that you follow the output specifications. In case of problem
statements which do not have unique output (e.g. with floating point
answers), the system may use a modified comparison function.
This will be documented in the problem description.


\paragraph{Restrictions}
\label{\detokenize{team:restrictions}}\label{\detokenize{team:runlimits}}
\sphinxAtStartPar
Submissions are run in a sandbox to prevent abuse, keep the jury system
stable and give everyone clear and equal environments. There
are some restrictions to which all submissions are subjected:
\begin{description}
\sphinxlineitem{compile time}
\sphinxAtStartPar
Compilation of your program may take no longer than 30
seconds. After that, compilation will be aborted and the result will
be a compile error. In practice this should never give rise to
problems. Should this happen to a normal program, please inform the
judges right away.

\sphinxlineitem{source size}
\sphinxAtStartPar
The total amount of source code in a single submission may not exceed
256 kilobytes, otherwise your submission will be rejected.

\sphinxlineitem{memory}
\sphinxAtStartPar
The judges will specify how much memory you have available during
execution of your program. This may vary per problem. It is the
total amount of memory (including program code, statically and
dynamically defined variables, stack, Java/Python VM, …)!
If your program tries to use more memory, it will most likely abort,
resulting in a run error.

\sphinxlineitem{creating new files}
\sphinxAtStartPar
Do not create new files. The sandbox will not allow this and the file open
function will return a failure. Using the file without handling this error can
result in a runtime error depending on the submission language.

\sphinxlineitem{number of processes}
\sphinxAtStartPar
You are not supposed to explicitly create multiple processes (threads). This is
to no avail anyway, because your program has exactly 1 processor core fully
at its disposal. DOMjudge executes submissions in a sandbox where a maximum
of 64 processes can be run simultaneously (including processes that
started your program).

\sphinxAtStartPar
People who have never programmed with multiple processes (or have
never heard of “threads”) do not have to worry: a normal program
runs in one process.

\end{description}




\subsubsection{Code examples}
\label{\detokenize{team:code-examples}}\label{\detokenize{team:codeexamples}}
\sphinxAtStartPar
Below are a few examples on how to read input and write output for a
problem.

\sphinxAtStartPar
The examples are solutions for the following problem: the first line
of the input contains the number of testcases. Then each testcase
consists of a line containing a name (a single word) of at most 99
characters. For each testcase output the string \sphinxcode{\sphinxupquote{Hello \textless{}name\textgreater{}!}}
on a separate line.

\sphinxAtStartPar
Sample input and output for this problem:


\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\centering
\begin{tabular}[t]{*{2}{\X{1}{2}}}
\sphinxtoprule
\sphinxstyletheadfamily 
\sphinxAtStartPar
Input
&\sphinxstyletheadfamily 
\sphinxAtStartPar
Output
\\
\sphinxmidrule
\sphinxtableatstartofbodyhook
\begin{DUlineblock}{0em}
\item[] \sphinxcode{\sphinxupquote{3}}
\item[] \sphinxcode{\sphinxupquote{world}}
\item[] \sphinxcode{\sphinxupquote{Jan}}
\item[] \sphinxcode{\sphinxupquote{SantaClaus}}
\end{DUlineblock}
&
\begin{DUlineblock}{0em}
\item[] \sphinxcode{\sphinxupquote{Hello world!}}
\item[] \sphinxcode{\sphinxupquote{Hello Jan!}}
\item[] \sphinxcode{\sphinxupquote{Hello SantaClaus!}}
\end{DUlineblock}
\\
\sphinxbottomrule
\end{tabular}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}

\sphinxAtStartPar
Note that the number \sphinxcode{\sphinxupquote{3}} on the first line indicates that 3 testcases
follow.

\sphinxAtStartPar
What follows is a number of possible solutions to this problem
for different programming languages.
\sphinxSetupCaptionForVerbatim{\sphinxstyleemphasis{A solution in C}}
\def\sphinxLiteralBlockLabel{\label{\detokenize{team:id5}}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{c+cp}{\PYGZsh{}}\PYG{c+cp}{include}\PYG{+w}{ }\PYG{c+cpf}{\PYGZlt{}stdio.h\PYGZgt{}}

\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n+nf}{main}\PYG{p}{(}\PYG{p}{)}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{	}\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n}{i}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{ntests}\PYG{p}{;}
\PYG{+w}{	}\PYG{k+kt}{char}\PYG{+w}{ }\PYG{n}{name}\PYG{p}{[}\PYG{l+m+mi}{100}\PYG{p}{]}\PYG{p}{;}

\PYG{+w}{	}\PYG{n}{scanf}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}}\PYG{l+s}{\PYGZpc{}d}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s}{\PYGZdq{}}\PYG{p}{,}\PYG{+w}{ }\PYG{o}{\PYGZam{}}\PYG{n}{ntests}\PYG{p}{)}\PYG{p}{;}

\PYG{+w}{	}\PYG{k}{for}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{i}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mi}{0}\PYG{p}{;}\PYG{+w}{ }\PYG{n}{i}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{n}{ntests}\PYG{p}{;}\PYG{+w}{ }\PYG{n}{i}\PYG{o}{+}\PYG{o}{+}\PYG{p}{)}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{		}\PYG{n}{scanf}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}}\PYG{l+s}{\PYGZpc{}s}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s}{\PYGZdq{}}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{name}\PYG{p}{)}\PYG{p}{;}
\PYG{+w}{		}\PYG{n}{printf}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}}\PYG{l+s}{Hello \PYGZpc{}s!}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s}{\PYGZdq{}}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{name}\PYG{p}{)}\PYG{p}{;}
\PYG{+w}{	}\PYG{p}{\PYGZcb{}}
\PYG{p}{\PYGZcb{}}
\end{sphinxVerbatim}

\clearpage
\sphinxSetupCaptionForVerbatim{\sphinxstyleemphasis{A solution in C++}}
\def\sphinxLiteralBlockLabel{\label{\detokenize{team:id6}}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{c+cp}{\PYGZsh{}}\PYG{c+cp}{include}\PYG{+w}{ }\PYG{c+cpf}{\PYGZlt{}iostream\PYGZgt{}}
\PYG{c+cp}{\PYGZsh{}}\PYG{c+cp}{include}\PYG{+w}{ }\PYG{c+cpf}{\PYGZlt{}string\PYGZgt{}}

\PYG{k}{using}\PYG{+w}{ }\PYG{k}{namespace}\PYG{+w}{ }\PYG{n+nn}{std}\PYG{p}{;}

\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n+nf}{main}\PYG{p}{(}\PYG{p}{)}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{	}\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n}{ntests}\PYG{p}{;}
\PYG{+w}{	}\PYG{n}{string}\PYG{+w}{ }\PYG{n}{name}\PYG{p}{;}

\PYG{+w}{	}\PYG{n}{cin}\PYG{+w}{ }\PYG{o}{\PYGZgt{}}\PYG{o}{\PYGZgt{}}\PYG{+w}{ }\PYG{n}{ntests}\PYG{p}{;}
\PYG{+w}{	}\PYG{k}{for}\PYG{+w}{ }\PYG{p}{(}\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n}{i}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mi}{0}\PYG{p}{;}\PYG{+w}{ }\PYG{n}{i}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{n}{ntests}\PYG{p}{;}\PYG{+w}{ }\PYG{n}{i}\PYG{o}{+}\PYG{o}{+}\PYG{p}{)}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{		}\PYG{n}{cin}\PYG{+w}{ }\PYG{o}{\PYGZgt{}}\PYG{o}{\PYGZgt{}}\PYG{+w}{ }\PYG{n}{name}\PYG{p}{;}
\PYG{+w}{		}\PYG{n}{cout}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}}\PYG{l+s}{Hello }\PYG{l+s}{\PYGZdq{}}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{n}{name}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}}\PYG{l+s}{!}\PYG{l+s}{\PYGZdq{}}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{n}{endl}\PYG{p}{;}
\PYG{+w}{	}\PYG{p}{\PYGZcb{}}
\PYG{p}{\PYGZcb{}}
\end{sphinxVerbatim}
\sphinxSetupCaptionForVerbatim{\sphinxstyleemphasis{A solution in Java}}
\def\sphinxLiteralBlockLabel{\label{\detokenize{team:id7}}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{c+c1}{// Note: do not use any \PYGZsq{}package\PYGZsq{} statements}

\PYG{k+kn}{import}\PYG{+w}{ }\PYG{n+nn}{java.util.*}\PYG{p}{;}

\PYG{k+kd}{class} \PYG{n+nc}{Main}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{	}\PYG{k+kd}{public}\PYG{+w}{ }\PYG{k+kd}{static}\PYG{+w}{ }\PYG{k+kt}{void}\PYG{+w}{ }\PYG{n+nf}{main}\PYG{p}{(}\PYG{n}{String}\PYG{o}{[}\PYG{o}{]}\PYG{+w}{ }\PYG{n}{args}\PYG{p}{)}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{		}\PYG{n}{Scanner}\PYG{+w}{ }\PYG{n}{scanner}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Scanner}\PYG{p}{(}\PYG{n}{System}\PYG{p}{.}\PYG{n+na}{in}\PYG{p}{)}\PYG{p}{;}
\PYG{+w}{		}\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n}{nTests}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{scanner}\PYG{p}{.}\PYG{n+na}{nextInt}\PYG{p}{(}\PYG{p}{)}\PYG{p}{;}

\PYG{+w}{		}\PYG{k}{for}\PYG{+w}{ }\PYG{p}{(}\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n}{i}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mi}{0}\PYG{p}{;}\PYG{+w}{ }\PYG{n}{i}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{n}{nTests}\PYG{p}{;}\PYG{+w}{ }\PYG{n}{i}\PYG{o}{+}\PYG{o}{+}\PYG{p}{)}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{			}\PYG{n}{String}\PYG{+w}{ }\PYG{n}{name}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{scanner}\PYG{p}{.}\PYG{n+na}{next}\PYG{p}{(}\PYG{p}{)}\PYG{p}{;}
\PYG{+w}{			}\PYG{n}{System}\PYG{p}{.}\PYG{n+na}{out}\PYG{p}{.}\PYG{n+na}{println}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}}\PYG{l+s}{Hello }\PYG{l+s}{\PYGZdq{}}\PYG{+w}{ }\PYG{o}{+}\PYG{+w}{ }\PYG{n}{name}\PYG{+w}{ }\PYG{o}{+}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}}\PYG{l+s}{!}\PYG{l+s}{\PYGZdq{}}\PYG{p}{)}\PYG{p}{;}
\PYG{+w}{		}\PYG{p}{\PYGZcb{}}
\PYG{+w}{	}\PYG{p}{\PYGZcb{}}
\PYG{p}{\PYGZcb{}}
\end{sphinxVerbatim}
\sphinxSetupCaptionForVerbatim{\sphinxstyleemphasis{A solution in Kotlin}}
\def\sphinxLiteralBlockLabel{\label{\detokenize{team:id8}}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{c+c1}{// Note: do not use any \PYGZsq{}package\PYGZsq{} statements}

\PYG{k}{import}\PYG{+w}{ }\PYG{n+nn}{java.util.*}

\PYG{k+kd}{fun}\PYG{+w}{ }\PYG{n+nf}{main}\PYG{p}{(}\PYG{n}{args}\PYG{p}{:}\PYG{+w}{ }\PYG{n}{Array}\PYG{o}{\PYGZlt{}}\PYG{k+kt}{String}\PYG{o}{\PYGZgt{}}\PYG{p}{)}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{    }\PYG{k+kd}{var}\PYG{+w}{ }\PYG{n+nv}{scanner}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{Scanner}\PYG{p}{(}\PYG{n}{System}\PYG{p}{.}\PYG{n}{`in`}\PYG{p}{)}
\PYG{+w}{    }\PYG{k+kd}{val}\PYG{+w}{ }\PYG{n+nv}{nTests}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{scanner}\PYG{p}{.}\PYG{n+na}{nextInt}\PYG{p}{(}\PYG{p}{)}
\PYG{+w}{    }\PYG{k}{for}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{i}\PYG{+w}{ }\PYG{k}{in}\PYG{+w}{ }\PYG{l+m}{1.}\PYG{p}{.}\PYG{n+na}{nTests}\PYG{p}{)}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{	    }\PYG{n}{System}\PYG{p}{.}\PYG{n}{`out`}\PYG{p}{.}\PYG{n+na}{format}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}}\PYG{l+s}{Hello \PYGZpc{}s!\PYGZpc{}n}\PYG{l+s}{\PYGZdq{}}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{scanner}\PYG{p}{.}\PYG{n+na}{next}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}
\PYG{+w}{    }\PYG{p}{\PYGZcb{}}
\PYG{p}{\PYGZcb{}}
\end{sphinxVerbatim}
\sphinxSetupCaptionForVerbatim{\sphinxstyleemphasis{A solution in Python}}
\def\sphinxLiteralBlockLabel{\label{\detokenize{team:id9}}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{k+kn}{import} \PYG{n+nn}{sys}

\PYG{n}{n} \PYG{o}{=} \PYG{n+nb}{int}\PYG{p}{(}\PYG{n+nb}{input}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}
\PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n}{n}\PYG{p}{)}\PYG{p}{:}
    \PYG{n}{name} \PYG{o}{=} \PYG{n}{sys}\PYG{o}{.}\PYG{n}{stdin}\PYG{o}{.}\PYG{n}{readline}\PYG{p}{(}\PYG{p}{)}\PYG{o}{.}\PYG{n}{rstrip}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}
    \PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Hello }\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{!}\PYG{l+s+s1}{\PYGZsq{}} \PYG{o}{\PYGZpc{}} \PYG{p}{(}\PYG{n}{name}\PYG{p}{)}\PYG{p}{)}

\end{sphinxVerbatim}
\sphinxSetupCaptionForVerbatim{\sphinxstyleemphasis{A solution in C\#}}
\def\sphinxLiteralBlockLabel{\label{\detokenize{team:id10}}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{System}\PYG{p}{;}

\PYG{k}{public}\PYG{+w}{ }\PYG{k}{class}\PYG{+w}{ }\PYG{n+nc}{Hello}
\PYG{p}{\PYGZob{}}
\PYG{+w}{	}\PYG{k}{public}\PYG{+w}{ }\PYG{k}{static}\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{Main}\PYG{p}{(}\PYG{k+kt}{string}\PYG{p}{[}\PYG{p}{]}\PYG{+w}{ }\PYG{n}{args}\PYG{p}{)}
\PYG{+w}{	}\PYG{p}{\PYGZob{}}
\PYG{+w}{		}\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n}{nTests}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k+kt}{int}\PYG{p}{.}\PYG{n}{Parse}\PYG{p}{(}\PYG{n}{Console}\PYG{p}{.}\PYG{n}{ReadLine}\PYG{p}{(}\PYG{p}{)}\PYG{p}{)}\PYG{p}{;}

\PYG{+w}{		}\PYG{k}{for}\PYG{+w}{ }\PYG{p}{(}\PYG{k+kt}{int}\PYG{+w}{ }\PYG{n}{i}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m}{0}\PYG{p}{;}\PYG{+w}{ }\PYG{n}{i}\PYG{+w}{ }\PYG{o}{\PYGZlt{}}\PYG{+w}{ }\PYG{n}{nTests}\PYG{p}{;}\PYG{+w}{ }\PYG{n}{i}\PYG{o}{++}\PYG{p}{)}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{			}\PYG{k+kt}{string}\PYG{+w}{ }\PYG{n}{name}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{Console}\PYG{p}{.}\PYG{n}{ReadLine}\PYG{p}{(}\PYG{p}{)}\PYG{p}{;}
\PYG{+w}{			}\PYG{n}{Console}\PYG{p}{.}\PYG{n}{WriteLine}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}Hello \PYGZdq{}}\PYG{o}{+}\PYG{n}{name}\PYG{o}{+}\PYG{l+s}{\PYGZdq{}!\PYGZdq{}}\PYG{p}{)}\PYG{p}{;}
\PYG{+w}{		}\PYG{p}{\PYGZcb{}}
\PYG{+w}{	}\PYG{p}{\PYGZcb{}}
\PYG{p}{\PYGZcb{}}
\end{sphinxVerbatim}
\sphinxSetupCaptionForVerbatim{\sphinxstyleemphasis{A solution in Pascal}}
\def\sphinxLiteralBlockLabel{\label{\detokenize{team:id11}}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{k}{program}\PYG{+w}{ }\PYG{n}{example}\PYG{p}{(}\PYG{n}{input}\PYG{o}{,}\PYG{+w}{ }\PYG{n}{output}\PYG{p}{)}\PYG{o}{;}

\PYG{k}{var}
\PYG{+w}{	}\PYG{n}{ntests}\PYG{o}{,}\PYG{+w}{ }\PYG{n}{test}\PYG{+w}{ }\PYG{o}{:}\PYG{+w}{ }\PYG{k+kt}{integer}\PYG{o}{;}
\PYG{+w}{	}\PYG{n}{name}\PYG{+w}{         }\PYG{o}{:}\PYG{+w}{ }\PYG{k}{string}\PYG{p}{[}\PYG{l+m+mi}{100}\PYG{p}{]}\PYG{o}{;}

\PYG{k}{begin}
\PYG{+w}{	}\PYG{n+nb}{readln}\PYG{p}{(}\PYG{n}{ntests}\PYG{p}{)}\PYG{o}{;}

\PYG{+w}{	}\PYG{k}{for}\PYG{+w}{ }\PYG{n}{test}\PYG{+w}{ }\PYG{o}{:}\PYG{o}{=}\PYG{+w}{ }\PYG{l+m+mi}{1}\PYG{+w}{ }\PYG{k}{to}\PYG{+w}{ }\PYG{n}{ntests}\PYG{+w}{ }\PYG{k}{do}
\PYG{+w}{	}\PYG{k}{begin}
\PYG{+w}{		}\PYG{n+nb}{readln}\PYG{p}{(}\PYG{n}{name}\PYG{p}{)}\PYG{o}{;}
\PYG{+w}{		}\PYG{n+nb}{writeln}\PYG{p}{(}\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{Hello }\PYG{l+s}{\PYGZsq{}}\PYG{o}{,}\PYG{+w}{ }\PYG{n}{name}\PYG{o}{,}\PYG{+w}{ }\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{!}\PYG{l+s}{\PYGZsq{}}\PYG{p}{)}\PYG{o}{;}
\PYG{+w}{	}\PYG{k}{end}\PYG{o}{;}
\PYG{k}{end}\PYG{o}{.}
\end{sphinxVerbatim}
\sphinxSetupCaptionForVerbatim{\sphinxstyleemphasis{A solution in Haskell}}
\def\sphinxLiteralBlockLabel{\label{\detokenize{team:id12}}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{k+kr}{import}\PYG{+w}{ }\PYG{n+nn}{Prelude}

\PYG{n+nf}{main}\PYG{+w}{ }\PYG{o+ow}{::}\PYG{+w}{ }\PYG{k+kt}{IO}\PYG{+w}{ }\PYG{n+nb}{()}
\PYG{n+nf}{main}\PYG{+w}{ }\PYG{o+ow}{=}\PYG{+w}{ }\PYG{k+kr}{do}\PYG{+w}{ }\PYG{n}{input}\PYG{+w}{ }\PYG{o+ow}{\PYGZlt{}\PYGZhy{}}\PYG{+w}{ }\PYG{n}{getContents}
\PYG{+w}{          }\PYG{n}{putStr}\PYG{o}{.}\PYG{n}{unlines}\PYG{o}{.}\PYG{n}{map}\PYG{+w}{ }\PYG{p}{(}\PYG{n+nf}{\PYGZbs{}}\PYG{n}{x}\PYG{+w}{ }\PYG{o+ow}{\PYGZhy{}\PYGZgt{}}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}}\PYG{l+s}{Hello }\PYG{l+s}{\PYGZdq{}}\PYG{+w}{ }\PYG{o}{++}\PYG{+w}{ }\PYG{n}{x}\PYG{+w}{ }\PYG{o}{++}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}}\PYG{l+s}{!}\PYG{l+s}{\PYGZdq{}}\PYG{p}{)}\PYG{o}{.}\PYG{n}{tail}\PYG{o}{.}\PYG{n}{lines}\PYG{+w}{ }\PYG{o}{\PYGZdl{}}\PYG{+w}{ }\PYG{n}{input}
\end{sphinxVerbatim}


\subsubsection{Improvements to DOMjudge}
\label{\detokenize{team:improvements-to-domjudge}}
\sphinxAtStartPar
The DOMjudge team would like your feedback. We do not receive much feedback from participants.
If you find something lacking or have improvement ideas, please report them. See \sphinxurl{https://www.domjudge.org/development}.

\sphinxstepscope


\subsection{Appendix: Problem format specification}
\label{\detokenize{problem-format:appendix-problem-format-specification}}\label{\detokenize{problem-format::doc}}
\sphinxAtStartPar
DOMjudge supports the import and export of problems in a zip\sphinxhyphen{}bundle
format.

\sphinxAtStartPar
The base of the format is the \sphinxhref{https://icpc.io/problem-package-format/spec/problem\_package\_format}{ICPC problem package specification}.
\begin{description}
\sphinxlineitem{On top, DOMjudge defines a few extensions:}\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{domjudge\sphinxhyphen{}problem.ini}} (optional): metadata file, see below.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{problem.\{pdf,html,txt\}}} (optional): problem statements as
distributed to participants. The file extension determines any of
three supported formats. If multiple files matching this pattern are
available, any one of those will be used.

\item {} 
\sphinxAtStartPar
Annotation with \sphinxcode{\sphinxupquote{@EXPECTED\_RESULTS@:}} for jury solutions.
Use this to annotate the possible outcomes that a submission can have,
that will be accepted by the Judging verifier.
This extension is in consideration to be added to the ICPC specification,
see \sphinxurl{https://github.com/Kattis/problem-package-format/pull/4}.
Note that, to match with the current ICPC specification,
the \sphinxcode{\sphinxupquote{@EXPECTED\_RESULTS@:}} tag is ignored in
the four official submission subdirectories,
but it will work if the tagged solution is in, e.g.,
\sphinxcode{\sphinxupquote{submissions/mixed\sphinxhyphen{}verdicts}}, \sphinxcode{\sphinxupquote{submissions/mixed/}} or \sphinxcode{\sphinxupquote{submissions/rejected/}}.
\sphinxSetupCaptionForVerbatim{\sphinxstyleemphasis{Example jury solution with multiple outcomes (Shortened)}}
\def\sphinxLiteralBlockLabel{\label{\detokenize{problem-format:id1}}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l+s+sd}{\PYGZsq{}\PYGZsq{}\PYGZsq{}}
\PYG{l+s+sd}{Sample solution in Python for the \PYGZdq{}boolfind\PYGZdq{} interactive problem.}
\PYG{l+s+sd}{This will sometimes give an off by one answer. This is a demonstration}
\PYG{l+s+sd}{of how to use the @EXPECTED\PYGZus{}RESULTS@ tag.}

\PYG{l+s+sd}{@EXPECTED\PYGZus{}RESULTS@: CORRECT, WRONG\PYGZhy{}ANSWER}
\PYG{l+s+sd}{\PYGZsq{}\PYGZsq{}\PYGZsq{}}

\PYG{k+kn}{import} \PYG{n+nn}{sys}\PYG{o}{,} \PYG{n+nn}{random}

\end{sphinxVerbatim}

\end{itemize}

\end{description}

\sphinxAtStartPar
The file \sphinxcode{\sphinxupquote{domjudge\sphinxhyphen{}problem.ini}} contains key\sphinxhyphen{}value pairs, one
pair per line, of the form \sphinxcode{\sphinxupquote{key = value}}. The \sphinxcode{\sphinxupquote{=}} can
optionally be surrounded by whitespace and the value may be quoted,
which allows it to contain newlines. The following keys are supported
(these correspond directly to the problem settings in the jury web
interface):
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{name}} \sphinxhyphen{} the problem displayed name

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{allow\_submit}} \sphinxhyphen{} whether to allow submissions to this problem,
disabling this also makes the problem invisible to teams and public

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{allow\_judge}} \sphinxhyphen{} whether to allow judging of this problem

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{timelimit}} \sphinxhyphen{} time limit in seconds per test case

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{special\_run}} \sphinxhyphen{} executable id of a special run script

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{special\_compare}} \sphinxhyphen{} executable id of a special compare script

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{points}} \sphinxhyphen{} number of points for this problem (defaults to 1)

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{color}} \sphinxhyphen{} CSS color specification for this problem

\end{itemize}

\sphinxAtStartPar
The basename of the ZIP\sphinxhyphen{}file will be used as the problem short name (e.g. “A”).
All keys are optional. If they are present, the respective value will be
overwritten; if not present, then the value will not be changed or a default
chosen when creating a new problem. Test data files are added to set of test
cases already present. Thus, one can easily add test cases to a configured
problem by uploading a zip file that contains only testcase files. Any jury
solutions present will be automatically submitted when \sphinxcode{\sphinxupquote{allow\_submit}} is
\sphinxcode{\sphinxupquote{1}} and there’s a team associated with the uploading user.

\sphinxstepscope


\subsection{Appendix: Running DOMjudge as a shadow system}
\label{\detokenize{shadow:appendix-running-domjudge-as-a-shadow-system}}\label{\detokenize{shadow::doc}}
\sphinxAtStartPar
It is possible to run DOMjudge as a shadow system behind another system.

\sphinxAtStartPar
Shadowing means that DOMjudge will read events from an external system and mimic
all actions described in those events. This is useful if one wants to verify if
the results of an external system match DOMjudge, for example to verify both
systems give the same judging results. This has been used at the ICPC World
Finals for the last few years.

\sphinxAtStartPar
DOMjudge can shadow any system that follows the \sphinxhref{https://ccs-specs.icpc.io/2021-11/contest\_api}{Contest API specification}.
It has been tested with recent versions of the \sphinxhref{https://tools.icpc.global/cds}{ICPC Tools CDS}
and with DOMjudge itself. Other known systems that implement the specification
and that should work are \sphinxhref{https://www.kattis.com}{Kattis} and \sphinxhref{http://pc2.ecs.csus.edu}{PC\sphinxhyphen{}Squared}.


\subsubsection{Configuring DOMjudge}
\label{\detokenize{shadow:configuring-domjudge}}
\sphinxAtStartPar
In the DOMjudge admin interface, go to \sphinxstyleemphasis{Configuration settings} page and modify
the settings to mimic the system to shadow from. Also make sure to set
\sphinxstyleemphasis{data\_source} to \sphinxcode{\sphinxupquote{configuration and live data external}}. This tells DOMjudge
that it will be a shadow for an external system. This will:
\begin{itemize}
\item {} 
\sphinxAtStartPar
Expose external ID’s in the API for both configuration and live data, i.e.
problems, teams, etc. as well as submissions, judgings and runs.

\item {} 
\sphinxAtStartPar
Add a \sphinxstyleemphasis{Shadow Differences} and \sphinxstyleemphasis{External Contest Sources} item to the jury
menu and homepage for admins.

\item {} 
\sphinxAtStartPar
Expose additional information in the submission overview and detail pages.

\end{itemize}

\sphinxAtStartPar
You can also set the \sphinxstyleemphasis{external\_ccs\_submission\_url} to a URL template. If you set
this, the submission detail page will show a link to the external system. If you
use DOMjudge as system to shadow from, you should enter
\sphinxcode{\sphinxupquote{https://url.to.domjudge/jury/submissions/{[}id{]}}}.


\subsubsection{Importing or creating the contest and problems}
\label{\detokenize{shadow:importing-or-creating-the-contest-and-problems}}
\sphinxAtStartPar
The contest needs to exist in DOMjudge \sphinxstyleemphasis{and} have all problems loaded. All other
configuration data, like teams, team categories and team affiliations should also
exist. The easiest way to create the contest and configuration data is to import
it. For this you need JSON files as described in the {\hyperref[\detokenize{import::doc}]{\sphinxcrossref{\DUrole{doc}{Import}}}} chapter.
Furthermore you need problem directories as described on that same page. Place
all the files and all directories together in one directory and use the
\sphinxcode{\sphinxupquote{misc\sphinxhyphen{}tools/import\sphinxhyphen{}contest}} script to import them. Note that, if you have no
team linked to your account, it will complain that it can’t import jury
submissions because you have no team linked to your account. That is fine since
these submissions will be read using the event feed later on.


\subsubsection{Configuration the external contest source}
\label{\detokenize{shadow:configuration-the-external-contest-source}}
\sphinxAtStartPar
In the DOMjudge admin interface, go to the \sphinxstyleemphasis{External Contest Sources} page and
create an external contest source. Select the contest to import into and enter
the source you want to import from.

\sphinxAtStartPar
Another alternative is to use these DOMjudge only keys in the \sphinxtitleref{contest.yaml}:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{shadow}\PYG{p}{:}
  \PYG{n+nb}{type}\PYG{p}{:} \PYG{n}{contest}\PYG{o}{\PYGZhy{}}\PYG{n}{api}
  \PYG{n}{source}\PYG{p}{:} \PYG{n}{http}\PYG{p}{(}\PYG{n}{s}\PYG{p}{)}\PYG{p}{:}\PYG{o}{/}\PYG{o}{/}\PYG{n}{url\PYGZus{}to\PYGZus{}external\PYGZus{}system}\PYG{o}{/}\PYG{n}{api}\PYG{o}{/}\PYG{n}{contests}\PYG{o}{/}\PYG{o}{\PYGZlt{}}\PYG{n}{contest\PYGZus{}id}\PYG{o}{\PYGZgt{}}
  \PYG{n}{username}\PYG{p}{:} \PYG{n}{user\PYGZus{}in\PYGZus{}external\PYGZus{}system}
  \PYG{n}{password}\PYG{p}{:} \PYG{n}{password\PYGZus{}for\PYGZus{}user}
\end{sphinxVerbatim}

\sphinxAtStartPar
or:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{n}{shadow}\PYG{p}{:}
  \PYG{n+nb}{type}\PYG{p}{:} \PYG{n}{contest}\PYG{o}{\PYGZhy{}}\PYG{n}{archive}
  \PYG{n}{source}\PYG{p}{:} \PYG{o}{/}\PYG{n}{path}\PYG{o}{/}\PYG{n}{on}\PYG{o}{/}\PYG{n}{domjudge}\PYG{o}{/}\PYG{n}{filestem}\PYG{o}{/}\PYG{n}{to}\PYG{o}{/}\PYG{n}{clics}\PYG{o}{/}\PYG{n}{compliant}\PYG{o}{/}\PYG{n}{archive}
\end{sphinxVerbatim}


\subsubsection{Running the event feed import command}
\label{\detokenize{shadow:running-the-event-feed-import-command}}
\sphinxAtStartPar
After doing all above steps, you can run the event feed import command to start
importing events from the primary system. The external contest source detail
page will show you the exact command to run.

\sphinxAtStartPar
If the command loses its connection to the primary system it will automatically
reconnect and continue reading where it left off. To stop the command, press
\sphinxcode{\sphinxupquote{ctrl\sphinxhyphen{}c}}. If you rerun the command, it will start again where it left off.

\sphinxAtStartPar
If you ever want to restart reading the feed from the beginning (for example
when the primary system had an error and fixed that), you can pass
\sphinxcode{\sphinxupquote{\sphinxhyphen{}\sphinxhyphen{}from\sphinxhyphen{}start}} to the command to start reading from the beginning.


\subsubsection{Viewing import warnings}
\label{\detokenize{shadow:viewing-import-warnings}}
\sphinxAtStartPar
During import a lot can happen. For example, an external system can send an event
that contains an unknown dependency, it can send an event we can’t process or we
might not be able to download a submission ZIP.

\sphinxAtStartPar
The external contest source detail page will show a list of all warnings that
occurred during import. If an event that is imported later fixes a warning, the
warning will automatically disappear.

\sphinxAtStartPar
The detail page also shows when the feed reader last checked in, what the last event
was that it processed and when it processed that event. This might be useful information
to keep track of while shadowing.


\subsubsection{Viewing shadow differences}
\label{\detokenize{shadow:viewing-shadow-differences}}
\sphinxAtStartPar
In the admin interface, the \sphinxstyleemphasis{Shadow Differences} page will show all differences
between the primary system and DOMjudge. Note that it will only show differences
in the final verdict, not on a testcase level.

\sphinxAtStartPar
At the top is a matrix where a summary of the differences is shown. All red
cells are actual differences. If they appear in the \sphinxstyleemphasis{JU} column or row, this
simply means one of the systems is not done yet with judging this submission.

\sphinxAtStartPar
Clicking any of the red cells will show detailed information about the
differences that correspond to it. You can also use the dropdowns in the
\sphinxstyleemphasis{Details} section. Clicking on a submission will bring you to the submission
detail page.

\sphinxAtStartPar
For submissions with a difference between the primary and shadow system,
you can mark a difference as verified on this page. This will make it not show
up when only showing \sphinxstyleemphasis{Verified} submissions. The menu badge will also not take
them into account.

\sphinxAtStartPar
The submission details page shows more information related to the shadow
differences:
\begin{itemize}
\item {} 
\sphinxAtStartPar
If you set the \sphinxstyleemphasis{external\_ccs\_submission\_url} configuration option, a link
titled \sphinxstyleemphasis{View in external CCS} will appear taking you to the submission in the
primary system. Clicking the external ID just below it will do the same.

\item {} 
\sphinxAtStartPar
The external ID and judgement (if any) will be shown.

\item {} 
\sphinxAtStartPar
A graph of external testcase runtimes is displayed.

\item {} 
\sphinxAtStartPar
The external testcase results are shown, but in a summary line as well as
with detailed information.

\item {} 
\sphinxAtStartPar
If the primary system has a different verdict than DOMjudge, a warning will be
displayed.

\end{itemize}

\sphinxstepscope


\subsection{Appendix: Configuration reference}
\label{\detokenize{configuration-reference:appendix-configuration-reference}}\label{\detokenize{configuration-reference::doc}}
\sphinxAtStartPar
DOMjudge has several configuration settings available. They can be accessed in
the admin interface under \sphinxstyleemphasis{Configuration settings}. This appendix contains a
list of all the available options with a description of what they mean.

\sphinxAtStartPar
The system has the following types of configuration options:
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{bool}}: a boolean, either \sphinxcode{\sphinxupquote{true}} or \sphinxcode{\sphinxupquote{false}}.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{int}}: a numeric value.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{string}}: a string value.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{array\_val}}: an array of values.

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{array\_keyval}}: an array of values with specific keys (also known as a dictionary).

\end{itemize}

\sphinxAtStartPar
\sphinxstylestrong{Public} means whether the option is exposed in the API to non\sphinxhyphen{}jury members.


\subsubsection{Scoring}
\label{\detokenize{configuration-reference:scoring}}
\sphinxAtStartPar
Options related to how scoring is handled.


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{verification\_required}}}
\label{\detokenize{configuration-reference:verification-required}}
\sphinxAtStartPar
Is manual verification of judgings by jury required before publication?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{compile\_penalty}}}
\label{\detokenize{configuration-reference:compile-penalty}}
\sphinxAtStartPar
Should submissions with compiler\sphinxhyphen{}error incur penalty time (and be shown on the scoreboard)?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{penalty\_time}}}
\label{\detokenize{configuration-reference:penalty-time}}
\sphinxAtStartPar
Penalty time in minutes per wrong submission (if eventually solved).
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{20}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{results\_prio}}}
\label{\detokenize{configuration-reference:results-prio}}
\sphinxAtStartPar
Priorities of results for determining final result with multiple testcases. Higher priority is used first as final result. With equal priority, the first (ordered by rank) incorrect result determines the final result.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{array\_keyval}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:}

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{p}{\PYGZob{}}
\PYG{+w}{  }\PYG{n+nt}{\PYGZdq{}memory\PYGZhy{}limit\PYGZdq{}}\PYG{p}{:}\PYG{+w}{ }\PYG{l+m+mi}{99}\PYG{p}{,}
\PYG{+w}{  }\PYG{n+nt}{\PYGZdq{}output\PYGZhy{}limit\PYGZdq{}}\PYG{p}{:}\PYG{+w}{ }\PYG{l+m+mi}{99}\PYG{p}{,}
\PYG{+w}{  }\PYG{n+nt}{\PYGZdq{}run\PYGZhy{}error\PYGZdq{}}\PYG{p}{:}\PYG{+w}{ }\PYG{l+m+mi}{99}\PYG{p}{,}
\PYG{+w}{  }\PYG{n+nt}{\PYGZdq{}timelimit\PYGZdq{}}\PYG{p}{:}\PYG{+w}{ }\PYG{l+m+mi}{99}\PYG{p}{,}
\PYG{+w}{  }\PYG{n+nt}{\PYGZdq{}wrong\PYGZhy{}answer\PYGZdq{}}\PYG{p}{:}\PYG{+w}{ }\PYG{l+m+mi}{99}\PYG{p}{,}
\PYG{+w}{  }\PYG{n+nt}{\PYGZdq{}no\PYGZhy{}output\PYGZdq{}}\PYG{p}{:}\PYG{+w}{ }\PYG{l+m+mi}{99}\PYG{p}{,}
\PYG{+w}{  }\PYG{n+nt}{\PYGZdq{}correct\PYGZdq{}}\PYG{p}{:}\PYG{+w}{ }\PYG{l+m+mi}{1}
\PYG{p}{\PYGZcb{}}
\end{sphinxVerbatim}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{results\_remap}}}
\label{\detokenize{configuration-reference:results-remap}}
\sphinxAtStartPar
Remap testcase result, e.g. to disable a specific result type such as \sphinxtitleref{no\sphinxhyphen{}output}.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{array\_keyval}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:}

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{p}{[]}
\end{sphinxVerbatim}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{score\_in\_seconds}}}
\label{\detokenize{configuration-reference:score-in-seconds}}
\sphinxAtStartPar
Is the scoreboard resolution measured in seconds instead of minutes?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\subsubsection{Judging}
\label{\detokenize{configuration-reference:judging}}
\sphinxAtStartPar
Options related to how judging is performed.


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{memory\_limit}}}
\label{\detokenize{configuration-reference:memory-limit}}
\sphinxAtStartPar
Maximum memory usage (in kB) by submissions. This includes the shell which starts the compiled solution and also any interpreter like the Java VM, which takes away approx. 300MB! Can be overridden per problem.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{2097152}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{output\_limit}}}
\label{\detokenize{configuration-reference:output-limit}}
\sphinxAtStartPar
Maximum output (in kB) submissions may generate. Any excessive output is truncated, so this should be greater than the maximum testdata output. Can be overridden per problem.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{8192}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{process\_limit}}}
\label{\detokenize{configuration-reference:process-limit}}
\sphinxAtStartPar
Maximum number of processes that the submission is allowed to start (including shell and possibly interpreters).
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{64}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{sourcesize\_limit}}}
\label{\detokenize{configuration-reference:sourcesize-limit}}
\sphinxAtStartPar
Maximum source code size (in kB) of a submission.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{256}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{sourcefiles\_limit}}}
\label{\detokenize{configuration-reference:sourcefiles-limit}}
\sphinxAtStartPar
Maximum number of source files in one submission. Set to \sphinxtitleref{1} to disable multi\sphinxhyphen{}file submissions.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{100}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{script\_timelimit}}}
\label{\detokenize{configuration-reference:script-timelimit}}
\sphinxAtStartPar
Maximum seconds available for compile/compare scripts. This is a safeguard against malicious code and buggy scripts, so a reasonable but large amount should do.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{30}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{script\_memory\_limit}}}
\label{\detokenize{configuration-reference:script-memory-limit}}
\sphinxAtStartPar
Maximum memory usage (in kB) by compile/compare scripts. This is a safeguard against malicious code and buggy script, so a reasonable but large amount should do.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{2097152}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{script\_filesize\_limit}}}
\label{\detokenize{configuration-reference:script-filesize-limit}}
\sphinxAtStartPar
Maximum filesize (in kB) compile/compare scripts may write. Submission will fail with compiler\sphinxhyphen{}error when trying to write more, so this should be greater than any \sphinxstylestrong{intermediate or final} result written by compilers.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{2621440}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{timelimit\_overshoot}}}
\label{\detokenize{configuration-reference:timelimit-overshoot}}
\sphinxAtStartPar
Time that submissions are kept running beyond timelimit before being killed. Specify as \sphinxtitleref{Xs} for X seconds, \sphinxtitleref{Y\%} as percentage, or a combination of both separated by one of \sphinxtitleref{+|\&} for the sum, maximum, or minimum of both.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{string}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{\textquotesingle{}1s|10\%\textquotesingle{}}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{output\_storage\_limit}}}
\label{\detokenize{configuration-reference:output-storage-limit}}
\sphinxAtStartPar
Maximum size of error/system output stored in the database (in bytes); use \sphinxtitleref{\sphinxhyphen{}1} to disable any limits. See \sphinxtitleref{Display} / \sphinxtitleref{output\_display\_limit} for how to control the output \sphinxstyleemphasis{shown}.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{50000}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{lazy\_eval\_results}}}
\label{\detokenize{configuration-reference:lazy-eval-results}}
\sphinxAtStartPar
Lazy evaluation of results? If enabled, stops judging as soon as a highest priority result is found, otherwise always all testcases will be judged. On request will not auto\sphinxhyphen{}start judging and is typically used when running as analyst system.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{1}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Possible options:}
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{1}}: \sphinxstyleemphasis{Lazy}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{2}}: \sphinxstyleemphasis{Full judging}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{3}}: \sphinxstyleemphasis{Only on request}

\end{itemize}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{judgehost\_warning}}}
\label{\detokenize{configuration-reference:judgehost-warning}}
\sphinxAtStartPar
Time in seconds after a judgehost last checked in before showing its status as \sphinxtitleref{warning}.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{30}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{judgehost\_critical}}}
\label{\detokenize{configuration-reference:judgehost-critical}}
\sphinxAtStartPar
Time in seconds after a judgehost last checked in before showing its status as \sphinxtitleref{critical}.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{120}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{diskspace\_error}}}
\label{\detokenize{configuration-reference:diskspace-error}}
\sphinxAtStartPar
Minimum free disk space (in kB) on judgehosts before posting an internal error.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{1048576}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{default\_compare}}}
\label{\detokenize{configuration-reference:default-compare}}
\sphinxAtStartPar
The script used to compare outputs if no special compare script specified.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{string}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{\textquotesingle{}compare\textquotesingle{}}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{default\_run}}}
\label{\detokenize{configuration-reference:default-run}}
\sphinxAtStartPar
The script used to run submissions if no special run script specified.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{string}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{\textquotesingle{}run\textquotesingle{}}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{default\_full\_debug}}}
\label{\detokenize{configuration-reference:default-full-debug}}
\sphinxAtStartPar
The script used to compile a full debug package.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{string}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{\textquotesingle{}full\_debug\textquotesingle{}}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{enable\_parallel\_judging}}}
\label{\detokenize{configuration-reference:enable-parallel-judging}}
\sphinxAtStartPar
Are submissions judged by multiple judgehosts in parallel?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{True}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{judgehost\_activated\_by\_default}}}
\label{\detokenize{configuration-reference:judgehost-activated-by-default}}
\sphinxAtStartPar
Activate a judgehost when it registers for the first time.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{True}}

\end{itemize}


\subsubsection{Clarifications}
\label{\detokenize{configuration-reference:clarifications}}
\sphinxAtStartPar
Options related to clarifications.


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{clar\_categories}}}
\label{\detokenize{configuration-reference:clar-categories}}
\sphinxAtStartPar
List of additional clarification categories.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{array\_keyval}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:}

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{p}{\PYGZob{}}
\PYG{+w}{  }\PYG{n+nt}{\PYGZdq{}general\PYGZdq{}}\PYG{p}{:}\PYG{+w}{ }\PYG{l+s+s2}{\PYGZdq{}General issue\PYGZdq{}}\PYG{p}{,}
\PYG{+w}{  }\PYG{n+nt}{\PYGZdq{}tech\PYGZdq{}}\PYG{p}{:}\PYG{+w}{ }\PYG{l+s+s2}{\PYGZdq{}Technical issue\PYGZdq{}}
\PYG{p}{\PYGZcb{}}
\end{sphinxVerbatim}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{clar\_answers}}}
\label{\detokenize{configuration-reference:clar-answers}}
\sphinxAtStartPar
List of pre\sphinxhyphen{}defined clarification answers.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{array\_val}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:}

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{p}{[}
\PYG{+w}{  }\PYG{l+s+s2}{\PYGZdq{}No comment.\PYGZdq{}}\PYG{p}{,}
\PYG{+w}{  }\PYG{l+s+s2}{\PYGZdq{}Read the problem statement carefully.\PYGZdq{}}
\PYG{p}{]}
\end{sphinxVerbatim}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{clar\_queues}}}
\label{\detokenize{configuration-reference:clar-queues}}
\sphinxAtStartPar
List of clarification queues.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{array\_keyval}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:}

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{p}{[]}
\end{sphinxVerbatim}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{clar\_default\_problem\_queue}}}
\label{\detokenize{configuration-reference:clar-default-problem-queue}}
\sphinxAtStartPar
Queue to assign to problem clarifications.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{string}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{\textquotesingle{}\textquotesingle{}}}

\end{itemize}


\subsubsection{Display}
\label{\detokenize{configuration-reference:display}}
\sphinxAtStartPar
Options related to the DOMjudge user interface.


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{output\_display\_limit}}}
\label{\detokenize{configuration-reference:output-display-limit}}
\sphinxAtStartPar
Maximum size of run/diff/error/system output shown in the jury interface (in bytes); use \sphinxtitleref{\sphinxhyphen{}1} to disable any limits.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{2000}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_pending}}}
\label{\detokenize{configuration-reference:show-pending}}
\sphinxAtStartPar
Show pending submissions on the scoreboard?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{True}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_flags}}}
\label{\detokenize{configuration-reference:show-flags}}
\sphinxAtStartPar
Show country information in the interfaces?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{True}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_affiliations}}}
\label{\detokenize{configuration-reference:show-affiliations}}
\sphinxAtStartPar
Show affiliation names in the interfaces?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{True}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_affiliation\_logos}}}
\label{\detokenize{configuration-reference:show-affiliation-logos}}
\sphinxAtStartPar
Show affiliation logos on the scoreboard?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_teams\_submissions}}}
\label{\detokenize{configuration-reference:show-teams-submissions}}
\sphinxAtStartPar
Show problem columns with submission information on the public and team scoreboards?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{True}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_compile}}}
\label{\detokenize{configuration-reference:show-compile}}
\sphinxAtStartPar
Show compile output in team webinterface?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{2}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Possible options:}
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{0}}: \sphinxstyleemphasis{never}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{1}}: \sphinxstyleemphasis{only on compilation error(s)}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{2}}: \sphinxstyleemphasis{always}

\end{itemize}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_sample\_output}}}
\label{\detokenize{configuration-reference:show-sample-output}}
\sphinxAtStartPar
Should teams be able to view a diff of their and the reference output on sample testcases?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_too\_late\_result}}}
\label{\detokenize{configuration-reference:show-too-late-result}}
\sphinxAtStartPar
Show results of TOO\sphinxhyphen{}LATE submissions in team interface?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_balloons\_postfreeze}}}
\label{\detokenize{configuration-reference:show-balloons-postfreeze}}
\sphinxAtStartPar
Give out balloon notifications after the scoreboard has been frozen?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_relative\_time}}}
\label{\detokenize{configuration-reference:show-relative-time}}
\sphinxAtStartPar
Print times of contest events relative to contest start (instead of absolute).
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{time\_format}}}
\label{\detokenize{configuration-reference:time-format}}
\sphinxAtStartPar
The format used to print times. For formatting options see the {[}PHP \sphinxtitleref{DateTime::format} function{]}(\sphinxurl{https://www.php.net/manual/en/datetime.format.php}).
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{string}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{\textquotesingle{}H:i\textquotesingle{}}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{thumbnail\_size}}}
\label{\detokenize{configuration-reference:thumbnail-size}}
\sphinxAtStartPar
Maximum width/height of a thumbnail for uploaded testcase images.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{200}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_limits\_on\_team\_page}}}
\label{\detokenize{configuration-reference:show-limits-on-team-page}}
\sphinxAtStartPar
Show time and memory limit on the team problems page.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{True}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{allow\_team\_submission\_download}}}
\label{\detokenize{configuration-reference:allow-team-submission-download}}
\sphinxAtStartPar
Allow teams to download their own submission code. Note that enabling this option means that if someone gets access to the account of a team, they can download
the source code of all submissions from that team. When this option is disabled, getting access to the account
of a team only allows someone to submit as that team, which can then easily be ignored by the jury later.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{team\_column\_width}}}
\label{\detokenize{configuration-reference:team-column-width}}
\sphinxAtStartPar
Maximum width of team column on scoreboard. Leave \sphinxtitleref{0} for no maximum.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{0}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_public\_stats}}}
\label{\detokenize{configuration-reference:show-public-stats}}
\sphinxAtStartPar
Show submission and problem statistics on the team and public pages.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{True}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_language\_versions}}}
\label{\detokenize{configuration-reference:show-language-versions}}
\sphinxAtStartPar
Show canonical compiler and runner version on the team pages.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{show\_teams\_on\_scoreboard}}}
\label{\detokenize{configuration-reference:show-teams-on-scoreboard}}
\sphinxAtStartPar
Show teams on the scoreboard?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{0}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Possible options:}
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{0}}: \sphinxstyleemphasis{Always}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{1}}: \sphinxstyleemphasis{After login}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{2}}: \sphinxstyleemphasis{After first submission}

\end{itemize}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{enable\_ranking}}}
\label{\detokenize{configuration-reference:enable-ranking}}
\sphinxAtStartPar
If disabled, no ranking information is shown to contestants.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{True}}

\end{itemize}


\subsubsection{Authentication}
\label{\detokenize{configuration-reference:authentication}}
\sphinxAtStartPar
Options related to authentication.


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{auth\_methods}}}
\label{\detokenize{configuration-reference:auth-methods}}
\sphinxAtStartPar
List of allowed additional authentication methods. See {\hyperref[\detokenize{config-advanced:authentication}]{\sphinxcrossref{\DUrole{std,std-ref}{Authentication and registration}}}} for more information.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{array\_val}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:}

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{p}{[]}
\end{sphinxVerbatim}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Possible options:}
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{ipaddress}}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{xheaders}}

\end{itemize}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{ip\_autologin}}}
\label{\detokenize{configuration-reference:ip-autologin}}
\sphinxAtStartPar
Enable to skip the login page when using IP authentication.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\subsubsection{External systems}
\label{\detokenize{configuration-reference:external-systems}}
\sphinxAtStartPar
Miscellaneous configuration options.


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{print\_command}}}
\label{\detokenize{configuration-reference:print-command}}
\sphinxAtStartPar
If set, enable teams and jury to send source code to this command. See admin manual for allowed arguments. See {\hyperref[\detokenize{config-advanced:printing}]{\sphinxcrossref{\DUrole{std,std-ref}{Printing}}}} for more information.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{string}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{\textquotesingle{}\textquotesingle{}}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{event\_feed\_format}}}
\label{\detokenize{configuration-reference:event-feed-format}}
\sphinxAtStartPar
Format of the event feed to use. See {[}current draft{]}(\sphinxurl{https://ccs-specs.icpc.io/draft/contest\_api\#event-feed}) and {[}versions available{]}(\sphinxurl{https://ccs-specs.icpc.io/}).
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{enum}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:}

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{l+s+s2}{\PYGZdq{}2022\PYGZhy{}07\PYGZdq{}}
\end{sphinxVerbatim}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{data\_source}}}
\label{\detokenize{configuration-reference:data-source}}
\sphinxAtStartPar
Source of data: used to indicate whether internal or external IDs are exposed in the API. \sphinxtitleref{configuration data external} is typically used when loading configuration data from the ICPC CMS, and \sphinxtitleref{configuration and live data external} when running DOMjudge as “shadow system”. See {\hyperref[\detokenize{shadow::doc}]{\sphinxcrossref{\DUrole{doc}{the chapter on running DOMjudge as a shadow system}}}} for more information.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{0}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Possible options:}
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{0}}: \sphinxstyleemphasis{all local}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{1}}: \sphinxstyleemphasis{configuration data external}

\item {} 
\sphinxAtStartPar
\sphinxcode{\sphinxupquote{2}}: \sphinxstyleemphasis{configuration and live data external}

\end{itemize}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{external\_contest\_sources\_allow\_untrusted\_certificates}}}
\label{\detokenize{configuration-reference:external-contest-sources-allow-untrusted-certificates}}
\sphinxAtStartPar
Whether to allow untrusted TLS certificates when reading from external contest sources.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{external\_judgement\_types}}}
\label{\detokenize{configuration-reference:external-judgement-types}}
\sphinxAtStartPar
List of additional judgement types as reported by the external CCS. All assumed to give a penalty.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{array\_keyval}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} yes

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:}

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{p}{[]}
\end{sphinxVerbatim}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{external\_ccs\_submission\_url}}}
\label{\detokenize{configuration-reference:external-ccs-submission-url}}
\sphinxAtStartPar
URL of a submission detail page on the external CCS. Placeholder \sphinxtitleref{{[}id{]}} will be replaced by submission ID and \sphinxtitleref{{[}contest{]}} by the contest ID. Leave empty to not display links to external CCS. See {\hyperref[\detokenize{shadow::doc}]{\sphinxcrossref{\DUrole{doc}{the chapter on running DOMjudge as a shadow system}}}} for more information.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{string}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{\textquotesingle{}\textquotesingle{}}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{icat\_url}}}
\label{\detokenize{configuration-reference:icat-url}}
\sphinxAtStartPar
URL of an ICPC iCAT instance if such is available; will be linked to from the submission verification box. See \sphinxurl{https://github.com/icpc-live/autoanalyst}
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{string}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{\textquotesingle{}\textquotesingle{}}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{external\_contest\_source\_critical}}}
\label{\detokenize{configuration-reference:external-contest-source-critical}}
\sphinxAtStartPar
Time in seconds after an external contest source reader last checked in before showing its status as \sphinxtitleref{critical}.
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{int}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{120}}

\end{itemize}


\paragraph{\sphinxstyleliteralintitle{\sphinxupquote{adminer\_enabled}}}
\label{\detokenize{configuration-reference:adminer-enabled}}
\sphinxAtStartPar
Is the Adminer Database Editor enabled?
\begin{itemize}
\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Type:} \sphinxcode{\sphinxupquote{bool}}

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Public:} no

\item {} 
\sphinxAtStartPar
\sphinxstylestrong{Default value:} \sphinxcode{\sphinxupquote{False}}

\end{itemize}



\renewcommand{\indexname}{Index}
\printindex
\end{document}