1 (edited by ryzhov_al 2015-03-10 14:20:38)

Topic: i2pd has been ported

i2pd is a simplified C++ implementation of I2P client with crypto++ and boost dependencies. I've made an appropriate package for my repo, if you want to use it with OpenWrt, just replace /opt to /usr path in Makefile and patches.

http://s020.radikal.ru/i722/1503/86/1b2d20f2b06d.png

Here is asciicast of working i2pd on Asus RT-N66U.

Entware team

2 (edited by LLE8 2017-11-30 13:26:46)

Re: i2pd has been ported

Fresh port.
i2pd 2.16.0, LEDE 17.01.4. Tested on TP-Link TL-WDR4300.

Makefile:

# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

## I2PD 2.16 for LEDE 17.01.4
## h__xx__ps://github.com/PurpleI2P/i2pd/archive/2.16.0.tar.gz

include $(TOPDIR)/rules.mk

PKG_NAME:=i2pd
PKG_VERSION:=2.16.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=h__xx__ps://github.com/PurpleI2P/i2pd/archive/
# PKG_MD5SUM:=fda55bfaedec3a8706fb11befdf12563
PKG_HASH:=0a8fbc76422ba3452d281f31dbd55bc2e3da3b6bb2bc689b3b93c8039b6edfcd
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk

define Package/i2pd
        SECTION:=net
        CATEGORY:=Network
        DEPENDS:=+libopenssl +boost-system +boost-filesystem +boost-program_options +boost-date_time +libatomic +zlib
        TITLE:=C++ implementation of I2P client
        URL:=h__xx__ps://github.com/PurpleI2P/i2pd/
        MAINTAINER:=X3_nobodY
        USERID:=i2pd:i2pd
endef

define Package/i2pd/description
        i2p router for Linux written on C++.
endef

## Try this code instead of manual copying *.patch from original sources
#define Build/Prepare
#       $(PKG_UNPACK)
#       cp $(PKG_BUILD_DIR)/debian/patches/*.patch ./patches
#       $(Build/Patch)
#endef

TARGET_LDFLAGS += -latomic

## Read more about this
#define Package/i2pd/conffiles
#       /etc/i2pd.conf
#       /etc/i2pd_tunnels.conf
#       /etc/i2pd_subscriptions.txt
#endef

define Package/i2pd/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/i2pd $(1)/usr/sbin
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/i2pd.init $(1)/etc/init.d/i2pd
        $(INSTALL_DATA) ./files/i2pd.conf $(1)/etc/i2pd.conf
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/contrib/tunnels.conf  $(1)/etc/i2pd_tunnels.conf
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/contrib/subscriptions.txt  $(1)/etc/i2pd_subscriptions.txt
        $(INSTALL_DIR) $(1)/usr/share/i2pd
        $(CP) $(PKG_BUILD_DIR)/contrib/certificates  $(1)/usr/share/i2pd
endef

$(eval $(call BuildPackage,i2pd))

i2pd.init:

#!/bin/sh /etc/rc.common

USE_PROCD=1

# PROCD_DEBUG=1

## Tune it
START=90
STOP=10

USER="i2pd"
GROUP="i2pd"
PIDFILE=/var/run/i2pd.pid
## Try to move DATADIR to other place (usb flash drive, i2pd user's HOME /var/run/i2pd, ...)
DATADIR=/var/lib/i2pd

start_service()
{
## RAM
  if [ ! -d $DATADIR ]
  then
    mkdir -p $DATADIR
    chown $USER:$GROUP  $DATADIR
    ln -s /usr/share/i2pd/certificates  $DATADIR/certificates
  fi

## We need permissions
  touch $PIDFILE
  chown $USER:adm $PIDFILE

## Tune it
  /sbin/sysctl -w net.core.somaxconn=4096
  /sbin/sysctl -w net.ipv4.tcp_max_orphans=1024

  procd_open_instance
  procd_set_param command /usr/sbin/i2pd  --service  --conf=/etc/i2pd.conf
## Don't know about i2pd user's HOME
  procd_set_param env HOME=$DATADIR
  procd_set_param limits nofile=4096
  procd_set_param stdout 1
  procd_set_param stderr 1
  procd_set_param user $USER
  procd_set_param pidfile $PIDFILE
  procd_close_instance
}

01-tune-build-opts.patch (just copy from debian/patches of original sources):

diff --git a/Makefile b/Makefile
index bdadfe0..2f71eec 100644

--- a/Makefile
+++ b/Makefile
@@ -9,10 +9,10 @@ DEPS := obj/make.dep

 include filelist.mk

-USE_AESNI      := yes
+USE_AESNI      := no
-USE_AVX                := yes
+USE_AVX                := no
 USE_STATIC     := no
 USE_MESHNET    := no
 USE_UPNP       := no

 ifeq ($(WEBSOCKETS),1)

You may need rebuild boost package.

3 (edited by LLE8 2017-11-28 15:11:32)

Re: i2pd has been ported

i2pd.conf:

tunconf = /etc/i2pd_tunnels.conf
pidfile = /var/run/i2pd.pid
log = syslog
loglevel = error
datadir = /var/lib/i2pd
daemon = false
ipv4 = true
ipv6 = false
ifname = eth0.2
nat = true
bandwidth = O
notransit = true
floodfill = false
[limits]
openfiles = 4096
[precomputation]
elgamal = true
[reseed]
verify = true
[h__tt__p]
address = <internal ip of your router>
port = 7070
[h__tt__pproxy]
address = <internal ip of your router>
port = 4444
[socksproxy]
address = <internal ip of your router>
port = 4447
[sam]
enabled = true

Re: i2pd has been ported

i2pd 2.17.0 for LEDE 17.01.4
Tested on TP-Link TL-WDR4300
Makefile:

# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

## I2PD 2.16 for LEDE 17.01.4
## h__xx__ps://github.com/PurpleI2P/i2pd/archive/2.16.0.tar.gz

include $(TOPDIR)/rules.mk

PKG_NAME:=i2pd
PKG_VERSION:=2.17.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=h__xx__ps://github.com/PurpleI2P/i2pd/archive/
# PKG_MD5SUM:=b669d7a94af4bef5bc015eb1beaf697d
PKG_HASH:=9afc79427300cabd4e50216466bcb5be980aee841dc2aea17a8c2ab60cd7918b
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk

define Package/i2pd
        SECTION:=net
        CATEGORY:=Network
        DEPENDS:=+libopenssl +boost-system +boost-filesystem +boost-program_options +boost-date_time +libatomic +zlib
        TITLE:=C++ implementation of I2P client
        URL:=h__xx__ps://github.com/PurpleI2P/i2pd/
        MAINTAINER:=X3_nobodY
        USERID:=i2pd:i2pd
endef

define Package/i2pd/description
        i2p router for Linux written on C++.
endef

## Try this code instead of manual copying *.patch from original sources
#define Build/Prepare
#       $(PKG_UNPACK)
#       cp $(PKG_BUILD_DIR)/debian/patches/*.patch ./patches
#       $(Build/Patch)
#endef

TARGET_LDFLAGS += -latomic

## Read more about this
#define Package/i2pd/conffiles
#       /etc/i2pd.conf
#       /etc/i2pd_tunnels.conf
#       /etc/i2pd_subscriptions.txt
#endef

define Package/i2pd/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/i2pd $(1)/usr/sbin
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/i2pd.init $(1)/etc/init.d/i2pd
        $(INSTALL_DATA) ./files/i2pd.conf $(1)/etc/i2pd.conf
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/contrib/tunnels.conf  $(1)/etc/i2pd_tunnels.conf
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/contrib/subscriptions.txt  $(1)/etc/i2pd_subscriptions.txt
        $(INSTALL_DIR) $(1)/usr/share/i2pd
        $(CP) $(PKG_BUILD_DIR)/contrib/certificates  $(1)/usr/share/i2pd
endef

$(eval $(call BuildPackage,i2pd))