Commit graph

59 commits

Author SHA1 Message Date
Stuart Cardall
54c6ba7438
add /sbin to binary search paths
* Amazon Linux puts pidof under /sbin

  fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/399
2020-09-06 20:51:57 +00:00
Stuart Cardall
bc28c7287a
fix typo
* closes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/376
2020-04-24 09:52:04 +00:00
Stuart Cardall
9347f74809
use $mail_path in send_email()
* finishes fixing 22c2a61bfe
2020-04-15 12:55:33 +00:00
Mitchell Krog
6d12a2d54c
Fix syntax error update-ngxblocker
REF: 22c2a61bfe
2020-04-15 14:41:42 +02:00
Stuart Cardall
e810105a9f
Add option for FROM address for ordinary mail
* reuses $MG_FROM as a FROM address for ordinary mail

Ordinarily the FROM address is configured on the host system. This
adds the option to pass a FROM address to update-ngxblocker with the
-f switch

fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/369
2020-04-11 13:14:38 +00:00
Alexander Leidinger
9a33383842 Use full path for curl. 2020-03-01 15:43:13 +01:00
Alexander Leidinger
38281f1185 Add *BSD compatibility (use GNU sed). 2020-02-15 13:46:07 +01:00
Stuart Cardall
1541154f02
workaround for crontabs configured without $PATH
fixes:

https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/284
2020-01-28 12:43:07 +00:00
Stuart Cardall
5c21edde6d
* remove whitespace 2019-10-21 20:15:53 +00:00
Stuart Cardall
71afff69ec
Merge pull request #267 from itoffshore/alpine
simplify reloading nginx configuration after updating
2019-06-20 21:11:07 +01:00
Stuart Cardall
83b9a1e509
simplify reloading nginx configuration after updating
* removes service_cmd()
* fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/265
2019-06-20 19:56:18 +00:00
Mark Brown
6b184171a9 Adds support to send update checks out via mailgun instead of using mailx/ssmtp. Adds 4 args: g, a, f, & d. -g accepts an e-mail address and triggers send_email_via_mailgun(). -a accepts the api key for mailgun. -d accepts the domain (i.e. mg.yourdomain.com), -f accepts the Mailgun from address 2019-06-10 15:48:01 -07:00
Stuart Cardall
7808a52fe2
Merge pull request #241 from mitchellkrogza/alpine
service_cmd() - add BSD service detection
2019-01-02 13:54:13 +00:00
Stuart Cardall
0b16e13001
service_cmd() - add BSD service detection
fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/238
2019-01-02 13:51:16 +00:00
Stuart Cardall
07271ef488
find_binary() less ambiguous variables
closes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/238
2019-01-02 12:42:36 +00:00
Stuart Cardall
afb7cc526b
consolidate check_mail_depends()
* move mail check into send_email()
2018-10-08 21:58:55 +00:00
Stuart Cardall
53d8a08fac
use example.com for email addresses 2018-10-08 21:35:58 +00:00
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