From f9cf4e1f2cf269601fdf2273fcf22797f34bd088 Mon Sep 17 00:00:00 2001 From: David Yang Date: Mon, 2 Sep 2019 22:19:14 +0800 Subject: [PATCH] i2pd: Update to 2.28.0 Signed-off-by: David Yang --- net/i2pd/Makefile | 8 +++- net/i2pd/files/i2pd.config | 25 +++++----- net/i2pd/files/i2pd.init | 8 ++-- net/i2pd/patches/config.patch | 88 +++++++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+), 16 deletions(-) create mode 100644 net/i2pd/patches/config.patch diff --git a/net/i2pd/Makefile b/net/i2pd/Makefile index 4775365d1..09aafa5a4 100644 --- a/net/i2pd/Makefile +++ b/net/i2pd/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=i2pd -PKG_VERSION:=2.26.0 +PKG_VERSION:=2.28.0 PKG_RELEASE:=1 PKG_BUILD_PARALLEL:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/PurpleI2P/i2pd/tar.gz/$(PKG_VERSION)? -PKG_HASH:=2ae18978c8796bb6b45bc8cfe4e1f25377e0cfc9fcf9f46054b09dc3384eef63 +PKG_HASH:=181327edc7cf5b3c25ee51ecc518a4da90fa9e421eca2107996791038a514a21 PKG_MAINTAINER:=David Yang PKG_LICENSE:=BSD-3-Clause @@ -43,6 +43,7 @@ define Package/i2pd/conffiles /etc/config/i2pd /etc/i2pd/i2pd.conf /etc/i2pd/tunnels.conf + /etc/i2pd/tunnels.d/* endef TARGET_LDFLAGS+=-latomic @@ -62,6 +63,9 @@ define Package/i2pd/install s/datadir = \/var\/lib/datadir = \/etc/ \ ' $(1)/etc/i2pd/i2pd.conf $(INSTALL_CONF) $(PKG_BUILD_DIR)/contrib/tunnels.conf $(1)/etc/i2pd + $(INSTALL_DIR) $(1)/etc/i2pd/tunnels.d + $(INSTALL_CONF) $(PKG_BUILD_DIR)/contrib/tunnels.d/*.conf $(1)/etc/i2pd/tunnels.d + # subscriptions.txt deprecated, see #8088 $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/i2pd.init $(1)/etc/init.d/i2pd endef diff --git a/net/i2pd/files/i2pd.config b/net/i2pd/files/i2pd.config index ca6f3c756..426ff9d11 100644 --- a/net/i2pd/files/i2pd.config +++ b/net/i2pd/files/i2pd.config @@ -1,15 +1,18 @@ config i2pd - # Set where i2pd should store its data (netDB, certificates, addresses, etc) - # By default we store it in RAM so no data is written to ROM. - # IMPORTANT! - # Data is consistently rewritten. DO NOT POINT IT TO INNER ROM. Flash will - # die. + # Set where i2pd should store its data (netDB, certificates, addresses, + # etc). By default we store it in RAM so no data is written to ROM. + # If you store data permanently, you may want to enable + # 'profiles = true' and 'addressbook = true' in i2pd.conf + #### IMPORTANT! #### + # Data is consistently rewritten. DO NOT POINT IT TO INNER ROM. Flash + # will die. option data_dir '/var/lib/i2pd' - # If you don't store i2pd data permanently, you can still choose to store only - # addressbook. If not, i2pd will be forced to do HTTP reseeding reseeding on - # every start. Storing addressbook may be useful if HTTP reseeding is not - # possible or blocked (by censorship). - # Even addressbook doesn't take up too much space, extroot is still strongly - # recommended to avoid flash wear-out. + # If you don't store i2pd data permanently, you can still choose to + # store only addressbooks. If not, i2pd will be forced to do HTTP + # reseeding on every start. Storing addressbook may be useful + # if HTTP reseeding is not possible or blocked (by censorship). + # Even addressbook doesn't take up too much space, extroot is still + # strongly recommended to avoid flash wear-out. + # Enable 'addressbook = true' in i2pd.conf to make it take effect. #option addressbook_dir '/etc/i2pd/addressbook' diff --git a/net/i2pd/files/i2pd.init b/net/i2pd/files/i2pd.init index a40a74205..21473407f 100755 --- a/net/i2pd/files/i2pd.init +++ b/net/i2pd/files/i2pd.init @@ -11,7 +11,7 @@ PROG=/usr/sbin/i2pd USER="i2pd" GROUP="i2pd" PIDFILE=/var/run/i2pd.pid -#DATADIR=/var/lib/i2pd +DATADIR=/var/lib/i2pd CONFFILE=/etc/i2pd/i2pd.conf . /lib/functions.sh @@ -23,14 +23,13 @@ i2pd_start() { local data_dir local addressbook_dir - config_get data_dir "$cfg" data_dir + config_get data_dir "$cfg" data_dir "$DATADIR" config_get addressbook_dir "$cfg" addressbook_dir ## Setting up data dir if [ ! -d "$data_dir" ]; then mkdir -p "$data_dir" ln -s /usr/share/i2pd/certificates "$data_dir/certificates" - ln -s /etc/i2pd/tunnels.conf "$data_dir/tunnels.conf" if [ -n "$addressbook_dir" ]; then if [ ! -d "$addressbook_dir" ]; then mkdir -p "$addressbook_dir" @@ -49,6 +48,9 @@ i2pd_start() { procd_set_param command "$PROG" --service --conf="$CONFFILE" --pidfile "$PIDFILE" ## Don't know about i2pd user's HOME procd_set_param env "HOME=$DATADIR" + ## For debugging, provide about 512 MB on external storage for coredump and adjust /proc/sys/kernel/core_pattern + # echo "/tmp/coredumps/core.%e.%p.%s.%t" > /proc/sys/kernel/core_pattern + # procd_set_param limits core="unlimited unlimited" procd_set_param limits nofile=4096 procd_set_param stdout 1 procd_set_param stderr 1 diff --git a/net/i2pd/patches/config.patch b/net/i2pd/patches/config.patch new file mode 100644 index 000000000..5dae88a64 --- /dev/null +++ b/net/i2pd/patches/config.patch @@ -0,0 +1,88 @@ +diff -u -r a/contrib/i2pd.conf b/contrib/i2pd.conf +--- a/contrib/i2pd.conf 2019-09-04 11:00:27.660713504 +0800 ++++ b/contrib/i2pd.conf 2019-09-04 11:07:53.669745273 +0800 +@@ -8,12 +8,12 @@ + + ## Tunnels config file + ## Default: ~/.i2pd/tunnels.conf or /var/lib/i2pd/tunnels.conf +-# tunconf = /var/lib/i2pd/tunnels.conf ++tunconf = /etc/i2pd/tunnels.conf + + ## Tunnels config files path + ## Use that path to store separated tunnels in different config files. + ## Default: ~/.i2pd/tunnels.d or /var/lib/i2pd/tunnels.d +-# tunnelsdir = /var/lib/i2pd/tunnels.conf.d ++tunnelsdir = /etc/i2pd/tunnels.conf.d + + ## Where to write pidfile (don't write by default) + # pidfile = /var/run/i2pd.pid +@@ -25,12 +25,12 @@ + ## * stdout - print log entries to stdout + ## * file - log entries to a file + ## * syslog - use syslog, see man 3 syslog +-# log = file ++log = syslog + ## Path to logfile (default - autodetect) + # logfile = /var/log/i2pd.log + ## Log messages above this level (debug, *info, warn, error, none) + ## If you set it to none, logging will be disabled +-# loglevel = info ++loglevel = error + ## Write full CLF-formatted date and time to log (default: write only time) + # logclftime = true + +@@ -61,7 +61,7 @@ + # ifname6 = + + ## Enable NTCP transport (default = true) +-# ntcp = true ++ntcp = false + ## If you run i2pd behind a proxy server, you can only use NTCP transport with ntcpproxy option + ## Should be http://address:port or socks://address:port + # ntcpproxy = http://127.0.0.1:8118 +@@ -81,7 +81,7 @@ + + ## Router will not accept transit tunnels, disabling transit traffic completely + ## (default = false) +-# notransit = true ++notransit = true + + ## Router will be floodfill + # floodfill = true +@@ -91,8 +91,10 @@ + ## Uncomment and set to 'false' to disable Web Console + # enabled = true + ## Address and port service will listen on +-address = 127.0.0.1 ++address = 192.168.1.1 ++# address = :: + port = 7070 ++# strictheaders = false + ## Path to web console, default "/" + # webroot = / + ## Uncomment following lines to enable Web Console authentication +@@ -104,7 +106,7 @@ + ## Uncomment and set to 'false' to disable HTTP Proxy + # enabled = true + ## Address and port service will listen on +-address = 127.0.0.1 ++address = 192.168.1.1 + port = 4444 + ## Optional keys file for proxy local destination + # keys = http-proxy-keys.dat +@@ -118,7 +120,7 @@ + ## Uncomment and set to 'false' to disable SOCKS Proxy + # enabled = true + ## Address and port service will listen on +-address = 127.0.0.1 ++address = 192.168.1.1 + port = 4447 + ## Optional keys file for proxy local destination + # keys = socks-proxy-keys.dat +@@ -228,4 +230,5 @@ + + [persist] + ## Save peer profiles on disk (default: true) +-# profiles = true ++profiles = false ++addressbook = false