├── .github └── workflows │ └── release-build.yml ├── README.md ├── libc6-compat ├── Makefile └── src │ ├── aarch64 │ └── libc6_aarch64.so │ └── x86_64 │ └── libc6_x86_64.so ├── luci-app-xunlei ├── Makefile ├── luasrc │ ├── controller │ │ └── xunlei.lua │ ├── model │ │ └── cbi │ │ │ └── xunlei.lua │ └── view │ │ └── xunlei │ │ └── xunlei_status.htm ├── po │ ├── zh-cn │ │ └── xunlei.po │ └── zh_Hans └── root │ ├── etc │ ├── config │ │ └── xunlei │ ├── init.d │ │ └── xunlei │ ├── uci-defaults │ │ └── luci-xunlei │ └── xunlei │ │ └── .drive │ │ └── 请勿删除,本目录文件.txt │ └── usr │ └── share │ └── rpcd │ └── acl.d │ └── luci-app-xunlei.json └── nas-xunlei ├── Makefile ├── files └── authenticate.cgi └── src └── hack ├── libc.so.6 ├── libdl.so.2 ├── libm.so.6 └── libpthread.so.0 /.github/workflows/release-build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | tags: 6 | - v*.** 7 | 8 | jobs: 9 | build: 10 | name: Build ${{ matrix.arch }} 11 | runs-on: ubuntu-latest 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | arch: 16 | - aarch64_generic 17 | - x86_64 18 | 19 | steps: 20 | - uses: actions/checkout@v3 21 | with: 22 | fetch-depth: 0 23 | 24 | - name: Building packages 25 | uses: sbwml/openwrt-gh-action-sdk@master 26 | env: 27 | ARCH: ${{ matrix.arch }}-openwrt-22.03 28 | FEEDNAME: packages_ci 29 | PACKAGES: luci-app-xunlei 30 | NO_REFRESH_CHECK: true 31 | 32 | - name: Upload artifacts 33 | uses: actions/upload-artifact@v3 34 | with: 35 | name: ${{ matrix.arch }} 36 | path: bin/packages/${{ matrix.arch }}/packages_ci/*.ipk 37 | 38 | - name: Upload packages 39 | uses: ncipollo/release-action@v1 40 | with: 41 | token: ${{ secrets.workflow_token }} 42 | allowUpdates: true 43 | replacesArtifacts: true 44 | artifacts: "bin/packages/${{ matrix.arch }}/packages_ci/*.ipk" 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NAS Xunlei Beta - OpenWrt Ported Version 2 | 3 | Only support **aarch64_generic / x86_64** platform. 4 | 5 | ### Invitation code: 网心超牛 6 | 7 | ------------ 8 | 9 | ## How to build 10 | 11 | - Enter in your openwrt dir 12 | 13 | - Openwrt official SnapShots 14 | 15 | ```shell 16 | git clone https://github.com/sbwml/luci-app-xunlei package/xunlei 17 | make menuconfig # choose LUCI -> Applications -> luci-app-xunlei 18 | make V=s 19 | ``` 20 | 21 | ------------ 22 | 23 | ![1](https://github.com/sbwml/luci-app-xunlei/assets/16485166/865399fe-f5c1-432b-a5a0-cb463c34d3e4) 24 | 25 | ![2](https://github.com/sbwml/luci-app-xunlei/assets/16485166/c679a2b2-08f7-4bbc-8fba-3fee68816e9d) 26 | 27 | ![3](https://github.com/sbwml/luci-app-xunlei/assets/16485166/aa16bca1-45d1-4bd2-8478-7e3aeb9f004f) 28 | 29 | ![4](https://github.com/sbwml/luci-app-xunlei/assets/16485166/78c04829-0abe-40b5-8a76-f561ab70a592) 30 | -------------------------------------------------------------------------------- /libc6-compat/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015-2016 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v3. 5 | # 6 | 7 | include $(TOPDIR)/rules.mk 8 | 9 | PKG_NAME:=libc6-compat 10 | PKG_VERSION:=2.34 11 | PKG_RELEASE:=1 12 | 13 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) 14 | 15 | include $(INCLUDE_DIR)/package.mk 16 | 17 | define Package/$(PKG_NAME) 18 | SECTION:=libs 19 | CATEGORY:=Libraries 20 | TITLE:=libc6-compat 21 | DEPENDS:=@(aarch64||x86_64) @USE_MUSL 22 | URL:=https://www.gnu.org/software/libc/ 23 | endef 24 | 25 | define Package/$(PKG_NAME)/description 26 | Compatibility libraries for glibc 27 | endef 28 | 29 | define Package/$(PKG_NAME)/postrm 30 | #!/bin/sh 31 | ARCH=$(uname -m) 32 | if [ "$ARCH" = "aarch64" ]; then 33 | LD=ld-linux-aarch64.so.1 34 | else 35 | LD=ld-linux-x86-64.so.2 36 | fi 37 | [ -L "/lib/$LD" ] && rm -f /lib/$LD 38 | [ $(grep -qs '/libc6' /proc/mounts) ] && umount /libc6 39 | rm -rf /libc6 40 | exit 0 41 | endef 42 | 43 | define Build/Compile 44 | endef 45 | 46 | define Package/$(PKG_NAME)/install 47 | $(INSTALL_DIR) $(1)/usr/libc6-compat 48 | $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ARCH)/libc6_$(ARCH).so $(1)/usr/libc6-compat/libc6.so 49 | endef 50 | 51 | $(eval $(call BuildPackage,$(PKG_NAME))) 52 | -------------------------------------------------------------------------------- /libc6-compat/src/aarch64/libc6_aarch64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbwml/luci-app-xunlei/b093fec3ed8af5a03ced235599514ff7d785eea3/libc6-compat/src/aarch64/libc6_aarch64.so -------------------------------------------------------------------------------- /libc6-compat/src/x86_64/libc6_x86_64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbwml/luci-app-xunlei/b093fec3ed8af5a03ced235599514ff7d785eea3/libc6-compat/src/x86_64/libc6_x86_64.so -------------------------------------------------------------------------------- /luci-app-xunlei/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Openwrt.org 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | PKG_NAME:=luci-app-xunlei 9 | PKG_VERSION:=1.0.1 10 | PKG_RELEASE:=2 11 | 12 | LUCI_TITLE:=LuCI support for NAS-Xunlei 13 | LUCI_PKGARCH:=all 14 | LUCI_DEPENDS:=+nas-xunlei 15 | PKG_MAINTAINER:=sbwml 16 | 17 | define Package/$(PKG_NAME)/conffiles 18 | /etc/xunlei 19 | /etc/synoinfo.conf 20 | endef 21 | 22 | define Package/$(PKG_NAME)/postinst 23 | #!/bin/sh 24 | [ -n "${IPKG_INSTROOT}" ] || { 25 | ( . /etc/uci-defaults/luci-xunlei ) && rm -f /etc/uci-defaults/luci-xunlei 26 | exit 0 27 | } 28 | endef 29 | 30 | define Package/$(PKG_NAME)/postrm 31 | #!/bin/sh 32 | rm -rf /var/packages/pan-xunlei-com 33 | exit 0 34 | endef 35 | 36 | include $(TOPDIR)/feeds/luci/luci.mk 37 | 38 | # call BuildPackage - OpenWrt buildroot signature 39 | -------------------------------------------------------------------------------- /luci-app-xunlei/luasrc/controller/xunlei.lua: -------------------------------------------------------------------------------- 1 | local sys = require "luci.sys" 2 | local http = require "luci.http" 3 | 4 | module("luci.controller.xunlei", package.seeall) 5 | 6 | function index() 7 | if not nixio.fs.access("/etc/config/xunlei") then 8 | return 9 | end 10 | 11 | local page = entry({"admin", "services", "xunlei"}, cbi("xunlei"), _("Xunlei"), 100) 12 | page.dependent = true 13 | page.acl_depends = { "luci-app-xunlei" } 14 | 15 | entry({"admin", "services", "xunlei", "status"}, call("act_status")).leaf = true 16 | end 17 | 18 | function act_status() 19 | local e = {} 20 | e.running = sys.call("pgrep -f xunlei >/dev/null") == 0 21 | http.prepare_content("application/json") 22 | http.write_json(e) 23 | end 24 | -------------------------------------------------------------------------------- /luci-app-xunlei/luasrc/model/cbi/xunlei.lua: -------------------------------------------------------------------------------- 1 | local m, s 2 | 3 | m = Map("xunlei", translate("Xunlei")) 4 | m.description = translate("NAS Xunlei DSM 7.x Beta Version") .. "
" .. translate("Invitation code:") .. "网心超牛" 5 | 6 | m:section(SimpleSection).template = "xunlei/xunlei_status" 7 | 8 | s = m:section(TypedSection, "xunlei") 9 | s.addremove = false 10 | s.anonymous = true 11 | 12 | o = s:option(Flag, "enabled", translate("Enabled")) 13 | o.rmempty = false 14 | 15 | o = s:option(Value, "port", translate("Port")) 16 | o.datatype = "and(port,min(1))" 17 | o.default = "5051" 18 | o.rmempty = false 19 | 20 | o = s:option(Value, "username", translate("Username")) 21 | o.datatype = "string" 22 | 23 | o = s:option(Value, "password", translate("Password")) 24 | o.description = translate("Leave blank to disable auth") 25 | o.datatype = "string" 26 | o.password = true 27 | 28 | o = s:option(Value, "config_path", translate("Data Storage Path")) 29 | o.default = "/etc/xunlei" 30 | 31 | o = s:option(Value, "download_dir", translate("Default Download Path")) 32 | o.default = "/mnt" 33 | 34 | return m 35 | -------------------------------------------------------------------------------- /luci-app-xunlei/luasrc/view/xunlei/xunlei_status.htm: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 |
23 |

24 | <%:Collecting data...%> 25 |

26 |
27 | -------------------------------------------------------------------------------- /luci-app-xunlei/po/zh-cn/xunlei.po: -------------------------------------------------------------------------------- 1 | msgid "Xunlei" 2 | msgstr "迅雷下载" 3 | 4 | msgid "NAS Xunlei DSM 7.x Beta Version" 5 | msgstr "NAS 迅雷下载 DSM 7.x 内测版" 6 | 7 | msgid "Invitation code:" 8 | msgstr "邀请码:" 9 | 10 | msgid "Enabled" 11 | msgstr "启用" 12 | 13 | msgid "RUNNING" 14 | msgstr "运行中" 15 | 16 | msgid "NOT RUNNING" 17 | msgstr "未运行" 18 | 19 | msgid "Collecting data..." 20 | msgstr "收集数据..." 21 | 22 | msgid "Open Web Interface" 23 | msgstr "打开 Web 界面" 24 | 25 | msgid "Port" 26 | msgstr "端口" 27 | 28 | msgid "Username" 29 | msgstr "用户名" 30 | 31 | msgid "Password" 32 | msgstr "密码" 33 | 34 | msgid "Leave blank to disable auth" 35 | msgstr "留空则禁用身份验证" 36 | 37 | msgid "Data Storage Path" 38 | msgstr "数据储存路径" 39 | 40 | msgid "Default Download Path" 41 | msgstr "默认下载路径" 42 | -------------------------------------------------------------------------------- /luci-app-xunlei/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /luci-app-xunlei/root/etc/config/xunlei: -------------------------------------------------------------------------------- 1 | 2 | config xunlei 3 | option 'enabled' '0' 4 | option 'port' '5051' 5 | option 'username' '' 6 | option 'password' '' 7 | option 'config_path' '/etc/xunlei' 8 | option 'download_dir' '/mnt' 9 | -------------------------------------------------------------------------------- /luci-app-xunlei/root/etc/init.d/xunlei: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=99 4 | USE_PROCD=1 5 | 6 | if [[ "$(ldd --version 2>&1)" == *"musl"* ]]; then 7 | PROG=/usr/share/xunlei/xunlei 8 | else 9 | PROG=/usr/share/xunlei/bin/xunlei-pan-cli-daemon 10 | fi 11 | 12 | get_config() { 13 | config_get_bool enabled $1 enabled 0 14 | config_get port $1 port 5051 15 | config_get username $1 username "" 16 | config_get password $1 password "" 17 | config_get config_path $1 config_path "/etc/xunlei" 18 | config_get download_dir $1 download_dir "/mnt" 19 | } 20 | 21 | start_service() { 22 | config_load xunlei 23 | config_foreach get_config xunlei 24 | [ $enabled -ne 1 ] && return 1 25 | 26 | # init 27 | rm -rf /var/packages/pan-xunlei-com 28 | mkdir -p /var/packages/pan-xunlei-com/target/var $config_path 29 | ln -s /usr/share/xunlei/bin/version /var/packages/pan-xunlei-com/target/ 30 | ln -s /usr/share/xunlei/bin/xunlei-pan-cli-launcher /var/packages/pan-xunlei-com/target/ 31 | ln -s /usr/share/xunlei/bin/xunlei-pan-cli-web /var/packages/pan-xunlei-com/target/ 32 | ln -s /usr/share/xunlei/bin/xunlei-pan-cli.* /var/packages/pan-xunlei-com/target/ 33 | echo "{\"port\":$port, \"internal\": false, \"download\": \"$download_dir\"}" > $config_path/config.json 34 | 35 | procd_open_instance 36 | procd_set_param command $PROG 37 | procd_append_param command run -config="$config_path" -username="$username" -password="$password" 38 | procd_set_param stdout 0 39 | procd_set_param stderr 0 40 | procd_set_param respawn 41 | procd_close_instance 42 | } 43 | 44 | service_triggers() { 45 | procd_add_reload_trigger "xunlei" 46 | } 47 | 48 | reload_service() { 49 | stop 50 | sleep 3 51 | start 52 | } 53 | -------------------------------------------------------------------------------- /luci-app-xunlei/root/etc/uci-defaults/luci-xunlei: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@xunlei[-1] 5 | add ucitrack xunlei 6 | set ucitrack.@xunlei[-1].init=xunlei 7 | commit ucitrack 8 | EOF 9 | 10 | [ ! -f /etc/synoinfo.conf ] && echo "unique=\"synology_$(cat /proc/sys/kernel/random/uuid | cut -c1-7)_720+\"" > /etc/synoinfo.conf 11 | 12 | rm -rf /tmp/luci-* 13 | exit 0 14 | -------------------------------------------------------------------------------- /luci-app-xunlei/root/etc/xunlei/.drive/请勿删除,本目录文件.txt: -------------------------------------------------------------------------------- 1 | 2 | 此目录存储为迅雷用户数据、配置以及任务数据,请勿删除 3 | -------------------------------------------------------------------------------- /luci-app-xunlei/root/usr/share/rpcd/acl.d/luci-app-xunlei.json: -------------------------------------------------------------------------------- 1 | { 2 | "luci-app-xunlei": { 3 | "description": "Grant UCI access for luci-app-xunlei", 4 | "read": { 5 | "uci": [ "xunlei" ] 6 | }, 7 | "write": { 8 | "uci": [ "xunlei" ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /nas-xunlei/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015-2016 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v3. 5 | # 6 | 7 | include $(TOPDIR)/rules.mk 8 | 9 | PKG_NAME:=nas-xunlei 10 | PKG_VERSION:=3.7.1-1 11 | PKG_RELEASE:=6 12 | STRIP:=false 13 | 14 | ifeq ($(ARCH),aarch64) 15 | BIN_HASH:=285c5b8156f775cf25531aa88e3e86d7df3883d692356fdd3eea58a0d566e39d 16 | endif 17 | 18 | ifeq ($(ARCH),x86_64) 19 | BIN_HASH:=37948aac57bbc5ef56e62fbde3b23b4f121f9d94854b88efa0c1f575dbb08e55 20 | endif 21 | 22 | PKG_MAINTAINER:=sbwml 23 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) 24 | include $(INCLUDE_DIR)/package.mk 25 | 26 | define Package/$(PKG_NAME) 27 | SECTION:=net 28 | CATEGORY:=Network 29 | SUBMENU:=Web Servers/Proxies 30 | TITLE:=nas-xunlei 31 | DEPENDS:=@(aarch64||x86_64) +USE_MUSL:libc6-compat +USE_GLIBC:libpthread +libgcc +libstdcpp 32 | URL:=https://nas.xunlei.com/ 33 | endef 34 | 35 | define Package/$(PKG_NAME)/description 36 | NAS Thunder download service 37 | endef 38 | 39 | define Package/$(PKG_NAME)/postrm 40 | #!/bin/sh 41 | rm -rf /usr/share/xunlei 42 | exit 0 43 | endef 44 | 45 | define Download/$(PKG_NAME) 46 | URL:=https://github.com/sbwml/nas-xunlei-binary/releases/download/v$(PKG_VERSION) 47 | URL_FILE:=$(ARCH)-v$(PKG_VERSION).tar.xz 48 | FILE:=nas-xunlei-$(ARCH)-v$(PKG_VERSION).tar.xz 49 | HASH:=$(BIN_HASH) 50 | endef 51 | 52 | define Build/Prepare 53 | $(call Build/Prepare/Default) 54 | $(eval $(call Download,$(PKG_NAME))) 55 | $(TAR) -xf $(DL_DIR)/nas-xunlei-$(ARCH)-v$(PKG_VERSION).tar.xz -C $(PKG_BUILD_DIR)/ 56 | endef 57 | 58 | define Build/Compile 59 | endef 60 | 61 | define Package/$(PKG_NAME)/install 62 | $(INSTALL_DIR) $(1)/usr/share/xunlei 63 | $(CP) $(PKG_BUILD_DIR)/bin $(1)/usr/share/xunlei/ 64 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/xunlei $(1)/usr/share/xunlei/xunlei 65 | 66 | $(INSTALL_DIR) $(1)/usr/syno/synoman/webman/modules 67 | $(INSTALL_BIN) $(CURDIR)/files/authenticate.cgi $(1)/usr/syno/synoman/webman/modules/authenticate.cgi 68 | 69 | ifeq ($(CONFIG_USE_MUSL),y) 70 | $(INSTALL_DIR) $(1)/usr/share/xunlei/hack 71 | $(CP) $(PKG_BUILD_DIR)/hack/libc.so.6 $(1)/usr/share/xunlei/hack/ 72 | $(CP) $(PKG_BUILD_DIR)/hack/libdl.so.2 $(1)/usr/share/xunlei/hack/ 73 | $(CP) $(PKG_BUILD_DIR)/hack/libm.so.6 $(1)/usr/share/xunlei/hack/ 74 | $(CP) $(PKG_BUILD_DIR)/hack/libpthread.so.0 $(1)/usr/share/xunlei/hack/ 75 | endif 76 | 77 | endef 78 | 79 | $(eval $(call BuildPackage,$(PKG_NAME))) 80 | -------------------------------------------------------------------------------- /nas-xunlei/files/authenticate.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ### hack authenticate 3 | echo "OK" 4 | -------------------------------------------------------------------------------- /nas-xunlei/src/hack/libc.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbwml/luci-app-xunlei/b093fec3ed8af5a03ced235599514ff7d785eea3/nas-xunlei/src/hack/libc.so.6 -------------------------------------------------------------------------------- /nas-xunlei/src/hack/libdl.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbwml/luci-app-xunlei/b093fec3ed8af5a03ced235599514ff7d785eea3/nas-xunlei/src/hack/libdl.so.2 -------------------------------------------------------------------------------- /nas-xunlei/src/hack/libm.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbwml/luci-app-xunlei/b093fec3ed8af5a03ced235599514ff7d785eea3/nas-xunlei/src/hack/libm.so.6 -------------------------------------------------------------------------------- /nas-xunlei/src/hack/libpthread.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sbwml/luci-app-xunlei/b093fec3ed8af5a03ced235599514ff7d785eea3/nas-xunlei/src/hack/libpthread.so.0 --------------------------------------------------------------------------------