diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 1ecb5835d..065f75506 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -62,6 +62,15 @@ jobs: ./dev-tools/test-blocker-rate-limiting.sh ./dev-tools/test-blocker-whitelist.sh + - name: Test Blocker - Stage 2 + shell: bash + run: | + ./dev-tools/install-nginx-2.sh + #./dev-tools/test-nginx-2.sh + #./dev-tools/install-nginx-3.sh + #./dev-tools/test-nginx-3.sh + #./dev-tools/test-setupngxblocker.sh + - name: Debug shell: bash run: | diff --git a/dev-tools/install-nginx-2.sh b/dev-tools/install-nginx-2.sh index f4382d7a3..9e6f0ef00 100755 --- a/dev-tools/install-nginx-2.sh +++ b/dev-tools/install-nginx-2.sh @@ -16,6 +16,8 @@ # # ############################################################################## +export TERM=xterm + # ------------------------------------------------------------------------------ # MIT License # ------------------------------------------------------------------------------ @@ -64,7 +66,7 @@ printf "\n" echo "${bold}${green}---------------" echo "${bold}${green}Reloading Nginx" echo "${bold}${green}---------------" -sudo nginx -t && sudo nginx -s reload +sudo nginx -t && sudo systemctl reload nginx } waitforReload () { @@ -100,9 +102,9 @@ printf "\n" } activateVHost () { -sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/default.vhost /etc/nginx/sites-available/default.vhost +sudo cp ./dev-tools/default.vhost /etc/nginx/sites-available/default.vhost sudo ln -s /etc/nginx/sites-available/default.vhost /etc/nginx/sites-enabled/default.vhost -sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/index.html /var/www/html/index.html +sudo cp ./dev-tools/index.html /var/www/html/index.html echo "${bold}${yellow}---------------------------------------------" echo "${bold}${yellow}Activating default.vhost and linking to Nginx" echo "${bold}${yellow}---------------------------------------------" @@ -123,8 +125,7 @@ echo "${bold}${magenta}--------------------------" echo "${bold}${magenta}Execute install-ngxblocker" echo "${bold}${magenta}--------------------------" printf "\n" -cd /usr/sbin -sudo bash ./install-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d +sudo bash /usr/sbin/install-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d } runsetupngxblocker1 () { @@ -133,8 +134,7 @@ echo "${bold}${magenta}------------------------" echo "${bold}${magenta}Execute setup-ngxblocker" echo "${bold}${magenta}------------------------" printf "\n" -cd /usr/sbin -sudo bash ./setup-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d +sudo bash /usr/sbin/setup-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d } makeScriptsExecutable () { @@ -148,7 +148,7 @@ printf "\n" echo "${bold}${magenta}------------------------------" echo "${bold}${magenta}Copy nginx.conf to /etc/nginx/" echo "${bold}${magenta}------------------------------" -sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/nginx.conf-newformat /etc/nginx/nginx.conf +sudo cp ./dev-tools/test_units/nginx.conf-newformat /etc/nginx/nginx.conf } loadNginxConf () { @@ -164,7 +164,7 @@ printf "\n" echo "${bold}${yellow}----------------------------------------------------" echo "${bold}${yellow}Copy older globalblacklist.conf file to force update" echo "${bold}${yellow}----------------------------------------------------" -sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/globalblacklist-dummy.conf /usr/local/nginx/conf.d/globalblacklist.conf +sudo cp ./dev-tools/globalblacklist-dummy.conf /usr/local/nginx/conf.d/globalblacklist.conf } forceUpdateTest2 () { @@ -192,7 +192,7 @@ echo "${bold}${yellow}---------------------------------------------------------- echo "${bold}${yellow}Make sure we test with latest generated globalblacklist.conf" echo "${bold}${yellow}------------------------------------------------------------" printf "\n" -sudo cp ${TRAVIS_BUILD_DIR}/conf.d/globalblacklist.conf /usr/local/nginx/conf.d/globalblacklist.conf +sudo cp ./conf.d/globalblacklist.conf /usr/local/nginx/conf.d/globalblacklist.conf } backupConfFiles () { @@ -201,10 +201,10 @@ echo "${bold}${green}-------------------------------------------------------" echo "${bold}${green}Backup all conf files and folders used during this test" echo "${bold}${green}-------------------------------------------------------" printf "\n" -sudo cp /usr/local/nginx/bots.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/test2_conf_files/bots.d/ -sudo cp /usr/local/nginx/conf.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/test2_conf_files/conf.d/ -sudo cp /etc/nginx/sites-available/default.vhost ${TRAVIS_BUILD_DIR}/.dev-tools/test2_conf_files/default.vhost -sudo cp /etc/nginx/nginx.conf ${TRAVIS_BUILD_DIR}/.dev-tools/test2_conf_files/nginx.conf +sudo cp /usr/local/nginx/bots.d/* ./dev-tools/test2_conf_files/bots.d/ +sudo cp /usr/local/nginx/conf.d/* ./dev-tools/test2_conf_files/conf.d/ +sudo cp /etc/nginx/sites-available/default.vhost ./dev-tools/test2_conf_files/default.vhost +sudo cp /etc/nginx/nginx.conf ./dev-tools/test2_conf_files/nginx.conf }