-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add scheduled stopforumspam blocklist update
- Loading branch information
1 parent
f99826c
commit 5a3dba8
Showing
4 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit -o nounset -o pipefail | ||
|
||
curl --fail-with-body https://www.stopforumspam.com/downloads/toxic_ip_cidr.txt | awk ' { print $1 " 1;" } ' > /etc/nginx/stopforumspam-toxic_ip_cidr.conf.new | ||
mv /etc/nginx/stopforumspam-toxic_ip_cidr.conf.new /etc/nginx/stopforumspam-toxic_ip_cidr.conf | ||
curl --fail-with-body https://www.stopforumspam.com/downloads/bannedips.csv.gz | gunzip | tr ',' '\n' | awk ' { print $1 " 1;" } ' > /etc/nginx/stopforumspam-bannedips.conf.new | ||
mv /etc/nginx/stopforumspam-bannedips.conf.new /etc/nginx/stopforumspam-bannedips.conf | ||
nginx -s reload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[Unit] | ||
Description=Stop Forum Spam data update | ||
|
||
[Service] | ||
CapabilityBoundingSet= | ||
CPUSchedulingPolicy=batch | ||
ExecStart=/usr/local/bin/stopforumspam-update | ||
IOSchedulingPriority=7 | ||
LockPersonality=true | ||
MemoryDenyWriteExecute=true | ||
Nice=19 | ||
NoNewPrivileges=true | ||
PrivateDevices=true | ||
PrivateIPC=true | ||
PrivateTmp=true | ||
PrivateUsers=true | ||
ProcSubset=pid | ||
ProtectClock=true | ||
ProtectControlGroups=true | ||
ProtectHome=true | ||
ProtectHostname=true | ||
ProtectKernelLogs=true | ||
ProtectKernelModules=true | ||
ProtectKernelTunables=true | ||
ProtectProc=invisible | ||
ProtectSystem=strict | ||
ReadWritePaths=/etc/nginx | ||
RemoveIPC=true | ||
RestrictAddressFamilies=AF_INET AF_INET6 | ||
RestrictNamespaces=true | ||
RestrictRealtime=true | ||
RestrictSUIDSGID=true | ||
SystemCallArchitectures=native | ||
SystemCallFilter=@system-service | ||
SystemCallFilter=~@privileged @resources @obsolete | ||
Type=oneshot | ||
UMask=0077 | ||
WorkingDirectory=/etc/nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=Daily Stop Forum Spam data update | ||
|
||
[Timer] | ||
OnCalendar=daily | ||
AccuracySec=1h | ||
Persistent=true | ||
|
||
[Install] | ||
WantedBy=timers.target |