mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-03 19:20:16 +00:00
UPDATE Whitelist Test [TEST]
This commit is contained in:
parent
a2f54a59aa
commit
20ad7bd7e6
1 changed files with 57 additions and 8 deletions
|
@ -16,6 +16,31 @@
|
||||||
# #
|
# #
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# MIT License
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2017 Mitchell Krog - mitchellkrog@gmail.com
|
||||||
|
# https://github.com/mitchellkrogza
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
|
# copies or substantial portions of the Software.
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
# SOFTWARE.
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
# ------------------------
|
# ------------------------
|
||||||
# Set Terminal Font Colors
|
# Set Terminal Font Colors
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
@ -75,9 +100,9 @@ echo "${bold}${magenta}---------------------------------------------------------
|
||||||
echo "${bold}${magenta}Generating blacklist-user-agents.conf & custom-bad-referrers.conf"
|
echo "${bold}${magenta}Generating blacklist-user-agents.conf & custom-bad-referrers.conf"
|
||||||
echo "${bold}${magenta}-----------------------------------------------------------------"
|
echo "${bold}${magenta}-----------------------------------------------------------------"
|
||||||
printf "\n\n"
|
printf "\n\n"
|
||||||
# **************************************************************************
|
# --------------------------------------------------------------------------
|
||||||
# Generate our custom test units turning all good to bad and all bad to good
|
# Generate our custom test units turning all good to bad and all bad to good
|
||||||
# **************************************************************************
|
# --------------------------------------------------------------------------
|
||||||
_input1=${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list
|
_input1=${TRAVIS_BUILD_DIR}/_generator_lists/bad-user-agents.list
|
||||||
_input2=${TRAVIS_BUILD_DIR}/.dev-tools/referrers-regex-format-whitelist-test.txt
|
_input2=${TRAVIS_BUILD_DIR}/.dev-tools/referrers-regex-format-whitelist-test.txt
|
||||||
_inputdb1=${TRAVIS_BUILD_DIR}/.dev-tools/good-bad-user-agents.db
|
_inputdb1=${TRAVIS_BUILD_DIR}/.dev-tools/good-bad-user-agents.db
|
||||||
|
@ -90,9 +115,9 @@ _start2="# START MAKE BAD REFERRERS GOOD ### DO NOT EDIT THIS LINE AT ALL ###"
|
||||||
_end2="# END MAKE BAD REFERRERS GOOD ### DO NOT EDIT THIS LINE AT ALL ###"
|
_end2="# END MAKE BAD REFERRERS GOOD ### DO NOT EDIT THIS LINE AT ALL ###"
|
||||||
_action1="0;"
|
_action1="0;"
|
||||||
|
|
||||||
# ****************************
|
# ----------------------------
|
||||||
# BAD BOTS - Create and Insert
|
# BAD BOTS - Create and Insert
|
||||||
# ****************************
|
# ----------------------------
|
||||||
|
|
||||||
echo "${bold}${yellow}------------------------"
|
echo "${bold}${yellow}------------------------"
|
||||||
echo "${bold}${green}Making all ${red}Bad Bots ${green}GOOD"
|
echo "${bold}${green}Making all ${red}Bad Bots ${green}GOOD"
|
||||||
|
@ -119,9 +144,9 @@ q
|
||||||
IN
|
IN
|
||||||
rm ${_inputdb1}
|
rm ${_inputdb1}
|
||||||
|
|
||||||
# ********************************
|
# --------------------------------
|
||||||
# BAD REFERERS - Create and Insert
|
# BAD REFERERS - Create and Insert
|
||||||
# ********************************
|
# --------------------------------
|
||||||
|
|
||||||
echo "${bold}${yellow}-----------------------------"
|
echo "${bold}${yellow}-----------------------------"
|
||||||
echo "${bold}${green}Making all ${red}Bad Referrers ${green}GOOD"
|
echo "${bold}${green}Making all ${red}Bad Referrers ${green}GOOD"
|
||||||
|
@ -247,10 +272,34 @@ echo "${bold}${green}Whitelisting Test Complete"
|
||||||
echo "${bold}${green}--------------------------"
|
echo "${bold}${green}--------------------------"
|
||||||
printf "\n\n"
|
printf "\n\n"
|
||||||
|
|
||||||
# **********************
|
# ----------------------
|
||||||
# Exit With Error Number
|
# Exit With Error Number
|
||||||
# **********************
|
# ----------------------
|
||||||
|
|
||||||
exit ${?}
|
exit ${?}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# MIT License
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2017 Mitchell Krog - mitchellkrog@gmail.com
|
||||||
|
# https://github.com/mitchellkrogza
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
|
# copies or substantial portions of the Software.
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
# SOFTWARE.
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue