mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 18:19:55 +00:00
[GHA] FIX Nginx folder locations
This commit is contained in:
parent
79aa4762f2
commit
8c44ede752
1 changed files with 17 additions and 23 deletions
|
@ -63,12 +63,6 @@ defaultcolor=$(tput setaf default)
|
|||
# FUNCTIONS
|
||||
# ---------
|
||||
|
||||
# Debug Folder Locations
|
||||
ls -la /
|
||||
ls -la /etc
|
||||
ls -la ./etc
|
||||
|
||||
|
||||
reloadNginX () {
|
||||
printf "\n"
|
||||
echo "${bold}${green}---------------"
|
||||
|
@ -90,7 +84,7 @@ printf "\n"
|
|||
echo "${bold}${yellow}---------------------------"
|
||||
echo "${bold}${yellow}Making backup of nginx.conf"
|
||||
echo "${bold}${yellow}---------------------------"
|
||||
sudo cp ./etc/nginx/nginx.conf ./dev-tools/test1_conf_backup_nginxconf/nginx.conf
|
||||
sudo cp /etc/nginx/nginx.conf ./dev-tools/test1_conf_backup_nginxconf/nginx.conf
|
||||
}
|
||||
|
||||
prepareVhost () {
|
||||
|
@ -98,15 +92,15 @@ printf "\n"
|
|||
echo "${bold}${yellow}-------------------------------------------"
|
||||
echo "${bold}${yellow}Delete any default files installed by Nginx"
|
||||
echo "${bold}${yellow}-------------------------------------------"
|
||||
sudo rm ./etc/nginx/sites-available/*
|
||||
sudo rm ./etc/nginx/sites-enabled/*
|
||||
sudo rm /etc/nginx/sites-available/*
|
||||
sudo rm /etc/nginx/sites-enabled/*
|
||||
sudo rm ./var/www/html/*
|
||||
printf "\n"
|
||||
echo "${bold}${yellow}---------------------"
|
||||
echo "${bold}${yellow}Setup Vhost for Nginx"
|
||||
echo "${bold}${yellow}---------------------"
|
||||
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 ./dev-tools/index.html /var/www/html/index.html
|
||||
}
|
||||
|
||||
|
@ -152,7 +146,7 @@ sudo bash ./setup-ngxblocker -x
|
|||
}
|
||||
|
||||
loadNginxConf () {
|
||||
sudo nginx -c ./etc/nginx/nginx.conf
|
||||
sudo nginx -c /etc/nginx/nginx.conf
|
||||
}
|
||||
|
||||
forceUpdateTest1 () {
|
||||
|
@ -160,17 +154,17 @@ printf "\n"
|
|||
echo "${bold}${yellow}----------------------------------------------------"
|
||||
echo "${bold}${yellow}Copy older globalblacklist.conf file to force update"
|
||||
echo "${bold}${yellow}----------------------------------------------------"
|
||||
sudo cp ./dev-tools/globalblacklist-dummy.conf ./etc/nginx/conf.d/globalblacklist.conf
|
||||
sudo cp ./dev-tools/globalblacklist-dummy.conf /etc/nginx/conf.d/globalblacklist.conf
|
||||
}
|
||||
|
||||
forceUpdateTest2 () {
|
||||
echo "${bold}${yellow}--------------------------------------"
|
||||
echo "${bold}${yellow}Delete Files to test update-ngxblocker"
|
||||
echo "${bold}${yellow}--------------------------------------"
|
||||
sudo rm ./etc/nginx/conf.d/*.conf
|
||||
sudo rm ./etc/nginx/bots.d/*.conf
|
||||
ls -la ./etc/nginx/conf.d/
|
||||
ls -la ./etc/nginx/bots.d/
|
||||
sudo rm /etc/nginx/conf.d/*.conf
|
||||
sudo rm /etc/nginx/bots.d/*.conf
|
||||
ls -la /etc/nginx/conf.d/
|
||||
ls -la /etc/nginx/bots.d/
|
||||
}
|
||||
|
||||
forceUpdateTest3 () {
|
||||
|
@ -178,7 +172,7 @@ printf "\n"
|
|||
echo "${bold}${yellow}----------------------------------------------------"
|
||||
echo "${bold}${yellow}Copy older globalblacklist.conf file to force update"
|
||||
echo "${bold}${yellow}----------------------------------------------------"
|
||||
sudo cp ./dev-tools/globalblacklist-dummy.conf ./etc/nginx/conf.d/globalblacklist.conf
|
||||
sudo cp ./dev-tools/globalblacklist-dummy.conf /etc/nginx/conf.d/globalblacklist.conf
|
||||
}
|
||||
|
||||
runupdatengxblocker () {
|
||||
|
@ -194,7 +188,7 @@ activateLatestBlacklist () {
|
|||
echo "${bold}${yellow}------------------------------------------------------------"
|
||||
echo "${bold}${yellow}Make sure we test with latest generated globalblacklist.conf"
|
||||
echo "${bold}${yellow}------------------------------------------------------------"
|
||||
sudo cp ./conf.d/globalblacklist.conf ./etc/nginx/conf.d/globalblacklist.conf
|
||||
sudo cp ./conf.d/globalblacklist.conf /etc/nginx/conf.d/globalblacklist.conf
|
||||
}
|
||||
|
||||
backupConfFiles () {
|
||||
|
@ -202,10 +196,10 @@ printf "\n"
|
|||
echo "${bold}${green}-------------------------------------------------------"
|
||||
echo "${bold}${green}Backup all conf files and folders used during this test"
|
||||
echo "${bold}${green}-------------------------------------------------------"
|
||||
sudo cp ./etc/nginx/bots.d/* ./dev-tools/test1_conf_files/bots.d/
|
||||
sudo cp ./etc/nginx/conf.d/* ./dev-tools/test1_conf_files/conf.d/
|
||||
sudo cp ./etc/nginx/sites-available/default.vhost ./dev-tools/test1_conf_files/default.vhost
|
||||
sudo cp ./etc/nginx/nginx.conf ./dev-tools/test1_conf_files/nginx.conf
|
||||
sudo cp /etc/nginx/bots.d/* ./dev-tools/test1_conf_files/bots.d/
|
||||
sudo cp /etc/nginx/conf.d/* ./dev-tools/test1_conf_files/conf.d/
|
||||
sudo cp /etc/nginx/sites-available/default.vhost ./dev-tools/test1_conf_files/default.vhost
|
||||
sudo cp /etc/nginx/nginx.conf ./dev-tools/test1_conf_files/nginx.conf
|
||||
}
|
||||
|
||||
copyNginxConf () {
|
||||
|
@ -213,7 +207,7 @@ printf "\n"
|
|||
echo "${bold}${magenta}------------------------------"
|
||||
echo "${bold}${magenta}Copy nginx.conf to /etc/nginx/"
|
||||
echo "${bold}${magenta}------------------------------"
|
||||
sudo cp ./dev-tools/test_units/nginx.conf-newformat ./etc/nginx/nginx.conf
|
||||
sudo cp ./dev-tools/test_units/nginx.conf-newformat /etc/nginx/nginx.conf
|
||||
}
|
||||
|
||||
getnginxversion () {
|
||||
|
|
Loading…
Add table
Reference in a new issue