mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-09 22:05:46 +00:00
GHA workflow - Fix Tests 3+ [skip travis]
This commit is contained in:
parent
5c31bf156f
commit
fa7535856d
5 changed files with 155 additions and 145 deletions
|
@ -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 () {
|
||||
|
@ -80,92 +82,92 @@ echo "${bold}${yellow}-----------------------------"
|
|||
echo "${bold}${yellow}Making GoogleBot ${yellow}RATE LIMITED"
|
||||
echo "${bold}${yellow}-----------------------------"
|
||||
printf "\n"
|
||||
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/rate-limiting-user-agents.conf /etc/nginx/bots.d/blacklist-user-agents.conf
|
||||
sudo cp ./dev-tools/test_units/rate-limiting-user-agents.conf /etc/nginx/bots.d/blacklist-user-agents.conf
|
||||
}
|
||||
|
||||
testRateLimiting () {
|
||||
ratelimittestfile=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/ratelimittest-master.txt
|
||||
ratelimittestfile=./dev-tools/test_units/ratelimittest-master.txt
|
||||
truncate -s 0 ${ratelimittestfile}
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 > ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:9000 2>&1 >> ${ratelimittestfile}
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 > ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile} &
|
||||
curl -A "GoogleBot" http://localhost:80 2>&1 >> ${ratelimittestfile}
|
||||
|
||||
if grep -i 'Unavailable' < ${ratelimittestfile}; then
|
||||
echo "${bold}${green}PASSED - ${red}GoogleBot was ${bold}${red}RATE LIMITED"
|
||||
|
@ -181,10 +183,10 @@ echo "${bold}${green}-------------------------------------------------------"
|
|||
echo "${bold}${green}Backup all conf files and folders used during this test"
|
||||
echo "${bold}${green}-------------------------------------------------------"
|
||||
printf "\n"
|
||||
sudo cp /etc/nginx/bots.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/test1_conf_files_ratelimiting/bots.d/
|
||||
sudo cp /etc/nginx/conf.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/test1_conf_files_ratelimiting/conf.d/
|
||||
sudo cp /etc/nginx/sites-available/default.vhost ${TRAVIS_BUILD_DIR}/.dev-tools/test1_conf_files_ratelimiting/default.vhost
|
||||
sudo cp /etc/nginx/nginx.conf ${TRAVIS_BUILD_DIR}/.dev-tools/test1_conf_files_ratelimiting/nginx.conf
|
||||
sudo cp /etc/nginx/bots.d/* ./dev-tools/test1_conf_files_ratelimiting/bots.d/
|
||||
sudo cp /etc/nginx/conf.d/* ./dev-tools/test1_conf_files_ratelimiting/conf.d/
|
||||
sudo cp /etc/nginx/sites-available/default.vhost ./dev-tools/test1_conf_files_ratelimiting/default.vhost
|
||||
sudo cp /etc/nginx/nginx.conf ./dev-tools/test1_conf_files_ratelimiting/nginx.conf
|
||||
}
|
||||
|
||||
# -----------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue