Compare commits

..

2 Commits

Author SHA1 Message Date
e77fe16199
chore: add uoj_protocol config
All checks were successful
continuous-integration/drone/push Build is passing
2022-09-20 13:50:29 +08:00
3de083701d
fix: randStr length 2022-09-20 13:20:51 +08:00
3 changed files with 5 additions and 1 deletions

View File

@ -51,6 +51,7 @@ services:
ports:
- "80:80"
environment:
- UOJ_PROTOCOL=http
- DATABASE_HOST=uoj-db
- DATABASE_PASSWORD=root
- JUDGER_SOCKET_PORT=2333

View File

@ -46,6 +46,7 @@ services:
ports:
- "80:80"
environment:
- UOJ_PROTOCOL=https
- DATABASE_HOST=uoj-db
- DATABASE_PASSWORD=root
- JUDGER_SOCKET_PORT=2333

View File

@ -8,9 +8,10 @@ _database_password_="${DATABASE_PASSWORD:-root}"
_judger_socket_port_="${JUDGER_SOCKET_PORT:-2333}"
_judger_socket_password_="${JUDGER_SOCKET_PASSWORD:-_judger_socket_password_}"
_salt0_="${SALT0:-$(genRandStr 32)}"
_salt1_="${SALT1:-$(genRandStr 32)}"
_salt1_="${SALT1:-$(genRandStr 16)}"
_salt2_="${SALT2:-$(genRandStr 16)}"
_salt3_="${SALT3:-$(genRandStr 16)}"
_uoj_protocol_="${UOJ_PROTOCOL:-http}"
getAptPackage(){
printf "\n\n==> Getting environment packages\n"
@ -86,6 +87,7 @@ initProgress(){
chown -R www-data:www-data /var/uoj_data
#Replace password placeholders
sed -i -e "s/salt0/$_salt0_/g" -e "s/salt1/$_salt1_/g" -e "s/salt2/$_salt2_/g" -e "s/salt3/$_salt3_/g" -e "s/_judger_socket_password_/$_judger_socket_password_/g" /var/www/uoj/app/.config.php
sed -i -e "s/'protocol' => 'http'/'protocol' => '$_uoj_protocol_',/g" /var/www/uoj/app/.config.php
#Using cli upgrade to latest
php /var/www/uoj/app/cli.php upgrade:latest
#Start services