Entware / Entware-ng

Entware-ng
GNU General Public License v2.0
1.21k stars 152 forks source link

Package request: simple-obfs #719

Closed ohmyarch closed 6 years ago

ohmyarch commented 7 years ago

Package: simple-obfs

Intro: A simple obfusacting tool, designed as plugin server of shadowsocks. Repo: https://github.com/shadowsocks/simple-obfs License: GPLv3 or any later version of GPL

Platform: ASUS RT-68U, Asuswrt-Merlin, ARMv7

maxduke commented 7 years ago

I would like to request the same. This package is a plugin for package shadowsocks-libev.

yicong2007 commented 7 years ago

I would like to request the same. Before the package is officially added into entware-ng, we can follow the simple-obfs for OpenWrt by @aa65535 and make an entware-ng version for our own.

I have just compiled obfs-local and use it in my RT-AC68U, it works fine for now. The following is HOW.

Follow How to add a new package to prepare the build environment. Compile shadowsocks-libev **_3.0.6-2 and install them first, this can confirm that you had prepared the build environment correctly. Then cd to the Entware-ng folder and download the Makefile created by @aa65535

git clone https://github.com/aa65535/openwrt-simple-obfs.git feeds/packages/net/simple-obfs

Apply the following patch to the feeds/packages/net/simple-obfs/Makefile (we should change the install directory since we use /opt/bin instead of /usr/bin in Entware-ng. I also add submenu to keep the simple-obfs in the same submenu as shadowsocks-libev. )

@@ -33,6 +33,7 @@
 define Package/simple-obfs/Default
    SECTION:=net
    CATEGORY:=Network
+   SUBMENU:=Web Servers/Proxies
    TITLE:=Simple-obfs
    URL:=https://github.com/shadowsocks/simple-obfs
    DEPENDS:=+libev +libudns +libpthread +libsodium
@@ -50,13 +51,13 @@
 CONFIGURE_ARGS += --disable-ssp --disable-documentation --disable-assert

 define Package/simple-obfs/install
-   $(INSTALL_DIR) $(1)/usr/bin
-   $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/obfs-local $(1)/usr/bin
+   $(INSTALL_DIR) $(1)/opt/bin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/obfs-local $(1)/opt/bin
 endef

 define Package/simple-obfs-server/install
-   $(INSTALL_DIR) $(1)/usr/bin
-   $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/obfs-server $(1)/usr/bin
+   $(INSTALL_DIR) $(1)/opt/bin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/obfs-server $(1)/opt/bin
 endef

 $(eval $(call BuildPackage,simple-obfs))

Use make package/symlinks to update the packages, use make menuconfig to enable simple-obfs and/or simple-obfs-server. At last, use make package/simple-obfs/compile to compile. If nothing got wrong, you would find simple-obfs-server_0.0.3-1_armv7soft.ipk and/or simple-obfs_0.0.3-1_armv7soft.ipk in the Entware-ng/bin/targets/armv7soft/generic-glibc/packages folder. Use opkg install to install the ipks in your router.

zyxmon commented 6 years ago

If it is still needed, please report. Now we have shadowsocksR-libev in repo - https://github.com/Entware-ng/Entware-ng/issues/736

maxduke commented 6 years ago

Thanks zyxmon. But the package is still needed for package shadowsocks-libev for full functionality. ( shadowsocksR-libev != shadowsocks-libev + simple-obfs )

zyxmon commented 6 years ago

simple-obfs is now in entware-3x - https://github.com/Entware-for-kernel-3x/rtndev-3x/tree/master/simple-obfs binaries will be available soon. I think it will be also added to Entware-ng