mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-29 20:57:22 +02:00
removed geoblocks, made tor exit node blocking optional during setup via yes/no dialog which will comment out the appropriate line in /etc/cron.daily/blacklist. Rearranged some code, deleted some files and clutter.
This commit is contained in:
@@ -8,14 +8,15 @@
|
||||
source setup/functions.sh # load our functions
|
||||
source /etc/mailinabox.conf # load global vars
|
||||
|
||||
cp conf/blacklist /etc/cron.daily/blacklist
|
||||
chmod a+x /etc/cron.daily/blacklist
|
||||
source setup/tor.sh
|
||||
echo iptables-persistent iptables-persistent/autosave_v4 boolean false | debconf-set-selections
|
||||
echo iptables-persistent iptables-persistent/autosave_v6 boolean false | debconf-set-selections
|
||||
apt_install -y ipset dialog iptables-persistent
|
||||
cp conf/iptables-persistent /etc/init.d/iptables-persistent
|
||||
ipset create blacklist hash:net
|
||||
iptables -I INPUT -m set --match-set blacklist src -j DROP
|
||||
cp conf/blacklist/blacklist /etc/cron.daily/blacklist
|
||||
chmod a+x /etc/cron.daily/blacklist
|
||||
time /etc/cron.daily/blacklist
|
||||
source setup/dialog.sh
|
||||
/etc/init.d/iptables-persistent save
|
||||
|
||||
22
setup/tor.sh
Normal file
22
setup/tor.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# tor.sh - Yes/No
|
||||
# created by Alon "ChiefGyk" Ganon
|
||||
# Alon@ganon.me
|
||||
# This will give the option of blocking Tor exit nodes
|
||||
dialog --title "Disable Tor Exit Nodes?" \
|
||||
--backtitle "" \
|
||||
--yesno "Would you like to block all Tor exit nodes? This will block all traffic coming from Tor which will impair people using it to \
|
||||
avoid censorship. However the majority of malicious traffic is sourced from Tor. If you change your mind later you can comment/uncomment line 14 \
|
||||
of /etc/cron.daily/blacklist where it specifies Tor Exit Nodes" 15 60
|
||||
|
||||
# Get exit status
|
||||
# 0 means user hit [yes] button.
|
||||
# 1 means user hit [no] button.
|
||||
# 255 means user hit [Esc] key.
|
||||
response=$?
|
||||
case $response in
|
||||
0) sed -e '13 s/^/#/' /etc/conf.daily/blacklist
|
||||
echo "Tor Exit Nodes Blocked";;
|
||||
1) echo "Freedom";;
|
||||
255) echo "[ESC] key pressed.";;
|
||||
esac
|
||||
Reference in New Issue
Block a user