Merge Mainline
This commit is contained in:
commit
b4ddfb0229
@ -7,12 +7,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=naiveproxy
|
||||
PKG_VERSION:=86.0.4240.75-1
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=87.0.4280.66-1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/klzgrad/naiveproxy/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=91f946e137565115649bc5787788a6889d84e0a20e9878553a832b89c0cb161f
|
||||
PKG_HASH:=17e79172fa32cb3b619614af989569aec7e866046f17e4a1b2179940f1915290
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=BSD 3-Clause
|
||||
@ -62,33 +62,42 @@ ifneq ($(CONFIG_CCACHE),)
|
||||
export naive_ccache_flags=cc_wrapper="ccache"
|
||||
endif
|
||||
|
||||
AFDO_VER:=86.0.4237.0_rc-r1-merged
|
||||
AFDO_VER:=87.0.4278.0_rc-r1-merged
|
||||
AFDO_FILE:=chromeos-chrome-amd64-$$(AFDO_VER).afdo.bz2
|
||||
define Download/AFDO_PROF
|
||||
URL:=https://storage.googleapis.com.cnpmjs.org/chromeos-prebuilt/afdo-job/llvm \
|
||||
https://storage.googleapis.com/chromeos-prebuilt/afdo-job/llvm
|
||||
URL_FILE:=$$(AFDO_FILE)
|
||||
FILE:=$$(URL_FILE)
|
||||
HASH:=d5730bd681766bcf4fd22c0e560ad500b2d6eb09164a9b80146cc327a156c98c
|
||||
URL_FILE:=$(AFDO_FILE)
|
||||
FILE:=$(AFDO_FILE)
|
||||
HASH:=7625590b588195918b30c63db20e06339132bbe8975f39e2e429b929682ee3ff
|
||||
endef
|
||||
|
||||
CLANG_VER:=llvmorg-12-init-3492-ga1caa302-1
|
||||
CLANG_VER:=llvmorg-12-init-5035-gd0abc757-3
|
||||
CLANG_FILE:=clang-$$(CLANG_VER).tgz
|
||||
define Download/CLANG
|
||||
URL:=https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64
|
||||
URL_FILE:=$$(CLANG_FILE)
|
||||
FILE:=$$(URL_FILE)
|
||||
HASH:=05df154999115386fb390a5ec7e6ca9e28aeae2ea1cbf76435247c0eee5b9ef3
|
||||
URL_FILE:=$(CLANG_FILE)
|
||||
FILE:=$(CLANG_FILE)
|
||||
HASH:=b0c3015209b6d624844ad230064eb5c9b4429a2eafd4854981e73217c563d93d
|
||||
endef
|
||||
|
||||
COLON:= :
|
||||
GN_VER:=git_revision$$(COLON)e327ffdc503815916db2543ec000226a8df45163
|
||||
GN_FILE:=gn-$$(GN_VER).zip
|
||||
GN_VER:=e002e68a48d1c82648eadde2f6aafa20d08c36f2
|
||||
GN_FILE:=gn-git_revision-$(GN_VER).zip
|
||||
define Download/GN_TOOL
|
||||
URL:=https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+
|
||||
URL_FILE:=$$(GN_VER)
|
||||
FILE:=$$(GN_FILE)
|
||||
HASH:=6d141b84a541e31ed7d3cd4d938987fdfa7988d5081d3089bc1509a43d6b742f
|
||||
URL_FILE:=git_revision:$(GN_VER)
|
||||
FILE:=$(GN_FILE)
|
||||
HASH:=67a733dc12803f61a0565ba3a390fa08576b2c4dc1d615c5c15c2b681e900675
|
||||
endef
|
||||
|
||||
PGO_VER:=4280-1605284980-f890b7d0344c87909c28619fe56e1dd48953d29e
|
||||
PGO_FILE:=chrome-linux-$(PGO_VER).profdata
|
||||
define Download/PGO_PROF
|
||||
URL:=https://storage.googleapis.com.cnpmjs.org/chromium-optimization-profiles/pgo_profiles \
|
||||
https://storage.googleapis.com/chromium-optimization-profiles/pgo_profiles
|
||||
URL_FILE:=$(PGO_FILE)
|
||||
FILE:=$(PGO_FILE)
|
||||
HASH:=8d87e67b84b2694776c931d8eabf0760144420718fe6a5352951fae38a3a25f6
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
@ -96,21 +105,24 @@ define Build/Prepare
|
||||
|
||||
( \
|
||||
cd $(PKG_BUILD_DIR)/src ; \
|
||||
bzip2 -cd > "chrome/android/profiles/afdo.prof" < $(DL_DIR)/$(AFDO_FILE) ; \
|
||||
bzip2 -cd > "chrome/android/profiles/afdo.prof" < "$(DL_DIR)/$(AFDO_FILE)" ; \
|
||||
mkdir -p "chrome/build/pgo_profiles" ; \
|
||||
$(CP) "$(DL_DIR)/$(PGO_FILE)" "chrome/build/pgo_profiles" ; \
|
||||
mkdir -p "third_party/llvm-build/Release+Asserts" ; \
|
||||
$(TAR) -xzf $(DL_DIR)/$(CLANG_FILE) -C "third_party/llvm-build/Release+Asserts" ; \
|
||||
$(TAR) -xzf "$(DL_DIR)/$(CLANG_FILE)" -C "third_party/llvm-build/Release+Asserts" ; \
|
||||
mkdir -p "gn/out" ; \
|
||||
unzip -o $(DL_DIR)/$(GN_FILE) -d "gn/out" ; \
|
||||
unzip -o "$(DL_DIR)/$(GN_FILE)" -d "gn/out" ; \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
( \
|
||||
cd $(PKG_BUILD_DIR)/src ; \
|
||||
cd "$(PKG_BUILD_DIR)/src" ; \
|
||||
. ../init_env.sh "$(ARCH)" "$(BOARD)" $(CPU_TYPE) $(CPU_SUBTYPE) "$(TOOLCHAIN_DIR)" ; \
|
||||
export naive_flags="$$$${naive_flags} pgo_data_path=\"$(PKG_BUILD_DIR)/src/chrome/build/pgo_profiles/$(PGO_FILE)\"" ; \
|
||||
export naive_flags="$$$${naive_flags} $$$${naive_ccache_flags}" ; \
|
||||
export OP_STAGING_DIR="$(STAGING_DIR)" ; \
|
||||
mkdir -p out ; \
|
||||
mkdir -p "out" ; \
|
||||
./gn/out/gn gen "out/Release" --args="$$$${naive_flags}" --script-executable="$(STAGING_DIR_HOSTPKG)/bin/python3" ; \
|
||||
$(STAGING_DIR_HOSTPKG)/bin/ninja -C "out/Release" naive ; \
|
||||
)
|
||||
@ -131,5 +143,6 @@ endef
|
||||
$(eval $(call Download,AFDO_PROF))
|
||||
$(eval $(call Download,CLANG))
|
||||
$(eval $(call Download,GN_TOOL))
|
||||
$(eval $(call Download,PGO_PROF))
|
||||
|
||||
$(eval $(call BuildPackage,naiveproxy))
|
||||
|
||||
@ -10,7 +10,7 @@ Subject: [PATCH] build: add OpenWrt staging libraries
|
||||
--- a/src/build/config/posix/BUILD.gn
|
||||
+++ b/src/build/config/posix/BUILD.gn
|
||||
@@ -28,6 +28,9 @@ config("runtime_library") {
|
||||
if (!is_mac && !is_ios && sysroot != "") {
|
||||
if (!is_apple && sysroot != "") {
|
||||
# Pass the sysroot to all C compiler variants, the assembler, and linker.
|
||||
sysroot_flags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ]
|
||||
+ sysroot_flags += [ "-I" + getenv("OP_STAGING_DIR") + "/usr/include" ]
|
||||
|
||||
@ -17,7 +17,7 @@ So, let's drop it in global build file.
|
||||
|
||||
--- a/src/BUILD.gn
|
||||
+++ b/src/BUILD.gn
|
||||
@@ -751,7 +751,6 @@ group("gn_all") {
|
||||
@@ -754,7 +754,6 @@ group("gn_all") {
|
||||
if (enable_nacl) {
|
||||
deps += [ "//native_client/src/trusted/platform_qualify:vcpuid" ]
|
||||
}
|
||||
|
||||
@ -21,12 +21,16 @@ ldso_path="/lib/$(find "${toolchain_dir}/" | grep -Eo "ld-musl-[a-z0-9_-]+\\.so\
|
||||
# OS detection
|
||||
[ "$(uname)" != "Linux" -o "$(uname -m)" != "x86_64" ] && { echo -e "Support Linux AMD64 only."; exit 1; }
|
||||
|
||||
# Create TMP dir
|
||||
mkdir -p "$PWD/tmp"
|
||||
export TMPDIR="$PWD/tmp"
|
||||
|
||||
# Set ENV
|
||||
export DEPOT_TOOLS_WIN_TOOLCHAIN=0
|
||||
export naive_flags="
|
||||
is_official_build=true
|
||||
exclude_unwind_tables=true
|
||||
enable_resource_whitelist_generation=false
|
||||
enable_resource_allowlist_generation=false
|
||||
symbol_level=0
|
||||
is_clang=true
|
||||
use_sysroot=false
|
||||
@ -56,6 +60,7 @@ use_pangocairo=false
|
||||
use_glib=false
|
||||
use_pulseaudio=false
|
||||
use_udev=false
|
||||
use_x11=false
|
||||
|
||||
disable_file_support=true
|
||||
enable_websockets=false
|
||||
@ -67,6 +72,7 @@ include_transport_security_state_preload_list=false
|
||||
rtc_use_pipewire=false
|
||||
|
||||
use_xkbcommon=false
|
||||
use_system_libdrm=false
|
||||
use_ozone=true
|
||||
ozone_auto_platforms=false
|
||||
ozone_platform=\"headless\"
|
||||
|
||||
@ -1,16 +1,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-ssr-plus
|
||||
PKG_VERSION:=181
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=180
|
||||
PKG_RELEASE:=10
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/shadowsocksr
|
||||
/etc/ssr/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin
|
||||
bool "Include Shadowsocks V2ray Plugin"
|
||||
|
||||
@ -99,7 +99,7 @@ function refresh_data()
|
||||
if type == "gfw_data" or type == "ad_data" then
|
||||
luci.sys.exec("/usr/share/shadowsocksr/gfw2ipset.sh")
|
||||
else
|
||||
luci.sys.exec("/usr/share/shadowsocksr/chinaipset.sh /tmp/etc/china_ssr.txt")
|
||||
luci.sys.exec("/etc/init.d/shadowsocksr restart &")
|
||||
end
|
||||
end
|
||||
else
|
||||
@ -111,7 +111,7 @@ function refresh_data()
|
||||
update(uci:get_first("shadowsocksr", "global", "gfwlist_url", "https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt"), "/etc/ssr/gfw_list.conf", set, "/tmp/dnsmasq.ssr/gfw_list.conf")
|
||||
end
|
||||
if set == "ip_data" then
|
||||
update(uci:get_first("shadowsocksr", "global", "chnroute_url","https://ispip.clang.cn/all_cn.txt"), "/etc/ssr/china_ssr.txt", set, "/tmp/etc/china_ssr.txt")
|
||||
update(uci:get_first("shadowsocksr", "global", "chnroute_url","https://ispip.clang.cn/all_cn.txt"), "/etc/ssr/china_ssr.txt", set)
|
||||
end
|
||||
if set == "ad_data" then
|
||||
update(uci:get_first("shadowsocksr", "global", "adblock_url","https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt"), "/etc/ssr/ad.conf", set, "/tmp/dnsmasq.ssr/ad.conf")
|
||||
|
||||
@ -56,10 +56,9 @@ o:depends("adblock", "1")
|
||||
o.description = translate("Support AdGuardHome and DNSMASQ format list")
|
||||
|
||||
o = s:option(Value, "gfwlist_url", translate("gfwlist Update url"))
|
||||
o:value("https://cdn.jsdelivr.net/gh/v2fly/domain-list-community@release/gfwlist.txt", translate("v2fly/domain-list-community"))
|
||||
o:value("https://cdn.jsdelivr.net/gh/Loukky/gfwlist-by-loukky/gfwlist.txt", translate("Loukky/gfwlist-by-loukky"))
|
||||
o:value("https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt", translate("gfwlist/gfwlist"))
|
||||
o.default = "https://cdn.jsdelivr.net/gh/v2fly/domain-list-community@release/gfwlist.txt"
|
||||
o.default = "https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt"
|
||||
|
||||
o = s:option(Value, "chnroute_url", translate("Chnroute Update url"))
|
||||
o:value("https://ispip.clang.cn/all_cn.txt", translate("Clang.CN"))
|
||||
|
||||
@ -380,10 +380,6 @@ o:depends("transport", "kcp")
|
||||
o.default = 2
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(Value, "seed", translate("Obfuscate password (optional)"))
|
||||
o:depends("transport", "kcp")
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(Flag, "congestion", translate("Congestion"))
|
||||
o:depends("transport", "kcp")
|
||||
o.rmempty = true
|
||||
|
||||
@ -101,7 +101,6 @@ o:value("114.114.115.115:53", translate("Oversea Mode DNS-2 (114.114.115.115)"))
|
||||
o:depends("pdnsd_enable", "1")
|
||||
o:depends("pdnsd_enable", "2")
|
||||
o.description = translate("Custom DNS Server format as IP:PORT (default: 8.8.4.4:53)")
|
||||
o.default = "8.8.4.4:53"
|
||||
|
||||
return m
|
||||
|
||||
|
||||
@ -24,7 +24,6 @@ o:value("0", translate("Disable"))
|
||||
o:value("w", translate("Allow listed only"))
|
||||
o:value("b", translate("Allow all except listed"))
|
||||
o.rmempty = false
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("lan_ac", DynamicList, "lan_ac_ips", translate("LAN Host List"))
|
||||
o.datatype = "ipaddr"
|
||||
|
||||
@ -54,7 +54,6 @@ sec.anonymous = true
|
||||
|
||||
o = sec:option(Flag, "enable_server", translate("Enable Server"))
|
||||
o.rmempty = false
|
||||
o.default = "0"
|
||||
|
||||
-- [[ Server Setting ]]--
|
||||
sec = m:section(TypedSection, "server_config", translate("Server Setting"))
|
||||
|
||||
@ -20,7 +20,6 @@ s.anonymous = true
|
||||
o = s:option(Flag, "auto_update", translate("Auto Update"))
|
||||
o.rmempty = false
|
||||
o.description = translate("Auto Update Server subscription, GFW list and CHN route")
|
||||
o.default = "1"
|
||||
|
||||
|
||||
o = s:option(ListValue, "auto_update_time", translate("Update time (every day)"))
|
||||
@ -36,7 +35,6 @@ o.rmempty = true
|
||||
o = s:option(Value, "filter_words", translate("Subscribe Filter Words"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Filter Words splited by /")
|
||||
o.default = "过期时间/剩余流量/QQ群/官网/防失联地址/回国"
|
||||
|
||||
o = s:option(Button,"update_Sub",translate("Update Subscribe List"))
|
||||
o.inputstyle = "reload"
|
||||
@ -53,7 +51,6 @@ o.default="1"
|
||||
o = s:option(Flag, "proxy", translate("Through proxy update"))
|
||||
o.rmempty = false
|
||||
o.description = translate("Through proxy update list, Not Recommended ")
|
||||
o.default="0"
|
||||
|
||||
|
||||
o = s:option(Button,"subscribe", translate("Update All Subscribe Severs"))
|
||||
|
||||
@ -684,6 +684,3 @@ msgstr "警告!请不要重复使用端口!"
|
||||
|
||||
msgid "Deny Domain List"
|
||||
msgstr "禁止连接的域名"
|
||||
|
||||
msgid "Obfuscate password (optional)"
|
||||
msgstr "混淆密码(可选)"
|
||||
|
||||
@ -1,22 +1,23 @@
|
||||
|
||||
config global
|
||||
option global_server 'nil'
|
||||
option netflix_server 'nil'
|
||||
option netflix_proxy '0'
|
||||
option threads '0'
|
||||
option tunnel_forward '8.8.4.4:53'
|
||||
option tunnel_address '0.0.0.0'
|
||||
option run_mode 'router'
|
||||
option dports '2'
|
||||
option pdnsd_enable '1'
|
||||
option tunnel_forward '8.8.4.4:53'
|
||||
option monitor_enable '1'
|
||||
option enable_switch '1'
|
||||
option switch_time '667'
|
||||
option switch_timeout '5'
|
||||
option switch_time '667'
|
||||
option switch_try_count '3'
|
||||
option gfwlist_url 'https://cdn.jsdelivr.net/gh/v2fly/domain-list-community@release/gfwlist.txt'
|
||||
option gfwlist_url 'https://cdn.jsdelivr.net/gh/Loukky/gfwlist-by-loukky/gfwlist.txt'
|
||||
option chnroute_url 'https://ispip.clang.cn/all_cn.txt'
|
||||
option nfip_url 'https://cdn.jsdelivr.net/gh/QiuSimons/Netflix_IP/getflix.txt'
|
||||
option adblock_url 'https://anti-ad.net/anti-ad-for-dnsmasq.conf'
|
||||
option threads '0'
|
||||
option global_server 'disable'
|
||||
option netflix_server 'nil'
|
||||
option netflix_proxy '0'
|
||||
|
||||
config access_control
|
||||
option lan_ac_mode '0'
|
||||
@ -27,15 +28,16 @@ config access_control
|
||||
list wan_fw_ips '91.108.56.0/22'
|
||||
list wan_fw_ips '109.239.140.0/24'
|
||||
|
||||
config socks5_proxy
|
||||
option socks '0'
|
||||
option local_port '1080'
|
||||
option local_address '0.0.0.0'
|
||||
|
||||
config server_global
|
||||
option enable_server '0'
|
||||
|
||||
config server_subscribe
|
||||
option proxy '0'
|
||||
option auto_update_time '2'
|
||||
option auto_update '1'
|
||||
option filter_words '过期时间/剩余流量/QQ群/官网/防失联地址/回国'
|
||||
|
||||
config socks5_proxy
|
||||
option socks '0'
|
||||
option local_port '1080'
|
||||
|
||||
config server_global
|
||||
option enable_server '0'
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
START=95
|
||||
STOP=15
|
||||
SERVICE_DAEMONIZE=1
|
||||
EXTRA_COMMANDS=rules
|
||||
MAXFD=32768
|
||||
NAME=shadowsocksr
|
||||
LOCK_FILE=/var/lock/${NAME}.lock
|
||||
@ -30,11 +31,6 @@ switch_enable=0
|
||||
switch_server=$1
|
||||
CRON_FILE=/etc/crontabs/root
|
||||
threads=1
|
||||
GLOBAL_SERVER="nil"
|
||||
NETFLIX_SERVER="nil"
|
||||
UDP_RELAY_SERVER="nil"
|
||||
run_mode="router"
|
||||
kcp_server=""
|
||||
|
||||
uci_get_by_name() {
|
||||
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
|
||||
@ -63,10 +59,14 @@ uci_get_by_cfgid() {
|
||||
|
||||
get_host_ip() {
|
||||
local host=$1
|
||||
local ip=$1
|
||||
if [ -z "$(echo $1 | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}")" ]; then
|
||||
if [ "$1" == "${1#*:[0-9a-fA-F]}" ]; then
|
||||
ip=$(resolveip -4 -t 3 $1 | awk 'NR==1{print}')
|
||||
local isip=""
|
||||
local ip=$host
|
||||
isip=$(echo $host | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}")
|
||||
if [ -z "$isip" ]; then
|
||||
if [ "$host" != "${host#*:[0-9a-fA-F]}" ]; then
|
||||
ip=$host
|
||||
else
|
||||
local ip=$(resolveip -4 -t 3 $host | awk 'NR==1{print}')
|
||||
[ -z "$ip" ] && ip=$(wget -q -O- http://119.29.29.29/d?dn=$1 | awk -F ';' '{print $1}')
|
||||
fi
|
||||
fi
|
||||
@ -129,8 +129,9 @@ gen_config_file() {
|
||||
else
|
||||
uci_set_by_name $1 ip $hostip
|
||||
fi
|
||||
[ "$2" == "0" -a "$kcp_flag" == "1" ] && hostip="127.0.0.1"
|
||||
case "$2" in
|
||||
0) config_file=$CONFIG_FILE && [ "$kcp_flag" == "1" ] && hostip="127.0.0.1" ;;
|
||||
0) config_file=$CONFIG_FILE ;;
|
||||
1) config_file=$CONFIG_UDP_FILE ;;
|
||||
2) config_file=$CONFIG_NETFLIX_FILE ;;
|
||||
*) config_file=$CONFIG_SOCK5_FILE ;;
|
||||
@ -186,11 +187,11 @@ gen_config_file() {
|
||||
EOF
|
||||
;;
|
||||
v2ray | vless)
|
||||
lua /usr/share/shadowsocksr/gen${type}config.lua $GLOBAL_SERVER tcp $3 >/var/etc/v2-ssr-retcp.json
|
||||
lua /usr/share/shadowsocksr/gen${type}config.lua $GLOBAL_SERVER tcp $(uci_get_by_name $1 local_port) >/var/etc/v2-ssr-retcp.json
|
||||
sed -i 's/\\//g' /var/etc/v2-ssr-retcp.json
|
||||
;;
|
||||
trojan)
|
||||
lua /usr/share/shadowsocksr/gentrojanconfig.lua $GLOBAL_SERVER nat $3 >/var/etc/trojan-ssr-retcp.json
|
||||
lua /usr/share/shadowsocksr/gentrojanconfig.lua $GLOBAL_SERVER nat $(uci_get_by_name $1 local_port) >/var/etc/trojan-ssr-retcp.json
|
||||
sed -i 's/\\//g' /var/etc/trojan-ssr-retcp.json
|
||||
;;
|
||||
naiveproxy)
|
||||
@ -262,6 +263,7 @@ start_dns() {
|
||||
local usr_port="$2"
|
||||
[ -z "$usr_dns" ] && usr_dns="8.8.8.8"
|
||||
[ -z "$usr_port" ] && usr_port="53"
|
||||
[ -d /var/etc ] || mkdir -p /var/etc
|
||||
if [ ! -f "/var/pdnsd/pdnsd.cache" ]; then
|
||||
mkdir -p /var/pdnsd
|
||||
touch /var/pdnsd/pdnsd.cache
|
||||
@ -297,23 +299,21 @@ start_dns() {
|
||||
EOF
|
||||
/usr/sbin/pdnsd -c /var/etc/pdnsd.conf >/dev/null 2>&1 &
|
||||
}
|
||||
ipset_add_dns() {
|
||||
if [ "$ssr_dns" != "0" ]; then
|
||||
case "$run_mode" in
|
||||
gfw) ipset add gfwlist $dnsserver 2>/dev/null ;;
|
||||
oversea) ipset add oversea $dnsserver 2>/dev/null ;;
|
||||
*) ipset add ss_spec_wan_ac $dnsserver nomatch 2>/dev/null ;;
|
||||
esac
|
||||
}
|
||||
fi
|
||||
case "$ssr_dns" in
|
||||
1)
|
||||
start_pdnsd $dnsserver $dnsport
|
||||
ipset_add_dns
|
||||
pdnsd_enable_flag=1
|
||||
;;
|
||||
2)
|
||||
microsocks -i 127.0.0.1 -p 10802 ssr-dns >/dev/null 2>&1 &
|
||||
dns2socks 127.0.0.1:10802 $dnsserver:$dnsport 127.0.0.1:5335 -q >/dev/null 2>&1 &
|
||||
ipset_add_dns
|
||||
pdnsd_enable_flag=2
|
||||
;;
|
||||
esac
|
||||
@ -398,7 +398,6 @@ start_redir_udp() {
|
||||
redir_udp=1
|
||||
local type=$(uci_get_by_name $UDP_RELAY_SERVER type)
|
||||
local bin=$(find_bin $type)
|
||||
local udp_port=1357
|
||||
[ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") UDP TPROXY Relay:Can't find $bin program, can't start!" >>/tmp/ssrplus.log && redir_udp=0 && return 1
|
||||
case "$type" in
|
||||
ss | ssr)
|
||||
@ -408,13 +407,13 @@ start_redir_udp() {
|
||||
esac
|
||||
local name="Shadowsocks"
|
||||
[ "$type" == "ssr" ] && name="ShadowsocksR"
|
||||
gen_config_file $UDP_RELAY_SERVER 1 $udp_port
|
||||
gen_config_file $UDP_RELAY_SERVER 1 $(uci_get_by_name $UDP_RELAY_SERVER local_port 1234)
|
||||
last_config_file=$CONFIG_UDP_FILE
|
||||
$bin -c $last_config_file $ARG_OTA -U -f /var/run/ssr-reudp.pid >/dev/null 2>&1
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") UDP TPROXY Relay:$name Started!" >>/tmp/ssrplus.log
|
||||
;;
|
||||
v2ray | vless)
|
||||
lua /usr/share/shadowsocksr/gen${type}config.lua $UDP_RELAY_SERVER udp $udp_port >/var/etc/v2-ssr-reudp.json
|
||||
lua /usr/share/shadowsocksr/gen${type}config.lua $UDP_RELAY_SERVER udp $(uci_get_by_name $UDP_RELAY_SERVER local_port) >/var/etc/v2-ssr-reudp.json
|
||||
sed -i 's/\\//g' /var/etc/v2-ssr-reudp.json
|
||||
$bin -config /var/etc/v2-ssr-reudp.json >/dev/null 2>&1 &
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") UDP TPROXY Relay:$($bin -version | head -1) Started!" >>/tmp/ssrplus.log
|
||||
@ -423,7 +422,7 @@ start_redir_udp() {
|
||||
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
|
||||
$bin --config /var/etc/trojan-ssr-reudp.json >/dev/null 2>&1 &
|
||||
ipt2socks -U -b 0.0.0.0 -4 -s 127.0.0.1 -p 10801 -l $udp_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 &
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") UDP TPROXY Relay:$($bin --version 2>&1 | head -1) Started!" >>/tmp/ssrplus.log
|
||||
;;
|
||||
naiveproxy)
|
||||
@ -431,7 +430,7 @@ start_redir_udp() {
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") $($bin --version | head -1) UDP TPROXY Relay not supported!" >>/tmp/ssrplus.log
|
||||
;;
|
||||
socks5)
|
||||
/usr/share/shadowsocksr/genred2config.sh "/var/etc/redsocks-ssr-reudp.conf" socks5 udp $udp_port \
|
||||
/usr/share/shadowsocksr/genred2config.sh "/var/etc/redsocks-ssr-reudp.conf" socks5 udp $(uci_get_by_name $UDP_RELAY_SERVER local_port) \
|
||||
$(get_host_ip $(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)
|
||||
$bin -c /var/etc/redsocks-ssr-reudp.conf >/dev/null 2>&1
|
||||
@ -512,8 +511,8 @@ start_shunt() {
|
||||
|
||||
start_local() {
|
||||
local local_server=$(uci_get_by_type socks5_proxy server nil)
|
||||
[ "$local_server" == "same" ] && local_server=$GLOBAL_SERVER
|
||||
[ "$local_server" == "nil" ] && return 1
|
||||
[ "$local_server" == "same" ] && local_server=$GLOBAL_SERVER
|
||||
local type=$(uci_get_by_name $local_server type)
|
||||
local bin=$(find_bin $type)
|
||||
[ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") Global_Socks5:Can't find $bin program, can't start!" >>/tmp/ssrplus.log && local_enable=0 && return 1
|
||||
@ -581,6 +580,7 @@ start_server() {
|
||||
iptables -t filter -A SSR-SERVER-RULE -p udp --dport $(uci_get_by_name $1 server_port) -j ACCEPT
|
||||
return 0
|
||||
}
|
||||
mkdir -p /var/run /var/etc
|
||||
config_load $NAME
|
||||
config_foreach server_service server_config
|
||||
gen_serv_include
|
||||
@ -626,76 +626,64 @@ check_server() {
|
||||
}
|
||||
|
||||
start_rules() {
|
||||
if [ -z "$switch_server" ]; then
|
||||
GLOBAL_SERVER=$(uci_get_by_type global global_server nil)
|
||||
else
|
||||
GLOBAL_SERVER=$switch_server
|
||||
switch_enable=1
|
||||
fi
|
||||
[ "$GLOBAL_SERVER" == "nil" ] && return 1
|
||||
local server=$(get_host_ip $(uci_get_by_name $GLOBAL_SERVER server))
|
||||
[ "$server" == "ERROR" ] && server=$(uci_get_by_name $GLOBAL_SERVER ip)
|
||||
local local_port=$(uci_get_by_name $GLOBAL_SERVER local_port 1234)
|
||||
local netflix="0"
|
||||
NETFLIX_SERVER=$(uci_get_by_type global netflix_server nil)
|
||||
if [ "$NETFLIX_SERVER" != "nil" ]; then
|
||||
if [ "$NETFLIX_SERVER" == "same" ]; then
|
||||
netflix="2"
|
||||
NETFLIX_SERVER=$GLOBAL_SERVER
|
||||
else
|
||||
netflix="1"
|
||||
fi
|
||||
if [ "$server" == "ERROR" ]; then
|
||||
server=$(uci_get_by_name $GLOBAL_SERVER ip)
|
||||
fi
|
||||
netflix_ip=$(get_host_ip $(uci_get_by_name $NETFLIX_SERVER server))
|
||||
if [ "$netflix_ip" == "ERROR" ]; then
|
||||
netflix_ip=$(uci_get_by_name $NETFLIX_SERVER ip)
|
||||
fi
|
||||
UDP_RELAY_SERVER=$(uci_get_by_type global udp_relay_server)
|
||||
[ "$UDP_RELAY_SERVER" == "same" ] && UDP_RELAY_SERVER=$GLOBAL_SERVER
|
||||
if [ "$(uci_get_by_name $GLOBAL_SERVER kcp_enable 0)" == "1" ]; then
|
||||
local kcp_enable=$(uci_get_by_name $GLOBAL_SERVER kcp_enable 0)
|
||||
if [ $kcp_enable == "1" ]; then
|
||||
kcp_server=$server
|
||||
kcp_flag=1
|
||||
fi
|
||||
if [ -n "$UDP_RELAY_SERVER" ]; then
|
||||
if [ "$kcp_flag" == "0" ]; then
|
||||
local type=$(uci_get_by_name $UDP_RELAY_SERVER type)
|
||||
case "$type" in
|
||||
tun | naiveproxy) local ARG_UDP="";;
|
||||
*) local ARG_UDP="-U";;
|
||||
esac
|
||||
local udp_server=$(get_host_ip $(uci_get_by_name $UDP_RELAY_SERVER server))
|
||||
local udp_local_port=1357
|
||||
fi
|
||||
fi
|
||||
local local_port=$(uci_get_by_name $GLOBAL_SERVER local_port)
|
||||
local lan_ac_ips=$(uci_get_by_type access_control lan_ac_ips)
|
||||
local lan_ac_mode=$(uci_get_by_type access_control lan_ac_mode)
|
||||
local router_proxy=$(uci_get_by_type access_control router_proxy)
|
||||
if [ "$GLOBAL_SERVER" == "$UDP_RELAY_SERVER" -a "$kcp_flag" == "0" ]; then
|
||||
ARG_UDP="-u"
|
||||
elif [ -n "$UDP_RELAY_SERVER" ]; then
|
||||
ARG_UDP="-U"
|
||||
local udp_server=$(uci_get_by_name $UDP_RELAY_SERVER server)
|
||||
local udp_local_port=$(uci_get_by_name $UDP_RELAY_SERVER local_port)
|
||||
fi
|
||||
if [ -n "$lan_ac_ips" ]; then
|
||||
case "$lan_ac_mode" in
|
||||
w | W | b | B) local ac_ips="$lan_ac_mode$lan_ac_ips" ;;
|
||||
esac
|
||||
fi
|
||||
get_proxyport() {
|
||||
local dports=$(uci_get_by_type global dports 1)
|
||||
case "$dports" in
|
||||
1) echo "" ;;
|
||||
2) echo "-m multiport --dports 22,53,587,465,995,993,143,80,443,853" ;;
|
||||
esac
|
||||
}
|
||||
run_mode=$(uci_get_by_type global run_mode router)
|
||||
get_mode() {
|
||||
case "$run_mode" in
|
||||
gfw) echo "-g" ;;
|
||||
router) echo "-r" ;;
|
||||
oversea) echo "-c" ;;
|
||||
all) echo "-z" ;;
|
||||
esac
|
||||
}
|
||||
#deal gfw firewall rule
|
||||
local gfwmode=""
|
||||
case "$run_mode" in
|
||||
gfw) gfwmode="-g" ;;
|
||||
router) gfwmode="-r" ;;
|
||||
oversea) gfwmode="-c" ;;
|
||||
all) gfwmode="-z" ;;
|
||||
esac
|
||||
local dports=$(uci_get_by_type global dports 1)
|
||||
if [ $dports == "1" ]; then
|
||||
proxyport=" "
|
||||
else
|
||||
proxyport="-m multiport --dports 22,53,587,465,995,993,143,80,443,853"
|
||||
fi
|
||||
if [ "$NETFLIX_SERVER" != "nil" ]; then
|
||||
if [ "$NETFLIX_SERVER" != "$GLOBAL_SERVER" ]; then
|
||||
netflix="1"
|
||||
else
|
||||
netflix="2"
|
||||
fi
|
||||
else
|
||||
netflix="0"
|
||||
fi
|
||||
get_arg_out() {
|
||||
case "$(uci_get_by_type access_control router_proxy 1)" in
|
||||
1) echo "-o" ;;
|
||||
2) echo "-O" ;;
|
||||
esac
|
||||
}
|
||||
netflix_ip=$(get_host_ip $(uci_get_by_name $NETFLIX_SERVER server))
|
||||
if [ "$netflix_ip" == "ERROR" ]; then
|
||||
netflix_ip=$(uci_get_by_name $NETFLIX_SERVER ip)
|
||||
fi
|
||||
/usr/bin/ssr-rules \
|
||||
-s "$server" \
|
||||
-l "$local_port" \
|
||||
@ -708,30 +696,61 @@ start_rules() {
|
||||
-B "$(uci_get_by_type access_control lan_bp_ips)" \
|
||||
-p "$(uci_get_by_type access_control lan_fp_ips)" \
|
||||
-G "$(uci_get_by_type access_control lan_gm_ips)" \
|
||||
-D "$(get_proxyport)" \
|
||||
-D "$proxyport" \
|
||||
-F "$netflix" \
|
||||
-N "$netflix_ip" \
|
||||
-M "$(uci_get_by_type global netflix_proxy 0)" \
|
||||
-I "/etc/ssr/netflixip.list" \
|
||||
$(get_arg_out) $(get_mode) $ARG_UDP
|
||||
$(get_arg_out) $gfwmode $ARG_UDP
|
||||
return $?
|
||||
}
|
||||
|
||||
rules() {
|
||||
if [ "$GLOBAL_SERVER" == "nil" ]; then
|
||||
return 1
|
||||
fi
|
||||
mkdir -p /var/run /var/etc
|
||||
run_mode=$(uci_get_by_type global run_mode)
|
||||
UDP_RELAY_SERVER=$(uci_get_by_type global udp_relay_server)
|
||||
[ "$UDP_RELAY_SERVER" == "same" ] && UDP_RELAY_SERVER=$GLOBAL_SERVER
|
||||
if start_rules; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
[ -f "$LOCK_FILE" ] && exit 2
|
||||
touch "$LOCK_FILE"
|
||||
echo "----------start------------" >>/tmp/ssrplus.log
|
||||
mkdir -p /tmp/dnsmasq.d /tmp/dnsmasq.ssr /var/run /var/etc
|
||||
echo "-----------start-----------" >>/tmp/ssrplus.log
|
||||
if [ -z "$switch_server" ]; then
|
||||
GLOBAL_SERVER=$(uci_get_by_type global global_server nil)
|
||||
else
|
||||
GLOBAL_SERVER=$switch_server
|
||||
switch_enable=1
|
||||
fi
|
||||
NETFLIX_SERVER=$(uci_get_by_type global netflix_server nil)
|
||||
if [ "$NETFLIX_SERVER" == "same" ]; then
|
||||
NETFLIX_SERVER=$GLOBAL_SERVER
|
||||
fi
|
||||
mkdir -p /tmp/dnsmasq.d /tmp/dnsmasq.ssr
|
||||
cat <<-EOF >/tmp/dnsmasq.d/dnsmasq-ssr.conf
|
||||
conf-dir=/tmp/dnsmasq.ssr
|
||||
EOF
|
||||
if start_rules; then
|
||||
if rules; then
|
||||
if start_redir_tcp; then
|
||||
start_redir_udp
|
||||
start_shunt
|
||||
start_switch
|
||||
start_dns
|
||||
add_cron
|
||||
if [ "$run_mode" == "oversea" ]; then
|
||||
cp -rf /etc/ssr/oversea_list.conf /tmp/dnsmasq.ssr/
|
||||
else
|
||||
cp -rf /etc/ssr/gfw_list.conf /tmp/dnsmasq.ssr/
|
||||
cp -rf /etc/ssr/gfw_base.conf /tmp/dnsmasq.ssr/
|
||||
fi
|
||||
/usr/share/shadowsocksr/gfw2ipset.sh $switch_server
|
||||
else
|
||||
/usr/bin/ssr-rules -f
|
||||
@ -753,15 +772,13 @@ start() {
|
||||
start_monitor
|
||||
check_server
|
||||
clean_log
|
||||
echo "-----------end------------" >>/tmp/ssrplus.log
|
||||
echo "------------end------------" >>/tmp/ssrplus.log
|
||||
rm -f $LOCK_FILE
|
||||
}
|
||||
|
||||
boot() {
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") boot!" >/tmp/ssrplus.log
|
||||
ulimit -n 65535
|
||||
/usr/share/shadowsocksr/chinaipset.sh
|
||||
start >/dev/null 2>&1
|
||||
(/usr/share/shadowsocksr/chinaipset.sh && sleep 3 && start >/dev/null 2>&1) &
|
||||
}
|
||||
|
||||
stop() {
|
||||
@ -782,7 +799,7 @@ stop() {
|
||||
ps -w | grep -v "grep" | grep "sleep $(uci_get_by_type global switch_time)s" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 &
|
||||
ps -w | grep -v "grep" | grep "sleep 30s" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 &
|
||||
killall -q -9 ss-redir ss-local obfs-local ssr-redir ssr-local ssr-server v2ray v2ray-plugin trojan naive microsocks ipt2socks dns2socks redsocks2 pdnsd
|
||||
rm -f /var/lock/ssr-monitor.lock
|
||||
rm -f /var/lock/ssr-chinaipset.lock /var/lock/ssr-monitor.lock
|
||||
if [ -f "/tmp/dnsmasq.d/dnsmasq-ssr.conf" ]; then
|
||||
rm -rf /tmp/dnsmasq.d/dnsmasq-ssr.conf /tmp/dnsmasq.ssr /tmp/dnsmasq.oversea
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
|
||||
@ -264,7 +264,6 @@
|
||||
42.242.0.0/15
|
||||
42.244.0.0/14
|
||||
42.248.0.0/13
|
||||
43.128.0.0/10
|
||||
43.224.12.0/22
|
||||
43.224.24.0/22
|
||||
43.224.44.0/22
|
||||
@ -954,6 +953,7 @@
|
||||
43.251.232.0/22
|
||||
43.251.236.0/22
|
||||
43.251.244.0/22
|
||||
43.252.40.0/22
|
||||
43.252.48.0/22
|
||||
43.252.56.0/22
|
||||
43.252.224.0/22
|
||||
@ -1112,6 +1112,7 @@
|
||||
45.120.164.0/22
|
||||
45.120.220.0/22
|
||||
45.120.240.0/22
|
||||
45.121.20.0/22
|
||||
45.121.52.0/22
|
||||
45.121.64.0/22
|
||||
45.121.68.0/22
|
||||
@ -1222,6 +1223,7 @@
|
||||
45.125.16.0/22
|
||||
45.125.24.0/22
|
||||
45.125.28.0/22
|
||||
45.125.32.0/22
|
||||
45.125.44.0/22
|
||||
45.125.52.0/22
|
||||
45.125.56.0/22
|
||||
@ -1247,6 +1249,7 @@
|
||||
45.127.12.0/22
|
||||
45.127.96.0/22
|
||||
45.127.116.0/22
|
||||
45.127.124.0/22
|
||||
45.127.128.0/22
|
||||
45.127.144.0/22
|
||||
45.127.148.0/22
|
||||
@ -1286,6 +1289,7 @@
|
||||
45.249.36.0/22
|
||||
45.249.92.0/22
|
||||
45.249.112.0/22
|
||||
45.249.180.0/22
|
||||
45.249.188.0/22
|
||||
45.249.192.0/22
|
||||
45.249.196.0/22
|
||||
@ -1467,6 +1471,8 @@
|
||||
45.253.236.0/22
|
||||
45.253.240.0/22
|
||||
45.253.244.0/22
|
||||
45.253.248.0/22
|
||||
45.253.252.0/22
|
||||
45.254.0.0/22
|
||||
45.254.4.0/22
|
||||
45.254.8.0/22
|
||||
@ -1778,9 +1784,7 @@
|
||||
61.29.128.0/18
|
||||
61.29.192.0/19
|
||||
61.29.224.0/20
|
||||
61.29.240.0/21
|
||||
61.29.248.0/22
|
||||
61.29.254.0/23
|
||||
61.29.240.0/20
|
||||
61.45.128.0/18
|
||||
61.45.224.0/20
|
||||
61.47.128.0/18
|
||||
@ -2076,6 +2080,7 @@
|
||||
103.18.208.0/22
|
||||
103.18.212.0/22
|
||||
103.18.224.0/22
|
||||
103.19.0.0/22
|
||||
103.19.12.0/22
|
||||
103.19.40.0/22
|
||||
103.19.44.0/22
|
||||
@ -3394,6 +3399,7 @@
|
||||
103.93.28.0/22
|
||||
103.93.76.0/22
|
||||
103.93.84.0/22
|
||||
103.93.121.0/24
|
||||
103.93.152.0/22
|
||||
103.93.180.0/22
|
||||
103.93.204.0/22
|
||||
@ -3768,6 +3774,7 @@
|
||||
103.119.224.0/22
|
||||
103.120.52.0/22
|
||||
103.120.72.0/22
|
||||
103.120.76.0/24
|
||||
103.120.88.0/22
|
||||
103.120.96.0/22
|
||||
103.120.100.0/22
|
||||
@ -3908,6 +3915,7 @@
|
||||
103.141.58.0/23
|
||||
103.141.128.0/23
|
||||
103.141.186.0/23
|
||||
103.141.190.0/23
|
||||
103.141.242.0/23
|
||||
103.142.0.0/23
|
||||
103.142.28.0/23
|
||||
@ -4073,32 +4081,6 @@
|
||||
103.155.16.0/23
|
||||
103.155.34.0/23
|
||||
103.155.48.0/23
|
||||
103.155.76.0/23
|
||||
103.155.100.0/23
|
||||
103.155.110.0/23
|
||||
103.155.120.0/23
|
||||
103.155.214.0/23
|
||||
103.155.248.0/23
|
||||
103.156.24.0/23
|
||||
103.156.28.0/23
|
||||
103.156.68.0/23
|
||||
103.156.78.0/23
|
||||
103.156.104.0/23
|
||||
103.156.158.0/23
|
||||
103.156.166.0/23
|
||||
103.156.174.0/23
|
||||
103.156.186.0/23
|
||||
103.156.228.0/23
|
||||
103.157.30.0/23
|
||||
103.157.138.0/23
|
||||
103.157.174.0/23
|
||||
103.157.212.0/23
|
||||
103.157.234.0/23
|
||||
103.157.254.0/23
|
||||
103.158.0.0/23
|
||||
103.158.8.0/23
|
||||
103.158.13.0/24
|
||||
103.158.16.0/23
|
||||
103.192.0.0/22
|
||||
103.192.4.0/22
|
||||
103.192.8.0/22
|
||||
@ -4135,6 +4117,7 @@
|
||||
103.193.124.0/22
|
||||
103.193.140.0/22
|
||||
103.193.144.0/22
|
||||
103.193.148.0/22
|
||||
103.193.160.0/22
|
||||
103.193.188.0/22
|
||||
103.193.192.0/22
|
||||
@ -4153,6 +4136,8 @@
|
||||
103.195.148.0/22
|
||||
103.195.152.0/22
|
||||
103.195.160.0/22
|
||||
103.195.192.0/22
|
||||
103.196.60.0/22
|
||||
103.196.64.0/22
|
||||
103.196.72.0/22
|
||||
103.196.88.0/22
|
||||
@ -4564,6 +4549,7 @@
|
||||
103.218.84.0/22
|
||||
103.218.88.0/22
|
||||
103.218.92.0/22
|
||||
103.218.184.0/22
|
||||
103.218.192.0/22
|
||||
103.218.196.0/22
|
||||
103.218.200.0/22
|
||||
@ -4811,6 +4797,7 @@
|
||||
103.227.212.0/22
|
||||
103.227.228.0/22
|
||||
103.228.12.0/22
|
||||
103.228.28.0/22
|
||||
103.228.88.0/22
|
||||
103.228.128.0/22
|
||||
103.228.136.0/22
|
||||
@ -5101,6 +5088,7 @@
|
||||
103.251.160.0/22
|
||||
103.251.192.0/22
|
||||
103.251.204.0/22
|
||||
103.251.236.0/22
|
||||
103.251.240.0/22
|
||||
103.252.28.0/22
|
||||
103.252.36.0/22
|
||||
@ -5312,6 +5300,7 @@
|
||||
113.208.128.0/17
|
||||
113.209.0.0/16
|
||||
113.212.0.0/18
|
||||
113.212.64.0/22
|
||||
113.212.88.0/22
|
||||
113.212.100.0/22
|
||||
113.212.184.0/21
|
||||
@ -5339,8 +5328,7 @@
|
||||
114.111.160.0/19
|
||||
114.112.0.0/14
|
||||
114.116.0.0/16
|
||||
114.117.0.0/17
|
||||
114.117.128.0/17
|
||||
114.117.0.0/16
|
||||
114.118.0.0/16
|
||||
114.119.0.0/17
|
||||
114.119.192.0/21
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -11,58 +11,21 @@ set firewall.shadowsocksr.path=/var/etc/shadowsocksr.include
|
||||
set firewall.shadowsocksr.reload=1
|
||||
commit firewall
|
||||
EOF
|
||||
rm -rf /etc/config/shadowsocksr-opkg /etc/ssr/*opkg
|
||||
touch /etc/ssr/china_ssr.txt
|
||||
touch /etc/ssr/deny.list
|
||||
touch /etc/ssr/white.list
|
||||
touch /etc/ssr/black.list
|
||||
touch /etc/ssr/netflix.list
|
||||
touch /etc/ssr/netflixip.list
|
||||
touch /etc/ssr/gfw_base.conf
|
||||
touch /etc/ssr/gfw_list.conf
|
||||
touch /etc/ssr/oversea_list.conf
|
||||
touch /etc/ssr/ad.conf
|
||||
touch /etc/config/shadowsocksr
|
||||
if [ ! -s "/etc/config/shadowsocksr" ] ; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
add shadowsocksr global
|
||||
set shadowsocksr.@global[0].global_server='nil'
|
||||
set shadowsocksr.@global[0].netflix_server='nil'
|
||||
set shadowsocksr.@global[0].netflix_proxy='0'
|
||||
set shadowsocksr.@global[0].threads='0'
|
||||
set shadowsocksr.@global[0].run_mode='router'
|
||||
set shadowsocksr.@global[0].dports='2'
|
||||
set shadowsocksr.@global[0].pdnsd_enable='1'
|
||||
set shadowsocksr.@global[0].tunnel_forward='8.8.4.4:53'
|
||||
set shadowsocksr.@global[0].monitor_enable='1'
|
||||
set shadowsocksr.@global[0].enable_switch='1'
|
||||
set shadowsocksr.@global[0].switch_time='667'
|
||||
set shadowsocksr.@global[0].switch_timeout='5'
|
||||
set shadowsocksr.@global[0].switch_try_count='3'
|
||||
set shadowsocksr.@global[0].gfwlist_url='https://cdn.jsdelivr.net/gh/v2fly/domain-list-community@release/gfwlist.txt'
|
||||
set shadowsocksr.@global[0].chnroute_url='https://ispip.clang.cn/all_cn.txt'
|
||||
set shadowsocksr.@global[0].nfip_url='https://cdn.jsdelivr.net/gh/QiuSimons/Netflix_IP/getflix.txt'
|
||||
set shadowsocksr.@global[0].adblock_url='https://anti-ad.net/anti-ad-for-dnsmasq.conf'
|
||||
add shadowsocksr server_subscribe
|
||||
set shadowsocksr.@server_subscribe[0].proxy='0'
|
||||
set shadowsocksr.@server_subscribe[0].auto_update_time='2'
|
||||
set shadowsocksr.@server_subscribe[0].auto_update='1'
|
||||
set shadowsocksr.@server_subscribe[0].filter_words='过期时间/剩余流量/QQ群/官网/防失联地址/回国'
|
||||
add shadowsocksr access_control
|
||||
set shadowsocksr.@access_control[0].lan_ac_mode='0'
|
||||
set shadowsocksr.@access_control[0].router_proxy='1'
|
||||
add_list shadowsocksr.@access_control[0].wan_fw_ips=149.154.160.0/20
|
||||
add_list shadowsocksr.@access_control[0].wan_fw_ips=67.198.55.0/24
|
||||
add_list shadowsocksr.@access_control[0].wan_fw_ips=91.108.4.0/22
|
||||
add_list shadowsocksr.@access_control[0].wan_fw_ips=91.108.56.0/22
|
||||
add_list shadowsocksr.@access_control[0].wan_fw_ips=109.239.140.0/24
|
||||
add shadowsocksr socks5_proxy
|
||||
set shadowsocksr.@socks5_proxy[0].server='nil'
|
||||
set shadowsocksr.@socks5_proxy[0].local_port='1080'
|
||||
add shadowsocksr server_global
|
||||
set shadowsocksr.@server_global[0].enable_server='0'
|
||||
commit shadowsocksr
|
||||
EOF
|
||||
fi
|
||||
touch /etc/ssr/gfw_list.conf
|
||||
touch /etc/ssr/deny.list
|
||||
#chmod 0755 /etc/init.d/shadowsocksr /usr/bin/ssr-* /usr/share/shadowsocksr/*.sh
|
||||
#chmod 0644 /etc/ssr/* \
|
||||
#/usr/share/shadowsocksr/*.lua \
|
||||
#/usr/share/rpcd/acl.d/luci-app-ssr-plus.json \
|
||||
#/usr/lib/lua/luci/controller/shadowsocksr.lua \
|
||||
#/usr/lib/lua/luci/model/cbi/shadowsocksr/*.lua \
|
||||
#/usr/lib/lua/luci/view/shadowsocksr/*.htm
|
||||
#chmod 0600 /etc/config/shadowsocksr
|
||||
rm -rf /tmp/luci-modulecache /tmp/luci-indexcache
|
||||
exit 0
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
/etc/config/shadowsocksr
|
||||
/etc/ssr/china_ssr.txt
|
||||
/etc/ssr/white.list
|
||||
/etc/ssr/black.list
|
||||
/etc/ssr/netflix.list
|
||||
/etc/ssr/netflixip.list
|
||||
/etc/ssr/gfw_list.conf
|
||||
/etc/ssr/ad.conf
|
||||
/etc/ssr/deny.list
|
||||
@ -39,10 +39,8 @@ Valid options are:
|
||||
-U enable udprelay mode, using different IP
|
||||
and ports for TCP and UDP
|
||||
-f flush the rules
|
||||
-g gfwlist mode
|
||||
-r router mode
|
||||
-c oversea mode
|
||||
-z all mode
|
||||
-g gfw list mode
|
||||
-r return china mode
|
||||
-h show this help message and exit
|
||||
EOF
|
||||
exit $1
|
||||
@ -81,36 +79,40 @@ flush_r() {
|
||||
}
|
||||
|
||||
ipset_r() {
|
||||
[ -f "$IGNORE_LIST" ] && /usr/share/shadowsocksr/chinaipset.sh $IGNORE_LIST
|
||||
$IPT -N SS_SPEC_WAN_AC
|
||||
$IPT -I SS_SPEC_WAN_AC -p tcp ! --dport 53 -d $server -j RETURN
|
||||
ipset -N gmlan hash:net 2>/dev/null
|
||||
for ip in $LAN_GM_IP; do ipset -! add gmlan $ip; done
|
||||
case "$RUNMODE" in
|
||||
router)
|
||||
ipset -! -R <<-EOF || return 1
|
||||
create ss_spec_wan_ac hash:net
|
||||
$(gen_spec_iplist | sed -e "s/^/add ss_spec_wan_ac /")
|
||||
$(gen_iplist | sed -e "s/^/add ss_spec_wan_ac /")
|
||||
EOF
|
||||
ipset -N gfwlist hash:net 2>/dev/null
|
||||
$IPT -N SS_SPEC_WAN_AC
|
||||
$IPT -I SS_SPEC_WAN_AC -p tcp ! --dport 53 -d $server -j RETURN
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set ss_spec_wan_ac dst -j RETURN
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set gmlan src -m set ! --match-set china dst -j SS_SPEC_WAN_FW
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set china dst -j RETURN
|
||||
$IPT -A SS_SPEC_WAN_AC -j SS_SPEC_WAN_FW
|
||||
;;
|
||||
gfw)
|
||||
ipset -N gfwlist hash:net 2>/dev/null
|
||||
$IPT -N SS_SPEC_WAN_AC
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set gfwlist dst -j SS_SPEC_WAN_FW
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set gmlan src -m set ! --match-set china dst -j SS_SPEC_WAN_FW
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set china dst -j RETURN
|
||||
$IPT -I SS_SPEC_WAN_AC -p tcp ! --dport 53 -d $server -j RETURN
|
||||
;;
|
||||
oversea)
|
||||
ipset -N oversea hash:net 2>/dev/null
|
||||
$IPT -I SS_SPEC_WAN_AC -m set --match-set oversea dst -j SS_SPEC_WAN_FW
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set gmlan src -j SS_SPEC_WAN_FW
|
||||
$IPT -N SS_SPEC_WAN_AC
|
||||
ipset -N gmlan hash:net 2>/dev/null
|
||||
for ip in $LAN_GM_IP; do ipset -! add gmlan $ip; done
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set china dst -j SS_SPEC_WAN_FW
|
||||
$IPT -I SS_SPEC_WAN_AC -p tcp ! --dport 53 -d $server -j RETURN
|
||||
;;
|
||||
all)
|
||||
$IPT -N SS_SPEC_WAN_AC
|
||||
$IPT -A SS_SPEC_WAN_AC -j SS_SPEC_WAN_FW
|
||||
$IPT -I SS_SPEC_WAN_AC -p tcp ! --dport 53 -d $server -j RETURN
|
||||
;;
|
||||
esac
|
||||
ipset -N fplan hash:net 2>/dev/null
|
||||
@ -181,19 +183,17 @@ ac_rule() {
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
IFNAME=$(uci -P /var/state get network.lan.ifname 2>/dev/null)
|
||||
IFNAME=$(uci get -P/var/state network.lan.ifname 2>/dev/null)
|
||||
ipset -! -R <<-EOF || return 1
|
||||
create ss_spec_lan_ac hash:net
|
||||
$(for ip in ${LAN_AC_IP:1}; do echo "add ss_spec_lan_ac $ip"; done)
|
||||
EOF
|
||||
$IPT -I PREROUTING 1 ${IFNAME:+-i $IFNAME} -p tcp $EXT_ARGS $MATCH_SET \
|
||||
-m comment --comment "$TAG" -j SS_SPEC_WAN_AC
|
||||
case "$OUTPUT" in
|
||||
1)
|
||||
if [ "$OUTPUT" = 1 ]; then
|
||||
$IPT -I OUTPUT 1 -p tcp $EXT_ARGS \
|
||||
-m comment --comment "$TAG" -j SS_SPEC_WAN_AC
|
||||
;;
|
||||
2)
|
||||
elif [ "$OUTPUT" = 2 ]; then
|
||||
ipset -! -R <<-EOF || return 1
|
||||
create ssr_gen_router hash:net
|
||||
$(gen_spec_iplist | sed -e "s/^/add ssr_gen_router /")
|
||||
@ -202,8 +202,7 @@ ac_rule() {
|
||||
$IPT -A SS_SPEC_ROUTER -m set --match-set ssr_gen_router dst -j RETURN && \
|
||||
$IPT -A SS_SPEC_ROUTER -j SS_SPEC_WAN_FW
|
||||
$IPT -I OUTPUT 1 -p tcp -m comment --comment "$TAG" -j SS_SPEC_ROUTER
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
return $?
|
||||
}
|
||||
|
||||
@ -224,8 +223,7 @@ tp_rule() {
|
||||
$ipt -A SS_SPEC_TPROXY -p udp -d 192.168.0.0/16 -j RETURN
|
||||
$ipt -A SS_SPEC_TPROXY -p udp -d 224.0.0.0/4 -j RETURN
|
||||
$ipt -A SS_SPEC_TPROXY -p udp -d 240.0.0.0/4 -j RETURN
|
||||
$ipt -A SS_SPEC_TPROXY -p udp ! --dport 53 -d $SERVER -j RETURN
|
||||
[ "$server" != "$SERVER" ] && ipset -! add whitelist $SERVER
|
||||
$ipt -A SS_SPEC_TPROXY -p udp ! --dport 53 -d $server -j RETURN
|
||||
$ipt -A SS_SPEC_TPROXY -p udp -m set --match-set bplan src -j RETURN
|
||||
$ipt -A SS_SPEC_TPROXY -p udp $PROXY_PORTS -m set --match-set fplan src \
|
||||
-j TPROXY --on-port "$LOCAL_PORT" --tproxy-mark 0x01/0x01
|
||||
@ -264,6 +262,29 @@ get_wan_ip() {
|
||||
EOF
|
||||
}
|
||||
|
||||
gen_iplist() {
|
||||
cat <<-EOF
|
||||
0.0.0.0/8
|
||||
10.0.0.0/8
|
||||
100.64.0.0/10
|
||||
127.0.0.0/8
|
||||
169.254.0.0/16
|
||||
172.16.0.0/12
|
||||
192.0.0.0/24
|
||||
192.0.2.0/24
|
||||
192.88.99.0/24
|
||||
192.168.0.0/16
|
||||
198.18.0.0/15
|
||||
198.51.100.0/24
|
||||
203.0.113.0/24
|
||||
224.0.0.0/4
|
||||
240.0.0.0/4
|
||||
255.255.255.255
|
||||
$(get_wan_ip)
|
||||
$(cat ${IGNORE_LIST:=/dev/null} 2>/dev/null)
|
||||
EOF
|
||||
}
|
||||
|
||||
gen_spec_iplist() {
|
||||
cat <<-EOF
|
||||
0.0.0.0/8
|
||||
@ -393,18 +414,14 @@ if [ -z "$server" -o -z "$local_port" ]; then
|
||||
usage 2
|
||||
fi
|
||||
|
||||
case "$TPROXY" in
|
||||
1)
|
||||
SERVER=$server
|
||||
LOCAL_PORT=$local_port
|
||||
;;
|
||||
2)
|
||||
: ${SERVER:?"You must assign an ip for the udp relay server."}
|
||||
: ${LOCAL_PORT:?"You must assign a port for the udp relay server."}
|
||||
;;
|
||||
esac
|
||||
if [ "$TPROXY" == 1 ]; then
|
||||
SERVER=$server
|
||||
LOCAL_PORT=$local_port
|
||||
elif [ "$TPROXY" == 2 ]; then
|
||||
: ${SERVER:?"You must assign an ip for the udp relay server."}
|
||||
: ${LOCAL_PORT:?"You must assign a port for the udp relay server."}
|
||||
fi
|
||||
|
||||
flush_r && fw_rule && ipset_r && ac_rule && tp_rule && gen_include
|
||||
RET=$?
|
||||
[ "$RET" = 0 ] || loger 3 "Start failed!"
|
||||
exit $RET
|
||||
[ "$?" == 0 ] || loger 3 "Start failed!"
|
||||
exit $?
|
||||
|
||||
@ -38,10 +38,14 @@ CURRENT_SERVER=$DEFAULT_SERVER
|
||||
#解析ip
|
||||
get_host_ip() {
|
||||
local host=$1
|
||||
local ip=$1
|
||||
if [ -z "$(echo $1 | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}")" ]; then
|
||||
if [ "$1" == "${1#*:[0-9a-fA-F]}" ]; then
|
||||
ip=$(resolveip -4 -t 3 $1 | awk 'NR==1{print}')
|
||||
local isip=""
|
||||
local ip=$host
|
||||
isip=$(echo $host | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}")
|
||||
if [ -z "$isip" ]; then
|
||||
if [ "$host" != "${host#*:[0-9a-fA-F]}" ]; then
|
||||
ip=$host
|
||||
else
|
||||
local ip=$(resolveip -4 -t 3 $host | awk 'NR==1{print}')
|
||||
[ -z "$ip" ] && ip=$(wget -q -O- http://119.29.29.29/d?dn=$1 | awk -F ';' '{print $1}')
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
#!/bin/sh
|
||||
[ -f "$1" ] && china_ip=$1
|
||||
ipset -! flush china 2>/dev/null
|
||||
ipset -! -R <<-EOF || exit 1
|
||||
create china hash:net
|
||||
$(cat ${china_ip:=/etc/ssr/china_ssr.txt} | sed -e "s/^/add china /")
|
||||
EOF
|
||||
LOCK_FILE="/var/lock/ssr-chinaipset.lock"
|
||||
[ -f "$LOCK_FILE" ] && exit 2
|
||||
touch "$LOCK_FILE"
|
||||
echo "create china hash:net family inet hashsize 1024 maxelem 65536" >/tmp/china.ipset
|
||||
awk '!/^$/&&!/^#/{printf("add china %s'" "'\n",$0)}' /etc/ssr/china_ssr.txt >>/tmp/china.ipset
|
||||
ipset -! flush china
|
||||
ipset -! restore </tmp/china.ipset 2>/dev/null
|
||||
rm -f /tmp/china.ipset $LOCK_FILE
|
||||
|
||||
@ -78,8 +78,7 @@ outbound = {
|
||||
writeBufferSize = tonumber(server.write_buffer_size),
|
||||
header = {
|
||||
type = server.kcp_guise
|
||||
},
|
||||
seed = server.seed or nil
|
||||
}
|
||||
} or nil,
|
||||
wsSettings = (server.transport == "ws") and (server.ws_path ~= nil or server.ws_host ~= nil) and {
|
||||
path = server.ws_path,
|
||||
|
||||
@ -89,8 +89,7 @@ outbound = {
|
||||
writeBufferSize = tonumber(server.write_buffer_size),
|
||||
header = {
|
||||
type = server.kcp_guise
|
||||
},
|
||||
seed = server.seed or nil
|
||||
}
|
||||
} or nil,
|
||||
wsSettings = (server.transport == "ws") and (server.ws_path ~= nil or server.ws_host ~= nil) and {
|
||||
path = server.ws_path,
|
||||
|
||||
@ -10,25 +10,16 @@ if [ -z "$switch_server" ]; then
|
||||
else
|
||||
GLOBAL_SERVER=$switch_server
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/dnsmasq.ssr
|
||||
if [ "$(uci_get_by_type global run_mode router)" == "oversea" ]; then
|
||||
cp -rf /etc/ssr/oversea_list.conf /tmp/dnsmasq.ssr/
|
||||
else
|
||||
cp -rf /etc/ssr/gfw_list.conf /tmp/dnsmasq.ssr/
|
||||
cp -rf /etc/ssr/gfw_base.conf /tmp/dnsmasq.ssr/
|
||||
fi
|
||||
|
||||
NETFLIX_SERVER=$(uci_get_by_type global netflix_server nil)
|
||||
[ "$NETFLIX_SERVER" == "same" ] && NETFLIX_SERVER=$GLOBAL_SERVER
|
||||
if [ "$NETFLIX_SERVER" != "nil" ]; then
|
||||
netflix() {
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"netflix"'\n",$0)}' /etc/ssr/netflix.list >/tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/%s/'"127.0.0.1#$1"'\n",$0)}' /etc/ssr/netflix.list >>/tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
if [ -f "/tmp/dnsmasq.ssr/gfw_list.conf" ]; then
|
||||
for line in $(cat /etc/ssr/netflix.list); do sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_list.conf; done
|
||||
for line in $(cat /etc/ssr/netflix.list); do sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_base.conf; done
|
||||
fi
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"netflix"'\n",$0)}' /etc/ssr/netflix.list >/tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/%s/'"127.0.0.1#$1"'\n",$0)}' /etc/ssr/netflix.list >>/tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
}
|
||||
if [ "$NETFLIX_SERVER" != "$GLOBAL_SERVER" ]; then
|
||||
netflix 5555
|
||||
@ -38,16 +29,16 @@ if [ "$NETFLIX_SERVER" != "nil" ]; then
|
||||
else
|
||||
rm -f /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
fi
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"blacklist"'\n",$0)}' /etc/ssr/black.list >/tmp/dnsmasq.ssr/blacklist_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/%s/'"127.0.0.1#5335"'\n",$0)}' /etc/ssr/black.list >>/tmp/dnsmasq.ssr/blacklist_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"whitelist"'\n",$0)}' /etc/ssr/white.list >/tmp/dnsmasq.ssr/whitelist_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("address=/%s/''\n",$0)}' /etc/ssr/deny.list >/tmp/dnsmasq.ssr/denylist.conf
|
||||
for line in $(cat /etc/ssr/black.list); do sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_list.conf; done
|
||||
for line in $(cat /etc/ssr/black.list); do sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_base.conf; done
|
||||
for line in $(cat /etc/ssr/white.list); do sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_list.conf; done
|
||||
for line in $(cat /etc/ssr/white.list); do sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_base.conf; done
|
||||
for line in $(cat /etc/ssr/deny.list); do sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_list.conf; done
|
||||
for line in $(cat /etc/ssr/deny.list); do sed -i "/$line/d" /tmp/dnsmasq.ssr/gfw_base.conf; done
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"blacklist"'\n",$0)}' /etc/ssr/black.list >/tmp/dnsmasq.ssr/blacklist_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/%s/'"127.0.0.1#5335"'\n",$0)}' /etc/ssr/black.list >>/tmp/dnsmasq.ssr/blacklist_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"whitelist"'\n",$0)}' /etc/ssr/white.list >/tmp/dnsmasq.ssr/whitelist_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("address=/%s/''\n",$0)}' /etc/ssr/deny.list >/tmp/dnsmasq.ssr/denylist.conf
|
||||
if [ "$(uci_get_by_type global adblock 0)" == "1" ]; then
|
||||
[ "$1" == "" ] && cp -f /etc/ssr/ad.conf /tmp/dnsmasq.ssr/
|
||||
if [ -f "/tmp/dnsmasq.ssr/ad.conf" ]; then
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
/usr/bin/lua /usr/share/shadowsocksr/update.lua
|
||||
sleep 2s
|
||||
/usr/share/shadowsocksr/chinaipset.sh /tmp/etc/china_ssr.txt
|
||||
/usr/share/shadowsocksr/chinaipset.sh
|
||||
sleep 2s
|
||||
/usr/bin/lua /usr/share/shadowsocksr/subscribe.lua
|
||||
|
||||
@ -40,9 +40,9 @@ local function update(url, file, type, file2)
|
||||
end
|
||||
|
||||
log("正在更新【GFW列表】数据库")
|
||||
update(uci:get_first("shadowsocksr", "global", "gfwlist_url", "https://cdn.jsdelivr.net/gh/v2fly/domain-list-community@release/gfwlist.txt"), "/etc/ssr/gfw_list.conf", "gfw_data", "/tmp/dnsmasq.ssr/gfw_list.conf")
|
||||
update(uci:get_first("shadowsocksr", "global", "gfwlist_url", "https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt"), "/etc/ssr/gfw_list.conf", "gfw_data", "/tmp/dnsmasq.ssr/gfw_list.conf")
|
||||
log("正在更新【国内IP段】数据库")
|
||||
update(uci:get_first("shadowsocksr", "global", "chnroute_url","https://ispip.clang.cn/all_cn.txt"), "/etc/ssr/china_ssr.txt", "cnip", "/tmp/etc/china_ssr.txt")
|
||||
update(uci:get_first("shadowsocksr", "global", "chnroute_url","https://ispip.clang.cn/all_cn.txt"), "/etc/ssr/china_ssr.txt", "cnip")
|
||||
if uci:get_first("shadowsocksr", "global", "adblock","0") == "1" then
|
||||
log("正在更新【广告屏蔽】数据库")
|
||||
update(uci:get_first("shadowsocksr", "global", "adblock_url","https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt"), "/etc/ssr/ad.conf", "ad_data", "/tmp/dnsmasq.ssr/ad.conf")
|
||||
|
||||
@ -68,7 +68,7 @@ define Build/Compile
|
||||
npm --prefix client ci ; \
|
||||
npm --prefix client run build-prod ; \
|
||||
GOOS=$$$$(go env GOOS) GOARCH=$$$$(go env GOARCH) GO111MODULE=off go get -v github.com/gobuffalo/packr/... ; \
|
||||
"$$$$(go env GOPATH)/bin/packr" -v -z -i $(PKG_BUILD_DIR)/home ; \
|
||||
"$$$$(go env GOPATH)/bin/packr" -v -z -i $(PKG_BUILD_DIR)/internal/home ; \
|
||||
$(call GoPackage/Build/Compile) ; \
|
||||
)
|
||||
ifeq ($(CONFIG_ADGUARDHOME_COMPRESS_UPX),y)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user