From 76814f830f02010ee7b4408c4316ce669c14720d Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Tue, 8 Mar 2022 18:18:40 +0200 Subject: [PATCH] etc/{i2pd,systemd}: modernise to less bad ideas The issue has been fixed last year and considering I2Pd can connect through Yggdrasil natively, tunneling Yggdrasil in is a bad idea and could lead into Yggdrasil over Yggdrasil loop situation. --- etc/i2pd/tunnels.conf.d/.gitignore | 0 etc/i2pd/tunnels.conf.d/yggdrasil-in.conf | 7 ---- etc/systemd/system/i2pd.service | 38 ------------------- .../i2pd.service.d/mullvad-exclude.conf | 5 +++ .../system/i2pd.service.d/override.conf | 3 -- 5 files changed, 5 insertions(+), 48 deletions(-) create mode 100644 etc/i2pd/tunnels.conf.d/.gitignore delete mode 100644 etc/i2pd/tunnels.conf.d/yggdrasil-in.conf delete mode 100644 etc/systemd/system/i2pd.service create mode 100644 etc/systemd/system/i2pd.service.d/mullvad-exclude.conf delete mode 100644 etc/systemd/system/i2pd.service.d/override.conf diff --git a/etc/i2pd/tunnels.conf.d/.gitignore b/etc/i2pd/tunnels.conf.d/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/etc/i2pd/tunnels.conf.d/yggdrasil-in.conf b/etc/i2pd/tunnels.conf.d/yggdrasil-in.conf deleted file mode 100644 index bbf92f8c..00000000 --- a/etc/i2pd/tunnels.conf.d/yggdrasil-in.conf +++ /dev/null @@ -1,7 +0,0 @@ -[yggdrasil-in] -type = server -host = 127.0.0.1 -port = 63412 -keys = yggdrasil-in.dat -inbound.length = 2 -outbound.length = 2 diff --git a/etc/systemd/system/i2pd.service b/etc/systemd/system/i2pd.service deleted file mode 100644 index b2a82875..00000000 --- a/etc/systemd/system/i2pd.service +++ /dev/null @@ -1,38 +0,0 @@ -[Unit] -Description=I2P Router written in C++ -Documentation=man:i2pd(1) https://i2pd.readthedocs.io/en/latest/ -After=network.target - -[Service] -User=i2pd -Group=i2pd -RuntimeDirectory=i2pd -RuntimeDirectoryMode=0700 -LogsDirectory=i2pd -LogsDirectoryMode=0700 -Type=forking -# Mikaela: my only modification, removing routerinfo and sleeping -# to workaround https://github.com/PurpleI2P/i2pd/issues/1275 -ExecStartPre=/bin/rm -f /var/lib/i2pd/routerinfo -ExecStartPre=/bin/sleep 15 -# Mikaela: normal commands -ExecStart=/usr/sbin/i2pd --conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --tunnelsdir=/etc/i2pd/tunnels.conf.d --pidfile=/var/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon --service -ExecReload=/bin/kill -HUP $MAINPID -PIDFile=/var/run/i2pd/i2pd.pid -### Uncomment, if auto restart needed -#Restart=on-failure - -KillSignal=SIGQUIT -# If you have the patience waiting 10 min on restarting/stopping it, uncomment this. -# i2pd stops accepting new tunnels and waits ~10 min while old ones do not die. -#KillSignal=SIGINT -#TimeoutStopSec=10m - -# If you have problems with hanging i2pd, you can try increase this -LimitNOFILE=4096 -# To enable write of coredump uncomment this -#LimitCORE=infinity -PrivateDevices=yes - -[Install] -WantedBy=multi-user.target diff --git a/etc/systemd/system/i2pd.service.d/mullvad-exclude.conf b/etc/systemd/system/i2pd.service.d/mullvad-exclude.conf new file mode 100644 index 00000000..c68438ae --- /dev/null +++ b/etc/systemd/system/i2pd.service.d/mullvad-exclude.conf @@ -0,0 +1,5 @@ +# https://i2pd.readthedocs.io/en/latest/tutorials/yggdrasil-only-mode/ +# and letting it through Mullvad this way +ExecStartPre=/usr/bin/sleep 30 +ExecStart= +ExecStart=/usr/bin/mullvad-exclude /usr/sbin/i2pd --conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --tunnelsdir=/etc/i2pd/tunnels.conf.d --pidfile=/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon --service diff --git a/etc/systemd/system/i2pd.service.d/override.conf b/etc/systemd/system/i2pd.service.d/override.conf deleted file mode 100644 index 4b12f0a9..00000000 --- a/etc/systemd/system/i2pd.service.d/override.conf +++ /dev/null @@ -1,3 +0,0 @@ -[Service] -ExecStartPre=/bin/rm -f /var/lib/i2pd/routerinfo -ExecStartPre=/bin/sleep 15