From e77fe16199b2ea8c7d1201c337afa7d9adb57df2 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Tue, 20 Sep 2022 13:50:29 +0800 Subject: [PATCH] chore: add uoj_protocol config --- docker-compose.development.yml | 1 + docker-compose.yml | 1 + web/install.sh | 2 ++ 3 files changed, 4 insertions(+) diff --git a/docker-compose.development.yml b/docker-compose.development.yml index 3b8e34f..531f1a5 100644 --- a/docker-compose.development.yml +++ b/docker-compose.development.yml @@ -51,6 +51,7 @@ services: ports: - "80:80" environment: + - UOJ_PROTOCOL=http - DATABASE_HOST=uoj-db - DATABASE_PASSWORD=root - JUDGER_SOCKET_PORT=2333 diff --git a/docker-compose.yml b/docker-compose.yml index eecbf52..f96fde1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,6 +46,7 @@ services: ports: - "80:80" environment: + - UOJ_PROTOCOL=https - DATABASE_HOST=uoj-db - DATABASE_PASSWORD=root - JUDGER_SOCKET_PORT=2333 diff --git a/web/install.sh b/web/install.sh index 2c7f7ad..74a6156 100644 --- a/web/install.sh +++ b/web/install.sh @@ -11,6 +11,7 @@ _salt0_="${SALT0:-$(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