Merge Mainline

This commit is contained in:
CN_SZTL 2020-11-28 21:21:58 +08:00
commit 6acd99e2ab
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
19 changed files with 36 additions and 42 deletions

View File

@ -86,8 +86,6 @@ define Host/Configure/Default
LDFLAGS="$(HOST_LDFLAGS)" \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER="$(HOSTCC)" \
-DCMAKE_CXX_COMPILER="$(HOSTCXX)" \
-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
-DCMAKE_EXE_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \

View File

@ -57,15 +57,6 @@ endef
define Build/Compile
endef
define Package/luci-app-vssr/conffiles
/etc/ssr_ip
/etc/dnsmasq.ssr/gfw_list.conf
/etc/china_ssr.txt
/etc/dnsmasq.ssr/gfw_list.conf
/etc/dnsmasq.ssr/gfw_base.conf
/etc/dnsmasq.oversea/oversea_list.conf
endef
define Package/luci-app-vssr/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
cp -pR ./luasrc/* $(1)/usr/lib/lua/luci

View File

@ -228,9 +228,9 @@ function refresh_data()
luci.sys.call('/usr/bin/vssr-gfw')
icount = luci.sys.exec('cat /tmp/gfwnew.txt | wc -l')
if tonumber(icount) > 1000 then
oldcount = luci.sys.exec('cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l')
oldcount = luci.sys.exec('cat /etc/vssr/gfw_list.conf | wc -l')
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec('cp -f /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf')
luci.sys.exec('cp -f /tmp/gfwnew.txt /etc/vssr/gfw_list.conf')
retstring = tostring(math.ceil(tonumber(icount) / 2))
else
retstring = '0'
@ -248,9 +248,9 @@ function refresh_data()
sret = luci.sys.call(refresh_cmd)
icount = luci.sys.exec('cat /tmp/china_ssr.txt | wc -l')
if sret == 0 and tonumber(icount) > 1000 then
oldcount = luci.sys.exec('cat /etc/china_ssr.txt | wc -l')
oldcount = luci.sys.exec('cat /etc/vssr/china_ssr.txt | wc -l')
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec('cp -f /tmp/china_ssr.txt /etc/china_ssr.txt')
luci.sys.exec('cp -f /tmp/china_ssr.txt /etc/vssr/china_ssr.txt')
retstring = tostring(tonumber(icount))
else
retstring = '0'
@ -274,13 +274,13 @@ function refresh_data()
end
icount = luci.sys.exec('cat /tmp/ad.conf | wc -l')
if tonumber(icount) > 1000 then
if nixio.fs.access('/etc/dnsmasq.ssr/ad.conf') then
oldcount = luci.sys.exec('cat /etc/dnsmasq.ssr/ad.conf | wc -l')
if nixio.fs.access('/etc/vssr/ad.conf') then
oldcount = luci.sys.exec('cat /etc/vssr/ad.conf | wc -l')
else
oldcount = 0
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec('cp -f /tmp/ad.conf /etc/dnsmasq.ssr/ad.conf')
luci.sys.exec('cp -f /tmp/ad.conf /etc/vssr/ad.conf')
retstring = tostring(math.ceil(tonumber(icount)))
if oldcount == 0 then
luci.sys.call('/etc/init.d/dnsmasq restart')

View File

@ -8,21 +8,21 @@ local ip_count = 0
local ad_count = 0
local server_count = 0
if nixio.fs.access('/etc/dnsmasq.ssr/gfw_list.conf') then
if nixio.fs.access('/etc/vssr/gfw_list.conf') then
gfwmode = 1
end
local sys = require 'luci.sys'
if gfwmode == 1 then
gfw_count = tonumber(sys.exec('cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l')) / 2
if nixio.fs.access('/etc/dnsmasq.ssr/ad.conf') then
ad_count = tonumber(sys.exec('cat /etc/dnsmasq.ssr/ad.conf | wc -l'))
gfw_count = tonumber(sys.exec('cat /etc/vssr/gfw_list.conf | wc -l')) / 2
if nixio.fs.access('/etc/vssr/ad.conf') then
ad_count = tonumber(sys.exec('cat /etc/vssr/ad.conf | wc -l'))
end
end
if nixio.fs.access('/etc/china_ssr.txt') then
ip_count = sys.exec('cat /etc/china_ssr.txt | wc -l')
if nixio.fs.access('/etc/vssr/china_ssr.txt') then
ip_count = sys.exec('cat /etc/vssr/china_ssr.txt | wc -l')
end
uci:foreach(

View File

@ -5,7 +5,7 @@ local m, s, sec, o, kcp_enable
local vssr = 'vssr'
local gfwmode = 0
if nixio.fs.access('/etc/dnsmasq.ssr/gfw_list.conf') then
if nixio.fs.access('/etc/vssr/gfw_list.conf') then
gfwmode = 1
end

View File

@ -61,7 +61,7 @@ luci.ip.neighbors(
s:tab('esc', translate('Bypass Domain List'))
local escconf = '/etc/config/white.list'
local escconf = '/etc/vssr/white.list'
o = s:taboption('esc', TextValue, 'escconf')
o.rows = 13
o.wrap = 'off'
@ -78,7 +78,7 @@ end
s:tab('block', translate('Black Domain List'))
local blockconf = '/etc/config/black.list'
local blockconf = '/etc/vssr/black.list'
o = s:taboption('block', TextValue, 'blockconf')
o.rows = 13
o.wrap = 'off'

View File

@ -21,7 +21,7 @@ config socks5_proxy
option Socks_pass 'password'
config access_control
option wan_bp_list '/etc/china_ssr.txt'
option wan_bp_list '/etc/vssr/china_ssr.txt'
option lan_ac_mode 'b'
option router_proxy '1'
list wan_fw_ips '149.154.160.0/20'

View File

@ -544,7 +544,7 @@ start() {
if rules; then
start_redir
mkdir -p /tmp/dnsmasq.d && cp -a /etc/dnsmasq.ssr /tmp/ && cp -a /etc/dnsmasq.oversea /tmp/
mkdir -p /tmp/dnsmasq.d && cp -a /etc/vssr/ad.conf gfw_base.conf gfw_list.conf /tmp/ && cp -a /etc/vssr/oversea_list.conf /tmp/
if ! [ "$run_mode" = "oversea" ]; then
cat >/tmp/dnsmasq.d/dnsmasq-ssr.conf <<EOF
conf-dir=/tmp/dnsmasq.ssr

View File

@ -19,4 +19,7 @@ primevideo.cc
primevideo.com
primevideo.info
primevideo.org
primevideo.tv
primevideo.tv
v2fly.org
github.com
raw.githubusercontent.com

View File

@ -3,13 +3,13 @@
mkdir -p /tmp/dnsmasq.ssr
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"gfwlist"'\n",$0)}' /etc/config/gfw.list >/tmp/dnsmasq.ssr/custom_forward.conf
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5335"'\n",$0)}' /etc/config/gfw.list >>/tmp/dnsmasq.ssr/custom_forward.conf
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"gfwlist"'\n",$0)}' /etc/vssr/gfw.list >/tmp/dnsmasq.ssr/custom_forward.conf
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5335"'\n",$0)}' /etc/vssr/gfw.list >>/tmp/dnsmasq.ssr/custom_forward.conf
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"blacklist"'\n",$0)}' /etc/config/black.list >/tmp/dnsmasq.ssr/blacklist_forward.conf
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5335"'\n",$0)}' /etc/config/black.list >>/tmp/dnsmasq.ssr/blacklist_forward.conf
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"blacklist"'\n",$0)}' /etc/vssr/black.list >/tmp/dnsmasq.ssr/blacklist_forward.conf
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5335"'\n",$0)}' /etc/vssr/black.list >>/tmp/dnsmasq.ssr/blacklist_forward.conf
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"whitelist"'\n",$0)}' /etc/config/white.list >/tmp/dnsmasq.ssr/whitelist_forward.conf
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"whitelist"'\n",$0)}' /etc/vssr/white.list >/tmp/dnsmasq.ssr/whitelist_forward.conf
function valid_ip() {
ip=$1

View File

@ -26,9 +26,9 @@ if sret == 0 then
luci.sys.call('/usr/bin/vssr-gfw')
icount = luci.sys.exec('cat /tmp/gfwnew.txt | wc -l')
if tonumber(icount) > 1000 then
oldcount = luci.sys.exec('cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l')
oldcount = luci.sys.exec('cat /etc/vssr/gfw_list.conf | wc -l')
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec('cp -f /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf')
luci.sys.exec('cp -f /tmp/gfwnew.txt /etc/vssr/gfw_list.conf')
-- retstring=tostring(math.ceil(tonumber(icount)/2))
log('更新成功! 新的总纪录数:' .. icount)
else
@ -49,9 +49,9 @@ icount = luci.sys.exec('cat /tmp/china_ssr.txt | wc -l')
if sret == 0 then
icount = luci.sys.exec('cat /tmp/china_ssr.txt | wc -l')
if tonumber(icount) > 1000 then
oldcount = luci.sys.exec('cat /etc/china_ssr.txt | wc -l')
oldcount = luci.sys.exec('cat /etc/vssr/china_ssr.txt | wc -l')
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec('cp -f /tmp/china_ssr.txt /etc/china_ssr.txt')
luci.sys.exec('cp -f /tmp/china_ssr.txt /etc/vssr/china_ssr.txt')
-- retstring=tostring(math.ceil(tonumber(icount)/2))
log('更新成功! 新的总纪录数:' .. icount)
else
@ -82,13 +82,13 @@ if ucic:get_first('vssr', 'global', 'adblock', '') == '1' then
end
icount = luci.sys.exec('cat /tmp/ad.conf | wc -l')
if tonumber(icount) > 1000 then
if nixio.fs.access('/etc/dnsmasq.ssr/ad.conf') then
oldcount = luci.sys.exec('cat /etc/dnsmasq.ssr/ad.conf | wc -l')
if nixio.fs.access('/etc/vssr/ad.conf') then
oldcount = luci.sys.exec('cat /etc/vssr/ad.conf | wc -l')
else
oldcount = 0
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec('cp -f /tmp/ad.conf /etc/dnsmasq.ssr/ad.conf')
luci.sys.exec('cp -f /tmp/ad.conf /etc/vssr/ad.conf')
-- retstring=tostring(math.ceil(tonumber(icount)))
if oldcount == 0 then
luci.sys.call('/etc/init.d/dnsmasq restart')

View File

@ -174,6 +174,8 @@ TARGET_CFLAGS:=$(TARGET_OPTIMIZATION)$(if $(CONFIG_DEBUG), -g3) $(call qstrip,$(
TARGET_CXXFLAGS = $(TARGET_CFLAGS)
TARGET_ASFLAGS_DEFAULT = $(TARGET_CFLAGS)
TARGET_ASFLAGS = $(TARGET_ASFLAGS_DEFAULT)
TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include
TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
ifneq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
LIBGCC_S_PATH=$(realpath $(wildcard $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC))))
LIBGCC_S=$(if $(LIBGCC_S_PATH),-L$(dir $(LIBGCC_S_PATH)) -lgcc_s)