Commit graph

42 commits

Author SHA1 Message Date
Stuart Cardall
ebb515c5ac
add syslog (-l) option
based on the original PR from https://github.com/ScrewLooseDan

* fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/pull/217
2018-10-08 21:32:09 +00:00
Stuart Cardall
8b5af8b7fa
remove hard coded paths
* use find_binary() instead of hard coded paths
2018-10-08 18:55:45 +00:00
Stuart Cardall
d3a5f408c7
add find_binary()
* emulates `which` as centos does not have it by default
2018-10-08 18:34:02 +00:00
Stuart Cardall
67888380bc
fix grep regex range error
* fixes grep: Invalid range end ERROR

* https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/86#issuecomment-381918868
2018-04-17 21:26:04 +00:00
Stuart Cardall
c2aa474e56
do not sanitize + in email addresses - further fix
* finishes fixing https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/157
2018-04-04 18:57:27 +00:00
Stuart Cardall
f04b21bfa9
do not sanitize + in email addresses
* sanitizing + breaks google aliases

  fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/157
2018-04-03 18:26:53 +00:00
Stuart Cardall
ea0193f1c4
fix -i option 2018-03-11 13:19:31 +00:00
Stuart Cardall
3850507195
add -o option for emails only on updates
* based on the original idea & PR from @ScrewLooseDan
  https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/pull/141
2018-03-11 13:13:59 +00:00
Stuart Cardall
f9e152b7f9
fix dash incompatibility
fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/pull/135#issuecomment-364082296
2018-02-08 19:20:50 +00:00
Stuart Cardall
fa873a3e20
install to /usr/local/sbin by default
fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/133
2018-02-08 09:56:34 +00:00
Stuart Cardall
c3624d2d89
fix service command for cron jobs
the cron environment usually does not contain $PATH. This fixes cases
where users do not use full paths in their crontabs.

fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/120#issuecomment-364028147
2018-02-08 09:44:58 +00:00
Stuart Cardall
ce97078a50
fix cron example for less verbose logging 2018-02-08 07:00:38 +00:00
Stuart Cardall
a416936b61
change less verbose option to -q
fixes a clash with the script directory setting in install-ngxblocker
2018-02-07 21:38:39 +00:00
Stuart Cardall
0bf1d6f121
update-ngxblocker: less verbose silent mode
* silent mode now only prints a message for cron / log parsers when
  the blacklist is updated.

* the update script is designed to be run via cron. do not enable
  $SEND_EMAIL by default (command line switches -e or -m enable it)
2018-01-13 18:16:59 +00:00
Stuart Cardall
d18d54087f
remove duplicate check_depends
* do not check depends twice on -v command line switch
2018-01-10 23:33:35 +00:00
Stuart Cardall
28ae60d9af
exit after printing version
* fixes double printing of blacklist version
2018-01-10 23:22:53 +00:00
Stuart Cardall
ecf4bb0ad2
add option for less verbose logging
* adds -s command line switch to update-ngxblocker / install-ngxblocker
  for less verbose messages to reduce unnecessary cron job logs.

  -s reduces messages to errors only & the Blacklist version number.
2018-01-07 01:25:48 +00:00
Stuart Cardall
f40c3271c9
remove sanity checks for -m command line switch
allows emails sent with -m to to be sent to system alias addresses.

fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/116
2018-01-06 11:29:19 +00:00
Stuart Cardall
0b3dcbe86d
update-ngxblocker: remove wget check from check_depends()
* downloads are now via curl so remove wget check from check_depends()
2017-09-20 13:40:47 +00:00
Stuart Cardall
af197cb559
update-ngxblocker: detect /bin/mail in centos / add -m cmd line switch for mail
* also detect /bin/mail in centos

* adds -m command line switch to specify an email address (to avoid confusion with
  -e used in setup-ngxblocker to specify vhost file extensions)

  -e can still be used to specify an email address to avoid breakage with current
  cron jobs
2017-09-20 13:36:15 +00:00
Mitchell Krog
5956814094
PATCH: Revert to Previous Install, Setup and Update Scripts 2017-09-20 12:56:22 +02:00
Mitchell Krog
0a88e3a38f
Re-Test 2017-09-20 12:15:50 +02:00
Stuart Cardall
ebe4020c7a
update-ngxblocker: fix email regex
* fixes regex for both busybox & GNU grep

closes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/87
2017-09-02 15:50:10 +00:00
Stuart Cardall
2765ce119a
update-ngxblocker: fix email regex
closes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/86
2017-09-02 08:57:14 +00:00
Stuart Cardall
287d8688cd
update-ngxblocker: print all curl errors
* also print curl errors besides 404 / timeouts
2017-08-26 20:10:21 +00:00
Stuart Cardall
3aec168de2
update-ngxblocker: fix installer command line switch 2017-08-26 18:02:08 +00:00
Stuart Cardall
130f1655cb
update-ngxblocker: reload nginx from curl return code 2017-08-26 15:46:15 +00:00
Stuart Cardall
801791e65e
update-ngxblocker: fix POSIX shell compatibility / remove wget_opts
* wget_opts() no longer used so removed
* use "$*" to pass multiple paramters to POSIX shell
2017-08-24 14:45:09 +00:00
Stuart Cardall
c62ef4f008
update-ngxblocker: use curl not wget
* make downloads more robust & informative with curl
2017-08-23 22:51:14 +00:00
Stuart Cardall
26fec015ed
update-ngxblocker: fix dash shell incompatibility
closes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/75

* dash shell need $@ to be quoted
* SCRIPT_DIR is checked by install-ngxblocker so not passed to check_dirs()
2017-08-23 22:13:32 +00:00
Stuart Cardall
93f0f7c65c
install-ngxblocker: add download for $SCRIPT_FILES 2017-07-26 23:49:26 +00:00
Stuart Cardall
48e4be4a7c
update-ngxblocker: use install-ngxblocker as $INSTALLER
* tidy up tabs / spaces

$INSTALL_INC now downloads new / missing files:

* as part of the update process
* if missing directories are detected
2017-07-26 23:48:24 +00:00
Stuart Cardall
b245b678c5
update-ngxblocker: add -b (bot.d directory) option
it is not currently possible to set a variable at the http{} level
to use in nginx include files.

adds -b option / $BOTS_DIR variable to update-ngxblocker for custom
bots.d locations

closes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/68
2017-07-24 22:52:30 +00:00
Mitchell Krog
b5fc344420 Updated Examples of Cron Jobs 2017-06-14 17:19:15 +02:00
Mitchell Krog
fd7e4ee264 Updated examples of command line switches and cron jobs. 2017-06-14 17:18:38 +02:00
Mitchell Krog
9fc58196f7 Minor changes to email body messages when updated / not updated 2017-06-13 11:20:57 +02:00
Stuart Cardall
e6af6d7fb6
update-ngxblocker: improved update function / check depends
fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/51#issuecomment-306734698

fixes a89de5831a (commitcomment-22363496)

globalblacklist.conf is only downloaded if it is a new version.

the version check is limited to 200 bytes of data rate limited @ 5kb.
(this adds curl as a dependency).

adds check_depends() as wget is not installed by default on centos 7
& curl is not installed by default on ubuntu or alpine linux.

adds check_mail_depends() & disables sending an email report if
/usr/bin/mail is not found.

adds a notification for reloading nginx as systemd only writes a
notice to syslog.

adds a note for logging cron to syslog.

adds some ANSI colour to the output.
2017-06-07 17:33:03 +00:00
Stuart Cardall
312ee8bdb5 update-ngxblocker: use getopts not getopt
long options for the command line are removed. getopt is replaced with
the newer getopts (which is compatible with Debian's DASH Shell)

* fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/35

* adds sanity checks for user command line switches

* adds -v command line option to print blacklist version
2017-04-26 15:56:40 +00:00
Stuart Cardall
b9198769b4 update-ngxblocker: add command line switches
* adds help menu & command line switches
* to view options run:

update-ngxblocker -h
2017-04-22 17:58:29 +00:00
Mitchell Krog
8960bc6de6 Update Comments Regarding Required Include Files 2017-04-20 16:56:04 +02:00
Mitchell Krog
c31997d4f6 Readme and Configuration Updates
Changes to reflect new names for install, setup and update script.
Happy Easter 🐰
2017-04-16 11:29:55 +02:00
Mitchell Krog UB1
ec94393e27 Change install, setup and update script names for Consistency 2017-04-16 10:56:03 +02:00