Merge Mainline
This commit is contained in:
commit
7d9a642185
21
package/ctcgfw/luci-app-naiveproxy/Makefile
Normal file
21
package/ctcgfw/luci-app-naiveproxy/Makefile
Normal file
@ -0,0 +1,21 @@
|
||||
# Copyright (C) 2020 Openwrt.org
|
||||
#
|
||||
# This is a free software, use it under GNU General Public License v3.0.
|
||||
#
|
||||
# Created By [CTCGFW]Project-OpenWrt
|
||||
# https://github.com/project-openwrt
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-naiveproxy
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=1
|
||||
LUCI_TITLE:=LuCI support for NaiveProxy
|
||||
LUCI_DEPENDS:=+naiveproxy
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_MAINTAINER:=CN_SZTL <cnsztl@project-openwrt.eu.org>
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -0,0 +1,23 @@
|
||||
-- This is a free software, use it under GNU General Public License v3.0.
|
||||
-- Created By [CTCGFW]Project OpenWRT
|
||||
-- https://github.com/project-openwrt
|
||||
|
||||
module("luci.controller.naiveproxy", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/naiveproxy") then
|
||||
return
|
||||
end
|
||||
|
||||
local page
|
||||
page = entry({"admin", "services", "naiveproxy"}, cbi("naiveproxy"), _("NaiveProxy"), 100)
|
||||
page.dependent = true
|
||||
entry({"admin", "services", "naiveproxy", "status"},call("act_status")).leaf=true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("pgrep naive >/dev/null")==0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
@ -0,0 +1,28 @@
|
||||
-- Created By [CTCGFW]Project-OpenWrt
|
||||
-- https://github.com/project-openwrt
|
||||
|
||||
mp = Map("naiveproxy", translate("NaiveProxy"))
|
||||
mp.description = translate("NaïveProxy uses Chrome's network stack to camouflage traffic with strong censorship resistance and low detectability. Reusing Chrome's stack also ensures best practices in performance and security.")
|
||||
|
||||
mp:section(SimpleSection).template = "naiveproxy/naiveproxy_status"
|
||||
|
||||
s = mp:section(TypedSection, "naiveproxy")
|
||||
s.anonymous=true
|
||||
s.addremove=false
|
||||
|
||||
enable = s:option(Flag, "enable", translate("Enable"))
|
||||
enable.default = 0
|
||||
enable.rmempty = false
|
||||
|
||||
listen_addr = s:option(Value, "listen_addr", translate("Listen Address"))
|
||||
listen_addr.description = translate("proto://[addr][:port]")
|
||||
listen_addr.rmempty = false
|
||||
|
||||
server_addr = s:option(Value, "server_addr", translate("Server Address"))
|
||||
server_addr.description = translate("proto://user:pass@hostname[:port]")
|
||||
server_addr.rmempty = false
|
||||
|
||||
extra_command = s:option(Value, "extra_command", translate("Extra Argument"))
|
||||
extra_command.description = translate("Appends extra argument to NaiveProxy")
|
||||
|
||||
return mp
|
||||
@ -0,0 +1,22 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[services]], [[naiveproxy]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('gost_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
var links = '<em><b><font color=green>NaiveProxy <%:RUNNING%></font></b></em>';
|
||||
tb.innerHTML = links;
|
||||
} else {
|
||||
tb.innerHTML = '<em><b><font color=red>NaiveProxy <%:NOT RUNNING%></font></b></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="gost_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
26
package/ctcgfw/luci-app-naiveproxy/po/en/naiveproxy.po
Normal file
26
package/ctcgfw/luci-app-naiveproxy/po/en/naiveproxy.po
Normal file
@ -0,0 +1,26 @@
|
||||
msgid "NaiveProxy"
|
||||
msgstr ""
|
||||
|
||||
msgid "NaïveProxy uses Chrome's network stack to camouflage traffic with strong censorship resistance and low detectability. Reusing Chrome's stack also ensures best practices in performance and security."
|
||||
msgstr ""
|
||||
|
||||
msgid "RUNNING"
|
||||
msgstr ""
|
||||
|
||||
msgid "NOT RUNNING"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enable"
|
||||
msgstr ""
|
||||
|
||||
msgid "Listen Address"
|
||||
msgstr ""
|
||||
|
||||
msgid "Server Address"
|
||||
msgstr ""
|
||||
|
||||
msgid "Extra Argument"
|
||||
msgstr ""
|
||||
|
||||
msgid "Appends extra argument to NaiveProxy"
|
||||
msgstr ""
|
||||
26
package/ctcgfw/luci-app-naiveproxy/po/zh-cn/naiveproxy.po
Normal file
26
package/ctcgfw/luci-app-naiveproxy/po/zh-cn/naiveproxy.po
Normal file
@ -0,0 +1,26 @@
|
||||
msgid "NaiveProxy"
|
||||
msgstr "NaiveProxy"
|
||||
|
||||
msgid "NaïveProxy uses Chrome's network stack to camouflage traffic with strong censorship resistance and low detectability. Reusing Chrome's stack also ensures best practices in performance and security."
|
||||
msgstr "NaïveProxy 使用 Chrome 网络堆栈强大的反审查功能和低可检测性来伪装流量,同时确保在性能和安全方面达到最佳。"
|
||||
|
||||
msgid "RUNNING"
|
||||
msgstr "运行中"
|
||||
|
||||
msgid "NOT RUNNING"
|
||||
msgstr "未运行"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Listen Address"
|
||||
msgstr "监听地址"
|
||||
|
||||
msgid "Server Address"
|
||||
msgstr "服务器地址"
|
||||
|
||||
msgid "Extra Argument"
|
||||
msgstr "额外参数"
|
||||
|
||||
msgid "Appends extra argument to NaiveProxy"
|
||||
msgstr "追加额外参数到 NaiveProxy"
|
||||
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@naiveproxy[-1]
|
||||
add ucitrack naiveproxy
|
||||
set ucitrack.@naiveproxy[-1].init=naiveproxy
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-vssr
|
||||
PKG_VERSION:=1.13
|
||||
PKG_RELEASE:=20200823
|
||||
PKG_VERSION:=1.14
|
||||
PKG_RELEASE:=20200824
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ function index()
|
||||
|
||||
if nixio.fs.access("/usr/bin/ssr-redir") then
|
||||
entry({"admin", "services", "vssr"},
|
||||
alias("admin", "services", "vssr", "client"), _("Hello World"), 10).dependent =
|
||||
alias("admin", "services", "vssr", "client"), _("Hello World"), 0).dependent =
|
||||
true -- 首页
|
||||
entry({"admin", "services", "vssr", "client"}, cbi("vssr/client"),
|
||||
_("SSR Client"), 10).leaf = true -- 基本设置
|
||||
@ -47,7 +47,7 @@ function index()
|
||||
entry({"admin", "services", "vssr", "checkport"}, call("check_port")) -- 检测单个端口并返回Ping
|
||||
entry({"admin", "services", "vssr", "run"}, call("act_status")) -- 检测全局服务器状态
|
||||
entry({"admin", "services", "vssr", "change"}, call("change_node")) -- 切换节点
|
||||
entry({"admin", "services", "vssr", "allserver"}, call("get_servers")) -- 获取所有节点Json
|
||||
--entry({"admin", "services", "vssr", "allserver"}, call("get_servers")) -- 获取所有节点Json
|
||||
entry({"admin", "services", "vssr", "subscribe"}, call("get_subscribe")) -- 执行订阅
|
||||
entry({"admin", "services", "vssr", "flag"}, call("get_flag")) -- 获取节点国旗 iso code
|
||||
entry({"admin", "services", "vssr", "ip"}, call("check_ip")) -- 获取ip情况
|
||||
@ -99,10 +99,6 @@ function get_servers()
|
||||
uci:foreach("vssr", "servers", function(s)
|
||||
local e = {}
|
||||
e["name"] = s[".name"]
|
||||
local t1 = luci.sys.exec(
|
||||
"ping -c 1 -W 1 %q 2>&1 | grep -o 'time=[0-9]*.[0-9]' | awk -F '=' '{print$2}'" %
|
||||
s["server"])
|
||||
e["t1"] = t1
|
||||
table.insert(server_table, e)
|
||||
end)
|
||||
luci.http.prepare_content("application/json")
|
||||
@ -114,14 +110,12 @@ function change_node()
|
||||
local e = {}
|
||||
local uci = luci.model.uci.cursor()
|
||||
local sid = luci.http.formvalue("set")
|
||||
local name = ""
|
||||
uci:foreach("vssr", "global", function(s) name = s[".name"] end)
|
||||
e.status = false
|
||||
e.sid = sid
|
||||
if sid ~= "" then
|
||||
uci:set("vssr", name, "global_server", sid)
|
||||
uci:set("vssr", '@global[0]', 'global_server', sid)
|
||||
uci:commit("vssr")
|
||||
luci.sys.call("/etc/init.d/vssr restart")
|
||||
luci.sys.exec("/etc/init.d/vssr reload")
|
||||
e.status = true
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
|
||||
@ -103,7 +103,7 @@ o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
uci:delete_all("vssr", "servers", function(s) return true end)
|
||||
uci:commit("vssr")
|
||||
luci.sys.call("/etc/init.d/vssr stop")
|
||||
luci.sys.exec("/etc/init.d/vssr stop")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "vssr",
|
||||
"advanced"))
|
||||
end
|
||||
|
||||
@ -132,7 +132,7 @@ o.description = translate(
|
||||
|
||||
o = s:option(Value, "alias", translate("Alias(optional)"))
|
||||
|
||||
o = s:option(Value, "flag", translate("Country"))
|
||||
o = s:option(Value, "flag", translate("Area"))
|
||||
o.description = translate("请自己指定。格式:cn us hk 等")
|
||||
o.rmempty = true
|
||||
|
||||
|
||||
@ -6,6 +6,8 @@ local m, s, sec, o, kcp_enable
|
||||
local vssr = "vssr"
|
||||
local gfwmode=0
|
||||
|
||||
|
||||
|
||||
if nixio.fs.access("/etc/dnsmasq.ssr/gfw_list.conf") then
|
||||
gfwmode=1
|
||||
end
|
||||
@ -34,6 +36,9 @@ end
|
||||
|
||||
table.sort(key_table)
|
||||
|
||||
local route_name = {"youtube_server","tw_video_server","netflix_server","disney_server","prime_server","tvb_server","custom_server"}
|
||||
local route_label = {"Youtube Proxy","TaiWan Video Proxy","Netflix Proxy","Diseny+ Proxy","Prime Video Proxy","TVB Video Proxy","Custom Proxy"}
|
||||
|
||||
-- [[ Global Setting ]]--
|
||||
s = m:section(TypedSection, "global",translate("Basic Settings [SS|SSR|V2ray|Trojan]"))
|
||||
s.anonymous = true
|
||||
@ -53,46 +58,13 @@ o = s:option(Flag, "v2ray_flow", translate("Open v2ray route"))
|
||||
o.rmempty = false
|
||||
o.description = translate("When open v2ray routed,Apply may take more time.")
|
||||
|
||||
o = s:option(ListValue, "youtube_server", translate("Youtube Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
|
||||
|
||||
|
||||
o = s:option(ListValue, "tw_video_server", translate("TaiWan Video Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
|
||||
|
||||
o = s:option(ListValue, "netflix_server", translate("Netflix Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
|
||||
|
||||
o = s:option(ListValue, "disney_server", translate("Diseny+ Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
|
||||
|
||||
o = s:option(ListValue, "prime_server", translate("Prime Video Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
|
||||
o = s:option(ListValue, "tvb_server", translate("TVB Video Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
for i,v in pairs(route_name) do
|
||||
o = s:option(ListValue, v, translate(route_label[i]))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "threads", translate("Multi Threads Option"))
|
||||
o:value("0", translate("Auto Threads"))
|
||||
|
||||
@ -85,4 +85,9 @@ o.remove = function(self, section, value)
|
||||
NXFS.writefile(blockconf, "")
|
||||
end
|
||||
|
||||
s:tab("proxy", translate("Custom Proxy Domain Name"))
|
||||
|
||||
o = s:taboption("proxy", DynamicList, "proxy_domain_name", translate("Proxy Domain Name"))
|
||||
o.datatype = "hostname"
|
||||
|
||||
return m
|
||||
@ -130,33 +130,66 @@
|
||||
s.innerHTML = "<font color='green'><%:Import%>ShadowsocksR<%:Configuration Succeeded%></font>";
|
||||
return false;
|
||||
} else if (ssu[0] == "ss") {
|
||||
var ploc = ssu[1].indexOf("#");
|
||||
if (ploc > 0) {
|
||||
url0 = ssu[1].substr(0, ploc);
|
||||
param = ssu[1].substr(ploc + 1);
|
||||
} else {
|
||||
url0 = ssu[1]
|
||||
}
|
||||
var sstr = b64decsafe(url0);
|
||||
var url0, param = "";
|
||||
var sipIndex = ssu[1].indexOf("@");
|
||||
var ploc = ssu[1].indexOf("#");
|
||||
if (ploc > 0) {
|
||||
url0 = ssu[1].substr(0, ploc);
|
||||
param = ssu[1].substr(ploc + 1);
|
||||
} else {
|
||||
url0 = ssu[1];
|
||||
}
|
||||
|
||||
if (sipIndex != -1) {
|
||||
// SIP002
|
||||
var userInfo = b64decsafe(url0.substr(0, sipIndex));
|
||||
var temp = url0.substr(sipIndex + 1).split("/?");
|
||||
var serverInfo = temp[0].split(":");
|
||||
var server = serverInfo[0];
|
||||
var port = serverInfo[1];
|
||||
var method, password, plugin, pluginOpts;
|
||||
if (temp[1]) {
|
||||
var pluginInfo = decodeURIComponent(temp[1]);
|
||||
var pluginIndex = pluginInfo.indexOf(";");
|
||||
var pluginNameInfo = pluginInfo.substr(0, pluginIndex);
|
||||
plugin = pluginNameInfo.substr(pluginNameInfo.indexOf("=") + 1)
|
||||
pluginOpts = pluginInfo.substr(pluginIndex + 1);
|
||||
}
|
||||
|
||||
el('.type').value = "ss";
|
||||
|
||||
el('.type').dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
console.log(param);
|
||||
var part1 = team[0].split(':');
|
||||
var part2 = team[1].split(':');
|
||||
el('.server').value = part2[0];
|
||||
el('.server_port').value = part2[1];
|
||||
el('.password').value = part1[1];
|
||||
el('.encrypt_method_ss').value = part1[0];
|
||||
var userInfoSplitIndex = userInfo.indexOf(":");
|
||||
if (userInfoSplitIndex != -1) {
|
||||
method = userInfo.substr(0, userInfoSplitIndex);
|
||||
password = userInfo.substr(userInfoSplitIndex + 1);
|
||||
}
|
||||
el('.type').value = "ss";
|
||||
el('.type').dispatchEvent(event);
|
||||
el('.server').value = server;
|
||||
el('.server_port').value = port;
|
||||
el('.password').value = password || "";
|
||||
el('.encrypt_method_ss').value = method || "";
|
||||
el('.plugin').value = plugin || "";
|
||||
el('.plugin_opts').value = pluginOpts || "";
|
||||
} else {
|
||||
var sstr = b64decsafe(url0);
|
||||
el('.type').value = "ss";
|
||||
el('.type').dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
console.log(param);
|
||||
var part1 = team[0].split(':');
|
||||
var part2 = team[1].split(':');
|
||||
el('.server').value = part2[0];
|
||||
el('.server_port').value = part2[1];
|
||||
el('.password').value = part1[1];
|
||||
el('.encrypt_method_ss').value = part1[0];
|
||||
el('.plugin').value = "";
|
||||
el('.plugin_opts').value = "";
|
||||
}
|
||||
|
||||
if (param != undefined) {
|
||||
rema = decodeURI(param)
|
||||
el('.alias').value = decodeURI(param);
|
||||
}
|
||||
getFlag(rema, part2[0], sid); //get flag iso code
|
||||
getFlag(rema, server, sid); //get flag iso code
|
||||
s.innerHTML = "<font color='green'><%:Import%>Shadowsocks<%:Configuration Succeeded%></font>";
|
||||
return false;
|
||||
} else if (ssu[0] == "trojan") {
|
||||
|
||||
@ -639,6 +639,15 @@ msgstr "Prime Video 代理"
|
||||
msgid "TVB Video Proxy"
|
||||
msgstr "TVB 视频代理"
|
||||
|
||||
msgid "Custom Proxy"
|
||||
msgstr "自定义代理"
|
||||
|
||||
msgid "Custom Proxy Domain Name"
|
||||
msgstr "自定义分流域名"
|
||||
|
||||
msgid "Proxy Domain Name"
|
||||
msgstr "需要被分流的域名"
|
||||
|
||||
msgid "adblock settings"
|
||||
msgstr "广告屏蔽设置"
|
||||
|
||||
@ -649,4 +658,4 @@ msgid "Licence"
|
||||
msgstr "许可"
|
||||
|
||||
msgid "Area"
|
||||
msgstr "区域"
|
||||
msgstr "国家或地区"
|
||||
|
||||
@ -34,9 +34,9 @@ switch_server=$1
|
||||
MAXFD=32768
|
||||
CRON_FILE=/etc/crontabs/root
|
||||
threads=1
|
||||
shunt_type=("global" "youtube" "tw_video" "netflix" "disney" "prime" "tvb")
|
||||
shunt_port=(2080 2081 2082 2083 2084 2085 2086)
|
||||
shunt_array=("youtube" "tw_video" "netflix" "disney" "prime" "tvb")
|
||||
shunt_type=("global" "youtube" "tw_video" "netflix" "disney" "prime" "tvb" "custom")
|
||||
shunt_port=(2080 2081 2082 2083 2084 2085 2086 2087)
|
||||
shunt_array=("youtube" "tw_video" "netflix" "disney" "prime" "tvb" "custom")
|
||||
scount=0
|
||||
uci_get_by_name() {
|
||||
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
|
||||
|
||||
@ -14,6 +14,8 @@ local netflix_server = ucursor:get_first(name, 'global', 'netflix_server')
|
||||
local disney_server = ucursor:get_first(name, 'global', 'disney_server')
|
||||
local prime_server = ucursor:get_first(name, 'global', 'prime_server')
|
||||
local tvb_server = ucursor:get_first(name, 'global', 'tvb_server')
|
||||
local custom_server = ucursor:get_first(name, 'global', 'custom_server')
|
||||
local proxy_domain_name = ucursor:get_list(name,"@access_control[0]","proxy_domain_name")
|
||||
|
||||
function gen_outbound(server_node, tags, local_ports)
|
||||
local bound = {}
|
||||
@ -107,6 +109,7 @@ if v2ray_flow == "1" then
|
||||
table.insert(outbounds_table, gen_outbound(disney_server, "disney",2084))
|
||||
table.insert(outbounds_table, gen_outbound(prime_server, "prime",2085))
|
||||
table.insert(outbounds_table, gen_outbound(tvb_server, "tvb",2086))
|
||||
table.insert(outbounds_table, gen_outbound(custom_server, "custom",2087))
|
||||
else
|
||||
table.insert(outbounds_table, gen_outbound(server_section, "main",local_port))
|
||||
end
|
||||
@ -207,6 +210,12 @@ local tvb_rule = {
|
||||
outboundTag = "tvb"
|
||||
}
|
||||
|
||||
local custom_rule = {
|
||||
type = "field",
|
||||
domain = proxy_domain_name,
|
||||
outboundTag = "custom"
|
||||
}
|
||||
|
||||
local rules_table = {}
|
||||
|
||||
if (youtube_server ~= "nil" and v2ray_flow == "1") then
|
||||
@ -233,6 +242,10 @@ if (tvb_server ~= "nil" and v2ray_flow == "1") then
|
||||
table.insert(rules_table, tvb_rule)
|
||||
end
|
||||
|
||||
if (custom_server ~= "nil" and v2ray_flow == "1") then
|
||||
table.insert(rules_table, custom_rule)
|
||||
end
|
||||
|
||||
local v2ray = {
|
||||
log = {
|
||||
-- error = "/var/vssrsss.log",
|
||||
|
||||
90
package/ctcgfw/naiveproxy/Makefile
Normal file
90
package/ctcgfw/naiveproxy/Makefile
Normal file
@ -0,0 +1,90 @@
|
||||
#
|
||||
# Copyright (C) 2020 Project OpenWrt
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=naiveproxy
|
||||
PKG_VERSION:=84.0.4147.89-2
|
||||
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:=f18fbb77dfb5326e97aff8340d42d327ec8572a82e5611e405e375454fe37b29
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=CN_SZTL <cnsztl@project-openwrt.eu.org>
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_DEPENDS:=ninja/host python3/host
|
||||
PKG_USE_MIPS16:=0
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
ifneq ($(CONFIG_CPU_TYPE)," ")
|
||||
CPU_TYPE:=$(word 1, $(subst +," ,$(CONFIG_CPU_TYPE)))
|
||||
CPU_SUBTYPE:=$(word 2, $(subst +, ",$(CONFIG_CPU_TYPE)))
|
||||
ifeq ($(CPU_SUBTYPE),)
|
||||
CPU_SUBTYPE:=""
|
||||
endif
|
||||
else
|
||||
CPU_TYPE:=""
|
||||
CPU_SUBTYPE:=""
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/naiveproxy
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
URL:=https://github.com/klzgrad/naiveproxy
|
||||
TITLE:=Make a fortune quietly
|
||||
DEPENDS:=@!(arc||armeb||powerpc) +libatomic +libnss
|
||||
endef
|
||||
|
||||
define Package/naiveproxy/description
|
||||
NaïveProxy uses Chrome's network stack to camouflage traffic with strong
|
||||
censorship resistance and low detectability. Reusing Chrome's stack also
|
||||
ensures best practices in performance and security.
|
||||
endef
|
||||
|
||||
ifneq ($(CONFIG_CCACHE),)
|
||||
export CCACHE_SLOPPINESS=time_macros
|
||||
export CCACHE_BASEDIR=$(PKG_BUILD_DIR)/src
|
||||
export CCACHE_CPP2=yes
|
||||
export naive_ccache_flags=cc_wrapper="ccache"
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
( \
|
||||
cd $(PKG_BUILD_DIR) ; \
|
||||
./tools/import-upstream.sh ; \
|
||||
. ./init_env.sh "$(ARCH)" "$(BOARD)" $(CPU_TYPE) $(CPU_SUBTYPE) "$(TOOLCHAIN_DIR)" "$(DL_DIR)"; \
|
||||
export naive_flags="$$$${naive_flags} $$$${naive_ccache_flags}" ; \
|
||||
export OP_STAGING_DIR="$(STAGING_DIR)" ; \
|
||||
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 ; \
|
||||
)
|
||||
endef
|
||||
|
||||
define Package/naiveproxy/conffiles
|
||||
/etc/chromium/policies/managed/proxy.json
|
||||
/etc/config/naiveproxy
|
||||
endef
|
||||
|
||||
define Package/naiveproxy/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/out/Release/naive $(1)/usr/bin/naive
|
||||
$(INSTALL_DIR) $(1)/etc/chromium/policies/managed
|
||||
$(INSTALL_CONF) $(CURDIR)/files/proxy.json $(1)/etc/chromium/policies/managed/proxy.json
|
||||
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
|
||||
$(INSTALL_CONF) $(CURDIR)/files/naiveproxy.config $(1)/etc/config/naiveproxy
|
||||
$(INSTALL_BIN) $(CURDIR)/files/naiveproxy.init $(1)/etc/init.d/naiveproxy
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,naiveproxy))
|
||||
6
package/ctcgfw/naiveproxy/files/naiveproxy.config
Normal file
6
package/ctcgfw/naiveproxy/files/naiveproxy.config
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
config naiveproxy 'config'
|
||||
option enable '0'
|
||||
option listen_addr ''
|
||||
option server_addr ''
|
||||
option extra_argument ''
|
||||
47
package/ctcgfw/naiveproxy/files/naiveproxy.init
Normal file
47
package/ctcgfw/naiveproxy/files/naiveproxy.init
Normal file
@ -0,0 +1,47 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2010 [CTCGFW] Project OpenWRT
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/procd.sh
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
init_conf() {
|
||||
config_load "naiveproxy"
|
||||
config_get "enable" "config" "enable" "0"
|
||||
config_get "listen_addr" "config" "listen_addr"
|
||||
config_get "server_addr" "config" "server_addr"
|
||||
config_get "extra_argument" "config" "extra_argument"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
init_conf
|
||||
[ "${enable}" == "1" ] || exit 0
|
||||
|
||||
procd_open_instance naiveproxy
|
||||
|
||||
procd_set_param command naive
|
||||
procd_append_param command --listen="${listen_addr}"
|
||||
procd_append_param command --proxy="${server_addr}"
|
||||
[ -n "${extra_argument}" ] && procd_append_param command "${extra_argument}"
|
||||
|
||||
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
|
||||
procd_set_param limits core="unlimited"
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service()
|
||||
{
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "naiveproxy"
|
||||
}
|
||||
1
package/ctcgfw/naiveproxy/files/proxy.json
Normal file
1
package/ctcgfw/naiveproxy/files/proxy.json
Normal file
@ -0,0 +1 @@
|
||||
{ "MaxConnectionsPerProxy": 99 }
|
||||
@ -0,0 +1,33 @@
|
||||
From 5b476d92f8dbee8b83061faa8cd18a46e5ab4aae Mon Sep 17 00:00:00 2001
|
||||
From: CN_SZTL <cnsztl@project-openwrt.eu.org>
|
||||
Date: Tue, 18 Aug 2020 20:36:39 +0000
|
||||
Subject: [PATCH 1/3] build: add OpenWrt staging libraries
|
||||
|
||||
---
|
||||
src/build/config/posix/BUILD.gn | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/build/config/posix/BUILD.gn b/src/build/config/posix/BUILD.gn
|
||||
index 9ccb89f27..de9e5501d 100644
|
||||
--- 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 != "") {
|
||||
# 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" ]
|
||||
+ sysroot_flags += [ "-I" + getenv("OP_STAGING_DIR") + "/usr/include/nss" ]
|
||||
+ sysroot_flags += [ "-I" + getenv("OP_STAGING_DIR") + "/usr/include/nspr" ]
|
||||
if (is_linux) {
|
||||
# This is here so that all files get recompiled after a sysroot roll and
|
||||
# when turning the sysroot on or off. (defines are passed via the command
|
||||
@@ -57,6 +60,7 @@ config("runtime_library") {
|
||||
cflags_objcc += sysroot_flags
|
||||
|
||||
# Need to get some linker flags out of the sysroot.
|
||||
+ ldflags += [ "-L" + getenv("OP_STAGING_DIR") + "/usr/lib" ]
|
||||
ld_paths = exec_script("sysroot_ld_path.py",
|
||||
[
|
||||
rebase_path("//build/linux/sysroot_ld_path.sh",
|
||||
--
|
||||
2.17.1
|
||||
@ -0,0 +1,79 @@
|
||||
From fd4f8c65ecbbdd15d71a04d213314de056107a31 Mon Sep 17 00:00:00 2001
|
||||
From: CN_SZTL <cnsztl@project-openwrt.eu.org>
|
||||
Date: Tue, 18 Aug 2020 20:47:40 +0000
|
||||
Subject: [PATCH 2/3] build: add mips & x86 OpenWrt toolchain definitions
|
||||
|
||||
---
|
||||
src/build/toolchain/linux/BUILD.gn | 42 ++++++++++++++++++++++++++++++
|
||||
1 file changed, 42 insertions(+)
|
||||
|
||||
diff --git a/src/build/toolchain/linux/BUILD.gn b/src/build/toolchain/linux/BUILD.gn
|
||||
index 2e7913a4f..cc8084eac 100644
|
||||
--- a/src/build/toolchain/linux/BUILD.gn
|
||||
+++ b/src/build/toolchain/linux/BUILD.gn
|
||||
@@ -95,6 +95,18 @@ clang_toolchain("clang_x86") {
|
||||
}
|
||||
}
|
||||
|
||||
+clang_toolchain("clang_x86_openwrt") {
|
||||
+ # Output linker map files for binary size analysis.
|
||||
+ enable_linker_map = true
|
||||
+ extra_cppflags = "--target=i386-openwrt-linux-musl -D_LIBCPP_HAS_MUSL_LIBC -D__UCLIBC__"
|
||||
+ extra_ldflags = "--target=i386-openwrt-linux-musl"
|
||||
+
|
||||
+ toolchain_args = {
|
||||
+ current_cpu = "x86"
|
||||
+ current_os = "linux"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
clang_toolchain("clang_x86_v8_arm") {
|
||||
toolchain_args = {
|
||||
current_cpu = "x86"
|
||||
@@ -203,6 +215,26 @@ gcc_toolchain("x64") {
|
||||
}
|
||||
}
|
||||
|
||||
+clang_toolchain("clang_mips_openwrt") {
|
||||
+ extra_cppflags = "--target=mips-openwrt-linux-musl -D_LIBCPP_HAS_MUSL_LIBC -D__UCLIBC__"
|
||||
+ extra_ldflags = "--target=mips-openwrt-linux-musl"
|
||||
+
|
||||
+ toolchain_args = {
|
||||
+ current_cpu = "mips"
|
||||
+ current_os = "linux"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+clang_toolchain("clang_mips64_openwrt") {
|
||||
+ extra_cppflags = "--target=mips64-openwrt-linux-musl -D_LIBCPP_HAS_MUSL_LIBC -D__UCLIBC__"
|
||||
+ extra_ldflags = "--target=mips64-openwrt-linux-musl"
|
||||
+
|
||||
+ toolchain_args = {
|
||||
+ current_cpu = "mips64"
|
||||
+ current_os = "linux"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
clang_toolchain("clang_mipsel") {
|
||||
toolchain_args = {
|
||||
current_cpu = "mipsel"
|
||||
@@ -227,6 +259,16 @@ clang_toolchain("clang_mips64el") {
|
||||
}
|
||||
}
|
||||
|
||||
+clang_toolchain("clang_mips64el_openwrt") {
|
||||
+ extra_cppflags = "--target=mips64el-openwrt-linux-musl -D_LIBCPP_HAS_MUSL_LIBC -D__UCLIBC__"
|
||||
+ extra_ldflags = "--target=mips64el-openwrt-linux-musl"
|
||||
+
|
||||
+ toolchain_args = {
|
||||
+ current_cpu = "mips64el"
|
||||
+ current_os = "linux"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
gcc_toolchain("mipsel") {
|
||||
toolprefix = "mipsel-linux-gnu-"
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
From dd07b78f561914ccc6cbe076ae66c380304bf92c Mon Sep 17 00:00:00 2001
|
||||
From: CN_SZTL <cnsztl@project-openwrt.eu.org>
|
||||
Date: Wed, 19 Aug 2020 12:42:45 +0000
|
||||
Subject: [PATCH 3/3] build: drop useless deps simd_asm
|
||||
|
||||
libjpeg_turbo itself has alreadly set the dependency "simd_asm",
|
||||
and this will cause cross-compile failed:
|
||||
```
|
||||
ERROR Unresolved dependencies.
|
||||
//:gn_all(//build/toolchain/linux:clang_arm64_openwrt)
|
||||
needs //third_party/libjpeg_turbo:simd_asm(//build/toolchain/linux:clang_arm64_openwrt)
|
||||
```
|
||||
So, let's drop it in global build file.
|
||||
---
|
||||
src/BUILD.gn | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/src/BUILD.gn b/src/BUILD.gn
|
||||
index 97494c0a0..daddf5213 100644
|
||||
--- a/src/BUILD.gn
|
||||
+++ b/src/BUILD.gn
|
||||
@@ -746,7 +746,6 @@ group("gn_all") {
|
||||
if (enable_nacl) {
|
||||
deps += [ "//native_client/src/trusted/platform_qualify:vcpuid" ]
|
||||
}
|
||||
- deps += [ "//third_party/libjpeg_turbo:simd_asm" ]
|
||||
}
|
||||
if (is_linux && current_toolchain == host_toolchain) {
|
||||
deps += [ "//v8:v8_shell" ]
|
||||
--
|
||||
2.17.1
|
||||
|
||||
113
package/ctcgfw/naiveproxy/src/init_env.sh
Executable file
113
package/ctcgfw/naiveproxy/src/init_env.sh
Executable file
@ -0,0 +1,113 @@
|
||||
#!/bin/bash
|
||||
# [CTCGFW] Project-OpenWrt
|
||||
# Use it under GPLv3.
|
||||
# --------------------------------------------------------
|
||||
# Init build dependencies for naiveproxy
|
||||
|
||||
# Read args from shell
|
||||
target_arch="$1"
|
||||
target_board="$2"
|
||||
cpu_type="$3"
|
||||
cpu_subtype="$4"
|
||||
toolchain_dir="$5"
|
||||
dl_dir="$6"
|
||||
|
||||
# Set arch info
|
||||
naive_arch="${target_arch}"
|
||||
[ "${target_arch}" == "i386" ] && naive_arch="x86"
|
||||
[ "${target_arch}" == "x86_64" ] && naive_arch="x64"
|
||||
[ "${target_arch}" == "aarch64" ] && naive_arch="arm64"
|
||||
ldso_path="/lib/$(find "${toolchain_dir}/" | grep -Eo "ld-musl-[a-z0-9_-]+\\.so\\.1")"
|
||||
|
||||
# OS detection
|
||||
[ "$(uname)" != "Linux" -o "$(uname -m)" != "x86_64" ] && { echo -e "Support Linux AMD64 only."; exit 1; }
|
||||
|
||||
cd "$PWD/src"
|
||||
|
||||
# AFDO profile
|
||||
[ ! -f "chrome/android/profiles/afdo.prof" ] && {
|
||||
AFDO_NAME="$(cat "chrome/android/profiles/newest.txt")"
|
||||
[ ! -f "${dl_dir}/${AFDO_NAME}" ] && curl -f --connect-timeout 20 --retry 5 --location --insecure "https://storage.googleapis.com/chromeos-prebuilt/afdo-job/llvm/${AFDO_NAME}" -o "${dl_dir}/${AFDO_NAME}"
|
||||
bzip2 -cd > "chrome/android/profiles/afdo.prof" < "${dl_dir}/${AFDO_NAME}"
|
||||
}
|
||||
|
||||
# Download Clang
|
||||
[ ! -d "third_party/llvm-build/Release+Asserts/bin" ] && {
|
||||
mkdir -p "third_party/llvm-build/Release+Asserts"
|
||||
CLANG_REVISION="$(python3 "tools/clang/scripts/update.py" --print-revision)"
|
||||
[ ! -f "${dl_dir}/clang-${CLANG_REVISION}.tgz" ] && curl -f --connect-timeout 20 --retry 5 --location --insecure "https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-${CLANG_REVISION}.tgz" -o "${dl_dir}/clang-${CLANG_REVISION}.tgz"
|
||||
tar -xzf "${dl_dir}/clang-${CLANG_REVISION}.tgz" -C "third_party/llvm-build/Release+Asserts"
|
||||
}
|
||||
|
||||
# Download GN tool
|
||||
[ ! -f "gn/out/gn" ] && {
|
||||
mkdir -p "gn/out"
|
||||
GN_VERSION="$(grep "'gn_version':" "buildtools/DEPS" | cut -d"'" -f4)"
|
||||
[ ! -f "${dl_dir}/gn-${GN_VERSION}.zip" ] && curl -f --connect-timeout 20 --retry 5 --location --insecure "https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/${GN_VERSION}" -o "${dl_dir}/gn-${GN_VERSION}.zip"
|
||||
unzip -o "${dl_dir}/gn-${GN_VERSION}.zip" -d "gn/out"
|
||||
}
|
||||
|
||||
# Set ENV
|
||||
export DEPOT_TOOLS_WIN_TOOLCHAIN=0
|
||||
export naive_flags="
|
||||
is_official_build=true
|
||||
exclude_unwind_tables=true
|
||||
enable_resource_whitelist_generation=false
|
||||
symbol_level=0
|
||||
is_clang=true
|
||||
use_sysroot=false
|
||||
|
||||
use_allocator=\"none\"
|
||||
use_allocator_shim=false
|
||||
|
||||
fatal_linker_warnings=false
|
||||
treat_warnings_as_errors=false
|
||||
|
||||
fieldtrial_testing_like_official_build=true
|
||||
|
||||
enable_nacl=false
|
||||
enable_print_preview=false
|
||||
enable_remoting=false
|
||||
use_alsa=false
|
||||
use_cups=false
|
||||
use_dbus=false
|
||||
use_gio=false
|
||||
use_platform_icu_alternatives=true
|
||||
use_gtk=false
|
||||
use_system_libdrm=false
|
||||
use_gnome_keyring=false
|
||||
use_libpci=false
|
||||
use_pangocairo=false
|
||||
use_aura=false
|
||||
use_glib=false
|
||||
use_pulseaudio=false
|
||||
use_udev=false
|
||||
|
||||
disable_file_support=true
|
||||
enable_websockets=false
|
||||
disable_ftp_support=true
|
||||
use_kerberos=false
|
||||
enable_mdns=false
|
||||
enable_reporting=false
|
||||
include_transport_security_state_preload_list=false
|
||||
rtc_use_pipewire=false
|
||||
|
||||
use_xkbcommon=false
|
||||
use_ozone=true
|
||||
ozone_auto_platforms=false
|
||||
ozone_platform=\"headless\"
|
||||
ozone_platform_headless=true
|
||||
|
||||
current_os=\"linux\"
|
||||
current_cpu=\"${naive_arch}\"
|
||||
sysroot=\"${toolchain_dir}\"
|
||||
custom_toolchain=\"//build/toolchain/linux:clang_${naive_arch}_openwrt\"
|
||||
ldso_path=\"${ldso_path}\""
|
||||
[ "${target_arch}" == "arm" ] && {
|
||||
naive_flags="${naive_flags} arm_version=0 arm_cpu=\"${cpu_type}\""
|
||||
[ -n "${cpu_subtype}" ] && { echo "${cpu_subtype}" | grep -q "neon" && neon_flag="arm_use_neon=true" || neon_flag="arm_use_neon=false"; naive_flags="${naive_flags} arm_fpu=\"${cpu_subtype}\" arm_float_abi=\"hard\" ${neon_flag}"; } || naive_flags="${naive_flags} arm_float_abi=\"soft\" arm_use_neon=false"
|
||||
}
|
||||
[[ "mips mips64 mipsel mips64el" =~ (^|[[:space:]])"${target_arch}"($|[[:space:]]) ]] && {
|
||||
naive_flags="${naive_flags} use_gold=false is_cfi=false use_cfi_icall=false use_thin_lto=false mips_arch_variant=\"r2\""
|
||||
[[ "${target_arch}" =~ ^"mips"$|^"mipsel"$ ]] && naive_flags="mips_float_abi=\"soft\" mips_tune=\"${cpu_type}\""
|
||||
}
|
||||
@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=3.9
|
||||
PKG_RELEASE:=42
|
||||
PKG_DATE:=20200822
|
||||
PKG_RELEASE:=43
|
||||
PKG_DATE:=20200825
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ end
|
||||
s:tab("DNS", translate("DNS"))
|
||||
|
||||
o = s:taboption("DNS", Value, "up_china_dns", translate("Resolver For Local/WhiteList Domains") .. "(UDP)")
|
||||
o.description = translate("Forced to local filter mode on 'Not China List' mode<br />IP:Port mode acceptable, multi value split with english comma.")
|
||||
o.description = translate("IP:Port mode acceptable, multi value split with english comma.")
|
||||
o.default = "default"
|
||||
o:value("default", translate("Default"))
|
||||
o:value("223.5.5.5", "223.5.5.5 (" .. translate("Ali") .. "DNS)")
|
||||
@ -182,7 +182,12 @@ o:depends({dns_mode = "chinadns-ng", up_trust_chinadns_ng_dns = "dns2socks"})
|
||||
o:depends({dns_mode = "dns2socks"})
|
||||
o:depends({dns_mode = "pdnsd"})
|
||||
|
||||
o = s:taboption("DNS", Button, "clear_ipset", translate("Clear IPSET"))
|
||||
o = s:taboption("DNS", ListValue, "dns_default", translate("Dnsmasq default dns"), translate("When the accessed domain name does not exist in the rule list, the default DNS used."))
|
||||
o.default = "china"
|
||||
o:value("china", translate("China"))
|
||||
o:value("remote", translate("Remote"))
|
||||
|
||||
o = s:taboption("DNS", Button, "clear_ipset", translate("Clear IPSET"), translate("Try this feature if the rule modification does not take effect."))
|
||||
o.inputstyle = "remove"
|
||||
function o.write(e, e)
|
||||
luci.sys.call("/etc/init.d/" .. appname .. " stop && /usr/share/" .. appname .. "/iptables.sh flush_ipset && /etc/init.d/" .. appname .. " restart")
|
||||
|
||||
@ -151,8 +151,8 @@ msgstr "定义接受 IP:Port 形式的输入,以指定其它域名服务的过
|
||||
msgid "Resolver For Local/WhiteList Domains"
|
||||
msgstr "解析本地和白名单域名"
|
||||
|
||||
msgid "Forced to local filter mode on 'Not China List' mode<br />IP:Port mode acceptable, multi value split with english comma."
|
||||
msgstr "在 '中国列表以外' 模式下会被强制设置为设定的DNS过滤服务<br />接受 IP:Port 形式的输入,多个以英文逗号分隔。"
|
||||
msgid "IP:Port mode acceptable, multi value split with english comma."
|
||||
msgstr "接受 IP:Port 形式的输入,多个以英文逗号分隔。"
|
||||
|
||||
msgid "Ali"
|
||||
msgstr "阿里"
|
||||
@ -184,14 +184,23 @@ msgstr "ChinaDNS-NG 公平模式"
|
||||
msgid "Filtered DNS(For Proxied Domains)"
|
||||
msgstr "域名过滤服务(用于被代理的域名)"
|
||||
|
||||
msgid "IP:Port mode acceptable, the 1st for 'dns2socks' if split with english comma."
|
||||
msgstr "接受 IP:Port 形式的输入,多个以英文逗号分隔 ,'dns2socks' 模式下仅首个有效。"
|
||||
|
||||
msgid "Cache Resolved"
|
||||
msgstr "缓存解析结果"
|
||||
|
||||
msgid "Dnsmasq default dns"
|
||||
msgstr "Dnsmasq的默认DNS"
|
||||
|
||||
msgid "When the accessed domain name does not exist in the rule list, the default DNS used."
|
||||
msgstr "当访问的域名不存在规则列表中,使用的默认DNS。"
|
||||
|
||||
msgid "Clear IPSET"
|
||||
msgstr "清空 IPSET"
|
||||
|
||||
msgid "IP:Port mode acceptable, the 1st for 'dns2socks' if split with english comma."
|
||||
msgstr "接受 IP:Port 形式的输入,多个以英文逗号分隔 ,'dns2socks' 模式下仅首个有效。"
|
||||
msgid "Try this feature if the rule modification does not take effect."
|
||||
msgstr "如果修改规则后没有生效,请尝试此功能。"
|
||||
|
||||
msgid "The server client can also use this rule to scientifically surf the Internet."
|
||||
msgstr "本机服务器的客户端也可以使用这个代理模式上网。"
|
||||
@ -622,8 +631,8 @@ msgstr "防火墙域名列表(gfwlist)更新URL"
|
||||
msgid "China IPs(chnroute) Update URL"
|
||||
msgstr "中国IP段(chnroute)更新URL"
|
||||
|
||||
msgid "China IPv6s(chnroute) Update URL"
|
||||
msgstr "中国IPv6段(chnroute)更新URL"
|
||||
msgid "China IPv6s(chnroute6) Update URL"
|
||||
msgstr "中国IPv6段(chnroute6)更新URL"
|
||||
|
||||
msgid "Rule status"
|
||||
msgstr "规则版本"
|
||||
@ -703,6 +712,12 @@ msgstr "Kcptun 客户端路径"
|
||||
msgid "Brook Path"
|
||||
msgstr "Brook 路径"
|
||||
|
||||
msgid "Trojan-Go Version API"
|
||||
msgstr "Trojan-Go 版本 API"
|
||||
|
||||
msgid "alternate API URL for version checking"
|
||||
msgstr "用于版本检查的 API URL"
|
||||
|
||||
msgid "Node Subscribe"
|
||||
msgstr "节点订阅"
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ config global
|
||||
option dns_mode 'pdnsd'
|
||||
option up_china_dns 'default'
|
||||
option dns_forward '8.8.4.4'
|
||||
option dns_default 'china'
|
||||
option use_tcp_node_resolve_dns '1'
|
||||
option tcp_proxy_mode 'chnroute'
|
||||
option udp_proxy_mode 'chnroute'
|
||||
@ -40,12 +41,12 @@ config global_rules
|
||||
option auto_update '0'
|
||||
option chnlist_update '1'
|
||||
option chnroute_update '1'
|
||||
option chnroute6_update '0'
|
||||
option chnroute6_update '1'
|
||||
option gfwlist_update '1'
|
||||
option gfwlist_version '2020-08-20'
|
||||
option chnroute_version '2020-08-20'
|
||||
option chnroute6_version '2020-08-20'
|
||||
option chnlist_version '2020-08-20'
|
||||
option chnroute6_version '2020-08-22'
|
||||
option gfwlist_version '2020-08-24'
|
||||
option chnroute_version '2020-08-24'
|
||||
option chnlist_version '2020-08-24'
|
||||
option enable_custom_url '0'
|
||||
option gfwlist_url 'https://cdn.jsdelivr.net/gh/Loukky/gfwlist-by-loukky/gfwlist.txt'
|
||||
option chnroute_url 'https://ispip.clang.cn/all_cn.txt'
|
||||
|
||||
@ -283,6 +283,7 @@ load_config() {
|
||||
DNS_MODE=$(config_t_get global dns_mode pdnsd)
|
||||
DNS_FORWARD=$(config_t_get global dns_forward 8.8.4.4:53 | sed 's/:/#/g')
|
||||
DNS_CACHE=$(config_t_get global dns_cache 1)
|
||||
DNS_DEFAULT=$(config_t_get global dns_default china)
|
||||
process=1
|
||||
if [ "$(config_t_get global_forwarding process 0)" = "0" ]; then
|
||||
process=$(cat /proc/cpuinfo | grep 'processor' | wc -l)
|
||||
@ -696,7 +697,7 @@ start_dns() {
|
||||
[ "$(config_t_get global fair_mode 1)" = "1" ] && extra_mode="-f"
|
||||
ln_start_bin "$(first_type chinadns-ng)" chinadns-ng -l "${DNS_PORT}" ${china_ng_chn:+-c "${china_ng_chn}"} ${chnlist_param:+-m "${chnlist_param}" -M} ${china_ng_gfw:+-t "${china_ng_gfw}"} ${gfwlist_param:+-g "${gfwlist_param}"} $extra_mode
|
||||
echolog " + 过滤服务:ChinaDNS-NG(:${DNS_PORT}${extra_mode}) + ${msg}:中国域名列表:${china_ng_chn:-D114.114.114.114},防火墙域名列表:${china_ng_gfw:-D8.8.8.8}"
|
||||
[ -n "${global}${chnlist}" ] && [ -z "${returnhome}" ] && TUN_DNS="${china_ng_gfw}"
|
||||
#[ -n "${global}${chnlist}" ] && [ -z "${returnhome}" ] && TUN_DNS="${china_ng_gfw}"
|
||||
;;
|
||||
*)
|
||||
TUN_DNS="$(echo ${DNS_MODE} | sed 's/:/#/g')"
|
||||
@ -740,24 +741,29 @@ add_dnsmasq() {
|
||||
[ "${DNS_MODE}" = "other_dns" ] || [ "${DNS_MODE}" = "chinadns-ng" ] && force_local=3
|
||||
fi
|
||||
[ "${DNS_MODE}" = "other_dns" ] || [ "${DNS_MODE}" = "chinadns-ng" ] || [ -n "${global}${chnlist}" ] && filtered_dns=1
|
||||
[ "${DNS_DEFAULT}" = "china" ] && unset filtered_dns
|
||||
|
||||
#始终用国内DNS解析节点域名
|
||||
fwd_dns="${LOCAL_DNS}"
|
||||
servers=$(uci show "${CONFIG}" | grep ".address=" | cut -d "'" -f 2)
|
||||
hosts_foreach "servers" host_from_url | grep -v "google.c" | grep '[a-zA-Z]$' | sort -u | gen_dnsmasq_items "vpsiplist" "${fwd_dns}" "${TMP_DNSMASQ_PATH}/vpsiplist_host.conf"
|
||||
echolog " - [$?]节点列表中的域名(vpsiplist):${fwd_dns:-默认}"
|
||||
|
||||
fwd_dns="${LOCAL_DNS}"
|
||||
[ -z "${global}" ] && {
|
||||
[ -z "${chnlist}" ] || [ -n "${returnhome}" ] && [ -n "${force_local}" ] && unset fwd_dns
|
||||
[ "${DNS_DEFAULT}" = "china" ] && unset fwd_dns
|
||||
[ "${DNS_MODE}" = "chinadns-ng" ] && unset fwd_dns
|
||||
[ "${DNS_MODE}" = "other_dns" ] && fwd_dns="${TUN_DNS}"
|
||||
sort -u "${RULES_PATH}/direct_host" | gen_dnsmasq_items "whitelist" "${fwd_dns}" "${TMP_DNSMASQ_PATH}/direct_host.conf"
|
||||
echolog " - [$?]域名白名单(whitelist):${fwd_dns:-默认}"
|
||||
}
|
||||
|
||||
servers=$(uci show "${CONFIG}" | grep ".address=" | cut -d "'" -f 2)
|
||||
[ "${filtered_dns}" = "1" ] && [ "${DNS_MODE}" != "chinadns-ng" ] && [ -z "${global}${chnlist}" ] && unset fwd_dns
|
||||
hosts_foreach "servers" host_from_url | grep -v "google.c" | grep '[a-zA-Z]$' | sort -u | gen_dnsmasq_items "vpsiplist" "${fwd_dns}" "${TMP_DNSMASQ_PATH}/vpsiplist_host.conf"
|
||||
echolog " - [$?]节点列表中的域名(vpsiplist):${fwd_dns:-默认}"
|
||||
|
||||
[ -n "${returnhome}" ] || [ "${filtered_dns}" = "1" ] && {
|
||||
[ -n "${gfwlist}" ] && fwd_dns="${LOCAL_DNS}"
|
||||
[ -n "${returnhome}" ] && fwd_dns="${TUN_DNS}"
|
||||
[ "${filtered_dns}" = "1" ] && [ -z "${chnlist}" ] && unset fwd_dns
|
||||
[ "${DNS_DEFAULT}" = "china" ] && unset fwd_dns
|
||||
[ -n "${global}" ] && unset fwd_dns
|
||||
sort -u "${RULES_PATH}/chnlist" | gen_dnsmasq_items "chnroute" "${fwd_dns}" "${TMP_DNSMASQ_PATH}/chinalist_host.conf"
|
||||
echolog " - [$?]中国域名表(chnroute):${fwd_dns:-默认}"
|
||||
@ -769,7 +775,7 @@ add_dnsmasq() {
|
||||
sort -u "${RULES_PATH}/proxy_host" | gen_dnsmasq_items "blacklist" "${fwd_dns}" "${TMP_DNSMASQ_PATH}/proxy_host.conf"
|
||||
echolog " - [$?]代理域名表(blacklist):${fwd_dns:-默认}"
|
||||
|
||||
[ -n "${gfwlist}" ] || [ "${filtered_dns}" = "1" ] && [ -z "${returnhome}" ] && {
|
||||
[ -z "${returnhome}" ] && {
|
||||
[ "${filtered_dns}" = "1" ] && [ "${DNS_MODE}" != "chinadns-ng" ] && unset fwd_dns
|
||||
sort -u "${TMP_PATH}/gfwlist.txt" | gen_dnsmasq_items "gfwlist" "${fwd_dns}" "${TMP_DNSMASQ_PATH}/gfwlist.conf"
|
||||
#sort -u "${TMP_PATH}/gfwlist.txt" | gen_dnsmasq_items "gfwlist,gfwlist6" "${fwd_dns}" "${TMP_DNSMASQ_PATH}/gfwlist.conf"
|
||||
@ -792,14 +798,15 @@ add_dnsmasq() {
|
||||
echo "conf-dir=${TMP_DNSMASQ_PATH}" > "${DNSMASQ_PATH}/dnsmasq-${CONFIG}.conf"
|
||||
|
||||
[ "${filtered_dns}" = "1" ] && [ -z "${returnhome}" ] && servers="${TUN_DNS}"
|
||||
if [ "${DNS_MODE}" = "chinadns-ng" ]; then
|
||||
[ -z "${global}${chnlist}" ] && servers="127.0.0.1#${DNS_PORT}" && msg="chinadns-ng"
|
||||
fi
|
||||
[ -n "${chnlist}" ] && msg="中国列表以外"
|
||||
[ -n "${returnhome}" ] && msg="中国列表"
|
||||
[ -n "${global}" ] && msg="全局"
|
||||
if [ "${DNS_MODE}" = "other_dns" ]; then
|
||||
msg="指定DNS"
|
||||
elif [ "${DNS_MODE}" = "chinadns-ng" ]; then
|
||||
#[ -z "${global}${chnlist}" ] && servers="127.0.0.1#${DNS_PORT}" && msg="chinadns-ng"
|
||||
#直接交给Chinadns-ng处理
|
||||
servers="${TUN_DNS}" && msg="chinadns-ng"
|
||||
else
|
||||
[ "${IS_DEFAULT_DNS}" = "1" ] && [ "${filtered_dns}" != "1" ] && {
|
||||
echolog " - 不强制设置默认DNS(上级分配)!"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -4076,6 +4076,7 @@
|
||||
103.154.162.0/23
|
||||
103.154.164.0/23
|
||||
103.154.168.0/23
|
||||
103.154.242.0/23
|
||||
103.192.0.0/22
|
||||
103.192.4.0/22
|
||||
103.192.8.0/22
|
||||
|
||||
@ -4922,20 +4922,22 @@ server=/.xxxfuckmom.com/127.0.0.1#7913
|
||||
ipset=/.xxxfuckmom.com/gfwlist
|
||||
server=/.macts.com.tw/127.0.0.1#7913
|
||||
ipset=/.macts.com.tw/gfwlist
|
||||
server=/.xn--90wwvt03e.com/127.0.0.1#7913
|
||||
ipset=/.xn--90wwvt03e.com/gfwlist
|
||||
server=/.crrev.com/127.0.0.1#7913
|
||||
ipset=/.crrev.com/gfwlist
|
||||
server=/.hitomi.la/127.0.0.1#7913
|
||||
ipset=/.hitomi.la/gfwlist
|
||||
server=/.xn--90wwvt03e.com/127.0.0.1#7913
|
||||
ipset=/.xn--90wwvt03e.com/gfwlist
|
||||
server=/.xn--oiq.cc/127.0.0.1#7913
|
||||
ipset=/.xn--oiq.cc/gfwlist
|
||||
server=/.xn--i2ru8q2qg.com/127.0.0.1#7913
|
||||
ipset=/.xn--i2ru8q2qg.com/gfwlist
|
||||
server=/.heungkongdiscuss.com/127.0.0.1#7913
|
||||
ipset=/.heungkongdiscuss.com/gfwlist
|
||||
server=/.xn--4gq171p.com/127.0.0.1#7913
|
||||
ipset=/.xn--4gq171p.com/gfwlist
|
||||
server=/.heungkongdiscuss.com/127.0.0.1#7913
|
||||
ipset=/.heungkongdiscuss.com/gfwlist
|
||||
server=/.jingsim.org/127.0.0.1#7913
|
||||
ipset=/.jingsim.org/gfwlist
|
||||
server=/.atc.org.au/127.0.0.1#7913
|
||||
ipset=/.atc.org.au/gfwlist
|
||||
server=/.asianews.it/127.0.0.1#7913
|
||||
@ -9696,8 +9698,8 @@ server=/.freechinaforum.org/127.0.0.1#7913
|
||||
ipset=/.freechinaforum.org/gfwlist
|
||||
server=/.spotify.com/127.0.0.1#7913
|
||||
ipset=/.spotify.com/gfwlist
|
||||
server=/.jingsim.org/127.0.0.1#7913
|
||||
ipset=/.jingsim.org/gfwlist
|
||||
server=/.comparitech.com/127.0.0.1#7913
|
||||
ipset=/.comparitech.com/gfwlist
|
||||
server=/.tibetanaidproject.org/127.0.0.1#7913
|
||||
ipset=/.tibetanaidproject.org/gfwlist
|
||||
server=/.goagent.biz/127.0.0.1#7913
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-clash
|
||||
PKG_VERSION:=v1.7.5.6
|
||||
PKG_VERSION:=v1.7.5.7
|
||||
PKG_MAINTAINER:=frainzy1477
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -144,6 +144,8 @@ define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_BIN) ./root/usr/share/clash/clash_real.txt $(1)/usr/share/clash
|
||||
$(INSTALL_BIN) ./root/usr/share/clash/logstatus_check $(1)/usr/share/clash
|
||||
$(INSTALL_BIN) ./root/usr/share/clash/clash.txt $(1)/usr/share/clash
|
||||
$(INSTALL_BIN) ./root/usr/share/clash/chinaipset.sh $(1)/usr/share/clash
|
||||
$(INSTALL_BIN) ./root/usr/share/clash/china_ip.txt $(1)/usr/share/clash
|
||||
|
||||
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/index.html $(1)/etc/clash/dashboard
|
||||
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/main.658aa6a6e3feec8f168b.css $(1)/etc/clash/dashboard
|
||||
|
||||
@ -11,7 +11,7 @@ function index()
|
||||
return
|
||||
end
|
||||
|
||||
local page = entry({"admin", "services", "clash"},alias("admin", "services", "clash", "overview"), _("Clash"), 5)
|
||||
local page = entry({"admin", "services", "clash"},alias("admin", "services", "clash", "overview"), _("Clash"), 1)
|
||||
page.dependent = true
|
||||
page.acl_depends = {"luci-app-clash"}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ o:value("1", translate("Enable"))
|
||||
o.description = translate("Set rules under Setting=>Game Rules, will take effect when client start")
|
||||
|
||||
|
||||
o = s:option(ListValue, "append_rules", translate("Customs Rules"))
|
||||
o = s:option(ListValue, "append_rules", translate("Append Customs Rules"))
|
||||
o.default = "0"
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("1", translate("Enable"))
|
||||
|
||||
@ -25,11 +25,6 @@ y:value("0", translate("disabled"))
|
||||
y:value("1", translate("enabled"))
|
||||
y.description = translate("Set to enable or disable dns cache")
|
||||
|
||||
y = s:option(ListValue, "enable_udp", translate("Enable UDP"))
|
||||
y:value("0", translate("disabled"))
|
||||
y:value("1", translate("enabled"))
|
||||
y.description = translate("Enable udp traffic ,make sure your server support udp")
|
||||
|
||||
y = s:option(ListValue, "access_control", translate("Access Control"))
|
||||
y:value("0", translate("disabled"))
|
||||
y:value("1", translate("Whitelist IPs"))
|
||||
|
||||
@ -106,9 +106,9 @@ s = k:section(TypedSection, "clash",translate("Download Online"))
|
||||
s.anonymous = true
|
||||
o = s:option(ListValue, "dcore", translate("Core Type"))
|
||||
o.default = "clashcore"
|
||||
o:value("1", translate("Clash"))
|
||||
o:value("3", translate("Clash(ctun)"))
|
||||
o:value("4", translate("Clash(premium)"))
|
||||
o:value("1", translate("clash"))
|
||||
o:value("3", translate("clash(ctun)"))
|
||||
o:value("4", translate("clash(premium)"))
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -993,8 +993,8 @@ msgstr "选择类型"
|
||||
msgid "Set custom rules under Setting=>Others , will take effect when client start"
|
||||
msgstr "在“设置”=>“其他”下设置自定义规则,将在客户端启动时生效"
|
||||
|
||||
msgid "Customs Rules"
|
||||
msgstr "自定义规则"
|
||||
msgid "Append Customs Rules"
|
||||
msgstr "附加自定义规则"
|
||||
|
||||
msgid "Edit Custom Rule & Group"
|
||||
msgstr "编辑自定义规则组"
|
||||
@ -1276,4 +1276,4 @@ msgid "No Protocol"
|
||||
msgstr "不带协议"
|
||||
|
||||
msgid "GeoIP Source"
|
||||
msgstr "GeoIP下载连接"
|
||||
msgstr "GeoIP下载连接"
|
||||
@ -263,7 +263,7 @@ rules(){
|
||||
ipset add localnetwork "$wan_ip4s" 2>/dev/null
|
||||
done
|
||||
fi
|
||||
|
||||
sh /usr/share/clash/chinaipset.sh >/dev/null 2>&1
|
||||
|
||||
|
||||
if [ "$(iptables -t nat -nL PREROUTING --line-number |grep "udp dpt:53" |grep "0.0.0.0/0 \{0,\}0.0.0.0/0" |wc -l)" -gt 1 ] && [ "$dnsforwader" -eq "1" ]; then
|
||||
@ -304,24 +304,24 @@ rules(){
|
||||
iptables -t nat -F clash
|
||||
iptables -t nat -A clash -m set --match-set localnetwork dst -j RETURN
|
||||
iptables -t nat -A clash -m set --match-set reject_lan src -j RETURN
|
||||
iptables -t nat -A clash -m set ! --match-set proxy_lan src -j RETURN
|
||||
iptables -t nat -A clash -m set ! --match-set proxy_lan src -j RETURN
|
||||
iptables -t nat -A clash -m set --match-set china dst -j RETURN
|
||||
iptables -t nat -A clash -p tcp -j REDIRECT --to-ports "${redir_port}"
|
||||
iptables -t nat -I PREROUTING -p tcp -d 8.8.8.8 -j REDIRECT --to-ports "${redir_port}"
|
||||
iptables -t nat -I PREROUTING -p tcp -d 8.8.4.4 -j REDIRECT --to-ports "${redir_port}"
|
||||
iptables -t nat -A PREROUTING -p tcp -j clash
|
||||
iptables -t nat -A PREROUTING -p tcp -j clash
|
||||
|
||||
|
||||
|
||||
|
||||
if [ "${enable_udp}" -eq 1 ]; then
|
||||
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE"
|
||||
ip route add local 0.0.0.0/0 dev lo table "$PROXY_ROUTE_TABLE"
|
||||
iptables -t mangle -N clash
|
||||
iptables -t mangle -A clash -m set --match-set localnetwork dst -j RETURN
|
||||
iptables -t mangle -A clash -m set --match-set reject_lan src -j RETURN
|
||||
iptables -t mangle -A clash -m set ! --match-set proxy_lan src -j RETURN
|
||||
iptables -t mangle -A clash -p udp -j TPROXY --on-port "${redir_port}" --tproxy-mark "$PROXY_FWMARK"
|
||||
iptables -t mangle -A PREROUTING -p udp -j clash
|
||||
fi
|
||||
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE"
|
||||
ip route add local 0.0.0.0/0 dev lo table "$PROXY_ROUTE_TABLE"
|
||||
iptables -t mangle -N clash
|
||||
iptables -t mangle -A clash -m set --match-set localnetwork dst -j RETURN
|
||||
iptables -t mangle -A clash -m set --match-set reject_lan src -j RETURN
|
||||
iptables -t mangle -A clash -m set ! --match-set proxy_lan src -j RETURN
|
||||
iptables -t mangle -A clash -m set --match-set china dst -j RETURN
|
||||
iptables -t mangle -A clash -p udp -j TPROXY --on-port "${redir_port}" --tproxy-mark "$PROXY_FWMARK"
|
||||
iptables -t mangle -A PREROUTING -p udp -j clash
|
||||
|
||||
|
||||
|
||||
if [ "${fake_ip}" == "fake-ip" ];then
|
||||
@ -383,12 +383,14 @@ rules(){
|
||||
iptables -t mangle -N clash
|
||||
iptables -t mangle -F clash
|
||||
iptables -t mangle -A clash -m set --match-set localnetwork dst -j RETURN
|
||||
iptables -t mangle -A TROJAN_GO -m set --match-set china dst -j RETURN
|
||||
if [ "${fake_ip}" == "fake-ip" ];then
|
||||
iptables -t mangle -A clash -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK"
|
||||
fi
|
||||
|
||||
iptables -t mangle -I OUTPUT -j clash
|
||||
iptables -t mangle -I PREROUTING -m set ! --match-set localnetwork dst -j MARK --set-mark "$PROXY_FWMARK"
|
||||
iptables -t mangle -I PREROUTING -m set ! --match-set china dst -j MARK --set-mark "$PROXY_FWMARK"
|
||||
iptables -t mangle -I PREROUTING -m set --match-set reject_lan src -j RETURN >/dev/null 2>&1
|
||||
iptables -t mangle -I PREROUTING -m set ! --match-set proxy_lan src -j RETURN >/dev/null 2>&1
|
||||
iptables -t nat -I PREROUTING -p tcp --dport 53 -j ACCEPT
|
||||
@ -734,11 +736,17 @@ remove_mark(){
|
||||
iptables -t mangle -D PREROUTING $prer 2>/dev/null
|
||||
done
|
||||
|
||||
pre1=$(iptables -nvL PREROUTING -t mangle | sed 1,2d | sed -n '/! match-set china dst MARK set 0x162/=' | sort -r)
|
||||
for prer in $pre1; do
|
||||
iptables -t mangle -D PREROUTING $prer 2>/dev/null
|
||||
done
|
||||
|
||||
pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d |sed -n '/8\.8\./=' 2>/dev/null |sort -rn)
|
||||
for pre_line in $pre_lines; do
|
||||
iptables -t nat -D PREROUTING "$pre_line" >/dev/null 2>&1
|
||||
done
|
||||
|
||||
|
||||
|
||||
iptables -t nat -D PREROUTING -p tcp --dport 53 -j ACCEPT >/dev/null 2>&1
|
||||
iptables -t nat -D PREROUTING -p udp --dport 53 -j DNAT --to "127.0.0.1:$dns_port"
|
||||
|
||||
@ -757,6 +765,8 @@ remove_mark(){
|
||||
ipset -! flush reject_lan >/dev/null 2>&1
|
||||
ipset destroy reject_lan >/dev/null 2>&1
|
||||
ipset destroy proxy_lan >/dev/null 2>&1
|
||||
ipset -! flush china >/dev/null 2>&1
|
||||
ipset destroy china >/dev/null 2>&1
|
||||
|
||||
proxy_lan=$(iptables -nvL PREROUTING -t mangle | sed 1,2d | sed -n '/! match-set proxy_lan src/=' | sort -r)
|
||||
for natx in $proxy_lan; do
|
||||
@ -790,6 +800,16 @@ remove_mark(){
|
||||
|
||||
iptables -t nat -D OUTPUT -p tcp -j clash_output >/dev/null 2>&1
|
||||
|
||||
|
||||
china_lan2=$(iptables -nvL PREROUTING -t nat | sed 1,2d | sed -n '/match-set china/=' | sort -r)
|
||||
for natx in $china_lan2; do
|
||||
iptables -t mangle -D PREROUTING $natx >/dev/null 2>&1
|
||||
done
|
||||
|
||||
china_lan3$(iptables -nvL PREROUTING -t mangle | sed 1,2d | sed -n '/match-set china/=' | sort -r)
|
||||
for natx in $china_lan3; do
|
||||
iptables -t mangle -D PREROUTING $natx >/dev/null 2>&1
|
||||
done
|
||||
|
||||
ipset destroy localnetwork 2>/dev/null
|
||||
|
||||
@ -939,10 +959,8 @@ reload()
|
||||
{
|
||||
if pidof clash >/dev/null; then
|
||||
remove_mark 2>/dev/null
|
||||
yml_dns_change 2>/dev/null
|
||||
rules 2>/dev/null
|
||||
sleep 5
|
||||
echo "Clash for OpenWRT" >$REAL_LOG
|
||||
echo "Clash Reload Completed"
|
||||
yml_dns_change 2>/dev/null
|
||||
rules 2>/dev/null
|
||||
echo "Clash Reload Completed"
|
||||
fi
|
||||
}
|
||||
}
|
||||
8492
package/ntlf9t/luci-app-clash/root/usr/share/clash/china_ip.txt
Normal file
8492
package/ntlf9t/luci-app-clash/root/usr/share/clash/china_ip.txt
Normal file
File diff suppressed because it is too large
Load Diff
6
package/ntlf9t/luci-app-clash/root/usr/share/clash/chinaipset.sh
Executable file
6
package/ntlf9t/luci-app-clash/root/usr/share/clash/chinaipset.sh
Executable file
@ -0,0 +1,6 @@
|
||||
echo "create china hash:net family inet hashsize 1024 maxelem 65536" > /tmp/china.ipset
|
||||
awk '!/^$/&&!/^#/{printf("add china %s'" "'\n",$0)}' /usr/share/clash/china_ip.txt >> /tmp/china.ipset
|
||||
ipset -! flush china
|
||||
ipset -! restore < /tmp/china.ipset 2>/dev/null
|
||||
rm -f /tmp/china.ipset
|
||||
|
||||
@ -30,3 +30,4 @@ if pidof clash >/dev/null; then
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
v1.7.5.6
|
||||
v1.7.5.7
|
||||
|
||||
Loading…
Reference in New Issue
Block a user