From 859403f3cfd12ac238f89daedda02df9db463776 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 8 Mar 2020 13:54:49 +0800 Subject: [PATCH] Merge Lean's source --- package/lean/adbyby/Makefile | 7 +- package/lean/automount/Makefile | 4 +- package/lean/default-settings/Makefile | 2 +- package/lean/luci-app-ssr-plus/Makefile | 20 +-- .../root/etc/init.d/shadowsocksr | 22 +-- package/lean/luci-app-unblockmusic/Config.in | 3 +- package/lean/luci-app-unblockmusic/Makefile | 2 +- package/lean/openwrt-frp/Makefile | 127 +++++++----------- 8 files changed, 83 insertions(+), 104 deletions(-) diff --git a/package/lean/adbyby/Makefile b/package/lean/adbyby/Makefile index 20b9b8d448..5082ed88af 100644 --- a/package/lean/adbyby/Makefile +++ b/package/lean/adbyby/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adbyby PKG_VERSION:=2.7 -PKG_RELEASE:=20200307 +PKG_RELEASE:=20200308 include $(INCLUDE_DIR)/package.mk @@ -16,7 +16,7 @@ define Package/$(PKG_NAME) SECTION:=net CATEGORY:=Network TITLE:=Powerful adblock module to block ad. - DEPENDS:=@(x86||x86_64||arm||mipsel||mips) + DEPENDS:=@(x86||x86_64||arm||mipsel||mips||aarch64) URL:=http://www.adbyby.com/ endef @@ -45,6 +45,9 @@ ifeq ($(ARCH),arm) ADBYBY_DIR:=arm endif endif +ifeq ($(ARCH),aarch64) + ADBYBY_DIR:=armv7 +endif define Build/Prepare endef diff --git a/package/lean/automount/Makefile b/package/lean/automount/Makefile index fca993f47b..d059506ef6 100644 --- a/package/lean/automount/Makefile +++ b/package/lean/automount/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=automount PKG_VERSION:=1 -PKG_RELEASE:=29 +PKG_RELEASE:=30 PKG_ARCH:=all include $(INCLUDE_DIR)/package.mk @@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk define Package/automount TITLE:=Mount autoconfig hotplug script. MAINTAINER:=Lean - DEPENDS:=+block-mount +kmod-usb-storage +kmod-usb-storage-extras +kmod-fs-vfat +kmod-fs-ext4 +kmod-fs-exfat +ntfs-3g + DEPENDS:=+block-mount +kmod-usb-storage +kmod-usb-storage-extras +kmod-usb-storage-uas +kmod-fs-vfat +kmod-fs-ext4 +kmod-fs-exfat +ntfs-3g endef define Package/automount/description diff --git a/package/lean/default-settings/Makefile b/package/lean/default-settings/Makefile index 59f7ac31a1..c207da5284 100644 --- a/package/lean/default-settings/Makefile +++ b/package/lean/default-settings/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=default-settings PKG_VERSION:=1.1 -PKG_RELEASE:=52 +PKG_RELEASE:=53 PKG_LICENSE:=GPLv3 PKG_LICENSE_FILES:=LICENSE diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index 1f6563da80..ef0ec075a3 100644 --- a/package/lean/luci-app-ssr-plus/Makefile +++ b/package/lean/luci-app-ssr-plus/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ssr-plus -PKG_VERSION:=163 -PKG_RELEASE:=6 +PKG_VERSION:=164 +PKG_RELEASE:=2 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) @@ -11,27 +11,27 @@ include $(INCLUDE_DIR)/package.mk define Package/$(PKG_NAME)/config config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks bool "Include Shadowsocks New Version" - default y if x86_64 + default y if x86||x86_64||arm||aarch64 config PACKAGE_$(PKG_NAME)_INCLUDE_Simple_obfs bool "Include Shadowsocks Simple-obfs Plugin" - default y if x86_64 + default y if x86||x86_64||arm||aarch64 config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin bool "Include Shadowsocks V2ray Plugin" - default y if x86_64 + default y if x86||x86_64||arm||aarch64 config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray bool "Include V2ray" - default y if x86_64 + default y if x86||x86_64||arm||aarch64 config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan bool "Include Trojan" - default y if x86_64 + default y if x86||x86_64||arm||aarch64 config PACKAGE_$(PKG_NAME)_INCLUDE_Redsocks2 bool "Include Redsocks2" - default y if x86_64 + default y if x86||x86_64||arm||aarch64 config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun bool "Include Kcptun" @@ -39,11 +39,11 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server bool "Include ShadowsocksR Server" - default y if x86_64 + default y if x86||x86_64||arm||aarch64 config PACKAGE_$(PKG_NAME)_INCLUDE_DNS2SOCKS bool "Include DNS2SOCKS" - default y if x86_64 + default y if x86||x86_64||arm||aarch64 endef define Package/$(PKG_NAME) diff --git a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index 20f5b2cde0..14e0ffb709 100755 --- a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -90,7 +90,7 @@ gen_config_file() { { "server": "$hostip", "server_port": $(uci_get_by_name $1 server_port), - "local_address": "::", + "local_address": "0.0.0.0", "local_port": $(uci_get_by_name $1 local_port), "password": "$(uci_get_by_name $1 password)", "timeout": $(uci_get_by_name $1 timeout 60), @@ -111,7 +111,7 @@ gen_config_file() { { "server": "$hostip", "server_port": $(uci_get_by_name $1 server_port), - "local_address": "::", + "local_address": "0.0.0.0", "local_port": $(uci_get_by_name $1 local_port), "password": "$(uci_get_by_name $1 password)", "timeout": $(uci_get_by_name $1 timeout 60), @@ -360,7 +360,7 @@ start_redir() { lua /usr/share/shadowsocksr/gentrojanconfig.lua $GLOBAL_SERVER client 10801 >/var/etc/trojan-ssr-reudp.json sed -i 's/\\//g' /var/etc/trojan-ssr-reudp.json $ucmd --config /var/etc/trojan-ssr-reudp.json >/dev/null 2>&1 & - ipt2socks -U -b 0.0.0.0 -B :: -s 127.0.0.1 -p 10801 -l $(uci_get_by_name $UDP_RELAY_SERVER local_port) >/dev/null 2>&1 & + ipt2socks -U -b 0.0.0.0 -4 -s 127.0.0.1 -p 10801 -l $(uci_get_by_name $UDP_RELAY_SERVER local_port) >/dev/null 2>&1 & elif [ "$utype" == "socks5" ]; then /usr/share/shadowsocksr/genred2config.sh "/var/etc/redsocks-ssr-reudp.conf" socks5 udp $(uci_get_by_name $UDP_RELAY_SERVER local_port) $(uci_get_by_name $UDP_RELAY_SERVER server) $(uci_get_by_name $UDP_RELAY_SERVER server_port) \ $(uci_get_by_name $UDP_RELAY_SERVER auth_enable 0) $(uci_get_by_name $UDP_RELAY_SERVER username) $(uci_get_by_name $UDP_RELAY_SERVER password) @@ -412,7 +412,7 @@ gen_service_file() { fi cat <<-EOF >$2 { - "server": "::", + "server": "0.0.0.0", "server_port": $(uci_get_by_name $1 server_port), "password": "$(uci_get_by_name $1 password)", "timeout": $(uci_get_by_name $1 timeout 60), @@ -521,14 +521,9 @@ start() { else echo "conf-dir=/tmp/dnsmasq.oversea" > /tmp/dnsmasq.d/dnsmasq-ssr.conf fi - if [ -e "/tmp/dnsmasq.d/ad.conf" ]; then - rm -f /tmp/dnsmasq.d/ad.conf - fi if [ $(uci_get_by_type global adblock 0) == "0" ] ;then rm -f /tmp/dnsmasq.ssr/ad.conf fi - /usr/share/shadowsocksr/gfw2ipset.sh - /etc/init.d/dnsmasq restart >/dev/null 2>&1 fi fi start_server @@ -576,14 +571,21 @@ stop() { killall -q -9 dns2socks killall -q -9 microsocks killall -q -9 redsocks2 +<<<<<<< HEAD if [ $(uci_get_by_type global adblock 0) == "0" ]; then rm -f /tmp/dnsmasq.d/ad.conf else cp -f /etc/dnsmasq.ssr/ad.conf /tmp/dnsmasq.d/ad.conf +======= + if [ -f /var/run/pdnsd.pid ]; then + kill $(cat /var/run/pdnsd.pid) >/dev/null 2>&1 + else + kill -9 $(busybox ps -w | grep pdnsd | grep -v grep | awk '{print $1}') >/dev/null 2>&1 +>>>>>>> 19ec6b2511601e88ade445e807b199aafdda7933 fi if [ -f "/tmp/dnsmasq.d/dnsmasq-ssr.conf" ]; then rm -f /tmp/dnsmasq.d/dnsmasq-ssr.conf + /etc/init.d/dnsmasq restart >/dev/null 2>&1 fi - /etc/init.d/dnsmasq restart >/dev/null 2>&1 del_cron } diff --git a/package/lean/luci-app-unblockmusic/Config.in b/package/lean/luci-app-unblockmusic/Config.in index cf7c75c6ff..9dae2dc0f0 100644 --- a/package/lean/luci-app-unblockmusic/Config.in +++ b/package/lean/luci-app-unblockmusic/Config.in @@ -1,8 +1,9 @@ config UnblockNeteaseMusic_Go bool "UnblockNeteaseMusic Golang Version" - default y + default y if x86||x86_64||arm||aarch64 config UnblockNeteaseMusic_NodeJS bool "UnblockNeteaseMusic NodeJS Version" depends on HAS_FPU || KERNEL_MIPS_FPU_EMULATOR + default y if x86||x86_64||arm||aarch64 diff --git a/package/lean/luci-app-unblockmusic/Makefile b/package/lean/luci-app-unblockmusic/Makefile index 83d7d58df9..5ce784044d 100644 --- a/package/lean/luci-app-unblockmusic/Makefile +++ b/package/lean/luci-app-unblockmusic/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-unblockmusic PKG_VERSION:=2.3.1 -PKG_RELEASE:=36 +PKG_RELEASE:=38 PKG_CONFIG_DEPENDS := \ CONFIG_UnblockNeteaseMusic_Go \ diff --git a/package/lean/openwrt-frp/Makefile b/package/lean/openwrt-frp/Makefile index a16798971a..b6ae77de3d 100644 --- a/package/lean/openwrt-frp/Makefile +++ b/package/lean/openwrt-frp/Makefile @@ -1,95 +1,68 @@ # -# Copyright (C) 2015-2016 OpenWrt.org +# Copyright (C) 2019 Xingwang Liao # -# This is free software, licensed under the GNU General Public License v3. +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. # include $(TOPDIR)/rules.mk PKG_NAME:=openwrt-frp PKG_VERSION:=0.31.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 -ifeq ($(ARCH),mipsel) - FRPC_ARCH:=mipsle -endif -ifeq ($(ARCH),mips) - FRPC_ARCH:=mips -endif -ifeq ($(ARCH),i386) - FRPC_ARCH:=386 -endif -ifeq ($(ARCH),x86_64) - FRPC_ARCH:=amd64 -endif -ifeq ($(ARCH),arm) - FRPC_ARCH:=arm -endif -ifeq ($(ARCH),aarch64) - FRPC_ARCH:=arm64 -endif +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/fatedier/frp/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=790a18f5651cc645a3d73fc147c719f5b212fc21db0c51c620011ee836b7a28f PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Xingwang Liao -PKG_SOURCE_URL:=https://github.com/fatedier/frp/releases/download/v$(PKG_VERSION) -PKG_SOURCE:=frp_$(PKG_VERSION)_linux_$(FRPC_ARCH).tar.gz -PKG_BUILD_DIR:=$(BUILD_DIR)/frp_$(PKG_VERSION)_linux_$(FRPC_ARCH) -PKG_HASH:=skip +PKG_BUILD_DEPENDS:=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_USE_MIPS16:=0 + +GO_PKG:=github.com/fatedier/frp +GO_PKG_BUILD_PKG:=github.com/fatedier/frp/cmd/... + +GO_PKG_LDFLAGS:=-s -w include $(INCLUDE_DIR)/package.mk +include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk -define Package/$(PKG_NAME)/default - SECTION:=net - CATEGORY:=Network - TITLE:=FRP - URL:=https://github.com/fatedier/frp/releases +define openwrt-frp/templates + define Package/openwrt-$(1) + TITLE:=A fast reverse proxy ($(1)) + URL:=https://github.com/fatedier/frp + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + DEPENDS:=$$(GO_ARCH_DEPENDS) + endef + + define Package/openwrt-$(1)/description + frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall + to the internet. As of now, it supports tcp & udp, as well as httpand https protocols, + where requests can be forwarded to internal services by domain name. + + This package contains the $(1). + endef + + define Package/openwrt-$(1)/install + $$(call GoPackage/Package/Install/Bin,$$(PKG_INSTALL_DIR)) + + $(STAGING_DIR_HOST)/bin/upx --lzma --best $(PKG_INSTALL_DIR)/usr/bin/$(1) + + $$(INSTALL_DIR) $$(1)/usr/bin + $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/ + endef endef -define Package/$(PKG_NAME)s - $(call Package/$(PKG_NAME)/default) - TITLE+= (Server) - VARIANT:=s -endef +FRP_COMPONENTS:=frpc frps -define Package/$(PKG_NAME)c - $(call Package/$(PKG_NAME)/default) - TITLE+= (Client) - VARIANT:=c -endef - -define Package/$(PKG_NAME)/description -frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet -endef - -define Package/$(PKG_NAME)s/description - $(call Package/$(PKG_NAME)/description) -endef - -define Package/$(PKG_NAME)c/description - $(call Package/$(PKG_NAME)/description) -endef - -define Build/Prepare - $(PKG_UNPACK) -endef - -define Build/Configure - $(STAGING_DIR_HOST)/bin/upx --lzma --best $(PKG_BUILD_DIR)/frps - $(STAGING_DIR_HOST)/bin/upx --lzma --best $(PKG_BUILD_DIR)/frpc -endef - -define Build/Compile -endef - -define Package/$(PKG_NAME)s/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/frps $(1)/usr/bin/ -endef - -define Package/$(PKG_NAME)c/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/frpc $(1)/usr/bin/ -endef - -$(eval $(call BuildPackage,$(PKG_NAME)s)) -$(eval $(call BuildPackage,$(PKG_NAME)c)) +$(foreach component,$(FRP_COMPONENTS), \ + $(eval $(call openwrt-frp/templates,$(component))) \ + $(eval $(call GoBinPackage,$(component))) \ + $(eval $(call BuildPackage,$(component))) \ +)