mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-05 12:09:57 +00:00
GHA workflow - Stage 2 Test 1 [skip travis]
This commit is contained in:
parent
fe51247d01
commit
14923be847
2 changed files with 23 additions and 14 deletions
9
.github/workflows/action.yml
vendored
9
.github/workflows/action.yml
vendored
|
@ -62,6 +62,15 @@ jobs:
|
||||||
./dev-tools/test-blocker-rate-limiting.sh
|
./dev-tools/test-blocker-rate-limiting.sh
|
||||||
./dev-tools/test-blocker-whitelist.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
|
- name: Debug
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
# #
|
# #
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
export TERM=xterm
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# MIT License
|
# MIT License
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -64,7 +66,7 @@ printf "\n"
|
||||||
echo "${bold}${green}---------------"
|
echo "${bold}${green}---------------"
|
||||||
echo "${bold}${green}Reloading Nginx"
|
echo "${bold}${green}Reloading Nginx"
|
||||||
echo "${bold}${green}---------------"
|
echo "${bold}${green}---------------"
|
||||||
sudo nginx -t && sudo nginx -s reload
|
sudo nginx -t && sudo systemctl reload nginx
|
||||||
}
|
}
|
||||||
|
|
||||||
waitforReload () {
|
waitforReload () {
|
||||||
|
@ -100,9 +102,9 @@ printf "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
activateVHost () {
|
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 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}---------------------------------------------"
|
||||||
echo "${bold}${yellow}Activating default.vhost and linking to Nginx"
|
echo "${bold}${yellow}Activating default.vhost and linking to Nginx"
|
||||||
echo "${bold}${yellow}---------------------------------------------"
|
echo "${bold}${yellow}---------------------------------------------"
|
||||||
|
@ -123,8 +125,7 @@ echo "${bold}${magenta}--------------------------"
|
||||||
echo "${bold}${magenta}Execute install-ngxblocker"
|
echo "${bold}${magenta}Execute install-ngxblocker"
|
||||||
echo "${bold}${magenta}--------------------------"
|
echo "${bold}${magenta}--------------------------"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
cd /usr/sbin
|
sudo bash /usr/sbin/install-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d
|
||||||
sudo bash ./install-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d
|
|
||||||
}
|
}
|
||||||
|
|
||||||
runsetupngxblocker1 () {
|
runsetupngxblocker1 () {
|
||||||
|
@ -133,8 +134,7 @@ echo "${bold}${magenta}------------------------"
|
||||||
echo "${bold}${magenta}Execute setup-ngxblocker"
|
echo "${bold}${magenta}Execute setup-ngxblocker"
|
||||||
echo "${bold}${magenta}------------------------"
|
echo "${bold}${magenta}------------------------"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
cd /usr/sbin
|
sudo bash /usr/sbin/setup-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d
|
||||||
sudo bash ./setup-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d
|
|
||||||
}
|
}
|
||||||
|
|
||||||
makeScriptsExecutable () {
|
makeScriptsExecutable () {
|
||||||
|
@ -148,7 +148,7 @@ printf "\n"
|
||||||
echo "${bold}${magenta}------------------------------"
|
echo "${bold}${magenta}------------------------------"
|
||||||
echo "${bold}${magenta}Copy nginx.conf to /etc/nginx/"
|
echo "${bold}${magenta}Copy nginx.conf to /etc/nginx/"
|
||||||
echo "${bold}${magenta}------------------------------"
|
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 () {
|
loadNginxConf () {
|
||||||
|
@ -164,7 +164,7 @@ printf "\n"
|
||||||
echo "${bold}${yellow}----------------------------------------------------"
|
echo "${bold}${yellow}----------------------------------------------------"
|
||||||
echo "${bold}${yellow}Copy older globalblacklist.conf file to force update"
|
echo "${bold}${yellow}Copy older globalblacklist.conf file to force update"
|
||||||
echo "${bold}${yellow}----------------------------------------------------"
|
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 () {
|
forceUpdateTest2 () {
|
||||||
|
@ -192,7 +192,7 @@ echo "${bold}${yellow}----------------------------------------------------------
|
||||||
echo "${bold}${yellow}Make sure we test with latest generated globalblacklist.conf"
|
echo "${bold}${yellow}Make sure we test with latest generated globalblacklist.conf"
|
||||||
echo "${bold}${yellow}------------------------------------------------------------"
|
echo "${bold}${yellow}------------------------------------------------------------"
|
||||||
printf "\n"
|
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 () {
|
backupConfFiles () {
|
||||||
|
@ -201,10 +201,10 @@ echo "${bold}${green}-------------------------------------------------------"
|
||||||
echo "${bold}${green}Backup all conf files and folders used during this test"
|
echo "${bold}${green}Backup all conf files and folders used during this test"
|
||||||
echo "${bold}${green}-------------------------------------------------------"
|
echo "${bold}${green}-------------------------------------------------------"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
sudo cp /usr/local/nginx/bots.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/test2_conf_files/bots.d/
|
sudo cp /usr/local/nginx/bots.d/* ./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 /usr/local/nginx/conf.d/* ./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/sites-available/default.vhost ./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 /etc/nginx/nginx.conf ./dev-tools/test2_conf_files/nginx.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue