Skip to content
This repository has been archived by the owner on Mar 17, 2018. It is now read-only.

Commit

Permalink
shadowsocks-libev: sync with upstrem
Browse files Browse the repository at this point in the history
  • Loading branch information
ryzhovau committed Jul 19, 2017
1 parent a69a756 commit e3793bb
Show file tree
Hide file tree
Showing 9 changed files with 772 additions and 321 deletions.
90 changes: 68 additions & 22 deletions net/shadowsocks-libev/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#
# Copyright (C) 2015 OpenWrt.org
# Copyright (C) 2017 Yousong Zhou <yszhou4tech@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
Expand All @@ -8,52 +7,99 @@

include $(TOPDIR)/rules.mk

# Checklist when bumping versions
#
# - update cipher list by checking src/crypto.c:crypto_init()
# - check if default mode has changed from TCP_ONLY
# - check if ss-rules has been upstreamed
#
# TODO
#
# - add validate type: user
#
PKG_NAME:=shadowsocks-libev
PKG_VERSION:=3.0.6
PKG_RELEASE:=1a
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
PKG_HASH:=7d9b43b0235a57c115bfe160efd54abef96bffcbfff61c5496e7c2800f0734ca

PKG_MAINTAINER:=Jian Chang <aa65535@live.com>
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>

PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=LICENSE

PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk

define Package/shadowsocks-libev
SECTION:=net
CATEGORY:=Network
TITLE:=Lightweight Secured Socks5 Proxy
URL:=https://github.com/shadowsocks/shadowsocks-libev
DEPENDS:=+libev +libmbedtls +libpthread +libsodium +libudns \
+libpcre +zlib

define Package/shadowsocks-libev-config
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=shadowsocks-libev config scripts
URL:=https://github.com/shadowsocks/shadowsocks-libev
endef

define Package/shadowsocks-libev/description
Shadowsocks-libev is a lightweight secured socks5 proxy for embedded devices and low end boxes.
define Package/shadowsocks-libev-config/install
$(INSTALL_DIR) $(1)/opt/etc/init.d
$(INSTALL_BIN) ./files/S22shadowsocks $(1)/opt/etc/init.d
$(INSTALL_CONF) $(PKG_BUILD_DIR)/debian/config.json $(1)/opt/etc/shadowsocks.json
endef

define Package/shadowsocks-libev/conffiles
define Package/shadowsocks-libev-config/conffiles
/opt/etc/shadowsocks.json
endef

define Package/shadowsocks-libev/install
define Package/shadowsocks-libev/Default
define Package/shadowsocks-libev-$(1)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=shadowsocks-libev $(1)
URL:=https://github.com/shadowsocks/shadowsocks-libev
DEPENDS:=+libev +libmbedtls +libpcre +libpthread +libsodium +libudns +shadowsocks-libev-config +zlib
endef

define Package/shadowsocks-libev-$(1)/install
$$(INSTALL_DIR) $$(1)/opt/bin
$$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/opt/bin/$(1) $$(1)/opt/bin
endef

endef

SHADOWSOCKS_COMPONENTS:=ss-local ss-redir ss-tunnel ss-server
define shadowsocks-libev/templates
$(foreach component,$(SHADOWSOCKS_COMPONENTS),
$(call Package/shadowsocks-libev/Default,$(component))
)
endef
$(eval $(call shadowsocks-libev/templates))


define Package/shadowsocks-libev-ss-rules
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=shadowsocks-libev ss-rules
URL:=https://github.com/shadowsocks/shadowsocks-libev
DEPENDS:=+shadowsocks-libev-ss-redir +shadowsocks-libev-config
endef

define Package/shadowsocks-libev-ss-rules/install
$(INSTALL_DIR) $(1)/opt/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-{redir,tunnel} $(1)/opt/bin
$(INSTALL_BIN) ./files/ss-rules $(1)/opt/bin
$(INSTALL_DIR) $(1)/opt/etc/init.d
$(INSTALL_BIN) ./files/S22shadowsocks $(1)/opt/etc/init.d
$(INSTALL_CONF) $(PKG_BUILD_DIR)/debian/config.json $(1)/opt/etc/shadowsocks.json
$(INSTALL_DIR) $(1)/opt/share/shadowsocks-libev
endef

CONFIGURE_ARGS += --disable-documentation

$(eval $(call BuildPackage,shadowsocks-libev))
$(eval $(call BuildPackage,shadowsocks-libev-config))
$(eval $(call BuildPackage,shadowsocks-libev-ss-rules))
$(foreach component,$(SHADOWSOCKS_COMPONENTS), \
$(eval $(call BuildPackage,shadowsocks-libev-$(component))) \
)
4 changes: 3 additions & 1 deletion net/shadowsocks-libev/files/S22shadowsocks
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/sh

ENABLED=yes
PROCS=ss-redir
PROCS=ss-local
ARGS="-c /opt/etc/shadowsocks.json"
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

[ -z "$(which $PROCS)" ] && exit 0

. /opt/etc/init.d/rc.func
6 changes: 0 additions & 6 deletions net/shadowsocks-libev/files/firewall.include

This file was deleted.

2 changes: 2 additions & 0 deletions net/shadowsocks-libev/files/firewall.ss-rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
/etc/init.d/shadowsocks-libev reload
71 changes: 58 additions & 13 deletions net/shadowsocks-libev/files/shadowsocks-libev.config
Original file line number Diff line number Diff line change
@@ -1,15 +1,60 @@

config shadowsocks-libev
option enable '1'
option server '127.0.0.1'
option server_port '8388'
config ss_local
option disabled 1
option server 'sss0'
option local_address '0.0.0.0'
option local_port '1080'
option password 'barfoo!'
option timeout '30'

config ss_tunnel
option disabled 1
option server 'sss0'
option local_address '0.0.0.0'
option local_port '1090'
option tunnel_address 'example.com:80'
option mode 'tcp_and_udp'
option timeout '60'
option encrypt_method 'rc4-md5'
option ignore_list '/dev/null'
option udp_mode '0'
option tunnel_enable '1'
option tunnel_port '5300'
option tunnel_forward '8.8.4.4:53'
option lan_ac_mode '0'

config ss_redir hi
option disabled 1
option server 'sss0'
option local_address '0.0.0.0'
option local_port '1100'
option mode 'tcp_and_udp'
option timeout '60'
option fast_open 1
option verbose 1
option reuse_port 1

config ss_redir hj
option disabled 1
option server 'sss0'
option local_address '0.0.0.0'
option local_port '1100'
option mode 'tcp_and_udp'
option timeout '60'
option fast_open 1
option verbose 1
option reuse_port 1

config ss_rules 'ss_rules'
option disabled 1
option redir_tcp 'hi'
option redir_udp 'hi'
option src_default 'bypass'
option local_default 'checkdst'
list src_ips_forward '192.168.1.4'
list dst_ips_forward '8.8.8.8'

config server 'sss0'
option disabled 1
option server '192.168.1.3'
option server_port '9001'
option password '********'
option method 'aes-256-cfb'

config ss_server
option disabled 1
option server_port '9001'
option password '********'
option method 'aes-256-cfb'
option bind_address '192.168.7.72'
Loading

0 comments on commit e3793bb

Please sign in to comment.