From ab7187d859b1103ac8cf42ee455b673edd4f2036 Mon Sep 17 00:00:00 2001 From: Mitchell Krog Date: Sun, 26 Feb 2017 13:51:46 +0200 Subject: [PATCH] Introduce Auto Updating Bash Script Option --- CONFIGURATION.md | 10 +++++++++- README.md | 8 +++++++- updatenginxblocker.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100755 updatenginxblocker.sh diff --git a/CONFIGURATION.md b/CONFIGURATION.md index eb257e518..868194639 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -154,7 +154,15 @@ Updating to the latest version is now as simple as: And you will be up to date with all your whitelisted domains included automatically for you now. -Relax now and sleep better at night knowing your site is telling all those baddies FORBIDDEN !!! +# AUTO UPDATING: + +See my latest auto updater bash script at: + +https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/updatenginxblocker.sh + +This can now be run as a daily cron to keep you up to date without having to remember to do it yourself. + +Relax now and sleep better at night knowing your site is telling all those baddies they are FORBIDDEN !!! ### PULL REQUESTS: To contribute your own bad referers please add them into the https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/blob/master/Pull%20Requests%20Here%20Please/badreferers.list file and then send a Pull Request (PR). diff --git a/README.md b/README.md index 826a744a9..115372bc5 100644 --- a/README.md +++ b/README.md @@ -261,7 +261,13 @@ Updating to the latest version is now as simple as: And you will be up to date with all your whitelisted domains included automatically for you now. -Relax now and sleep better at night knowing your site is telling all those baddies FORBIDDEN !!! +# AUTO UPDATING: + +See my latest auto updater bash script at: + +https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/updatenginxblocker.sh + +Relax now and sleep better at night knowing your site is telling all those baddies they are FORBIDDEN !!! ### PULL REQUESTS: To contribute your own bad referers please add them into the https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/blob/master/Pull%20Requests%20Here%20Please/badreferers.list file and then send a Pull Request (PR). diff --git a/updatenginxblocker.sh b/updatenginxblocker.sh new file mode 100755 index 000000000..3a87d950e --- /dev/null +++ b/updatenginxblocker.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Bash Script for Auto Updating the Nginx Bad Bot Blocker +# Copyright - https://github.com/mitchellkrogza +# Project Url: https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker + +# MAKE SURE you have your whitelist-ips.conf and whitelist-domains.conf files in /etc/nginx/bots.ds +# A major change to using include files was introduced in +# https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/commit/c7acdfa8228d2f19a83e5bb14d54355db86fcebf + +# PLEASE READ UPDATED CONFIGURATION INSTRUCTIONS BEFORE USING THIS + +# Save this file as /bin/updatenginxblocker.sh +# Make it Executable chmod +x /bin/updatenginxblocker.sh + +# RUN THE UPDATE +# Here our script runs, pulls the latest update, reloads nginx and emails you a notification +# Place your own valid email address where it says "me@myemail.com" + +cd /etc/nginx/conf.d +sudo wget https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/conf.d/globalblacklist.conf -O globalblacklist.conf +sudo service nginx reload | mail -s "Nginx Bad Bot Blocker Updated" me@myemail.com +exit 0 + +# Add this as a cron to run daily / weekly as you like +# Here's a sample CRON entry to update every day at 10pm +# 00 22 * * * /bin/updatenginxblocker.sh \ No newline at end of file