diff --git a/.dev-tools/_conf_files_ratelimiting/.keep b/.dev-tools/conf_files_ratelimiting/.keep similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/.keep rename to .dev-tools/conf_files_ratelimiting/.keep diff --git a/.dev-tools/_conf_files_ratelimiting/bots.d/.keep b/.dev-tools/conf_files_ratelimiting/bots.d/.keep similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/bots.d/.keep rename to .dev-tools/conf_files_ratelimiting/bots.d/.keep diff --git a/.dev-tools/_conf_files_ratelimiting/bots.d/bad-referrer-words.conf b/.dev-tools/conf_files_ratelimiting/bots.d/bad-referrer-words.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/bots.d/bad-referrer-words.conf rename to .dev-tools/conf_files_ratelimiting/bots.d/bad-referrer-words.conf diff --git a/.dev-tools/_conf_files_ratelimiting/bots.d/blacklist-domains.conf b/.dev-tools/conf_files_ratelimiting/bots.d/blacklist-domains.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/bots.d/blacklist-domains.conf rename to .dev-tools/conf_files_ratelimiting/bots.d/blacklist-domains.conf diff --git a/.dev-tools/_conf_files_ratelimiting/bots.d/blacklist-ips.conf b/.dev-tools/conf_files_ratelimiting/bots.d/blacklist-ips.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/bots.d/blacklist-ips.conf rename to .dev-tools/conf_files_ratelimiting/bots.d/blacklist-ips.conf diff --git a/.dev-tools/_conf_files_ratelimiting/bots.d/blacklist-user-agents.conf b/.dev-tools/conf_files_ratelimiting/bots.d/blacklist-user-agents.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/bots.d/blacklist-user-agents.conf rename to .dev-tools/conf_files_ratelimiting/bots.d/blacklist-user-agents.conf diff --git a/.dev-tools/_conf_files_ratelimiting/bots.d/blockbots.conf b/.dev-tools/conf_files_ratelimiting/bots.d/blockbots.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/bots.d/blockbots.conf rename to .dev-tools/conf_files_ratelimiting/bots.d/blockbots.conf diff --git a/.dev-tools/_conf_files_ratelimiting/bots.d/custom-bad-referrers.conf b/.dev-tools/conf_files_ratelimiting/bots.d/custom-bad-referrers.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/bots.d/custom-bad-referrers.conf rename to .dev-tools/conf_files_ratelimiting/bots.d/custom-bad-referrers.conf diff --git a/.dev-tools/_conf_files_ratelimiting/bots.d/ddos.conf b/.dev-tools/conf_files_ratelimiting/bots.d/ddos.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/bots.d/ddos.conf rename to .dev-tools/conf_files_ratelimiting/bots.d/ddos.conf diff --git a/.dev-tools/_conf_files_ratelimiting/bots.d/whitelist-domains.conf b/.dev-tools/conf_files_ratelimiting/bots.d/whitelist-domains.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/bots.d/whitelist-domains.conf rename to .dev-tools/conf_files_ratelimiting/bots.d/whitelist-domains.conf diff --git a/.dev-tools/_conf_files_ratelimiting/bots.d/whitelist-ips.conf b/.dev-tools/conf_files_ratelimiting/bots.d/whitelist-ips.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/bots.d/whitelist-ips.conf rename to .dev-tools/conf_files_ratelimiting/bots.d/whitelist-ips.conf diff --git a/.dev-tools/_conf_files_ratelimiting/conf.d/.keep b/.dev-tools/conf_files_ratelimiting/conf.d/.keep similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/conf.d/.keep rename to .dev-tools/conf_files_ratelimiting/conf.d/.keep diff --git a/.dev-tools/_conf_files_ratelimiting/conf.d/botblocker-nginx-settings.conf b/.dev-tools/conf_files_ratelimiting/conf.d/botblocker-nginx-settings.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/conf.d/botblocker-nginx-settings.conf rename to .dev-tools/conf_files_ratelimiting/conf.d/botblocker-nginx-settings.conf diff --git a/.dev-tools/_conf_files_ratelimiting/conf.d/globalblacklist.conf b/.dev-tools/conf_files_ratelimiting/conf.d/globalblacklist.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/conf.d/globalblacklist.conf rename to .dev-tools/conf_files_ratelimiting/conf.d/globalblacklist.conf diff --git a/.dev-tools/_conf_files_ratelimiting/default.vhost b/.dev-tools/conf_files_ratelimiting/default.vhost similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/default.vhost rename to .dev-tools/conf_files_ratelimiting/default.vhost diff --git a/.dev-tools/_conf_files_ratelimiting/nginx.conf b/.dev-tools/conf_files_ratelimiting/nginx.conf similarity index 100% rename from .dev-tools/_conf_files_ratelimiting/nginx.conf rename to .dev-tools/conf_files_ratelimiting/nginx.conf diff --git a/.dev-tools/generate-files.sh b/.dev-tools/generate-files.sh index 0f06855d5..c2a58d6c3 100755 --- a/.dev-tools/generate-files.sh +++ b/.dev-tools/generate-files.sh @@ -84,7 +84,7 @@ sudo dos2unix ${TRAVIS_BUILD_DIR}/.dev-tools/referrers-regex-format.txt echo "${bold}${green}-------------------------" echo "${bold}${green}File Generation Completed" echo "${bold}${green}-------------------------" -printf "\n\n" +printf "\n" } # ----------------- diff --git a/.dev-tools/generate-google-disavow.sh b/.dev-tools/generate-google-disavow.sh index ebe0f6a3e..7d2ad5a5c 100755 --- a/.dev-tools/generate-google-disavow.sh +++ b/.dev-tools/generate-google-disavow.sh @@ -74,7 +74,7 @@ done < ${_input1} echo "${bold}${green}-----------------------" echo "${bold}${green}Creating Google Disavow" echo "${bold}${green}-----------------------" -printf "\n\n" +printf "\n" } # ----------------- diff --git a/.dev-tools/generate-robots.sh b/.dev-tools/generate-robots.sh index eef658956..16c1c537d 100755 --- a/.dev-tools/generate-robots.sh +++ b/.dev-tools/generate-robots.sh @@ -98,7 +98,7 @@ sudo cp ${_tmprobots} ${TRAVIS_BUILD_DIR}/robots.txt/robots.txt echo "${bold}${green}-------------------------------" echo "${bold}${green}robots.txt Generation Completed" echo "${bold}${green}-------------------------------" -printf "\n\n" +printf "\n" } # ---------------- diff --git a/.dev-tools/install-nginx-1.sh b/.dev-tools/install-nginx-1.sh index fcef116b3..8d7fd8f07 100755 --- a/.dev-tools/install-nginx-1.sh +++ b/.dev-tools/install-nginx-1.sh @@ -116,7 +116,6 @@ sudo chmod +x /usr/sbin/install-ngxblocker } runinstallngxblocker () { -printf "\n" echo "${bold}${magenta}--------------------------" echo "${bold}${magenta}Execute install-ngxblocker" echo "${bold}${magenta}--------------------------" @@ -155,7 +154,6 @@ sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/globalblacklist-dummy.conf /etc/nginx/con } forceUpdateTest2 () { -printf "\n" echo "${bold}${yellow}--------------------------------------" echo "${bold}${yellow}Delete Files to test update-ngxblocker" echo "${bold}${yellow}--------------------------------------" @@ -183,7 +181,6 @@ sudo bash ./update-ngxblocker -n } activateLatestBlacklist () { -printf "\n" echo "${bold}${yellow}------------------------------------------------------------" echo "${bold}${yellow}Make sure we test with latest generated globalblacklist.conf" echo "${bold}${yellow}------------------------------------------------------------" @@ -192,9 +189,9 @@ sudo cp ${TRAVIS_BUILD_DIR}/conf.d/globalblacklist.conf /etc/nginx/conf.d/global backupConfFiles () { printf "\n" -echo "${bold}${green}------------------------------------------------------------" -echo "${bold}${green}Make Backup all conf files and folders used during this test" -echo "${bold}${green}------------------------------------------------------------" +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/* ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_test1/bots.d/ sudo cp /etc/nginx/conf.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_test1/conf.d/ sudo cp /etc/nginx/sites-available/default.vhost ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_test1/default.vhost @@ -209,7 +206,6 @@ printf "\n" echo "${bold}${green}------------------" echo "${bold}${green}Start Nginx Test 1" echo "${bold}${green}------------------" -printf "\n" backupNginxConf prepareVhost diff --git a/.dev-tools/install-nginx-2.sh b/.dev-tools/install-nginx-2.sh index 69dd38d33..529e5aec1 100755 --- a/.dev-tools/install-nginx-2.sh +++ b/.dev-tools/install-nginx-2.sh @@ -110,7 +110,6 @@ printf "\n" } getinstallngxblocker () { -printf "\n" echo "${bold}${magenta}--------------------------------------" echo "${bold}${magenta}Fetch install-ngxblocker from the repo" echo "${bold}${magenta}--------------------------------------" @@ -129,6 +128,7 @@ sudo bash ./install-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx } runsetupngxblocker1 () { +printf "\n" echo "${bold}${magenta}------------------------" echo "${bold}${magenta}Execute setup-ngxblocker" echo "${bold}${magenta}------------------------" @@ -144,18 +144,18 @@ sudo chmod +x /usr/sbin/update-ngxblocker } copyNginxConf () { +printf "\n" echo "${bold}${magenta}------------------------------" echo "${bold}${magenta}Copy nginx.conf to /etc/nginx/" echo "${bold}${magenta}------------------------------" -printf "\n" sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/nginx.conf-newformat /etc/nginx/nginx.conf } loadNginxConf () { +printf "\n" echo "${bold}${magenta}---------------" echo "${bold}${magenta}Load nginx.conf" echo "${bold}${magenta}---------------" -printf "\n" sudo nginx -c /etc/nginx/nginx.conf } @@ -164,12 +164,10 @@ printf "\n" echo "${bold}${yellow}----------------------------------------------------" echo "${bold}${yellow}Copy older globalblacklist.conf file to force update" echo "${bold}${yellow}----------------------------------------------------" -printf "\n" sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/globalblacklist-dummy.conf /usr/local/nginx/conf.d/globalblacklist.conf } forceUpdateTest2 () { -printf "\n" echo "${bold}${yellow}--------------------------------------" echo "${bold}${yellow}Delete Files to test update-ngxblocker" echo "${bold}${yellow}--------------------------------------" @@ -185,13 +183,11 @@ printf "\n" echo "${bold}${magenta}-------------------------" echo "${bold}${magenta}Execute update-ngxblocker" echo "${bold}${magenta}-------------------------" -printf "\n" cd /usr/sbin sudo bash ./update-ngxblocker -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d -n } activateLatestBlacklist () { -printf "\n" echo "${bold}${yellow}------------------------------------------------------------" echo "${bold}${yellow}Make sure we test with latest generated globalblacklist.conf" echo "${bold}${yellow}------------------------------------------------------------" @@ -201,9 +197,9 @@ sudo cp ${TRAVIS_BUILD_DIR}/conf.d/globalblacklist.conf /usr/local/nginx/conf.d/ backupConfFiles () { printf "\n" -echo "${bold}${green}------------------------------------------------------------" -echo "${bold}${green}Make Backup all conf files and folders used during this test" -echo "${bold}${green}------------------------------------------------------------" +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/conf_files_test2/bots.d/ sudo cp /usr/local/nginx/conf.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/conf_files_test2/conf.d/ diff --git a/.dev-tools/modify-config-readme-files.sh b/.dev-tools/modify-config-readme-files.sh index 2b6e9f399..3bbebc0e0 100755 --- a/.dev-tools/modify-config-readme-files.sh +++ b/.dev-tools/modify-config-readme-files.sh @@ -177,7 +177,7 @@ updateGoogleGhostSpam echo "${bold}${green}------------------------" echo "${bold}${green}All README Files Updated" echo "${bold}${green}------------------------" -printf "\n\n" +printf "\n" # ---------------------- # Exit With Error Number diff --git a/.dev-tools/prepare-robots-input.sh b/.dev-tools/prepare-robots-input.sh index 42ddaa1d4..8ebcd285c 100755 --- a/.dev-tools/prepare-robots-input.sh +++ b/.dev-tools/prepare-robots-input.sh @@ -73,7 +73,7 @@ sort -u ${_output} -o ${_output} echo "${bold}${green}--------------------------------" echo "${bold}${green}robots.txt Preparation Completed" echo "${bold}${green}--------------------------------" -printf "\n\n" +printf "\n" } # ---------------- diff --git a/.dev-tools/test-blocker-badwords.sh b/.dev-tools/test-blocker-badwords.sh index fad573443..d19ee8d2b 100755 --- a/.dev-tools/test-blocker-badwords.sh +++ b/.dev-tools/test-blocker-badwords.sh @@ -60,10 +60,10 @@ defaultcolor=$(tput setaf default) # --------- reloadNginX () { +printf "\n" echo "${bold}${green}---------------" echo "${bold}${green}Reloading Nginx" echo "${bold}${green}---------------" -printf "\n\n" sudo nginx -t && sudo nginx -s reload } @@ -71,7 +71,7 @@ waitforReload () { echo "${bold}${yellow}-----------------------------------------------------------------------" echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis" echo "${bold}${yellow}-----------------------------------------------------------------------" -printf "\n\n" +printf "\n" sleep 10s } @@ -79,7 +79,7 @@ activateBadWords () { echo "${bold}${green}----------------------------------------" echo "${bold}${green}Activating Users bad-referrer-words.conf" echo "${bold}${green}----------------------------------------" -printf "\n\n" +printf "\n" sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/bad-referrer-words.conf /etc/nginx/bots.d/bad-referrer-words.conf } @@ -104,7 +104,7 @@ fi echo "${bold}${green}--------------------------------" echo "${bold}${green}Bad Referrer Words Test Starting" echo "${bold}${green}--------------------------------" -printf "\n\n" +printf "\n" activateBadWords reloadNginX @@ -115,7 +115,7 @@ run_curltest2 echo "${bold}${green}--------------------------------" echo "${bold}${green}Bad Referrer Words Test Complete" echo "${bold}${green}--------------------------------" -printf "\n\n" +printf "\n" # ---------------------- # Exit With Error Number diff --git a/.dev-tools/test-blocker-quick.sh b/.dev-tools/test-blocker-quick.sh index 2e829979f..b499a77ed 100755 --- a/.dev-tools/test-blocker-quick.sh +++ b/.dev-tools/test-blocker-quick.sh @@ -64,7 +64,6 @@ resetNginx () { echo "${bold}${green}------------------------------------------------" echo "${bold}${green}Disable any User Whitelisting and set to Default" echo "${bold}${green}------------------------------------------------" -printf "\n" sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/blacklist-user-agents-none.conf /etc/nginx/bots.d/blacklist-user-agents.conf } @@ -224,10 +223,10 @@ shuf -n 10 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list > ${TRAVIS_ sed 's/\\//g' ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list sudo rm ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.tmp sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list +printf "\n" echo "${bold}${magenta}---------------------------" echo "${bold}${magenta}Testing 10 Random Bad Bots" echo "${bold}${magenta}---------------------------" -printf "\n" IFS=$'\n' file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-test-quick.list lines=$(cat ${file}) @@ -244,10 +243,10 @@ IFS="" testGoodUserAgents () { sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/good-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list +printf "\n" echo "${bold}${magenta}---------------------" echo "${bold}${magenta}Testing All Good Bots" echo "${bold}${magenta}---------------------" -printf "\n" IFS=$'\n' file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-bots-for-test.list lines=$(cat ${file}) @@ -264,10 +263,10 @@ IFS="" testAllowedUserAgents () { sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/allowed-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list +printf "\n" echo "${bold}${magenta}------------------------" echo "${bold}${magenta}Testing All Allowed Bots" echo "${bold}${magenta}------------------------" -printf "\n" IFS=$'\n' file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/allowed-bots-for-test.list lines=$(cat ${file}) @@ -284,10 +283,10 @@ IFS="" testLimitedUserAgents () { sed 's/\\//g' ${TRAVIS_BUILD_DIR}/_generator_lists/limited-user-agents.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list +printf "\n" echo "${bold}${magenta}------------------------" echo "${bold}${magenta}Testing All Limited Bots" echo "${bold}${magenta}------------------------" -printf "\n" IFS=$'\n' file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/limited-bots-for-test.list lines=$(cat ${file}) @@ -305,10 +304,10 @@ IFS="" testRandomReferrers () { shuf -n 10 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-referrers.list > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list +printf "\n" echo "${bold}${magenta}---------------------------------" echo "${bold}${magenta}Testing 10 Random Bad Referrers" echo "${bold}${magenta}---------------------------------" -printf "\n" IFS=$'\n' file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-test-quick.list lines=$(cat ${file}) @@ -324,10 +323,10 @@ IFS="" } testGoodReferrers () { +printf "\n" echo "${bold}${magenta}----------------------" echo "${bold}${magenta}Testing Good Referrers" echo "${bold}${magenta}----------------------" -printf "\n" IFS=$'\n' file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/good-referrers-for-test.list lines=$(cat ${file}) diff --git a/.dev-tools/test-blocker-rate-limiting.sh b/.dev-tools/test-blocker-rate-limiting.sh index 7b95fed87..23d35a59b 100755 --- a/.dev-tools/test-blocker-rate-limiting.sh +++ b/.dev-tools/test-blocker-rate-limiting.sh @@ -60,10 +60,10 @@ defaultcolor=$(tput setaf default) # --------- reloadNginX () { +printf "\n" echo "${bold}${green}---------------" echo "${bold}${green}Reloading Nginx" echo "${bold}${green}---------------" -printf "\n\n" sudo nginx -t && sudo nginx -s reload } @@ -71,7 +71,7 @@ waitforReload () { echo "${bold}${yellow}-----------------------------------------------------------------------" echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis" echo "${bold}${yellow}-----------------------------------------------------------------------" -printf "\n\n" +printf "\n" sleep 10s } @@ -79,7 +79,7 @@ ratelimitGoogle () { echo "${bold}${yellow}-----------------------------" echo "${bold}${yellow}Making GoogleBot ${yellow}RATE LIMITED" echo "${bold}${yellow}-----------------------------" -printf "\n\n" +printf "\n" sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/rate-limiting-user-agents.conf /etc/nginx/bots.d/blacklist-user-agents.conf } @@ -111,14 +111,14 @@ if grep -i 'Unavailable' < ${ratelimittestfile}; then backupConfFiles () { printf "\n" -echo "${bold}${green}------------------------------------------------------------" -echo "${bold}${green}Make Backup all conf files and folders used during this test" -echo "${bold}${green}------------------------------------------------------------" +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/_conf_files_ratelimiting/bots.d/ -sudo cp /etc/nginx/conf.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_ratelimiting/conf.d/ -sudo cp /etc/nginx/sites-available/default.vhost ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_ratelimiting/default.vhost -sudo cp /etc/nginx/nginx.conf ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_ratelimiting/nginx.conf +sudo cp /etc/nginx/bots.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/conf_files_ratelimiting/bots.d/ +sudo cp /etc/nginx/conf.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/conf_files_ratelimiting/conf.d/ +sudo cp /etc/nginx/sites-available/default.vhost ${TRAVIS_BUILD_DIR}/.dev-tools/conf_files_ratelimiting/default.vhost +sudo cp /etc/nginx/nginx.conf ${TRAVIS_BUILD_DIR}/.dev-tools/conf_files_ratelimiting/nginx.conf } # ----------- @@ -129,7 +129,7 @@ printf "\n" echo "${bold}${green}---------------------------" echo "${bold}${green}Starting Rate Limiting Test" echo "${bold}${green}---------------------------" -printf "\n\n" +printf "\n" ratelimitGoogle reloadNginX diff --git a/.dev-tools/test-blocker-whitelist-domains.sh b/.dev-tools/test-blocker-whitelist-domains.sh index c8d851e82..b97e14c2c 100755 --- a/.dev-tools/test-blocker-whitelist-domains.sh +++ b/.dev-tools/test-blocker-whitelist-domains.sh @@ -60,10 +60,10 @@ defaultcolor=$(tput setaf default) # --------- reloadNginX () { +printf "\n" echo "${bold}${green}---------------" echo "${bold}${green}Reloading Nginx" echo "${bold}${green}---------------" -printf "\n\n" sudo nginx -t && sudo nginx -s reload } @@ -71,7 +71,7 @@ waitforReload () { echo "${bold}${yellow}-----------------------------------------------------------------------" echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis" echo "${bold}${yellow}-----------------------------------------------------------------------" -printf "\n\n" +printf "\n" sleep 10s } @@ -79,7 +79,7 @@ whitelistOwnDomain () { echo "${bold}${green}---------------------------------------" echo "${bold}${green}Activating Users whitelist-domains.conf" echo "${bold}${green}---------------------------------------" -printf "\n\n" +printf "\n" sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/whitelist-domains.conf /etc/nginx/bots.d/whitelist-domains.conf } @@ -108,7 +108,7 @@ fi echo "${bold}${green}-------------------------------" echo "${bold}${green}Whitelist Domains Test Starting" echo "${bold}${green}-------------------------------" -printf "\n\n" +printf "\n" whitelistOwnDomain reloadNginX @@ -120,7 +120,7 @@ run_curltest2 echo "${bold}${green}-------------------------------" echo "${bold}${green}Whitelist Domains Test Complete" echo "${bold}${green}-------------------------------" -printf "\n\n" +printf "\n" # ---------------------- # Exit With Error Number diff --git a/.dev-tools/test-blocker-whitelist-ips.sh b/.dev-tools/test-blocker-whitelist-ips.sh index e2b4000bc..72ec67865 100755 --- a/.dev-tools/test-blocker-whitelist-ips.sh +++ b/.dev-tools/test-blocker-whitelist-ips.sh @@ -64,7 +64,6 @@ reloadNginX () { echo "${bold}${green}---------------" echo "${bold}${green}Reloading Nginx" echo "${bold}${green}---------------" -printf "\n\n" sudo nginx -t && sudo nginx -s reload } @@ -72,7 +71,7 @@ waitforReload () { echo "${bold}${yellow}-----------------------------------------------------------------------" echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis" echo "${bold}${yellow}-----------------------------------------------------------------------" -printf "\n\n" +printf "\n" sleep 10s } @@ -130,42 +129,32 @@ sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/botblocker-nginx-settings.conf echo "${bold}${green}--------------------------" echo "${bold}${green}Whitelist IP Test Starting" echo "${bold}${green}--------------------------" -printf "\n\n" +printf "\n" echo "${bold}${green}-------------------------" echo "${bold}${green}Blacklisting own IP First" echo "${bold}${green}-------------------------" -printf "\n\n" +printf "\n" blacklistOwnIP reloadNginX waitforReload - -# ************************************************* -# Function Curl Test 1 - Test our IP is Blacklisted -# ************************************************* - run_curltest1 echo "${bold}${green}--------------------" echo "${bold}${green}Now Whitelist own IP" echo "${bold}${green}--------------------" -printf "\n\n" +printf "\n" whitelistOwnIP reloadNginX waitforReload - -# ************************************************* -# Function Curl Test 2 - Test our IP is Whitelisted -# ************************************************* - run_curltest2 echo "${bold}${green}-----------------------------" echo "${bold}${green}Whitelisting IP Test Complete" echo "${bold}${green}-----------------------------" -printf "\n\n" +printf "\n" # ************************************************************* # Copy all .conf files used in Testing to a folder for checking diff --git a/.dev-tools/test-blocker-whitelist.sh b/.dev-tools/test-blocker-whitelist.sh index 2c4ee10c7..e3a2363a4 100755 --- a/.dev-tools/test-blocker-whitelist.sh +++ b/.dev-tools/test-blocker-whitelist.sh @@ -60,10 +60,10 @@ defaultcolor=$(tput setaf default) # --------- reloadNginX () { +printf "\n" echo "${bold}${green}---------------" echo "${bold}${green}Reloading Nginx" echo "${bold}${green}---------------" -printf "\n\n" sudo nginx -t && sudo nginx -s reload } @@ -71,7 +71,7 @@ waitforReload () { echo "${bold}${yellow}-----------------------------------------------------------------------" echo "${bold}${yellow}Sleeping for 10 seconds to allow Nginx to Properly Reload inside Travis" echo "${bold}${yellow}-----------------------------------------------------------------------" -printf "\n\n" +printf "\n" sleep 10s } @@ -99,7 +99,7 @@ generateCustomBlacklists () { echo "${bold}${magenta}-----------------------------------------------------------------" echo "${bold}${magenta}Generating blacklist-user-agents.conf & custom-bad-referrers.conf" echo "${bold}${magenta}-----------------------------------------------------------------" -printf "\n\n" +printf "\n" # -------------------------------------------------------------------------- # Generate our custom test units turning all good to bad and all bad to good # -------------------------------------------------------------------------- @@ -122,7 +122,7 @@ _action1="0;" echo "${bold}${yellow}------------------------" echo "${bold}${green}Making all ${red}Bad Bots ${green}GOOD" echo "${bold}${yellow}------------------------" -printf "\n\n" +printf "\n" printf '%s\n' "$_start1" >> ${_tmpnginx1} while IFS= read -r LINE @@ -151,7 +151,7 @@ rm ${_inputdb1} echo "${bold}${yellow}-----------------------------" echo "${bold}${green}Making all ${red}Bad Referrers ${green}GOOD" echo "${bold}${yellow}-----------------------------" -printf "\n\n" +printf "\n" printf '%s\n' "$_start2" >> ${_tmpnginx2} @@ -179,12 +179,12 @@ activateCustomBlacklists () { echo "${bold}${green}------------------------------------------------" echo "${bold}${green}Activating Users User-Agents Whitelist/Blacklist" echo "${bold}${green}------------------------------------------------" -printf "\n\n" +printf "\n" sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/blacklist-user-agents.conf /etc/nginx/bots.d/blacklist-user-agents.conf echo "${bold}${green}----------------------------------------------" echo "${bold}${green}Activating Users Referrers Whitelist/Blacklist" echo "${bold}${green}----------------------------------------------" -printf "\n\n" +printf "\n" sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/custom-bad-referrers.conf /etc/nginx/bots.d/custom-bad-referrers.conf } @@ -193,11 +193,10 @@ shuf -n 100 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list > ${TRAVIS sed 's/\\//g' ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-whitelist-test.tmp > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-whitelist-test.list sudo rm ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-whitelist-test.tmp sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-whitelist-test.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-whitelist-test.list -printf "\n\n" +printf "\n" echo "${bold}${magenta}---------------------------" echo "${bold}${magenta}Testing 100 Random Bad Bots" echo "${bold}${magenta}---------------------------" -printf "\n\n" IFS=$'\n' file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-bots-for-whitelist-test.list lines=$(cat ${file}) @@ -217,11 +216,10 @@ shuf -n 100 ${TRAVIS_BUILD_DIR}/_generator_lists/bad-referrers.list > ${TRAVIS_B sed 's/\\//g' ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-whitelist-test.tmp > ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-whitelist-test.list sudo rm ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-whitelist-test.tmp sort -u ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-whitelist-test.list -o ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-whitelist-test.list -printf "\n\n" +printf "\n" echo "${bold}${magenta}----------------------------" echo "${bold}${magenta}Testing 100 Random Referrers" echo "${bold}${magenta}----------------------------" -printf "\n\n" IFS=$'\n' file=${TRAVIS_BUILD_DIR}/.dev-tools/test_units/random-referrers-for-whitelist-test.list lines=$(cat ${file}) @@ -255,7 +253,7 @@ sudo cp /etc/nginx/nginx.conf ${TRAVIS_BUILD_DIR}/.dev-tools/_conf_files_whiteli echo "${bold}${green}--------------------------" echo "${bold}${green}Whitelisting Test Starting" echo "${bold}${green}--------------------------" -printf "\n\n" +printf "\n" generateCustomBlacklists activateCustomBlacklists @@ -270,7 +268,7 @@ backupConfFiles echo "${bold}${green}--------------------------" echo "${bold}${green}Whitelisting Test Complete" echo "${bold}${green}--------------------------" -printf "\n\n" +printf "\n" # ---------------------- # Exit With Error Number diff --git a/.dev-tools/update-bad-ips.sh b/.dev-tools/update-bad-ips.sh index 7fd625c1a..c241ba96d 100755 --- a/.dev-tools/update-bad-ips.sh +++ b/.dev-tools/update-bad-ips.sh @@ -58,7 +58,7 @@ fetchBadIPs () { echo "${bold}${green}----------------------------" echo "${bold}${green}Fetching Latest BAD IPs List" echo "${bold}${green}----------------------------" -printf "\n\n" +printf "\n" } prepareBadIPs () { @@ -69,7 +69,7 @@ prepareBadIPs () { echo "${bold}${green}-----------------------------" echo "${bold}${green}Preparing Latest BAD IPs List" echo "${bold}${green}-----------------------------" -printf "\n\n" +printf "\n" } # -----------------