summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-hooks/16-i2p_config
diff options
context:
space:
mode:
Diffstat (limited to 'config/chroot_local-hooks/16-i2p_config')
-rwxr-xr-xconfig/chroot_local-hooks/16-i2p_config22
1 files changed, 22 insertions, 0 deletions
diff --git a/config/chroot_local-hooks/16-i2p_config b/config/chroot_local-hooks/16-i2p_config
index 06ee28d..cfa1328 100755
--- a/config/chroot_local-hooks/16-i2p_config
+++ b/config/chroot_local-hooks/16-i2p_config
@@ -5,11 +5,29 @@ set -e
echo "Configuring I2P"
I2P="/usr/share/i2p"
+I2PROUTER="/usr/bin/i2prouter"
WRAPPER="/etc/i2p/wrapper.config"
# This must be set in order for the i2p init script to work
sed -i 's/^RUN_DAEMON=.*$/RUN_DAEMON="true"/' /etc/default/i2p
+# Remove the "i2prouter" script, its man page, and its apparmor profile
+# since these are not used by Tails:
+rm /etc/apparmor.d/usr.bin.i2prouter /usr/share/man/man1/i2prouter.1.gz
+
+# Install custom i2prouter stub scripts
+for script in ${I2PROUTER} ${I2PROUTER}-nowrapper; do
+ echo "Removing $script"
+ dpkg-divert --rename --add "${script}"
+ cat > "$script" << EOF
+#!/bin/sh
+echo "This script is not used by Tails."
+echo "See https://tails.boum.org/doc/anonymous_internet/i2p/ for more information."
+exit 0
+EOF
+ chmod 755 "$script"
+done
+
# Remove the outproxy from the tunnel on port 4444
# This will remove the following lines:
# tunnel.0.proxyList=false.i2p
@@ -48,3 +66,7 @@ EOF
cat > "$I2P/susimail.config" << EOF
susimail.pop3.leave.on.server=true
EOF
+
+# enforce apparmor
+echo Setting the I2P apparmor profile to enforce mode
+sed -i -re 's|flags=\(complain\)||' /etc/apparmor.d/system_i2p