From 6cd6f10f6e365d90d140da96c3e9c69c87bc0f13 Mon Sep 17 00:00:00 2001 From: Masco Skray Date: Mon, 15 Jul 2019 16:18:26 +0800 Subject: [PATCH] style(web,install): change judge_client work path When move out judger from bundle, no need to create judger account. So these work paths will no longer exist. Prepare for future. --- install/bundle/Dockerfile | 2 +- install/bundle/install.sh | 22 +++++++++++----------- web/app/controllers/download.php | 2 +- web/app/libs/uoj-judger-lib.php | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/install/bundle/Dockerfile b/install/bundle/Dockerfile index 8add775..6032e4b 100644 --- a/install/bundle/Dockerfile +++ b/install/bundle/Dockerfile @@ -16,7 +16,7 @@ fi\n\ service ntp start\n\ service mysql start\n\ service apache2 start\n\ -su local_main_judger -c \"~/judge_client/judge_client start\"\n\ +su local_main_judger -c \"/opt/UOJ-System/judger/judge_client start\"\n\ exec bash\n" >/root/up && chmod +x /root/up ENV LANG=C.UTF-8 TZ=Asia/Shanghai diff --git a/install/bundle/install.sh b/install/bundle/install.sh index fdf3ad5..c52f311 100644 --- a/install/bundle/install.sh +++ b/install/bundle/install.sh @@ -58,7 +58,7 @@ setLAMPConf(){ XSendFile On XSendFilePath /var/uoj_data XSendFilePath /var/www/uoj/app/storage - XSendFilePath /home/local_main_judger/judge_client/uoj_judger/include + XSendFilePath /opt/UOJ-System/judger/uoj_judger/include UOJEOF #Enable modules and make UOJ site conf enabled @@ -106,23 +106,23 @@ setJudgeConf(){ chown -R www-data /var/uoj_data && chgrp -R www-data /var/uoj_data #Compile judge_client and set runtime su local_main_judger <uoj_judger/include/uoj_work_path.h </home/local_main_judger/judge_client/.conf.json </opt/UOJ-System/judger/.conf.json < Doing initial config and start service\n" #Replace password placeholders - sed -i -e "s/_main_judger_password_/$_main_judger_password_/g" -e "s/_judger_socket_password_/$_judger_socket_password_/g" /home/local_main_judger/judge_client/.conf.json + sed -i -e "s/_main_judger_password_/$_main_judger_password_/g" -e "s/_judger_socket_password_/$_judger_socket_password_/g" /opt/UOJ-System/judger/.conf.json sed -i -e "s/salt0/$(genRandStr 32)/g" -e "s/salt1/$(genRandStr 16)/g" -e "s/salt2/$(genRandStr 16)/g" -e "s/salt3/$(genRandStr 16)/g" -e "s/_judger_socket_password_/$_judger_socket_password_/g" /var/www/uoj/app/.config.php #Import judge_client to MySQL database service mysql start @@ -150,7 +150,7 @@ initProgress(){ service ntp restart service mysql restart service apache2 restart - su local_main_judger -c '~/judge_client/judge_client start' + su local_main_judger -c '/opt/UOJ-System/judger/judge_client start' #Touch SetupDone flag file printf "\n\n***Installation complete. Enjoy!***\n" } diff --git a/web/app/controllers/download.php b/web/app/controllers/download.php index 9ddf720..1b1bef4 100644 --- a/web/app/controllers/download.php +++ b/web/app/controllers/download.php @@ -27,7 +27,7 @@ $download_name = "problem_$id.zip"; break; case 'testlib.h': - $file_name = "/home/local_main_judger/judge_client/uoj_judger/include/testlib.h"; + $file_name = "/opt/UOJ-System/judger/uoj_judger/include/testlib.h"; $download_name = "testlib.h"; break; default: diff --git a/web/app/libs/uoj-judger-lib.php b/web/app/libs/uoj-judger-lib.php index 0c29c3c..931a4be 100644 --- a/web/app/libs/uoj-judger-lib.php +++ b/web/app/libs/uoj-judger-lib.php @@ -1,7 +1,7 @@