Skip to content

Commit 2cb7eb9

Browse files
Michael Vasseurvmcj
authored andcommitted
Drop support for building containers DOMjudge <8.0
We assume PHP8 already in the scripts, so I suspect this did not work anymore. When someone wants such an older version they can still check the history for the current files and alter the setup from there.
1 parent b6ae271 commit 2cb7eb9

File tree

3 files changed

+2
-73
lines changed

3 files changed

+2
-73
lines changed

docker/domserver/build.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,12 @@ sudo -u domjudge ./configure -with-baseurl=http://localhost/
88

99
# Passwords should not be included in the built image. We create empty files here to prevent passwords from being generated.
1010
sudo -u domjudge touch etc/dbpasswords.secret etc/restapi.secret etc/symfony_app.secret etc/initial_admin_password.secret
11-
if [ ! -f webapp/config/load_db_secrets.php ]
12-
then
13-
# DOMjudge 7.1
14-
sudo -u domjudge touch webapp/.env.local webapp/.env.local.php
15-
fi
1611

1712
sudo -u domjudge make domserver
1813
make install-domserver
1914

2015
# Remove installed password files
2116
rm /opt/domjudge/domserver/etc/*.secret
22-
if [ ! -f webapp/config/load_db_secrets.php ]
23-
then
24-
# DOMjudge 7.1
25-
rm /opt/domjudge/domserver/webapp/.env.local /opt/domjudge/domserver/webapp/.env.local.php
26-
fi
2717

2818
sudo -u domjudge sh -c '. /venv/bin/activate && make docs'
2919
# Use Python venv to use the latest Sphinx to build DOMjudge docs.

docker/domserver/configure.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
# Create PHP FPM socket dir, change permissions for some domjudge directories and fix scripts
44
mkdir -p /run/php
55
chown -R www-data: /opt/domjudge/domserver/tmp
6-
# for DOMjudge <= 7.2 (submitdir was removed in commit DOMjudge/domjudge@d66725038)
7-
if [ -d /opt/domjudge/domserver/submissions ]
8-
then
9-
chown -R www-data: /opt/domjudge/domserver/submissions
10-
fi
116

127
chmod 755 /scripts/start.sh
138
for script in /scripts/bin/*

docker/domserver/scripts/start.d/50-domjudge.sh

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -42,50 +42,8 @@ else
4242
fi
4343

4444
# Generate secrets
45-
if [[ -f etc/gen_all_secrets ]]
46-
then
47-
# DOMjudge >= 7.2.1
48-
(cd etc && ./gen_all_secrets)
49-
# (Note: running 'etc/gen_all_secrets' does not work before commit DOMjudge/domjudge@9bac55144600)
50-
elif [[ -f webapp/config/load_db_secrets.php ]]
51-
then
52-
# DOMjudge 7.2.0
53-
# This version does not install gen_all_secrets and gensymfonysecret, so we have to inline them here (fixed in commit DOMjudge/domjudge@d523a965f8e0)
54-
if [[ ! -f etc/restapi.secret ]]; then
55-
etc/genrestapicredentials | (umask 077 && cat > etc/restapi.secret)
56-
fi
57-
if [[ ! -f etc/initial_admin_password.secret ]]; then
58-
etc/genadminpassword | (umask 077 && cat > etc/initial_admin_password.secret)
59-
fi
60-
if [[ ! -f etc/symfony_app.secret ]]; then
61-
{
62-
# From etc/gensymfonysecret
63-
head -c20 /dev/urandom | base64 | head -c20 | tr '/+' 'Aa'
64-
echo
65-
} | (umask 077 && cat > etc/symfony_app.secret)
66-
fi
67-
else
68-
# DOMjudge 7.1
69-
if [[ ! -f etc/restapi.secret ]]; then
70-
etc/genrestapicredentials | (umask 077 && cat > etc/restapi.secret)
71-
fi
72-
if [[ ! -f etc/initial_admin_password.secret ]]; then
73-
etc/genadminpassword | (umask 077 && cat > etc/initial_admin_password.secret)
74-
fi
75-
# This version needs the database settings and app secret to be in webapp/.env.local
76-
# It is generated using etc/gensymfonyenv on DOMjudge 7.1, but that script is not installed so we inline it here
77-
if [[ ! -f webapp/.env.local ]]; then
78-
{
79-
SECRET=$(head -c20 /dev/urandom | base64 | head -c20 | tr '/+' 'Aa')
80-
echo "# Generated on $(hostname), $(date)."
81-
echo
82-
echo "# Uncomment the following line to run the application in development mode"
83-
echo "#APP_ENV=dev"
84-
echo "APP_SECRET=$SECRET"
85-
echo "DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}"
86-
} | (umask 077 && cat > webapp/.env.local)
87-
fi
88-
fi
45+
(cd etc && ./gen_all_secrets)
46+
# (Note: running 'etc/gen_all_secrets' does not work before commit DOMjudge/domjudge@9bac55144600)
8947

9048
# Add the Docker gateway as a trusted proxy
9149
if grep -q TRUSTED_PROXIES webapp/.env.local > /dev/null 2>&1
@@ -163,20 +121,6 @@ done
163121
echo "real_ip_header X-Forwarded-For;" >> ${NGINX_CONFIG_FILE}
164122
echo "real_ip_recursive on;" >> ${NGINX_CONFIG_FILE}
165123

166-
if [[ ! -f webapp/config/load_db_secrets.php ]]
167-
then
168-
# DOMjudge 7.1 dumps the environment into webapp/.env.local.php for improved speed
169-
# We also do that here (with some additional setup to get composer to work)
170-
echo '{"config": {"vendor-dir": "lib/vendor"}, "extra": {"symfony": {"root-dir": "webapp/"}}}' > composer.json
171-
touch webapp/.env
172-
composer symfony:dump-env prod
173-
rm composer.json
174-
if [[ ! -s webapp/.env ]]; then
175-
rm webapp/.env
176-
fi
177-
chmod og= webapp/.env.local.php
178-
fi
179-
180124
# Set up permissions
181125
chown -R www-data: webapp/public/images
182126
chown www-data: etc/dbpasswords.secret

0 commit comments

Comments
 (0)