@@ -21,13 +21,8 @@ if [[ "$INSTALL_OPT" == "f" || "$INSTALL_OPT" == "full" ]]; then
2121 build-essential openjdk-11-jdk-headless fp-compiler postgresql postgresql-client \
2222 python3.12 cppreference-doc-en-html libffi-dev zip \
2323 python3.12-dev libpq-dev libcups2-dev libyaml-dev php-cli \
24- texlive-latex-base a2ps ghc rustc mono-mcs pypy3 python3-pycryptodome python3-venv git python3-pip
25- read -p " Do you want to install additional Free Pascal Units? [Y/N] (default Y): " PASCAL_UNITS_INSTALL
26- PASCAL_UNITS_INSTALL=${PASCAL_UNITS_INSTALL:- Y}
27- PASCAL_UNITS_INSTALL=${PASCAL_UNITS_INSTALL,,}
28- if [[ " $PASCAL_UNITS_INSTALL " == " y" || " $PASCAL_UNITS_INSTALL " == " yes" ]]; then
29- sudo apt-get install -y fp-units-base fp-units-fcl fp-units-misc fp-units-math fp-units-rtl
30- fi
24+ texlive-latex-base a2ps ghc rustc mono-mcs pypy3 python3-pycryptodome python3-venv \
25+ git python3-pip fp-units-base fp-units-fcl fp-units-misc fp-units-math fp-units-rtl
3126else
3227sudo apt-get install -y \
3328 build-essential postgresql postgresql-client \
@@ -49,14 +44,15 @@ if ! id cmsuser &>/dev/null; then
4944 sudo useradd --user-group --create-home --comment CMS cmsuser
5045fi
5146sudo usermod -aG isolate cmsuser
47+ sudo usermod -aG sudo cmsuser
5248sudo -u cmsuser git clone https://github.com/cms-dev/cms.git /home/cmsuser/cms
5349sudo sed -i ' s|default=\["C11 / gcc", "C++20 / g++", "Pascal / fpc"\])|default=\["C11 / gcc", "C++20 / g++"\])|' /home/cmsuser/cms/cms/db/contest.py
5450sudo -u cmsuser bash -c ' cd /home/cmsuser/cms && /home/cmsuser/cms/install.py --dir=target cms'
5551CONFIG_PATH=" /home/cmsuser/cms/target/etc/cms.toml"
5652SECRET_KEY=$( sudo -u cmsuser /home/cmsuser/cms/target/bin/python3 -c ' from cmscommon import crypto; print(crypto.get_hex_random_key())' )
5753
5854# Database
59- read -p " Do you want to initialize the database [Y/N] (default : Y) : " DB_OPTION
55+ read -p " Do you want to create a new database [Y/N] (default : Y) : " DB_OPTION
6056DB_OPTION=${DB_OPTION:- Y}
6157DB_OPTION=${DB_OPTION,,}
6258if [[ " $DB_OPTION " == " y" || " $DB_OPTION " == " Y" ]]; then
@@ -83,7 +79,7 @@ if [[ "$DB_OPTION" == "y" || "$DB_OPTION" == "Y" ]]; then
8379 sudo sed -i " s|^secret_key = \" .*\" |secret_key = \" $SECRET_KEY \" |" " $CONFIG_PATH "
8480 sudo -u cmsuser bash -c ' /home/cmsuser/cms/target/bin/cmsInitDB'
8581fi
86- sudo usermod -aG sudo cmsuser
82+
8783# Docs
8884sudo mkdir /usr/share/cms
8985sudo mkdir /usr/share/cms/docs
0 commit comments