Merge remote-tracking branch 'origin/stable' into stable
[tails/pzajda.git] / config / chroot_local-hooks / 16-i2p_config
blobd3332f4eeeb5167c705833740291f65303b2f208
1 #!/bin/sh
3 set -e
5 echo "Configuring I2P"
7 I2P="/usr/share/i2p"
8 WRAPPER="/etc/i2p/wrapper.config"
10 # This must be set in order for the i2p init script to work
11 sed -i 's/^RUN_DAEMON=.*$/RUN_DAEMON="true"/' /etc/default/i2p
13 # Remove the false.i2p outproxy from i2ptunnel
14 sed -i '/^tunnel.0.proxyList/d' "$I2P/i2ptunnel.config"
16 # Disable the https outproxy
17 # We go out through Tor so this is redundant.
18 sed -i 's|^.*\(tunnel.6.startOnLoad\).*|\1=false|' "$I2P/i2ptunnel.config"
20 # Don't serve the router console on IPv6
21 sed -i 's|^clientApp\.0\.args=7657\s\+::1,127\.0\.0\.1|clientApp.0.args=7657 127.0.0.1|' "$I2P/clients.config"
23 # Disable IPv6 in the wrapper
24 sed -i 's|^.*\(wrapper\.java\.additional\.5=-Djava\.net\.preferIPv4Stack=\).*|\1true|' "$WRAPPER"
25 sed -i 's|^.*\(wrapper\.java\.additional\.6=-Djava\.net\.preferIPv6Addresses=\).*|\1false|' "$WRAPPER"
27 # Tails specific router configs:
28 # * i2cp: allows java clients to communicate with I2P outside of the JVM. Disabled.
29 # * IPv6: Disabled
30 # * HiddenMode: Enabled
31 # * In-I2P Network Updates: Disabled
32 # * Inbound connections: Disabled (setting is "i2cp.ntcp.autoip")
33 # * Disable I2P plugins
34 cat > "$I2P/router.config" << EOF
35 # NOTE: This I2P config file must use UTF-8 encoding
36 i2cp.disableInterface=true
37 i2np.ntcp.ipv6=false
38 i2np.ntcp.autoip=false
39 i2np.udp.ipv6=false
40 router.isHidden=true
41 router.updateDisabled=true
42 router.enablePlugins=false
43 EOF
45 cat > "$I2P/susimail.config" << EOF
46 susimail.pop3.leave.on.server=true
47 EOF