mirror of
https://github.com/kenzok8/openwrt-packages.git
synced 2025-01-07 03:06:43 +08:00
update 2024-10-17 21:12:59
This commit is contained in:
parent
9fb2c1521c
commit
328187fa92
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddns-go
|
||||
PKG_VERSION:=6.7.1
|
||||
PKG_VERSION:=6.7.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/jeessy2/ddns-go/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=2f376b807c72c902f2e1a8a231acf20c4ecb92881c76352cd8144f3fa5ed7a81
|
||||
PKG_HASH:=c583aa1dd160e1a87f4ed3a1ec4b7342c14a5c732f3929f435418a109d3a2a55
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
@ -1,155 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-openclash
|
||||
PKG_VERSION:=0.46.033
|
||||
PKG_RELEASE:=beta
|
||||
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
config PACKAGE_kmod-inet-diag
|
||||
default y if PACKAGE_$(PKG_NAME)
|
||||
|
||||
config PACKAGE_luci-compat
|
||||
default y if PACKAGE_$(PKG_NAME)
|
||||
|
||||
config PACKAGE_kmod-nft-tproxy
|
||||
default y if PACKAGE_firewall4
|
||||
|
||||
config PACKAGE_kmod-ipt-nat
|
||||
default y if ! PACKAGE_firewall4
|
||||
|
||||
config PACKAGE_iptables-mod-tproxy
|
||||
default y if ! PACKAGE_firewall4
|
||||
|
||||
config PACKAGE_iptables-mod-extra
|
||||
default y if ! PACKAGE_firewall4
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=LuCI
|
||||
SUBMENU:=3. Applications
|
||||
TITLE:=LuCI support for clash
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+dnsmasq-full +coreutils +coreutils-nohup +bash +curl +ca-bundle +ipset +ip-full \
|
||||
+libcap +libcap-bin +libcap-bin +ruby +ruby-yaml +kmod-tun +unzip
|
||||
MAINTAINER:=vernesong
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
A LuCI support for clash
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(CP) $(CURDIR)/root $(PKG_BUILD_DIR)
|
||||
$(CP) $(CURDIR)/luasrc $(PKG_BUILD_DIR)
|
||||
$(foreach po,$(wildcard ${CURDIR}/po/zh-cn/*.po), \
|
||||
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
|
||||
sed -i "s/v0.00.00-beta/v$(PKG_VERSION)-beta/g" $(PKG_BUILD_DIR)/root/www/luci-static/resources/openclash/img/version.svg >/dev/null 2>&1
|
||||
chmod 0755 $(PKG_BUILD_DIR)/root/etc/init.d/openclash
|
||||
chmod -R 0755 $(PKG_BUILD_DIR)/root/usr/share/openclash/
|
||||
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/config
|
||||
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/rule_provider
|
||||
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/backup
|
||||
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/core
|
||||
mkdir -p $(PKG_BUILD_DIR)/root/usr/share/openclash/backup
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/config/openclash" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_rules.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_rules.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_rules_2.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_rules_2.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_hosts.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_hosts.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_fake_filter.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_fake_filter.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_domain_dns.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_domain_dns.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_domain_dns_policy.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_domain_dns_policy.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_fallback_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_fallback_filter.yaml" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_force_sniffing_domain.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_force_sniffing_domain.yaml" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_sniffing_domain_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_sniffing_domain_filter.yaml" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_sniffing_ports_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_sniffing_ports_filter.yaml" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_localnetwork_ipv4.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_localnetwork_ipv4.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_localnetwork_ipv6.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_localnetwork_ipv6.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_chnroute_pass.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_chnroute_pass.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_chnroute6_pass.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_chnroute6_pass.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_firewall_rules.sh" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_firewall_rules.sh" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_overwrite.sh" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_overwrite.sh" >/dev/null 2>&1
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/preinst
|
||||
#!/bin/sh
|
||||
if [ -f "/etc/config/openclash" ]; then
|
||||
cp -f "/etc/config/openclash" "/tmp/openclash.bak" >/dev/null 2>&1
|
||||
cp -rf "/etc/openclash" "/tmp/openclash" >/dev/null 2>&1
|
||||
cp -rf "/usr/share/openclash/ui/yacd" "/tmp/openclash_yacd" >/dev/null 2>&1
|
||||
cp -rf "/usr/share/openclash/ui/dashboard" "/tmp/openclash_dashboard" >/dev/null 2>&1
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
sed -i "s/v0.00.00-beta/v$(PKG_VERSION)-beta/g" /www/luci-static/resources/openclash/img/version.svg >/dev/null 2>&1
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
uci -q set openclash.config.enable=0
|
||||
uci -q commit openclash
|
||||
cp -f "/etc/config/openclash" "/tmp/openclash.bak" >/dev/null 2>&1
|
||||
cp -rf "/etc/openclash" "/tmp/openclash" >/dev/null 2>&1
|
||||
cp -rf "/usr/share/openclash/ui/yacd" "/tmp/openclash_yacd" >/dev/null 2>&1
|
||||
cp -rf "/usr/share/openclash/ui/dashboard" "/tmp/openclash_dashboard" >/dev/null 2>&1
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postrm
|
||||
#!/bin/sh
|
||||
dnsmasqconfdir="$(uci -q get dhcp.@dnsmasq[0].confdir || echo '/tmp/dnsmasq.d')"
|
||||
dnsmasqconfdir="${dnsmasqconfdir%*/}"
|
||||
rm -rf /etc/openclash >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash.log >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash_start.log >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash_last_version >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash_config.tmp >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash.change >/dev/null 2>&1
|
||||
rm -rf /tmp/Proxy_Group >/dev/null 2>&1
|
||||
rm -rf /tmp/rules_name >/dev/null 2>&1
|
||||
rm -rf /tmp/rule_providers_name >/dev/null 2>&1
|
||||
rm -rf /tmp/clash_last_version >/dev/null 2>&1
|
||||
rm -rf /usr/share/openclash/backup >/dev/null 2>&1
|
||||
rm -rf ${dnsmasqconfdir}/dnsmasq_openclash_custom_domain.conf >/dev/null 2>&1
|
||||
rm -rf ${dnsmasqconfdir}/dnsmasq_openclash_chnroute_pass.conf >/dev/null 2>&1
|
||||
rm -rf ${dnsmasqconfdir}/dnsmasq_openclash_chnroute6_pass.conf >/dev/null 2>&1
|
||||
rm -rf /tmp/dler* >/dev/null 2>&1
|
||||
rm -rf /tmp/etc/openclash >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash_edit_file_name >/dev/null 2>&1
|
||||
sed -i '/OpenClash Append/,/OpenClash Append End/d' "/usr/lib/lua/luci/model/network.lua" >/dev/null 2>&1
|
||||
sed -i '/.*kB maximum content size*/c\HTTP_MAX_CONTENT = 1024*100 -- 100 kB maximum content size' /usr/lib/lua/luci/http.lua >/dev/null 2>&1
|
||||
sed -i '/.*kB maximum content size*/c\export let HTTP_MAX_CONTENT = 1024*100; // 100 kB maximum content size' /usr/share/ucode/luci/http.uc >/dev/null 2>&1
|
||||
uci -q delete firewall.openclash
|
||||
uci -q commit firewall
|
||||
uci -q delete ucitrack.@openclash[-1]
|
||||
uci -q commit ucitrack
|
||||
rm -rf /tmp/luci-*
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.*.lmo $(1)/usr/lib/lua/luci/i18n/
|
||||
$(CP) $(PKG_BUILD_DIR)/root/* $(1)/
|
||||
$(CP) $(PKG_BUILD_DIR)/luasrc/* $(1)/usr/lib/lua/luci/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
File diff suppressed because it is too large
Load Diff
@ -1,175 +0,0 @@
|
||||
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
|
||||
m = SimpleForm("openclash",translate("OpenClash"))
|
||||
m.description = translate("A Clash Client For OpenWrt")
|
||||
m.reset = false
|
||||
m.submit = false
|
||||
|
||||
m:section(SimpleSection).template = "openclash/status"
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
function config_check(CONFIG_FILE)
|
||||
local yaml = fs.isfile(CONFIG_FILE)
|
||||
if yaml then
|
||||
yaml = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "puts YAML.load_file(\'%s\')" 2>/dev/null',CONFIG_FILE))
|
||||
if yaml ~= "false\n" and yaml ~= "" then
|
||||
return "Config Normal"
|
||||
else
|
||||
return "Config Abnormal"
|
||||
end
|
||||
elseif (yaml ~= 0) then
|
||||
return "File Not Exist"
|
||||
end
|
||||
end
|
||||
|
||||
local e,a={}
|
||||
for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(o)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].num=string.format(t)
|
||||
e[t].name=fs.basename(o)
|
||||
BACKUP_FILE="/etc/openclash/backup/".. e[t].name
|
||||
if fs.mtime(BACKUP_FILE) then
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(BACKUP_FILE))
|
||||
else
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
|
||||
end
|
||||
if uci:get("openclash", "config", "config_path") and string.sub(uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then
|
||||
e[t].state=translate("Enable")
|
||||
else
|
||||
e[t].state=translate("Disable")
|
||||
end
|
||||
e[t].check=translate(config_check(o))
|
||||
end
|
||||
end
|
||||
|
||||
form = SimpleForm("openclash")
|
||||
form.reset = false
|
||||
form.submit = false
|
||||
if a then
|
||||
tb=form:section(Table,e)
|
||||
st=tb:option(DummyValue,"state",translate("State"))
|
||||
nm=tb:option(DummyValue,"name",translate("Config Alias"))
|
||||
sb=tb:option(DummyValue,"name",translate("Subscription Info"))
|
||||
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
|
||||
ck=tb:option(DummyValue,"check",translate("Grammar Check"))
|
||||
st.template="openclash/cfg_check"
|
||||
ck.template="openclash/cfg_check"
|
||||
sb.template="openclash/sub_info_show"
|
||||
|
||||
btnis=tb:option(Button,"switch",translate("Switch Config"))
|
||||
btnis.template="openclash/other_button"
|
||||
btnis.render=function(o,t,a)
|
||||
if not e[t] then return false end
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
a.display=""
|
||||
else
|
||||
a.display="none"
|
||||
end
|
||||
o.inputstyle="apply"
|
||||
Button.render(o,t,a)
|
||||
end
|
||||
btnis.write=function(a,t)
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name)
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "client"))
|
||||
end
|
||||
end
|
||||
|
||||
if not a then
|
||||
local tc = {
|
||||
{create, upload}
|
||||
}
|
||||
tb=form:section(Table,tc)
|
||||
btncr=tb:option(Button,"create",translate("Config Subscribe"))
|
||||
btncr.template="openclash/other_button"
|
||||
btncr.inputstyle="apply"
|
||||
btncr.write=function()
|
||||
local sid = uci:add("openclash", "config_subscribe")
|
||||
if sid then
|
||||
uci:commit("openclash")
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config-subscribe-edit", sid))
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
btnup=tb:option(Button,"upload",translate("Upload Config File"))
|
||||
btnup.template="openclash/other_button"
|
||||
btnup.inputstyle="apply"
|
||||
btnup.write=function()
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
end
|
||||
|
||||
s = SimpleForm("openclash")
|
||||
s.reset = false
|
||||
s.submit = false
|
||||
s:section(SimpleSection).template = "openclash/myip"
|
||||
|
||||
local t = {
|
||||
{enable, disable}
|
||||
}
|
||||
|
||||
ap = SimpleForm("openclash")
|
||||
ap.reset = false
|
||||
ap.submit = false
|
||||
|
||||
ss = ap:section(Table, t)
|
||||
|
||||
o = ss:option(Button, "enable", " ")
|
||||
o.inputtitle = translate("Enable OpenClash")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
end
|
||||
|
||||
o = ss:option(Button, "disable", " ")
|
||||
o.inputtitle = translate("Disable OpenClash")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
uci:set("openclash", "config", "enable", 0)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash stop >/dev/null 2>&1 &")
|
||||
end
|
||||
|
||||
d = SimpleForm("openclash")
|
||||
d.title = translate("Credits")
|
||||
d.reset = false
|
||||
d.submit = false
|
||||
d:section(SimpleSection).template = "openclash/developer"
|
||||
|
||||
dler = SimpleForm("openclash")
|
||||
dler.reset = false
|
||||
dler.submit = false
|
||||
dler:section(SimpleSection).template = "openclash/dlercloud"
|
||||
|
||||
m:append(Template("openclash/select_git_cdn"))
|
||||
|
||||
if uci:get("openclash", "config", "dler_token") then
|
||||
return m, dler, form, s, ap, d
|
||||
else
|
||||
return m, form, s, ap, d
|
||||
end
|
@ -1,630 +0,0 @@
|
||||
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local json = require "luci.jsonc"
|
||||
local datatype = require "luci.cbi.datatypes"
|
||||
|
||||
font_green = [[<b style=color:green>]]
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
local op_mode = string.sub(luci.sys.exec('uci get openclash.config.operation_mode 2>/dev/null'),0,-2)
|
||||
if not op_mode then op_mode = "redir-host" end
|
||||
local lan_int_name = uci:get("openclash", "config", "lan_interface_name") or "0"
|
||||
|
||||
local lan_ip
|
||||
if lan_int_name == "0" then
|
||||
lan_ip = SYS.exec("uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null |tr -d '\n'")
|
||||
else
|
||||
lan_ip = SYS.exec(string.format("ip address show %s | grep -w 'inet' 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | tr -d '\n'", lan_int_name))
|
||||
end
|
||||
if not lan_ip or lan_ip == "" then
|
||||
lan_ip = luci.sys.exec("ip address show $(uci -q -p /tmp/state get network.lan.ifname || uci -q -p /tmp/state get network.lan.device) | grep -w 'inet' 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | tr -d '\n'")
|
||||
end
|
||||
if not lan_ip or lan_ip == "" then
|
||||
lan_ip = luci.sys.exec("ip addr show 2>/dev/null | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | head -n 1 | tr -d '\n'")
|
||||
end
|
||||
m = Map("openclash", translate("Overwrite Settings"))
|
||||
m.pageaction = false
|
||||
m.description = translate("Note: To restore the default configuration, try accessing:").." <a href='javascript:void(0)' onclick='javascript:restore_config(this)'>http://"..lan_ip.."/cgi-bin/luci/admin/services/openclash/restore</a>"
|
||||
|
||||
s = m:section(TypedSection, "openclash")
|
||||
s.anonymous = true
|
||||
|
||||
s:tab("settings", translate("General Settings"))
|
||||
s:tab("dns", "DNS "..translate("Settings"))
|
||||
s:tab("meta", translate("Meta Settings"))
|
||||
s:tab("rules", translate("Rules Setting"))
|
||||
s:tab("developer", translate("Developer Settings"))
|
||||
|
||||
----- General Settings
|
||||
o = s:taboption("settings", ListValue, "interface_name", translate("Bind Network Interface"))
|
||||
local de_int = SYS.exec("ip route |grep 'default' |awk '{print $5}' 2>/dev/null") or SYS.exec("/usr/share/openclash/openclash_get_network.lua 'dhcp'")
|
||||
o.description = translate("Default Interface Name:").." "..font_green..bold_on..de_int..bold_off..font_off..translate(",Try Enable If Network Loopback")
|
||||
local interfaces = SYS.exec("ls -l /sys/class/net/ 2>/dev/null |awk '{print $9}' 2>/dev/null")
|
||||
for interface in string.gmatch(interfaces, "%S+") do
|
||||
o:value(interface)
|
||||
end
|
||||
o:value("0", translate("Disable"))
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("settings", Value, "tolerance", translate("URL-Test Group Tolerance").."(ms)")
|
||||
o.description = translate("Switch To The New Proxy When The Delay Difference Between Old and The Fastest Currently is Greater Than This Value")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("100")
|
||||
o:value("150")
|
||||
o.datatype = "uinteger"
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("settings", Value, "urltest_interval_mod", translate("URL-Test Interval Modify").."(s)")
|
||||
o.description = translate("Modify The URL-Test Interval In The Config")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("180")
|
||||
o:value("300")
|
||||
o.datatype = "uinteger"
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("settings", Value, "urltest_address_mod", translate("URL-Test Address Modify"))
|
||||
o.description = translate("Modify The URL-Test Address In The Config")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("http://www.gstatic.com/generate_204")
|
||||
o:value("http://cp.cloudflare.com/generate_204")
|
||||
o:value("https://cp.cloudflare.com/generate_204")
|
||||
o:value("http://captive.apple.com/generate_204")
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("settings", Value, "github_address_mod", translate("Github Address Modify"))
|
||||
o.description = translate("Modify The Github Address In The Config And OpenClash With Proxy(CDN) To Prevent File Download Faild. Format Reference:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://mirror.ghproxy.com/\")'>https://mirror.ghproxy.com/</a>"
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("https://fastly.jsdelivr.net/")
|
||||
o:value("https://testingcf.jsdelivr.net/")
|
||||
o:value("https://raw.fastgit.org/")
|
||||
o:value("https://cdn.jsdelivr.net/")
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("settings", ListValue, "log_level", translate("Log Level"))
|
||||
o.description = translate("Select Core's Log Level")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("info", translate("Info Mode"))
|
||||
o:value("warning", translate("Warning Mode"))
|
||||
o:value("error", translate("Error Mode"))
|
||||
o:value("debug", translate("Debug Mode"))
|
||||
o:value("silent", translate("Silent Mode"))
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("settings", Value, "dns_port")
|
||||
o.title = translate("DNS Port")
|
||||
o.default = "7874"
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o.description = translate("Please Make Sure Ports Available")
|
||||
|
||||
o = s:taboption("settings", Value, "proxy_port")
|
||||
o.title = translate("Redir Port")
|
||||
o.default = "7892"
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o.description = translate("Please Make Sure Ports Available")
|
||||
|
||||
o = s:taboption("settings", Value, "tproxy_port")
|
||||
o.title = translate("TProxy Port")
|
||||
o.default = "7895"
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o.description = translate("Please Make Sure Ports Available")
|
||||
|
||||
o = s:taboption("settings", Value, "http_port")
|
||||
o.title = translate("HTTP(S) Port")
|
||||
o.default = "7890"
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o.description = translate("Please Make Sure Ports Available")
|
||||
|
||||
o = s:taboption("settings", Value, "socks_port")
|
||||
o.title = translate("SOCKS5 Port")
|
||||
o.default = "7891"
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o.description = translate("Please Make Sure Ports Available")
|
||||
|
||||
o = s:taboption("settings", Value, "mixed_port")
|
||||
o.title = translate("Mixed Port")
|
||||
o.default = "7893"
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o.description = translate("Please Make Sure Ports Available")
|
||||
|
||||
---- DNS Settings
|
||||
|
||||
o = s:taboption("dns", Flag, "enable_custom_dns", font_red..bold_on..translate("Custom DNS Setting")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Set OpenClash Upstream DNS Resolve Server")..bold_off..font_off
|
||||
o.default = 0
|
||||
|
||||
o = s:taboption("dns", Flag, "enable_respect_rules", font_red..bold_on..translate("Respect Rules")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Whether or not The Connection to the DNS Server Follow the Rules in Config")..bold_off..font_off
|
||||
o.default = 0
|
||||
|
||||
o = s:taboption("dns", Flag, "append_wan_dns", translate("Append Upstream DNS"))
|
||||
o.description = translate("Append The Upstream Assigned DNS And Gateway IP To The Nameserver")
|
||||
o.default = 1
|
||||
|
||||
o = s:taboption("dns", Flag, "append_default_dns", translate("Append Default DNS"))
|
||||
o.description = translate("Automatically Append Compliant DNS to default-nameserver")
|
||||
o.default = 1
|
||||
|
||||
if op_mode == "fake-ip" then
|
||||
o = s:taboption("dns", Value, "fakeip_range", translate("Fake-IP Range (IPv4 Cidr)"))
|
||||
o.description = translate("Set Fake-IP Range (IPv4 Cidr)")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("198.18.0.1/16")
|
||||
o.default = "0"
|
||||
o.placeholder = "198.18.0.1/16"
|
||||
function o.validate(self, value)
|
||||
if value == "0" then
|
||||
return "0"
|
||||
end
|
||||
if datatype.cidr4(value) then
|
||||
return value
|
||||
end
|
||||
return "198.18.0.1/16"
|
||||
end
|
||||
|
||||
o = s:taboption("dns", Flag, "store_fakeip", translate("Persistence Fake-IP"))
|
||||
o.description = font_red..bold_on..translate("Cache Fake-IP DNS Resolution Records To File, Improve The Response Speed After Startup")..bold_off..font_off
|
||||
o.default = 1
|
||||
|
||||
end
|
||||
|
||||
o = s:taboption("dns", Flag, "custom_fallback_filter", translate("Fallback-Filter"))
|
||||
o.description = translate("Take Effect If Fallback DNS Setted, Prevent DNS Pollution")
|
||||
o.default = 0
|
||||
|
||||
custom_fallback_filter = s:taboption("dns", Value, "custom_fallback_fil")
|
||||
custom_fallback_filter.template = "cbi/tvalue"
|
||||
custom_fallback_filter.rows = 20
|
||||
custom_fallback_filter.wrap = "off"
|
||||
custom_fallback_filter:depends("custom_fallback_filter", "1")
|
||||
|
||||
function custom_fallback_filter.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/openclash/custom/openclash_custom_fallback_filter.yaml") or ""
|
||||
end
|
||||
function custom_fallback_filter.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_custom_fallback_filter.yaml")
|
||||
if value ~= old_value then
|
||||
NXFS.writefile("/etc/openclash/custom/openclash_custom_fallback_filter.yaml", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if op_mode == "fake-ip" then
|
||||
o = s:taboption("dns", Flag, "custom_fakeip_filter", translate("Fake-IP-Filter"))
|
||||
o.default = 0
|
||||
|
||||
o = s:taboption("dns", ListValue, "custom_fakeip_filter_mode", translate("Fake-IP-Filter-Mode"))
|
||||
o.description = translate("Fake-IP is not returned if the matching succeeds when blacklist mode or Fake-IP is returned if the matching succeeds when whitelist mode")
|
||||
o.default = "blacklist"
|
||||
o:value("blacklist", translate("Blacklist Mode"))
|
||||
o:value("whitelist", translate("Whitelist Mode"))
|
||||
o:depends("custom_fakeip_filter", "1")
|
||||
|
||||
custom_fake_black = s:taboption("dns", Value, "custom_fake_filter")
|
||||
custom_fake_black.template = "cbi/tvalue"
|
||||
custom_fake_black.description = translate("Domain Names In The List Do Not Return Fake-IP, One rule per line")
|
||||
custom_fake_black.rows = 20
|
||||
custom_fake_black.wrap = "off"
|
||||
custom_fake_black:depends("custom_fakeip_filter", "1")
|
||||
|
||||
function custom_fake_black.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/openclash/custom/openclash_custom_fake_filter.list") or ""
|
||||
end
|
||||
function custom_fake_black.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_custom_fake_filter.list")
|
||||
if value ~= old_value then
|
||||
NXFS.writefile("/etc/openclash/custom/openclash_custom_fake_filter.list", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:taboption("dns", Flag, "custom_name_policy", translate("Nameserver-Policy"))
|
||||
o.default = 0
|
||||
|
||||
custom_domain_dns_policy = s:taboption("dns", Value, "custom_domain_dns_core")
|
||||
custom_domain_dns_policy.template = "cbi/tvalue"
|
||||
custom_domain_dns_policy.description = translate("Domain Names In The List Use The Custom DNS Server, But Still Return Fake-IP Results, One rule per line")
|
||||
custom_domain_dns_policy.rows = 20
|
||||
custom_domain_dns_policy.wrap = "off"
|
||||
custom_domain_dns_policy:depends("custom_name_policy", "1")
|
||||
|
||||
function custom_domain_dns_policy.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/openclash/custom/openclash_custom_domain_dns_policy.list") or ""
|
||||
end
|
||||
function custom_domain_dns_policy.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_custom_domain_dns_policy.list")
|
||||
if value ~= old_value then
|
||||
NXFS.writefile("/etc/openclash/custom/openclash_custom_domain_dns_policy.list", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:taboption("dns", Flag, "custom_host", translate("Hosts"))
|
||||
o.default = 0
|
||||
|
||||
custom_hosts = s:taboption("dns", Value, "custom_hosts")
|
||||
custom_hosts.template = "cbi/tvalue"
|
||||
custom_hosts.description = translate("Custom Hosts Here, You May Need to Turn off The Rebinding Protection Option of Dnsmasq When Hosts Has Set a Reserved Address, For More Go:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://lancellc.gitbook.io/clash/clash-config-file/dns/host\")'>https://lancellc.gitbook.io/clash/clash-config-file/dns/host</a>"
|
||||
custom_hosts.rows = 20
|
||||
custom_hosts.wrap = "off"
|
||||
custom_hosts:depends("custom_host", "1")
|
||||
|
||||
function custom_hosts.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/openclash/custom/openclash_custom_hosts.list") or ""
|
||||
end
|
||||
function custom_hosts.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_custom_hosts.list")
|
||||
if value ~= old_value then
|
||||
NXFS.writefile("/etc/openclash/custom/openclash_custom_hosts.list", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Meta
|
||||
o = s:taboption("meta", Flag, "enable_tcp_concurrent", font_red..bold_on..translate("Enable Tcp Concurrent")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("TCP Concurrent Request IPs, Choose The Lowest Latency One To Connection")..bold_off..font_off
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", Flag, "enable_unified_delay", font_red..bold_on..translate("Enable Unified Delay")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Change The Delay Calculation Method To Remove Extra Delays Such as Handshaking")..bold_off..font_off
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", ListValue, "keep_alive_interval", font_red..bold_on..translate("TCP Keep-alive Interval(s)")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Change The TCP Keep-alive Interval, Selecting a Larger Value Avoids Abnormal Resource Consumption")..bold_off..font_off
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("15")
|
||||
o:value("1800")
|
||||
o:value("3600")
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", ListValue, "find_process_mode", translate("Enable Process Rule"))
|
||||
o.description = translate("Whether to Enable Process Rules, If You Are Not Sure, Please Choose off Which Useful in Router Environment")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("off", translate("OFF "))
|
||||
o:value("always", translate("Always "))
|
||||
o:value("strict", translate("strict "))
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", ListValue, "global_client_fingerprint", translate("Client Fingerprint"))
|
||||
o.description = translate("Change The Client Fingerprint, Only Support TLS Transport in TCP/GRPC/WS/HTTP For Vless/Vmess and Trojan")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("none", translate("None "))
|
||||
o:value("random", translate("Random"))
|
||||
o:value("chrome", translate("Chrome"))
|
||||
o:value("firefox", translate("Firefox"))
|
||||
o:value("safari", translate("Safari"))
|
||||
o:value("ios", translate("IOS"))
|
||||
o:value("android", translate("Android"))
|
||||
o:value("edge", translate("Edge"))
|
||||
o:value("360", translate("360"))
|
||||
o:value("qq", translate("QQ"))
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", ListValue, "geodata_loader", translate("Geodata Loader Mode"))
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("memconservative", translate("Memconservative"))
|
||||
o:value("standard", translate("Standard"))
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", Flag, "enable_geoip_dat", translate("Enable GeoIP Dat"))
|
||||
o.description = translate("Replace GEOIP MMDB With GEOIP Dat, Large Size File")..", "..font_red..bold_on..translate("Need Download First")..bold_off..font_off
|
||||
o.default = 0
|
||||
|
||||
o = s:taboption("meta", Flag, "enable_meta_sniffer", font_red..bold_on..translate("Enable Sniffer")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Sniffer Will Prevent Domain Name Proxy and DNS Hijack Failure")..bold_off..font_off
|
||||
o.default = 1
|
||||
|
||||
o = s:taboption("meta", Flag, "enable_meta_sniffer_pure_ip", translate("Forced Sniff Pure IP"))
|
||||
o.description = translate("Forced Sniff Pure IP Connections")
|
||||
o.default = 1
|
||||
o:depends("enable_meta_sniffer", "1")
|
||||
|
||||
o = s:taboption("meta", Flag, "enable_meta_sniffer_custom", translate("Custom Sniffer Settings"))
|
||||
o.description = translate("Custom The Force and Skip Sniffing Doamin Lists")
|
||||
o.default = 0
|
||||
o:depends("enable_meta_sniffer", "1")
|
||||
|
||||
sniffing_domain_force = s:taboption("meta", Value, "sniffing_domain_force")
|
||||
sniffing_domain_force:depends("enable_meta_sniffer_custom", "1")
|
||||
sniffing_domain_force.template = "cbi/tvalue"
|
||||
sniffing_domain_force.description = translate("Will Override Dns Queries If Domains in The List")
|
||||
sniffing_domain_force.rows = 20
|
||||
sniffing_domain_force.wrap = "off"
|
||||
|
||||
function sniffing_domain_force.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/openclash/custom/openclash_force_sniffing_domain.yaml") or ""
|
||||
end
|
||||
function sniffing_domain_force.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_force_sniffing_domain.yaml")
|
||||
if value ~= old_value then
|
||||
NXFS.writefile("/etc/openclash/custom/openclash_force_sniffing_domain.yaml", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
sniffing_port_filter = s:taboption("meta", Value, "sniffing_port_filter")
|
||||
sniffing_port_filter:depends("enable_meta_sniffer_custom", "1")
|
||||
sniffing_port_filter.template = "cbi/tvalue"
|
||||
sniffing_port_filter.description = translate("Will Only Sniffing If Ports in The List")
|
||||
sniffing_port_filter.rows = 20
|
||||
sniffing_port_filter.wrap = "off"
|
||||
|
||||
function sniffing_port_filter.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/openclash/custom/openclash_sniffing_ports_filter.yaml") or ""
|
||||
end
|
||||
function sniffing_port_filter.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_sniffing_ports_filter.yaml")
|
||||
if value ~= old_value then
|
||||
NXFS.writefile("/etc/openclash/custom/openclash_sniffing_ports_filter.yaml", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
sniffing_domain_filter = s:taboption("meta", Value, "sniffing_domain_filter")
|
||||
sniffing_domain_filter:depends("enable_meta_sniffer_custom", "1")
|
||||
sniffing_domain_filter.template = "cbi/tvalue"
|
||||
sniffing_domain_filter.description = translate("Will Disable Sniffing If Domains(sni) in The List")
|
||||
sniffing_domain_filter.rows = 20
|
||||
sniffing_domain_filter.wrap = "off"
|
||||
|
||||
function sniffing_domain_filter.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/openclash/custom/openclash_sniffing_domain_filter.yaml") or ""
|
||||
end
|
||||
function sniffing_domain_filter.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_sniffing_domain_filter.yaml")
|
||||
if value ~= old_value then
|
||||
NXFS.writefile("/etc/openclash/custom/openclash_sniffing_domain_filter.yaml", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---- Rules Settings
|
||||
o = s:taboption("rules", Flag, "rule_source", translate("Enable Other Rules"))
|
||||
o.description = translate("Use Other Rules")
|
||||
o.default = 0
|
||||
|
||||
o = s:taboption("rules", Flag, "enable_rule_proxy", translate("Rule Match Proxy Mode"))
|
||||
o.description = translate("Append Some Rules to Config, Allow Only Traffic Proxies that Match the Rule, Prevent BT/P2P Passing")
|
||||
o.default = 0
|
||||
|
||||
o = s:taboption("rules", Flag, "enable_custom_clash_rules", font_red..bold_on..translate("Custom Clash Rules")..bold_off..font_off)
|
||||
o.description = translate("Use Custom Rules")
|
||||
o.default = 0
|
||||
|
||||
custom_rules = s:taboption("rules", Value, "custom_rules")
|
||||
custom_rules:depends("enable_custom_clash_rules", 1)
|
||||
custom_rules.template = "cbi/tvalue"
|
||||
custom_rules.description = font_green..bold_on..translate("(Priority)")..bold_off..font_off.." "..translate("Custom Rules Here, For More Go:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/rules/\")'>https://wiki.metacubex.one/config/rules/</a>".." ,"..translate("IP To CIDR:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"http://ip2cidr.com\")'>http://ip2cidr.com</a>"
|
||||
custom_rules.rows = 20
|
||||
custom_rules.wrap = "off"
|
||||
|
||||
function custom_rules.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/openclash/custom/openclash_custom_rules.list") or ""
|
||||
end
|
||||
function custom_rules.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_custom_rules.list")
|
||||
if value ~= old_value then
|
||||
NXFS.writefile("/etc/openclash/custom/openclash_custom_rules.list", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
custom_rules_2 = s:taboption("rules", Value, "custom_rules_2")
|
||||
custom_rules_2:depends("enable_custom_clash_rules", 1)
|
||||
custom_rules_2.template = "cbi/tvalue"
|
||||
custom_rules_2.description = font_green..bold_on..translate("(Extended)")..bold_off..font_off.." "..translate("Custom Rules Here, For More Go:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/rules/\")'>https://wiki.metacubex.one/config/rules/</a>".." ,"..translate("IP To CIDR:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"http://ip2cidr.com\")'>http://ip2cidr.com</a>"
|
||||
custom_rules_2.rows = 20
|
||||
custom_rules_2.wrap = "off"
|
||||
|
||||
function custom_rules_2.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/openclash/custom/openclash_custom_rules_2.list") or ""
|
||||
end
|
||||
function custom_rules_2.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_custom_rules_2.list")
|
||||
if value ~= old_value then
|
||||
NXFS.writefile("/etc/openclash/custom/openclash_custom_rules_2.list", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---- developer
|
||||
o = s:taboption("developer", Value, "ymchange_custom")
|
||||
o.template = "cbi/tvalue"
|
||||
o.description = translate("Custom Config Overwrite Scripts Which Will Run After Plugin Own Completely, Please Be Careful, The Wrong Changes May Lead to Exceptions")
|
||||
o.rows = 30
|
||||
o.wrap = "off"
|
||||
|
||||
function o.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/openclash/custom/openclash_custom_overwrite.sh") or ""
|
||||
end
|
||||
function o.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_custom_overwrite.sh")
|
||||
if value ~= old_value then
|
||||
NXFS.writefile("/etc/openclash/custom/openclash_custom_overwrite.sh", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- [[ Edit Custom DNS ]] --
|
||||
ds = m:section(TypedSection, "dns_servers", translate("Add Custom DNS Servers")..translate("(Take Effect After Choose Above)"))
|
||||
ds.anonymous = true
|
||||
ds.addremove = true
|
||||
ds.sortable = true
|
||||
ds.template = "openclash/tblsection_dns"
|
||||
ds.extedit = luci.dispatcher.build_url("admin/services/openclash/custom-dns-edit/%s")
|
||||
function ds.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(ds.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
---- enable flag
|
||||
o = ds:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- group
|
||||
o = ds:option(ListValue, "group", translate("DNS Server Group"))
|
||||
o:value("nameserver", translate("NameServer "))
|
||||
o:value("fallback", translate("FallBack "))
|
||||
o:value("default", translate("Default-NameServer"))
|
||||
o.default = "nameserver"
|
||||
o.rempty = false
|
||||
|
||||
---- IP address
|
||||
o = ds:option(Value, "ip", translate("DNS Server Address"))
|
||||
o.placeholder = translate("Not Null")
|
||||
o.datatype = "or(host, string)"
|
||||
o.rmempty = true
|
||||
|
||||
---- port
|
||||
o = ds:option(Value, "port", translate("DNS Server Port"))
|
||||
o.datatype = "port"
|
||||
o.rempty = true
|
||||
|
||||
---- type
|
||||
o = ds:option(ListValue, "type", translate("DNS Server Type"))
|
||||
o:value("udp", translate("UDP"))
|
||||
o:value("tcp", translate("TCP"))
|
||||
o:value("tls", translate("TLS"))
|
||||
o:value("https", translate("HTTPS"))
|
||||
o:value("quic", translate("QUIC ")..translate("(Only Meta Core)"))
|
||||
o.default = "udp"
|
||||
o.rempty = false
|
||||
|
||||
-- [[ Other Rules Manage ]]--
|
||||
ss = m:section(TypedSection, "other_rules", translate("Other Rules Edit")..translate("(Take Effect After Choose Above)"))
|
||||
ss.anonymous = true
|
||||
ss.addremove = true
|
||||
ss.sortable = true
|
||||
ss.template = "cbi/tblsection"
|
||||
ss.extedit = luci.dispatcher.build_url("admin/services/openclash/other-rules-edit/%s")
|
||||
function ss.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(ss.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
o = ss:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
o = ss:option(DummyValue, "config", translate("Config File"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = ss:option(DummyValue, "rule_name", translate("Other Rules Name"))
|
||||
function o.cfgvalue(...)
|
||||
if Value.cfgvalue(...) == "lhie1" then
|
||||
return translate("lhie1 Rules")
|
||||
else
|
||||
return translate("None")
|
||||
end
|
||||
end
|
||||
|
||||
o = ss:option(DummyValue, "Note", translate("Note"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
-- [[ Edit Authentication ]] --
|
||||
s = m:section(TypedSection, "authentication", translate("Set Authentication of SOCKS5/HTTP(S)"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = false
|
||||
s.template = "cbi/tblsection"
|
||||
s.rmempty = false
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- username
|
||||
o = s:option(Value, "username", translate("Username"))
|
||||
o.placeholder = translate("Not Null")
|
||||
o.rempty = true
|
||||
|
||||
---- password
|
||||
o = s:option(Value, "password", translate("Password"))
|
||||
o.placeholder = translate("Not Null")
|
||||
o.rmempty = true
|
||||
|
||||
local t = {
|
||||
{Commit, Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit("openclash")
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Apply Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 1)
|
||||
m.uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
m:append(Template("openclash/config_editor"))
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
|
||||
return m
|
||||
|
||||
|
@ -1,227 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local sys = require "luci.sys"
|
||||
local json = require "luci.jsonc"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
|
||||
m = Map(openclash, translate("Config Subscribe Edit"))
|
||||
m.pageaction = false
|
||||
m.description=translate("Convert Subscribe function of Online is Supported By subconverter Written By tindy X") ..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("API By tindy X & lhie1")..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("Subconverter external configuration (subscription conversion template) Description: https://github.com/tindy2013/subconverter#external-configuration-file")..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("If you need to customize the external configuration file (subscription conversion template), please write it according to the instructions, upload it to the accessible location of the external network, and fill in the address correctly when using it")..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("If you have a recommended external configuration file (subscription conversion template), you can modify by following The file format of /usr/share/openclash/res/sub_ini.list and pr")
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/config-subscribe")
|
||||
if m.uci:get(openclash, sid) ~= "config_subscribe" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Config Subscribe Setting ]]--
|
||||
s = m:section(NamedSection, sid, "config_subscribe")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
---- name
|
||||
o = s:option(Value, "name", translate("Config Alias"))
|
||||
o.description = font_red..bold_on..translate("Name For Distinguishing")..bold_off..font_off
|
||||
o.placeholder = translate("config")
|
||||
o.rmempty = true
|
||||
|
||||
---- address
|
||||
o = s:option(Value, "address", translate("Subscribe Address"))
|
||||
o.template = "cbi/tvalue"
|
||||
o.rows = 10
|
||||
o.wrap = "off"
|
||||
o.description = font_red..bold_on..translate("SS/SSR/Vmess or Other Link And Subscription Address is Supported When Online Subscription Conversion is Enabled, Multiple Links Should be One Per Line or Separated By |")..bold_off..font_off
|
||||
o.placeholder = translate("Not Null")
|
||||
o.rmempty = false
|
||||
function o.validate(self, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
value = value:gsub("%c*$", "")
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
local sub_path = "/tmp/dler_sub"
|
||||
local info, token, get_sub, sub_info
|
||||
local token = uci:get("openclash", "config", "dler_token")
|
||||
if token then
|
||||
get_sub = string.format("curl -sL -H 'Content-Type: application/json' --connect-timeout 2 -d '{\"access_token\":\"%s\"}' -X POST https://dler.cloud/api/v1/managed/clash -o %s", token, sub_path)
|
||||
if not nixio.fs.access(sub_path) then
|
||||
luci.sys.exec(get_sub)
|
||||
else
|
||||
if fs.readfile(sub_path) == "" or not fs.readfile(sub_path) then
|
||||
luci.sys.exec(get_sub)
|
||||
end
|
||||
end
|
||||
sub_info = fs.readfile(sub_path)
|
||||
if sub_info then
|
||||
sub_info = json.parse(sub_info)
|
||||
end
|
||||
if sub_info and sub_info.ret == 200 then
|
||||
o:value(sub_info.smart)
|
||||
o:value(sub_info.ss)
|
||||
o:value(sub_info.vmess)
|
||||
o:value(sub_info.trojan)
|
||||
else
|
||||
fs.unlink(sub_path)
|
||||
end
|
||||
end
|
||||
|
||||
---- UA
|
||||
o = s:option(Value, "sub_ua", "User-Agent")
|
||||
o.description = font_red..bold_on..translate("Used for Downloading Subscriptions, Defaults to Clash")..bold_off..font_off
|
||||
o:value("Clash")
|
||||
o:value("clash.meta")
|
||||
o.default = "Clash"
|
||||
o.rmempty = true
|
||||
|
||||
---- subconverter
|
||||
o = s:option(Flag, "sub_convert", translate("Subscribe Convert Online"))
|
||||
o.description = translate("Convert Subscribe Online With Template")
|
||||
o.default = 0
|
||||
|
||||
---- Convert Address
|
||||
o = s:option(Value, "convert_address", translate("Convert Address"))
|
||||
o.rmempty = true
|
||||
o.description = font_red..bold_on..translate("Note: There is A Risk of Privacy Leakage in Online Convert")..bold_off..font_off
|
||||
o:depends("sub_convert", "1")
|
||||
o:value("https://api.dler.io/sub", translate("api.dler.io")..translate("(Default)"))
|
||||
o:value("https://v.id9.cc/sub", translate("v.id9.cc")..translate("(Support Vless By Pinyun)"))
|
||||
o:value("https://sub.id9.cc/sub", translate("sub.id9.cc"))
|
||||
o:value("https://api.wcc.best/sub", translate("api.wcc.best"))
|
||||
o.default = "https://api.dler.io/sub"
|
||||
o.placeholder = "https://api.dler.io/sub"
|
||||
|
||||
---- Template
|
||||
o = s:option(ListValue, "template", translate("Template Name"))
|
||||
o.rmempty = true
|
||||
o:depends("sub_convert", "1")
|
||||
file = io.open("/usr/share/openclash/res/sub_ini.list", "r");
|
||||
for l in file:lines() do
|
||||
if l ~= "" and l ~= nil then
|
||||
o:value(string.sub(luci.sys.exec(string.format("echo '%s' |awk -F ',' '{print $1}' 2>/dev/null",l)),1,-2))
|
||||
end
|
||||
end
|
||||
file:close()
|
||||
o:value("0", translate("Custom Template"))
|
||||
|
||||
---- Custom Template
|
||||
o = s:option(Value, "custom_template_url", translate("Custom Template URL"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("Not Null")
|
||||
o.datatype = "or(host, string)"
|
||||
o:depends("template", "0")
|
||||
|
||||
---- emoji
|
||||
o = s:option(ListValue, "emoji", translate("Emoji"))
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- udp
|
||||
o = s:option(ListValue, "udp", translate("UDP Enable"))
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- skip-cert-verify
|
||||
o = s:option(ListValue, "skip_cert_verify", translate("skip-cert-verify"))
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- sort
|
||||
o = s:option(ListValue, "sort", translate("Sort"))
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- node type
|
||||
o = s:option(ListValue, "node_type", translate("Append Node Type"))
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- rule provider
|
||||
o = s:option(ListValue, "rule_provider", translate("Use Rule Provider"))
|
||||
o.description = font_red..bold_on..translate("Note: Please Make Sure Backend Service Supports This Feature")..bold_off..font_off
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- custom params
|
||||
o = s:option(DynamicList, "custom_params", translate("Custom Params"))
|
||||
o.description = font_red..bold_on..translate("eg: \"rename=\\s+([2-9])[xX]@ (HIGH:$1)\"")..bold_off..font_off
|
||||
o.rmempty = false
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- key
|
||||
o = s:option(DynamicList, "keyword", font_red..bold_on..translate("Keyword Match")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("eg: hk or tw&bgp")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
|
||||
---- exkey
|
||||
o = s:option(DynamicList, "ex_keyword", font_red..bold_on..translate("Exclude Keyword Match")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("eg: hk or tw&bgp")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
|
||||
---- de_exkey
|
||||
o = s:option(MultiValue, "de_ex_keyword", font_red..bold_on..translate("Exclude Keyword Match Default")..bold_off..font_off)
|
||||
o.rmempty = true
|
||||
o:depends("sub_convert", 0)
|
||||
o:value("过期时间")
|
||||
o:value("剩余流量")
|
||||
o:value("TG群")
|
||||
o:value("官网")
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,150 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
m = Map("openclash", translate("Config Subscribe"))
|
||||
m.pageaction = false
|
||||
|
||||
s = m:section(TypedSection, "openclash")
|
||||
s.anonymous = true
|
||||
|
||||
---- update Settings
|
||||
o = s:option(Flag, "auto_update", translate("Auto Update"))
|
||||
o.description = translate("Auto Update Server subscription")
|
||||
o.default = 0
|
||||
|
||||
o = s:option(ListValue, "config_auto_update_mode", translate("Update Mode"))
|
||||
o:depends("auto_update", "1")
|
||||
o:value("0", translate("Appointment Mode"))
|
||||
o:value("1", translate("Loop Mode"))
|
||||
o.default = "0"
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(ListValue, "config_update_week_time", translate("Update Time (Every Week)"))
|
||||
o:depends("config_auto_update_mode", "0")
|
||||
o:value("*", translate("Every Day"))
|
||||
o:value("1", translate("Every Monday"))
|
||||
o:value("2", translate("Every Tuesday"))
|
||||
o:value("3", translate("Every Wednesday"))
|
||||
o:value("4", translate("Every Thursday"))
|
||||
o:value("5", translate("Every Friday"))
|
||||
o:value("6", translate("Every Saturday"))
|
||||
o:value("0", translate("Every Sunday"))
|
||||
o.default = "1"
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(ListValue, "auto_update_time", translate("Update time (every day)"))
|
||||
o:depends("config_auto_update_mode", "0")
|
||||
for t = 0,23 do
|
||||
o:value(t, t..":00")
|
||||
end
|
||||
o.default = "0"
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(Value, "config_update_interval", translate("Update Interval(min)"))
|
||||
o.default = "60"
|
||||
o.datatype = "integer"
|
||||
o:depends("config_auto_update_mode", "1")
|
||||
o.rmempty = true
|
||||
|
||||
-- [[ Edit Server ]] --
|
||||
s = m:section(TypedSection, "config_subscribe", translate("Config Subscribe Edit"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "cbi/tblsection"
|
||||
s.extedit = luci.dispatcher.build_url("admin/services/openclash/config-subscribe-edit/%s")
|
||||
function s.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(s.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- name
|
||||
o = s:option(DummyValue, "name", translate("Config Alias"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("config")
|
||||
end
|
||||
|
||||
---- address
|
||||
o = s:option(DummyValue, "address", translate("Subscribe Address"))
|
||||
function o.cfgvalue(...)
|
||||
if Value.cfgvalue(...) then
|
||||
if string.len(Value.cfgvalue(...)) <= 50 then
|
||||
return Value.cfgvalue(...)
|
||||
else
|
||||
return string.sub(Value.cfgvalue(...), 1, 50) .. " ..."
|
||||
end
|
||||
end
|
||||
return translate("None")
|
||||
end
|
||||
|
||||
---- template
|
||||
o = s:option(DummyValue, "template", translate("Template Name"))
|
||||
function o.cfgvalue(...)
|
||||
if Value.cfgvalue(...) ~= "0" then
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
else
|
||||
return translate("Custom Template")
|
||||
end
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
m.uci:commit("openclash")
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Update Config")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
m.uci:set("openclash", "config", "enable", 1)
|
||||
m.uci:commit("openclash")
|
||||
uci:foreach("openclash", "config_subscribe",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil and s.enabled == "1" then
|
||||
local back_cfg_path_yaml="/etc/openclash/backup/" .. s.name .. ".yaml"
|
||||
local back_cfg_path_yml="/etc/openclash/backup/" .. s.name .. ".yml"
|
||||
fs.unlink(back_cfg_path_yaml)
|
||||
fs.unlink(back_cfg_path_yml)
|
||||
end
|
||||
end)
|
||||
SYS.call("/usr/share/openclash/openclash.sh >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
|
||||
return m
|
@ -1,468 +0,0 @@
|
||||
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
local CHIF = "0"
|
||||
|
||||
font_green = [[<b style=color:green>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
align_mid = [[<p align="center">]]
|
||||
align_mid_off = [[</p>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
function default_config_set(f)
|
||||
local cf = uci:get("openclash", "config", "config_path")
|
||||
if cf == "/etc/openclash/config/"..f or not cf or cf == "" or not fs.isfile(cf) then
|
||||
if CHIF == "1" and cf == "/etc/openclash/config/"..f then
|
||||
return
|
||||
end
|
||||
local fis = fs.glob("/etc/openclash/config/*")[1]
|
||||
if fis ~= nil then
|
||||
fcf = fs.basename(fis)
|
||||
if fcf then
|
||||
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..fcf)
|
||||
uci:commit("openclash")
|
||||
end
|
||||
else
|
||||
uci:set("openclash", "config", "config_path", "/etc/openclash/config/config.yaml")
|
||||
uci:commit("openclash")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function config_check(CONFIG_FILE)
|
||||
local yaml = fs.isfile(CONFIG_FILE)
|
||||
if yaml then
|
||||
yaml = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "puts YAML.load_file(\'%s\')" 2>/dev/null',CONFIG_FILE))
|
||||
if yaml ~= "false\n" and yaml ~= "" then
|
||||
return "Config Normal"
|
||||
else
|
||||
return "Config Abnormal"
|
||||
end
|
||||
elseif (yaml ~= 0) then
|
||||
return "File Not Exist"
|
||||
end
|
||||
end
|
||||
|
||||
ful = SimpleForm("upload", translate("Config Manage"), nil)
|
||||
ful.reset = false
|
||||
ful.submit = false
|
||||
|
||||
sul =ful:section(SimpleSection, "")
|
||||
o = sul:option(FileUpload, "")
|
||||
o.template = "openclash/upload"
|
||||
um = sul:option(DummyValue, "", nil)
|
||||
um.template = "openclash/dvalue"
|
||||
|
||||
local dir, fd, clash
|
||||
clash = "/etc/openclash/clash"
|
||||
dir = "/etc/openclash/config/"
|
||||
bakck_dir="/etc/openclash/backup"
|
||||
proxy_pro_dir="/etc/openclash/proxy_provider/"
|
||||
rule_pro_dir="/etc/openclash/rule_provider/"
|
||||
core_dir="/etc/openclash/core/core/"
|
||||
backup_dir="/tmp/"
|
||||
create_bakck_dir=fs.mkdir(bakck_dir)
|
||||
create_proxy_pro_dir=fs.mkdir(proxy_pro_dir)
|
||||
create_rule_pro_dir=fs.mkdir(rule_pro_dir)
|
||||
|
||||
HTTP.setfilehandler(
|
||||
function(meta, chunk, eof)
|
||||
local fp = HTTP.formvalue("file_type")
|
||||
if not fd then
|
||||
if not meta then return end
|
||||
|
||||
if fp == "config" then
|
||||
if meta and chunk then fd = nixio.open(dir .. meta.file, "w") end
|
||||
elseif fp == "proxy-provider" then
|
||||
if meta and chunk then fd = nixio.open(proxy_pro_dir .. meta.file, "w") end
|
||||
elseif fp == "rule-provider" then
|
||||
if meta and chunk then fd = nixio.open(rule_pro_dir .. meta.file, "w") end
|
||||
elseif fp == "clash" or fp == "clash_tun" or fp == "clash_meta" then
|
||||
create_core_dir=fs.mkdir(core_dir)
|
||||
if meta and chunk then fd = nixio.open(core_dir .. meta.file, "w") end
|
||||
elseif fp == "backup-file" then
|
||||
if meta and chunk then fd = nixio.open(backup_dir .. meta.file, "w") end
|
||||
end
|
||||
|
||||
if not fd then
|
||||
um.value = translate("upload file error.")
|
||||
return
|
||||
end
|
||||
end
|
||||
if chunk and fd then
|
||||
fd:write(chunk)
|
||||
end
|
||||
if eof and fd then
|
||||
fd:close()
|
||||
fd = nil
|
||||
if fp == "config" then
|
||||
CHIF = "1"
|
||||
if IsYamlFile(meta.file) then
|
||||
local yamlbackup="/etc/openclash/backup/" .. meta.file
|
||||
local c=fs.copy(dir .. meta.file,yamlbackup)
|
||||
default_config_set(meta.file)
|
||||
end
|
||||
if IsYmlFile(meta.file) then
|
||||
local ymlname=string.lower(string.sub(meta.file,0,-5))
|
||||
local ymlbackup="/etc/openclash/backup/".. ymlname .. ".yaml"
|
||||
local c=fs.rename(dir .. meta.file,"/etc/openclash/config/".. ymlname .. ".yaml")
|
||||
local c=fs.copy("/etc/openclash/config/".. ymlname .. ".yaml",ymlbackup)
|
||||
local yamlname=ymlname .. ".yaml"
|
||||
default_config_set(yamlname)
|
||||
end
|
||||
um.value = translate("File saved to") .. ' "/etc/openclash/config/"'
|
||||
elseif fp == "proxy-provider" then
|
||||
um.value = translate("File saved to") .. ' "/etc/openclash/proxy_provider/"'
|
||||
elseif fp == "rule-provider" then
|
||||
um.value = translate("File saved to") .. ' "/etc/openclash/rule_provider/"'
|
||||
elseif fp == "clash" or fp == "clash_tun" or fp == "clash_meta" then
|
||||
if string.lower(string.sub(meta.file, -7, -1)) == ".tar.gz" then
|
||||
os.execute(string.format("tar -C '/etc/openclash/core/core' -xzf %s >/dev/null 2>&1", (core_dir .. meta.file)))
|
||||
fs.unlink(core_dir .. meta.file)
|
||||
os.execute(string.format("mv $(echo \"/etc/openclash/core/core/$(ls /etc/openclash/core/core/)\") '/etc/openclash/core/%s' >/dev/null 2>&1", fp))
|
||||
elseif string.lower(string.sub(meta.file, -3, -1)) == ".gz" then
|
||||
os.execute(string.format("mv %s '/etc/openclash/core/%s.gz' >/dev/null 2>&1", (core_dir .. meta.file), fp))
|
||||
os.execute("gzip -fd '/etc/openclash/core/%s.gz' >/dev/null 2>&1" %fp)
|
||||
fs.unlink("/etc/openclash/core/%s.gz" %fp)
|
||||
else
|
||||
os.execute(string.format("mv $(echo \"/etc/openclash/core/core/$(ls /etc/openclash/core/core/)\") '/etc/openclash/core/%s' >/dev/null 2>&1", fp))
|
||||
end
|
||||
os.execute("chmod 4755 /etc/openclash/core/%s >/dev/null 2>&1" %fp)
|
||||
os.execute("rm -rf %s >/dev/null 2>&1" %core_dir)
|
||||
um.value = translate("File saved to") .. ' "/etc/openclash/core/"'
|
||||
elseif fp == "backup-file" then
|
||||
os.execute("tar -C '/etc/openclash/' -xzf %s >/dev/null 2>&1" % (backup_dir .. meta.file))
|
||||
os.execute("mv /etc/openclash/openclash /etc/config/openclash >/dev/null 2>&1")
|
||||
fs.unlink(backup_dir .. meta.file)
|
||||
um.value = translate("Backup File Restore Successful!")
|
||||
end
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
if HTTP.formvalue("upload") then
|
||||
if not um.value then
|
||||
um.value = translate("No Specify Upload File")
|
||||
end
|
||||
end
|
||||
|
||||
local e,a={}
|
||||
for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(o)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(o)
|
||||
BACKUP_FILE="/etc/openclash/backup/".. e[t].name
|
||||
if fs.mtime(BACKUP_FILE) then
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(BACKUP_FILE))
|
||||
else
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
|
||||
end
|
||||
if uci:get("openclash", "config", "config_path") and string.sub(uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then
|
||||
e[t].state=translate("Enable")
|
||||
else
|
||||
e[t].state=translate("Disable")
|
||||
end
|
||||
e[t].size=fs.filesize(a.size)
|
||||
e[t].check=translate(config_check(o))
|
||||
e[t].remove=0
|
||||
end
|
||||
end
|
||||
|
||||
form=SimpleForm("config_file_list",translate("Config File List"))
|
||||
form.reset=false
|
||||
form.submit=false
|
||||
tb=form:section(Table,e)
|
||||
st=tb:option(DummyValue,"state",translate("State"))
|
||||
nm=tb:option(DummyValue,"name",translate("Config Alias"))
|
||||
sb=tb:option(DummyValue,"name",translate("Subscription Info"))
|
||||
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
|
||||
sz=tb:option(DummyValue,"size",translate("Size"))
|
||||
ck=tb:option(DummyValue,"check",translate("Grammar Check"))
|
||||
st.template="openclash/cfg_check"
|
||||
ck.template="openclash/cfg_check"
|
||||
sb.template="openclash/sub_info_show"
|
||||
|
||||
btnis=tb:option(Button,"switch",translate("Switch Config"))
|
||||
btnis.template="openclash/other_button"
|
||||
btnis.render=function(o,t,a)
|
||||
if not e[t] then return false end
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
a.display=""
|
||||
else
|
||||
a.display="none"
|
||||
end
|
||||
o.inputstyle="apply"
|
||||
Button.render(o,t,a)
|
||||
end
|
||||
btnis.write=function(a,t)
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name)
|
||||
uci:commit("openclash")
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
|
||||
btned=tb:option(Button,"edit",translate("Edit"))
|
||||
btned.render=function(o,t,a)
|
||||
o.inputstyle="apply"
|
||||
Button.render(o,t,a)
|
||||
end
|
||||
btned.write=function(a,t)
|
||||
local file_path = "etc/openclash/config/" .. fs.basename(e[t].name)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "config", "%s") %file_path)
|
||||
end
|
||||
|
||||
btncp=tb:option(Button,"copy",translate("Copy Config"))
|
||||
btncp.template="openclash/other_button"
|
||||
btncp.render=function(o,t,a)
|
||||
if not e[t] then return false end
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
a.display=""
|
||||
else
|
||||
a.display="none"
|
||||
end
|
||||
o.inputstyle="apply"
|
||||
Button.render(o,t,a)
|
||||
end
|
||||
btncp.write=function(a,t)
|
||||
local num = 1
|
||||
while true do
|
||||
num = num + 1
|
||||
if not fs.isfile("/etc/openclash/config/"..fs.filename(e[t].name).."("..num..")"..".yaml") then
|
||||
fs.copy("/etc/openclash/config/"..e[t].name, "/etc/openclash/config/"..fs.filename(e[t].name).."("..num..")"..".yaml")
|
||||
break
|
||||
end
|
||||
end
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
|
||||
btnrn=tb:option(DummyValue,"/etc/openclash/config/",translate("Rename"))
|
||||
btnrn.template="openclash/input_rename"
|
||||
btnrn.rawhtml = true
|
||||
btnrn.render=function(c,t,a)
|
||||
c.value = e[t].name
|
||||
Button.render(c,t,a)
|
||||
end
|
||||
|
||||
btndl = tb:option(Button,"download",translate("Download Config"))
|
||||
btndl.template="openclash/other_button"
|
||||
btndl.render=function(e,t,a)
|
||||
e.inputstyle="remove"
|
||||
Button.render(e,t,a)
|
||||
end
|
||||
btndl.write = function (a,t)
|
||||
local sPath, sFile, fd, block
|
||||
sPath = "/etc/openclash/config/"..e[t].name
|
||||
sFile = NXFS.basename(sPath)
|
||||
if fs.isdirectory(sPath) then
|
||||
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
|
||||
sFile = sFile .. ".tar.gz"
|
||||
else
|
||||
fd = nixio.open(sPath, "r")
|
||||
end
|
||||
if not fd then
|
||||
return
|
||||
end
|
||||
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
|
||||
HTTP.prepare_content("application/octet-stream")
|
||||
while true do
|
||||
block = fd:read(nixio.const.buffersize)
|
||||
if (not block) or (#block ==0) then
|
||||
break
|
||||
else
|
||||
HTTP.write(block)
|
||||
end
|
||||
end
|
||||
fd:close()
|
||||
HTTP.close()
|
||||
end
|
||||
|
||||
btndlr = tb:option(Button,"download_run",translate("Download Running Config"))
|
||||
btndlr.template="openclash/other_button"
|
||||
btndlr.render=function(c,t,a)
|
||||
if nixio.fs.access("/etc/openclash/"..e[t].name) then
|
||||
a.display=""
|
||||
else
|
||||
a.display="none"
|
||||
end
|
||||
c.inputstyle="remove"
|
||||
Button.render(c,t,a)
|
||||
end
|
||||
btndlr.write = function (a,t)
|
||||
local sPath, sFile, fd, block
|
||||
sPath = "/etc/openclash/"..e[t].name
|
||||
sFile = NXFS.basename(sPath)
|
||||
if fs.isdirectory(sPath) then
|
||||
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
|
||||
sFile = sFile .. ".tar.gz"
|
||||
else
|
||||
fd = nixio.open(sPath, "r")
|
||||
end
|
||||
if not fd then
|
||||
return
|
||||
end
|
||||
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
|
||||
HTTP.prepare_content("application/octet-stream")
|
||||
while true do
|
||||
block = fd:read(nixio.const.buffersize)
|
||||
if (not block) or (#block ==0) then
|
||||
break
|
||||
else
|
||||
HTTP.write(block)
|
||||
end
|
||||
end
|
||||
fd:close()
|
||||
HTTP.close()
|
||||
end
|
||||
|
||||
btnrm=tb:option(Button,"remove",translate("Remove"))
|
||||
btnrm.render=function(e,t,a)
|
||||
e.inputstyle="reset"
|
||||
Button.render(e,t,a)
|
||||
end
|
||||
btnrm.write=function(a,t)
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
fs.unlink("/etc/openclash/backup/"..fs.basename(e[t].name))
|
||||
fs.unlink("/etc/openclash/history/"..fs.filename(e[t].name))
|
||||
fs.unlink("/etc/openclash/history/"..fs.filename(e[t].name)..".db")
|
||||
fs.unlink("/etc/openclash/"..fs.basename(e[t].name))
|
||||
local a=fs.unlink("/etc/openclash/config/"..fs.basename(e[t].name))
|
||||
default_config_set(fs.basename(e[t].name))
|
||||
if a then table.remove(e,t)end
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash","config"))
|
||||
end
|
||||
|
||||
p = SimpleForm("provider_file_manage",translate("Provider File Manage"))
|
||||
p.reset = false
|
||||
p.submit = false
|
||||
|
||||
local provider_manage = {
|
||||
{proxy_mg, rule_mg, game_mg}
|
||||
}
|
||||
|
||||
promg = p:section(Table, provider_manage)
|
||||
|
||||
o = promg:option(Button, "proxy_mg", " ")
|
||||
o.inputtitle = translate("Proxy Provider File List")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "proxy-provider-file-manage"))
|
||||
end
|
||||
|
||||
o = promg:option(Button, "rule_mg", " ")
|
||||
o.inputtitle = translate("Rule Providers File List")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-file-manage"))
|
||||
end
|
||||
|
||||
o = promg:option(Button, "game_mg", " ")
|
||||
o.inputtitle = translate("Game Rules File List")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
|
||||
end
|
||||
|
||||
m = SimpleForm("openclash",translate("Config File Edit"))
|
||||
m.reset = false
|
||||
m.submit = false
|
||||
|
||||
local tab = {
|
||||
{user, default}
|
||||
}
|
||||
|
||||
s = m:section(Table, tab)
|
||||
s.description = align_mid..translate("Support syntax check, press").." "..font_green..bold_on.."F10"..bold_off..font_off.." "..translate("to control diff option, press").." "..font_green..bold_on.."F11"..bold_off..font_off.." "..translate("to enter full screen editing mode")..align_mid_off
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
local conf = uci:get("openclash", "config", "config_path")
|
||||
local dconf = "/usr/share/openclash/res/default.yaml"
|
||||
if not conf then conf = "/etc/openclash/config/config.yaml" end
|
||||
local conf_name = fs.basename(conf)
|
||||
if not conf_name then conf_name = "config.yaml" end
|
||||
local sconf = "/etc/openclash/"..conf_name
|
||||
|
||||
sev = s:option(TextValue, "user")
|
||||
---sev.description = align_mid..translate("Modify Your Config file:").." "..font_green..bold_on..conf_name..bold_off..font_off.." "..translate("Here, Except The Settings That Were Taken Over")..align_mid_off
|
||||
sev.rows = 40
|
||||
sev.wrap = "off"
|
||||
sev.cfgvalue = function(self, section)
|
||||
return NXFS.readfile(conf) or NXFS.readfile(dconf) or ""
|
||||
end
|
||||
sev.write = function(self, section, value)
|
||||
if (CHIF == "0") then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile(conf)
|
||||
if value ~= old_value then
|
||||
NXFS.writefile(conf, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def = s:option(TextValue, "default")
|
||||
if fs.isfile(sconf) then
|
||||
---def.description = align_mid..translate("Config File Edited By OpenClash For Running")..align_mid_off
|
||||
else
|
||||
---def.description = align_mid..translate("Default Config File With Correct Template")..align_mid_off
|
||||
end
|
||||
def.rows = 40
|
||||
def.wrap = "off"
|
||||
def.readonly = true
|
||||
def.cfgvalue = function(self, section)
|
||||
return NXFS.readfile(sconf) or NXFS.readfile(dconf) or ""
|
||||
end
|
||||
def.write = function(self, section, value)
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Create, Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:commit("openclash")
|
||||
end
|
||||
|
||||
o = a:option(DummyValue, "Create", " ")
|
||||
o.rawhtml = true
|
||||
o.template = "openclash/input_file_name"
|
||||
o.value = "/etc/openclash/config/"
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Apply Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
m:append(Template("openclash/config_editor"))
|
||||
|
||||
return ful , form , p , m
|
@ -1,149 +0,0 @@
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local SYS = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_green = [[<b style=color:green>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
m = Map(openclash, translate("Add Custom DNS Servers"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/config-overwrite")
|
||||
if m.uci:get(openclash, sid) ~= "dns_servers" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Edit Custom DNS ]] --
|
||||
s = m:section(NamedSection, sid, "dns_servers")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
---- group
|
||||
o = s:option(ListValue, "group", translate("DNS Server Group"))
|
||||
o.description = font_red..bold_on..translate("NameServer Group Must Be Set")..bold_off..font_off
|
||||
o:value("nameserver", translate("NameServer "))
|
||||
o:value("fallback", translate("FallBack "))
|
||||
o:value("default", translate("Default-NameServer"))
|
||||
o.default = "nameserver"
|
||||
o.rempty = false
|
||||
|
||||
---- IP address
|
||||
o = s:option(Value, "ip", translate("DNS Server Address"))
|
||||
o.description = translate("Do Not Add Type Ahead")
|
||||
o.placeholder = translate("Not Null")
|
||||
o.datatype = "or(host, string)"
|
||||
o.rmempty = true
|
||||
|
||||
---- port
|
||||
o = s:option(Value, "port", translate("DNS Server Port"))
|
||||
o.description = translate("Require When Use Non-Standard Port")
|
||||
o.datatype = "port"
|
||||
o.rempty = true
|
||||
|
||||
---- type
|
||||
o = s:option(ListValue, "type", translate("DNS Server Type"))
|
||||
o.description = translate("Communication protocol")
|
||||
o:value("udp", translate("UDP"))
|
||||
o:value("tcp", translate("TCP"))
|
||||
o:value("tls", translate("TLS"))
|
||||
o:value("https", translate("HTTPS"))
|
||||
o:value("quic", translate("QUIC ")..translate("(Only Meta Core)"))
|
||||
o.default = "udp"
|
||||
o.rempty = false
|
||||
|
||||
---- interface
|
||||
o = s:option(Value, "interface", translate("Specific Interface"))
|
||||
o.description = translate("DNS Lookup Only Through The Specific Interface")..translate("(Only TUN Core)")
|
||||
local interfaces = SYS.exec("ls -l /sys/class/net/ 2>/dev/null |awk '{print $9}' 2>/dev/null")
|
||||
for interface in string.gmatch(interfaces, "%S+") do
|
||||
o:value(interface)
|
||||
end
|
||||
o:value("Disable", translate("Disable"))
|
||||
o.default = "Disable"
|
||||
o.rempty = false
|
||||
|
||||
---- Node Domain Resolve
|
||||
o = s:option(Flag, "node_resolve", translate("Node Domain Resolve"), translate("Use For Node Domain Resolve")..translate("(Only Meta Core)"))
|
||||
o.rmempty = false
|
||||
o.default = o.disbled
|
||||
|
||||
---- Force HTTP/3
|
||||
o = s:option(Flag, "http3", translate("Force HTTP/3"), translate("Force HTTP/3 to connect")..translate("(Only Meta Core)"))
|
||||
o:depends("type", "https")
|
||||
o.rmempty = false
|
||||
o.default = o.disbled
|
||||
|
||||
---- ECS Subnet
|
||||
o = s:option(Value, "ecs_subnet", translate("ECS Subnet"),translate("Specify the ECS Subnet Address")..translate("(Only Meta Core)"))
|
||||
o:depends("type", "https")
|
||||
o.rmempty = true
|
||||
o.datatype = "ipaddr"
|
||||
o:value("1.1.1.1/24")
|
||||
|
||||
---- ECS Override
|
||||
o = s:option(Flag, "ecs_override", translate("ECS Override"),translate("Override the ECS Subnet Address")..translate("(Only Meta Core)"))
|
||||
o:depends("type", "https")
|
||||
o.rmempty = false
|
||||
o.datatype = "ipaddr"
|
||||
o.default = o.disbled
|
||||
|
||||
---- Proxy group
|
||||
o = s:option(Value, "specific_group", translate("Specific Group (Support Regex)"))
|
||||
o.description = translate("Group Use For Proxy The DNS")..translate("(Only Meta Core)")
|
||||
o:depends("group", "nameserver")
|
||||
o:depends("group", "fallback")
|
||||
local groupnames,filename
|
||||
filename = m.uci:get(openclash, "config", "config_path")
|
||||
if filename then
|
||||
groupnames = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
|
||||
if groupnames then
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
m.uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
o:value("Disable", translate("Disable"))
|
||||
o.default = "Disable"
|
||||
o.rempty = false
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,123 +0,0 @@
|
||||
|
||||
local rule_form
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
local g,h={}
|
||||
for n,m in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
|
||||
h=fs.stat(m)
|
||||
if h then
|
||||
g[n]={}
|
||||
g[n].num=string.format(n)
|
||||
g[n].name=fs.basename(m)
|
||||
g[n].mtime=os.date("%Y-%m-%d %H:%M:%S",h.mtime)
|
||||
g[n].size=fs.filesize(h.size)
|
||||
g[n].remove=0
|
||||
g[n].enable=false
|
||||
end
|
||||
end
|
||||
|
||||
rule_form=SimpleForm("game_rules_file_list",translate("Game Rules File List"))
|
||||
rule_form.reset=false
|
||||
rule_form.submit=false
|
||||
tb2=rule_form:section(Table,g)
|
||||
nu2=tb2:option(DummyValue,"num",translate("Serial Number"))
|
||||
nm2=tb2:option(DummyValue,"name",translate("File Name"))
|
||||
mt2=tb2:option(DummyValue,"mtime",translate("Update Time"))
|
||||
sz2=tb2:option(DummyValue,"size",translate("Size"))
|
||||
|
||||
btned1=tb2:option(Button,"edit",translate("Edit"))
|
||||
btned1.render=function(g,n,h)
|
||||
g.inputstyle="apply"
|
||||
Button.render(g,n,h)
|
||||
end
|
||||
btned1.write=function(h,n)
|
||||
local file_path = "etc/openclash/game_rules/" .. fs.basename(g[n].name)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "game-rules-file-manage", "%s") %file_path)
|
||||
end
|
||||
|
||||
btndl2 = tb2:option(Button,"download2",translate("Download Config"))
|
||||
btndl2.template="openclash/other_button"
|
||||
btndl2.render=function(m,n,h)
|
||||
m.inputstyle="remove"
|
||||
Button.render(m,n,h)
|
||||
end
|
||||
btndl2.write = function (h,n)
|
||||
local sPath, sFile, fd, block
|
||||
sPath = "/etc/openclash/game_rules/"..g[n].name
|
||||
sFile = NXFS.basename(sPath)
|
||||
if fs.isdirectory(sPath) then
|
||||
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
|
||||
sFile = sFile .. ".tar.gz"
|
||||
else
|
||||
fd = nixio.open(sPath, "r")
|
||||
end
|
||||
if not fd then
|
||||
return
|
||||
end
|
||||
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
|
||||
HTTP.prepare_content("application/octet-stream")
|
||||
while true do
|
||||
block = fd:read(nixio.const.buffersize)
|
||||
if (not block) or (#block ==0) then
|
||||
break
|
||||
else
|
||||
HTTP.write(block)
|
||||
end
|
||||
end
|
||||
fd:close()
|
||||
HTTP.close()
|
||||
end
|
||||
|
||||
btnrm2=tb2:option(Button,"remove2",translate("Remove"))
|
||||
btnrm2.render=function(g,n,h)
|
||||
g.inputstyle="reset"
|
||||
Button.render(g,n,h)
|
||||
end
|
||||
btnrm2.write=function(h,n)
|
||||
local h=fs.unlink("/etc/openclash/game_rules/"..luci.openclash.basename(g[n].name))
|
||||
if h then table.remove(g,n)end
|
||||
return h
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Refresh, Create, Delete_all, Apply}
|
||||
}
|
||||
|
||||
a = rule_form:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Refresh", " ")
|
||||
o.inputtitle = translate("Refresh Page")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(DummyValue, "Create", " ")
|
||||
o.rawhtml = true
|
||||
o.template = "openclash/input_file_name"
|
||||
o.value = "/etc/openclash/game_rules/"
|
||||
|
||||
o = a:option(Button, "Delete_all", " ")
|
||||
o.inputtitle = translate("Delete All File")
|
||||
o.inputstyle = "remove"
|
||||
o.write = function()
|
||||
luci.sys.call("rm -rf /etc/openclash/game_rules/* >/dev/null 2>&1")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
|
||||
rule_form:append(Template("openclash/toolbar_show"))
|
||||
return rule_form
|
@ -1,100 +0,0 @@
|
||||
|
||||
local form, m
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
m = SimpleForm("openclash", translate("Game Rules List"))
|
||||
m.description=translate("Rule Project:").." SSTap-Rule ( https://github.com/FQrabbit/SSTap-Rule )"
|
||||
m.reset = false
|
||||
m.submit = false
|
||||
|
||||
local t = {
|
||||
{Refresh, Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Refresh", " ")
|
||||
o.inputtitle = translate("Refresh Page")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
SYS.call("rm -rf /tmp/rules_name 2>/dev/null")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-settings"))
|
||||
end
|
||||
|
||||
if not NXFS.access("/tmp/rules_name") then
|
||||
SYS.call("awk -F ',' '{print $1}' /usr/share/openclash/res/game_rules.list > /tmp/rules_name 2>/dev/null")
|
||||
end
|
||||
file = io.open("/tmp/rules_name", "r");
|
||||
|
||||
---- Rules List
|
||||
local e={},o,t
|
||||
if NXFS.access("/tmp/rules_name") then
|
||||
for o in file:lines() do
|
||||
table.insert(e,o)
|
||||
end
|
||||
for t,o in ipairs(e) do
|
||||
e[t]={}
|
||||
e[t].num=string.format(t)
|
||||
e[t].name=o
|
||||
e[t].filename=string.sub(luci.sys.exec(string.format("grep -F '%s,' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $3}' 2>/dev/null",e[t].name)),1,-2)
|
||||
if e[t].filename == "" then
|
||||
e[t].filename=string.sub(luci.sys.exec(string.format("grep -F '%s,' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $2}' 2>/dev/null",e[t].name)),1,-2)
|
||||
end
|
||||
RULE_FILE="/etc/openclash/game_rules/".. e[t].filename
|
||||
if fs.mtime(RULE_FILE) then
|
||||
e[t].size=fs.filesize(fs.stat(RULE_FILE).size)
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(RULE_FILE))
|
||||
else
|
||||
e[t].size="/"
|
||||
e[t].mtime="/"
|
||||
end
|
||||
if fs.isfile(RULE_FILE) then
|
||||
e[t].exist=translate("Exist")
|
||||
else
|
||||
e[t].exist=translate("Not Exist")
|
||||
end
|
||||
e[t].remove=0
|
||||
end
|
||||
end
|
||||
file:close()
|
||||
|
||||
form=SimpleForm("filelist")
|
||||
form.reset=false
|
||||
form.submit=false
|
||||
tb=form:section(Table,e)
|
||||
nu=tb:option(DummyValue,"num",translate("Serial Number"))
|
||||
st=tb:option(DummyValue,"exist",translate("State"))
|
||||
st.template="openclash/cfg_check"
|
||||
nm=tb:option(DummyValue,"name",translate("Rule Name"))
|
||||
fm=tb:option(DummyValue,"filename",translate("File Name"))
|
||||
sz=tb:option(DummyValue,"size",translate("Size"))
|
||||
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
|
||||
|
||||
btnis=tb:option(DummyValue,"filename",translate("Download Rule"))
|
||||
btnis.template="openclash/download_rule"
|
||||
|
||||
btnrm=tb:option(Button,"remove",translate("Remove"))
|
||||
btnrm.render=function(e,t,a)
|
||||
e.inputstyle="reset"
|
||||
Button.render(e,t,a)
|
||||
end
|
||||
btnrm.write=function(a,t)
|
||||
fs.unlink("/etc/openclash/game_rules/"..e[t].filename)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
|
||||
end
|
||||
|
||||
return m, form
|
@ -1,149 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
m = Map(openclash, translate("Edit Group"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
|
||||
if m.uci:get(openclash, sid) ~= "groups" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Groups Setting ]]--
|
||||
s = m:section(NamedSection, sid, "groups")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "type", translate("Group Type"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose The Operation Mode")
|
||||
o:value("select", translate("Manual-Select"))
|
||||
o:value("url-test", translate("URL-Test"))
|
||||
o:value("fallback", translate("Fallback"))
|
||||
o:value("load-balance", translate("Load-Balance"))
|
||||
o:value("relay", translate("Relay-Traffic"))
|
||||
|
||||
o = s:option(ListValue, "strategy", translate("Strategy Type"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose The Load-Balance's Strategy Type")
|
||||
o:value("consistent-hashing", translate("Consistent-hashing"))
|
||||
o:value("round-robin", translate("Round-robin"))
|
||||
o:depends("type", "load-balance")
|
||||
|
||||
o = s:option(Value, "name", translate("Group Name"))
|
||||
o.rmempty = false
|
||||
o.default = "Group - "..sid
|
||||
|
||||
o = s:option(ListValue, "disable_udp", translate("Disable UDP"))
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "test_url", translate("Test URL"))
|
||||
o:value("http://cp.cloudflare.com/generate_204")
|
||||
o:value("http://www.gstatic.com/generate_204")
|
||||
o:value("https://cp.cloudflare.com/generate_204")
|
||||
o.rmempty = false
|
||||
o:depends("type", "url-test")
|
||||
o:depends("type", "fallback")
|
||||
o:depends("type", "load-balance")
|
||||
|
||||
o = s:option(Value, "test_interval", translate("Test Interval(s)"))
|
||||
o.default = "300"
|
||||
o.rmempty = false
|
||||
o:depends("type", "url-test")
|
||||
o:depends("type", "fallback")
|
||||
o:depends("type", "load-balance")
|
||||
|
||||
o = s:option(Value, "tolerance", translate("Tolerance(ms)"))
|
||||
o.default = "150"
|
||||
o.rmempty = true
|
||||
o:depends("type", "url-test")
|
||||
|
||||
o = s:option(Value, "policy_filter", translate("Provider Filter"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "bgp|sg"
|
||||
|
||||
-- [[ interface-name ]]--
|
||||
o = s:option(Value, "interface_name", translate("interface-name"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("eth0")
|
||||
|
||||
-- [[ routing-mark ]]--
|
||||
o = s:option(Value, "routing_mark", translate("routing-mark"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("2333")
|
||||
|
||||
o = s:option(DynamicList, "other_group", translate("Other Group (Support Regex)"))
|
||||
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT'")..bold_off..font_off
|
||||
o:value("all", translate("All Groups"))
|
||||
uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil and s.name ~= m.uci:get(openclash, sid, "name") then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
o.rmempty = true
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
sys.call("/usr/share/openclash/yml_groups_name_ch.sh")
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,22 +0,0 @@
|
||||
--
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
|
||||
m = Map("openclash", translate("Server Logs"))
|
||||
s = m:section(TypedSection, "openclash")
|
||||
m.pageaction = false
|
||||
s.anonymous = true
|
||||
s.addremove=false
|
||||
|
||||
log = s:option(TextValue, "clog")
|
||||
log.readonly=true
|
||||
log.pollcheck=true
|
||||
log.template="openclash/log"
|
||||
log.description = translate("")
|
||||
log.rows = 29
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
m:append(Template("openclash/config_editor"))
|
||||
|
||||
return m
|
@ -1,73 +0,0 @@
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local fs = require "luci.openclash"
|
||||
local file_path = ""
|
||||
local edit_file_name = "/tmp/openclash_edit_file_name"
|
||||
|
||||
for i = 2, #(arg) do
|
||||
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
|
||||
end
|
||||
|
||||
if not fs.isfile(file_path) and file_path ~= "" then
|
||||
file_path = luci.http.urldecode(file_path)
|
||||
end
|
||||
|
||||
--re-get file path to save
|
||||
if NXFS.readfile(edit_file_name) ~= file_path and fs.isfile(file_path) then
|
||||
NXFS.writefile(edit_file_name, file_path)
|
||||
else
|
||||
if not fs.isfile(file_path) and fs.isfile(edit_file_name) then
|
||||
file_path = NXFS.readfile(edit_file_name)
|
||||
fs.unlink(edit_file_name)
|
||||
end
|
||||
end
|
||||
|
||||
m = Map("openclash", translate("File Edit"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/"..arg[1])
|
||||
s = m:section(TypedSection, "openclash")
|
||||
s.anonymous = true
|
||||
s.addremove=false
|
||||
|
||||
o = s:option(TextValue, "edit_file")
|
||||
o.rows = 50
|
||||
o.wrap = "off"
|
||||
|
||||
function o.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile(file_path)
|
||||
if value ~= old_value then
|
||||
NXFS.writefile(file_path, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function o.cfgvalue(self, section)
|
||||
return NXFS.readfile(file_path) or ""
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/config_editor"))
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,431 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_green = [[<b style=color:green>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
m = Map(openclash, translate("Other Rules Edit"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/config-overwrite")
|
||||
if m.uci:get(openclash, sid) ~= "other_rules" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Other Rules Setting ]]--
|
||||
s = m:section(NamedSection, sid, "other_rules")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(Value, "Note", translate("Note"))
|
||||
o.default = "default"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
local e,a={}
|
||||
local groupnames,filename
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
if e[t].name == m.uci:get(openclash, sid, "config") then
|
||||
filename = e[t].name
|
||||
groupnames = sys.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',f))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Button, translate("Get Group Names"))
|
||||
o.title = translate("Get Group Names")
|
||||
o.inputtitle = translate("Get Group Names")
|
||||
o.description = translate("Get Group Names After Select Config File")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
m.uci:commit("openclash")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin/services/openclash/other-rules-edit/%s") % sid)
|
||||
end
|
||||
|
||||
if groupnames ~= nil and filename ~= nil then
|
||||
o = s:option(ListValue, "rule_name", translate("Other Rules Name"))
|
||||
o.rmempty = true
|
||||
o:value("lhie1", translate("lhie1 Rules"))
|
||||
|
||||
o = s:option(ListValue, "GlobalTV", translate("GlobalTV"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "AsianTV", translate("AsianTV"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Proxy", translate("Proxy"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Youtube", translate("Youtube"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Bilibili", translate("Bilibili"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Bahamut", translate("Bahamut"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "HBOMax", translate("HBO Max"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "HBOGo", translate("HBO Go"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Pornhub", translate("Pornhub"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Apple", translate("Apple"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "AppleTV", translate("Apple TV"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "GoogleFCM", translate("Google FCM"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Scholar", translate("Scholar"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Microsoft", translate("Microsoft"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "OpenAI", translate("OpenAI"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Netflix", translate("Netflix"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Disney", translate("Disney Plus"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Discovery", translate("Discovery Plus"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "DAZN", translate("DAZN"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Spotify", translate("Spotify"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Steam", translate("Steam"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "miHoYo", translate("miHoYo"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Speedtest", translate("Speedtest"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Telegram", translate("Telegram"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Crypto", translate("Crypto"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Discord", translate("Discord"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "PayPal", translate("PayPal"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "AdBlock", translate("AdBlock"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Domestic", translate("Domestic"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Others", translate("Others"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose Proxy Groups, Base On Your Config File").." ( "..font_green..bold_on..filename..bold_off..font_off.." )"
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
--luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,184 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
local fs = require "luci.openclash"
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
m = Map(openclash, translate("Edit Proxy-Provider"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
|
||||
if m.uci:get(openclash, sid) ~= "proxy-provider" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Provider Setting ]]--
|
||||
s = m:section(NamedSection, sid, "proxy-provider")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Flag, "manual", translate("Custom Tag"))
|
||||
o.rmempty = false
|
||||
o.default = "0"
|
||||
o.description = translate("Mark as Custom Node to Prevent Retention config from being Deleted When Enabled")
|
||||
|
||||
o = s:option(ListValue, "type", translate("Provider Type"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose The Provider Type")
|
||||
o:value("http")
|
||||
o:value("file")
|
||||
|
||||
o = s:option(Value, "name", translate("Provider Name"))
|
||||
o.rmempty = false
|
||||
o.default = "Proxy-provider - "..sid
|
||||
|
||||
o = s:option(ListValue, "path", translate("Provider Path"))
|
||||
o.description = translate("Update Your Proxy Provider File From Config Luci Page")
|
||||
local p,h={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/proxy_provider/*"))do
|
||||
h=fs.stat(f)
|
||||
if h then
|
||||
p[t]={}
|
||||
p[t].name=fs.basename(f)
|
||||
if IsYamlFile(p[t].name) or IsYmlFile(p[t].name) then
|
||||
o:value("./proxy_provider/"..p[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
o.rmempty = false
|
||||
o:depends("type", "file")
|
||||
|
||||
o = s:option(Value, "provider_url", translate("Provider URL"))
|
||||
o.rmempty = false
|
||||
o:depends("type", "http")
|
||||
|
||||
o = s:option(Value, "provider_filter", translate("Provider Filter"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "bgp|sg"
|
||||
|
||||
o = s:option(Value, "provider_interval", translate("Provider Interval(s)"))
|
||||
o.default = "3600"
|
||||
o.rmempty = false
|
||||
o:depends("type", "http")
|
||||
|
||||
o = s:option(ListValue, "health_check", translate("Provider Health Check"))
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = true
|
||||
|
||||
o = s:option(Value, "health_check_url", translate("Health Check URL"))
|
||||
o:value("http://cp.cloudflare.com/generate_204")
|
||||
o:value("http://www.gstatic.com/generate_204")
|
||||
o:value("https://cp.cloudflare.com/generate_204")
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "health_check_interval", translate("Health Check Interval(s)"))
|
||||
o.default = "300"
|
||||
o.rmempty = false
|
||||
|
||||
-- [[ other-setting ]]--
|
||||
o = s:option(Value, "other_parameters", translate("Other Parameters"))
|
||||
o.template = "cbi/tvalue"
|
||||
o.rows = 20
|
||||
o.wrap = "off"
|
||||
o.description = font_red..bold_on..translate("Edit Your Other Parameters Here")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
function o.cfgvalue(self, section)
|
||||
if self.map:get(section, "other_parameters") == nil then
|
||||
return "# Example:\n"..
|
||||
"# Only support YAML, four spaces need to be reserved at the beginning of each line to maintain formatting alignment\n"..
|
||||
"# 示例:\n"..
|
||||
"# 仅支持 YAML, 每行行首需要多保留四个空格以使脚本处理后能够与上方配置保持格式对齐\n"..
|
||||
"# header:\n"..
|
||||
"# User-Agent:\n"..
|
||||
"# - \"Clash/v1.18.0\"\n"..
|
||||
"# - \"mihomo/1.18.3\"\n"..
|
||||
"# Authorization:\n"..
|
||||
"# - \"token 1231231\"\n"..
|
||||
"# override:\n"..
|
||||
"# skip-cert-verify: true\n"..
|
||||
"# additional-prefix: \"provider1 prefix |\"\n"..
|
||||
"# additional-suffix: \"| provider1 suffix\"\n"..
|
||||
"# proxy-name:\n"..
|
||||
"# - pattern: \"IPLC-(.*?)倍\"\n"..
|
||||
"# target: \"iplc x $1\"\n"..
|
||||
"# exclude-type: \"ss|http\""
|
||||
else
|
||||
return Value.cfgvalue(self, section)
|
||||
end
|
||||
end
|
||||
function o.validate(self, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
value = value:gsub("%c*$", "")
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
o = s:option(DynamicList, "groups", translate("Proxy Group (Support Regex)"))
|
||||
o.description = font_red..bold_on..translate("No Need Set when Config Create, The added Proxy Groups Must Exist")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
o:value("all", translate("All Groups"))
|
||||
m.uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
m:append(Template("openclash/config_editor"))
|
||||
return m
|
@ -1,123 +0,0 @@
|
||||
|
||||
local proxy_form
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
local p,r={}
|
||||
for x,y in ipairs(fs.glob("/etc/openclash/proxy_provider/*"))do
|
||||
r=fs.stat(y)
|
||||
if r then
|
||||
p[x]={}
|
||||
p[x].num=string.format(x)
|
||||
p[x].name=fs.basename(y)
|
||||
p[x].mtime=os.date("%Y-%m-%d %H:%M:%S",r.mtime)
|
||||
p[x].size=fs.filesize(r.size)
|
||||
p[x].remove=0
|
||||
p[x].enable=false
|
||||
end
|
||||
end
|
||||
|
||||
proxy_form=SimpleForm("proxy_provider_file_list",translate("Proxy Provider File List"))
|
||||
proxy_form.reset=false
|
||||
proxy_form.submit=false
|
||||
tb1=proxy_form:section(Table,p)
|
||||
nu1=tb1:option(DummyValue,"num",translate("Serial Number"))
|
||||
nm1=tb1:option(DummyValue,"name",translate("File Name"))
|
||||
mt1=tb1:option(DummyValue,"mtime",translate("Update Time"))
|
||||
sz1=tb1:option(DummyValue,"size",translate("Size"))
|
||||
|
||||
btned1=tb1:option(Button,"edit",translate("Edit"))
|
||||
btned1.render=function(p,x,r)
|
||||
p.inputstyle="apply"
|
||||
Button.render(p,x,r)
|
||||
end
|
||||
btned1.write=function(r,x)
|
||||
local file_path = "etc/openclash/proxy_provider/" .. fs.basename(p[x].name)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "proxy-provider-file-manage", "%s") %file_path)
|
||||
end
|
||||
|
||||
btndl1 = tb1:option(Button,"download1",translate("Download Config"))
|
||||
btndl1.template="openclash/other_button"
|
||||
btndl1.render=function(y,x,r)
|
||||
y.inputstyle="remove"
|
||||
Button.render(y,x,r)
|
||||
end
|
||||
btndl1.write = function (r,x)
|
||||
local sPath, sFile, fd, block
|
||||
sPath = "/etc/openclash/proxy_provider/"..p[x].name
|
||||
sFile = NXFS.basename(sPath)
|
||||
if fs.isdirectory(sPath) then
|
||||
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
|
||||
sFile = sFile .. ".tar.gz"
|
||||
else
|
||||
fd = nixio.open(sPath, "r")
|
||||
end
|
||||
if not fd then
|
||||
return
|
||||
end
|
||||
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
|
||||
HTTP.prepare_content("application/octet-stream")
|
||||
while true do
|
||||
block = fd:read(nixio.const.buffersize)
|
||||
if (not block) or (#block ==0) then
|
||||
break
|
||||
else
|
||||
HTTP.write(block)
|
||||
end
|
||||
end
|
||||
fd:close()
|
||||
HTTP.close()
|
||||
end
|
||||
|
||||
btnrm1=tb1:option(Button,"remove1",translate("Remove"))
|
||||
btnrm1.render=function(p,x,r)
|
||||
p.inputstyle="reset"
|
||||
Button.render(p,x,r)
|
||||
end
|
||||
btnrm1.write=function(r,x)
|
||||
local r=fs.unlink("/etc/openclash/proxy_provider/"..luci.openclash.basename(p[x].name))
|
||||
if r then table.remove(p,x)end
|
||||
return r
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Refresh, Create, Delete_all, Apply}
|
||||
}
|
||||
|
||||
a = proxy_form:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Refresh", " ")
|
||||
o.inputtitle = translate("Refresh Page")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "proxy-provider-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(DummyValue, "Create", " ")
|
||||
o.rawhtml = true
|
||||
o.template = "openclash/input_file_name"
|
||||
o.value = "/etc/openclash/proxy_provider/"
|
||||
|
||||
o = a:option(Button, "Delete_all", " ")
|
||||
o.inputtitle = translate("Delete All File")
|
||||
o.inputstyle = "remove"
|
||||
o.write = function()
|
||||
luci.sys.call("rm -rf /etc/openclash/proxy_provider/* >/dev/null 2>&1")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "proxy-provider-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
|
||||
proxy_form:append(Template("openclash/toolbar_show"))
|
||||
return proxy_form
|
@ -1,162 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
m = Map(openclash, translate("Edit Rule Providers"))
|
||||
m.pageaction = false
|
||||
m.description=translate("规则集使用介绍:https://wiki.metacubex.one/config/rule-providers/content/")
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/rule-providers-settings")
|
||||
if m.uci:get(openclash, sid) ~= "rule_providers" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Rule Providers Setting ]]--
|
||||
s = m:section(NamedSection, sid, "rule_providers")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Value, "name", translate("Rule Providers Name"))
|
||||
o.rmempty = false
|
||||
o.default = "Rule-provider - "..sid
|
||||
|
||||
o = s:option(ListValue, "type", translate("Rule Providers Type"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose The Rule Providers Type")
|
||||
o:value("http", translate("http"))
|
||||
o:value("file", translate("file"))
|
||||
|
||||
o = s:option(ListValue, "behavior", translate("Rule Behavior"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose The Rule Behavior")
|
||||
o:value("domain")
|
||||
o:value("ipcidr")
|
||||
o:value("classical")
|
||||
|
||||
o = s:option(ListValue, "format", translate("Rule Format")..translate("(TUN&Meta Core)"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose The Rule File Format, For More Info:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/rule-providers/content/\")'>https://wiki.metacubex.one/config/rule-providers/content/</a>"
|
||||
o:value("yaml")
|
||||
o:value("text")
|
||||
o:value("mrs")
|
||||
|
||||
o = s:option(ListValue, "path", translate("Rule Providers Path"))
|
||||
o.description = translate("Update Your Rule Providers File From Config Luci Page")
|
||||
local p,h={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/rule_provider/*"))do
|
||||
h=fs.stat(f)
|
||||
if h then
|
||||
p[t]={}
|
||||
p[t].name=fs.basename(f)
|
||||
o:value("./rule_provider/"..p[t].name)
|
||||
end
|
||||
end
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
|
||||
h=fs.stat(f)
|
||||
if h then
|
||||
p[t]={}
|
||||
p[t].name=fs.basename(f)
|
||||
o:value("./game_rules/"..p[t].name)
|
||||
end
|
||||
end
|
||||
o.rmempty = false
|
||||
o:depends("type", "file")
|
||||
|
||||
o = s:option(Value, "url", translate("Rule Providers URL"))
|
||||
o.rmempty = false
|
||||
o:depends("type", "http")
|
||||
|
||||
o = s:option(Value, "interval", translate("Rule Providers Interval(s)"))
|
||||
o.default = "86400"
|
||||
o.rmempty = false
|
||||
o:depends("type", "http")
|
||||
|
||||
o = s:option(ListValue, "position", translate("Append Position"))
|
||||
o.rmempty = false
|
||||
o:value("0", translate("Priority Match"))
|
||||
o:value("1", translate("Extended Match"))
|
||||
|
||||
o = s:option(ListValue, "group", translate("Set Proxy Group"))
|
||||
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT'")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
local groupnames,filename
|
||||
filename = m.uci:get(openclash, "config", "config_path")
|
||||
if filename then
|
||||
groupnames = sys.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
|
||||
if groupnames then
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
m.uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
sys.call("/usr/share/openclash/yml_groups_name_ch.sh")
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,123 +0,0 @@
|
||||
|
||||
local rule_form
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
local g,h={}
|
||||
for n,m in ipairs(fs.glob("/etc/openclash/rule_provider/*"))do
|
||||
h=fs.stat(m)
|
||||
if h then
|
||||
g[n]={}
|
||||
g[n].num=string.format(n)
|
||||
g[n].name=fs.basename(m)
|
||||
g[n].mtime=os.date("%Y-%m-%d %H:%M:%S",h.mtime)
|
||||
g[n].size=fs.filesize(h.size)
|
||||
g[n].remove=0
|
||||
g[n].enable=false
|
||||
end
|
||||
end
|
||||
|
||||
rule_form=SimpleForm("rule_provider_file_list",translate("Rule Providers File List"))
|
||||
rule_form.reset=false
|
||||
rule_form.submit=false
|
||||
tb2=rule_form:section(Table,g)
|
||||
nu2=tb2:option(DummyValue,"num",translate("Serial Number"))
|
||||
nm2=tb2:option(DummyValue,"name",translate("File Name"))
|
||||
mt2=tb2:option(DummyValue,"mtime",translate("Update Time"))
|
||||
sz2=tb2:option(DummyValue,"size",translate("Size"))
|
||||
|
||||
btned1=tb2:option(Button,"edit",translate("Edit"))
|
||||
btned1.render=function(g,n,h)
|
||||
g.inputstyle="apply"
|
||||
Button.render(g,n,h)
|
||||
end
|
||||
btned1.write=function(h,n)
|
||||
local file_path = "etc/openclash/rule_provider/" .. fs.basename(g[n].name)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "rule-providers-file-manage", "%s") %file_path)
|
||||
end
|
||||
|
||||
btndl2 = tb2:option(Button,"download2",translate("Download Config"))
|
||||
btndl2.template="openclash/other_button"
|
||||
btndl2.render=function(m,n,h)
|
||||
m.inputstyle="remove"
|
||||
Button.render(m,n,h)
|
||||
end
|
||||
btndl2.write = function (h,n)
|
||||
local sPath, sFile, fd, block
|
||||
sPath = "/etc/openclash/rule_provider/"..g[n].name
|
||||
sFile = NXFS.basename(sPath)
|
||||
if fs.isdirectory(sPath) then
|
||||
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
|
||||
sFile = sFile .. ".tar.gz"
|
||||
else
|
||||
fd = nixio.open(sPath, "r")
|
||||
end
|
||||
if not fd then
|
||||
return
|
||||
end
|
||||
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
|
||||
HTTP.prepare_content("application/octet-stream")
|
||||
while true do
|
||||
block = fd:read(nixio.const.buffersize)
|
||||
if (not block) or (#block ==0) then
|
||||
break
|
||||
else
|
||||
HTTP.write(block)
|
||||
end
|
||||
end
|
||||
fd:close()
|
||||
HTTP.close()
|
||||
end
|
||||
|
||||
btnrm2=tb2:option(Button,"remove2",translate("Remove"))
|
||||
btnrm2.render=function(g,n,h)
|
||||
g.inputstyle="reset"
|
||||
Button.render(g,n,h)
|
||||
end
|
||||
btnrm2.write=function(h,n)
|
||||
local h=fs.unlink("/etc/openclash/rule_provider/"..luci.openclash.basename(g[n].name))
|
||||
if h then table.remove(g,n)end
|
||||
return h
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Refresh, Create, Delete_all, Apply}
|
||||
}
|
||||
|
||||
a = rule_form:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Refresh", " ")
|
||||
o.inputtitle = translate("Refresh Page")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(DummyValue, "Create", " ")
|
||||
o.rawhtml = true
|
||||
o.template = "openclash/input_file_name"
|
||||
o.value = "/etc/openclash/rule_provider/"
|
||||
|
||||
o = a:option(Button, "Delete_all", " ")
|
||||
o.inputtitle = translate("Delete All File")
|
||||
o.inputstyle = "remove"
|
||||
o.write = function()
|
||||
luci.sys.call("rm -rf /etc/openclash/rule_provider/* >/dev/null 2>&1")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
|
||||
rule_form:append(Template("openclash/toolbar_show"))
|
||||
return rule_form
|
@ -1,106 +0,0 @@
|
||||
|
||||
local form, m
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
m = SimpleForm("openclash", translate("Other Rule Providers List"))
|
||||
m.description=translate("Rule Project:").." lhie1 ( https://github.com/dler-io/Rules )<br/>"..
|
||||
translate("Rule Project:").." ACL4SSR ( https://github.com/ACL4SSR/ACL4SSR/tree/master )"
|
||||
m.reset = false
|
||||
m.submit = false
|
||||
|
||||
local t = {
|
||||
{Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Refresh", " ")
|
||||
o.inputtitle = translate("Refresh Page")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
SYS.call("rm -rf /tmp/rule_providers_name 2>/dev/null")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-settings"))
|
||||
end
|
||||
|
||||
if not NXFS.access("/tmp/rule_providers_name") then
|
||||
SYS.call("awk -v d=',' -F ',' '{print $4d$5}' /usr/share/openclash/res/rule_providers.list > /tmp/rule_providers_name 2>/dev/null")
|
||||
end
|
||||
file = io.open("/tmp/rule_providers_name", "r");
|
||||
|
||||
---- Rules List
|
||||
local e={},o,t
|
||||
if NXFS.access("/tmp/rule_providers_name") then
|
||||
for o in file:lines() do
|
||||
table.insert(e,o)
|
||||
end
|
||||
for t,o in ipairs(e) do
|
||||
e[t]={}
|
||||
e[t].num=string.format(t)
|
||||
e[t].name=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",o)),1,-2)
|
||||
e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $6}' 2>/dev/null",o)),1,-2)
|
||||
if e[t].lfilename == "" then
|
||||
e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $5}' 2>/dev/null",o)),1,-2)
|
||||
end
|
||||
e[t].filename=o
|
||||
e[t].author=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $2}' 2>/dev/null",o)),1,-2)
|
||||
e[t].rule_type=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $3}' 2>/dev/null",o)),1,-2)
|
||||
RULE_FILE="/etc/openclash/rule_provider/".. e[t].lfilename
|
||||
if fs.mtime(RULE_FILE) then
|
||||
e[t].size=fs.filesize(fs.stat(RULE_FILE).size)
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(RULE_FILE))
|
||||
else
|
||||
e[t].size="/"
|
||||
e[t].mtime="/"
|
||||
end
|
||||
if fs.isfile(RULE_FILE) then
|
||||
e[t].exist=translate("Exist")
|
||||
else
|
||||
e[t].exist=translate("Not Exist")
|
||||
end
|
||||
e[t].remove=0
|
||||
end
|
||||
end
|
||||
file:close()
|
||||
|
||||
form=SimpleForm("filelist")
|
||||
form.reset=false
|
||||
form.submit=false
|
||||
tb=form:section(Table,e)
|
||||
nu=tb:option(DummyValue,"num",translate("Serial Number"))
|
||||
st=tb:option(DummyValue,"exist",translate("State"))
|
||||
st.template="openclash/cfg_check"
|
||||
tp=tb:option(DummyValue,"rule_type",translate("Rule Type"))
|
||||
nm=tb:option(DummyValue,"name",translate("Rule Name"))
|
||||
au=tb:option(DummyValue,"author",translate("Rule Author"))
|
||||
fm=tb:option(DummyValue,"lfilename",translate("File Name"))
|
||||
sz=tb:option(DummyValue,"size",translate("Size"))
|
||||
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
|
||||
|
||||
btnis=tb:option(DummyValue,"filename",translate("Download Rule"))
|
||||
btnis.template="openclash/download_rule"
|
||||
|
||||
btnrm=tb:option(Button,"remove",translate("Remove"))
|
||||
btnrm.render=function(e,t,a)
|
||||
e.inputstyle="reset"
|
||||
Button.render(e,t,a)
|
||||
end
|
||||
btnrm.write=function(a,t)
|
||||
fs.unlink("/etc/openclash/rule_provider/"..e[t].lfilename)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
|
||||
end
|
||||
|
||||
return m, form
|
@ -1,289 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
m = Map(openclash, translate("Rule Providers Append"))
|
||||
m.pageaction = false
|
||||
m.description=translate("Attention:")..
|
||||
"<br/>"..translate("The game proxy is a test function and does not guarantee the availability of rules")..
|
||||
"<br/>"..translate("Preparation steps:")..
|
||||
"<br/>"..translate("1. In the <server and policy group management> page, create the policy group and node you are going to use, and apply the configuration (when adding nodes, you must select the policy group you want to join). Policy group type suggestion: fallback, game nodes must be support UDP and not a Vmess")..
|
||||
"<br/>"..translate("2. Click the <manage third party game rules> or <manage third party rule set> button to enter the rule list and download the rules you want to use")..
|
||||
"<br/>"..translate("3. On this page, set the corresponding configuration file and policy group of the rule you have downloaded, and save the settings")..
|
||||
"<br/>"..translate("4. Install the TUN or Meta core")..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("When setting this page, if the groups is empty, please go to the <server and group management> page to add")..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("Introduction to rule set usage: https://wiki.metacubex.one/config/rule-providers/content/")
|
||||
|
||||
function IsRuleFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-6,-1))
|
||||
return e==".rules"
|
||||
end
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
-- [[ Edit Game Rule ]] --
|
||||
s = m:section(TypedSection, "game_config", translate("Game Rules Append"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "openclash/tblsection"
|
||||
s.rmempty = false
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- config
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---- rule name
|
||||
o = s:option(DynamicList, "rule_name", translate("Game Rule's Name"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].filename=fs.basename(f)
|
||||
if IsRuleFile(e[t].filename) then
|
||||
e[t].name=string.gsub(luci.sys.exec(string.format("grep ',%s$' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $1}' 2>/dev/null",e[t].filename)), "[\r\n]", "")
|
||||
if e[t].name ~= "" and e[t].name ~= nil then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o.rmempty = true
|
||||
|
||||
---- Proxy Group
|
||||
o = s:option(ListValue, "group", translate("Select Proxy Group"))
|
||||
local groupnames,filename
|
||||
filename = m.uci:get(openclash, "config", "config_path")
|
||||
if filename then
|
||||
groupnames = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
|
||||
if groupnames then
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
o.rmempty = true
|
||||
|
||||
-- [[ Edit Other Rule Provider ]] --
|
||||
s = m:section(TypedSection, "rule_provider_config", translate("Other Rule Providers Append"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "openclash/tblsection"
|
||||
s.rmempty = false
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- config
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---- rule name
|
||||
o = s:option(DynamicList, "rule_name", translate("Rule Provider's Name"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/rule_provider/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].filename=fs.basename(f)
|
||||
if IsYamlFile(e[t].filename) or IsYmlFile(e[t].filename) then
|
||||
e[t].name=string.gsub(luci.sys.exec(string.format("grep ',%s$' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",e[t].filename)), "[\r\n]", "")
|
||||
if e[t].name ~= "" and e[t].name ~= nil then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o.rmempty = true
|
||||
|
||||
---- Proxy Group
|
||||
o = s:option(ListValue, "group", translate("Select Proxy Group"))
|
||||
local groupnames,filename
|
||||
filename = m.uci:get(openclash, "config", "config_path")
|
||||
if filename then
|
||||
groupnames = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
|
||||
if groupnames then
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(Value, "interval", translate("Rule Providers Interval(s)"))
|
||||
o.default = "86400"
|
||||
o.rmempty = false
|
||||
|
||||
---- position
|
||||
o = s:option(ListValue, "position", translate("Append Position"))
|
||||
o.rmempty = false
|
||||
o:value("0", translate("Priority Match"))
|
||||
o:value("1", translate("Extended Match"))
|
||||
|
||||
-- [[ Edit Custom Rule Provider ]] --
|
||||
s = m:section(TypedSection, "rule_providers", translate("Custom Rule Providers Append"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "openclash/tblsection"
|
||||
s.extedit = luci.dispatcher.build_url("admin/services/openclash/rule-providers-config/%s")
|
||||
function s.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(s.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "config", translate("Config File"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("all")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "name", translate("Rule Providers Name"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "position", translate("Append Position"))
|
||||
o.rmempty = false
|
||||
o:value("0", translate("Priority Match"))
|
||||
o:value("1", translate("Extended Match"))
|
||||
|
||||
local rm = {
|
||||
{rule_mg, pro_mg}
|
||||
}
|
||||
|
||||
rmg = m:section(Table, rm)
|
||||
|
||||
o = rmg:option(Button, "rule_mg", " ")
|
||||
o.inputtitle = translate("Game Rules Manage")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
|
||||
end
|
||||
|
||||
o = rmg:option(Button, "pro_mg", " ")
|
||||
o.inputtitle = translate("Other Rule Provider Manage")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Apply}
|
||||
}
|
||||
|
||||
ss = m:section(Table, t)
|
||||
|
||||
o = ss:option(Button, "Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit("openclash")
|
||||
end
|
||||
|
||||
o = ss:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Apply Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 1)
|
||||
m.uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
|
||||
return m
|
@ -1,973 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
local uuid = luci.sys.exec("cat /proc/sys/kernel/random/uuid")
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
local encrypt_methods_ss = {
|
||||
|
||||
-- stream
|
||||
"rc4-md5",
|
||||
"aes-128-cfb",
|
||||
"aes-192-cfb",
|
||||
"aes-256-cfb",
|
||||
"aes-128-ctr",
|
||||
"aes-192-ctr",
|
||||
"aes-256-ctr",
|
||||
"aes-128-gcm",
|
||||
"aes-192-gcm",
|
||||
"aes-256-gcm",
|
||||
"chacha20-ietf",
|
||||
"xchacha20",
|
||||
"chacha20-ietf-poly1305",
|
||||
"xchacha20-ietf-poly1305",
|
||||
"2022-blake3-aes-128-gcm",
|
||||
"2022-blake3-aes-256-gcm",
|
||||
"2022-blake3-chacha20-poly1305"
|
||||
}
|
||||
|
||||
local encrypt_methods_ssr = {
|
||||
|
||||
"rc4-md5",
|
||||
"aes-128-cfb",
|
||||
"aes-192-cfb",
|
||||
"aes-256-cfb",
|
||||
"aes-128-ctr",
|
||||
"aes-192-ctr",
|
||||
"aes-256-ctr",
|
||||
"chacha20-ietf",
|
||||
"xchacha20"
|
||||
}
|
||||
|
||||
local securitys = {
|
||||
"auto",
|
||||
"none",
|
||||
"zero",
|
||||
"aes-128-gcm",
|
||||
"chacha20-poly1305"
|
||||
}
|
||||
|
||||
local protocols = {
|
||||
"origin",
|
||||
"auth_sha1_v4",
|
||||
"auth_aes128_md5",
|
||||
"auth_aes128_sha1",
|
||||
"auth_chain_a",
|
||||
"auth_chain_b"
|
||||
}
|
||||
|
||||
local hysteria_protocols = {
|
||||
"udp",
|
||||
"wechat-video",
|
||||
"faketcp"
|
||||
}
|
||||
|
||||
local hysteria2_protocols = {
|
||||
"udp"
|
||||
}
|
||||
|
||||
local obfs = {
|
||||
"plain",
|
||||
"http_simple",
|
||||
"http_post",
|
||||
"random_head",
|
||||
"tls1.2_ticket_auth",
|
||||
"tls1.2_ticket_fastauth"
|
||||
}
|
||||
|
||||
m = Map(openclash, translate("Edit Server"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
|
||||
|
||||
if m.uci:get(openclash, sid) ~= "servers" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Servers Setting ]] --
|
||||
s = m:section(NamedSection, sid, "servers")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(DummyValue, "server_url", "SS/SSR/VMESS/TROJAN URL")
|
||||
o.rawhtml = true
|
||||
o.template = "openclash/server_url"
|
||||
o.value = sid
|
||||
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Flag, "manual", translate("Custom Tag"))
|
||||
o.rmempty = false
|
||||
o.default = "0"
|
||||
o.description = translate("Mark as Custom Node to Prevent Retention config from being Deleted When Enabled")
|
||||
|
||||
o = s:option(ListValue, "type", translate("Server Node Type"))
|
||||
o:value("ss", translate("Shadowsocks"))
|
||||
o:value("ssr", translate("ShadowsocksR"))
|
||||
o:value("vmess", translate("Vmess"))
|
||||
o:value("trojan", translate("trojan"))
|
||||
o:value("vless", translate("Vless ")..translate("(Only Meta Core)"))
|
||||
o:value("hysteria", translate("Hysteria ")..translate("(Only Meta Core)"))
|
||||
o:value("hysteria2", translate("Hysteria2 ")..translate("(Only Meta Core)"))
|
||||
o:value("wireguard", translate("WireGuard")..translate("(Only Meta Core)"))
|
||||
o:value("tuic", translate("Tuic")..translate("(Only Meta Core)"))
|
||||
o:value("snell", translate("Snell"))
|
||||
o:value("socks5", translate("Socks5"))
|
||||
o:value("http", translate("HTTP(S)"))
|
||||
|
||||
o.description = translate("Using incorrect encryption mothod may causes service fail to start")
|
||||
|
||||
o = s:option(Value, "name", translate("Server Alias"))
|
||||
o.rmempty = false
|
||||
o.default = "Server - "..sid
|
||||
|
||||
o = s:option(Value, "server", translate("Server Address"))
|
||||
o.datatype = "host"
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(Value, "port", translate("Server Port"))
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o.default = "443"
|
||||
|
||||
o = s:option(Flag, "flag_port_hopping", translate("Enable Port Hopping"))
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
o.rmempty = true
|
||||
o.default = "0"
|
||||
|
||||
o = s:option(Value, "ports", translate("Port Range"))
|
||||
o.datatype = "portrange"
|
||||
o.rmempty = true
|
||||
o.default = "20000-40000"
|
||||
o.placeholder = translate("20000-40000")
|
||||
o:depends({type = "hysteria", flag_port_hopping = true})
|
||||
o:depends({type = "hysteria2", flag_port_hopping = true})
|
||||
|
||||
o = s:option(Value, "password", translate("Password"))
|
||||
o.password = true
|
||||
o.rmempty = false
|
||||
o:depends("type", "ss")
|
||||
o:depends("type", "ssr")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ Tuic ]]--
|
||||
o = s:option(Value, "tc_ip", translate("Server IP"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("127.0.0.1")
|
||||
o.datatype = "or(ip4addr, ip6addr)"
|
||||
o:depends("type", "tuic")
|
||||
|
||||
o = s:option(Value, "tc_token", translate("Token"))
|
||||
o.rmempty = true
|
||||
o:depends("type", "tuic")
|
||||
|
||||
o = s:option(ListValue, "udp_relay_mode", translate("UDP Relay Mode"))
|
||||
o.rmempty = true
|
||||
o.default = "native"
|
||||
o:value("native")
|
||||
o:value("quic")
|
||||
o:depends("type", "tuic")
|
||||
|
||||
o = s:option(ListValue, "congestion_controller", translate("Congestion Controller"))
|
||||
o.rmempty = true
|
||||
o.default = "cubic"
|
||||
o:value("cubic")
|
||||
o:value("bbr")
|
||||
o:value("new_reno")
|
||||
o:depends("type", "tuic")
|
||||
|
||||
o = s:option(DynamicList, "tc_alpn", translate("Alpn"))
|
||||
o.rmempty = true
|
||||
o:value("h3")
|
||||
o:value("h2")
|
||||
o:depends("type", "tuic")
|
||||
|
||||
o = s:option(ListValue, "disable_sni", translate("Disable SNI"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "tuic")
|
||||
|
||||
o = s:option(ListValue, "reduce_rtt", translate("Reduce RTT"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "tuic")
|
||||
|
||||
o = s:option(Value, "heartbeat_interval", translate("Heartbeat Interval"))
|
||||
o.rmempty = true
|
||||
o:depends("type", "tuic")
|
||||
o.default = "8000"
|
||||
|
||||
o = s:option(Value, "request_timeout", translate("Request Timeout"))
|
||||
o.rmempty = true
|
||||
o.default = "8000"
|
||||
o:depends("type", "tuic")
|
||||
|
||||
o = s:option(Value, "max_udp_relay_packet_size", translate("Max UDP Relay Packet Size"))
|
||||
o.rmempty = true
|
||||
o.default = "1500"
|
||||
o:depends("type", "tuic")
|
||||
|
||||
o = s:option(Value, "max_open_streams", translate("Max Open Streams"))
|
||||
o.rmempty = true
|
||||
o.default = "100"
|
||||
o:depends("type", "tuic")
|
||||
|
||||
-- [[ Wireguard ]]--
|
||||
o = s:option(Value, "wg_ip", translate("IP"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("127.0.0.1")
|
||||
o.datatype = "ip4addr"
|
||||
o:depends("type", "wireguard")
|
||||
|
||||
o = s:option(Value, "wg_ipv6", translate("IPv6"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("your_ipv6")
|
||||
o.datatype = "ip6addr"
|
||||
o:depends("type", "wireguard")
|
||||
|
||||
o = s:option(Value, "private_key", translate("Private Key"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("eCtXsJZ27+4PbhDkHnB923tkUn2Gj59wZw5wFA75MnU=")
|
||||
o:depends("type", "wireguard")
|
||||
|
||||
o = s:option(Value, "public_key", translate("Public Key"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("Cr8hWlKvtDt7nrvf+f0brNQQzabAqrjfBvas9pmowjo=")
|
||||
o:depends("type", "wireguard")
|
||||
|
||||
o = s:option(Value, "preshared_key", translate("Preshared Key"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("base64")
|
||||
o:depends("type", "wireguard")
|
||||
|
||||
o = s:option(DynamicList, "wg_dns", translate("DNS"))
|
||||
o.rmempty = true
|
||||
o:value("1.1.1.1")
|
||||
o:value("8.8.8.8")
|
||||
o:depends("type", "wireguard")
|
||||
|
||||
o = s:option(Value, "wg_mtu", translate("MTU"))
|
||||
o.rmempty = true
|
||||
o.default = "1420"
|
||||
o.placeholder = translate("1420")
|
||||
o:depends("type", "wireguard")
|
||||
|
||||
o = s:option(Flag, "flag_transport", translate("Enable Transport Protocol Settings"))
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
o.rmempty = true
|
||||
o.default = "0"
|
||||
|
||||
o = s:option(ListValue, "hysteria_protocol", translate("Protocol"))
|
||||
for _, v in ipairs(hysteria_protocols) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends({type = "hysteria", flag_transport = true})
|
||||
|
||||
o = s:option(ListValue, "hysteria2_protocol", translate("Protocol"))
|
||||
for _, v in ipairs(hysteria2_protocols) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends({type = "hysteria2", flag_transport = true})
|
||||
|
||||
o = s:option(Value, "hysteria_up", translate("Uplink Capacity(Default:Mbps)"))
|
||||
o.rmempty = false
|
||||
o.description = translate("Required")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
o = s:option(Value, "hysteria_down", translate("Downlink Capacity(Default:Mbps)"))
|
||||
o.rmempty = false
|
||||
o.description = translate("Required")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
o = s:option(Value, "psk", translate("Psk"))
|
||||
o.rmempty = true
|
||||
o:depends("type", "snell")
|
||||
|
||||
o = s:option(ListValue, "snell_version", translate("Version"))
|
||||
o:value("2")
|
||||
o:value("3")
|
||||
o:depends("type", "snell")
|
||||
|
||||
o = s:option(ListValue, "cipher", translate("Encrypt Method"))
|
||||
for _, v in ipairs(encrypt_methods_ss) do o:value(v) end
|
||||
o.description = translate("Only Meta Core Support SS2022")
|
||||
o.rmempty = true
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "cipher_ssr", translate("Encrypt Method"))
|
||||
for _, v in ipairs(encrypt_methods_ssr) do o:value(v) end
|
||||
o:value("dummy", "none")
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(ListValue, "protocol", translate("Protocol"))
|
||||
for _, v in ipairs(protocols) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(Value, "protocol_param", translate("Protocol param(optional)"))
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(ListValue, "securitys", translate("Encrypt Method"))
|
||||
for _, v in ipairs(securitys) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends("type", "vmess")
|
||||
|
||||
o = s:option(ListValue, "obfs_ssr", translate("Obfs"))
|
||||
for _, v in ipairs(obfs) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(Value, "obfs_param", translate("Obfs param(optional)"))
|
||||
o:depends("type", "ssr")
|
||||
|
||||
-- AlterId
|
||||
o = s:option(Value, "alterId", translate("AlterId"))
|
||||
o.default = "32"
|
||||
o.rmempty = true
|
||||
o:depends("type", "vmess")
|
||||
|
||||
-- VmessId
|
||||
o = s:option(Value, "uuid", translate("UUID"))
|
||||
o.rmempty = true
|
||||
o.default = uuid
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
|
||||
o = s:option(ListValue, "udp", translate("UDP Enable"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "ss")
|
||||
o:depends("type", "ssr")
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "trojan")
|
||||
o:depends({type = "snell", snell_version = "3"})
|
||||
o:depends("type", "wireguard")
|
||||
|
||||
o = s:option(ListValue, "udp_over_tcp", translate("udp-over-tcp"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "xudp", translate("XUDP Enable")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends({type = "vmess", udp = "true"})
|
||||
o:depends({type = "vless", udp = "true"})
|
||||
|
||||
o = s:option(ListValue, "obfs", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("tls")
|
||||
o:value("http")
|
||||
o:value("websocket", translate("websocket (ws)"))
|
||||
o:value("shadow-tls", translate("shadow-tls")..translate("(Only Meta Core)"))
|
||||
o:value("restls", translate("restls")..translate("(Only Meta Core)"))
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "obfs_snell", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("tls")
|
||||
o:value("http")
|
||||
o:depends("type", "snell")
|
||||
|
||||
o = s:option(ListValue, "obfs_vless", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "tcp"
|
||||
o:value("tcp", translate("tcp"))
|
||||
o:value("ws", translate("websocket (ws)"))
|
||||
o:value("grpc", translate("grpc"))
|
||||
o:depends("type", "vless")
|
||||
|
||||
o = s:option(ListValue, "obfs_vmess", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("websocket", translate("websocket (ws)"))
|
||||
o:value("http", translate("http"))
|
||||
o:value("h2", translate("h2"))
|
||||
o:value("grpc", translate("grpc"))
|
||||
o:depends("type", "vmess")
|
||||
|
||||
o = s:option(ListValue, "obfs_trojan", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("ws", translate("websocket (ws)"))
|
||||
o:value("grpc", translate("grpc"))
|
||||
o:depends("type", "trojan")
|
||||
|
||||
o = s:option(Value, "host", translate("obfs-hosts"))
|
||||
o.datatype = "host"
|
||||
o.placeholder = translate("example.com")
|
||||
o.rmempty = true
|
||||
o:depends("obfs", "tls")
|
||||
o:depends("obfs", "http")
|
||||
o:depends("obfs", "websocket")
|
||||
o:depends("obfs", "shadow-tls")
|
||||
o:depends("obfs", "restls")
|
||||
o:depends("obfs_snell", "tls")
|
||||
o:depends("obfs_snell", "http")
|
||||
|
||||
o = s:option(Value, "obfs_password", translate("obfs-password"))
|
||||
o.rmempty = true
|
||||
o:depends("obfs", "shadow-tls")
|
||||
o:depends("obfs", "restls")
|
||||
|
||||
o = s:option(ListValue, "obfs_version_hint", translate("version-hint"))
|
||||
o.rmempty = true
|
||||
o:value("tls13")
|
||||
o:value("tls12")
|
||||
o:depends("obfs", "restls")
|
||||
|
||||
o = s:option(Value, "obfs_restls_script", translate("restls-script"))
|
||||
o.rmempty = true
|
||||
o:depends("obfs", "restls")
|
||||
o.placeholder = translate("1000?100<1,500~100,350~100,600~100,400~200")
|
||||
|
||||
-- vmess路径
|
||||
o = s:option(Value, "path", translate("path"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("/")
|
||||
o:depends("obfs", "websocket")
|
||||
|
||||
o = s:option(DynamicList, "h2_host", translate("host"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("http.example.com")
|
||||
o.datatype = "host"
|
||||
o:depends("obfs_vmess", "h2")
|
||||
|
||||
o = s:option(Value, "h2_path", translate("path"))
|
||||
o.rmempty = true
|
||||
o.default = "/"
|
||||
o:depends("obfs_vmess", "h2")
|
||||
|
||||
o = s:option(DynamicList, "http_path", translate("path"))
|
||||
o.rmempty = true
|
||||
o:value("/")
|
||||
o:value("/video")
|
||||
o:depends("obfs_vmess", "http")
|
||||
|
||||
o = s:option(Value, "custom", translate("headers"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("v2ray.com")
|
||||
o:depends("obfs", "websocket")
|
||||
|
||||
o = s:option(Value, "ws_opts_path", translate("ws-opts-path"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("/path")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
o:depends("obfs_vless", "ws")
|
||||
|
||||
o = s:option(DynamicList, "ws_opts_headers", translate("ws-opts-headers"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("Host: v2ray.com")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
o:depends("obfs_vless", "ws")
|
||||
|
||||
o = s:option(Value, "vless_flow", translate("flow"))
|
||||
o.rmempty = true
|
||||
o.default = "xtls-rprx-direct"
|
||||
o:value("xtls-rprx-direct")
|
||||
o:value("xtls-rprx-origin")
|
||||
o:value("xtls-rprx-vision")
|
||||
o:depends("obfs_vless", "tcp")
|
||||
|
||||
-- [[ grpc ]]--
|
||||
o = s:option(Value, "grpc_service_name", translate("grpc-service-name"))
|
||||
o.rmempty = true
|
||||
o.datatype = "host"
|
||||
o.placeholder = translate("example")
|
||||
o:depends("obfs_trojan", "grpc")
|
||||
o:depends("obfs_vmess", "grpc")
|
||||
o:depends("obfs_vless", "grpc")
|
||||
|
||||
-- [[ reality-public-key ]]--
|
||||
o = s:option(Value, "reality_public_key", translate("public-key(reality)"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("CrrQSjAG_YkHLwvM2M-7XkKJilgL5upBKCp0od0tLhE")
|
||||
o:depends("obfs_vless", "grpc")
|
||||
o:depends("obfs_vless", "tcp")
|
||||
|
||||
-- [[ reality-short-id ]]--
|
||||
o = s:option(Value, "reality_short_id", translate("short-id(reality)"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("10f897e26c4b9478")
|
||||
o:depends("obfs_vless", "grpc")
|
||||
o:depends("obfs_vless", "tcp")
|
||||
|
||||
o = s:option(Value, "max_early_data", translate("max-early-data"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("2048")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
|
||||
o = s:option(Value, "early_data_header_name", translate("early-data-header-name"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("Sec-WebSocket-Protocol")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
|
||||
-- [[ skip-cert-verify ]]--
|
||||
o = s:option(ListValue, "skip_cert_verify", translate("skip-cert-verify"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("obfs", "websocket")
|
||||
o:depends("obfs_vmess", "none")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
o:depends("obfs_vmess", "grpc")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
o:depends("type", "tuic")
|
||||
|
||||
-- [[ TLS ]]--
|
||||
o = s:option(ListValue, "tls", translate("TLS"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("obfs", "websocket")
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
|
||||
o = s:option(Value, "servername", translate("servername"))
|
||||
o.rmempty = true
|
||||
o.datatype = "host"
|
||||
o.placeholder = translate("example.com")
|
||||
o:depends({obfs_vmess = "websocket", tls = "true"})
|
||||
o:depends({obfs_vmess = "grpc", tls = "true"})
|
||||
o:depends({obfs_vmess = "none", tls = "true"})
|
||||
o:depends("type", "vless")
|
||||
|
||||
o = s:option(Value, "keep_alive", translate("keep-alive"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("obfs_vmess", "http")
|
||||
|
||||
-- [[ MUX ]]--
|
||||
o = s:option(ListValue, "mux", translate("mux"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("obfs", "websocket")
|
||||
|
||||
-- [[ sni ]]--
|
||||
o = s:option(Value, "sni", translate("sni"))
|
||||
o.datatype = "host"
|
||||
o.placeholder = translate("example.com")
|
||||
o.rmempty = true
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "http")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ headers ]]--
|
||||
o = s:option(DynamicList, "http_headers", translate("headers"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("User-Agent: okhttp/3.11.0 Dalvik/2.1.0 ...... ")
|
||||
o:depends("type", "http")
|
||||
|
||||
-- 验证用户名
|
||||
o = s:option(Value, "auth_name", translate("Auth Username"))
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
o.rmempty = true
|
||||
|
||||
-- 验证密码
|
||||
o = s:option(Value, "auth_pass", translate("Auth Password"))
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
o.rmempty = true
|
||||
|
||||
-- [[ alpn ]]--
|
||||
o = s:option(DynamicList, "alpn", translate("alpn"))
|
||||
o.rmempty = true
|
||||
o:value("h2")
|
||||
o:value("http/1.1")
|
||||
o:depends("type", "trojan")
|
||||
|
||||
-- [[ alpn ]]--
|
||||
o = s:option(DynamicList, "hysteria_alpn", translate("alpn"))
|
||||
o.rmempty = false
|
||||
o:value("h3")
|
||||
o:value("h2")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ trojan-ws-path ]]--
|
||||
o = s:option(Value, "trojan_ws_path", translate("Path"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("/path")
|
||||
o:depends("obfs_trojan", "ws")
|
||||
|
||||
-- [[ trojan-ws-headers ]]--
|
||||
o = s:option(DynamicList, "trojan_ws_headers", translate("Headers"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("Host: v2ray.com")
|
||||
o:depends("obfs_trojan", "ws")
|
||||
|
||||
-- [[ hysteria_obfs ]]--
|
||||
o = s:option(Value, "hysteria_obfs", translate("obfs"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("obfs-str")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ hysteria_obfs_password ]]--
|
||||
o = s:option(Value, "hysteria_obfs_password", translate("obfs-password"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("yourpassword")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ hysteria_auth ]]--
|
||||
--o = s:option(Value, "hysteria_auth", translate("auth"))
|
||||
--o.rmempty = true
|
||||
--o.placeholder = translate("[BASE64]")
|
||||
--o:depends("type", "hysteria")
|
||||
|
||||
-- [[ hysteria_auth_str ]]--
|
||||
o = s:option(Value, "hysteria_auth_str", translate("auth_str"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("yubiyubi")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ hysteria_ca ]]--
|
||||
o = s:option(Value, "hysteria_ca", translate("ca"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("./my.ca")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ hysteria_ca_str ]]--
|
||||
o = s:option(Value, "hysteria_ca_str", translate("ca_str"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("xyz")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ recv_window_conn ]]--
|
||||
o = s:option(Flag, "flag_quicparam", translate("Hysterir QUIC parameters"))
|
||||
o:depends("type", "hysteria")
|
||||
o.rmempty = true
|
||||
o.default = "0"
|
||||
|
||||
o = s:option(Value, "recv_window_conn", translate("recv_window_conn"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("QUIC stream receive window")
|
||||
o.datatype = "uinteger"
|
||||
o:depends({type = "hysteria", flag_quicparam = true})
|
||||
|
||||
-- [[ recv_window ]]--
|
||||
o = s:option(Value, "recv_window", translate("recv_window"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("QUIC connection receive window")
|
||||
o.datatype = "uinteger"
|
||||
o:depends({type = "hysteria", flag_quicparam = true})
|
||||
|
||||
-- [[ hop_interval ]]--
|
||||
o = s:option(Value, "hop_interval", translate("Hop Interval (Unit:second)"))
|
||||
o.rmempty = true
|
||||
o.default = "10"
|
||||
o:depends({type = "hysteria", flag_transport = true, flag_port_hopping = true})
|
||||
o:depends({type = "hysteria2", flag_port_hopping = true})
|
||||
|
||||
-- [[ disable_mtu_discovery ]]--
|
||||
o = s:option(ListValue, "disable_mtu_discovery", translate("disable_mtu_discovery"))
|
||||
o.rmempty = true
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o.default = "false"
|
||||
o:depends({type = "hysteria", flag_quicparam = true})
|
||||
|
||||
o = s:option(ListValue, "packet-addr", translate("Packet-Addr")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends({type = "vless", xudp = "false"})
|
||||
|
||||
o = s:option(Value, "packet_encoding", translate("Packet-Encoding")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
|
||||
o = s:option(ListValue, "global_padding", translate("Global-Padding")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "vmess")
|
||||
|
||||
o = s:option(ListValue, "authenticated_length", translate("Authenticated-Length")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "vmess")
|
||||
|
||||
-- [[ Fast Open ]]--
|
||||
o = s:option(ListValue, "fast_open", translate("Fast Open"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "tuic")
|
||||
|
||||
-- [[ TFO ]]--
|
||||
o = s:option(ListValue, "tfo", translate("TFO")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "http")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "ss")
|
||||
o:depends("type", "ssr")
|
||||
o:depends("type", "snell")
|
||||
|
||||
-- [[ fingerprint ]]--
|
||||
o = s:option(Value, "fingerprint", translate("Fingerprint")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "vless")
|
||||
o:depends({type = "ss", obfs = "websocket"})
|
||||
o:depends({type = "ss", obfs = "shadow-tls"})
|
||||
o:depends({type = "vmess", obfs_vmess = "websocket"})
|
||||
o:depends({type = "vmess", obfs_vmess = "h2"})
|
||||
o:depends({type = "vmess", obfs_vmess = "grpc"})
|
||||
|
||||
-- [[ client-fingerprint ]]--
|
||||
o = s:option(ListValue, "client_fingerprint", translate("Client Fingerprint")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o:value("none")
|
||||
o:value("chrome")
|
||||
o:value("firefox")
|
||||
o:value("safari")
|
||||
o:value("ios")
|
||||
o.default = "none"
|
||||
o:depends("type", "vless")
|
||||
o:depends({type = "ss", obfs = "restls"})
|
||||
o:depends({type = "ss", obfs = "shadow-tls"})
|
||||
o:depends({type = "trojan", obfs_vmess = "grpc"})
|
||||
o:depends({type = "vmess", obfs_vmess = "websocket"})
|
||||
o:depends({type = "vmess", obfs_vmess = "http"})
|
||||
o:depends({type = "vmess", obfs_vmess = "h2"})
|
||||
o:depends({type = "vmess", obfs_vmess = "grpc"})
|
||||
|
||||
-- [[ ip version ]]--
|
||||
o = s:option(ListValue, "ip_version", translate("IP Version")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o:value("dual")
|
||||
o:value("ipv4")
|
||||
o:value("ipv4-prefer")
|
||||
o:value("ipv6")
|
||||
o:value("ipv6-prefer")
|
||||
o.default = "ipv4-prefer"
|
||||
|
||||
-- [[ smux ]]--
|
||||
o = s:option(ListValue, "multiplex", translate("Multiplex")..translate("(Only Meta Core)"))
|
||||
o.rmempty = false
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o.default = "false"
|
||||
|
||||
o = s:option(ListValue, "multiplex_protocol", translate("Protocol"))
|
||||
o.rmempty = true
|
||||
o:value("smux")
|
||||
o:value("yamux")
|
||||
o:value("h2mux")
|
||||
o.default = "smux"
|
||||
o:depends("multiplex", "true")
|
||||
|
||||
o = s:option(Value, "multiplex_max_connections", translate("Max-connections"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "4"
|
||||
o.default = "4"
|
||||
o.datatype = "uinteger"
|
||||
o:depends("multiplex", "true")
|
||||
|
||||
o = s:option(Value, "multiplex_min_streams", translate("Min-streams"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "4"
|
||||
o.default = "4"
|
||||
o.datatype = "uinteger"
|
||||
o:depends("multiplex", "true")
|
||||
|
||||
o = s:option(Value, "multiplex_max_streams", translate("Max-streams"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "0"
|
||||
o.default = "0"
|
||||
o.datatype = "uinteger"
|
||||
o:depends("multiplex", "true")
|
||||
|
||||
o = s:option(ListValue, "multiplex_padding", translate("Padding"))
|
||||
o.rmempty = false
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o.default = "false"
|
||||
o:depends("multiplex", "true")
|
||||
|
||||
o = s:option(ListValue, "multiplex_statistic", translate("Statistic"))
|
||||
o.rmempty = false
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o.default = "false"
|
||||
o:depends("multiplex", "true")
|
||||
|
||||
o = s:option(ListValue, "multiplex_only_tcp", translate("Only-tcp"))
|
||||
o.rmempty = false
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o.default = "false"
|
||||
o:depends("multiplex", "true")
|
||||
|
||||
-- [[ interface-name ]]--
|
||||
o = s:option(Value, "interface_name", translate("interface-name"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("eth0")
|
||||
|
||||
-- [[ routing-mark ]]--
|
||||
o = s:option(Value, "routing_mark", translate("routing-mark"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("2333")
|
||||
|
||||
-- [[ other-setting ]]--
|
||||
o = s:option(Value, "other_parameters", translate("Other Parameters"))
|
||||
o.template = "cbi/tvalue"
|
||||
o.rows = 20
|
||||
o.wrap = "off"
|
||||
o.description = font_red..bold_on..translate("Edit Your Other Parameters Here")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
function o.cfgvalue(self, section)
|
||||
if self.map:get(section, "other_parameters") == nil then
|
||||
return "# Example:\n"..
|
||||
"# Only support YAML, four spaces need to be reserved at the beginning of each line to maintain formatting alignment\n"..
|
||||
"# 示例:\n"..
|
||||
"# 仅支持 YAML, 每行行首需要多保留四个空格以使脚本处理后能够与上方配置保持格式对齐\n"..
|
||||
"# type: ss\n"..
|
||||
"# server: \"127.0.0.1\"\n"..
|
||||
"# port: 443\n"..
|
||||
"# cipher: rc4-md5\n"..
|
||||
"# password: \"123456\"\n"..
|
||||
"# udp: true\n"..
|
||||
"# udp-over-tcp: false\n"..
|
||||
"# ip-version: \"dual\"\n"..
|
||||
"# tfo: true\n"..
|
||||
"# smux:\n"..
|
||||
"# enabled: false\n"..
|
||||
"# plugin-opts:\n"..
|
||||
"# mode: tls\n"..
|
||||
"# host: world.taobao.com"
|
||||
else
|
||||
return Value.cfgvalue(self, section)
|
||||
end
|
||||
end
|
||||
function o.validate(self, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
value = value:gsub("%c*$", "")
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
o = s:option(DynamicList, "groups", translate("Proxy Group (Support Regex)"))
|
||||
o.description = font_red..bold_on..translate("No Need Set when Config Create, The added Proxy Groups Must Exist")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
o:value("all", translate("All Groups"))
|
||||
m.uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
m:append(Template("openclash/config_editor"))
|
||||
return m
|
@ -1,286 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
m = Map(openclash, translate("Onekey Create (Servers&Groups manage)"))
|
||||
m.pageaction = false
|
||||
m.description=translate("Attention:")..
|
||||
"<br/>"..translate("1. Before modifying the configuration file, please click the button below to read the configuration file")..
|
||||
"<br/>"..translate("2. Proxy-providers address can be directly filled in the subscription link")..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("Introduction to proxy usage: https://wiki.metacubex.one/config/proxies/")..
|
||||
"<br/>"..translate("Introduction to proxy-provider usage: https://wiki.metacubex.one/config/proxy-providers/")
|
||||
|
||||
s = m:section(TypedSection, "openclash")
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "create_config", translate("Create Config"))
|
||||
o.description = font_red .. bold_on .. translate("Create Config By One-Click Only Need Proxies") .. bold_off .. font_off
|
||||
o.default = 0
|
||||
|
||||
o = s:option(ListValue, "rule_sources", translate("Choose Template For Create Config"))
|
||||
o.description = translate("Use Other Rules To Create Config")
|
||||
o:depends("create_config", 1)
|
||||
o:value("lhie1", translate("lhie1 Rules"))
|
||||
o:value("ConnersHua", translate("ConnersHua(Provider-type) Rules"))
|
||||
o:value("ConnersHua_return", translate("ConnersHua Return Rules"))
|
||||
|
||||
o = s:option(Flag, "mix_proxies", translate("Mix Proxies"))
|
||||
o.description = font_red .. bold_on .. translate("Mix This Page's Proxies") .. bold_off .. font_off
|
||||
o:depends("create_config", 1)
|
||||
o.default = 0
|
||||
|
||||
o = s:option(Flag, "servers_update", translate("Keep Settings"))
|
||||
o.description = font_red .. bold_on .. translate("Only Update Servers Below When Subscription") .. bold_off .. font_off
|
||||
o.default = 0
|
||||
|
||||
o = s:option(DynamicList, "new_servers_group", translate("New Servers Group (Support Regex)"))
|
||||
o.description = translate("Set The New Subscribe Server's Default Proxy Groups")
|
||||
o.rmempty = true
|
||||
o:depends("servers_update", 1)
|
||||
o:value("all", translate("All Groups"))
|
||||
m.uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
o:value(s.name)
|
||||
end)
|
||||
|
||||
-- [[ Groups Manage ]]--
|
||||
s = m:section(TypedSection, "groups", translate("Proxy Groups(No Need Set when Config Create)"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "openclash/tblsection"
|
||||
s.extedit = luci.dispatcher.build_url("admin/services/openclash/groups-config/%s")
|
||||
function s.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(s.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "config", translate("Config File"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("all")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "type", translate("Group Type"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "name", translate("Group Name"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
-- [[ Proxy-Provider Manage ]]--
|
||||
s = m:section(TypedSection, "proxy-provider", translate("Proxy-Provider"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "openclash/tblsection"
|
||||
s.extedit = luci.dispatcher.build_url("admin/services/openclash/proxy-provider-config/%s")
|
||||
function s.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(s.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
o = s:option(Flag, "manual", translate("Custom Tag"))
|
||||
o.rmempty = false
|
||||
o.default = "0"
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "config", translate("Config File"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("all")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "type", translate("Provider Type"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "name", translate("Provider Name"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
-- [[ Servers Manage ]]--
|
||||
s = m:section(TypedSection, "servers", translate("Proxies"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "openclash/tblsection"
|
||||
s.extedit = luci.dispatcher.build_url("admin/services/openclash/servers-config/%s")
|
||||
function s.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(s.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
o = s:option(Flag, "manual", translate("Custom Tag"))
|
||||
o.rmempty = false
|
||||
o.default = "0"
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "config", translate("Config File"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("all")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "type", translate("Type"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "name", translate("Server Alias"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "server", translate("Server Address"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "port", translate("Server Port"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "udp", translate("UDP Support"))
|
||||
function o.cfgvalue(...)
|
||||
if Value.cfgvalue(...) == "true" then
|
||||
return translate("Enable")
|
||||
elseif Value.cfgvalue(...) == "false" then
|
||||
return translate("Disable")
|
||||
else
|
||||
return translate("None")
|
||||
end
|
||||
end
|
||||
|
||||
local tt = {
|
||||
{Delete_Unused_Servers, Delete_Servers, Delete_Proxy_Provider, Delete_Groups}
|
||||
}
|
||||
|
||||
b = m:section(Table, tt)
|
||||
|
||||
o = b:option(Button,"Delete_Unused_Servers", " ")
|
||||
o.inputtitle = translate("Delete Unused Servers")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:commit("openclash")
|
||||
luci.sys.call("sh /usr/share/openclash/cfg_unused_servers_del.sh 2>/dev/null")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
|
||||
end
|
||||
|
||||
o = b:option(Button,"Delete_Servers", " ")
|
||||
o.inputtitle = translate("Delete Servers")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:delete_all("openclash", "servers", function(s) return true end)
|
||||
m.uci:commit("openclash")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
|
||||
end
|
||||
|
||||
o = b:option(Button,"Delete_Proxy_Provider", " ")
|
||||
o.inputtitle = translate("Delete Proxy Providers")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:delete_all("openclash", "proxy-provider", function(s) return true end)
|
||||
m.uci:commit("openclash")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
|
||||
end
|
||||
|
||||
o = b:option(Button,"Delete_Groups", " ")
|
||||
o.inputtitle = translate("Delete Groups")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:delete_all("openclash", "groups", function(s) return true end)
|
||||
m.uci:commit("openclash")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Load_Config, Commit, Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Load_Config", " ")
|
||||
o.inputtitle = translate("Read Config")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:commit("openclash")
|
||||
luci.sys.call("/usr/share/openclash/yml_groups_get.sh 2>/dev/null &")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:commit("openclash")
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Apply Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:commit("openclash")
|
||||
luci.sys.call("/usr/share/openclash/yml_groups_set.sh >/dev/null 2>&1 &")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
|
||||
return m
|
File diff suppressed because it is too large
Load Diff
@ -1,264 +0,0 @@
|
||||
--[[
|
||||
LuCI - Filesystem tools
|
||||
|
||||
Description:
|
||||
A module offering often needed filesystem manipulation functions
|
||||
|
||||
FileId:
|
||||
$Id$
|
||||
|
||||
License:
|
||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
]]--
|
||||
|
||||
local io = require "io"
|
||||
local os = require "os"
|
||||
local ltn12 = require "luci.ltn12"
|
||||
local fs = require "nixio.fs"
|
||||
local nutil = require "nixio.util"
|
||||
|
||||
local type = type
|
||||
local string = string
|
||||
|
||||
--- LuCI filesystem library.
|
||||
module "luci.openclash"
|
||||
|
||||
--- Test for file access permission on given path.
|
||||
-- @class function
|
||||
-- @name access
|
||||
-- @param str String value containing the path
|
||||
-- @return Number containing the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description (if any)
|
||||
-- @return Number containing the os specific errno (if any)
|
||||
access = fs.access
|
||||
|
||||
--- Evaluate given shell glob pattern and return a table containing all matching
|
||||
-- file and directory entries.
|
||||
-- @class function
|
||||
-- @name glob
|
||||
-- @param filename String containing the path of the file to read
|
||||
-- @return Table containing file and directory entries or nil if no matches
|
||||
-- @return String containing the error description (if no matches)
|
||||
-- @return Number containing the os specific errno (if no matches)
|
||||
function glob(...)
|
||||
local iter, code, msg = fs.glob(...)
|
||||
if iter then
|
||||
return nutil.consume(iter)
|
||||
else
|
||||
return nil, code, msg
|
||||
end
|
||||
end
|
||||
|
||||
--- Checks wheather the given path exists and points to a regular file.
|
||||
-- @param filename String containing the path of the file to test
|
||||
-- @return Boolean indicating wheather given path points to regular file
|
||||
function isfile(filename)
|
||||
return fs.stat(filename, "type") == "reg"
|
||||
end
|
||||
|
||||
--- Checks wheather the given path exists and points to a directory.
|
||||
-- @param dirname String containing the path of the directory to test
|
||||
-- @return Boolean indicating wheather given path points to directory
|
||||
function isdirectory(dirname)
|
||||
return fs.stat(dirname, "type") == "dir"
|
||||
end
|
||||
|
||||
--- Read the whole content of the given file into memory.
|
||||
-- @param filename String containing the path of the file to read
|
||||
-- @return String containing the file contents or nil on error
|
||||
-- @return String containing the error message on error
|
||||
readfile = fs.readfile
|
||||
|
||||
--- Write the contents of given string to given file.
|
||||
-- @param filename String containing the path of the file to read
|
||||
-- @param data String containing the data to write
|
||||
-- @return Boolean containing true on success or nil on error
|
||||
-- @return String containing the error message on error
|
||||
writefile = fs.writefile
|
||||
|
||||
--- Copies a file.
|
||||
-- @param source Source file
|
||||
-- @param dest Destination
|
||||
-- @return Boolean containing true on success or nil on error
|
||||
copy = fs.datacopy
|
||||
|
||||
--- Renames a file.
|
||||
-- @param source Source file
|
||||
-- @param dest Destination
|
||||
-- @return Boolean containing true on success or nil on error
|
||||
rename = fs.move
|
||||
|
||||
--- Get the last modification time of given file path in Unix epoch format.
|
||||
-- @param path String containing the path of the file or directory to read
|
||||
-- @return Number containing the epoch time or nil on error
|
||||
-- @return String containing the error description (if any)
|
||||
-- @return Number containing the os specific errno (if any)
|
||||
function mtime(path)
|
||||
return fs.stat(path, "mtime")
|
||||
end
|
||||
|
||||
--- Set the last modification time of given file path in Unix epoch format.
|
||||
-- @param path String containing the path of the file or directory to read
|
||||
-- @param mtime Last modification timestamp
|
||||
-- @param atime Last accessed timestamp
|
||||
-- @return 0 in case of success nil on error
|
||||
-- @return String containing the error description (if any)
|
||||
-- @return Number containing the os specific errno (if any)
|
||||
function utime(path, mtime, atime)
|
||||
return fs.utimes(path, atime, mtime)
|
||||
end
|
||||
|
||||
--- Return the last element - usually the filename - from the given path with
|
||||
-- the directory component stripped.
|
||||
-- @class function
|
||||
-- @name basename
|
||||
-- @param path String containing the path to strip
|
||||
-- @return String containing the base name of given path
|
||||
-- @see dirname
|
||||
basename = fs.basename
|
||||
|
||||
--- Return the directory component of the given path with the last element
|
||||
-- stripped of.
|
||||
-- @class function
|
||||
-- @name dirname
|
||||
-- @param path String containing the path to strip
|
||||
-- @return String containing the directory component of given path
|
||||
-- @see basename
|
||||
dirname = fs.dirname
|
||||
|
||||
--- Return a table containing all entries of the specified directory.
|
||||
-- @class function
|
||||
-- @name dir
|
||||
-- @param path String containing the path of the directory to scan
|
||||
-- @return Table containing file and directory entries or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
function dir(...)
|
||||
local iter, code, msg = fs.dir(...)
|
||||
if iter then
|
||||
local t = nutil.consume(iter)
|
||||
t[#t+1] = "."
|
||||
t[#t+1] = ".."
|
||||
return t
|
||||
else
|
||||
return nil, code, msg
|
||||
end
|
||||
end
|
||||
|
||||
--- Create a new directory, recursively on demand.
|
||||
-- @param path String with the name or path of the directory to create
|
||||
-- @param recursive Create multiple directory levels (optional, default is true)
|
||||
-- @return Number with the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
function mkdir(path, recursive)
|
||||
return recursive and fs.mkdirr(path) or fs.mkdir(path)
|
||||
end
|
||||
|
||||
--- Remove the given empty directory.
|
||||
-- @class function
|
||||
-- @name rmdir
|
||||
-- @param path String containing the path of the directory to remove
|
||||
-- @return Number with the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
rmdir = fs.rmdir
|
||||
|
||||
local stat_tr = {
|
||||
reg = "regular",
|
||||
dir = "directory",
|
||||
lnk = "link",
|
||||
chr = "character device",
|
||||
blk = "block device",
|
||||
fifo = "fifo",
|
||||
sock = "socket"
|
||||
}
|
||||
--- Get information about given file or directory.
|
||||
-- @class function
|
||||
-- @name stat
|
||||
-- @param path String containing the path of the directory to query
|
||||
-- @return Table containing file or directory properties or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
function stat(path, key)
|
||||
local data, code, msg = fs.stat(path)
|
||||
if data then
|
||||
data.mode = data.modestr
|
||||
data.type = stat_tr[data.type] or "?"
|
||||
end
|
||||
return key and data and data[key] or data, code, msg
|
||||
end
|
||||
|
||||
--- Set permissions on given file or directory.
|
||||
-- @class function
|
||||
-- @name chmod
|
||||
-- @param path String containing the path of the directory
|
||||
-- @param perm String containing the permissions to set ([ugoa][+-][rwx])
|
||||
-- @return Number with the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
chmod = fs.chmod
|
||||
|
||||
--- Create a hard- or symlink from given file (or directory) to specified target
|
||||
-- file (or directory) path.
|
||||
-- @class function
|
||||
-- @name link
|
||||
-- @param path1 String containing the source path to link
|
||||
-- @param path2 String containing the destination path for the link
|
||||
-- @param symlink Boolean indicating wheather to create a symlink (optional)
|
||||
-- @return Number with the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
function link(src, dest, sym)
|
||||
return sym and fs.symlink(src, dest) or fs.link(src, dest)
|
||||
end
|
||||
|
||||
--- Remove the given file.
|
||||
-- @class function
|
||||
-- @name unlink
|
||||
-- @param path String containing the path of the file to remove
|
||||
-- @return Number with the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
unlink = fs.unlink
|
||||
|
||||
--- Retrieve target of given symlink.
|
||||
-- @class function
|
||||
-- @name readlink
|
||||
-- @param path String containing the path of the symlink to read
|
||||
-- @return String containing the link target or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
readlink = fs.readlink
|
||||
|
||||
function filename(str)
|
||||
local idx = str:match(".+()%.%w+$")
|
||||
if(idx) then
|
||||
return str:sub(1, idx-1)
|
||||
else
|
||||
return str
|
||||
end
|
||||
end
|
||||
|
||||
function filesize(e)
|
||||
local t=0
|
||||
local a={' KB',' MB',' GB',' TB'}
|
||||
repeat
|
||||
e=e/1024
|
||||
t=t+1
|
||||
until(e<=1024)
|
||||
return string.format("%.1f",e)..a[t]
|
||||
end
|
@ -1,18 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<div>
|
||||
<%
|
||||
local val = self:cfgvalue(section)
|
||||
if val == translate("Enable") or val == translate("Config Normal") or val == translate("Exist") then
|
||||
%>
|
||||
<div style="color: green; font-weight:bold;">
|
||||
<%
|
||||
else
|
||||
%>
|
||||
<div style="color: red; font-weight:bold;">
|
||||
<%
|
||||
end
|
||||
write(pcdata(val))
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
<%+cbi/valuefooter%>
|
@ -1,470 +0,0 @@
|
||||
<style>
|
||||
.CodeMirror {
|
||||
text-align: left !important;
|
||||
font-size: 15px;
|
||||
line-height: 150%;
|
||||
resize: both !important;
|
||||
}
|
||||
.CodeMirror-merge-r-chunk {
|
||||
background: #0095ff2e !important;
|
||||
}
|
||||
.CodeMirror-merge-r-chunk-end {
|
||||
border-bottom: unset !important;
|
||||
}
|
||||
.CodeMirror-merge-r-chunk-start {
|
||||
border-top: unset !important;
|
||||
}
|
||||
.CodeMirror-merge-2pane .CodeMirror-merge-gap {
|
||||
height: 700px !important;
|
||||
}
|
||||
.CodeMirror-merge-r-connect {
|
||||
fill: #0095ff2e !important;
|
||||
stroke: #0095ff2e !important;
|
||||
}
|
||||
.CodeMirror-vscrollbar-oc {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/lib/codemirror.css"/>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/material.css"/>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/idea.css"/>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/fold/foldgutter.css"/>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/lint/lint.css">
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/display/fullscreen.css">
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/dialog/dialog.css">
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/search/matchesonscrollbar.css">
|
||||
<script src="/luci-static/resources/openclash/lib/codemirror.js"></script>
|
||||
<script src="/luci-static/resources/openclash/mode/yaml/yaml.js"></script>
|
||||
<script src="/luci-static/resources/openclash/mode/lua/lua.js"></script>
|
||||
<script src="/luci-static/resources/openclash/mode/shell/shell.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/fold/foldcode.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/fold/foldgutter.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/fold/indent-fold.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/edit/matchbrackets.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/selection/active-line.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/lint/lint.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/lint/yaml-lint.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/lint/js-yaml.min.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/display/fullscreen.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/display/autorefresh.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/dialog/dialog.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/search/searchcursor.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/search/search.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/scroll/annotatescrollbar.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/search/matchesonscrollbar.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/search/jump-to-line.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/merge/diff_match_patch.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/merge/merge.js"></script>
|
||||
<link rel=stylesheet href="/luci-static/resources/openclash/addon/merge/merge.css">
|
||||
|
||||
<%-
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local conf = uci:get("openclash", "config", "config_path")
|
||||
if not conf then conf = "/etc/openclash/config/config.yaml" end
|
||||
local conf_name = fs.basename(conf)
|
||||
if not conf_name then conf_name = "config.yaml" end
|
||||
local sconf = "/etc/openclash/"..conf_name
|
||||
-%>
|
||||
|
||||
<table id="my_editor_div" style="width: 100%; text-align: center; display: none;">
|
||||
<tr>
|
||||
<td style="width: 50%; overflow: hidden;"><%:Modify Your Config file:%> <b style=color:green><%=conf_name%></b> <%:Here, Except The Settings That Were Taken Over%></td>
|
||||
|
||||
<%-
|
||||
if fs.isfile(sconf) then
|
||||
-%>
|
||||
<td style="width: 50%; overflow: hidden;"><%:Config File Edited By OpenClash For Running%></td>
|
||||
<%-
|
||||
else
|
||||
-%>
|
||||
<td style="width: 50%; overflow: hidden;"><%:Default Config File With Correct Template%></td>
|
||||
<%-
|
||||
end
|
||||
-%>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function merge_editor(id, id2, target, target2, readOnly, readOnly2, wid, height)
|
||||
{
|
||||
var value, orig1, orig2, merge_editor, descr, gap, vscrollbar, vscrollbar_oc, panes = 2, highlight = true, connect = null, collapse = false;
|
||||
descr = document.getElementById("my_editor_div");
|
||||
target.parentNode.parentNode.parentNode.insertBefore(descr, target.parentNode.parentNode);
|
||||
descr.style.display="inline-table"
|
||||
value = id.value;
|
||||
if (value == null) {
|
||||
editor(id, readOnly, wid, height);
|
||||
editor(id2, readOnly2, wid, height);
|
||||
}
|
||||
else {
|
||||
target2.parentNode.style.display="none";
|
||||
orig1 = '';
|
||||
orig2 = id2.value;
|
||||
target.style.height= "700px"
|
||||
id.style.display = "none";
|
||||
id2.style.display = "none";
|
||||
merge_editor = CodeMirror.MergeView(target, {
|
||||
mode: "text/yaml",
|
||||
value: value,
|
||||
origLeft: panes == 3 ? orig1 : null,
|
||||
orig: orig2,
|
||||
theme: "material",
|
||||
lineNumbers: true,
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
lint: true,
|
||||
highlightDifferences: highlight,
|
||||
connect: connect,
|
||||
collapseIdentical: collapse,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter", "CodeMirror-lint-markers"],
|
||||
extraKeys: {
|
||||
"F10": function() {
|
||||
merge_editor.setShowDifferences(highlight = !highlight);
|
||||
},
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
gap = document.getElementsByClassName("CodeMirror-merge-gap")[0];
|
||||
vscrollbar = document.getElementsByClassName("CodeMirror-vscrollbar")[0];
|
||||
vscrollbar_oc = document.getElementsByClassName("CodeMirror-vscrollbar-oc")[0];
|
||||
if (cm.getOption("fullScreen")) {
|
||||
console.log(gap.style.display)
|
||||
gap.style.display = "none";
|
||||
vscrollbar.className = "CodeMirror-vscrollbar-oc";
|
||||
}
|
||||
else {
|
||||
gap.style.display = "";
|
||||
vscrollbar_oc.className = "CodeMirror-vscrollbar";
|
||||
};
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
gap = document.getElementsByClassName("CodeMirror-merge-gap")[0];
|
||||
vscrollbar = document.getElementsByClassName("CodeMirror-vscrollbar")[0];
|
||||
vscrollbar_oc = document.getElementsByClassName("CodeMirror-vscrollbar-oc")[0];
|
||||
if (cm.getOption("fullScreen")) {
|
||||
cm.setOption("fullScreen", false);
|
||||
gap.style.display = "";
|
||||
vscrollbar_oc.className = "CodeMirror-vscrollbar";
|
||||
};
|
||||
},
|
||||
"Tab": function(cm) {
|
||||
if (cm.somethingSelected()) {
|
||||
cm.indentSelection('add')
|
||||
} else {
|
||||
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
|
||||
cm.replaceSelection(spaces)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
merge_editor.edit.on("change", function(cm) {
|
||||
id.value = cm.getValue();
|
||||
});
|
||||
|
||||
if (wid && height) {
|
||||
merge_editor.editor().setSize(wid, height);
|
||||
merge_editor.rightOriginal().setSize(wid, height);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
function editor(id, readOnly, wid, height)
|
||||
{
|
||||
var editor = CodeMirror.fromTextArea(id, {
|
||||
mode: "text/yaml",
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
theme: "material",
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
lint: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter", "CodeMirror-lint-markers"],
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
},
|
||||
"Tab": function(cm) {
|
||||
if (cm.somethingSelected()) {
|
||||
cm.indentSelection('add')
|
||||
} else {
|
||||
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
|
||||
cm.replaceSelection(spaces)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (readOnly == "true") {
|
||||
editor.setOption("readOnly","true");
|
||||
};
|
||||
|
||||
if (wid && height) {
|
||||
editor.setSize(wid, height);
|
||||
};
|
||||
};
|
||||
|
||||
function shell_editor(id, readOnly, wid, height)
|
||||
{
|
||||
var editor = CodeMirror.fromTextArea(id, {
|
||||
mode: "shell",
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
theme: "material",
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
},
|
||||
"Tab": function(cm) {
|
||||
if (cm.somethingSelected()) {
|
||||
cm.indentSelection('add')
|
||||
} else {
|
||||
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
|
||||
cm.replaceSelection(spaces)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (wid && height) {
|
||||
editor.setSize(wid, height);
|
||||
};
|
||||
};
|
||||
|
||||
function other_editor(id, readOnly, wid, height)
|
||||
{
|
||||
var editor = CodeMirror.fromTextArea(id, {
|
||||
mode: "lua",
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
theme: "material",
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
},
|
||||
"Tab": function(cm) {
|
||||
if (cm.somethingSelected()) {
|
||||
cm.indentSelection('add')
|
||||
} else {
|
||||
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
|
||||
cm.replaceSelection(spaces)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (wid && height) {
|
||||
editor.setSize(wid, height);
|
||||
};
|
||||
};
|
||||
|
||||
function other_log_area(id, readOnly, wid, height)
|
||||
{
|
||||
var other_log_area = CodeMirror.fromTextArea(id, {
|
||||
mode: "lua",
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
theme: "idea",
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (readOnly == "true") {
|
||||
other_log_area.setOption("readOnly","true");
|
||||
};
|
||||
|
||||
if (wid && height) {
|
||||
other_log_area.setSize(wid, height);
|
||||
};
|
||||
|
||||
other_log_area.markText({line:0,ch:0},{line:9999,ch:9999}, {css: 'font-size:13px'});
|
||||
};
|
||||
|
||||
var custom_cfg_value = document.getElementById("cbid.openclash." + window.location.pathname.split("/")[window.location.pathname.split("/").length - 1] + ".other_parameters");
|
||||
if (custom_cfg_value) {
|
||||
editor(custom_cfg_value, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
var custom_firewall = document.getElementById("cbid.openclash.config.firewall_custom");
|
||||
var custom_ymchange = document.getElementById("cbid.openclash.config.ymchange_custom");
|
||||
if (custom_firewall) {
|
||||
shell_editor(custom_firewall, 'false', "100%", '300px');
|
||||
};
|
||||
|
||||
if (custom_ymchange) {
|
||||
shell_editor(custom_ymchange, 'false', "100%", '300px');
|
||||
};
|
||||
|
||||
var myEditor_use = document.getElementById("cbid.table.1.user");
|
||||
var myEditor_def = document.getElementById("cbid.table.1.default");
|
||||
|
||||
if (myEditor_use && myEditor_def) {
|
||||
var myEditor_div_use = document.getElementById("cbi-table-1-user");
|
||||
var myEditor_div_def = document.getElementById("cbi-table-1-default");
|
||||
|
||||
myEditor_div_def.parentNode.parentNode.style.cssText="text-align: left !important"
|
||||
myEditor_div_def.parentNode.className='cbi-value';
|
||||
myEditor_div_def.parentNode.style.display="revert"
|
||||
myEditor_div_def.parentNode.style.width="100%"
|
||||
|
||||
myEditor_div_use.parentNode.className='cbi-value';
|
||||
myEditor_div_use.parentNode.style.display="revert"
|
||||
myEditor_div_use.parentNode.style.width="100%"
|
||||
merge_editor(myEditor_use, myEditor_def, myEditor_div_use, myEditor_div_def, 'true', 'false', 'auto', '700px');
|
||||
};
|
||||
|
||||
var myEditor_hosts = document.getElementById("cbid.openclash.config.custom_hosts");
|
||||
var myEditor_fall_fil = document.getElementById("cbid.openclash.config.custom_fallback_fil");
|
||||
var myEditor_name_pol = document.getElementById("cbid.openclash.config.custom_domain_dns_core");
|
||||
var myEditor_name_cus_r1 = document.getElementById("cbid.openclash.config.custom_rules_2");
|
||||
var myEditor_name_cus_r2 = document.getElementById("cbid.openclash.config.custom_rules");
|
||||
var myEditor_fake_filter = document.getElementById("cbid.openclash.config.custom_fake_filter");
|
||||
var myEditor_custom_domain_dns = document.getElementById("cbid.openclash.config.custom_domain_dns");
|
||||
var myEditor_edit_file = document.getElementById("cbid.openclash.config.edit_file");
|
||||
var myEditor_sniffing_domain_force = document.getElementById("cbid.openclash.config.sniffing_domain_force");
|
||||
var myEditor_sniffing_domain_filter = document.getElementById("cbid.openclash.config.sniffing_domain_filter");
|
||||
var myEditor_sniffing_port_filter = document.getElementById("cbid.openclash.config.sniffing_port_filter");
|
||||
|
||||
if (myEditor_hosts) {
|
||||
editor(myEditor_hosts, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_edit_file) {
|
||||
editor(myEditor_edit_file, 'false', '100%', '700px');
|
||||
};
|
||||
|
||||
if (myEditor_fall_fil) {
|
||||
editor(myEditor_fall_fil, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_name_pol) {
|
||||
editor(myEditor_name_pol, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_name_cus_r1) {
|
||||
editor(myEditor_name_cus_r1, 'false', '100%', '300px');
|
||||
editor(myEditor_name_cus_r2, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_fake_filter) {
|
||||
other_editor(myEditor_fake_filter, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_custom_domain_dns) {
|
||||
other_editor(myEditor_custom_domain_dns, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_sniffing_domain_force) {
|
||||
other_editor(myEditor_sniffing_domain_force, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_sniffing_domain_filter) {
|
||||
other_editor(myEditor_sniffing_domain_filter, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
if (myEditor_sniffing_port_filter) {
|
||||
other_editor(myEditor_sniffing_port_filter, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
|
||||
var core_log = document.getElementById("core_log");
|
||||
var oc_log = document.getElementById("cbid.openclash.config.clog");
|
||||
if (core_log && oc_log) {
|
||||
var core_editor = CodeMirror.fromTextArea(core_log, {
|
||||
mode: "lua",
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
theme: "idea",
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var oc_editor = CodeMirror.fromTextArea(oc_log, {
|
||||
mode: "lua",
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
theme: "idea",
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
core_editor.setSize("100%", "540px");
|
||||
core_editor.setOption("readOnly","true");
|
||||
oc_editor.setSize("100%", "540px");
|
||||
oc_editor.setOption("readOnly","true");
|
||||
};
|
||||
|
||||
var proxy_mg = document.getElementById('cbi-table-1-proxy_mg');
|
||||
var rule_mg = document.getElementById('cbi-table-1-rule_mg');
|
||||
var game_mg = document.getElementById('cbi-table-1-game_mg');
|
||||
var Commit = document.getElementById('cbi-table-1-Commit');
|
||||
var Apply = document.getElementById('cbi-table-1-Apply');
|
||||
var Create = document.getElementById('cbi-table-1-Create');
|
||||
|
||||
if (proxy_mg) {
|
||||
proxy_mg.style.textAlign="center";
|
||||
rule_mg.style.textAlign="center";
|
||||
game_mg.style.textAlign="center";
|
||||
Commit.style.textAlign="center";
|
||||
Apply.style.textAlign="center";
|
||||
Create.style.textAlign="center";
|
||||
};
|
||||
//]]>
|
||||
</script>
|
@ -1,218 +0,0 @@
|
||||
<%#
|
||||
Copyright 2010 Jo-Philipp Wich <jow@openwrt.org>
|
||||
Licensed to the public under the Apache License 2.0.
|
||||
-%>
|
||||
|
||||
<%
|
||||
local diag_host = "www.instagram.com"
|
||||
local dns_host = "www.instagram.com"
|
||||
%>
|
||||
|
||||
<style>
|
||||
#diag-rc-output > pre {
|
||||
background-color: #f5f5f5;
|
||||
display: block;
|
||||
padding: 8.5px;
|
||||
margin: 0 0 18px;
|
||||
line-height: 1.5rem;
|
||||
-moz-border-radius: 3px;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
font-size: 1.4rem;
|
||||
color: #404040;
|
||||
}
|
||||
|
||||
#dns-rc-output > pre {
|
||||
background-color: #f5f5f5;
|
||||
display: block;
|
||||
padding: 8.5px;
|
||||
margin: 0 0 18px;
|
||||
line-height: 1.5rem;
|
||||
-moz-border-radius: 3px;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
font-size: 1.4rem;
|
||||
color: #404040;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
function show_diag_info(addr)
|
||||
{
|
||||
var addr = addr;
|
||||
var legend = document.getElementById('diag-rc-legend');
|
||||
var output = document.getElementById('diag-rc-output');
|
||||
|
||||
if (legend && output)
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "diag_connection")%>', {addr: addr}, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "")
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = String.format('<pre>%h</pre>', x.responseText);
|
||||
}
|
||||
else if (x.status == 500)
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<span class="error"><%:Bad address specified!%></span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<span class="error"><%:Could not find any connection logs!%></br></br><%:1. It may be that the plugin is not running%></br></br><%:2. It may be that the cache causes the browser to directly use the IP for access%></br></br><%:3. It may be that DNS hijacking did not take effect, so clash unable to reverse the domain name%></br></br><%:4. It may be that the filled address cannot be resolved and connected%></span>';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function update_status(field)
|
||||
{
|
||||
var addr = field.value;
|
||||
var legend = document.getElementById('diag-rc-legend');
|
||||
var output = document.getElementById('diag-rc-output');
|
||||
|
||||
if (legend && output)
|
||||
{
|
||||
output.innerHTML =
|
||||
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
|
||||
'<%:Waiting for command to complete...%>';
|
||||
|
||||
legend.parentNode.style.display = 'block';
|
||||
legend.style.display = 'inline';
|
||||
}
|
||||
|
||||
let HTTP = {
|
||||
checker: (domain) => {
|
||||
let img = new Image;
|
||||
let timeout = setTimeout(() => {
|
||||
img.onerror = img.onload = null;
|
||||
show_diag_info(addr);
|
||||
}, 10000);
|
||||
|
||||
img.onerror = () => {
|
||||
clearTimeout(timeout);
|
||||
show_diag_info(addr);
|
||||
}
|
||||
|
||||
img.onload = () => {
|
||||
clearTimeout(timeout);
|
||||
show_diag_info(addr);
|
||||
}
|
||||
|
||||
img.src = `https://${domain}/favicon.ico?${+(new Date)}`
|
||||
},
|
||||
runcheck: () => {
|
||||
HTTP.checker(addr);
|
||||
}
|
||||
};
|
||||
HTTP.runcheck();
|
||||
}
|
||||
|
||||
function diag_dns(field)
|
||||
{
|
||||
var addr = field.value;
|
||||
var legend = document.getElementById('dns-rc-legend');
|
||||
var output = document.getElementById('dns-rc-output');
|
||||
|
||||
if (legend && output)
|
||||
{
|
||||
output.innerHTML =
|
||||
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
|
||||
'<%:Waiting for command to complete...%>';
|
||||
|
||||
legend.parentNode.style.display = 'block';
|
||||
legend.style.display = 'inline';
|
||||
}
|
||||
|
||||
if (legend && output)
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "diag_dns")%>', {addr: addr}, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "")
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = String.format('<pre>%h</pre>', x.responseText);
|
||||
}
|
||||
else if (x.status == 500)
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<span class="error"><%:Bad address specified!%></span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<span class="error"><%:No Response Found!%></span>';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function gen_debug_logs()
|
||||
{
|
||||
var legend = document.getElementById('debug-rc-legend');
|
||||
var output = document.getElementById('debug-rc-output');
|
||||
|
||||
if (legend && output)
|
||||
{
|
||||
output.innerHTML =
|
||||
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
|
||||
'<%:Waiting for command to complete...%>';
|
||||
|
||||
legend.parentNode.style.display = 'block';
|
||||
legend.style.display = 'inline';
|
||||
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "gen_debug_logs")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "")
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<textarea class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="30" cols="60" readonly="readonly" >'+x.responseText+'</textarea>';
|
||||
}
|
||||
else
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<span class="error"><%:Some error occurred!%></span>';
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
//]]></script>
|
||||
|
||||
<form>
|
||||
<fieldset>
|
||||
<div style="width:33%; float: left; text-align: center;">
|
||||
<%:Connection Test (Current Browser)%>
|
||||
<input type="text" value="<%=diag_host%>" name="diag" />
|
||||
<input type="button" value="<%:Click to Test%>" class="btn cbi-button cbi-button-apply" onclick="update_status(this.form.diag)" />
|
||||
</div>
|
||||
<div style="width:33%; float: left; text-align: center;">
|
||||
<%:DNS Test (Clash Response)%>
|
||||
<input type="text" value="<%=dns_host%>" name="dns_host" />
|
||||
<input type="button" value="<%:Click to Test%>" class="btn cbi-button cbi-button-apply" onclick="diag_dns(this.form.dns_host)" />
|
||||
</div>
|
||||
<div style="width:33%; float: left; text-align: center;">
|
||||
<%:Generate Logs%>
|
||||
<input type="button" value="<%:Click to Generate%>" class="btn cbi-button cbi-button-apply" onclick="gen_debug_logs(this)" />
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset style="display:none">
|
||||
<legend id="diag-rc-legend"><%:Collecting data...%></legend>
|
||||
<br />
|
||||
<span id="diag-rc-output"></span>
|
||||
</fieldset>
|
||||
|
||||
<fieldset style="display:none">
|
||||
<legend id="dns-rc-legend"><%:Collecting data...%></legend>
|
||||
<br />
|
||||
<span id="dns-rc-output"></span>
|
||||
</fieldset>
|
||||
|
||||
<fieldset style="display:none">
|
||||
<legend id="debug-rc-legend"><%:Collecting data...%></legend>
|
||||
<br />
|
||||
<span id="debug-rc-output"></span>
|
||||
</fieldset>
|
||||
</form>
|
File diff suppressed because one or more lines are too long
@ -1,111 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function dler_login(btn,option)
|
||||
{
|
||||
btn.disabled = true;
|
||||
if (option == "dler_login") {
|
||||
var s = document.getElementById(option+'-status');
|
||||
var e = document.getElementsByName('cbid.openclash.config.dler_email');
|
||||
var p = document.getElementsByName('cbid.openclash.config.dler_passwd');
|
||||
var c = document.getElementsByName('cbid.openclash.config.dler_checkin');
|
||||
if (!e[0].value || !p[0].value) {
|
||||
btn.disabled = false;
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Error Login Info%>"+"</strong></font>";
|
||||
return false;
|
||||
};
|
||||
if (c[0] && c[0].checked) {
|
||||
c = "1";
|
||||
var i = document.getElementsByName('cbid.openclash.config.dler_checkin_interval');
|
||||
var m = document.getElementsByName('cbid.openclash.config.dler_checkin_multiple');
|
||||
if (!i[0].value || !(/(^[1-9]\d*$)/.test(i[0].value))) { i = "1"} else {i = i[0].value};
|
||||
if (!m[0].value || !(/(^[1-9]\d*$)/.test(m[0].value)))
|
||||
{
|
||||
btn.disabled = false;
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 50%>"+"</strong></font>";
|
||||
return false;
|
||||
}
|
||||
else if (m[0].value < 1)
|
||||
{
|
||||
btn.disabled = false;
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 50%>"+"</strong></font>";
|
||||
return false;
|
||||
}
|
||||
else if (m[0].value > 50)
|
||||
{
|
||||
btn.disabled = false;
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 50%>"+"</strong></font>";
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
m = m[0].value;
|
||||
};
|
||||
}
|
||||
else {
|
||||
c = "0";
|
||||
var i = "1";
|
||||
var m = "1";
|
||||
};
|
||||
btn.value = '<%:Login...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_login_info_save")%>', {email: e[0].value, passwd : p[0].value, checkin: c, interval: i, multiple: m}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_login")%>', null, function(x, status) {
|
||||
if (s)
|
||||
{
|
||||
if (x && x.status == 200 && status.dler_login == 200) {
|
||||
s.innerHTML ="<font color='green'><strong>"+"<%:Dler Cloud Login Successful%>"+"</strong></font>";
|
||||
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
|
||||
}
|
||||
else {
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Dler Cloud Login Faild%>"+"</strong></font>";
|
||||
if (status.dler_login) {
|
||||
alert("<%:Dler Cloud Login Faild%>: "+status.dler_login)
|
||||
}
|
||||
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
|
||||
}
|
||||
}
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Login Account%>';
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (option == "dler_logout") {
|
||||
var s = document.getElementById('dler_login-status');
|
||||
btn.value = '<%:Logout...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_logout")%>', null, function(x, status) {
|
||||
if (s)
|
||||
{
|
||||
if (x && x.status == 200 && status.dler_logout == 200) {
|
||||
s.innerHTML ="<font color='green'><strong>"+"<%:Dler Cloud Logout Successful%>"+"</strong></font>";
|
||||
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
|
||||
}
|
||||
else {
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Dler Cloud Logout Faild%>"+"</strong></font>";
|
||||
if (status.dler_logout) {
|
||||
alert("<%:Dler Cloud Logout Faild%>: "+status.dler_logout)
|
||||
}
|
||||
}
|
||||
}
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Logout Account%>';
|
||||
}
|
||||
);
|
||||
};
|
||||
return false;
|
||||
}
|
||||
|
||||
function web_dler(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
url='https://bit.ly/32mrABp';
|
||||
window.open(url);
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
//]]></script>
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Login Account%>" onclick="return dler_login(this,'dler_login')" />
|
||||
<input type="button" class="btn cbi-button cbi-button-remove" value="<%:Logout Account%>" onclick="return dler_login(this,'dler_logout')" />
|
||||
<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Official Website%>" onclick="return web_dler(this)" />
|
||||
<span id="<%=self.option%>-status"><%=self.value%></span>
|
||||
<%+cbi/valuefooter%>
|
File diff suppressed because one or more lines are too long
@ -1,41 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function act_download_rule(btn,filename)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Downloading Rule...%> ';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","download_rule")%>',
|
||||
{
|
||||
filename: filename
|
||||
},
|
||||
function(x,status)
|
||||
{
|
||||
if ( x && x.status == 200 ) {
|
||||
if(status.rule_download_status=="0")
|
||||
{
|
||||
btn.value = '<%:Download Failed%>';
|
||||
}
|
||||
else if (status.rule_download_status=="1")
|
||||
{
|
||||
btn.value = '<%:Download Successful%>';
|
||||
}
|
||||
else if (status.rule_download_status=="2")
|
||||
{
|
||||
btn.value = '<%:Rule No Change%>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Download Timeout%>';
|
||||
}
|
||||
}
|
||||
);
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
//]]></script>
|
||||
|
||||
|
||||
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Click to Update%>" onclick="return act_download_rule(this,'<%=self:cfgvalue(section)%>')" />
|
||||
|
||||
<%+cbi/valuefooter%>
|
@ -1,13 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<div style="text-align: center; margin:2% auto; display: block; width: 100%; text-overflow: ellipsis;">
|
||||
<div>
|
||||
<%:Note: Please Upload File According To File Type, File Will Be Saved To The Prompt Path%>
|
||||
</div>
|
||||
<div style="color: green; margin-top: 1%;">
|
||||
<%
|
||||
local val = self:cfgvalue(section) or self.default or ""
|
||||
write(pcdata(val))
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
<%+cbi/valuefooter%>
|
@ -1,37 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
function act_flush_fakeip_cache(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Flushing...%> ';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","flush_fakeip_cache")%>',
|
||||
null,
|
||||
function(x,status)
|
||||
{
|
||||
if ( x && x.status == 200 ) {
|
||||
if(status.flush_status == "0" || status.flush_status != "")
|
||||
{
|
||||
btn.value = '<%:Flush Failed%>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
btn.value = '<%:Flush Successful%>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Flush Timeout%>';
|
||||
}
|
||||
}
|
||||
);
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
};
|
||||
|
||||
//]]></script>
|
||||
|
||||
|
||||
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Flush%>" onclick="return act_flush_fakeip_cache(this)" />
|
||||
<%+cbi/valuefooter%>
|
@ -1,19 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function import_file_name(btn, option, file_path) {
|
||||
var file_name = prompt("<%:Paste the name of the new file (including the extension) here:%>", "");
|
||||
if (file_name == null || file_name == "") {
|
||||
return false;
|
||||
}
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "create_file")%>', {filename: file_name, filepath: file_path}, function(x, status) {
|
||||
if (x && x.status == 200)
|
||||
{
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Create File%>" onclick="return import_file_name(this, '<%=self.option%>', '<%=self.value%>')" />
|
||||
<%+cbi/valuefooter%>
|
@ -1,23 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function import_new_file_name(btn, file_path, file_name) {
|
||||
var new_file_name = prompt("<%:Paste the new file name (including the extension) here:%>", "");
|
||||
if (new_file_name == null || new_file_name == "") {
|
||||
return false;
|
||||
}
|
||||
if (file_path == "/etc/openclash/config/" && new_file_name.split('.').pop() != "yaml" && new_file_name.split('.').pop() != "yml") {
|
||||
alert('<%:Illegal extension!%>')
|
||||
return false;
|
||||
}
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "rename_file")%>', {new_file_name: new_file_name, file_path: file_path, file_name: file_name}, function(x, status) {
|
||||
if (x && x.status == 200)
|
||||
{
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Rename%>" onclick="return import_new_file_name(this, '<%=self.option%>', '<%=self.value%>')" />
|
||||
<%+cbi/valuefooter%>
|
@ -1,321 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<style type="text/css">
|
||||
*{margin: 0;padding: 0;}
|
||||
|
||||
ul{
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#tab{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #ddd;
|
||||
box-shadow: 0 0 2px #ddd;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#tab-header{
|
||||
min-height: 35px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
#tab-header ul{
|
||||
left: -1px;
|
||||
width: 100%;
|
||||
padding: unset !important;
|
||||
margin: unset !important;
|
||||
}
|
||||
#tab-header ul li{
|
||||
float: left;
|
||||
width: 160px;
|
||||
line-height: 35px;
|
||||
padding: 0 1px;
|
||||
border-right: 1px solid #dddddd;
|
||||
cursor: pointer;
|
||||
}
|
||||
#tab-header ul li a{
|
||||
float: unset !important;
|
||||
padding: unset !important;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
#tab-header ul li.cbi-tab > a{
|
||||
font-weight: bolder;
|
||||
color: unset;
|
||||
}
|
||||
#tab-header ul li a:hover{
|
||||
color: orangered;
|
||||
}
|
||||
#tab-content .dom{
|
||||
display: none;
|
||||
}
|
||||
#tab-content .dom ul li{
|
||||
float: left;
|
||||
margin: 15px 10px;
|
||||
width: 225px;
|
||||
}
|
||||
|
||||
.radio-button{
|
||||
width: fit-content;
|
||||
text-align: center;
|
||||
overflow: auto;
|
||||
margin: 10px auto;
|
||||
background-color: #d1d1d1;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.radio-button input[type="radio"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.radio-button label {
|
||||
display: inline-block;
|
||||
padding: 4px 11px;
|
||||
font-size: 18px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.radio-button input[type="radio"]:checked+label {
|
||||
background-color: #1080c1;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div id="tab" class="cbi-section">
|
||||
<div id="tab-header" class="cbi-tabmenu">
|
||||
<ul class="cbi-tabmenu">
|
||||
<li name="tab-header" class="cbi-tab"><a><%:OpenClash Log%></a></li>
|
||||
<li name="tab-header" class="cbi-tab-disabled"><a><%:Core Log%></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="tab-content">
|
||||
<div class="dom" style="display: block;">
|
||||
<textarea id="cbid.openclash.config.clog" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
|
||||
</div>
|
||||
<div class="dom">
|
||||
<textarea id="core_log" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
|
||||
<div class="radio-button">
|
||||
<input type="radio" id="info" name="radios" value="info" checked onclick="return switch_log_level(this.value)"/>
|
||||
<label for="info">Info</label>
|
||||
<input type="radio" id="warning" name="radios" value="warning" onclick="return switch_log_level(this.value)"/>
|
||||
<label for="warning">Warning</label>
|
||||
<input type="radio" id="error" name="radios" value="error" onclick="return switch_log_level(this.value)"/>
|
||||
<label for="error">Error</label>
|
||||
<input type="radio" id="debug" name="radios" value="debug" onclick="return switch_log_level(this.value)"/>
|
||||
<label for="debug">Debug</label>
|
||||
<input type="radio" id="silent" name="radios" value="silent" onclick="return switch_log_level(this.value)"/>
|
||||
<label for="silent">Silent</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset style="text-align: center; width: 100%" class="cbi-section">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="text-align: center; width: 25%">
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" id="stop_refresh_button" value="<%:Stop Refresh Log%>" onclick=" return stop_refresh() "/>
|
||||
</td>
|
||||
<td style="text-align: center; width: 25%">
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" id="start_refresh_button" value="<%:Start Refresh Log%>" onclick=" return start_refresh() "/>
|
||||
</td>
|
||||
<td style="text-align: center; width: 25%">
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" id="del_log_button" value="<%:Clean Log%>" style=" display:inline;" onclick=" return del_log() " />
|
||||
</td>
|
||||
<td style="text-align: center; width: 25%">
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" id="down_log_button" value="<%:Download Log%>" style=" display:inline;" onclick=" return download_log() " />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var r;
|
||||
var s;
|
||||
var log_len = 0;
|
||||
var lv = document.getElementById('cbid.openclash.config.clog');
|
||||
var cl = document.getElementById('core_log');
|
||||
|
||||
function get_log_level() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "log_level")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && status.log_level != "") {
|
||||
var radio = document.getElementsByName("radios");
|
||||
for (i=0; i<radio.length; i++) {
|
||||
if (radio[i].value == status.log_level && ! radio[i].checked) {
|
||||
radio[i].checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
s=setTimeout("get_log_level()",5000);
|
||||
};
|
||||
|
||||
function switch_log_level(value)
|
||||
{
|
||||
clearTimeout(s);
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_log")%>', {log_level: value}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
alert(' <%:Log Level%>: ' + value + ' <%:switching succeeded!%>');
|
||||
get_log_level();
|
||||
}
|
||||
else {
|
||||
alert(' <%:Log Level%>: ' + value + ' <%:switching failed!%>');
|
||||
get_log_level();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function stop_refresh() {
|
||||
clearTimeout(r);
|
||||
return
|
||||
};
|
||||
|
||||
function start_refresh() {
|
||||
clearTimeout(r);
|
||||
r=setTimeout("poll_log()",1000*2);
|
||||
return
|
||||
};
|
||||
|
||||
function createAndDownloadFile(fileName, content) {
|
||||
var aTag = document.createElement('a');
|
||||
var blob = new Blob([content]);
|
||||
aTag.download = fileName;
|
||||
aTag.href = URL.createObjectURL(blob);
|
||||
aTag.click();
|
||||
URL.revokeObjectURL(blob);
|
||||
};
|
||||
|
||||
function download_log(){
|
||||
var dt = new Date();
|
||||
var timestamp = dt.getFullYear()+"-"+(dt.getMonth()+1)+"-"+dt.getDate()+"-"+dt.getHours()+"-"+dt.getMinutes()+"-"+dt.getSeconds();
|
||||
createAndDownloadFile("OpenClash-"+timestamp+".log","<%:OpenClash Log%>:\n"+lv.innerHTML+"\n<%:Core Log%>:\n"+cl.innerHTML)
|
||||
return
|
||||
};
|
||||
|
||||
function del_log() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_log")%>',null,function(x, data){
|
||||
lv.innerHTML="";
|
||||
cl.innerHTML="";
|
||||
log_len = 0;
|
||||
oc_editor.setValue(lv.value);
|
||||
core_editor.setValue(cl.value);
|
||||
core_editor.refresh();
|
||||
oc_editor.refresh();
|
||||
});
|
||||
return
|
||||
};
|
||||
|
||||
function p(s) {
|
||||
return s < 10 ? '0' + s: s;
|
||||
};
|
||||
|
||||
function line_tolocal(str){
|
||||
var strt=new Array();
|
||||
var cstrt=new Array();
|
||||
var cn = 0;
|
||||
var sn = 0;
|
||||
str.trim().split('\n').forEach(function(v, i) {
|
||||
var regex = /"([^"]*)"/g;
|
||||
var res = regex.exec(v);
|
||||
if (res) {
|
||||
var dt = new Date(res[1]);
|
||||
}
|
||||
else {
|
||||
var dtt = new Date(v.substring(0,19));
|
||||
}
|
||||
if (dt && dt != "Invalid Date"){
|
||||
if (v.indexOf("level=") != -1) {
|
||||
var log_info = v.substring(res[1].length + 7);
|
||||
}
|
||||
else {
|
||||
var log_info = v.substring(res[1].length + 2);
|
||||
}
|
||||
cstrt[cn]=dt.getFullYear()+"-"+p(dt.getMonth()+1)+"-"+p(dt.getDate())+" "+p(dt.getHours())+":"+p(dt.getMinutes())+":"+p(dt.getSeconds())+log_info;
|
||||
cn = cn + 1;
|
||||
}
|
||||
else if (dtt && dtt != "Invalid Date" && v.substring(28,33).indexOf(" ERR ") == -1) {
|
||||
strt[sn]=v;
|
||||
sn = sn + 1;
|
||||
}
|
||||
else{
|
||||
cstrt[cn]=v;
|
||||
cn = cn + 1;
|
||||
}
|
||||
})
|
||||
return [strt,cstrt]
|
||||
};
|
||||
|
||||
function poll_log(){
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "refresh_log")%>', {log_len: log_len},
|
||||
function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if (status && status.log != "" && lv && cl) {
|
||||
var log = line_tolocal(status.log);
|
||||
var lines = log[0];
|
||||
var clines = log[1];
|
||||
if (lines != "" || clines != "") {
|
||||
if (lines != "") {
|
||||
lv.innerHTML = lines.join('\n')+ (log_len != 0 ? '\n' : '') + lv.innerHTML;
|
||||
oc_editor.setValue(lv.value);
|
||||
oc_editor.refresh();
|
||||
}
|
||||
if (clines != "") {
|
||||
if (lines[0] != "..." && lines[lines.length-1] != "...") {
|
||||
cl.innerHTML = clines.join('\n') + (log_len != 0 ? '\n' : '') + cl.innerHTML;
|
||||
}
|
||||
else {
|
||||
cl.innerHTML = clines.join('\n') + (log_len != 0 ? '\n' : cl.innerHTML + '\n...');
|
||||
}
|
||||
core_editor.setValue(cl.value);
|
||||
core_editor.refresh();
|
||||
}
|
||||
log_len = status.len;
|
||||
//lv.innerHTML = x.responseText.split('\n').reverse().join('\n')+lv.innerHTML;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
r=setTimeout("poll_log()",1000*2);
|
||||
};
|
||||
|
||||
window.onload = function(){
|
||||
var titles = document.getElementsByName('tab-header');
|
||||
var divs = document.getElementsByClassName('dom');
|
||||
if(titles.length != divs.length) return;
|
||||
for(var i=0; i<titles.length; i++){
|
||||
var li = titles[i];
|
||||
li.id = i;
|
||||
li.onclick = function(){
|
||||
for(var j=0; j<titles.length; j++){
|
||||
titles[j].className = 'cbi-tab-disabled';
|
||||
divs[j].style.display = 'none';
|
||||
}
|
||||
this.className = 'cbi-tab';
|
||||
divs[this.id].style.display = 'block';
|
||||
}
|
||||
li.onTouchStart = function(){
|
||||
for(var j=0; j<titles.length; j++){
|
||||
titles[j].className = 'cbi-tab-disabled';
|
||||
divs[j].style.display = 'none';
|
||||
}
|
||||
this.className = 'cbi-tab';
|
||||
divs[this.id].style.display = 'block';
|
||||
}
|
||||
}
|
||||
get_log_level();
|
||||
poll_log();
|
||||
};
|
||||
//]]>
|
||||
</script>
|
||||
<%+cbi/valuefooter%>
|
@ -1,509 +0,0 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-dns-prefetch-control" content="on">
|
||||
<link rel="dns-prefetch" href="//cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="//whois.pconline.com.cn">
|
||||
<link rel="dns-prefetch" href="//pubstatic.b0.upaiyun.com">
|
||||
<link rel="dns-prefetch" href="//api-ipv4.ip.sb">
|
||||
<link rel="dns-prefetch" href="//api.ipify.org">
|
||||
<link rel="dns-prefetch" href="//api.ttt.sh">
|
||||
<link rel="dns-prefetch" href="//qqwry.api.skk.moe">
|
||||
<link rel="dns-prefetch" href="//d.skk.moe">
|
||||
<link rel="preconnect" href="https://pubstatic.b0.upaiyun.com">
|
||||
<link rel="preconnect" href="https://whois.pconline.com.cn">
|
||||
<link rel="preconnect" href="https://api-ipv4.ip.sb">
|
||||
<link rel="preconnect" href="https://api.ipify.org">
|
||||
<link rel="preconnect" href="https://api.ttt.sh">
|
||||
<link rel="preconnect" href="https://qqwry.api.skk.moe">
|
||||
<link rel="preconnect" href="https://d.skk.moe">
|
||||
<meta name="referrer" content="no-referrer">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,minimal-ui">
|
||||
<title>IP 地址查询</title>
|
||||
<style>
|
||||
.title-ip {
|
||||
margin: 10px -2% 15px 8%;
|
||||
padding: 0px !important;
|
||||
text-align: left;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.title-http {
|
||||
margin: 10px 0 15px 5%;;
|
||||
padding: 0px !important;
|
||||
text-align: left;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ip-title {
|
||||
font-weight: bold;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
width: 25%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
vertical-align:bottom;
|
||||
}
|
||||
|
||||
.ip-state_title {
|
||||
font-weight: bold;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
width: 42%;
|
||||
vertical-align:bottom;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.ip-result {
|
||||
font-size:15px;
|
||||
margin:0px 0px 0px 5%;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
width: 32%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
vertical-align:bottom;
|
||||
}
|
||||
|
||||
.ip-geo {
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
width: 35%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: right;
|
||||
vertical-align:bottom;
|
||||
}
|
||||
|
||||
.ip-checking {
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 29%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.sk-text-success {
|
||||
color: #32b643;
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 30%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.sk-load-success {
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 18%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.sk-text-error {
|
||||
color: #e85600;
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 30%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr><td>
|
||||
<div style="display: flex; min-width: 820px;">
|
||||
<div style="width: 48%">
|
||||
<p style="margin: 20px 0 20px 8%; padding: 0px !important; text-align: left; font-size: 25px; font-weight: bold;"><%:IP Address%>
|
||||
<span style="float: right;"><img src="/luci-static/resources/openclash/img/eye-light.svg" height="20px" title="<%:Hide IP%>" alt="<%:Hide IP%>" id="eye-icon" onclick="return privacy_my_ip(this)" /></span>
|
||||
</p>
|
||||
<p style="margin: 10px -2% 0 8%; text-align: left; padding-left: 0px !important; padding-right: 0px !important;">
|
||||
<span class="ip-title">UpaiYun:</span><span class="ip-result" id="ip-upaiyun"></span> <span class="ip-geo" id="ip-upaiyun-geo"></span>
|
||||
</p>
|
||||
<p style="margin: 10px -2% 0 8%; text-align: left; padding-left: 0px !important; padding-right: 0px !important;">
|
||||
<span class="ip-title">PConline:</span><span class="ip-result" id="ip-pcol"></span> <span class="ip-geo" id="ip-pcol-geo"></span>
|
||||
</p>
|
||||
<p style="margin: 10px -2% 0 8%; text-align: left; padding-left: 0px !important; padding-right: 0px !important;">
|
||||
<span class="ip-title">IP.SB:</span><span class="ip-result" id="ip-ipsb"></span> <span class="ip-geo" id="ip-ipsb-geo"></span>
|
||||
</p>
|
||||
<p style="margin: 10px -2% 0 8%; text-align: left; padding-left: 0px !important; padding-right: 0px !important;">
|
||||
<span class="ip-title">IPIFY:</span><span class="ip-result" id="ip-ipify"></span> <span class="ip-geo" id="ip-ipify-geo"></span>
|
||||
</p>
|
||||
</div>
|
||||
<div style="width: 52%">
|
||||
<p style="margin: 20px 0 20px 8%; padding: 0px !important;text-align: left; font-size: 25px; font-weight: bold;"><%:Website Access Check%>
|
||||
<span style="float: right; margin: 0 10% 0 0;"><img src="/luci-static/resources/openclash/img/arrow-clockwise-light.svg" height="20px" title="<%:Refresh%>" alt="<%:Refresh%>" onclick="return refresh_myip(this)" /></span>
|
||||
</p>
|
||||
<p style="margin: 10px 0 0 8%; text-align: left; padding-left: 0px !important; padding-right: 0px !important;">
|
||||
<span class="ip-state_title"><%:Baidu Search%>:</span><span id="http-baidu"></span><span id="ldtime-baidu"></span>
|
||||
</p>
|
||||
<p style="margin: 10px 0 0 8%; text-align: left; padding-left: 0px !important; padding-right: 0px !important;">
|
||||
<span class="ip-state_title"><%:NetEase Music%>:</span><span id="http-163"></span><span id="ldtime-163"></span>
|
||||
</p>
|
||||
<p style="margin: 10px 0 0 8%; text-align: left; padding-left: 0px !important; padding-right: 0px !important;">
|
||||
<span class="ip-state_title">GitHub:</span><span id="http-github"></span><span id="ldtime-github"></span>
|
||||
</p>
|
||||
<p style="margin: 10px 0 0 8%; text-align: left; padding-left: 0px !important; padding-right: 0px !important;">
|
||||
<span class="ip-state_title">YouTube:</span><span id="http-youtube"></span><span id="ldtime-youtube"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p style="float: right; margin: 0.5% 2.5% 0 0; font-size:15px; line-height: 20px; padding-left: 0px !important; padding-right: 0px !important;">Powered by <a style="text-decoration: none; color: #666" onclick="return ip_skk()" href="javascript:void(0);">ip.skk.moe</a></p>
|
||||
</div>
|
||||
</td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</body>
|
||||
<script>
|
||||
function addTitleOnOverflow() {
|
||||
document.querySelectorAll('.ip-result, .ip-geo').forEach(function (span) {
|
||||
if (span.scrollWidth > span.clientWidth && localStorage.getItem('privacy_my_ip') !== 'true') {
|
||||
span.setAttribute('title', span.textContent);
|
||||
} else {
|
||||
span.removeAttribute('title');
|
||||
}
|
||||
});
|
||||
}
|
||||
function ip_skk()
|
||||
{
|
||||
url2='https://ip.skk.moe';
|
||||
window.open(url2);
|
||||
}
|
||||
const $$ = document;
|
||||
var ip_pcol_ip;
|
||||
var ip_ipsb_ip;
|
||||
var ip_upaiyun_ip;
|
||||
var ip_ipify_ip;
|
||||
var refresh_http;
|
||||
var refresh_ip;
|
||||
$$.getElementById('ip-pcol').innerHTML = '<%:Querying...%>';
|
||||
$$.getElementById('ip-ipify').innerHTML = '<%:Querying...%>';
|
||||
$$.getElementById('ip-upaiyun').innerHTML = '<%:Querying...%>';
|
||||
$$.getElementById('ip-ipsb').innerHTML = '<%:Querying...%>';
|
||||
let random = parseInt(Math.random() * 100000000);
|
||||
let IP = {
|
||||
get: (url, type) =>
|
||||
fetch(url, { method: 'GET' }).then((resp) => {
|
||||
if (type === 'text')
|
||||
return Promise.all([resp.ok, resp.status, resp.text(), resp.headers]);
|
||||
else {
|
||||
return Promise.all([resp.ok, resp.status, resp.json(), resp.headers]);
|
||||
}
|
||||
}).then(([ok, status, data, headers]) => {
|
||||
if (ok) {
|
||||
let json = {
|
||||
ok,
|
||||
status,
|
||||
data,
|
||||
headers
|
||||
}
|
||||
return json;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(json.error));
|
||||
}
|
||||
}).catch(error => {
|
||||
throw error;
|
||||
}),
|
||||
parseIPIpip: (ip, elID) => {
|
||||
const v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}';
|
||||
const v4Exact = new RegExp(`^${v4}$`);
|
||||
const anonymizedIp = (() => {
|
||||
if (v4Exact.test(ip)) {
|
||||
const [a, b, c] = ip.split('.');
|
||||
return `${a}.${b}.${c}.0`;
|
||||
}
|
||||
return ip;
|
||||
})();
|
||||
|
||||
fetch(`https://api.ip.sb/geoip/${anonymizedIp}`, {
|
||||
referrerPolicy: 'no-referrer-when-downgrade',
|
||||
}).then(r => r.json())
|
||||
.then(resp => {
|
||||
if ( resp.country && resp.country != '' && resp.isp && resp.isp != '' ) {
|
||||
$$.getElementById(elID).innerHTML = resp.country + ' ' + resp.isp;
|
||||
}
|
||||
else {
|
||||
fetch(`https://qqwry.api.skk.moe/${anonymizedIp}`, {
|
||||
referrerPolicy: 'no-referrer-when-downgrade',
|
||||
}).then(r => r.json())
|
||||
.then(resp => {
|
||||
if ( resp.geo.indexOf('skk.moe') == -1 ) {
|
||||
$$.getElementById(elID).innerHTML = resp.geo;
|
||||
}
|
||||
else {
|
||||
$$.getElementById(elID).innerHTML = 'Unknown';
|
||||
}
|
||||
})
|
||||
}
|
||||
//https://api.ip.sb/geoip/${anonymizedIp}
|
||||
//http://ip-api.com/json/${anonymizedIp}?lang=zh-CN
|
||||
//$$.getElementById(elID).innerHTML = `${resp.data.country} ${resp.data.regionName} ${resp.data.city} ${resp.data.isp}`;
|
||||
})
|
||||
},
|
||||
getIpipnetIP: () => {
|
||||
IP.get(window.location.protocol+`//myip.ipip.net/?z=${random}`, 'text')
|
||||
.then((resp) => {
|
||||
let data = resp.data.replace('当前 IP:', '').split(' 来自于:');
|
||||
if (localStorage.getItem('privacy_my_ip') != 'true') {
|
||||
$$.getElementById('ip-ipipnet').innerHTML = `${data[0]}`;
|
||||
};
|
||||
$$.getElementById('ip-ipipnet-geo').innerHTML = `${data[1]}`;
|
||||
addTitleOnOverflow();
|
||||
});
|
||||
},
|
||||
getIPApiIP: () => {
|
||||
IP.get(`https://ipapi.co/json?z=${random}`, 'json')
|
||||
.then(resp => {
|
||||
if (localStorage.getItem('privacy_my_ip') != 'true') {
|
||||
$$.getElementById('ip-ipapi').innerHTML = resp.data.ip;
|
||||
};
|
||||
IP.parseIPIpip(resp.data.ip, 'ip-ipapi-geo');
|
||||
addTitleOnOverflow();
|
||||
})
|
||||
},
|
||||
//getSpeedIP: () => {
|
||||
// IP.get(`https://forge.speedtest.cn/api/location/info?z=${random}`, 'json')
|
||||
// .then(resp => {
|
||||
// if (localStorage.getItem('privacy_my_ip') != 'true') {
|
||||
// $$.getElementById('ip-speedtest').innerHTML = resp.data.ip;
|
||||
// };
|
||||
//$$.getElementById('ip-speedtest-geo').innerHTML = resp.data.country + resp.data.province + resp.data.city + (resp.data.distinct == "null" ? '' : resp.data.distinct) + ' ' + (resp.data.isp == "null" ? '' : resp.data.isp);
|
||||
// IP.parseIPIpip(resp.data.ip, 'ip-speedtest-geo');
|
||||
// })
|
||||
//},
|
||||
getUpaiIP: () => {
|
||||
IP.get(`https://pubstatic.b0.upaiyun.com/?_upnode&z=${random}`, 'json')
|
||||
.then(resp => {
|
||||
if (localStorage.getItem('privacy_my_ip') != 'true') {
|
||||
$$.getElementById('ip-upaiyun').innerHTML = resp.data.remote_addr;
|
||||
};
|
||||
$$.getElementById('ip-upaiyun-geo').innerHTML = resp.data.remote_addr_location.country + resp.data.remote_addr_location.province + resp.data.remote_addr_location.city + ' ' + resp.data.remote_addr_location.isp;
|
||||
//IP.parseIPIpip(resp.data.remote_addr, 'ip-upaiyun-geo');
|
||||
addTitleOnOverflow();
|
||||
})
|
||||
},
|
||||
getIpifyIP: () => {
|
||||
IP.get(`https://api.ipify.org/?format=json&z=${random}`, 'json')
|
||||
.then(resp => {
|
||||
if (localStorage.getItem('privacy_my_ip') != 'true') {
|
||||
$$.getElementById('ip-ipify').innerHTML = resp.data.ip;
|
||||
};
|
||||
return resp.data.ip;
|
||||
})
|
||||
.then(ip => {
|
||||
IP.parseIPIpip(ip, 'ip-ipify-geo');
|
||||
addTitleOnOverflow();
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
$$.getElementById('http-baidu').innerHTML = '<span class="ip-checking"><%:Testing...%></span>';
|
||||
$$.getElementById('http-163').innerHTML = '<span class="ip-checking"><%:Testing...%></span>';
|
||||
$$.getElementById('http-github').innerHTML = '<span class="ip-checking"><%:Testing...%></span>';
|
||||
$$.getElementById('http-youtube').innerHTML = '<span class="ip-checking"><%:Testing...%></span>';
|
||||
let HTTP = {
|
||||
checker: (domain, cbElID, cbLoID) => {
|
||||
let img = new Image;
|
||||
let img_start_time = (+new Date());
|
||||
let timeout = setTimeout(() => {
|
||||
img.onerror = img.onload = null;
|
||||
$$.getElementById(cbLoID).style.display = 'none';
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-error"><%:Access Timed Out%></span>'
|
||||
}, 5000);
|
||||
|
||||
img.onerror = () => {
|
||||
clearTimeout(timeout);
|
||||
$$.getElementById(cbLoID).style.display = 'none';
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-error"><%:Access Denied%></span>'
|
||||
}
|
||||
|
||||
img.onload = () => {
|
||||
clearTimeout(timeout);
|
||||
let img_load_time = (new Date())- img_start_time;
|
||||
if ($$.getElementById(cbLoID).style.display == 'none') {
|
||||
$$.getElementById(cbLoID).style.display = '';
|
||||
}
|
||||
if (img_load_time <= 500) {
|
||||
$$.getElementById(cbLoID).innerHTML = '<span class="sk-load-success">' + img_load_time + ' ms</span>'
|
||||
$$.getElementById(cbLoID).style.color = '#32b643';
|
||||
}
|
||||
else if (img_load_time > 500 && img_load_time <= 1000) {
|
||||
$$.getElementById(cbLoID).innerHTML = '<span class="sk-load-success">' + img_load_time + ' ms</span>'
|
||||
$$.getElementById(cbLoID).style.color = 'orange';
|
||||
}
|
||||
else {
|
||||
$$.getElementById(cbLoID).innerHTML = '<span class="sk-load-success">' + img_load_time + ' ms</span>'
|
||||
$$.getElementById(cbLoID).style.color = '#e85600';
|
||||
}
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-success"><%:Access Normal%></span>'
|
||||
}
|
||||
|
||||
img.src = `https://${domain}/favicon.ico?${+(new Date)}`
|
||||
},
|
||||
runcheck: () => {
|
||||
HTTP.checker('www.baidu.com', 'http-baidu', 'ldtime-baidu');
|
||||
HTTP.checker('s1.music.126.net/style', 'http-163', 'ldtime-163');
|
||||
HTTP.checker('github.com', 'http-github', 'ldtime-github');
|
||||
HTTP.checker('www.youtube.com', 'http-youtube', 'ldtime-youtube');
|
||||
}
|
||||
};
|
||||
|
||||
function getPcolIP(data){
|
||||
let pcisp = data.addr.split(' ');
|
||||
if (localStorage.getItem('privacy_my_ip') != 'true') {
|
||||
$$.getElementById('ip-pcol').innerHTML = data.ip;
|
||||
};
|
||||
$$.getElementById('ip-pcol-geo').innerHTML = `${data.pro}${data.city}${data.region} ${pcisp[1]}`;
|
||||
addTitleOnOverflow();
|
||||
};
|
||||
|
||||
function getIpsbIP(data){
|
||||
if (localStorage.getItem('privacy_my_ip') != 'true') {
|
||||
$$.getElementById('ip-ipsb').innerHTML = data.ip;
|
||||
};
|
||||
//IP.parseIPIpip(data.ip, 'ip-ipsb-geo');
|
||||
$$.getElementById('ip-ipsb-geo').innerHTML = `${data.country} ${data.isp}`;
|
||||
addTitleOnOverflow();
|
||||
};
|
||||
|
||||
//function ipCallback(data){
|
||||
// if (localStorage.getItem('privacy_my_ip') != 'true') {
|
||||
// $$.getElementById('ip-taobao').innerHTML = data.ip;
|
||||
// };
|
||||
// IP.parseIPIpip(data.ip, 'ip-taobao-geo');
|
||||
//};
|
||||
|
||||
function delete_ip_script()
|
||||
{
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = scripts.length; i--; ) {
|
||||
if (document.getElementsByTagName("script")[i]['src'].indexOf('whois.pconline.com.cn') > -1
|
||||
|| document.getElementsByTagName("script")[i]['src'].indexOf('api-ipv4.ip.sb') > -1) {
|
||||
scripts[i].parentNode.removeChild(scripts[i]);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
function myip_Load()
|
||||
{
|
||||
delete_ip_script();
|
||||
var mypage = document.getElementsByTagName('HEAD').item(0);
|
||||
var pcipScript= document.createElement("script");
|
||||
var random = parseInt(Math.random() * 100000000);
|
||||
pcipScript.defer = "defer";
|
||||
pcipScript.src=`https://whois.pconline.com.cn/ipJson.jsp?callback=getPcolIP&z=${random}`;
|
||||
mypage.appendChild(pcipScript);
|
||||
|
||||
var sbipScript= document.createElement("script");
|
||||
sbipScript.defer = "defer";
|
||||
sbipScript.src=`https://api-ipv4.ip.sb/geoip?callback=getIpsbIP&z=${random}`;
|
||||
mypage.appendChild(sbipScript);
|
||||
|
||||
//HTTP.runcheck();
|
||||
IP.getUpaiIP();
|
||||
IP.getIpifyIP();
|
||||
};
|
||||
|
||||
function show_my_ip()
|
||||
{
|
||||
if (localStorage.getItem('privacy_my_ip') == 'true') {
|
||||
$$.getElementById('eye-icon').src='/luci-static/resources/openclash/img/eye-slash-light.svg';
|
||||
$$.getElementById('eye-icon').title='<%:Show IP%>';
|
||||
$$.getElementById('eye-icon').alt='<%:Show IP%>';
|
||||
ip_pcol_ip = $$.getElementById('ip-pcol').innerHTML;
|
||||
ip_ipsb_ip = $$.getElementById('ip-ipsb').innerHTML;
|
||||
ip_upaiyun_ip = $$.getElementById('ip-upaiyun').innerHTML;
|
||||
ip_ipify_ip = $$.getElementById('ip-ipify').innerHTML;
|
||||
$$.getElementById('ip-pcol').innerHTML = '***.***.***.***';
|
||||
$$.getElementById('ip-ipsb').innerHTML = '***.***.***.***';
|
||||
$$.getElementById('ip-upaiyun').innerHTML = '***.***.***.***';
|
||||
$$.getElementById('ip-ipify').innerHTML = '***.***.***.***';
|
||||
addTitleOnOverflow();
|
||||
}
|
||||
else {
|
||||
refresh_http = setInterval("HTTP.runcheck()", Math.floor(Math.random()*(10-5+1)+5)*1000);
|
||||
refresh_ip = setInterval("myip_Load()", Math.floor(Math.random()*(30-10+1)+10)*1000);
|
||||
};
|
||||
};
|
||||
|
||||
function privacy_my_ip(imgobj)
|
||||
{
|
||||
if (imgobj.getAttribute("src") == "/luci-static/resources/openclash/img/eye-light.svg") {
|
||||
delete_ip_script();
|
||||
clearInterval(refresh_ip);
|
||||
localStorage.setItem('privacy_my_ip', 'true');
|
||||
imgobj.src='/luci-static/resources/openclash/img/eye-slash-light.svg';
|
||||
imgobj.title='<%:Show IP%>';
|
||||
imgobj.alt='<%:Show IP%>';
|
||||
ip_pcol_ip = $$.getElementById('ip-pcol').innerHTML;
|
||||
ip_ipsb_ip = $$.getElementById('ip-ipsb').innerHTML;
|
||||
ip_upaiyun_ip = $$.getElementById('ip-upaiyun').innerHTML;
|
||||
ip_ipify_ip = $$.getElementById('ip-ipify').innerHTML;
|
||||
$$.getElementById('ip-pcol').innerHTML = '***.***.***.***';
|
||||
$$.getElementById('ip-ipsb').innerHTML = '***.***.***.***';
|
||||
$$.getElementById('ip-upaiyun').innerHTML = '***.***.***.***';
|
||||
$$.getElementById('ip-ipify').innerHTML = '***.***.***.***';
|
||||
addTitleOnOverflow();
|
||||
}
|
||||
else {
|
||||
imgobj.src='/luci-static/resources/openclash/img/eye-light.svg';
|
||||
imgobj.title='<%:Hide IP%>';
|
||||
imgobj.alt='<%:Hide IP%>';
|
||||
$$.getElementById('ip-pcol').innerHTML = ip_pcol_ip;
|
||||
$$.getElementById('ip-ipsb').innerHTML = ip_ipsb_ip;
|
||||
$$.getElementById('ip-upaiyun').innerHTML = ip_upaiyun_ip;
|
||||
$$.getElementById('ip-ipify').innerHTML = ip_ipify_ip;
|
||||
localStorage.removeItem('privacy_my_ip');
|
||||
myip_Load();
|
||||
refresh_ip = setInterval("myip_Load()", Math.floor(Math.random()*(30-10+1)+10)*1000);
|
||||
};
|
||||
};
|
||||
|
||||
function refresh_myip(imgobj)
|
||||
{
|
||||
clearInterval(refresh_http);
|
||||
clearInterval(refresh_ip);
|
||||
myip_Load();
|
||||
HTTP.runcheck();
|
||||
refresh_http = setInterval("HTTP.runcheck()", Math.floor(Math.random()*(10-5+1)+5)*1000);
|
||||
refresh_ip = setInterval("myip_Load()", Math.floor(Math.random()*(30-10+1)+10)*1000);
|
||||
};
|
||||
|
||||
HTTP.runcheck();
|
||||
IP.getIpifyIP();
|
||||
IP.getUpaiIP();
|
||||
show_my_ip();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
document.write('<script defer="defer" src="https://whois.pconline.com.cn/ipJson.jsp?callback=getPcolIP&z='+parseInt(Math.random() * 100000000)+'" type="text/javascript"><\/script>');
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
document.write('<script defer="defer" src="https://api-ipv4.ip.sb/geoip?callback=getIpsbIP&z='+parseInt(Math.random() * 100000000)+'" type="text/javascript"><\/script>');
|
||||
</script>
|
||||
</html>
|
@ -1,7 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<% if self:cfgvalue(section) ~= false then %>
|
||||
<input class="btn cbi-button cbi-input-<%=self.inputstyle or "button" %>" style="display: <%= display %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> />
|
||||
<% else %>
|
||||
-
|
||||
<% end %>
|
||||
<%+cbi/valuefooter%>
|
@ -1,88 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<%
|
||||
local stream_id_name = string.gsub(self.value, "%W", "")
|
||||
%>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
function act_manual_unlock_test_<%=stream_id_name%>(btn, type)
|
||||
{
|
||||
var manual_<%=stream_id_name%>_type_legend = document.getElementById('manual-<%=stream_id_name%>-test-state');
|
||||
var manual_<%=stream_id_name%>_type_output = document.getElementById('manual-<%=stream_id_name%>-test-output');
|
||||
var r = confirm("<%:Network instability may occur during testing, Are you sure want to start test?%>")
|
||||
if (r == true) {
|
||||
if (manual_<%=stream_id_name%>_type_legend && manual_<%=stream_id_name%>_type_output)
|
||||
{
|
||||
manual_<%=stream_id_name%>_type_output.innerHTML =
|
||||
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
|
||||
'<%:Waiting for command to complete...%>';
|
||||
|
||||
manual_<%=stream_id_name%>_type_legend.parentNode.style.display = 'block';
|
||||
manual_<%=stream_id_name%>_type_legend.style.display = 'inline';
|
||||
};
|
||||
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "manual_stream_unlock_test")%>', {type: type}, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "")
|
||||
{
|
||||
manual_<%=stream_id_name%>_type_legend.style.display = 'none';
|
||||
manual_<%=stream_id_name%>_type_output.innerHTML = '<textarea id="manual_<%=stream_id_name%>_type_output" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="10" cols="50" readonly="readonly" >'+x.responseText+'</textarea>';
|
||||
other_log_area(document.getElementById("manual_<%=stream_id_name%>_type_output"), 'true', manual_<%=stream_id_name%>_type_output.offsetWidth, '250px');
|
||||
}
|
||||
else
|
||||
{
|
||||
manual_<%=stream_id_name%>_type_legend.style.display = 'none';
|
||||
manual_<%=stream_id_name%>_type_output.innerHTML = '<span class="error"><%:Something Wrong While Testing...%></span>';
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
function act_all_proxies_test_<%=stream_id_name%>(btn, type)
|
||||
{
|
||||
var all_<%=stream_id_name%>_legend = document.getElementById('all-<%=stream_id_name%>-test-state');
|
||||
var all_<%=stream_id_name%>_output = document.getElementById('all-<%=stream_id_name%>-test-output');
|
||||
var r = confirm("<%:Network instability may occur during testing, Are you sure want to start test?%>")
|
||||
if (r == true) {
|
||||
if (all_<%=stream_id_name%>_legend && all_<%=stream_id_name%>_output)
|
||||
{
|
||||
all_<%=stream_id_name%>_output.innerHTML =
|
||||
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
|
||||
'<%:Waiting for command to complete...%>';
|
||||
|
||||
all_<%=stream_id_name%>_legend.parentNode.style.display = 'block';
|
||||
all_<%=stream_id_name%>_legend.style.display = 'inline';
|
||||
};
|
||||
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "all_proxies_stream_test")%>', {type: type}, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "")
|
||||
{
|
||||
all_<%=stream_id_name%>_legend.style.display = 'none';
|
||||
all_<%=stream_id_name%>_output.innerHTML = '<textarea id="all_<%=stream_id_name%>_output" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="10" cols="50" readonly="readonly" >'+x.responseText+'</textarea>';
|
||||
other_log_area(document.getElementById("all_<%=stream_id_name%>_output"), 'true', all_<%=stream_id_name%>_output.offsetWidth, '250px');
|
||||
}
|
||||
else
|
||||
{
|
||||
all_<%=stream_id_name%>_legend.style.display = 'none';
|
||||
all_<%=stream_id_name%>_output.innerHTML = '<span class="error"><%:Something Wrong While Testing...%></span>';
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
//]]></script>
|
||||
|
||||
|
||||
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Unlock Test(Select)%>" onclick="return act_manual_unlock_test_<%=stream_id_name%>(this, '<%=self.value%>')" />
|
||||
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:All Proxies Test%>" onclick="return act_all_proxies_test_<%=stream_id_name%>(this, '<%=self.value%>')" />
|
||||
<fieldset style="display: none;margin: 0 auto;">
|
||||
<legend id="manual-<%=stream_id_name%>-test-state"><%:Collecting data...%></legend>
|
||||
<br />
|
||||
<span id="manual-<%=stream_id_name%>-test-output"></span>
|
||||
</fieldset>
|
||||
<fieldset style="display: none;margin: 0 auto;">
|
||||
<legend id="all-<%=stream_id_name%>-test-state"><%:Collecting data...%></legend>
|
||||
<br />
|
||||
<span id="all-<%=stream_id_name%>-test-output"></span>
|
||||
</fieldset>
|
||||
<%+cbi/valuefooter%>
|
@ -1,260 +0,0 @@
|
||||
|
||||
<style type="text/css">
|
||||
.select-popup {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: white;
|
||||
border: 3px solid #9e9e9e;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
z-index: 1000;
|
||||
max-width: 1000%;
|
||||
min-width: 70%;
|
||||
width: 70%;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.select-popup.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select-popup-header {
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.select-popup-body {
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.select-option {
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid #d7d7d7;
|
||||
}
|
||||
|
||||
.select-option:hover {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.custom-option-input {
|
||||
margin-top: 5px;
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div id="selectPopup" class="select-popup hidden">
|
||||
<table width="100%"><tr>
|
||||
<td width="25%" align="center"><%:Compiled Version Selected (Auto-save when you click to update or download)%></td>
|
||||
<td width="25%" align="center"><select id="CORE_VERSION_CDN">
|
||||
<option value="linux-386"><%:linux-386%></option>
|
||||
<option value="linux-amd64"><%:linux-amd64(x86-64)%></option>
|
||||
<option value="linux-amd64-v3"><%:linux-amd64-v3(x86-64)%></option>
|
||||
<option value="linux-armv5"><%:linux-armv5%></option>
|
||||
<option value="linux-armv6"><%:linux-armv6%></option>
|
||||
<option value="linux-armv7"><%:linux-armv7%></option>
|
||||
<option value="linux-arm64"><%:linux-arm64(armv8)%></option>
|
||||
<option value="linux-loong64-abi1"><%:linux-loong64-abi1%></option>
|
||||
<option value="linux-loong64-abi2"><%:linux-loong64-abi2%></option>
|
||||
<option value="linux-riscv64"><%:linux-riscv64%></option>
|
||||
<option value="linux-s390x"><%:linux-s390x%></option>
|
||||
<option value="linux-mips-hardfloat"><%:linux-mips-hardfloat%></option>
|
||||
<option value="linux-mips-softfloat"><%:linux-mips-softfloat%></option>
|
||||
<option value="linux-mips64"><%:linux-mips64%></option>
|
||||
<option value="linux-mips64le"><%:linux-mips64le%></option>
|
||||
<option value="linux-mipsle-softfloat"><%:linux-mipsle-softfloat%></option>
|
||||
<option value="linux-mipsle-hardfloat"><%:linux-mipsle-hardfloat%></option>
|
||||
<option value="0"><%:Not Set%></option>
|
||||
</select></td>
|
||||
<td width="25%" align="center"><%:Release Branch Selected (Auto-save when you click to update or download)%></td>
|
||||
<td width="25%" align="center"><select id="RELEASE_BRANCH_CDN">
|
||||
<option value="master">Master</option>
|
||||
<option value="dev">Developer</option>
|
||||
</select></td>
|
||||
</tr></table>
|
||||
<div class="select-popup-header"><%:Choose CDN For Downloading:%></div>
|
||||
<div class="select-popup-body">
|
||||
<div class="select-option" data-value="https://fastly.jsdelivr.net/">https://fastly.jsdelivr.net/</div>
|
||||
<div class="select-option" data-value="https://testingcf.jsdelivr.net/">https://testingcf.jsdelivr.net/</div>
|
||||
<div class="select-option" data-value="https://raw.fastgit.org/">https://raw.fastgit.org/</div>
|
||||
<div class="select-option" data-value="https://cdn.jsdelivr.net/">https://cdn.jsdelivr.net/</div>
|
||||
<div class="select-option" data-value="custom"><%:Custom Your CDN URL%></div>
|
||||
<input type="text" id="customOptionInput" class="custom-option-input" value="https://mirror.ghproxy.com/" placeholder="<%:Type CDN URL, Format Like%> https://mirror.ghproxy.com/" style="display: none;">
|
||||
<div class="select-option" id="addCustomOption" style="display: none;"><%:Add%></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
var core_version_cdn = document.getElementById('CORE_VERSION_CDN');
|
||||
var release_branch_cdn = document.getElementById('RELEASE_BRANCH_CDN');
|
||||
|
||||
function get_update_info() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_info")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.corever != "0" && status.corever != "" ) {
|
||||
core_version_cdn.value = status.corever;
|
||||
}
|
||||
else {
|
||||
core_version_cdn.value = "0";
|
||||
}
|
||||
if ( status.release_branch != "" ) {
|
||||
release_branch_cdn.value = status.release_branch;
|
||||
}
|
||||
else {
|
||||
release_branch_cdn.value = "master";
|
||||
}
|
||||
}
|
||||
else {
|
||||
core_version_cdn.value = "0";
|
||||
release_branch_cdn.value = "master";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function isValidURL(str) {
|
||||
var pattern = new RegExp('^(https?:\\/\\/)?'+ // protocol
|
||||
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name
|
||||
'((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address
|
||||
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path
|
||||
'(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string
|
||||
'(\\#[-a-z\\d_]*)?'+'\/$','i'); // fragment locator
|
||||
return !!pattern.test(str);
|
||||
};
|
||||
|
||||
function HTTP_delay(domain, ID) {
|
||||
let img = new Image;
|
||||
let img_start_time = (+new Date());
|
||||
let timeout = setTimeout(() => {
|
||||
img.onerror = img.onload = null;
|
||||
ID.innerHTML = ID.dataset.value + ' <font style=\'color:red\'><%:Access Timed Out%></font>'
|
||||
}, 3000);
|
||||
|
||||
img.onerror = () => {
|
||||
clearTimeout(timeout);
|
||||
ID.innerHTML = ID.dataset.value + ' <font style=\'color:red\'><%:Access Denied%></font>'
|
||||
};
|
||||
|
||||
img.onload = () => {
|
||||
clearTimeout(timeout);
|
||||
let img_load_time = (new Date())- img_start_time;
|
||||
if (img_load_time <= 500) {
|
||||
ID.innerHTML = ID.dataset.value + ' ' + '<font style=\'color:#32b643\'>'+img_load_time+' ms</font>'
|
||||
}
|
||||
else if (img_load_time > 500 && img_load_time <= 1000) {
|
||||
ID.innerHTML = ID.dataset.value + ' ' + '<font style=\'color:orange\'>'+img_load_time+' ms</font>'
|
||||
}
|
||||
else {
|
||||
ID.innerHTML = ID.dataset.value + ' ' + '<font style=\'color:#e85600\'>'+img_load_time+' ms</font>'
|
||||
}
|
||||
};
|
||||
|
||||
img.src = `${domain}favicon.ico?${+(new Date)}`;
|
||||
};
|
||||
|
||||
function select_git_cdn(btn, type) {
|
||||
var selectPopup = document.getElementById('selectPopup');
|
||||
get_update_info();
|
||||
selectPopup.classList.remove('hidden');
|
||||
|
||||
var customOptionInput = document.getElementById('customOptionInput');
|
||||
var addCustomOption = document.getElementById('addCustomOption');
|
||||
var selectOptions = document.getElementsByClassName('select-option');
|
||||
|
||||
// 隐藏自定义输入和按钮
|
||||
customOptionInput.style.display = 'none';
|
||||
addCustomOption.style.display = 'none';
|
||||
|
||||
// 添加自定义选项的事件监听
|
||||
selectPopup.addEventListener('click', select_window, type);
|
||||
|
||||
//点击弹窗外部关闭弹窗
|
||||
document.addEventListener('click', select_window_close);
|
||||
|
||||
refresh_httpdelay = setInterval(() => {
|
||||
for(var i = 0; i < selectOptions.length; i++) {
|
||||
if (isValidURL(selectOptions[i].dataset.value)) {
|
||||
HTTP_delay(selectOptions[i].dataset.value, selectOptions[i]);
|
||||
};
|
||||
};
|
||||
}, Math.floor(Math.random()*(7-3+1)+3)*1000);
|
||||
};
|
||||
|
||||
function select_window_close(event) {
|
||||
if (!selectPopup.contains(event.target)) {
|
||||
selectPopup.classList.add('hidden');
|
||||
clearInterval(refresh_httpdelay);
|
||||
}
|
||||
};
|
||||
|
||||
function select_window(event, type) {
|
||||
var v = core_version_cdn.value;
|
||||
var r = release_branch_cdn.value;
|
||||
var selectOptions = document.getElementsByClassName('select-option');
|
||||
var target = event.target;
|
||||
if (target.classList.contains('select-option') && target.dataset.value === 'custom') {
|
||||
// 显示自定义输入和按钮
|
||||
customOptionInput.style.display = 'block';
|
||||
addCustomOption.style.display = 'block';
|
||||
} else if (target === addCustomOption) {
|
||||
// 添加自定义选项到列表中
|
||||
var newValue = customOptionInput.value.trim();
|
||||
if (newValue !== '' && isValidURL(newValue)) {
|
||||
var newOption = document.createElement('div');
|
||||
newOption.classList.add('select-option');
|
||||
newOption.textContent = newValue;
|
||||
newOption.dataset.value = newValue;
|
||||
selectPopup.querySelector('.select-popup-body').insertBefore(newOption, selectPopup.querySelector('.select-popup-body').children[selectOptions.length - 2]);
|
||||
|
||||
// 隐藏自定义输入和按钮
|
||||
customOptionInput.style.display = 'none';
|
||||
addCustomOption.style.display = 'none';
|
||||
}
|
||||
else {
|
||||
alert("<%:Please enter a valid URL!%>");
|
||||
}
|
||||
} else if (target != addCustomOption && target != customOptionInput && target.classList.contains('select-option')) {
|
||||
customOptionInput.style.display = 'none';
|
||||
addCustomOption.style.display = 'none';
|
||||
if (type === 'core_download') {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "core_download")%>', {url: target.dataset.value}, function(x, status) {});
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update")%>', {url: target.dataset.value}, function(x, status) {});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
selectPopup.classList.add('hidden');
|
||||
clearInterval(refresh_httpdelay);
|
||||
}
|
||||
else if (target != addCustomOption && target != customOptionInput) {
|
||||
// 点击其他选项或弹窗外部,隐藏自定义输入和按钮
|
||||
customOptionInput.style.display = 'none';
|
||||
addCustomOption.style.display = 'none';
|
||||
}
|
||||
else {
|
||||
if (target != customOptionInput) {
|
||||
selectPopup.classList.add('hidden');
|
||||
clearInterval(refresh_httpdelay);
|
||||
}
|
||||
};
|
||||
};
|
||||
//]]>
|
||||
</script>
|
@ -1,316 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function padright(str, cnt, pad) {
|
||||
return str + Array(cnt + 1).join(pad);
|
||||
}
|
||||
|
||||
function b64EncodeUnicode(str) {
|
||||
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
|
||||
return String.fromCharCode('0x' + p1);
|
||||
}));
|
||||
}
|
||||
|
||||
function b64encutf8safe(str) {
|
||||
return b64EncodeUnicode(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, '');
|
||||
}
|
||||
|
||||
function b64DecodeUnicode(str) {
|
||||
return decodeURIComponent(Array.prototype.map.call(atob(str), function (c) {
|
||||
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
||||
}).join(''));
|
||||
}
|
||||
|
||||
function b64decutf8safe(str) {
|
||||
var l;
|
||||
str = str.replace(/-/g, "+").replace(/_/g, "/");
|
||||
l = str.length;
|
||||
l = (4 - l % 4) % 4;
|
||||
if (l) str = padright(str, l, "=");
|
||||
return b64DecodeUnicode(str);
|
||||
}
|
||||
|
||||
function b64encsafe(str) {
|
||||
return btoa(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, '')
|
||||
}
|
||||
|
||||
function b64decsafe(str) {
|
||||
var l;
|
||||
str = str.replace(/-/g, "+").replace(/_/g, "/");
|
||||
l = str.length;
|
||||
l = (4 - l % 4) % 4;
|
||||
if (l) str = padright(str, l, "=");
|
||||
return atob(str);
|
||||
}
|
||||
|
||||
function dictvalue(d, key) {
|
||||
var v = d[key];
|
||||
if (typeof (v) == 'undefined' || v == '') return '';
|
||||
return b64decsafe(v);
|
||||
}
|
||||
|
||||
function export_ssr_url(btn, urlname, sid) {
|
||||
var s = document.getElementById(urlname + '-status');
|
||||
if (!s) return false;
|
||||
var v_server = document.getElementsByName('cbid.openclash.' + sid + '.server')[0];
|
||||
var v_port = document.getElementsByName('cbid.openclash.' + sid + '.port')[0];
|
||||
var v_protocol = document.getElementsByName('cbid.openclash.' + sid + '.protocol')[0];
|
||||
var v_method = document.getElementsByName('cbid.openclash.' + sid + '.cipher_ssr')[0];
|
||||
var v_obfs = document.getElementsByName('cbid.openclash.' + sid + '.obfs_ssr')[0];
|
||||
var v_password = document.getElementsByName('cbid.openclash.' + sid + '.password')[0];
|
||||
var v_obfs_param = document.getElementsByName('cbid.openclash.' + sid + '.obfs_param')[0];
|
||||
var v_protocol_param = document.getElementsByName('cbid.openclash.' + sid + '.protocol_param')[0];
|
||||
var v_alias = document.getElementsByName('cbid.openclash.' + sid + '.name')[0];
|
||||
var ssr_str = v_server.value + ":" + v_port.value + ":" + v_protocol.value + ":" + v_method.value + ":" + v_obfs.value + ":" + b64encsafe(v_password.value) + "/?obfsparam=" + b64encsafe(v_obfs_param.value) + "&protoparam=" + b64encsafe(v_protocol_param.value) + "&remarks=" + b64encutf8safe(v_alias.value);
|
||||
var textarea = document.createElement("textarea");
|
||||
textarea.textContent = "ssr://" + b64encsafe(ssr_str);
|
||||
textarea.style.position = "fixed";
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
try {
|
||||
document.execCommand("copy"); // Security exception may be thrown by some browsers.
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Copy SSR to clipboard successfully.%></font>";
|
||||
} catch (ex) {
|
||||
s.innerHTML = "<font style=\"color:red\"><%:Unable to copy SSR to clipboard.%></font>";
|
||||
} finally {
|
||||
document.body.removeChild(textarea);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function import_ssr_url(btn, urlname, sid) {
|
||||
var s = document.getElementById(urlname + '-status');
|
||||
if (!s) return false;
|
||||
var ssrurl = prompt("<%:Paste sharing link here%>", "");
|
||||
if (ssrurl == null || ssrurl == "") {
|
||||
s.innerHTML = "<font style=\"color:red\"><%:User cancelled.%></font>";
|
||||
return false;
|
||||
}
|
||||
s.innerHTML = "";
|
||||
//var ssu = ssrurl.match(/ssr:\/\/([A-Za-z0-9_-]+)/i);
|
||||
var ssu = ssrurl.split('://');
|
||||
//console.log(ssu.length);
|
||||
var event = document.createEvent("HTMLEvents");
|
||||
event.initEvent("change", true, true);
|
||||
switch (ssu[0]) {
|
||||
case "ss":
|
||||
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, pluginObfs, pluginObfsHost, pluginObfsPath, pluginObfsHeaders;
|
||||
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);
|
||||
if (pluginOpts.indexOf("obfs=") != -1) {
|
||||
pluginObfs = pluginOpts.split("obfs=")[1].split(";")[0];
|
||||
if (pluginObfs == "ws") {
|
||||
pluginObfs = "websocket"
|
||||
}
|
||||
if (pluginOpts.indexOf("obfs-host=") != -1) {
|
||||
pluginObfsHost = pluginOpts.split("obfs-host=")[1].split("&group=")[0] || pluginOpts.split("obfs-host=")[1].split(";")[0];
|
||||
}
|
||||
if (pluginOpts.indexOf("path=") != -1) {
|
||||
pluginObfsPath = pluginOpts.split("path=")[1].split(";")[0];
|
||||
}
|
||||
if (pluginOpts.indexOf("headers=") != -1) {
|
||||
pluginObfsHeaders = pluginOpts.split("headers=")[1].split(";")[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
var userInfoSplitIndex = userInfo.indexOf(":");
|
||||
if (userInfoSplitIndex != -1) {
|
||||
method = userInfo.substr(0, userInfoSplitIndex);
|
||||
password = userInfo.substr(userInfoSplitIndex + 1);
|
||||
}
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].value = ssu[0];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.server')[0].value = server;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.port')[0].value = port;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.password')[0].value = password || "";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.cipher')[0].value = method || "";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs')[0].value = pluginObfs || "none";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs')[0].dispatchEvent(event);
|
||||
if (plugin != undefined) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.host')[0].value = pluginObfsHost || "";
|
||||
if (pluginObfs == "websocket") {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.custom')[0].value = pluginObfsHeaders || "";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.path')[0].value = pluginObfsPath || "";
|
||||
}
|
||||
}
|
||||
if (param != undefined) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
} else {
|
||||
var sstr = b64decsafe(url0);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].value = ssu[0];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
var part1 = team[0].split(':');
|
||||
var part2 = team[1].split(':');
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.server')[0].value = part2[0];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.port')[0].value = part2[1];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.password')[0].value = part1[1];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.cipher')[0].value = part1[0];
|
||||
if (param != undefined) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
}
|
||||
return false;
|
||||
case "ssr":
|
||||
var sstr = b64decsafe(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].value = ssu[0];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var url0, param = "";
|
||||
if (ploc > 0) {
|
||||
url0 = sstr.substr(0, ploc);
|
||||
param = sstr.substr(ploc + 2);
|
||||
}
|
||||
var ssm = url0.match(/^(.+):([^:]+):([^:]*):([^:]+):([^:]*):([^:]+)/);
|
||||
if (!ssm || ssm.length < 7) return false;
|
||||
var pdict = {};
|
||||
if (param.length > 2) {
|
||||
var a = param.split('&');
|
||||
for (var i = 0; i < a.length; i++) {
|
||||
var b = a[i].split('=');
|
||||
pdict[decodeURIComponent(b[0])] = decodeURIComponent(b[1] || '');
|
||||
}
|
||||
}
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.server')[0].value = ssm[1];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.port')[0].value = ssm[2];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.protocol')[0].value = ssm[3];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.cipher_ssr')[0].value = (ssm[4] == "none" ? "dummy" : ssm[4]);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_ssr')[0].value = ssm[5];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.password')[0].value = b64decsafe(ssm[6]);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_param')[0].value = dictvalue(pdict, 'obfsparam');
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.protocol_param')[0].value = dictvalue(pdict, 'protoparam');
|
||||
var rem = pdict['remarks'];
|
||||
if (typeof (rem) != 'undefined' && rem != '' && rem.length > 0) document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = b64decutf8safe(rem);
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
return false;
|
||||
case "trojan":
|
||||
var url0, param = "";
|
||||
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 = url0;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].value = "trojan";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
var password = team[0]
|
||||
var serverPart = team[1].split(':');
|
||||
var others = serverPart[1].split('?');
|
||||
var port = parseInt(others[0]);
|
||||
var queryParam = {}
|
||||
if (others.length > 1) {
|
||||
var queryParams = others[1]
|
||||
var queryArray = queryParams.split('&');
|
||||
for (i = 0; i < queryArray.length; i++) {
|
||||
var params = queryArray[i].split('=');
|
||||
queryParam[decodeURIComponent(params[0])] = decodeURIComponent(params[1] || '');
|
||||
}
|
||||
}
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.server')[0].value = serverPart[0];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.port')[0].value = port || '443';
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.password')[0].value = password;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.sni')[0].value = queryParam.sni || '';
|
||||
if (queryParam.type != undefined) {
|
||||
for (i = 0; i < document.getElementById('cbi.combobox.cbid.openclash.' + sid + '.alpn.1').getElementsByTagName("option").length; i++) {
|
||||
if ( document.getElementById('cbi.combobox.cbid.openclash.' + sid + '.alpn.1').getElementsByTagName("option")[i].value == queryParam.type ) {
|
||||
document.getElementById('cbi.combobox.cbid.openclash.' + sid + '.alpn.1').getElementsByTagName("option")[i].selected=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (param != undefined) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
return false;
|
||||
case "vmess":
|
||||
var sstr = b64DecodeUnicode(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].value = "vmess";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var url0, param = "";
|
||||
if (ploc > 0) {
|
||||
url0 = sstr.substr(0, ploc);
|
||||
param = sstr.substr(ploc + 2);
|
||||
}
|
||||
var ssm = JSON.parse(sstr);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = ssm.ps;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.server')[0].value = ssm.add;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.port')[0].value = ssm.port;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.alterId')[0].value = ssm.aid;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.uuid')[0].value = ssm.id;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].value = ssm.net;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].dispatchEvent(event);
|
||||
if (ssm.method) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.securitys')[0].value = ssm.method;
|
||||
}
|
||||
if (ssm.net == "tcp") {
|
||||
if (ssm.type && ssm.type != "http") {
|
||||
ssm.type = "none"
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].value = ssm.type;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].dispatchEvent(event);
|
||||
} else {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].value = "http";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.http_path')[0].value = ssm.path;
|
||||
}
|
||||
}
|
||||
if (ssm.net == "ws") {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].value = "websocket";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.ws_opts_path')[0].value = ssm.path;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.ws_opts_headers')[0].value = "Host: " + ssm.host;
|
||||
if (ssm.maxearlydata) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.max_early_data')[0].value = ssm.maxearlydata;
|
||||
}
|
||||
if (ssm.earlydataheadername) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.early_data_header_name')[0].value = ssm.earlydataheadername;
|
||||
}
|
||||
}
|
||||
if (ssm.net == "h2") {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.h2_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.h2_path')[0].value = ssm.path;
|
||||
}
|
||||
if (ssm.tls == "tls") {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.tls')[0].value = "true";
|
||||
}
|
||||
if (ssm.sni) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.servername')[0].value = ssm.sni;
|
||||
}
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
return false;
|
||||
default:
|
||||
s.innerHTML = "<font style=\"color:red\"><%:Invalid format.%></font>";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Import%>" onclick="return import_ssr_url(this, '<%=self.option%>', '<%=self.value%>')" />
|
||||
<span id="<%=self.option%>-status"></span>
|
||||
<%+cbi/valuefooter%>
|
@ -1,985 +0,0 @@
|
||||
<head>
|
||||
<style>
|
||||
.dot-typing{position:relative;left:-9999px;width:10px;height:10px;border-radius:5px;background-color:#9880ff;color:#9880ff;box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff;animation:dotTyping 1.5s infinite linear}@keyframes dotTyping{0%{box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff}16.667%{box-shadow:9984px -10px 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff}33.333%{box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff}50%{box-shadow:9984px 0 0 0 #9880ff,9999px -10px 0 0 #9880ff,10014px 0 0 0 #9880ff}66.667%{box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff}83.333%{box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px -10px 0 0 #9880ff}100%{box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff}}
|
||||
.radio-button{
|
||||
display: none;
|
||||
white-space: nowrap;
|
||||
background-color: #d1d1d1;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.radio-button input[type="radio"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.radio-button label {
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
padding: 4px 5px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.radio-button input[type="radio"]:checked+label {
|
||||
background-color: #1080c1;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<%
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
local RELEASE_BRANCH = uci:get("openclash", "config", "release_branch")
|
||||
local random = tostring(os.time()):reverse():sub(1, 9)
|
||||
%>
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td colspan="4" width="100%">
|
||||
<p style="margin: 10px 0; text-align: center">
|
||||
<img id="_logo" src="/luci-static/resources/openclash/img/meta.png?<%=random%>" loading="lazy" width="150px" height="150px" onload="return logo_check(this,this.src,'https://raw.githubusercontent.com/vernesong/OpenClash/<%=RELEASE_BRANCH%>/img/meta.png')" onerror="return logo_error(this,'/luci-static/resources/openclash/img/meta.png?<%=random%>')" title="Hello, World!" alt="OpenClash" onclick="return homepage()" />
|
||||
</p>
|
||||
<p id="_clashversion" style="margin: 10px 0; text-align: center">
|
||||
<img src="/luci-static/resources/openclash/img/version.svg?<%=random%>" alt="currentversion" height="21px" onclick="return go_update()">
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td colspan="4" width="100%">
|
||||
<p style="margin: 10px 0; text-align: center">
|
||||
<img id="gitbook" src="/luci-static/resources/openclash/img/Wiki.svg?<%=random%>" loading="lazy" alt="GitBook" width="50px" height="20px" onerror="return imgerrorfuns(this,'https://img.shields.io/badge/Wiki--lightgrey?logo=GitBook&style=social')" onclick="return gitbookpage()" />
|
||||
|
||||
<img id="wiki" src="/luci-static/resources/openclash/img/Tutorials.svg?<%=random%>" loading="lazy" alt="Wiki" width="75px" height="20px" onerror="return imgerrorfuns(this,'https://img.shields.io/badge/Tutorials--lightgrey?logo=Wikipedia&style=social')" onclick="return wikipage()" />
|
||||
|
||||
<img id="star" src="/luci-static/resources/openclash/img/Star.svg?<%=random%>g" loading="lazy" alt="star" width="50px" height="20px" onerror="return imgerrorfuns(this,'https://img.shields.io/badge/Star--lightgrey?logo=github&style=social')" onclick="return homepage()" />
|
||||
|
||||
<img id="telegram" src="/luci-static/resources/openclash/img/Telegram.svg?<%=random%>" loading="lazy" alt="Telegram" onerror="return imgerrorfuns(this,'https://img.shields.io/badge/Telegram--lightgrey?logo=Telegram&style=social')" onclick="return telegrampage()" />
|
||||
|
||||
<img id="sponsor" src="/luci-static/resources/openclash/img/Sponsor.svg?<%=random%>" loading="lazy" alt="Sponsor" width="73px" height="20px" onerror="return imgerrorfuns(this,'https://img.shields.io/badge/Sponsor--lightgrey?logo=ko-fi&style=social')" onclick="return sponsorpage()" />
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="100%" colspan="4">
|
||||
<div style="margin: 10px 0; text-align: center" id="_clashstart">
|
||||
<b><%:Tip: after started, please wait patiently until the connection is normal%></b>
|
||||
</div>
|
||||
</td></tr>
|
||||
<tr><td width="25%"><%:Main Program%></td><td width="25%" align="left"><span id="_clash"><%:Collecting data...%></span><span id="_watchdog"></span></td><td width="25%"><%:Control Panel Login IP%></td><td width="25%" align="left" id="_daip"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="20%"><%:Running Mode%></td><td width="30%" align="left"><span id="_mode"><%:Collecting data...%></span><span id="radio-ru-mode" class="radio-button">
|
||||
<input type="radio" id="normal" name="radios-ru" value="" checked onclick="return switch_run_mode(this.value)"/>
|
||||
<label for="normal" id="run_normal"><%:Compatible%></label>
|
||||
<input type="radio" id="tun" name="radios-ru" value="-tun" onclick="return switch_run_mode(this.value)"/>
|
||||
<label for="tun"><%:TUN%></label>
|
||||
<input type="radio" id="mix" name="radios-ru" value="-mix" onclick="return switch_run_mode(this.value)"/>
|
||||
<label for="mix"><%:Mix%></label>
|
||||
</span></td><td width="25%"><%:Control Panel Login Port%></td><td width="25%" align="left" id="_dapo"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Proxy Mode%></td><td width="25%" align="left"><span id="radio-de"><%:Collecting data...%></span><span id="radio-mode" class="radio-button">
|
||||
<input type="radio" id="rule" name="radios" value="rule" checked onclick="return switch_rule_mode(this.value)"/>
|
||||
<label for="rule">Rule</label>
|
||||
<input type="radio" id="global" name="radios" value="global" onclick="return switch_rule_mode(this.value)"/>
|
||||
<label for="global">Global</label>
|
||||
<input type="radio" id="direct" name="radios" value="direct" onclick="return switch_rule_mode(this.value)"/>
|
||||
<label for="direct">Direct</label>
|
||||
</span></td><td width="25%"><%:Control Panel Login Secret%></td><td width="25%" align="left" id="_dase"><%:Collecting data...%></td></tr>
|
||||
<tr><td colspan="4"><div style="margin: 10px 0; text-align: center"><span id="_web" style="width: 33%; display: inline-block;"></span><span id="_webm" style="width: 33%; display: inline-block;"><%:Collecting data...%></span><span id="_webo" style="width: 33%; display: inline-block;"></span></div></td></tr>
|
||||
<tr id="tool_label2"><td colspan="4">
|
||||
<div style="margin: 10px 0; text-align: center">
|
||||
<span>
|
||||
<%:Up:%>
|
||||
<span id="upload_">
|
||||
<font style=color:green>
|
||||
0 KB/S
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:Down:%>
|
||||
<span id="download_">
|
||||
<font style=color:green>
|
||||
0 KB/S
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:Up Total:%>
|
||||
<span id="uploadtotal_">
|
||||
<font style=color:green>
|
||||
0 KB
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:Down Total:%>
|
||||
<span id="downloadtotal_">
|
||||
<font style=color:green>
|
||||
0 KB
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:Connections:%>
|
||||
<span id="connect_t">
|
||||
<font style=color:green>
|
||||
0
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:Ram:%>
|
||||
<span id="mem_t">
|
||||
<font style=color:green>
|
||||
0 KB
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:CPU:%>
|
||||
<span id="cpu_t">
|
||||
<font style=color:green>
|
||||
0 %
|
||||
</font>
|
||||
</span>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</td></tr>
|
||||
<tr height="50px">
|
||||
<td width="100%" colspan="4">
|
||||
<div id="hid_btn" style="height: 25px;width: 100px;margin: 0 auto;" onclick="hid_btn_action()">
|
||||
<div style="margin: 0 auto; top: 50%;" class="dot-typing"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="hid_1"><td width="100%" colspan="4"><p style="margin: 10px 0; text-align: center"><b><%:Quick Operation%></b></p></td></tr>
|
||||
<tr id="hid_2">
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_close_all_connection"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_reload_firewall"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_flush_fakeip_cache"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_subscribe"><%:Collecting data...%></p></td>
|
||||
</tr>
|
||||
<tr id="hid_3">
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_other_rules"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_geoip"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_geosite"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_one_key_update"><%:Collecting data...%></p></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset id="state" class="cbi-section">
|
||||
<table>
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p style="margin: 10px 0; text-align: center">
|
||||
<b><%:Please ensure that all items are displayed normally before running. If you need to update, please go to the global settings page%></b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%"><%:Node Select Backup%></td><td width="25%" align="left" id="_historychecktime"><%:Collecting data...%></td><td width="25%"><%:lhie1 Rule Update%></td><td width="25%" align="left" id="_lhie1"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Mainland IP Update%></td><td width="25%" align="left" id="_chnroute"><%:Collecting data...%></td><td width="25%"><%: Mainland IPv6 Update%></td><td width="25%" align="left" id="_chnroutev6"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:GeoIP Data Update%></td><td width="25%" align="left" id="_ipdb"><%:Collecting data...%></td><td width="25%"><%:GeoSite Data Update%></td><td width="25%" align="left" id="_geosite"><%:Collecting data...%></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var clash = document.getElementById('_clash');
|
||||
var mode = document.getElementById('_mode');
|
||||
var web = document.getElementById('_web');
|
||||
var webo = document.getElementById('_webo');
|
||||
var webm = document.getElementById('_webm');
|
||||
var watchdog = document.getElementById('_watchdog');
|
||||
var daip = document.getElementById('_daip');
|
||||
var dase = document.getElementById('_dase');
|
||||
var dapo = document.getElementById('_dapo');
|
||||
var startlog = document.getElementById('_clashstart');
|
||||
var clashversion = document.getElementById('_clashversion');
|
||||
var close_all_connection = document.getElementById('_close_all_connection');
|
||||
var reload_firewall = document.getElementById('_reload_firewall');
|
||||
var one_key_update = document.getElementById('_one_key_update');
|
||||
var update_subscribe = document.getElementById('_update_subscribe');
|
||||
var update_other_rules = document.getElementById('_update_other_rules');
|
||||
var update_geoip = document.getElementById('_update_geoip');
|
||||
var update_geosite = document.getElementById('_update_geosite');
|
||||
var flush_fakeip_cache= document.getElementById('_flush_fakeip_cache');
|
||||
var ipdb = document.getElementById('_ipdb');
|
||||
var geosite = document.getElementById('_geosite');
|
||||
var lhie1 = document.getElementById('_lhie1');
|
||||
var chnroute = document.getElementById('_chnroute');
|
||||
var chnroutev6 = document.getElementById('_chnroutev6');
|
||||
var historychecktime = document.getElementById('_historychecktime');
|
||||
var hid_1 = document.getElementById("hid_1");
|
||||
var hid_2 = document.getElementById("hid_2");
|
||||
var hid_3 = document.getElementById("hid_3");
|
||||
var state = document.getElementById("state");
|
||||
var hid_btn = document.getElementById("hid_btn");
|
||||
var tool_label2 = document.getElementById('tool_label2');
|
||||
var radio_mode = document.getElementById('radio-mode');
|
||||
var radio = document.getElementsByName("radios");
|
||||
var radio_de = document.getElementById('radio-de');
|
||||
var radio_ru_mode = document.getElementById('radio-ru-mode');
|
||||
var radio_ru = document.getElementsByName("radios-ru");
|
||||
var radio_run_normal = document.getElementById("run_normal");
|
||||
var script_radio;
|
||||
var script_radio_label;
|
||||
var hid_btn_if = true;
|
||||
var ws_connect = false;
|
||||
var ws_error = false;
|
||||
var ws_retry = 0;
|
||||
var luci_protocol;
|
||||
var ws_t;
|
||||
var ws_c;
|
||||
var state_refresh;
|
||||
var s;
|
||||
var gr;
|
||||
|
||||
hid_1.style.display = "none";
|
||||
hid_2.style.display = "none";
|
||||
hid_3.style.display = "none";
|
||||
state.style.display="none";
|
||||
|
||||
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
clash.innerHTML = status.clash ? '<b style=color:green>' + status.core_type +' <%:Running%></b>' : '<b style=color:red><%:Not Running%></b>';
|
||||
watchdog.innerHTML = status.watchdog ? ' | <%:Daemons%>: <b style=color:green><%:Running%></b>' : ' | <%:Daemons%>: <b style=color:red><%:Not Running%></b>';
|
||||
dase.innerHTML = status.dase ? "<b style=color:green>"+status.dase+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
web.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Yacd Control Panel%>" onclick="return ycad_dashboard(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
webo.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Dashboard Control Panel%>" onclick="return net_dashboard(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
webm.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Metacubexd Control Panel%>" onclick="return meta_dashboard(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
close_all_connection.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Close All Connections%>" onclick="return b_close_all_connection(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
reload_firewall.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Reload Firewall Rules%>" onclick="return b_reload_firewall(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
flush_fakeip_cache.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Flush Fake-IP Cache%>" onclick="return b_flush_fakeip_cache(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
one_key_update.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check All Components Update%>" onclick="return all_one_key_update(this)"/>';
|
||||
update_subscribe.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check Config Update%>" onclick="return b_update_subscribe(this)"/>';
|
||||
update_other_rules.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check Third Party Rules Update%>" onclick="return b_update_other_rules(this)"/>';
|
||||
update_geoip.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check GEOIP Data Update%>" onclick="return b_update_geoip(this)"/>';
|
||||
update_geosite.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check GeoSite Data Update%>" onclick="return b_update_geosite(this)"/>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
daip.innerHTML = status.daip ? "<b style=color:green>"+status.daip+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
dapo.innerHTML = status.cn_port ? "<b style=color:green>"+status.cn_port+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
luci_protocol = (window.location.protocol == "http:" ? "ws://" : "wss://") + status.daip + ":" + status.cn_port;
|
||||
}
|
||||
else if (status.daip && window.location.hostname != status.daip && status.db_foward_domain && status.db_foward_port)
|
||||
{
|
||||
daip.innerHTML = status.db_foward_domain ? "<b style=color:green>"+status.db_foward_domain+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
dapo.innerHTML = status.db_foward_port ? "<b style=color:green>"+status.db_foward_port+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
luci_protocol = (window.location.protocol == "http:" ? "ws://" : "wss://") + status.db_foward_domain + ":" + status.db_foward_port;
|
||||
}
|
||||
else {
|
||||
daip.innerHTML = status.daip ? "<b style=color:green>"+status.daip+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
dapo.innerHTML = status.cn_port ? "<b style=color:green>"+status.cn_port+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
luci_protocol = (window.location.protocol == "http:" ? "ws://" : "wss://") + status.daip + ":" + status.cn_port;
|
||||
};
|
||||
|
||||
if (status.clash && status.watchdog) {
|
||||
radio_mode.style.display = "inline-block";
|
||||
radio_de.style.display = "none";
|
||||
}
|
||||
else {
|
||||
radio_mode.style.display = "none";
|
||||
radio_de.style.display = "";
|
||||
radio_de.innerHTML = "<b style=color:red><%:Not Running%></b>";
|
||||
};
|
||||
|
||||
if (status.clash && status.watchdog) {
|
||||
radio_ru_mode.style.display = "inline-block";
|
||||
}
|
||||
else {
|
||||
radio_ru_mode.style.display = "none";
|
||||
};
|
||||
|
||||
function ws_open() {
|
||||
ws_t = new WebSocket(luci_protocol+"/traffic?token="+status.dase);
|
||||
ws_c = new WebSocket(luci_protocol+"/connections?token="+status.dase);
|
||||
ws_t.onmessage = ws_tmessage;
|
||||
ws_c.onmessage = ws_cmessage;
|
||||
ws_t.onerror = ws_terror;
|
||||
ws_t.onopen = function (event) {
|
||||
ws_connect = true;
|
||||
ws_error = false;
|
||||
};
|
||||
};
|
||||
|
||||
if (status.watchdog && status.clash) {
|
||||
if (!ws_connect) {
|
||||
if (!ws_error) {
|
||||
ws_open();
|
||||
}
|
||||
else if (ws_retry < 3)
|
||||
{
|
||||
ws_retry=ws_retry+1;
|
||||
ws_open();
|
||||
}
|
||||
else
|
||||
{
|
||||
ws_terror();
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
ws_connect = false;
|
||||
ws_error = false;
|
||||
if (status.clash) {
|
||||
ws_terror();
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.startlog.match("level=fatal") || status.startlog.match("level=error") || status.startlog.indexOf("FTL [Config]") != "-1" ) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {});
|
||||
if ( status.startlog.match("level=fatal") || status.startlog.match("level=error") ) {
|
||||
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('msg=')[1]);
|
||||
}
|
||||
else {
|
||||
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('FTL [Config] ')[1]);
|
||||
};
|
||||
}
|
||||
else if ( status.startlog != "\n" && status.startlog != "" ) {
|
||||
if ( status.startlog.match("Tip:") || status.startlog.match("提示:")) {
|
||||
startlog.innerHTML = '<b style=color:#ff6f00>'+status.startlog+'</b>';
|
||||
}
|
||||
else if ( status.startlog.match("Error:") || status.startlog.match("错误:")) {
|
||||
startlog.innerHTML = '<b style=color:#FF0000>'+status.startlog+'</b>';
|
||||
}
|
||||
else if ( status.startlog.match("Warning:") || status.startlog.match("警告:")) {
|
||||
startlog.innerHTML = '<b style=color:#ff00bb>'+status.startlog+'</b>';
|
||||
}
|
||||
else if ( status.startlog.match("Watchdog:") || status.startlog.match("守护程序:")) {
|
||||
startlog.innerHTML = '<b style=color:#b300ff>'+status.startlog+'</b>';
|
||||
}
|
||||
else {
|
||||
startlog.innerHTML = '<b style=color:green>'+status.startlog+'</b>';
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
XHR.poll(6, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.startlog == "\n" || status.startlog == "" ) {
|
||||
var rdmdl=Math.floor(Math.random()*16)+1;
|
||||
if(rdmdl==1)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: You can modify the profile on the profile page (for content that is not taken over)%></font></b>';
|
||||
}
|
||||
if(rdmdl==2)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: click the version icon above to jump to the client publishing page%></font></b>';
|
||||
}
|
||||
if(rdmdl==3)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: do not write configuration files? Try to create one click on the server page%></font></b>';
|
||||
}
|
||||
if(rdmdl==4)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: some website are abnormal? Try switching modes or using third-party rules%></font></b>';
|
||||
}
|
||||
if(rdmdl==5)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: using the fake IP mode can get a faster access experience%></font></b>';
|
||||
}
|
||||
if(rdmdl==6)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: query DNS by TLS & TCP & HTTPS can get better anti pollution effect%></font></b>';
|
||||
}
|
||||
if(rdmdl==7)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: openlash will check the configuration file parameters to ensure that it works properly%></font></b>';
|
||||
}
|
||||
if(rdmdl==8)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: the nameserver group must have at least one server set when using custom DNS%></font></b>';
|
||||
}
|
||||
if(rdmdl==9)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: the website access check shows the connection of the device currently logged in to the Luci page%></font></b>';
|
||||
}
|
||||
if(rdmdl==10)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: after started, please wait patiently until the connection is normal%></font></b>';
|
||||
}
|
||||
if(rdmdl==11)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: if you don not use IPv6, please turn off the DHCP service of IPv6, otherwise the connection will be abnormal%></font></b>';
|
||||
}
|
||||
if(rdmdl==12)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: you can update the version in the global settings page%></font></b>';
|
||||
}
|
||||
if(rdmdl==13)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Note: It is not recommended to enable IPv6 and related services for routing. Most of the network connection problems reported so far are related to it%></font></b>';
|
||||
}
|
||||
if(rdmdl==14)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Note: Turning on secure DNS in the browser will cause abnormal shunting, please be careful to turn it off%></font></b>';
|
||||
}
|
||||
if(rdmdl==15)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Note: Some software will modify the device HOSTS, which will cause abnormal shunt, please pay attention to check%></font></b>';
|
||||
}
|
||||
if(rdmdl==16)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Note: The default proxy routes local traffic, BT, PT download, etc., please use Redir-Host mode as much as possible and pay attention to traffic avoidance%></font></b>';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
get_rule_mode();
|
||||
get_run_mode();
|
||||
state_get();
|
||||
clashversion_check();
|
||||
check_core();
|
||||
|
||||
function get_rule_mode() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "rule_mode")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && status.mode != "") {
|
||||
if (status.core_type == "TUN" && radio.length != 4) {
|
||||
script_radio = document.createElement("input")
|
||||
script_radio.setAttribute("type", "radio");
|
||||
script_radio.setAttribute("id", "script");
|
||||
script_radio.setAttribute("name", "radios");
|
||||
script_radio.setAttribute("value", "script");
|
||||
script_radio.setAttribute("onclick", "javascript:return switch_rule_mode(this.value);");
|
||||
script_radio_label = document.createElement("label")
|
||||
script_radio_label.setAttribute("for", "script");
|
||||
script_radio_label.innerHTML = "Script";
|
||||
radio_mode.appendChild(script_radio);
|
||||
radio_mode.appendChild(script_radio_label);
|
||||
}
|
||||
else if (status.core_type != "TUN" && radio.length == 4) {
|
||||
radio_mode.removeChild(script_radio)
|
||||
radio_mode.removeChild(script_radio_label)
|
||||
}
|
||||
for (i=0; i<radio.length; i++) {
|
||||
if (radio[i].value == status.mode && ! radio[i].checked) {
|
||||
radio[i].checked = true;
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
s = setTimeout("get_rule_mode()",5000);
|
||||
};
|
||||
|
||||
function switch_rule_mode(value)
|
||||
{
|
||||
clearTimeout(s);
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_rule_mode")%>', {rule_mode: value}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
alert(' <%:Proxy Mode%>: ' + value + ' <%:switching succeeded!%>');
|
||||
get_rule_mode();
|
||||
}
|
||||
else {
|
||||
alert(' <%:Proxy Mode%>: ' + value + ' <%:switching failed!%>');
|
||||
get_rule_mode();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function get_run_mode() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "get_run_mode")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && status.mode) {
|
||||
if (status.mode == "fake-ip" || status.mode == "fake-ip-tun" || status.mode == "fake-ip-mix")
|
||||
{
|
||||
mode.innerHTML = status.clash && status.watchdog ? "<b style=color:green><%:Fake-IP%></b> | " : '<b style=color:red><%:Not Running%></b> ';
|
||||
radio_run_normal.innerHTML = "<%:Enhance%>"
|
||||
}
|
||||
else if (status.mode == "redir-host" || status.mode == "redir-host-tun" || status.mode == "redir-host-mix")
|
||||
{
|
||||
mode.innerHTML = status.clash && status.watchdog ? "<b style=color:green><%:Redir-Host%></b> | " : '<b style=color:red><%:Not Running%></b> ';
|
||||
radio_run_normal.innerHTML = "<%:Compatible%>"
|
||||
};
|
||||
for (i=0; i<radio_ru.length; i++) {
|
||||
if (radio_ru[i].value == (status["mode"].split("-")[2] == undefined ? "" : ("-" + status["mode"].split("-")[2])) && ! radio_ru[i].checked) {
|
||||
radio_ru[i].checked = true;
|
||||
}
|
||||
};
|
||||
};
|
||||
});
|
||||
gr = setTimeout("get_run_mode()",2000);
|
||||
};
|
||||
|
||||
function switch_run_mode(value)
|
||||
{
|
||||
var r = confirm("<%:Are you sure want to switch the running mode?%>")
|
||||
if (r == true) {
|
||||
clearTimeout(gr);
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_run_mode")%>', {run_mode: value}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
get_run_mode();
|
||||
}
|
||||
else {
|
||||
get_run_mode();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function state_get() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
ipdb.innerHTML = status.ipdb ? "<b style=color:green>"+status.ipdb+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
geosite.innerHTML = status.geosite ? "<b style=color:green>"+status.geosite+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
lhie1.innerHTML = status.lhie1 ? "<b style=color:green>"+status.lhie1+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
chnroute.innerHTML = status.chnroute ? "<b style=color:green>"+status.chnroute+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
chnroutev6.innerHTML = status.chnroutev6 ? "<b style=color:green>"+status.chnroutev6+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
if ( status.historychecktime != "0" ) {
|
||||
historychecktime.innerHTML = "<b style=color:green>"+status.historychecktime+"</b>";
|
||||
}
|
||||
else {
|
||||
historychecktime.innerHTML = "<b style=color:green>"+"<%:No Backup%>"+"</b>";
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function hid_btn_action() {
|
||||
if (hid_btn_if) {
|
||||
hid_1.style.display = "";
|
||||
hid_2.style.display = "";
|
||||
hid_3.style.display = "";
|
||||
state.style.display = "block";
|
||||
hid_btn_if = false;
|
||||
clearInterval(state_refresh);
|
||||
state_refresh=setInterval("state_get()",1000*2);
|
||||
} else {
|
||||
hid_1.style.display = "none";
|
||||
hid_2.style.display = "none";
|
||||
hid_3.style.display = "none";
|
||||
state.style.display = "none";
|
||||
hid_btn_if = true;
|
||||
clearInterval(state_refresh);
|
||||
}
|
||||
};
|
||||
|
||||
function winOpen(url)
|
||||
{
|
||||
var winOpen = window.open(url);
|
||||
if(winOpen == null || typeof(winOpen) == 'undefined'){
|
||||
window.location.href=url;
|
||||
}
|
||||
};
|
||||
|
||||
function ws_terror() {
|
||||
ws_error = true;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "toolbar_show")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "") {
|
||||
document.getElementById("upload_").innerHTML = "<font style=\"color:green\">"+status.up+"</font>";
|
||||
document.getElementById("download_").innerHTML = "<font style=\"color:green\">"+status.down+"</font>";
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font style=\"color:green\">"+status.up_total+"</font>";
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font style=\"color:green\">"+status.down_total+"</font>";
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">"+status.mem+"</font>";
|
||||
document.getElementById("connect_t").innerHTML = "<font style=\"color:green\">"+status.connections+"</font>";
|
||||
if (status.cpu <= 50) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else if (status.cpu >= 50 && status.cpu <= 80) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:orange\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else if (status.cpu <= 100) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:red\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">0 %</font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
document.getElementById("upload_").innerHTML = "<font style=\"color:green\">0 B/S</font>";
|
||||
document.getElementById("download_").innerHTML = "<font style=\"color:green\">0 B/S</font>";
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">0 %</font>";
|
||||
document.getElementById("connect_t").innerHTML = "<font style=\"color:green\">0</font>";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function show_sys() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "toolbar_show_sys")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "") {
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">"+status.mem+"</font>";
|
||||
if (status.cpu <= 50) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else if (status.cpu >= 50 && status.cpu <= 80) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:orange\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else if (status.cpu <= 100) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:red\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">0 %</font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">0 %</font>";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function ws_tmessage(event) {
|
||||
var data = JSON.parse(event.data)
|
||||
if (data.up) {
|
||||
document.getElementById("upload_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.up)+"/S</font>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("upload_").innerHTML = "<font style=\"color:green\">0 B/S</font>";
|
||||
}
|
||||
if (data.down) {
|
||||
document.getElementById("download_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.down)+"/S</font>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("download_").innerHTML = "<font style=\"color:green\">0 B/S</font>";
|
||||
}
|
||||
};
|
||||
|
||||
function ws_cmessage(event) {
|
||||
var data = JSON.parse(event.data)
|
||||
if (data.uploadTotal) {
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.uploadTotal)+"</font>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
}
|
||||
if (data.downloadTotal) {
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.downloadTotal)+"</font>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
}
|
||||
if (data.connections) {
|
||||
document.getElementById("connect_t").innerHTML = "<font style=\"color:green\">"+Object.keys(data.connections).length+"</font>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("connect_t").innerHTML = "<font style=\"color:green\">0</font>";
|
||||
}
|
||||
show_sys();
|
||||
};
|
||||
|
||||
function bytesToSize(bytes) {
|
||||
var sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
|
||||
if (bytes == 0) return '0 B';
|
||||
var i = Math.floor(Math.log(bytes) / Math.log(1024));
|
||||
return i == 0 ? (bytes / Math.pow(1024, i)) + ' ' + sizes[i] : (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
|
||||
};
|
||||
|
||||
function all_one_key_update(btn)
|
||||
{
|
||||
btn.value = '<%:Check All Components Update%>';
|
||||
btn.disabled = true;
|
||||
var r = confirm("<%:Check and Update all Cores and OpenClash?%>")
|
||||
if (r == true) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update_check")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.corever != "0" ) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update")%>', null, function(x, status) {
|
||||
if ( x && x.status != 200 ) {
|
||||
alert('<%:Check failed, Please try again later!%>')
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
alert('<%:No compiled version is selected. Please configure it in the General Settings tab!%>')
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert('<%:Check failed, Please try again later!%>')
|
||||
}
|
||||
});
|
||||
}
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
};
|
||||
|
||||
function b_update_other_rules(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Checking...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_other_rules")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check Third Party Rules Update%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check Third Party Rules Update%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function b_update_geoip(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Checking...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_geoip")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check GEOIP Data Update%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check GEOIP Data Update%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function b_update_geosite(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Checking...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_geosite")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check GeoSite Data Update%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check GeoSite Data Update%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function b_flush_fakeip_cache(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Flushing...%> ';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","flush_fakeip_cache")%>',
|
||||
null,
|
||||
function(x,status)
|
||||
{
|
||||
if ( x && x.status == 200 ) {
|
||||
if(status.flush_status == "0" || status.flush_status != "")
|
||||
{
|
||||
btn.value = '<%:Flush Failed%>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
btn.value = '<%:Flush Successful%>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Flush Timeout%>';
|
||||
}
|
||||
}
|
||||
);
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
};
|
||||
|
||||
function b_update_subscribe(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Checking...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_subscribe")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check Config Update%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check Config Update%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function b_reload_firewall(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Reloading...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "reload_firewall")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Reload Firewall Rules%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Firewall Rules Reset Failed%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function b_close_all_connection(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Reloading...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "close_all_connection")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Close All Connections%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Close All Connections Failed%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function meta_dashboard(btn)
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Metacubexd Control Panel%>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
url9='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/metacubexd/#/setup?hostname='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else if (status.daip && window.location.hostname != status.daip && status.db_foward_domain && status.db_foward_port) {
|
||||
var ui_proto = status.db_forward_ssl == 0 ? 'http://' : 'https://';
|
||||
url9='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/metacubexd/#/setup?hostname='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else {
|
||||
url9='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/metacubexd/#/"%>';
|
||||
}
|
||||
winOpen(url9);
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function ycad_dashboard(btn)
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Yacd Control Panel%>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
url1='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/yacd/?hostname='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else if (status.daip && window.location.hostname != status.daip && status.db_foward_domain && status.db_foward_port) {
|
||||
var ui_proto = status.db_forward_ssl == 0 ? 'http://' : 'https://';
|
||||
url1='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/yacd/?hostname='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else {
|
||||
url1='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/yacd/"%>';
|
||||
}
|
||||
winOpen(url1);
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function net_dashboard(btn)
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Dashboard Control Panel%>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
url2='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/dashboard/#/?host='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else if (status.daip && window.location.hostname != status.daip && status.db_foward_domain && status.db_foward_port) {
|
||||
var ui_proto = status.db_forward_ssl == 0 ? 'http://' : 'https://';
|
||||
url2='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/dashboard/#/?host='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else {
|
||||
url2='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/dashboard/"%>';
|
||||
}
|
||||
winOpen(url2);
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function homepage()
|
||||
{
|
||||
url3='https://github.com/vernesong/OpenClash';
|
||||
winOpen(url3);
|
||||
};
|
||||
|
||||
|
||||
function gitbookpage()
|
||||
{
|
||||
url8='https://wiki.metacubex.one';
|
||||
winOpen(url8);
|
||||
};
|
||||
|
||||
function wikipage()
|
||||
{
|
||||
url5='https://github.com/vernesong/OpenClash/wiki';
|
||||
winOpen(url5);
|
||||
};
|
||||
|
||||
function telegrampage()
|
||||
{
|
||||
url6='https://t.me/ctcgfw_openwrt_discuss';
|
||||
winOpen(url6);
|
||||
};
|
||||
|
||||
function sponsorpage()
|
||||
{
|
||||
url7='https://ko-fi.com/vernesong';
|
||||
winOpen(url7);
|
||||
};
|
||||
|
||||
function logo_check(imgobj,imgSrc,imgNewSrc)
|
||||
{
|
||||
var newimg = new Image();
|
||||
newimg.src = imgNewSrc;
|
||||
newimg.onload = function() {
|
||||
imgobj.src = imgNewSrc;
|
||||
imgobj.loading = "lazy";
|
||||
imgobj.onload = function() {};
|
||||
};
|
||||
newimg.onerror = function() {
|
||||
imgobj.onload = function() {};
|
||||
imgerrorfuns(imgobj,imgSrc);
|
||||
};
|
||||
};
|
||||
|
||||
function clashversion_check()
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "lastversion")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.lastversion != "" )
|
||||
{
|
||||
clashversion.innerHTML = '<img id="lastver" src="'+status.lastversion+'" alt="lastversion" onerror="return clashversion_error()" onclick="return go_update()">';
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function clashversion_error()
|
||||
{
|
||||
clashversion.innerHTML = '<img id="clashversion" src="/luci-static/resources/openclash/img/version.svg?<%=random%>" alt="currentversion" height="21px" onclick="return go_update()">';
|
||||
};
|
||||
|
||||
function logo_error(imgobj,imgSrc)
|
||||
{
|
||||
imgobj.src=imgSrc;
|
||||
};
|
||||
|
||||
function imgerrorfuns(imgobj,imgSrc){
|
||||
setTimeout(function(){
|
||||
imgobj.src = imgSrc;
|
||||
imgobj.loading = "lazy";
|
||||
},1000*10);
|
||||
};
|
||||
|
||||
function go_update()
|
||||
{
|
||||
url4='https://github.com/vernesong/OpenClash/releases';
|
||||
winOpen(url4);
|
||||
};
|
||||
|
||||
function check_core()
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "check_core")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.core_status != "1" )
|
||||
{
|
||||
var r = confirm("<%:You have not installed the core yet, do you want to download and install it now?%>")
|
||||
if (r == true) {
|
||||
return select_git_cdn("core_download");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
//]]></script>
|
||||
|
@ -1,148 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<style>
|
||||
.sub_tab{
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
margin: 0 auto;
|
||||
opacity: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.sub_tab_show{
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
color: var(--gray-dark);
|
||||
font-size: 12px;
|
||||
margin: 0 auto;
|
||||
-webkit-transition: all 1.5s;
|
||||
-moz-transition: all 1.5s;
|
||||
-ms-transition: all 1.5s;
|
||||
-o-transition: all 1.5s;
|
||||
transition: all 1s;
|
||||
opacity: 1;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.sub_setting{
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
margin: 0 auto;
|
||||
opacity: 1;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.sub_div{
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<%
|
||||
local fs = require "luci.openclash"
|
||||
local val = self:cfgvalue(section)
|
||||
local filename = fs.filename(val)
|
||||
local idname = math.random(1000)..(string.match(filename, "[%w_]+") or "")
|
||||
%>
|
||||
<div class="sub_div"><span id='<%=idname%>' class="sub_tab"></span> <span class="sub_setting"><img src='/luci-static/resources/openclash/img/arrow-clockwise-light.svg' height="20px" title='<%:Refresh%>' alt='<%:Refresh%>' onclick='return sub_info_refresh_<%=idname%>(this)'></span> <span class="sub_setting"><img src='/luci-static/resources/openclash/img/wrench-light.svg' height="20px" title='<%:Specify URL%>' alt='<%:Specify URL%>' onclick='return set_subinfo_url_<%=idname%>(this,"<%=filename%>")'></span></div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
var retry_<%=idname%> = 0;
|
||||
var s_<%=idname%>;
|
||||
sub_info_get_<%=idname%>();
|
||||
|
||||
function progressbar_<%=idname%>(v, m, pc, np, f, t, tr) {
|
||||
return String.format(
|
||||
'<div style="width:250px; max-width:500px; position:relative; border:1px solid #999999; border-radius: 6px">' +
|
||||
(pc >= 50 ? '<div style="background-color:#9edd9e; width:%d%%; height:36px; border-radius: 6px">' : (pc < 50 && pc >= 20 ? '<div style="background-color:#ffc99f; width:%d%%; height:35px">' : '<div style="background-color:#ffb9b9; width:%d%%; height:35px">')) +
|
||||
'<div style="position:absolute; left:0;' + (tr == "null" ? 'top:12px;' : 'top:0;') + 'text-align:center; width:100%%">' +
|
||||
'<small>%s '+ (f ? f : '/') +' %s ' + (np ? "" : '(%s%%)') + (tr == "null" ? '<div style="visibility: hidden;">' : '<div style="visibility: visible;">') + '%s (<%:Remaining%> %s <%:days%>)</small>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>', pc, v, m, pc, t, tr
|
||||
);
|
||||
};
|
||||
|
||||
function sub_info_refresh_<%=idname%>()
|
||||
{
|
||||
if (s_<%=idname%>) { clearTimeout(s_<%=idname%>);};
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "sub_info_get")%>', {filename: "<%=filename%>"}, function(x, status) {
|
||||
if (x && x.status == 200 && status.sub_info != "" && status.sub_info != "No Sub Info Found") {
|
||||
retry_<%=idname%> = 0;
|
||||
localStorage.setItem("<%=filename%>",JSON.stringify(status));
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
document.getElementById('<%=idname%>').innerHTML = progressbar_<%=idname%>((status.surplus ? status.surplus : status.used), (status.total), (status.percent), false, false, (status.expire), (status.day_left));
|
||||
}
|
||||
else if ( x && x.status == 200 && status.sub_info == "No Sub Info Found" ) {
|
||||
retry_<%=idname%> = 0;
|
||||
localStorage.setItem("<%=filename%>",JSON.stringify(status));
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>";
|
||||
}
|
||||
else {
|
||||
if (document.getElementById('<%=idname%>').innerHTML == "" || retry_<%=idname%> > 2) {
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
document.getElementById('<%=idname%>').innerHTML = "<span style=color:red><%:Sub Info Get Error%></span>";
|
||||
}
|
||||
if (retry_<%=idname%> > 2) {
|
||||
retry_<%=idname%> = 0;
|
||||
localStorage.removeItem("<%=filename%>");
|
||||
}
|
||||
else {
|
||||
retry_<%=idname%> ++;
|
||||
s_<%=idname%> = setTimeout("sub_info_refresh_<%=idname%>()",1000*120);
|
||||
return
|
||||
}
|
||||
|
||||
};
|
||||
s_<%=idname%> = setTimeout("sub_info_refresh_<%=idname%>()",1000*1800);
|
||||
});
|
||||
};
|
||||
|
||||
function sub_info_get_<%=idname%>()
|
||||
{
|
||||
if (localStorage.getItem("<%=filename%>")) {
|
||||
var save_info = JSON.parse(localStorage.getItem("<%=filename%>"));
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
if (save_info.sub_info == "No Sub Info Found") {
|
||||
document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>";
|
||||
}
|
||||
else {
|
||||
document.getElementById('<%=idname%>').innerHTML = progressbar_<%=idname%>((save_info.surplus ? save_info.surplus : save_info.used), (save_info.total), (save_info.percent ? save_info.percent : 0), false, false, (save_info.expire), (save_info.day_left ? save_info.day_left : 0));
|
||||
}
|
||||
}
|
||||
else {
|
||||
sub_info_refresh_<%=idname%>();
|
||||
};
|
||||
s_<%=idname%> = setTimeout("sub_info_refresh_<%=idname%>()",1000*30);
|
||||
};
|
||||
|
||||
function set_subinfo_url_<%=idname%>(btn, filename) {
|
||||
var new_url = prompt("<%:Paste the new url of subscribe infos sources here:%>", "");
|
||||
if (filename == null || filename == "") {
|
||||
return false;
|
||||
}
|
||||
if (new_url == null) {
|
||||
return false;
|
||||
}
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "set_subinfo_url")%>', {filename: filename, url: new_url}, function(x, status) {
|
||||
if (x && x.status == 200 && status.info == "Success")
|
||||
{
|
||||
sub_info_refresh_<%=idname%>();
|
||||
alert("<%:Specify subscribe infos sources url successfully!%>");
|
||||
}
|
||||
else if (x && x.status == 200 && status.info == "Delete success")
|
||||
{
|
||||
sub_info_refresh_<%=idname%>();
|
||||
alert("<%:Delete Specify Subscribe infos sources url successfully!%>");
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("<%:Specify subscribe infos sources url failed:%>\n" + status.info);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//]]></script>
|
||||
<%+cbi/valuefooter%>
|
@ -1,81 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<div class="cbi-value-field" id="switch_dashboard_<%=self.option%>">
|
||||
<%:Collecting data...%>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var btn_type_<%=self.option%> = "<%=self.option%>";
|
||||
var switch_dashboard_<%=self.option%> = document.getElementById('switch_dashboard_<%=self.option%>');
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dashboard_type")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( btn_type_<%=self.option%> == "Dashboard" ) {
|
||||
if ( status.dashboard_type == "Meta" ) {
|
||||
switch_dashboard_<%=self.option%>.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch To Official Version%>" onclick="return switch_dashboard(this, btn_type_<%=self.option%>, \'Official\')"/>';
|
||||
}
|
||||
else {
|
||||
switch_dashboard_<%=self.option%>.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch To Meta Version%>" onclick="return switch_dashboard(this, btn_type_<%=self.option%>, \'Meta\')"/>';
|
||||
}
|
||||
}
|
||||
if ( btn_type_<%=self.option%> == "Yacd" ) {
|
||||
if ( status.yacd_type == "Meta" ) {
|
||||
switch_dashboard_<%=self.option%>.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch To Official Version%>" onclick="return switch_dashboard(this, btn_type_<%=self.option%>, \'Official\')"/>';
|
||||
}
|
||||
else {
|
||||
switch_dashboard_<%=self.option%>.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch To Meta Version%>" onclick="return switch_dashboard(this, btn_type_<%=self.option%>, \'Meta\')"/>';
|
||||
}
|
||||
}
|
||||
if ( btn_type_<%=self.option%> == "Metacubexd" ) {
|
||||
switch_dashboard_<%=self.option%>.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Update Metacubexd Version%>" onclick="return switch_dashboard(this, btn_type_<%=self.option%>, \'Official\')"/>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function switch_dashboard(btn, name, type)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Downloading File...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_dashboard")%>', {name: name, type : type}, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.download_state == "1" ) {
|
||||
if ( type == "Meta" ) {
|
||||
if ( name == "Dashboard" ) {
|
||||
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch Successful%> - <%:Switch To Official Version%>" onclick="return switch_dashboard(this, \'Dashboard\', \'Official\')"/>';
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch Successful%> - <%:Switch To Official Version%>" onclick="return switch_dashboard(this, \'Yacd\', \'Official\')"/>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ( name == "Dashboard" ) {
|
||||
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch Successful%> - <%:Switch To Meta Version%>" onclick="return switch_dashboard(this, \'Dashboard\', \'Meta\')"/>';
|
||||
}
|
||||
else if ( name == "Yacd" )
|
||||
{
|
||||
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch Successful%> - <%:Switch To Meta Version%>" onclick="return switch_dashboard(this, \'Yacd\', \'Meta\')"/>';
|
||||
}
|
||||
else{
|
||||
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Update Successful%> - <%:Update Metacubexd Version%>" onclick="return switch_dashboard(this, \'Metacubexd\', \'Official\')"/>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( status.download_state == "2" ) {
|
||||
btn.value = '<%:Unzip Error%>';
|
||||
}
|
||||
else {
|
||||
if ( name == "Metacubexd" ) {
|
||||
btn.value = '<%:Update Failed%>';
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Switch Failed%>';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
//]]></script>
|
||||
|
||||
<%+cbi/valuefooter%>
|
@ -1,45 +0,0 @@
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center" id="switch_mode">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var switch_mode = document.getElementById('switch_mode');
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "op_mode")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.op_mode == "redir-host" ) {
|
||||
switch_mode.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch page to Fake-IP mode%>" onclick="return switch_modes(this)"/>';
|
||||
}
|
||||
else {
|
||||
switch_mode.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch page to Redir-Host mode%>" onclick="return switch_modes(this)"/>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function switch_modes(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_mode")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.switch_mode == "redir-host" ) {
|
||||
alert('<%:Page has been switched to Fake-IP mode!%>')
|
||||
window.location.href='<%="settings"%>';
|
||||
}
|
||||
else {
|
||||
alert('<%:Page has been switched to Redir-Host mode!%>')
|
||||
window.location.href='<%="settings"%>';
|
||||
}
|
||||
}
|
||||
});
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
//]]></script>
|
||||
|
@ -1,375 +0,0 @@
|
||||
<%-
|
||||
local rowcnt = 1
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
local fs = require "luci.openclash"
|
||||
|
||||
function rowstyle()
|
||||
rowcnt = rowcnt + 1
|
||||
return (rowcnt % 2) + 1
|
||||
end
|
||||
|
||||
function width(o)
|
||||
if o.width then
|
||||
if type(o.width) == 'number' then
|
||||
return ' style="width:%dpx"' % o.width
|
||||
end
|
||||
return ' style="width:%s"' % o.width
|
||||
end
|
||||
return ''
|
||||
end
|
||||
|
||||
function table_include(table, value)
|
||||
if table == nil then
|
||||
return false
|
||||
end
|
||||
|
||||
for k, v in pairs(table) do
|
||||
if v == value then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local head_width
|
||||
local a={}
|
||||
local e={}
|
||||
for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(o)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(o)
|
||||
end
|
||||
end
|
||||
|
||||
if not table_include(e, "all") then
|
||||
table.insert(e, 1, {name="all"})
|
||||
end
|
||||
|
||||
if #e > 4 then
|
||||
head_width = (95 / #e).."%"
|
||||
else
|
||||
head_width = "120px"
|
||||
end
|
||||
|
||||
local cfg_name
|
||||
if uci:get("openclash", "config", "config_path") then
|
||||
cfg_name = fs.basename(uci:get("openclash", "config", "config_path"))
|
||||
end
|
||||
|
||||
local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]+") or "self.sectiontype"
|
||||
-%>
|
||||
|
||||
<style type="text/css">
|
||||
*{margin: 0;padding: 0;}
|
||||
|
||||
ul{
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%>{
|
||||
min-height: 35px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul{
|
||||
left: -1px;
|
||||
width: 100%;
|
||||
padding: unset !important;
|
||||
margin: unset !important;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li{
|
||||
float: left;
|
||||
width: <%=head_width%>;
|
||||
line-height: 35px;
|
||||
padding: 0 1px;
|
||||
border-right: 1px solid #dddddd;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a{
|
||||
float: unset !important;
|
||||
padding: unset !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab > a{
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a:hover{
|
||||
color: orangered;
|
||||
}
|
||||
|
||||
#tab-content .dom-<%=self.config%>-<%=self.sectiontype%>{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tab-content .dom-<%=self.config%>-<%=self.sectiontype%> ul li{
|
||||
float: left;
|
||||
margin: 15px 10px;
|
||||
width: 225px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- tblsection -->
|
||||
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
|
||||
<% if self.title and #self.title > 0 then -%>
|
||||
<legend><%=self.title%></legend>
|
||||
<%- end %>
|
||||
<%- if self.sortable then -%>
|
||||
<input type="hidden" id="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" name="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" value="" />
|
||||
<%- end -%>
|
||||
<div class="cbi-section-descr"><%=self.description%></div>
|
||||
<%- local count = 0 -%>
|
||||
<div id="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tabmenu">
|
||||
<ul class="cbi-tabmenu">
|
||||
<%-
|
||||
if #e ~= 1 then
|
||||
for t,o in ipairs(e)do
|
||||
if o.name == cfg_name and cfg_name then
|
||||
-%>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a><%=o.name%></a></li>
|
||||
<%- elseif not cfg_name and o.name == "all" then -%>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a>ALL</a></li>
|
||||
<%- elseif o.name == "all" then -%>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled"><a>ALL</a></li>
|
||||
<%- else -%>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled"><a><%=o.name%></a></li>
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
<%- else -%>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a>ALL</a></li>
|
||||
<%- end -%>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="tab-content">
|
||||
<%- for t,o in ipairs(e)do
|
||||
if #e ~= 1 and o.name == cfg_name and cfg_name then
|
||||
-%>
|
||||
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
|
||||
<%- elseif #e ~= 1 and o.name == "all" and not cfg_name then -%>
|
||||
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
|
||||
<%- elseif #e == 1 then -%>
|
||||
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
|
||||
<%- else -%>
|
||||
<div class="dom-<%=self.config%>-<%=self.sectiontype%>">
|
||||
<%- end -%>
|
||||
<table class="cbi-section-table">
|
||||
<tr class="cbi-section-table-titles">
|
||||
<%- if not self.anonymous then -%>
|
||||
<%- if self.sectionhead then -%>
|
||||
<th class="cbi-section-table-cell"><%=self.sectionhead%></th>
|
||||
<%- else -%>
|
||||
<th> </th>
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
<%- for i, k in pairs(self.children) do if not k.optional then -%>
|
||||
<%- if i == 1 then -%>
|
||||
<th class="cbi-section-table-cell"><%:Serial Number%></th>
|
||||
<%- end -%>
|
||||
<th class="cbi-section-table-cell"<%=width(k)%>>
|
||||
<%- if k.titleref then -%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=k.titleref%>"><%- end -%>
|
||||
<%-=k.title-%>
|
||||
<%- if k.titleref then -%></a><%- end -%>
|
||||
</th>
|
||||
<%- count = count + 1; end; end; if self.sortable then -%>
|
||||
<th class="cbi-section-table-cell"><%:Sort%></th>
|
||||
<%- end; if self.extedit or self.addremove then -%>
|
||||
<th class="cbi-section-table-cell"> </th>
|
||||
<%- count = count + 1; end -%>
|
||||
</tr>
|
||||
<tr class="cbi-section-table-descr">
|
||||
<%- if not self.anonymous then -%>
|
||||
<%- if self.sectiondesc then -%>
|
||||
<th class="cbi-section-table-cell"><%=self.sectiondesc%></th>
|
||||
<%- else -%>
|
||||
<th></th>
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
<%- for i, k in pairs(self.children) do if not k.optional then -%>
|
||||
<th class="cbi-section-table-cell"<%=width(k)%>><%=k.description%></th>
|
||||
<%- end; end; if self.sortable then -%>
|
||||
<th class="cbi-section-table-cell"></th>
|
||||
<%- end; if self.extedit or self.addremove then -%>
|
||||
<th class="cbi-section-table-cell"></th>
|
||||
<%- end -%>
|
||||
</tr>
|
||||
<%- local isempty = true
|
||||
local num = 1
|
||||
for i, k in ipairs(self:cfgsections()) do
|
||||
section = k
|
||||
while true do
|
||||
if not uci:get("openclash", section, "config") then
|
||||
uci:set("openclash", section, "config", "all")
|
||||
uci:save("openclash")
|
||||
end
|
||||
if uci:get("openclash", section, "config") ~= o.name then
|
||||
break
|
||||
end
|
||||
isempty = false
|
||||
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
|
||||
-%>
|
||||
<tr class="cbi-section-table-row<% if self.extedit or self.rowcolors then %> cbi-rowstyle-<%=rowstyle()%><% end %>" id="cbi-<%=self.config%>-<%=section%>">
|
||||
<% if not self.anonymous then -%>
|
||||
<th><h3><%=(type(self.sectiontitle) == "function") and self:sectiontitle(section) or k%></h3></th>
|
||||
<%- end %>
|
||||
<td class="cbi-section-table-cell">
|
||||
<p><%=num%></p>
|
||||
<% num = num + 1 -%>
|
||||
</td>
|
||||
<%-
|
||||
for k, node in ipairs(self.children) do
|
||||
if not node.optional then
|
||||
node:render(section, scope or {})
|
||||
end
|
||||
end
|
||||
-%>
|
||||
<%- if self.sortable then -%>
|
||||
<td class="cbi-section-table-cell">
|
||||
<input class="cbi-button cbi-button-up" type="button" value="<%:∧%>" onclick="return cbi_row_swap(this, true, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move up%>" title="<%:Move up%>" />
|
||||
<input class="cbi-button cbi-button-down" type="button" value="<%:∨%>" onclick="return cbi_row_swap(this, false, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move down%>" title="<%:Move down%>" />
|
||||
</td>
|
||||
<%- end -%>
|
||||
|
||||
<%- if self.extedit or self.addremove then -%>
|
||||
<td class="cbi-section-table-cell">
|
||||
<%- if self.extedit then -%>
|
||||
<input class="btn cbi-button cbi-button-edit" type="button" value="<%:Edit%>"
|
||||
<%- if type(self.extedit) == "string" then
|
||||
%> onclick="location.href='<%=self.extedit:format(section)%>';return switch_to_tab<%=sectiontype%>()"
|
||||
<%- elseif type(self.extedit) == "function" then
|
||||
%> onclick="location.href='<%=self:extedit(section)%>';return switch_to_tab<%=sectiontype%>()"
|
||||
<%- end
|
||||
%> alt="<%:Edit%>" title="<%:Edit%>" />
|
||||
<%- end; if self.addremove then %>
|
||||
<input class="btn cbi-button cbi-button-remove" type="submit" value="<%:Delete%>" onclick="this.form.cbi_state='del-section'; return switch_to_tab<%=sectiontype%>()" name="cbi.rts.<%=self.config%>.<%=k%>" alt="<%:Delete%>" title="<%:Delete%>" />
|
||||
<%- end -%>
|
||||
</td>
|
||||
<%- end -%>
|
||||
<%-
|
||||
break
|
||||
end
|
||||
-%>
|
||||
</tr>
|
||||
<%- end -%>
|
||||
|
||||
<%- if isempty then -%>
|
||||
<tr class="cbi-section-table-row">
|
||||
<td colspan="<%=count%>"><em><br /><%:This section contains no values yet%></em></td>
|
||||
</tr>
|
||||
<%- end -%>
|
||||
</table>
|
||||
|
||||
<% if self.error then %>
|
||||
<div class="cbi-section-error">
|
||||
<ul><% for _, c in pairs(self.error) do for _, e in ipairs(c) do -%>
|
||||
<li><%=pcdata(e):gsub("\n","<br />")%></li>
|
||||
<%- end end %></ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%- if self.addremove then -%>
|
||||
<% if self.template_addremove then include(self.template_addremove) else -%>
|
||||
<div class="cbi-section-create cbi-tblsection-create">
|
||||
<% if self.anonymous then %>
|
||||
<input class="btn cbi-button cbi-button-add" type="submit" onclick="return switch_to_tab<%=sectiontype%>('create')" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" title="<%:Add%>" />
|
||||
<% else %>
|
||||
<% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
|
||||
<input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" data-type="uciname" data-optional="true" />
|
||||
<input class="btn cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
|
||||
<% if self.invalid_cts then -%>
|
||||
<br /><%:Invalid%></div>
|
||||
<%- end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%- end %>
|
||||
<%- end -%>
|
||||
</div>
|
||||
<%- end -%>
|
||||
</div>
|
||||
</fieldset>
|
||||
<!-- /tblsection -->
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
window.addEventListener('load', onload<%=sectiontype%>, false);
|
||||
|
||||
var titles<%=sectiontype%> = document.getElementsByName('tab-header-<%=self.config%>-<%=self.sectiontype%>');
|
||||
var divs<%=sectiontype%> = document.getElementsByClassName('dom-<%=self.config%>-<%=self.sectiontype%>');
|
||||
|
||||
function switch_to_tab<%=sectiontype%>(type){
|
||||
|
||||
if(titles<%=sectiontype%>.length != divs<%=sectiontype%>.length) return;
|
||||
|
||||
if ( type == 'create' ) {
|
||||
for(var j=0; j < titles<%=sectiontype%>.length; j++){
|
||||
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
|
||||
divs<%=sectiontype%>[j].style.display = 'none';
|
||||
};
|
||||
titles<%=sectiontype%>[0].className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[0].style.display = 'block';
|
||||
localStorage.setItem("titles<%=sectiontype%>",0);
|
||||
};
|
||||
|
||||
localStorage.setItem("id<%=sectiontype%>",'cbi-<%=self.config%>-<%=self.sectiontype%>');
|
||||
return true;
|
||||
};
|
||||
|
||||
function onload<%=sectiontype%>() {
|
||||
|
||||
if(titles<%=sectiontype%>.length != divs<%=sectiontype%>.length) return;
|
||||
|
||||
if (localStorage.getItem("id<%=sectiontype%>")) {
|
||||
if (document.getElementById(localStorage.getItem("id<%=sectiontype%>"))) {
|
||||
document.getElementById(localStorage.getItem("id<%=sectiontype%>")).scrollIntoView();
|
||||
};
|
||||
localStorage.removeItem("id<%=sectiontype%>");
|
||||
};
|
||||
|
||||
if (localStorage.getItem("titles<%=sectiontype%>")) {
|
||||
if (titles<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")]) {
|
||||
for(var j=0; j < titles<%=sectiontype%>.length; j++){
|
||||
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
|
||||
divs<%=sectiontype%>[j].style.display = 'none';
|
||||
};
|
||||
titles<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")].className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")].style.display = 'block';
|
||||
};
|
||||
localStorage.removeItem("titles<%=sectiontype%>");
|
||||
};
|
||||
|
||||
for(var i=0; i < titles<%=sectiontype%>.length; i++){
|
||||
var li<%=sectiontype%> = titles<%=sectiontype%>[i];
|
||||
li<%=sectiontype%>.id = i;
|
||||
|
||||
li<%=sectiontype%>.onclick = function(){
|
||||
for(var j=0; j < titles<%=sectiontype%>.length; j++){
|
||||
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
|
||||
divs<%=sectiontype%>[j].style.display = 'none';
|
||||
};
|
||||
this.className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[this.id].style.display = 'block';
|
||||
localStorage.setItem("titles<%=sectiontype%>",this.id);
|
||||
};
|
||||
|
||||
li<%=sectiontype%>.onTouchStart = function(){
|
||||
for(var j=0; j < titles<%=sectiontype%>.length; j++){
|
||||
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
|
||||
divs<%=sectiontype%>[j].style.display = 'none';
|
||||
};
|
||||
this.className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[this.id].style.display = 'block';
|
||||
localStorage.setItem("titles<%=sectiontype%>",this.id);
|
||||
};
|
||||
};
|
||||
};
|
||||
//]]>
|
||||
</script>
|
@ -1,320 +0,0 @@
|
||||
<%-
|
||||
local rowcnt = 1
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
local fs = require "luci.openclash"
|
||||
|
||||
function rowstyle()
|
||||
rowcnt = rowcnt + 1
|
||||
return (rowcnt % 2) + 1
|
||||
end
|
||||
|
||||
function width(o)
|
||||
if o.width then
|
||||
if type(o.width) == 'number' then
|
||||
return ' style="width:%dpx"' % o.width
|
||||
end
|
||||
return ' style="width:%s"' % o.width
|
||||
end
|
||||
return ''
|
||||
end
|
||||
|
||||
local head_width
|
||||
local e={}
|
||||
table.insert(e, {group="nameserver"})
|
||||
table.insert(e, {group="fallback"})
|
||||
table.insert(e, {group="default"})
|
||||
|
||||
local sectiontype = "_"..self.config.."_"..string.match(self.sectiontype, "[%w_]+") or "self.sectiontype"
|
||||
-%>
|
||||
|
||||
<style type="text/css">
|
||||
*{margin: 0;padding: 0;}
|
||||
|
||||
ul{
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%>{
|
||||
min-height: 35px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul{
|
||||
left: -1px;
|
||||
width: 100%;
|
||||
padding: unset !important;
|
||||
margin: unset !important;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li{
|
||||
float: left;
|
||||
width: 160px;
|
||||
line-height: 35px;
|
||||
padding: 0 1px;
|
||||
border-right: 1px solid #dddddd;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a{
|
||||
float: unset !important;
|
||||
padding: unset !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li.cbi-tab > a{
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
#tab-header-<%=self.config%>-<%=self.sectiontype%> ul li a:hover{
|
||||
color: orangered;
|
||||
}
|
||||
|
||||
#tab-content .dom-<%=self.config%>-<%=self.sectiontype%>{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tab-content .dom-<%=self.config%>-<%=self.sectiontype%> ul li{
|
||||
float: left;
|
||||
margin: 15px 10px;
|
||||
width: 225px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- tblsection -->
|
||||
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
|
||||
<% if self.title and #self.title > 0 then -%>
|
||||
<legend><%=self.title%></legend>
|
||||
<%- end %>
|
||||
<%- if self.sortable then -%>
|
||||
<input type="hidden" id="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" name="cbi.sts.<%=self.config%>.<%=self.sectiontype%>" value="" />
|
||||
<%- end -%>
|
||||
<div class="cbi-section-descr"><%=self.description%></div>
|
||||
<%- local count = 0 -%>
|
||||
<div id="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tabmenu">
|
||||
<ul class="cbi-tabmenu">
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab"><a>NameServer</a></li>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled"><a>FallBack</a></li>
|
||||
<li name="tab-header-<%=self.config%>-<%=self.sectiontype%>" class="cbi-tab-disabled"><a>Default-NameServer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="tab-content">
|
||||
<%- for t,o in ipairs(e)do
|
||||
if o.group == "nameserver" then
|
||||
-%>
|
||||
<div class="dom-<%=self.config%>-<%=self.sectiontype%>" style="display: block;">
|
||||
<%- else -%>
|
||||
<div class="dom-<%=self.config%>-<%=self.sectiontype%>">
|
||||
<%- end -%>
|
||||
<table class="cbi-section-table">
|
||||
<tr class="cbi-section-table-titles">
|
||||
<%- if not self.anonymous then -%>
|
||||
<%- if self.sectionhead then -%>
|
||||
<th class="cbi-section-table-cell"><%=self.sectionhead%></th>
|
||||
<%- else -%>
|
||||
<th> </th>
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
<%- for i, k in pairs(self.children) do if not k.optional then -%>
|
||||
<%- if i == 1 then -%>
|
||||
<th class="cbi-section-table-cell"><%:Serial Number%></th>
|
||||
<%- end -%>
|
||||
<th class="cbi-section-table-cell"<%=width(k)%>>
|
||||
<%- if k.titleref then -%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=k.titleref%>"><%- end -%>
|
||||
<%-=k.title-%>
|
||||
<%- if k.titleref then -%></a><%- end -%>
|
||||
</th>
|
||||
<%- count = count + 1; end; end; if self.sortable then -%>
|
||||
<th class="cbi-section-table-cell"><%:Sort%></th>
|
||||
<%- end; if self.extedit or self.addremove then -%>
|
||||
<th class="cbi-section-table-cell"> </th>
|
||||
<%- count = count + 1; end -%>
|
||||
</tr>
|
||||
<tr class="cbi-section-table-descr">
|
||||
<%- if not self.anonymous then -%>
|
||||
<%- if self.sectiondesc then -%>
|
||||
<th class="cbi-section-table-cell"><%=self.sectiondesc%></th>
|
||||
<%- else -%>
|
||||
<th></th>
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
<%- for i, k in pairs(self.children) do if not k.optional then -%>
|
||||
<th class="cbi-section-table-cell"<%=width(k)%>><%=k.description%></th>
|
||||
<%- end; end; if self.sortable then -%>
|
||||
<th class="cbi-section-table-cell"></th>
|
||||
<%- end; if self.extedit or self.addremove then -%>
|
||||
<th class="cbi-section-table-cell"></th>
|
||||
<%- end -%>
|
||||
</tr>
|
||||
<%- local isempty = true
|
||||
local num = 1
|
||||
for i, k in ipairs(self:cfgsections()) do
|
||||
section = k
|
||||
while true do
|
||||
if uci:get("openclash", section, "group") ~= o.group then
|
||||
break
|
||||
end
|
||||
isempty = false
|
||||
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
|
||||
-%>
|
||||
<tr class="cbi-section-table-row<% if self.extedit or self.rowcolors then %> cbi-rowstyle-<%=rowstyle()%><% end %>" id="cbi-<%=self.config%>-<%=section%>">
|
||||
<% if not self.anonymous then -%>
|
||||
<th><h3><%=(type(self.sectiontitle) == "function") and self:sectiontitle(section) or k%></h3></th>
|
||||
<%- end %>
|
||||
<td class="cbi-section-table-cell">
|
||||
<p><%=num%></p>
|
||||
<% num = num + 1 -%>
|
||||
</td>
|
||||
<%-
|
||||
for k, node in ipairs(self.children) do
|
||||
if not node.optional then
|
||||
node:render(section, scope or {})
|
||||
end
|
||||
end
|
||||
-%>
|
||||
<%- if self.sortable then -%>
|
||||
<td class="cbi-section-table-cell">
|
||||
<input class="cbi-button cbi-button-up" type="button" value="<%:∧%>" onclick="return cbi_row_swap(this, true, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move up%>" title="<%:Move up%>" />
|
||||
<input class="cbi-button cbi-button-down" type="button" value="<%:∨%>" onclick="return cbi_row_swap(this, false, 'cbi.sts.<%=self.config%>.<%=self.sectiontype%>')" alt="<%:Move down%>" title="<%:Move down%>" />
|
||||
</td>
|
||||
<%- end -%>
|
||||
|
||||
<%- if self.extedit or self.addremove then -%>
|
||||
<td class="cbi-section-table-cell">
|
||||
<%- if self.extedit then -%>
|
||||
<input class="btn cbi-button cbi-button-edit" type="button" value="<%:Edit%>"
|
||||
<%- if type(self.extedit) == "string" then
|
||||
%> onclick="location.href='<%=self.extedit:format(section)%>';return switch_to_tab<%=sectiontype%>()"
|
||||
<%- elseif type(self.extedit) == "function" then
|
||||
%> onclick="location.href='<%=self:extedit(section)%>';return switch_to_tab<%=sectiontype%>()"
|
||||
<%- end
|
||||
%> alt="<%:Edit%>" title="<%:Edit%>" />
|
||||
<%- end; if self.addremove then %>
|
||||
<input class="btn cbi-button cbi-button-remove" type="submit" value="<%:Delete%>" onclick="this.form.cbi_state='del-section';return switch_to_tab<%=sectiontype%>()" name="cbi.rts.<%=self.config%>.<%=k%>" alt="<%:Delete%>" title="<%:Delete%>" />
|
||||
<%- end -%>
|
||||
</td>
|
||||
<%- end -%>
|
||||
<%-
|
||||
break
|
||||
end
|
||||
-%>
|
||||
</tr>
|
||||
<%- end -%>
|
||||
|
||||
<%- if isempty then -%>
|
||||
<tr class="cbi-section-table-row">
|
||||
<td colspan="<%=count%>"><em><br /><%:This section contains no values yet%></em></td>
|
||||
</tr>
|
||||
<%- end -%>
|
||||
</table>
|
||||
|
||||
<% if self.error then %>
|
||||
<div class="cbi-section-error">
|
||||
<ul><% for _, c in pairs(self.error) do for _, e in ipairs(c) do -%>
|
||||
<li><%=pcdata(e):gsub("\n","<br />")%></li>
|
||||
<%- end end %></ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%- if self.addremove then -%>
|
||||
<% if self.template_addremove then include(self.template_addremove) else -%>
|
||||
<div class="cbi-section-create cbi-tblsection-create">
|
||||
<% if self.anonymous then %>
|
||||
<input class="btn cbi-button cbi-button-add" type="submit" onclick="return switch_to_tab<%=sectiontype%>('create')" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" title="<%:Add%>" />
|
||||
<% else %>
|
||||
<% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
|
||||
<input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" data-type="uciname" data-optional="true" />
|
||||
<input class="btn cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
|
||||
<% if self.invalid_cts then -%>
|
||||
<br /><%:Invalid%></div>
|
||||
<%- end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%- end %>
|
||||
<%- end -%>
|
||||
</div>
|
||||
<%- end -%>
|
||||
</div>
|
||||
</fieldset>
|
||||
<!-- /tblsection -->
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
window.addEventListener('load', onload<%=sectiontype%>, false);
|
||||
|
||||
var titles<%=sectiontype%> = document.getElementsByName('tab-header-<%=self.config%>-<%=self.sectiontype%>');
|
||||
var divs<%=sectiontype%> = document.getElementsByClassName('dom-<%=self.config%>-<%=self.sectiontype%>');
|
||||
|
||||
function switch_to_tab<%=sectiontype%>(type){
|
||||
|
||||
if(titles<%=sectiontype%>.length != divs<%=sectiontype%>.length) return;
|
||||
|
||||
if ( type == 'create' ) {
|
||||
for(var j=0; j < titles<%=sectiontype%>.length; j++){
|
||||
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
|
||||
divs<%=sectiontype%>[j].style.display = 'none';
|
||||
};
|
||||
titles<%=sectiontype%>[0].className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[0].style.display = 'block';
|
||||
localStorage.setItem("titles<%=sectiontype%>",0);
|
||||
};
|
||||
|
||||
localStorage.setItem("id<%=sectiontype%>",'cbi-<%=self.config%>-<%=self.sectiontype%>');
|
||||
return true;
|
||||
};
|
||||
|
||||
function onload<%=sectiontype%>() {
|
||||
|
||||
if(titles<%=sectiontype%>.length != divs<%=sectiontype%>.length) return;
|
||||
|
||||
if (localStorage.getItem("id<%=sectiontype%>")) {
|
||||
if (document.getElementById(localStorage.getItem("id<%=sectiontype%>"))) {
|
||||
document.getElementById(localStorage.getItem("id<%=sectiontype%>")).scrollIntoView();
|
||||
};
|
||||
localStorage.removeItem("id<%=sectiontype%>");
|
||||
};
|
||||
|
||||
if (localStorage.getItem("titles<%=sectiontype%>")) {
|
||||
if (titles<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")]) {
|
||||
for(var j=0; j < titles<%=sectiontype%>.length; j++){
|
||||
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
|
||||
divs<%=sectiontype%>[j].style.display = 'none';
|
||||
};
|
||||
titles<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")].className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[localStorage.getItem("titles<%=sectiontype%>")].style.display = 'block';
|
||||
};
|
||||
localStorage.removeItem("titles<%=sectiontype%>");
|
||||
};
|
||||
|
||||
for(var i=0; i < titles<%=sectiontype%>.length; i++){
|
||||
var li<%=sectiontype%> = titles<%=sectiontype%>[i];
|
||||
li<%=sectiontype%>.id = i;
|
||||
|
||||
li<%=sectiontype%>.onclick = function(){
|
||||
for(var j=0; j < titles<%=sectiontype%>.length; j++){
|
||||
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
|
||||
divs<%=sectiontype%>[j].style.display = 'none';
|
||||
};
|
||||
this.className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[this.id].style.display = 'block';
|
||||
localStorage.setItem("titles<%=sectiontype%>",this.id);
|
||||
};
|
||||
|
||||
li<%=sectiontype%>.onTouchStart = function(){
|
||||
for(var j=0; j < titles<%=sectiontype%>.length; j++){
|
||||
titles<%=sectiontype%>[j].className = 'cbi-tab-disabled';
|
||||
divs<%=sectiontype%>[j].style.display = 'none';
|
||||
};
|
||||
this.className = 'cbi-tab';
|
||||
divs<%=sectiontype%>[this.id].style.display = 'block';
|
||||
localStorage.setItem("titles<%=sectiontype%>",this.id);
|
||||
};
|
||||
};
|
||||
};
|
||||
//]]>
|
||||
</script>
|
@ -1,173 +0,0 @@
|
||||
<head>
|
||||
<style>
|
||||
|
||||
.tabs > li {
|
||||
vertical-align: middle !important;;
|
||||
}
|
||||
|
||||
.tool_label:hover {
|
||||
border-color: rgba(0, 0, 0, 0) !important;;
|
||||
background-color: unset !important;;
|
||||
color: unset !important;;
|
||||
cursor: unset !important;;
|
||||
}
|
||||
|
||||
.tool_label::after {
|
||||
border-color: rgba(0, 0, 0, 0) !important;;
|
||||
background-color: unset !important;;
|
||||
color: unset !important;;
|
||||
cursor: unset !important;;
|
||||
content: unset !important;;
|
||||
}
|
||||
|
||||
.tool_label_span {
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tool_label_select {
|
||||
width: auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<li id="tool_label" class="tool_label">
|
||||
<span class="tool_label_span">
|
||||
<%:Current Config File%>:
|
||||
<select class="tool_label_select" id="cfg_name">
|
||||
</select>
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Switch Config%>" onclick="return switch_config(this)" />
|
||||
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
var config_name = document.getElementById('cfg_name');
|
||||
var tool_label = document.getElementById('tool_label');
|
||||
var Commit = document.getElementById('cbi-table-1-Commit');
|
||||
var Apply = document.getElementById('cbi-table-1-Apply');
|
||||
var Back = document.getElementById('cbi-table-1-Back');
|
||||
var Load_Config = document.getElementById('cbi-table-1-Load_Config');
|
||||
var Delete_Unused_Servers = document.getElementById('cbi-table-1-Delete_Unused_Servers');
|
||||
var Delete_Servers = document.getElementById('cbi-table-1-Delete_Servers');
|
||||
var Delete_Proxy_Provider = document.getElementById('cbi-table-1-Delete_Proxy_Provider');
|
||||
var Delete_Groups = document.getElementById('cbi-table-1-Delete_Groups');
|
||||
var rule_mg = document.getElementById('cbi-table-1-rule_mg');
|
||||
var pro_mg = document.getElementById('cbi-table-1-pro_mg');
|
||||
|
||||
setTimeout("get_header()",100);
|
||||
|
||||
if (Commit) {
|
||||
Commit.style.textAlign="center";
|
||||
}
|
||||
if (Apply) {
|
||||
Apply.style.textAlign="center";
|
||||
}
|
||||
if (Back) {
|
||||
Back.style.textAlign="center";
|
||||
}
|
||||
if (Load_Config) {
|
||||
Load_Config.style.textAlign="center";
|
||||
Delete_Unused_Servers.style.textAlign="center";
|
||||
Delete_Servers.style.textAlign="center";
|
||||
Delete_Proxy_Provider.style.textAlign="center";
|
||||
Delete_Groups.style.textAlign="center";
|
||||
}
|
||||
if (rule_mg) {
|
||||
rule_mg.style.textAlign="center";
|
||||
pro_mg.style.textAlign="center";
|
||||
}
|
||||
|
||||
if (tool_label.style.display != "none") {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "config_name")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && status.config_name != "") {
|
||||
for(var i in status.config_name){
|
||||
config_name.options.add(new Option(status.config_name[i].name,status.config_name[i].name));
|
||||
}
|
||||
if (status.config_path != "") {
|
||||
config_name.value = status.config_path;
|
||||
}
|
||||
else
|
||||
{
|
||||
config_name.options.add(new Option("<%:Not Select%>",""));
|
||||
config_name.value = "";
|
||||
}
|
||||
}
|
||||
else if (x && x.status == 200 && status.config_path != "") {
|
||||
config_name.options.add(new Option(status.config_path,status.config_path));
|
||||
config_name.value = status.config_path;
|
||||
}
|
||||
else {
|
||||
tool_label.style.display = "none";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function get_header() {
|
||||
var header = document.getElementsByClassName("tabmenu-item-log ")[0];
|
||||
if (header) {
|
||||
insertAfter(tool_label,header);
|
||||
}
|
||||
else {
|
||||
setTimeout("get_header()",100);
|
||||
}
|
||||
}
|
||||
|
||||
function insertAfter(newElement, targetElement) {
|
||||
var parent = targetElement.parentNode;
|
||||
if (parent.lastChild == targetElement) {
|
||||
parent.appendChild(newElement, targetElement);
|
||||
}
|
||||
else {
|
||||
parent.insertBefore(newElement, targetElement.nextSibling);
|
||||
};
|
||||
};
|
||||
|
||||
function switch_config(btn)
|
||||
{
|
||||
if (config_name.value && config_name.value != "") {
|
||||
btn.disabled = true;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_config")%>', {config_name: config_name.value}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
btn.disabled = false;
|
||||
alert(' <%:Config File%>: ' + config_name.value + ' <%:switching succeeded!%>')
|
||||
window.location.href=location.pathname;
|
||||
}
|
||||
else {
|
||||
alert(' <%:Config File%>: ' + config_name.value + ' <%:switching failed!%>')
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function restore_config(btn)
|
||||
{
|
||||
btn.value = '<%:Restore Default Config%>';
|
||||
btn.disabled = true;
|
||||
var r = confirm("<%:Are you sure want to restore the default config?%>")
|
||||
if (r == true) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "restore")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
alert('<%:Restore succeeded!%>')
|
||||
window.location.href='<%="settings"%>';
|
||||
}
|
||||
else {
|
||||
alert('<%:Restore failed!%>')
|
||||
window.location.href='<%="settings"%>';
|
||||
}
|
||||
});
|
||||
}
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function winOpen(url)
|
||||
{
|
||||
var winOpen = window.open(url);
|
||||
if(winOpen == null || typeof(winOpen) == 'undefined'){
|
||||
window.location.href=url;
|
||||
}
|
||||
}
|
||||
//]]></script>
|
@ -1,492 +0,0 @@
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center" id="update_tip">
|
||||
<b><%:Note: if the update fails, you can manually download and upload%></b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%"><%:Compiled Version Selected (Auto-save when you click to update or download)%></td>
|
||||
<td width="25%" align="left"><select id="CORE_VERSION">
|
||||
<option value="linux-386"><%:linux-386%></option>
|
||||
<option value="linux-amd64"><%:linux-amd64(x86-64)%></option>
|
||||
<option value="linux-amd64-v3"><%:linux-amd64-v3(x86-64)%></option>
|
||||
<option value="linux-armv5"><%:linux-armv5%></option>
|
||||
<option value="linux-armv6"><%:linux-armv6%></option>
|
||||
<option value="linux-armv7"><%:linux-armv7%></option>
|
||||
<option value="linux-arm64"><%:linux-arm64(armv8)%></option>
|
||||
<option value="linux-loong64-abi1"><%:linux-loong64-abi1%></option>
|
||||
<option value="linux-loong64-abi2"><%:linux-loong64-abi2%></option>
|
||||
<option value="linux-riscv64"><%:linux-riscv64%></option>
|
||||
<option value="linux-s390x"><%:linux-s390x%></option>
|
||||
<option value="linux-mips-hardfloat"><%:linux-mips-hardfloat%></option>
|
||||
<option value="linux-mips-softfloat"><%:linux-mips-softfloat%></option>
|
||||
<option value="linux-mips64"><%:linux-mips64%></option>
|
||||
<option value="linux-mips64le"><%:linux-mips64le%></option>
|
||||
<option value="linux-mipsle-softfloat"><%:linux-mipsle-softfloat%></option>
|
||||
<option value="linux-mipsle-hardfloat"><%:linux-mipsle-hardfloat%></option>
|
||||
<option value="0"><%:Not Set%></option>
|
||||
</select></td>
|
||||
<td width="25%"><%:Release Branch Selected (Auto-save when you click to update or download)%></td>
|
||||
<td width="25%" align="left"><select id="RELEASE_BRANCH">
|
||||
<option value="master">Master</option>
|
||||
<option value="dev">Developer</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%"><%:CPU Architecture%></td><td width="25%" align="left" id="CPU_MODEL"><%:Collecting data...%></td>
|
||||
<td width="25%"><%:Last Check Update%></td><td width="25%" align="left" id="CHECKTIME"><%:Collecting data...%></td>
|
||||
</tr>
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center">
|
||||
<b><%:Core path:%>/etc/openclash/core/clash_meta</b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%">[Meta] <%:Current Core%></td><td width="25%" align="left" id="CORE_META_CV"><%:Collecting data...%></td><td width="25%">[Meta] <%:Latest Core%></td><td width="25%" align="left" id="CORE_META_LV"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Update Core%></td><td width="25%" align="left" id="core_meta_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Core%></td><td width="25%" align="left" id="ma_core_meta_up"><%:Collecting data...%></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center">
|
||||
<b><%:Client Update%></b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%"><%:Current Client%></td><td width="25%" align="left" id="OP_CV"><%:Collecting data...%></td><td width="25%"><%:Latest Client%></td><td width="25%" align="left" id="OP_LV"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Update Client%></td><td width="25%" align="left" id="op_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Client%></td><td width="25%" align="left" id="ma_op_up"><%:Collecting data...%></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="25%">
|
||||
<p align="center" id="restore">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="remove_core">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="one_key_update_cdn">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="one_key_update">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center">
|
||||
<b><%:Backup Section%></b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup_ex_core">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup_core_only">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup_config_only">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup_rule_only">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup_proxy_only">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var core_version = document.getElementById('CORE_VERSION');
|
||||
var checktime = document.getElementById('CHECKTIME');
|
||||
var cpu_model = document.getElementById('CPU_MODEL');
|
||||
var core_meta_cv = document.getElementById('CORE_META_CV');
|
||||
var core_meta_lv = document.getElementById('CORE_META_LV');
|
||||
var op_cv = document.getElementById('OP_CV');
|
||||
var op_lv = document.getElementById('OP_LV');
|
||||
var core_meta_up = document.getElementById('core_meta_up');
|
||||
var op_up = document.getElementById('op_up');
|
||||
var update_tip = document.getElementById('update_tip');
|
||||
var ma_core_meta_up = document.getElementById('ma_core_meta_up');
|
||||
var ma_op_up = document.getElementById('ma_op_up');
|
||||
var restore = document.getElementById('restore');
|
||||
var backup = document.getElementById('backup');
|
||||
var backup_ex_core = document.getElementById('backup_ex_core');
|
||||
var backup_core_only = document.getElementById('backup_core_only');
|
||||
var backup_config_only = document.getElementById('backup_config_only');
|
||||
var backup_rule_only = document.getElementById('backup_rule_only');
|
||||
var backup_proxy_only = document.getElementById('backup_proxy_only');
|
||||
var one_key_update = document.getElementById('one_key_update');
|
||||
var one_key_update_cdn = document.getElementById('one_key_update_cdn');
|
||||
var remove_core = document.getElementById('remove_core');
|
||||
var release_branch = document.getElementById('RELEASE_BRANCH');
|
||||
core_meta_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return core_update(this,\'Meta\')"/>';
|
||||
op_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return op_update(this)"/>';
|
||||
ma_core_meta_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_core_update(this,\'Meta\')"/>';
|
||||
ma_op_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_op_update(this)"/>';
|
||||
restore.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Restore Default Config%>" onclick="return restore_config(this)"/>';
|
||||
one_key_update.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:One Click Check Update%>" onclick="return all_one_key_update(this)"/>';
|
||||
one_key_update_cdn.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:One Click Check Update With CDN%>" onclick="return all_one_key_update_cdn(this)"/>';
|
||||
remove_core.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Remove Core%>" onclick="return remove_all_core(this)"/>';
|
||||
backup.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup OpenClash%>" onclick="return backup_all_file(this)"/>';
|
||||
backup_ex_core.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Exclude Cores%>" onclick="return backup_no_core(this)"/>';
|
||||
backup_core_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Core%>" onclick="return backup_only_core(this)"/>';
|
||||
backup_config_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Config%>" onclick="return backup_only_config(this)"/>';
|
||||
backup_rule_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Rule Provider%>" onclick="return backup_only_rule(this)"/>';
|
||||
backup_proxy_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Proxy Provider%>" onclick="return backup_only_proxy(this)"/>';
|
||||
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_info")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.corever != "0" && status.corever != "" ) {
|
||||
core_version.value = status.corever;
|
||||
}
|
||||
else {
|
||||
core_version.value = "0";
|
||||
}
|
||||
if ( status.release_branch != "" ) {
|
||||
release_branch.value = status.release_branch;
|
||||
}
|
||||
else {
|
||||
release_branch.value = "master";
|
||||
}
|
||||
}
|
||||
else {
|
||||
core_version.value = "0";
|
||||
release_branch.value = "master";
|
||||
}
|
||||
});
|
||||
|
||||
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
cpu_model.innerHTML = status.coremodel ? "<b style=color:green>"+status.coremodel+"</b>" : "<b style=color:red><%:Model Not Found%></b>";
|
||||
if ( status.upchecktime != "1" ) {
|
||||
checktime.innerHTML = "<b style=color:green>"+status.upchecktime+"</b>";
|
||||
}
|
||||
else {
|
||||
checktime.innerHTML = "<b style=color:red><%:Check Failed%></b>";
|
||||
}
|
||||
if ( status.coremetacv == "0" ) {
|
||||
core_meta_cv.innerHTML = "<b style=color:red><%:File Not Exist%></b>";
|
||||
}
|
||||
else if (status.coremetacv != "") {
|
||||
core_meta_cv.innerHTML = "<b style=color:green>"+status.coremetacv+"</b>";
|
||||
}
|
||||
else {
|
||||
core_meta_cv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
var coremetalvis = status.corelv;
|
||||
if (coremetalvis != status.coremetacv && coremetalvis != "" && coremetalvis != "\n") {
|
||||
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+"<%:<New>%></b>";
|
||||
}
|
||||
else if (coremetalvis != "" && coremetalvis == status.coremetacv && coremetalvis != "\n") {
|
||||
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+"</b>";
|
||||
}
|
||||
else {
|
||||
core_meta_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
var oplv = status.oplv;
|
||||
var arr_op = oplv.split(",");
|
||||
var oplvis = arr_op[0];
|
||||
var new_op = arr_op[1];
|
||||
op_cv.innerHTML = status.opcv ? "<b style=color:green>"+status.opcv+"</b>" : "<b style=color:red><%:Unknown%></b>";
|
||||
if ( new_op == "2" && oplvis != "" && oplvis != "\n") {
|
||||
op_lv.innerHTML = "<b style=color:green>"+oplvis+"<%:<New>%></b>";
|
||||
}
|
||||
else if (oplvis != "" && oplvis != "\n") {
|
||||
op_lv.innerHTML = "<b style=color:green>"+oplvis+"</b>";
|
||||
}
|
||||
else {
|
||||
op_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
XHR.poll(7, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', status.startlog, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.startlog == "\n" || status.startlog == "" ) {
|
||||
var rdmdl=Math.floor(Math.random()*2)+1;
|
||||
if(rdmdl==1)
|
||||
{
|
||||
update_tip.innerHTML = '<b><font><%:Note: if the update fails, you can manually download and upload%></font></b>';
|
||||
}
|
||||
if(rdmdl==2)
|
||||
{
|
||||
update_tip.innerHTML = '<b><font><%:Note: the client may not support update, because the firmware with squashfs format will not release flash space after updating%></font></b>';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.startlog.match("level=fatal") || status.startlog.indexOf("FTL [Config]") != "-1" ) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {});
|
||||
if ( status.startlog.match("level=fatal") ) {
|
||||
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('msg=')[1]);
|
||||
}
|
||||
else {
|
||||
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('FTL [Config] ')[1]);
|
||||
};
|
||||
}
|
||||
else if ( status.startlog != "\n" && status.startlog != "" ) {
|
||||
if ( status.startlog.match("Tip:") || status.startlog.match("提示:")) {
|
||||
update_tip.innerHTML = '<b style=color:#ff6f00>'+status.startlog+'</b>';
|
||||
}
|
||||
else if ( status.startlog.match("Error:") || status.startlog.match("错误:")) {
|
||||
update_tip.innerHTML = '<b style=color:#FF0000>'+status.startlog+'</b>';
|
||||
}
|
||||
else if ( status.startlog.match("Warning:") || status.startlog.match("警告:")) {
|
||||
update_tip.innerHTML = '<b style=color:#ff00bb>'+status.startlog+'</b>';
|
||||
}
|
||||
else if ( status.startlog.match("Watchdog:") || status.startlog.match("守护程序:")) {
|
||||
update_tip.innerHTML = '<b style=color:#b300ff>'+status.startlog+'</b>';
|
||||
}
|
||||
else {
|
||||
update_tip.innerHTML = '<b style=color:green>'+status.startlog+'</b>';
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
function core_update(btn,type)
|
||||
{
|
||||
var v = core_version.value;
|
||||
var r = release_branch.value;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "coreupdate")%>', {core_type: type}, function(x, status) {
|
||||
btn.value = '<%:Check And Update%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function op_update(btn)
|
||||
{
|
||||
var r = release_branch.value;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "opupdate")%>', null, function(x, status) {
|
||||
btn.value = '<%:Check And Update%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ma_core_update(btn,type)
|
||||
{
|
||||
var v = core_version.value;
|
||||
var r = release_branch.value;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
btn.value = '<%:Download%>';
|
||||
btn.disabled = false;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_ma")%>', status.corever, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.corever != "0" ) {
|
||||
if (type == "Meta") {
|
||||
url4='https://raw.githubusercontent.com/vernesong/OpenClash/core/'+r+'/meta/clash-'+status.corever+'.tar.gz';
|
||||
window.location.href=url4;
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert('<%:No Compiled Version is Selected, Please Select on The Top and Try Again!%>')
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ma_op_update(btn)
|
||||
{
|
||||
btn.value = '<%:Download%>';
|
||||
btn.disabled = false;
|
||||
var r = release_branch.value;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_ma")%>', status.oplv, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
var oplv = status.oplv;
|
||||
var oplvis = oplv.substring(oplv.indexOf("v") + 1,oplv.indexOf(","));
|
||||
if ( oplvis != "" ) {
|
||||
url2='https://raw.githubusercontent.com/vernesong/OpenClash/package/'+r+'/luci-app-openclash_'+oplvis+'_all.ipk';
|
||||
window.location.href=url2;
|
||||
}
|
||||
else {
|
||||
alert('<%:Failed to get the latest version. Please try again later!%>')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function remove_all_core(btn)
|
||||
{
|
||||
btn.value = '<%:Remove Core%>';
|
||||
btn.disabled = true;
|
||||
var r = confirm("<%:Are you sure want to remove all core files?%>")
|
||||
if (r == true) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "remove_all_core")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
alert('<%:Remove succeeded!%>')
|
||||
window.location.href='<%="settings?tab.openclash.config=version_update"%>';
|
||||
}
|
||||
else {
|
||||
alert('<%:Remove failed!%>')
|
||||
}
|
||||
});
|
||||
} else {
|
||||
}
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_all_file(btn)
|
||||
{
|
||||
btn.value = '<%:Backup OpenClash%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_no_core(btn)
|
||||
{
|
||||
btn.value = '<%:Backup Exclude Cores%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup_ex_core"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_only_core(btn)
|
||||
{
|
||||
btn.value = '<%:Backup Core%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup_only_core"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_only_config(btn)
|
||||
{
|
||||
btn.value = '<%:Backup Config%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup_only_config"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_only_rule(btn)
|
||||
{
|
||||
btn.value = '<%:Backup Rule Provider%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup_only_rule"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_only_proxy(btn)
|
||||
{
|
||||
btn.value = '<%:Backup Proxy Provider%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup_only_proxy"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function all_one_key_update(btn)
|
||||
{
|
||||
var v = core_version.value;
|
||||
var r = release_branch.value;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
btn.value = '<%:One Click Check Update%>';
|
||||
btn.disabled = true;
|
||||
var r = confirm("<%:Check and Update all Cores and OpenClash?%>")
|
||||
if (r == true) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update_check")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.corever != "0" ) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update")%>', null, function(x, status) {
|
||||
if ( x && x.status != 200 ) {
|
||||
alert('<%:Check failed, Please try again later!%>')
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
alert('<%:No Compiled Version is Selected, Please Select on The Top and Try Again!%>')
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert('<%:Check failed, Please try again later!%>')
|
||||
}
|
||||
});
|
||||
}
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function all_one_key_update_cdn(btn)
|
||||
{
|
||||
var v = core_version.value;
|
||||
var r = release_branch.value;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
btn.value = '<%:One Click Check Update With CDN%>';
|
||||
btn.disabled = true;
|
||||
var r = confirm("<%:Check and Update all Cores and OpenClash?%>");
|
||||
if (r == true) {
|
||||
btn.disabled = false;
|
||||
return select_git_cdn("one_key_update");
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//]]></script>
|
@ -1,28 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<div style="text-align: center; margin:0 auto; display:block; white-space: nowrap;">
|
||||
<label class="cbi-value" style="display:inline-block; width: 100%;" for="ulfiles"><%:Upload File Type%> <%:(Click to select)%>
|
||||
<select name="file_type" style="width:auto">
|
||||
<option value="config" selected="selected"><%:Config File%> (.yaml)</option>
|
||||
<option value="proxy-provider"><%:Proxy Provider File%></option>
|
||||
<option value="rule-provider"><%:Rule Provider File%></option>
|
||||
<option value="clash_meta">[Meta] <%:Core File%> (.tar.gz)</option>
|
||||
<option value="backup-file"><%:Backup File%> (.tar.gz)</option>
|
||||
</select>
|
||||
<input class="cbi-input-file" style="width: 30%" type="file" id="ulfile" name="ulfile" />
|
||||
<input type="submit" class="btn cbi-button cbi-input-reload" name="upload" value="<%:Upload%>" />
|
||||
<input type="submit" class="btn cbi-button cbi-button-reset" value="<%:Backup%>" onclick="return backup_all_file(this)"/>
|
||||
</div>
|
||||
<%+cbi/valuefooter%>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
function backup_all_file(btn)
|
||||
{
|
||||
btn.value = '<%:Backup%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
};
|
||||
|
||||
//]]></script>
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
zh-cn
|
@ -1,289 +0,0 @@
|
||||
|
||||
config openclash 'config'
|
||||
option proxy_port '7892'
|
||||
option tproxy_port '7895'
|
||||
option mixed_port '7893'
|
||||
option socks_port '7891'
|
||||
option http_port '7890'
|
||||
option dns_port '7874'
|
||||
option enable '0'
|
||||
option update '0'
|
||||
option en_mode '0'
|
||||
option auto_update '0'
|
||||
option auto_update_time '0'
|
||||
option cn_port '9090'
|
||||
option dashboard_password '123456'
|
||||
option dashboard_forward_ssl '0'
|
||||
option rule_source '0'
|
||||
option enable_custom_dns '0'
|
||||
option ipv6_enable '0'
|
||||
option ipv6_dns '0'
|
||||
option enable_custom_clash_rules '0'
|
||||
option other_rule_auto_update '0'
|
||||
option core_version '0'
|
||||
option en_mode 'fake-ip'
|
||||
option enable_redirect_dns '1'
|
||||
option servers_if_update '0'
|
||||
option disable_masq_cache '1'
|
||||
option servers_update '0'
|
||||
option log_level '0'
|
||||
option proxy_mode 'rule'
|
||||
option intranet_allowed '1'
|
||||
option enable_udp_proxy '1'
|
||||
option disable_udp_quic '1'
|
||||
option lan_ac_mode '0'
|
||||
option operation_mode 'fake-ip'
|
||||
option enable_rule_proxy '0'
|
||||
option redirect_dns '0'
|
||||
option cachesize_dns '0'
|
||||
option filter_aaaa_dns '0'
|
||||
option small_flash_memory '0'
|
||||
option interface_name '0'
|
||||
option common_ports '0'
|
||||
option log_size '1024'
|
||||
option tolerance '0'
|
||||
option store_fakeip '0'
|
||||
option custom_fallback_filter '0'
|
||||
option custom_fakeip_filter '0'
|
||||
option custom_host '0'
|
||||
option custom_name_policy '0'
|
||||
option append_wan_dns '0'
|
||||
option stream_auto_select '0'
|
||||
option bypass_gateway_compatible '0'
|
||||
option github_address_mod '0'
|
||||
option urltest_address_mod '0'
|
||||
option urltest_interval_mod '0'
|
||||
option delay_start '0'
|
||||
option router_self_proxy '1'
|
||||
option release_branch 'master'
|
||||
option dashboard_type 'Official'
|
||||
option yacd_type 'Official'
|
||||
option append_default_dns '0'
|
||||
option enable_respect_rules '0'
|
||||
option geo_custom_url 'https://testingcf.jsdelivr.net/gh/alecthw/mmdb_china_ip_list@release/lite/Country.mmdb'
|
||||
option geosite_custom_url 'https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat'
|
||||
option geoip_custom_url 'https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat'
|
||||
option chnr_custom_url 'https://ispip.clang.cn/all_cn.txt'
|
||||
option chnr6_custom_url 'https://ispip.clang.cn/all_cn_ipv6.txt'
|
||||
|
||||
config dns_servers
|
||||
option type 'udp'
|
||||
option ip '114.114.114.114'
|
||||
option enabled '1'
|
||||
option group 'default'
|
||||
|
||||
config dns_servers
|
||||
option type 'udp'
|
||||
option ip '119.29.29.29'
|
||||
option enabled '1'
|
||||
option group 'default'
|
||||
|
||||
config dns_servers
|
||||
option group 'nameserver'
|
||||
option type 'udp'
|
||||
option ip '114.114.114.114'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option type 'udp'
|
||||
option ip '223.5.5.5'
|
||||
option enabled '1'
|
||||
option group 'default'
|
||||
|
||||
config dns_servers
|
||||
option group 'nameserver'
|
||||
option type 'udp'
|
||||
option ip '119.29.29.29'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option group 'nameserver'
|
||||
option type 'udp'
|
||||
option ip '119.28.28.28'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option group 'nameserver'
|
||||
option type 'udp'
|
||||
option ip '223.5.5.5'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option type 'https'
|
||||
option ip 'doh.pub/dns-query'
|
||||
option group 'nameserver'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option type 'https'
|
||||
option ip 'dns.alidns.com/dns-query'
|
||||
option group 'nameserver'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '9.9.9.9'
|
||||
option type 'udp'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '149.112.112.112'
|
||||
option type 'udp'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '2620:fe::fe'
|
||||
option type 'udp'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '2620:fe::9'
|
||||
option type 'udp'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '8.8.8.8'
|
||||
option type 'udp'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '8.8.4.4'
|
||||
option type 'udp'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '2001:4860:4860::8888'
|
||||
option type 'udp'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '2001:4860:4860::8844'
|
||||
option type 'udp'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '2001:da8::666'
|
||||
option type 'udp'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'dns.quad9.net'
|
||||
option type 'tls'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'dns.google'
|
||||
option type 'tls'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '1.1.1.1'
|
||||
option type 'tls'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'jp.tiar.app'
|
||||
option type 'tls'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'dot.tiar.app'
|
||||
option type 'tls'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'dns.quad9.net/dns-query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'dns.google/dns-query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'dns.cloudflare.com/dns-query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '1.1.1.1/dns-query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'public.dns.iij.jp/dns-query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'jp.tiar.app/dns-query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'jp.tiarap.org/dns-query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option type 'https'
|
||||
option ip 'doh.dnslify.com/dns-query'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'dns.twnic.tw/dns-query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'dns.oszx.co/dns-query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'doh.applied-privacy.net/query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'dnsforge.de/dns-query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'doh.ffmuc.net/dns-query'
|
||||
option type 'https'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'doh.mullvad.net/dns-query'
|
||||
option type 'https'
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,6 +0,0 @@
|
||||
#baidu.com
|
||||
#2400:da00::dbf:0:100
|
||||
##解决绕过大陆后谷歌商店无法更新
|
||||
services.googleapis.cn
|
||||
googleapis.cn
|
||||
xn--ngstr-lra8j.com
|
@ -1,6 +0,0 @@
|
||||
#baidu.com
|
||||
#114.114.114.114
|
||||
##解决绕过大陆后谷歌商店无法更新
|
||||
services.googleapis.cn
|
||||
googleapis.cn
|
||||
xn--ngstr-lra8j.com
|
@ -1 +0,0 @@
|
||||
#baidu.com
|
@ -1,5 +0,0 @@
|
||||
#'www.baidu.com': '114.114.114.114'
|
||||
#'+.internal.crop.com': '10.0.0.1'
|
||||
#"geosite:category-games@cn": [https://doh.pub/dns-query, 114.114.114.114, 223.5.5.5]
|
||||
#"geosite:google": [tls://8.8.4.4, https://1.0.0.1/dns-query]
|
||||
#"geosite:cn": [https://doh.pub/dns-query, 114.114.114.114, 223.5.5.5]
|
@ -1,149 +0,0 @@
|
||||
#LAN
|
||||
*.lan
|
||||
*.localdomain
|
||||
*.example
|
||||
*.invalid
|
||||
*.localhost
|
||||
*.test
|
||||
*.local
|
||||
*.home.arpa
|
||||
#放行NTP服务
|
||||
time.*.com
|
||||
time.*.gov
|
||||
time.*.edu.cn
|
||||
time.*.apple.com
|
||||
time-ios.apple.com
|
||||
time1.*.com
|
||||
time2.*.com
|
||||
time3.*.com
|
||||
time4.*.com
|
||||
time5.*.com
|
||||
time6.*.com
|
||||
time7.*.com
|
||||
ntp.*.com
|
||||
ntp1.*.com
|
||||
ntp2.*.com
|
||||
ntp3.*.com
|
||||
ntp4.*.com
|
||||
ntp5.*.com
|
||||
ntp6.*.com
|
||||
ntp7.*.com
|
||||
*.time.edu.cn
|
||||
*.ntp.org.cn
|
||||
+.pool.ntp.org
|
||||
time1.cloud.tencent.com
|
||||
#放行网易云音乐
|
||||
music.163.com
|
||||
*.music.163.com
|
||||
*.126.net
|
||||
#百度音乐
|
||||
musicapi.taihe.com
|
||||
music.taihe.com
|
||||
#酷狗音乐
|
||||
songsearch.kugou.com
|
||||
trackercdn.kugou.com
|
||||
#酷我音乐
|
||||
*.kuwo.cn
|
||||
#JOOX音乐
|
||||
api-jooxtt.sanook.com
|
||||
api.joox.com
|
||||
joox.com
|
||||
#QQ音乐
|
||||
y.qq.com
|
||||
*.y.qq.com
|
||||
streamoc.music.tc.qq.com
|
||||
mobileoc.music.tc.qq.com
|
||||
isure.stream.qqmusic.qq.com
|
||||
dl.stream.qqmusic.qq.com
|
||||
aqqmusic.tc.qq.com
|
||||
amobile.music.tc.qq.com
|
||||
#虾米音乐
|
||||
*.xiami.com
|
||||
#咪咕音乐
|
||||
*.music.migu.cn
|
||||
music.migu.cn
|
||||
#win10本地连接检测
|
||||
+.msftconnecttest.com
|
||||
+.msftncsi.com
|
||||
#QQ登录
|
||||
localhost.ptlogin2.qq.com
|
||||
localhost.sec.qq.com
|
||||
+.qq.com
|
||||
+.tencent.com
|
||||
#Game
|
||||
#Nintendo Switch
|
||||
+.srv.nintendo.net
|
||||
*.n.n.srv.nintendo.net
|
||||
+.cdn.nintendo.net
|
||||
#Sony PlayStation
|
||||
+.stun.playstation.net
|
||||
#Microsoft Xbox
|
||||
xbox.*.*.microsoft.com
|
||||
*.*.xboxlive.com
|
||||
xbox.*.microsoft.com
|
||||
xnotify.xboxlive.com
|
||||
#Wotgame
|
||||
+.battlenet.com.cn
|
||||
+.wotgame.cn
|
||||
+.wggames.cn
|
||||
+.wowsgame.cn
|
||||
+.wargaming.net
|
||||
#Golang
|
||||
proxy.golang.org
|
||||
#STUN
|
||||
stun.*.*
|
||||
stun.*.*.*
|
||||
+.stun.*.*
|
||||
+.stun.*.*.*
|
||||
+.stun.*.*.*.*
|
||||
+.stun.*.*.*.*.*
|
||||
#Linksys Router
|
||||
heartbeat.belkin.com
|
||||
*.linksys.com
|
||||
*.linksyssmartwifi.com
|
||||
#ASUS Router
|
||||
*.router.asus.com
|
||||
#Apple Software Update Service
|
||||
mesu.apple.com
|
||||
swscan.apple.com
|
||||
swquery.apple.com
|
||||
swdownload.apple.com
|
||||
swcdn.apple.com
|
||||
swdist.apple.com
|
||||
#Google
|
||||
lens.l.google.com
|
||||
stun.l.google.com
|
||||
na.b.g-tun.com
|
||||
#Netflix
|
||||
+.nflxvideo.net
|
||||
#FinalFantasy XIV Worldwide Server & CN Server
|
||||
*.square-enix.com
|
||||
*.finalfantasyxiv.com
|
||||
*.ffxiv.com
|
||||
*.ff14.sdo.com
|
||||
ff.dorado.sdo.com
|
||||
#Bilibili
|
||||
*.mcdn.bilivideo.cn
|
||||
#Disney Plus
|
||||
+.media.dssott.com
|
||||
#shark007 Codecs
|
||||
shark007.net
|
||||
#Mijia
|
||||
Mijia Cloud
|
||||
#招商银行
|
||||
+.cmbchina.com
|
||||
+.cmbimg.com
|
||||
#AdGuard
|
||||
local.adguard.org
|
||||
#迅雷
|
||||
+.sandai.net
|
||||
+.n0808.com
|
||||
#UU Plugin
|
||||
+.uu.163.com
|
||||
ps.res.netease.com
|
||||
#Wifi Calling
|
||||
+.pub.3gppnetwork.org
|
||||
#GEOSITE(Meta core)
|
||||
geosite:category-games
|
||||
#geosite:apple-cn
|
||||
#geosite:google-cn
|
@ -1,40 +0,0 @@
|
||||
# If IP addresses resolved with servers in `nameservers` are in the specified
|
||||
# subnets below, they are considered invalid and results from `fallback`
|
||||
# servers are used instead.
|
||||
#
|
||||
# IP address resolved with servers in `nameserver` is used when
|
||||
# `fallback-filter.geoip` is true and when GEOIP of the IP address is `CN`.
|
||||
#
|
||||
# If `fallback-filter.geoip` is false, results from `nameserver` nameservers
|
||||
# are always used if not match `fallback-filter.ipcidr`.
|
||||
#
|
||||
# This is a countermeasure against DNS pollution attacks.
|
||||
|
||||
fallback-filter:
|
||||
geoip: true
|
||||
geoip-code: CN
|
||||
ipcidr:
|
||||
- 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/32
|
||||
domain:
|
||||
- "+.google.com"
|
||||
- "+.facebook.com"
|
||||
- "+.youtube.com"
|
||||
- "+.githubusercontent.com"
|
||||
- "+.googlevideo.com"
|
||||
- "+.msftconnecttest.com"
|
||||
- "+.msftncsi.com"
|
@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
. /usr/share/openclash/log.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
# This script is called by /etc/init.d/openclash
|
||||
# Add your custom firewall rules here, they will be added after the end of the OpenClash iptables rules
|
||||
|
||||
LOG_OUT "Tip: Start Add Custom Firewall Rules..."
|
||||
|
||||
exit 0
|
@ -1,10 +0,0 @@
|
||||
# Static hosts for DNS server and connection establishment (like /etc/hosts)
|
||||
#
|
||||
# Wildcard hostnames are supported (e.g. *.clash.dev, *.foo.*.example.com)
|
||||
# Non-wildcard domain names have a higher priority than wildcard domain names
|
||||
# e.g. foo.example.com > *.example.com > .example.com
|
||||
# P.S. +.foo.com equals to .foo.com and foo.com
|
||||
|
||||
# '*.clash.dev': 127.0.0.1
|
||||
# '.dev': 127.0.0.1
|
||||
# 'alpha.clash.dev': '::1'
|
@ -1,9 +0,0 @@
|
||||
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.168.0.0/16
|
||||
224.0.0.0/4
|
||||
240.0.0.0/4
|
@ -1,13 +0,0 @@
|
||||
::/128
|
||||
::1/128
|
||||
::ffff:0:0/96
|
||||
::ffff:0:0:0/96
|
||||
64:ff9b::/96
|
||||
100::/64
|
||||
2001::/32
|
||||
2001:20::/28
|
||||
2001:db8::/32
|
||||
2002::/16
|
||||
fc00::/7
|
||||
fe80::/10
|
||||
ff00::/8
|
@ -1,69 +0,0 @@
|
||||
#!/bin/sh
|
||||
. /usr/share/openclash/ruby.sh
|
||||
. /usr/share/openclash/log.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
# This script is called by /etc/init.d/openclash
|
||||
# Add your custom overwrite scripts here, they will be take effict after the OpenClash own srcipts
|
||||
|
||||
LOG_OUT "Tip: Start Running Custom Overwrite Scripts..."
|
||||
LOGTIME=$(echo $(date "+%Y-%m-%d %H:%M:%S"))
|
||||
LOG_FILE="/tmp/openclash.log"
|
||||
CONFIG_FILE="$1" #config path
|
||||
|
||||
#Simple Demo:
|
||||
#General Demo
|
||||
#1--config path
|
||||
#2--key name
|
||||
#3--value
|
||||
#ruby_edit "$CONFIG_FILE" "['redir-port']" "7892"
|
||||
#ruby_edit "$CONFIG_FILE" "['secret']" "123456"
|
||||
#ruby_edit "$CONFIG_FILE" "['dns']['enable']" "true"
|
||||
|
||||
#Hash Demo
|
||||
#1--config path
|
||||
#2--key name
|
||||
#3--hash type value
|
||||
#ruby_edit "$CONFIG_FILE" "['experimental']" "{'sniff-tls-sni'=>true}"
|
||||
#ruby_edit "$CONFIG_FILE" "['sniffer']" "{'sniffing'=>['tls','http']}"
|
||||
|
||||
#Array Demo:
|
||||
#1--config path
|
||||
#2--key name
|
||||
#3--position(start from 0, end with -1)
|
||||
#4--value
|
||||
#ruby_arr_insert "$CONFIG_FILE" "['dns']['nameserver']" "0" "114.114.114.114"
|
||||
|
||||
#Array Add From Yaml File Demo:
|
||||
#1--config path
|
||||
#2--key name
|
||||
#3--position(start from 0, end with -1)
|
||||
#4--value file path
|
||||
#5--value key name in #4 file
|
||||
#ruby_arr_add_file "$CONFIG_FILE" "['dns']['fallback-filter']['ipcidr']" "0" "/etc/openclash/custom/openclash_custom_fallback_filter.yaml" "['fallback-filter']['ipcidr']"
|
||||
|
||||
#Ruby Script Demo:
|
||||
#ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "
|
||||
# begin
|
||||
# Value = YAML.load_file('$CONFIG_FILE');
|
||||
# rescue Exception => e
|
||||
# puts '${LOGTIME} Error: Load File Failed,【' + e.message + '】';
|
||||
# end;
|
||||
|
||||
#General
|
||||
# begin
|
||||
# Thread.new{
|
||||
# Value['redir-port']=7892;
|
||||
# Value['tproxy-port']=7895;
|
||||
# Value['port']=7890;
|
||||
# Value['socks-port']=7891;
|
||||
# Value['mixed-port']=7893;
|
||||
# }.join;
|
||||
|
||||
# rescue Exception => e
|
||||
# puts '${LOGTIME} Error: Set General Failed,【' + e.message + '】';
|
||||
# ensure
|
||||
# File.open('$CONFIG_FILE','w') {|f| YAML.dump(Value, f)};
|
||||
# end" 2>/dev/null >> $LOG_FILE
|
||||
|
||||
exit 0
|
@ -1,78 +0,0 @@
|
||||
rules:
|
||||
##- PROCESS-NAME,curl,DIRECT #匹配路由自身进程(curl直连)
|
||||
##- DOMAIN-SUFFIX,google.com,Proxy #匹配域名后缀(交由Proxy代理服务器组)
|
||||
##- DOMAIN-KEYWORD,google,Proxy #匹配域名关键字(交由Proxy代理服务器组)
|
||||
##- DOMAIN,google.com,Proxy #匹配域名(交由Proxy代理服务器组)
|
||||
##- DOMAIN-SUFFIX,ad.com,REJECT #匹配域名后缀(拒绝)
|
||||
##- IP-CIDR,127.0.0.0/8,DIRECT #匹配数据目标IP(直连)
|
||||
##- SRC-IP-CIDR,192.168.1.201/32,DIRECT #匹配数据发起IP(直连)
|
||||
##- DST-PORT,80,DIRECT #匹配数据目标端口(直连)
|
||||
##- SRC-PORT,7777,DIRECT #匹配数据源端口(直连)
|
||||
##- GEOSITE,category-public-tracker,DIRECT #匹配GEOSITE数据库规则(直连)
|
||||
##- DOMAIN-REGEX,^abc.*com,PROXY #正则匹配域名
|
||||
##- RULE-SET,providername,PROXY #匹配规则集
|
||||
|
||||
##- IP-CIDR6,2620:0:2d0:200::7/32,PROXY
|
||||
##- IP-SUFFIX,8.8.8.8/24,PROXY
|
||||
##- IP-ASN,13335,DIRECT
|
||||
|
||||
##- SRC-GEOIP,cn,DIRECT
|
||||
##- SRC-IP-ASN,9808,DIRECT
|
||||
##- SRC-IP-SUFFIX,192.168.1.201/8,DIRECT
|
||||
|
||||
##- IN-PORT,7890,PROXY
|
||||
##- IN-TYPE,SOCKS/HTTP,PROXY
|
||||
##- IN-USER,mihomo,PROXY
|
||||
##- IN-NAME,ss,PROXY
|
||||
|
||||
##- PROCESS-NAME-REGEX,curl$,PROXY
|
||||
##- PROCESS-NAME-REGEX,(?i)Telegram,PROXY
|
||||
##- PROCESS-NAME-REGEX,.*telegram.*,PROXY
|
||||
|
||||
##- NETWORK,udp,DIRECT
|
||||
##- DSCP,4,DIRECT
|
||||
|
||||
##- AND,((DOMAIN,baidu.com),(NETWORK,UDP)),DIRECT
|
||||
##- OR,((NETWORK,UDP),(DOMAIN,baidu.com)),REJECT
|
||||
##- NOT,((DOMAIN,baidu.com)),PROXY
|
||||
##- SUB-RULE,(NETWORK,tcp),sub-rule
|
||||
|
||||
##排序在上的规则优先生效,如添加(去除规则前的#号):
|
||||
##IP段:192.168.1.2-192.168.1.200 直连
|
||||
##- SRC-IP-CIDR,192.168.1.2/31,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.4/30,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.8/29,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.16/28,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.32/27,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.64/26,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.128/26,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.192/29,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.200/32,DIRECT
|
||||
|
||||
##IP段:192.168.1.202-192.168.1.255 直连
|
||||
##- SRC-IP-CIDR,192.168.1.202/31,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.204/30,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.208/28,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.224/27,DIRECT
|
||||
|
||||
##此时IP为192.168.1.1和192.168.1.201的客户端流量走代理(策略),其余客户端不走代理
|
||||
##因为Fake-IP模式下,IP地址为192.168.1.1的路由器自身流量可走代理(策略),所以需要排除
|
||||
|
||||
##仅设置路由器自身直连:
|
||||
##- SRC-IP-CIDR,192.168.1.1/32,DIRECT
|
||||
##- SRC-IP-CIDR,198.18.0.1/32,DIRECT
|
||||
|
||||
##DDNS
|
||||
##- DOMAIN-KEYWORD,synology,DIRECT
|
||||
##- DOMAIN-KEYWORD,quickconnect,DIRECT
|
||||
##- DOMAIN-SUFFIX,checkip.dyndns.org,DIRECT
|
||||
##- DOMAIN-SUFFIX,checkipv6.dyndns.org,DIRECT
|
||||
##- DOMAIN-SUFFIX,checkip.synology.com,DIRECT
|
||||
##- DOMAIN-SUFFIX,ifconfig.co,DIRECT
|
||||
##- DOMAIN-SUFFIX,api.myip.com,DIRECT
|
||||
##- DOMAIN-SUFFIX,ip-api.com,DIRECT
|
||||
##- DOMAIN-SUFFIX,ipapi.co,DIRECT
|
||||
##- DOMAIN-SUFFIX,ip6.seeip.org,DIRECT
|
||||
##- DOMAIN-SUFFIX,members.3322.org,DIRECT
|
||||
|
||||
##在线IP段转CIDR地址:http://ip2cidr.com
|
@ -1,9 +0,0 @@
|
||||
rules:
|
||||
##- DOMAIN-SUFFIX,google.com,Proxy #匹配域名后缀(交由Proxy代理服务器组)
|
||||
##- DOMAIN-KEYWORD,google,Proxy #匹配域名关键字(交由Proxy代理服务器组)
|
||||
##- DOMAIN,google.com,Proxy #匹配域名(交由Proxy代理服务器组)
|
||||
##- DOMAIN-SUFFIX,ad.com,REJECT #匹配域名后缀(拒绝)
|
||||
##- IP-CIDR,127.0.0.0/8,DIRECT #匹配数据目标IP(直连)
|
||||
##- SRC-IP-CIDR,192.168.1.201/32,DIRECT #匹配数据发起IP(直连)
|
||||
##- DST-PORT,80,DIRECT #匹配数据目标端口(直连)
|
||||
##- SRC-PORT,7777,DIRECT #匹配数据源端口(直连)
|
@ -1,6 +0,0 @@
|
||||
force-domain:
|
||||
# - '+'
|
||||
- '+.netflix.com'
|
||||
- '+.nflxvideo.net'
|
||||
- '+.amazonaws.com'
|
||||
- '+.media.dssott.com'
|
@ -1,7 +0,0 @@
|
||||
skip-domain:
|
||||
- '+.apple.com'
|
||||
- Mijia Cloud
|
||||
- dlg.io.mi.com
|
||||
- +.oray.com
|
||||
- +.sunlogin.net
|
||||
#- geosite:cn
|
@ -1,12 +0,0 @@
|
||||
sniff:
|
||||
# TLS 默认如果不配置 ports 默认嗅探 443
|
||||
TLS:
|
||||
# ports: [443, 8443]
|
||||
|
||||
# 默认嗅探 80
|
||||
HTTP:
|
||||
# 需要嗅探的端口
|
||||
|
||||
ports: [80, 8080-8880]
|
||||
# 是否使用嗅探结果作为实际访问
|
||||
override-destination: true
|
@ -1,618 +0,0 @@
|
||||
payload:
|
||||
- 1.165.84.0/24
|
||||
- 1.165.85.0/24
|
||||
- 1.165.90.0/24
|
||||
- 5.8.200.0/24
|
||||
- 5.9.123.0/24
|
||||
- 13.73.0.0/16
|
||||
- 13.73.1.0/24
|
||||
- 13.75.114.0/24
|
||||
- 13.126.76.0/24
|
||||
- 14.18.251.72/32
|
||||
- 18.214.26.0/24
|
||||
- 24.105.28.0/24
|
||||
- 27.64.93.0/24
|
||||
- 34.235.169.0/24
|
||||
- 35.185.157.0/24
|
||||
- 35.198.200.0/24
|
||||
- 36.232.23.0/24
|
||||
- 36.232.28.0/24
|
||||
- 36.232.29.0/24
|
||||
- 37.21.10.0/24
|
||||
- 37.230.228.0/24
|
||||
- 42.113.94.0/24
|
||||
- 42.114.229.0/24
|
||||
- 43.225.199.0/24
|
||||
- 43.239.136.0/24
|
||||
- 43.241.50.0/24
|
||||
- 43.249.36.0/24
|
||||
- 45.113.137.0/24
|
||||
- 45.113.191.0/24
|
||||
- 45.119.240.0/24
|
||||
- 45.121.184.0/24
|
||||
- 45.121.185.0/24
|
||||
- 45.121.186.0/24
|
||||
- 45.121.187.0/24
|
||||
- 47.52.16.0/24
|
||||
- 47.52.17.0/24
|
||||
- 47.52.18.0/24
|
||||
- 47.52.19.0/24
|
||||
- 47.52.20.0/24
|
||||
- 47.52.21.0/24
|
||||
- 47.52.22.0/24
|
||||
- 47.52.23.0/24
|
||||
- 47.52.24.0/24
|
||||
- 47.52.25.0/24
|
||||
- 47.52.26.0/24
|
||||
- 47.52.27.0/24
|
||||
- 47.52.28.0/24
|
||||
- 47.52.29.0/24
|
||||
- 47.52.30.0/24
|
||||
- 47.52.31.0/24
|
||||
- 47.52.40.0/24
|
||||
- 47.52.41.0/24
|
||||
- 47.52.42.0/24
|
||||
- 47.52.43.0/24
|
||||
- 47.52.44.0/24
|
||||
- 47.52.45.0/24
|
||||
- 47.52.46.0/24
|
||||
- 47.52.47.0/24
|
||||
- 47.52.56.0/24
|
||||
- 47.52.57.0/24
|
||||
- 47.52.58.0/24
|
||||
- 47.52.59.0/24
|
||||
- 47.52.60.0/24
|
||||
- 47.52.61.0/24
|
||||
- 47.52.62.0/24
|
||||
- 47.52.63.0/24
|
||||
- 47.52.64.0/24
|
||||
- 47.52.65.0/24
|
||||
- 47.52.66.0/24
|
||||
- 47.52.67.0/24
|
||||
- 47.52.68.0/24
|
||||
- 47.52.69.0/24
|
||||
- 47.52.70.0/24
|
||||
- 47.52.71.0/24
|
||||
- 47.52.72.0/24
|
||||
- 47.52.73.0/24
|
||||
- 47.52.74.0/24
|
||||
- 47.52.75.0/24
|
||||
- 47.52.76.0/24
|
||||
- 47.52.77.0/24
|
||||
- 47.52.78.0/24
|
||||
- 47.52.79.0/24
|
||||
- 47.52.88.0/24
|
||||
- 47.52.89.0/24
|
||||
- 47.52.90.0/24
|
||||
- 47.52.91.0/24
|
||||
- 47.52.92.0/24
|
||||
- 47.52.93.0/24
|
||||
- 47.52.94.0/24
|
||||
- 47.52.95.0/24
|
||||
- 47.52.96.0/24
|
||||
- 47.52.97.0/24
|
||||
- 47.52.98.0/24
|
||||
- 47.52.99.0/24
|
||||
- 47.52.100.0/24
|
||||
- 47.52.101.0/24
|
||||
- 47.52.102.0/24
|
||||
- 47.52.103.0/24
|
||||
- 47.52.104.0/24
|
||||
- 47.52.105.0/24
|
||||
- 47.52.106.0/24
|
||||
- 47.52.107.0/24
|
||||
- 47.52.108.0/24
|
||||
- 47.52.109.0/24
|
||||
- 47.52.110.0/24
|
||||
- 47.52.111.0/24
|
||||
- 47.52.112.0/24
|
||||
- 47.52.113.0/24
|
||||
- 47.52.114.0/24
|
||||
- 47.52.115.0/24
|
||||
- 47.52.116.0/24
|
||||
- 47.52.117.0/24
|
||||
- 47.52.118.0/24
|
||||
- 47.52.119.0/24
|
||||
- 47.52.128.0/24
|
||||
- 47.52.129.0/24
|
||||
- 47.52.130.0/24
|
||||
- 47.52.131.0/24
|
||||
- 47.52.132.0/24
|
||||
- 47.52.133.0/24
|
||||
- 47.52.134.0/24
|
||||
- 47.52.135.0/24
|
||||
- 47.52.136.0/24
|
||||
- 47.52.137.0/24
|
||||
- 47.52.138.0/24
|
||||
- 47.52.139.0/24
|
||||
- 47.52.140.0/24
|
||||
- 47.52.141.0/24
|
||||
- 47.52.142.0/24
|
||||
- 47.52.143.0/24
|
||||
- 47.52.144.0/24
|
||||
- 47.52.145.0/24
|
||||
- 47.52.146.0/24
|
||||
- 47.52.147.0/24
|
||||
- 47.52.148.0/24
|
||||
- 47.52.149.0/24
|
||||
- 47.52.150.0/24
|
||||
- 47.52.151.0/24
|
||||
- 47.52.152.0/24
|
||||
- 47.52.153.0/24
|
||||
- 47.52.154.0/24
|
||||
- 47.52.155.0/24
|
||||
- 47.52.156.0/24
|
||||
- 47.52.157.0/24
|
||||
- 47.52.158.0/24
|
||||
- 47.52.159.0/24
|
||||
- 47.52.160.0/24
|
||||
- 47.52.161.0/24
|
||||
- 47.52.162.0/24
|
||||
- 47.52.163.0/24
|
||||
- 47.52.164.0/24
|
||||
- 47.52.165.0/24
|
||||
- 47.52.166.0/24
|
||||
- 47.52.167.0/24
|
||||
- 47.52.168.0/24
|
||||
- 47.52.169.0/24
|
||||
- 47.52.170.0/24
|
||||
- 47.52.171.0/24
|
||||
- 47.52.172.0/24
|
||||
- 47.52.173.0/24
|
||||
- 47.52.174.0/24
|
||||
- 47.52.175.0/24
|
||||
- 47.52.188.0/24
|
||||
- 47.52.190.0/24
|
||||
- 47.52.191.0/24
|
||||
- 47.52.192.0/24
|
||||
- 47.52.193.0/24
|
||||
- 47.52.194.0/24
|
||||
- 47.52.195.0/24
|
||||
- 47.52.196.0/24
|
||||
- 47.52.197.0/24
|
||||
- 47.52.198.0/24
|
||||
- 47.52.199.0/24
|
||||
- 47.52.200.0/24
|
||||
- 47.52.201.0/24
|
||||
- 47.52.202.0/24
|
||||
- 47.52.203.0/24
|
||||
- 47.52.204.0/24
|
||||
- 47.52.205.0/24
|
||||
- 47.52.206.0/24
|
||||
- 47.52.207.0/24
|
||||
- 47.52.208.0/24
|
||||
- 47.52.209.0/24
|
||||
- 47.52.224.0/24
|
||||
- 47.52.225.0/24
|
||||
- 47.52.226.0/24
|
||||
- 47.52.228.0/24
|
||||
- 47.52.230.0/24
|
||||
- 47.52.231.0/24
|
||||
- 47.52.232.0/24
|
||||
- 47.52.234.0/24
|
||||
- 47.52.235.0/24
|
||||
- 47.52.236.0/24
|
||||
- 47.52.241.0/24
|
||||
- 47.52.242.0/24
|
||||
- 47.52.244.0/24
|
||||
- 47.52.246.0/24
|
||||
- 47.52.247.0/24
|
||||
- 47.52.248.0/24
|
||||
- 47.52.249.0/24
|
||||
- 47.52.250.0/24
|
||||
- 47.52.251.0/24
|
||||
- 47.52.252.0/24
|
||||
- 47.52.253.0/24
|
||||
- 47.52.254.0/24
|
||||
- 47.52.255.0/24
|
||||
- 47.74.1.0/24
|
||||
- 47.75.3.0/24
|
||||
- 47.75.5.0/24
|
||||
- 47.75.94.0/24
|
||||
- 47.75.98.0/24
|
||||
- 47.75.143.0/24
|
||||
- 47.75.194.0/24
|
||||
- 47.75.207.0/24
|
||||
- 47.75.219.0/24
|
||||
- 47.89.8.0/24
|
||||
- 47.89.9.0/24
|
||||
- 47.89.10.0/24
|
||||
- 47.89.11.0/24
|
||||
- 47.89.12.0/24
|
||||
- 47.89.13.0/24
|
||||
- 47.89.14.0/24
|
||||
- 47.89.15.0/24
|
||||
- 47.89.16.0/24
|
||||
- 47.89.17.0/24
|
||||
- 47.89.18.0/24
|
||||
- 47.89.19.0/24
|
||||
- 47.89.20.0/24
|
||||
- 47.89.21.0/24
|
||||
- 47.89.22.0/24
|
||||
- 47.89.23.0/24
|
||||
- 47.90.8.0/24
|
||||
- 47.90.90.0/24
|
||||
- 47.90.96.0/24
|
||||
- 47.90.97.0/24
|
||||
- 47.90.98.0/24
|
||||
- 47.90.99.0/24
|
||||
- 47.90.100.0/24
|
||||
- 47.90.101.0/24
|
||||
- 47.90.102.0/24
|
||||
- 47.90.103.0/24
|
||||
- 47.90.120.0/24
|
||||
- 47.90.121.0/24
|
||||
- 47.90.122.0/24
|
||||
- 47.90.123.0/24
|
||||
- 47.90.124.0/24
|
||||
- 47.90.125.0/24
|
||||
- 47.90.126.0/24
|
||||
- 47.90.127.0/24
|
||||
- 47.90.214.0/24
|
||||
- 47.91.152.0/24
|
||||
- 47.91.153.0/24
|
||||
- 47.91.154.0/24
|
||||
- 47.91.155.0/24
|
||||
- 47.91.156.0/24
|
||||
- 47.91.157.0/24
|
||||
- 47.91.158.0/24
|
||||
- 47.91.159.0/24
|
||||
- 47.91.207.0/24
|
||||
- 47.91.208.0/24
|
||||
- 47.91.209.0/24
|
||||
- 47.91.210.0/24
|
||||
- 47.91.211.0/24
|
||||
- 47.91.212.0/24
|
||||
- 47.91.213.0/24
|
||||
- 47.91.214.0/24
|
||||
- 47.91.215.0/24
|
||||
- 47.91.216.0/24
|
||||
- 47.91.217.0/24
|
||||
- 47.91.218.0/24
|
||||
- 47.91.219.0/24
|
||||
- 47.91.220.0/24
|
||||
- 47.91.221.0/24
|
||||
- 47.91.224.0/24
|
||||
- 47.91.225.0/24
|
||||
- 47.91.226.0/24
|
||||
- 47.91.227.0/24
|
||||
- 47.91.228.0/24
|
||||
- 47.91.229.0/24
|
||||
- 47.91.230.0/24
|
||||
- 47.91.231.0/24
|
||||
- 47.91.232.0/24
|
||||
- 47.91.233.0/24
|
||||
- 47.91.234.0/24
|
||||
- 47.91.235.0/24
|
||||
- 47.91.236.0/24
|
||||
- 47.91.237.0/24
|
||||
- 47.91.238.0/24
|
||||
- 47.91.239.0/24
|
||||
- 47.91.240.0/24
|
||||
- 47.91.241.0/24
|
||||
- 47.91.242.0/24
|
||||
- 47.91.243.0/24
|
||||
- 47.91.244.0/24
|
||||
- 47.91.245.0/24
|
||||
- 47.91.246.0/24
|
||||
- 47.91.247.0/24
|
||||
- 47.91.248.0/24
|
||||
- 47.91.249.0/24
|
||||
- 47.91.250.0/24
|
||||
- 47.91.251.0/24
|
||||
- 47.91.252.0/24
|
||||
- 47.91.253.0/24
|
||||
- 47.91.254.0/24
|
||||
- 47.91.255.0/24
|
||||
- 47.96.0.0/16
|
||||
- 47.96.2.0/24
|
||||
- 47.96.3.0/24
|
||||
- 47.96.5.0/24
|
||||
- 47.96.6.0/24
|
||||
- 47.96.7.0/24
|
||||
- 47.96.8.0/24
|
||||
- 47.96.9.0/24
|
||||
- 47.96.10.0/24
|
||||
- 47.96.12.0/24
|
||||
- 47.96.13.0/24
|
||||
- 47.96.14.0/24
|
||||
- 47.99.33.0/24
|
||||
- 47.99.38.0/24
|
||||
- 47.99.44.0/24
|
||||
- 47.99.62.0/24
|
||||
- 47.99.73.0/24
|
||||
- 47.99.75.0/24
|
||||
- 47.99.76.0/24
|
||||
- 47.99.81.0/24
|
||||
- 47.99.84.0/24
|
||||
- 47.99.89.0/24
|
||||
- 47.99.90.0/24
|
||||
- 47.99.93.0/24
|
||||
- 47.99.95.0/24
|
||||
- 47.99.98.0/24
|
||||
- 47.99.99.0/24
|
||||
- 47.99.101.0/24
|
||||
- 47.99.103.0/24
|
||||
- 47.99.104.0/24
|
||||
- 47.99.107.0/24
|
||||
- 47.99.111.0/24
|
||||
- 47.99.120.0/24
|
||||
- 47.99.128.0/24
|
||||
- 47.99.159.0/24
|
||||
- 47.99.161.0/24
|
||||
- 47.99.164.0/24
|
||||
- 47.99.166.0/24
|
||||
- 47.99.169.0/24
|
||||
- 47.110.42.0/24
|
||||
- 47.244.1.0/24
|
||||
- 47.244.2.0/24
|
||||
- 47.244.3.0/24
|
||||
- 47.244.5.0/24
|
||||
- 47.244.7.0/24
|
||||
- 47.244.10.0/24
|
||||
- 47.244.11.0/24
|
||||
- 47.244.12.0/24
|
||||
- 47.244.13.0/24
|
||||
- 47.244.14.0/24
|
||||
- 47.244.15.0/24
|
||||
- 47.244.16.0/24
|
||||
- 47.244.17.0/24
|
||||
- 47.244.18.0/24
|
||||
- 47.244.19.0/24
|
||||
- 47.244.21.0/24
|
||||
- 47.244.22.0/24
|
||||
- 47.244.24.0/24
|
||||
- 47.244.25.0/24
|
||||
- 47.244.26.0/24
|
||||
- 47.244.33.0/24
|
||||
- 47.244.35.0/24
|
||||
- 47.244.36.0/24
|
||||
- 47.244.37.0/24
|
||||
- 47.244.43.0/24
|
||||
- 47.244.44.0/24
|
||||
- 47.244.48.0/24
|
||||
- 47.244.51.0/24
|
||||
- 47.244.56.0/24
|
||||
- 52.53.89.0/24
|
||||
- 52.63.114.0/24
|
||||
- 52.64.199.0/24
|
||||
- 52.90.185.0/24
|
||||
- 52.175.16.0/24
|
||||
- 52.175.31.0/24
|
||||
- 52.207.236.0/24
|
||||
- 52.229.154.0/24
|
||||
- 52.229.160.0/24
|
||||
- 52.229.161.0/24
|
||||
- 54.66.223.0/24
|
||||
- 54.158.198.0/24
|
||||
- 54.164.19.0/24
|
||||
- 54.169.27.0/24
|
||||
- 54.209.147.0/24
|
||||
- 58.153.0.0/16
|
||||
- 58.153.19.0/24
|
||||
- 58.153.171.0/24
|
||||
- 58.153.208.0/24
|
||||
- 58.153.209.0/24
|
||||
- 58.153.221.0/24
|
||||
- 58.176.80.0/24
|
||||
- 58.177.181.0/24
|
||||
- 58.215.54.0/24
|
||||
- 58.221.252.0/24
|
||||
- 59.16.249.0/24
|
||||
- 59.127.115.0/24
|
||||
- 59.149.239.0/24
|
||||
- 60.248.89.0/24
|
||||
- 61.80.89.0/24
|
||||
- 61.84.148.0/24
|
||||
- 61.155.210.0/24
|
||||
- 61.216.2.0/24
|
||||
- 61.216.34.0/24
|
||||
- 61.216.146.0/24
|
||||
- 61.238.35.0/24
|
||||
- 61.239.213.0/24
|
||||
- 61.239.223.0/24
|
||||
- 74.91.112.0/24
|
||||
- 74.201.99.0/24
|
||||
- 87.98.228.0/24
|
||||
- 88.82.185.0/24
|
||||
- 90.188.238.0/24
|
||||
- 94.245.155.0/24
|
||||
- 95.154.88.0/24
|
||||
- 95.154.113.0/24
|
||||
- 95.172.92.0/24
|
||||
- 95.183.13.0/24
|
||||
- 103.9.89.0/24
|
||||
- 103.10.124.0/24
|
||||
- 103.10.125.0/24
|
||||
- 103.16.27.0/24
|
||||
- 103.28.54.0/24
|
||||
- 103.28.55.0/24
|
||||
- 103.36.208.0/24
|
||||
- 103.44.160.0/24
|
||||
- 103.57.72.0/24
|
||||
- 103.58.149.0/24
|
||||
- 103.60.126.0/24
|
||||
- 103.62.48.0/24
|
||||
- 103.89.90.0/24
|
||||
- 103.207.36.0/24
|
||||
- 103.222.20.0/24
|
||||
- 103.231.163.0/24
|
||||
- 103.232.85.0/24
|
||||
- 103.241.165.0/24
|
||||
- 103.244.2.0/24
|
||||
- 103.254.153.0/24
|
||||
- 104.199.166.0/24
|
||||
- 104.236.115.0/24
|
||||
- 107.21.14.0/24
|
||||
- 110.42.10.0/24
|
||||
- 110.173.58.0/24
|
||||
- 111.91.236.0/24
|
||||
- 111.231.11.0/24
|
||||
- 111.253.47.0/24
|
||||
- 111.253.49.0/24
|
||||
- 111.253.50.0/24
|
||||
- 111.253.52.0/24
|
||||
- 111.253.55.0/24
|
||||
- 112.118.44.0/24
|
||||
- 112.118.193.0/24
|
||||
- 113.160.204.0/24
|
||||
- 113.190.242.0/24
|
||||
- 114.46.16.0/24
|
||||
- 114.46.20.0/24
|
||||
- 114.46.21.0/24
|
||||
- 114.46.22.0/24
|
||||
- 114.46.24.0/24
|
||||
- 114.46.30.0/24
|
||||
- 114.167.236.0/24
|
||||
- 115.230.127.0/24
|
||||
- 115.231.221.0/24
|
||||
- 115.231.223.0/24
|
||||
- 116.31.123.0/24
|
||||
- 116.49.214.0/24
|
||||
- 116.122.109.0/24
|
||||
- 116.251.223.0/24
|
||||
- 118.107.76.0/24
|
||||
- 119.28.222.0/24
|
||||
- 119.197.57.0/24
|
||||
- 119.236.132.0/24
|
||||
- 119.237.11.0/24
|
||||
- 120.72.85.0/24
|
||||
- 123.31.20.0/24
|
||||
- 123.194.52.0/24
|
||||
- 124.158.10.0/24
|
||||
- 124.228.91.0/24
|
||||
- 125.212.211.0/24
|
||||
- 125.212.226.0/24
|
||||
- 125.226.128.0/24
|
||||
- 125.253.124.0/24
|
||||
- 128.199.81.0/24
|
||||
- 132.232.7.0/24
|
||||
- 132.232.9.0/24
|
||||
- 132.232.12.0/24
|
||||
- 132.232.29.0/24
|
||||
- 132.232.51.0/24
|
||||
- 132.232.55.0/24
|
||||
- 132.232.57.0/24
|
||||
- 132.232.61.0/24
|
||||
- 132.232.62.0/24
|
||||
- 132.232.75.0/24
|
||||
- 132.232.91.0/24
|
||||
- 132.232.94.0/24
|
||||
- 132.232.99.0/24
|
||||
- 132.232.104.0/24
|
||||
- 133.130.123.0/24
|
||||
- 138.19.63.0/24
|
||||
- 139.99.9.0/24
|
||||
- 139.99.104.0/24
|
||||
- 139.99.119.0/24
|
||||
- 139.162.55.0/24
|
||||
- 146.66.152.0/24
|
||||
- 146.66.153.0/24
|
||||
- 146.66.154.0/24
|
||||
- 146.66.155.0/24
|
||||
- 146.66.156.0/24
|
||||
- 146.66.157.0/24
|
||||
- 146.66.158.0/24
|
||||
- 146.66.159.0/24
|
||||
- 150.109.40.0/24
|
||||
- 151.80.60.0/24
|
||||
- 151.80.145.0/24
|
||||
- 152.111.192.0/24
|
||||
- 153.160.25.0/24
|
||||
- 153.254.86.0/24
|
||||
- 155.133.227.0/24
|
||||
- 155.133.230.0/24
|
||||
- 155.133.232.0/24
|
||||
- 155.133.233.0/24
|
||||
- 155.133.235.0/24
|
||||
- 155.133.238.0/24
|
||||
- 155.133.239.0/24
|
||||
- 155.133.242.0/24
|
||||
- 155.133.244.0/24
|
||||
- 155.133.245.0/24
|
||||
- 155.133.246.0/24
|
||||
- 155.133.247.0/24
|
||||
- 155.133.248.0/24
|
||||
- 155.133.249.0/24
|
||||
- 155.133.252.0/24
|
||||
- 155.133.253.0/24
|
||||
- 155.133.254.0/24
|
||||
- 159.28.159.0/24
|
||||
- 161.202.44.0/24
|
||||
- 162.254.192.0/24
|
||||
- 162.254.193.0/24
|
||||
- 162.254.194.0/24
|
||||
- 162.254.195.0/24
|
||||
- 162.254.196.0/24
|
||||
- 162.254.197.0/24
|
||||
- 162.254.198.0/24
|
||||
- 162.254.199.0/24
|
||||
- 163.53.149.0/24
|
||||
- 169.254.0.0/16
|
||||
- 169.254.125.95/32
|
||||
- 169.254.10.218/32
|
||||
- 175.210.83.0/24
|
||||
- 176.215.255.0/24
|
||||
- 180.149.95.0/24
|
||||
- 180.177.178.0/24
|
||||
- 182.171.230.0/24
|
||||
- 182.176.65.0/24
|
||||
- 183.60.111.0/24
|
||||
- 183.179.66.0/24
|
||||
- 185.25.60.0/24
|
||||
- 185.25.180.0/24
|
||||
- 185.25.181.0/24
|
||||
- 185.25.182.0/24
|
||||
- 185.25.183.0/24
|
||||
- 185.37.216.0/24
|
||||
- 185.62.205.0/24
|
||||
- 185.113.141.0/24
|
||||
- 190.217.33.0/24
|
||||
- 192.69.96.0/24
|
||||
- 192.69.97.0/24
|
||||
- 193.33.176.0/24
|
||||
- 195.14.118.0/24
|
||||
- 195.201.246.0/24
|
||||
- 196.38.180.0/24
|
||||
- 197.80.200.0/24
|
||||
- 198.27.83.0/24
|
||||
- 202.21.115.0/24
|
||||
- 203.175.163.0/24
|
||||
- 203.175.164.0/24
|
||||
- 203.175.165.0/24
|
||||
- 203.175.166.0/24
|
||||
- 203.218.101.0/24
|
||||
- 205.185.194.0/24
|
||||
- 205.196.6.0/24
|
||||
- 208.64.200.0/24
|
||||
- 208.64.203.0/24
|
||||
- 208.78.164.0/24
|
||||
- 208.78.165.0/24
|
||||
- 208.78.166.0/24
|
||||
- 209.58.164.0/24
|
||||
- 209.58.168.0/24
|
||||
- 209.58.178.0/24
|
||||
- 209.58.188.0/24
|
||||
- 210.211.124.0/24
|
||||
- 211.21.37.0/24
|
||||
- 211.48.69.0/24
|
||||
- 211.75.181.0/24
|
||||
- 212.64.32.0/24
|
||||
- 216.52.148.0/24
|
||||
- 217.150.77.0/24
|
||||
- 218.250.12.0/24
|
||||
- 218.250.15.0/24
|
||||
- 218.250.113.0/24
|
||||
- 218.255.3.0/24
|
||||
- 220.80.129.0/24
|
||||
- 220.134.154.0/24
|
||||
- 220.135.180.0/24
|
||||
- 220.169.242.0/24
|
||||
- 220.170.89.0/24
|
||||
- 221.6.100.0/24
|
||||
- 222.102.95.0/24
|
||||
- 222.112.242.0/24
|
||||
- 222.186.50.0/24
|
||||
- 222.187.224.0/24
|
||||
- 224.0.0.0/4
|
||||
- 240.0.0.0/4
|
@ -1,294 +0,0 @@
|
||||
payload:
|
||||
- 2.16.0.0/16
|
||||
- 2.17.0.0/16
|
||||
- 2.18.0.0/16
|
||||
- 2.19.0.0/16
|
||||
- 2.20.0.0/16
|
||||
- 2.21.0.0/16
|
||||
- 2.22.0.0/16
|
||||
- 2.23.0.0/16
|
||||
- 8.7.0.0/16
|
||||
- 14.21.0.0/16
|
||||
- 23.0.0.0/4
|
||||
- 23.1.0.0/16
|
||||
- 23.2.0.0/16
|
||||
- 23.3.0.0/16
|
||||
- 23.4.0.0/16
|
||||
- 23.5.0.0/16
|
||||
- 23.7.0.0/16
|
||||
- 23.8.0.0/16
|
||||
- 23.9.0.0/16
|
||||
- 23.11.0.0/16
|
||||
- 23.12.0.0/16
|
||||
- 23.13.0.0/16
|
||||
- 23.14.0.0/16
|
||||
- 23.15.0.0/16
|
||||
- 23.32.0.0/16
|
||||
- 23.33.0.0/16
|
||||
- 23.34.0.0/16
|
||||
- 23.35.0.0/16
|
||||
- 23.36.0.0/16
|
||||
- 23.37.0.0/16
|
||||
- 23.38.0.0/16
|
||||
- 23.39.0.0/16
|
||||
- 23.40.0.0/16
|
||||
- 23.41.0.0/16
|
||||
- 23.42.0.0/16
|
||||
- 23.44.0.0/16
|
||||
- 23.45.0.0/16
|
||||
- 23.46.0.0/16
|
||||
- 23.48.0.0/16
|
||||
- 23.49.0.0/16
|
||||
- 23.50.0.0/16
|
||||
- 23.51.0.0/16
|
||||
- 23.52.0.0/16
|
||||
- 23.53.0.0/16
|
||||
- 23.54.0.0/16
|
||||
- 23.55.0.0/16
|
||||
- 23.56.0.0/16
|
||||
- 23.57.0.0/16
|
||||
- 23.58.0.0/16
|
||||
- 23.59.0.0/16
|
||||
- 23.60.0.0/16
|
||||
- 23.61.0.0/16
|
||||
- 23.62.0.0/16
|
||||
- 23.63.0.0/16
|
||||
- 23.64.0.0/16
|
||||
- 23.65.0.0/16
|
||||
- 23.67.0.0/16
|
||||
- 23.72.0.0/16
|
||||
- 23.73.0.0/16
|
||||
- 23.74.0.0/16
|
||||
- 23.75.0.0/16
|
||||
- 23.76.0.0/16
|
||||
- 23.77.0.0/16
|
||||
- 23.78.0.0/16
|
||||
- 23.79.0.0/16
|
||||
- 23.192.0.0/16
|
||||
- 23.193.0.0/16
|
||||
- 23.194.0.0/16
|
||||
- 23.196.0.0/16
|
||||
- 23.197.0.0/16
|
||||
- 23.198.0.0/16
|
||||
- 23.199.0.0/16
|
||||
- 23.200.0.0/16
|
||||
- 23.201.0.0/16
|
||||
- 23.202.0.0/16
|
||||
- 23.203.0.0/16
|
||||
- 23.204.0.0/16
|
||||
- 23.205.0.0/16
|
||||
- 23.206.0.0/16
|
||||
- 23.207.0.0/16
|
||||
- 23.208.0.0/16
|
||||
- 23.209.0.0/16
|
||||
- 23.210.0.0/16
|
||||
- 23.211.0.0/16
|
||||
- 23.212.0.0/16
|
||||
- 23.213.0.0/16
|
||||
- 23.214.0.0/16
|
||||
- 23.215.0.0/16
|
||||
- 23.216.0.0/16
|
||||
- 23.217.0.0/16
|
||||
- 23.218.0.0/16
|
||||
- 23.219.0.0/16
|
||||
- 23.220.0.0/16
|
||||
- 23.221.0.0/16
|
||||
- 23.222.0.0/16
|
||||
- 23.223.0.0/16
|
||||
- 31.0.0.0/4
|
||||
- 31.13.0.0/16
|
||||
- 37.10.0.0/16
|
||||
- 45.121.0.0/16
|
||||
- 45.121.184.0/24
|
||||
- 45.121.186.0/24
|
||||
- 46.0.0.0/4
|
||||
- 59.0.0.0/4
|
||||
- 60.254.0.0/16
|
||||
- 61.213.0.0/16
|
||||
- 63.146.0.0/16
|
||||
- 63.219.0.0/16
|
||||
- 63.243.0.0/16
|
||||
- 64.0.0.0/4
|
||||
- 64.124.0.0/16
|
||||
- 65.152.0.0/16
|
||||
- 65.158.0.0/16
|
||||
- 66.0.0.0/4
|
||||
- 67.0.0.0/4
|
||||
- 67.131.0.0/16
|
||||
- 69.0.0.0/4
|
||||
- 69.16.0.0/16
|
||||
- 69.63.0.0/16
|
||||
- 69.171.0.0/16
|
||||
- 69.192.0.0/16
|
||||
- 72.165.0.0/16
|
||||
- 72.246.0.0/16
|
||||
- 72.247.0.0/16
|
||||
- 74.0.0.0/4
|
||||
- 74.86.0.0/16
|
||||
- 74.201.0.0/16
|
||||
- 75.0.0.0/4
|
||||
- 75.126.0.0/16
|
||||
- 78.16.0.0/16
|
||||
- 84.53.0.0/16
|
||||
- 85.190.0.0/16
|
||||
- 88.0.0.0/4
|
||||
- 88.221.0.0/16
|
||||
- 92.122.0.0/16
|
||||
- 92.123.0.0/16
|
||||
- 95.100.0.0/16
|
||||
- 95.101.0.0/16
|
||||
- 96.0.0.0/4
|
||||
- 96.6.0.0/16
|
||||
- 96.16.0.0/16
|
||||
- 96.17.0.0/16
|
||||
- 103.10.124.0/24
|
||||
- 103.28.0.0/16
|
||||
- 103.28.54.0/24
|
||||
- 103.74.0.0/16
|
||||
- 104.0.0.0/4
|
||||
- 104.65.0.0/16
|
||||
- 104.66.0.0/16
|
||||
- 104.67.0.0/16
|
||||
- 104.68.0.0/16
|
||||
- 104.70.0.0/16
|
||||
- 104.71.0.0/16
|
||||
- 104.72.0.0/16
|
||||
- 104.73.0.0/16
|
||||
- 104.75.0.0/16
|
||||
- 104.76.0.0/16
|
||||
- 104.77.0.0/16
|
||||
- 104.79.0.0/16
|
||||
- 104.80.0.0/16
|
||||
- 104.81.0.0/16
|
||||
- 104.82.0.0/16
|
||||
- 104.83.0.0/16
|
||||
- 104.84.0.0/16
|
||||
- 104.85.0.0/16
|
||||
- 104.86.0.0/16
|
||||
- 104.87.0.0/16
|
||||
- 104.89.0.0/16
|
||||
- 104.90.0.0/16
|
||||
- 104.91.0.0/16
|
||||
- 104.92.0.0/16
|
||||
- 104.94.0.0/16
|
||||
- 104.95.0.0/16
|
||||
- 104.97.0.0/16
|
||||
- 104.98.0.0/16
|
||||
- 104.100.0.0/16
|
||||
- 104.101.0.0/16
|
||||
- 104.102.0.0/16
|
||||
- 104.103.0.0/16
|
||||
- 104.104.0.0/16
|
||||
- 104.105.0.0/16
|
||||
- 104.106.0.0/16
|
||||
- 104.107.0.0/16
|
||||
- 104.108.0.0/16
|
||||
- 104.109.0.0/16
|
||||
- 104.110.0.0/16
|
||||
- 104.111.0.0/16
|
||||
- 104.112.0.0/16
|
||||
- 104.113.0.0/16
|
||||
- 104.115.0.0/16
|
||||
- 104.116.0.0/16
|
||||
- 104.117.0.0/16
|
||||
- 104.118.0.0/16
|
||||
- 104.119.0.0/16
|
||||
- 104.120.0.0/16
|
||||
- 104.121.0.0/16
|
||||
- 104.122.0.0/16
|
||||
- 104.123.0.0/16
|
||||
- 104.124.0.0/16
|
||||
- 104.126.0.0/16
|
||||
- 104.127.0.0/16
|
||||
- 106.15.0.0/16
|
||||
- 110.45.0.0/16
|
||||
- 115.223.0.0/16
|
||||
- 117.103.0.0/16
|
||||
- 118.155.0.0/16
|
||||
- 118.214.0.0/16
|
||||
- 118.215.0.0/16
|
||||
- 120.24.184.25/32
|
||||
- 121.156.0.0/16
|
||||
- 122.252.0.0/16
|
||||
- 125.56.0.0/16
|
||||
- 125.252.0.0/16
|
||||
- 128.241.0.0/16
|
||||
- 139.175.0.0/16
|
||||
- 141.0.0.0/4
|
||||
- 146.66.0.0/16
|
||||
- 152.199.0.0/16
|
||||
- 153.254.0.0/16
|
||||
- 153.254.86.0/24
|
||||
- 155.133.0.0/16
|
||||
- 155.133.232.0/24
|
||||
- 155.133.233.0/24
|
||||
- 155.133.234.0/24
|
||||
- 155.133.235.0/24
|
||||
- 155.133.239.0/24
|
||||
- 155.133.244.0/24
|
||||
- 155.133.253.0/24
|
||||
- 155.133.254.0/24
|
||||
- 162.254.0.0/16
|
||||
- 162.254.192.0/24
|
||||
- 162.254.193.0/24
|
||||
- 162.254.194.0/24
|
||||
- 162.254.199.0/24
|
||||
- 165.254.0.0/16
|
||||
- 172.0.0.0/4
|
||||
- 172.224.0.0/16
|
||||
- 172.226.0.0/16
|
||||
- 172.227.0.0/16
|
||||
- 172.228.0.0/16
|
||||
- 172.229.0.0/16
|
||||
- 172.230.0.0/16
|
||||
- 172.231.0.0/16
|
||||
- 173.0.0.0/4
|
||||
- 173.197.0.0/16
|
||||
- 173.205.0.0/16
|
||||
- 173.222.0.0/16
|
||||
- 173.223.0.0/16
|
||||
- 173.252.0.0/16
|
||||
- 174.36.0.0/16
|
||||
- 175.99.0.0/16
|
||||
- 175.139.0.0/16
|
||||
- 180.101.192.0/24
|
||||
- 182.162.0.0/16
|
||||
- 184.0.0.0/4
|
||||
- 184.24.0.0/16
|
||||
- 184.25.0.0/16
|
||||
- 184.26.0.0/16
|
||||
- 184.29.0.0/16
|
||||
- 184.30.0.0/16
|
||||
- 184.31.0.0/16
|
||||
- 184.50.0.0/16
|
||||
- 184.51.0.0/16
|
||||
- 184.84.0.0/16
|
||||
- 184.85.0.0/16
|
||||
- 184.87.0.0/16
|
||||
- 185.25.0.0/16
|
||||
- 185.27.0.0/16
|
||||
- 185.88.0.0/16
|
||||
- 192.69.96.0/24
|
||||
- 192.81.0.0/16
|
||||
- 198.87.0.0/16
|
||||
- 198.172.0.0/16
|
||||
- 199.0.0.0/4
|
||||
- 199.239.0.0/16
|
||||
- 203.69.0.0/16
|
||||
- 203.80.149.0/24
|
||||
- 205.186.0.0/16
|
||||
- 205.196.6.0/24
|
||||
- 205.197.0.0/16
|
||||
- 208.0.0.0/4
|
||||
- 208.64.0.0/16
|
||||
- 208.64.200.0/24
|
||||
- 208.78.0.0/16
|
||||
- 208.78.164.0/24
|
||||
- 208.78.166.0/24
|
||||
- 208.78.167.0/24
|
||||
- 209.170.0.0/16
|
||||
- 210.61.0.0/16
|
||||
- 210.201.0.0/16
|
||||
- 216.3.0.0/16
|
||||
- 216.156.0.0/16
|
||||
- 223.119.0.0/16
|
@ -1,133 +0,0 @@
|
||||
payload:
|
||||
- 96.7.54.0/24
|
||||
- 96.17.68.0/24
|
||||
- 95.101.58.0/24
|
||||
- 92.123.234.0/24
|
||||
- 72.249.197.0/24
|
||||
- 72.247.118.0/24
|
||||
- 75.126.208.0/20
|
||||
- 69.192.4.0/24
|
||||
- 61.213.189.0/24
|
||||
- 61.213.168.0/24
|
||||
- 23.9.186.0/24
|
||||
- 23.9.179.0/24
|
||||
- 23.9.117.0/24
|
||||
- 23.77.27.0/24
|
||||
- 23.77.18.0/24
|
||||
- 23.76.210.0/24
|
||||
- 23.75.104.0/24
|
||||
- 23.67.53.0/24
|
||||
- 23.67.189.0/24
|
||||
- 23.66.135.0/24
|
||||
- 23.62.226.0/24
|
||||
- 23.61.244.0/24
|
||||
- 23.61.195.0/24
|
||||
- 23.57.66.0/24
|
||||
- 23.56.108.0/24
|
||||
- 23.55.56.0/24
|
||||
- 23.55.47.0/24
|
||||
- 23.55.37.0/24
|
||||
- 23.52.74.0/24
|
||||
- 23.52.171.0/24
|
||||
- 23.50.232.0/24
|
||||
- 23.5.229.0/24
|
||||
- 23.48.201.0/24
|
||||
- 23.47.143.0/24
|
||||
- 23.46.16.0/24
|
||||
- 23.46.147.0/24
|
||||
- 23.45.51.0/24
|
||||
- 23.45.127.0/24
|
||||
- 23.44.51.0/24
|
||||
- 23.44.172.0/24
|
||||
- 23.44.17.0/24
|
||||
- 23.43.49.0/24
|
||||
- 23.42.74.0/24
|
||||
- 23.37.126.0/24
|
||||
- 23.36.111.0/24
|
||||
- 23.34.96.0/24
|
||||
- 23.33.178.0/24
|
||||
- 23.33.151.0/24
|
||||
- 23.32.255.0/24
|
||||
- 23.32.248.0/24
|
||||
- 23.32.241.0/24
|
||||
- 23.219.172.0/24
|
||||
- 23.218.94.0/24
|
||||
- 23.218.5.0/24
|
||||
- 23.218.24.0/24
|
||||
- 23.215.188.0/24
|
||||
- 23.211.136.0/24
|
||||
- 23.211.117.0/24
|
||||
- 23.211.108.0/24
|
||||
- 23.210.215.0/24
|
||||
- 23.204.57.0/24
|
||||
- 23.204.147.0/24
|
||||
- 23.200.74.0/24
|
||||
- 23.2.16.0/24
|
||||
- 23.199.34.0/24
|
||||
- 23.198.137.0/24
|
||||
- 23.198.136.0/24
|
||||
- 23.198.103.0/24
|
||||
- 23.192.168.0/24
|
||||
- 23.192.119.0/24
|
||||
- 23.15.4.0/24
|
||||
- 23.12.40.0/24
|
||||
- 23.1.237.0/24
|
||||
- 23.1.236.0/24
|
||||
- 23.1.234.0/24
|
||||
- 23.7.208.0/20
|
||||
- 223.119.50.0/24
|
||||
- 223.119.248.0/24
|
||||
- 220.90.198.0/24
|
||||
- 219.76.10.0/24
|
||||
- 203.74.140.0/24
|
||||
- 203.69.141.0/24
|
||||
- 202.4.185.0/24
|
||||
- 2.21.98.0/24
|
||||
- 2.20.27.0/24
|
||||
- 189.6.45.0/24
|
||||
- 184.87.133.0/24
|
||||
- 184.86.250.0/24
|
||||
- 184.51.198.0/24
|
||||
- 184.51.183.0/24
|
||||
- 184.50.26.0/24
|
||||
- 184.31.165.0/24
|
||||
- 184.28.223.0/24
|
||||
- 184.28.218.0/24
|
||||
- 184.27.20.0/24
|
||||
- 184.26.194.0/24
|
||||
- 184.24.58.0/24
|
||||
- 184.150.58.0/24
|
||||
- 184.150.154.0/24
|
||||
- 175.207.14.0/24
|
||||
- 172.217.0.0/16
|
||||
- 172.232.19.0/24
|
||||
- 139.175.236.0/24
|
||||
- 125.56.201.0/24
|
||||
- 125.252.224.0/24
|
||||
- 119.56.4.0/24
|
||||
- 119.207.66.0/24
|
||||
- 119.207.64.0/24
|
||||
- 104.88.23.0/24
|
||||
- 104.84.150.0/24
|
||||
- 104.84.160.0/19
|
||||
- 104.81.21.0/24
|
||||
- 104.76.86.0/24
|
||||
- 104.76.172.0/24
|
||||
- 104.75.169.0/24
|
||||
- 104.74.47.0/24
|
||||
- 104.74.30.0/24
|
||||
- 104.74.214.0/24
|
||||
- 104.74.209.0/24
|
||||
- 104.71.139.0/24
|
||||
- 104.64.155.0/24
|
||||
- 104.250.32.0/23
|
||||
- 104.254.123.0/24
|
||||
- 104.127.4.0/24
|
||||
- 104.124.248.0/24
|
||||
- 104.124.233.0/24
|
||||
- 104.124.232.0/24
|
||||
- 104.122.6.0/24
|
||||
- 104.120.11.0/24
|
||||
- 104.116.243.0/24
|
||||
- 104.110.72.0/24
|
||||
- 153.254.86.0/24
|
@ -1,4 +0,0 @@
|
||||
payload:
|
||||
# > ABC
|
||||
- DOMAIN-SUFFIX,edgedatg.com
|
||||
- DOMAIN-SUFFIX,go.com
|
@ -1,10 +0,0 @@
|
||||
payload:
|
||||
# > AbemaTV
|
||||
# - USER-AGENT,AbemaTV*
|
||||
- PROCESS-NAME,tv.abema
|
||||
- DOMAIN-SUFFIX,abema.io
|
||||
- DOMAIN-SUFFIX,abema.tv
|
||||
- DOMAIN-SUFFIX,akamaized.net
|
||||
- DOMAIN-SUFFIX,ameba.jp
|
||||
- DOMAIN-SUFFIX,hayabusa.io
|
||||
- DOMAIN-KEYWORD,abematv.akamaized.net
|
@ -1,45 +0,0 @@
|
||||
payload:
|
||||
# > Amazon Prime Video
|
||||
# - USER-AGENT,InstantVideo.US*
|
||||
# - USER-AGENT,Prime%20Video*
|
||||
|
||||
- DOMAIN-KEYWORD,avoddashs
|
||||
|
||||
- DOMAIN-SUFFIX,aiv-cdn.net
|
||||
- DOMAIN-SUFFIX,aiv-delivery.net
|
||||
- DOMAIN-SUFFIX,amazonprimevideos.com
|
||||
- DOMAIN-SUFFIX,amazonvideo.cc
|
||||
- DOMAIN-SUFFIX,amazonvideo.com
|
||||
- DOMAIN-SUFFIX,amazonvideodirect.cc
|
||||
- DOMAIN-SUFFIX,atv-ext.amazon.com
|
||||
- DOMAIN-SUFFIX,atv-ext-eu.amazon.com
|
||||
- DOMAIN-SUFFIX,atv-ext-fe.amazon.com
|
||||
- DOMAIN-SUFFIX,atv-ps.amazon.com
|
||||
- DOMAIN-SUFFIX,atv-ps-eu.amazon.co.uk
|
||||
- DOMAIN-SUFFIX,atv-ps-eu.amazon.com
|
||||
- DOMAIN-SUFFIX,atv-ps-fe.amazon.co.jp
|
||||
- DOMAIN-SUFFIX,atv-ps-fe.amazon.com
|
||||
- DOMAIN-SUFFIX,fls-na.amazon.com
|
||||
- DOMAIN-SUFFIX,media-amazon.com
|
||||
- DOMAIN-SUFFIX,primevideo.cc
|
||||
- DOMAIN-SUFFIX,primevideo.com
|
||||
- DOMAIN-SUFFIX,prime-video.com
|
||||
- DOMAIN-SUFFIX,primevideo.info
|
||||
- DOMAIN-SUFFIX,primevideo.org
|
||||
- DOMAIN-SUFFIX,primevideo.tv
|
||||
- DOMAIN-SUFFIX,pv-cdn.net
|
||||
- DOMAIN-SUFFIX,video.a2z.com
|
||||
|
||||
- DOMAIN,avodmp4s3ww-a.akamaihd.net
|
||||
- DOMAIN,d1v5ir2lpwr8os.cloudfront.net
|
||||
- DOMAIN,d1y002tclu9djj.cloudfront.net
|
||||
- DOMAIN,d22qjgkvxw22r6.cloudfront.net
|
||||
- DOMAIN,d25xi40x97liuc.cloudfront.net
|
||||
- DOMAIN,dmqdd6hw24ucf.cloudfront.net
|
||||
- DOMAIN,d27xxe7juh1us6.cloudfront.net
|
||||
|
||||
- DOMAIN,dualstack.pefs-alb-266603904.eu-west-1.elb.amazonaws.com
|
||||
|
||||
# // 美区网页版需二选一走代理,如 URL-REGEX 则需 MITM www.amazon.com
|
||||
# // DOMAIN,www.amazon.com
|
||||
# URL-REGEX,^https?:\/\/www\.amazon\.com\/(Amazon-Video|gp\/video)\/
|
@ -1,33 +0,0 @@
|
||||
payload:
|
||||
# > Apple API
|
||||
- DOMAIN-KEYWORD,apple.com.akadns.net
|
||||
- DOMAIN-KEYWORD,icloud.com.akadns.net
|
||||
- DOMAIN-SUFFIX,aaplimg.com
|
||||
- DOMAIN-SUFFIX,apple.co
|
||||
- DOMAIN-SUFFIX,apple.com
|
||||
- DOMAIN-SUFFIX,apple-cloudkit.com
|
||||
- DOMAIN-SUFFIX,apple-mapkit.com
|
||||
- DOMAIN-SUFFIX,appsto.re
|
||||
- DOMAIN-SUFFIX,cdn-apple.com
|
||||
- DOMAIN-SUFFIX,icloud.com
|
||||
- DOMAIN-SUFFIX,icloud-content.com
|
||||
- DOMAIN-SUFFIX,itunes.com
|
||||
- DOMAIN-SUFFIX,me.com
|
||||
- DOMAIN-SUFFIX,mzstatic.com
|
||||
- IP-CIDR,17.0.0.0/8,no-resolve
|
||||
- IP-CIDR,63.92.224.0/19,no-resolve
|
||||
- IP-CIDR,65.199.22.0/23,no-resolve
|
||||
- IP-CIDR,139.178.128.0/18,no-resolve
|
||||
- IP-CIDR,144.178.0.0/19,no-resolve
|
||||
- IP-CIDR,144.178.36.0/22,no-resolve
|
||||
- IP-CIDR,144.178.48.0/20,no-resolve
|
||||
- IP-CIDR,192.35.50.0/24,no-resolve
|
||||
- IP-CIDR,198.183.17.0/24,no-resolve
|
||||
- IP-CIDR,205.180.175.0/24,no-resolve
|
||||
|
||||
# > Apple News
|
||||
- DOMAIN-SUFFIX,apple.comscoreresearch.com
|
||||
- DOMAIN-SUFFIX,apple.news
|
||||
|
||||
# > Apple Maps
|
||||
- PROCESS-NAME,com.apple.geod
|
@ -1,16 +0,0 @@
|
||||
payload:
|
||||
# > Apple Music
|
||||
# - USER-AGENT,Music*
|
||||
- PROCESS-NAME,music
|
||||
- DOMAIN-SUFFIX,applemusic.com
|
||||
- DOMAIN-SUFFIX,blobstore.apple.com
|
||||
- DOMAIN-SUFFIX,music.apple.com
|
||||
- DOMAIN,aod.itunes.apple.com
|
||||
- DOMAIN,aod-ssl.itunes.apple.com
|
||||
- DOMAIN,audio.itunes.apple.com
|
||||
- DOMAIN,audio-ssl.itunes.apple.com
|
||||
- DOMAIN,mvod.itunes.apple.com
|
||||
- DOMAIN,streamingaudio.itunes.apple.com
|
||||
|
||||
# iCloud Music Library
|
||||
- DOMAIN-SUFFIX,blobstore.apple.com
|
@ -1,12 +0,0 @@
|
||||
payload:
|
||||
# > Apple News and Apple Map TOMTOM Version
|
||||
# - USER-AGENT,AppleNews*
|
||||
# - USER-AGENT,com.apple.news*
|
||||
- DOMAIN,gspe1-ssl.ls.apple.com
|
||||
# - USER-AGENT,News*
|
||||
# - DOMAIN,apple.comscoreresearch.com
|
||||
# - DOMAIN,gateway.icloud.com
|
||||
# - DOMAIN,news-client.apple.com
|
||||
# - DOMAIN,news-edge.apple.com
|
||||
# - DOMAIN,news-events.apple.com
|
||||
# - DOMAIN-SUFFIX,apple.news
|
@ -1,5 +0,0 @@
|
||||
payload:
|
||||
# > Apple TV
|
||||
- DOMAIN,np-edge.itunes.apple.com
|
||||
- DOMAIN,play-edge.itunes.apple.com
|
||||
- DOMAIN-SUFFIX,tv.apple.com
|
@ -1,15 +0,0 @@
|
||||
payload:
|
||||
# > BBC iPlayer
|
||||
- PROCESS-NAME,bbc.iplayer.android
|
||||
- DOMAIN-KEYWORD,bbcfmt
|
||||
- DOMAIN,aod-dash-uk-live.akamaized.net
|
||||
- DOMAIN,aod-hls-uk-live.akamaized.net
|
||||
- DOMAIN,vod-dash-uk-live.akamaized.net
|
||||
- DOMAIN,vod-thumb-uk-live.akamaized.net
|
||||
- DOMAIN-SUFFIX,bbc.co
|
||||
- DOMAIN-SUFFIX,bbc.co.uk
|
||||
- DOMAIN-SUFFIX,bbc.com
|
||||
- DOMAIN-SUFFIX,bbcfmt.hs.llnwd.net
|
||||
- DOMAIN-SUFFIX,bbci.co
|
||||
- DOMAIN-SUFFIX,bbci.co.uk
|
||||
- DOMAIN-SUFFIX,bidi.net.uk
|
@ -1,8 +0,0 @@
|
||||
payload:
|
||||
# > Bahamut
|
||||
# - USER-AGENT,Anime*
|
||||
- PROCESS-NAME,tw.com.gamer.android.animad
|
||||
- DOMAIN-SUFFIX,bahamut.com.tw
|
||||
- DOMAIN-SUFFIX,gamer.com.tw
|
||||
- DOMAIN,gamer-cds.cdn.hinet.net
|
||||
- DOMAIN,gamer2-cds.cdn.hinet.net
|
@ -1,16 +0,0 @@
|
||||
payload:
|
||||
# > Bilibili
|
||||
# - USER-AGENT,bili*
|
||||
- DOMAIN-SUFFIX,acg.tv
|
||||
- DOMAIN-SUFFIX,acgvideo.com
|
||||
- DOMAIN-SUFFIX,b23.tv
|
||||
- DOMAIN-SUFFIX,bilibili.com
|
||||
- DOMAIN-SUFFIX,bilibili.tv
|
||||
- DOMAIN-SUFFIX,biliapi.net
|
||||
- DOMAIN-SUFFIX,biliapi.com
|
||||
- DOMAIN-SUFFIX,bilivideo.com
|
||||
- DOMAIN-SUFFIX,hdslb.com
|
||||
- DOMAIN,upos-hz-mirrorakam.akamaized.net
|
||||
# Hong Kong, Macau, Taiwan
|
||||
# - USER-AGENT,bili-inter*
|
||||
- DOMAIN,apiintl.biliapi.net
|
@ -1,300 +0,0 @@
|
||||
payload:
|
||||
# > Forum
|
||||
- DOMAIN-SUFFIX,bitcointalk.org
|
||||
|
||||
# > Exchange
|
||||
- DOMAIN-SUFFIX,aex.com
|
||||
- DOMAIN-SUFFIX,bibox.com
|
||||
- DOMAIN-SUFFIX,bitfinex.com
|
||||
- DOMAIN-SUFFIX,bithumb.com
|
||||
- DOMAIN-SUFFIX,bitmex.com
|
||||
- DOMAIN-SUFFIX,bitstamp.net
|
||||
- DOMAIN-SUFFIX,bittrex.com
|
||||
- DOMAIN-SUFFIX,bybit.com
|
||||
- DOMAIN-SUFFIX,coinbase.com
|
||||
- DOMAIN-SUFFIX,coincheck.com
|
||||
- DOMAIN-SUFFIX,coinone.co.kr
|
||||
- DOMAIN-SUFFIX,gemini.com
|
||||
- DOMAIN-SUFFIX,korbit.co.kr
|
||||
- DOMAIN-SUFFIX,kraken.com
|
||||
- DOMAIN-SUFFIX,kucoin.com
|
||||
- DOMAIN-SUFFIX,liquid.com
|
||||
- DOMAIN-SUFFIX,poloniex.com
|
||||
- DOMAIN-SUFFIX,bitbank.cc
|
||||
- DOMAIN-SUFFIX,bitcoin.org
|
||||
- DOMAIN-SUFFIX,bitquick.co
|
||||
- DOMAIN-SUFFIX,btcbox.co.jp
|
||||
- DOMAIN-SUFFIX,cex.io
|
||||
- DOMAIN-SUFFIX,dogecoin.com
|
||||
- DOMAIN-SUFFIX,paxful.com
|
||||
- DOMAIN-SUFFIX,tether.to
|
||||
- DOMAIN-SUFFIX,dydx.exchange
|
||||
- DOMAIN-SUFFIX,solana.com
|
||||
- DOMAIN-SUFFIX,avax.network
|
||||
- DOMAIN-SUFFIX,optimism.io
|
||||
- DOMAIN-SUFFIX,arbitrum.io
|
||||
- DOMAIN-SUFFIX,poly.network
|
||||
- DOMAIN-SUFFIX,zkscan.io
|
||||
- DOMAIN-SUFFIX,zksync.io
|
||||
- DOMAIN-SUFFIX,boba.network
|
||||
|
||||
# > Binance
|
||||
- DOMAIN-SUFFIX,binance.cc
|
||||
- DOMAIN-SUFFIX,binance.cloud
|
||||
- DOMAIN-SUFFIX,binance.com
|
||||
- DOMAIN-SUFFIX,binance.im
|
||||
- DOMAIN-SUFFIX,binance.me
|
||||
- DOMAIN-SUFFIX,binance.us
|
||||
- DOMAIN-SUFFIX,bnappzh.co
|
||||
- DOMAIN-SUFFIX,bnappzh.com
|
||||
- DOMAIN-SUFFIX,bnbstatic.com
|
||||
- DOMAIN-SUFFIX,bntrace.com
|
||||
- DOMAIN-SUFFIX,binance.charity
|
||||
- DOMAIN-SUFFIX,binance.co
|
||||
- DOMAIN-SUFFIX,binance.info
|
||||
- DOMAIN-SUFFIX,binance.net
|
||||
- DOMAIN-SUFFIX,binance.org
|
||||
- DOMAIN-SUFFIX,binance.vision
|
||||
- DOMAIN-SUFFIX,binanceapi.com
|
||||
- DOMAIN-SUFFIX,binancezh.be
|
||||
- DOMAIN-SUFFIX,binancezh.biz
|
||||
- DOMAIN-SUFFIX,binancezh.cc
|
||||
- DOMAIN-SUFFIX,binancezh.co
|
||||
- DOMAIN-SUFFIX,binancezh.com
|
||||
- DOMAIN-SUFFIX,binancezh.info
|
||||
- DOMAIN-SUFFIX,binancezh.ink
|
||||
- DOMAIN-SUFFIX,binancezh.kim
|
||||
- DOMAIN-SUFFIX,binancezh.link
|
||||
- DOMAIN-SUFFIX,binancezh.live
|
||||
- DOMAIN-SUFFIX,binancezh.mobi
|
||||
- DOMAIN-SUFFIX,binancezh.net
|
||||
- DOMAIN-SUFFIX,binancezh.pro
|
||||
- DOMAIN-SUFFIX,binancezh.sh
|
||||
- DOMAIN-SUFFIX,binancezh.top
|
||||
- DOMAIN-SUFFIX,bnappzh.mobi
|
||||
- DOMAIN-SUFFIX,bsc.getblock.io
|
||||
- DOMAIN-SUFFIX,bscscan.com
|
||||
- PROCESS-NAME,Binance.exe
|
||||
- DOMAIN-KEYWORD,binance
|
||||
|
||||
# > Huobi
|
||||
- DOMAIN-SUFFIX,hbabit.com
|
||||
- DOMAIN-SUFFIX,hbfile.net
|
||||
- DOMAIN-SUFFIX,huobi.com
|
||||
- DOMAIN-SUFFIX,huobi.me
|
||||
- DOMAIN-SUFFIX,huobi.pro
|
||||
- DOMAIN-SUFFIX,huobi.sc
|
||||
- DOMAIN-SUFFIX,huobiasia.vip
|
||||
- DOMAIN-SUFFIX,huobigroup.com
|
||||
- DOMAIN-SUFFIX,huobitoken.com
|
||||
- DOMAIN-SUFFIX,heco-scan.com
|
||||
- DOMAIN-SUFFIX,hecoview.com
|
||||
- DOMAIN-SUFFIX,hbfile.net
|
||||
- DOMAIN-SUFFIX,huobi.br.com
|
||||
- DOMAIN-SUFFIX,bitderiv.com
|
||||
- DOMAIN-SUFFIX,hecochain.com
|
||||
- DOMAIN-SUFFIX,huobi.ws
|
||||
- DOMAIN-SUFFIX,huobi.ug
|
||||
- DOMAIN-SUFFIX,huobi.co.ma
|
||||
- DOMAIN-SUFFIX,huobi.br.com
|
||||
- PROCESS-NAME,Huobi.exe
|
||||
- DOMAIN-KEYWORD,huobi
|
||||
|
||||
# > OKX
|
||||
- DOMAIN-SUFFIX,okex.com
|
||||
- DOMAIN-SUFFIX,okx.com
|
||||
- PROCESS-NAME,OKX.exe
|
||||
- DOMAIN-KEYWORD,okx
|
||||
|
||||
# > asproex
|
||||
- DOMAIN-SUFFIX,asproex.com
|
||||
- DOMAIN-SUFFIX,asproexapi.com
|
||||
|
||||
# > bitflyer
|
||||
- DOMAIN-SUFFIX,bitflyer.com
|
||||
- DOMAIN-SUFFIX,bitflyer.jp
|
||||
|
||||
# > bitsquare
|
||||
- DOMAIN-SUFFIX,bisq.io
|
||||
- DOMAIN-SUFFIX,bisq.network
|
||||
- DOMAIN-SUFFIX,bitsquare.io
|
||||
|
||||
# > coinone
|
||||
- DOMAIN-SUFFIX,coinone.co.kr
|
||||
- DOMAIN-SUFFIX,coinonecore.com
|
||||
- DOMAIN-SUFFIX,coinonecorp.com
|
||||
|
||||
# > ethereum
|
||||
- DOMAIN-SUFFIX,devcon.org
|
||||
- DOMAIN-SUFFIX,ethereum.foundation
|
||||
- DOMAIN-SUFFIX,ethereum.org
|
||||
- DOMAIN-SUFFIX,etherscan.io
|
||||
- DOMAIN-SUFFIX,nansen.ai
|
||||
- DOMAIN-SUFFIX,ethgasstation.info
|
||||
- DOMAIN-SUFFIX,watchtheburn.com
|
||||
- DOMAIN-SUFFIX,flashbots.net
|
||||
- DOMAIN-SUFFIX,cryptofees.info
|
||||
- DOMAIN-SUFFIX,etherscan.io
|
||||
- DOMAIN-SUFFIX,ethereum-magicians.org
|
||||
- DOMAIN-SUFFIX,vitalik.ca
|
||||
- DOMAIN-SUFFIX,ethfans.org
|
||||
- DOMAIN-SUFFIX,ethereum.cn
|
||||
- DOMAIN-SUFFIX,ethereum.stackexchange.com
|
||||
- DOMAIN-SUFFIX,etherscan.com
|
||||
- DOMAIN-SUFFIX,parity.io
|
||||
- DOMAIN-SUFFIX,ethernodes.org
|
||||
|
||||
# > localbitcoins
|
||||
- DOMAIN-SUFFIX,localbitcoins.com
|
||||
- DOMAIN-SUFFIX,localbitcoinschain.com
|
||||
|
||||
# > zb
|
||||
- DOMAIN-SUFFIX,zb.app
|
||||
- DOMAIN-SUFFIX,zb.com
|
||||
- DOMAIN-SUFFIX,zb.io
|
||||
- DOMAIN-SUFFIX,zb.live
|
||||
|
||||
# > Analysis
|
||||
- DOMAIN-SUFFIX,aicoin.com
|
||||
- DOMAIN-SUFFIX,aimoon.com
|
||||
- DOMAIN-SUFFIX,coingecko.com
|
||||
- DOMAIN-SUFFIX,coinmarketcap.com
|
||||
- DOMAIN-SUFFIX,glassnode.com
|
||||
- DOMAIN-SUFFIX,coinmetrics.io
|
||||
- DOMAIN-SUFFIX,tokenview.com
|
||||
- DOMAIN-SUFFIX,oklink.com
|
||||
- DOMAIN-SUFFIX,blockchair.com
|
||||
- DOMAIN-SUFFIX,intotheblock.com
|
||||
- DOMAIN-SUFFIX,bytetree.com
|
||||
- DOMAIN-SUFFIX,coin.dance
|
||||
- DOMAIN-SUFFIX,defieye.io
|
||||
- DOMAIN-SUFFIX,duneanalytics.com
|
||||
- DOMAIN-SUFFIX,tokenterminal.com
|
||||
- DOMAIN-SUFFIX,dapp.review
|
||||
- DOMAIN-SUFFIX,dappradar.com
|
||||
- DOMAIN-SUFFIX,stateofthedapps.com
|
||||
- DOMAIN-SUFFIX,thegraph.com
|
||||
- DOMAIN-SUFFIX,debank.com
|
||||
- DOMAIN-SUFFIX,vfat.tools
|
||||
- DOMAIN-SUFFIX,loanscan.io
|
||||
- DOMAIN-SUFFIX,defirate.com
|
||||
- DOMAIN-SUFFIX,defipulse.com
|
||||
- DOMAIN-SUFFIX,apy999.com
|
||||
- DOMAIN-SUFFIX,defieye.io
|
||||
- DOMAIN-SUFFIX,dextools.io
|
||||
- DOMAIN-SUFFIX,tradingview.com
|
||||
- DOMAIN-SUFFIX,dcabtc.com
|
||||
- DOMAIN-SUFFIX,chainalysis.com
|
||||
- DOMAIN-SUFFIX,cryptoquant.com
|
||||
- DOMAIN-SUFFIX,viewbase.com
|
||||
- DOMAIN-SUFFIX,bitcoinity.org
|
||||
- DOMAIN-SUFFIX,cryptocompare.com
|
||||
- DOMAIN-SUFFIX,coincodex.com
|
||||
- DOMAIN-SUFFIX,cointrendz.com
|
||||
- DOMAIN-SUFFIX,coincheckup.com
|
||||
- DOMAIN-SUFFIX,thetie.io
|
||||
- DOMAIN-SUFFIX,cryptorank.io
|
||||
- DOMAIN-SUFFIX,tradeblock.com
|
||||
- DOMAIN-SUFFIX,nyctale.io
|
||||
- DOMAIN-SUFFIX,dovemetrics.com
|
||||
- DOMAIN-SUFFIX,cryptorank.io
|
||||
- DOMAIN-SUFFIX,icodrops.com
|
||||
- DOMAIN-SUFFIX,chainbroker.io
|
||||
- DOMAIN-SUFFIX,crunchbase.com
|
||||
- DOMAIN-SUFFIX,defillama.com
|
||||
- DOMAIN-SUFFIX,coinowo.com
|
||||
- DOMAIN-SUFFIX,earni.fi
|
||||
- DOMAIN-SUFFIX,dropsearn.com
|
||||
- DOMAIN-SUFFIX,bitcoin.it
|
||||
- DOMAIN-SUFFIX,bitcoinmagazine.com
|
||||
- DOMAIN-SUFFIX,blockchain.com
|
||||
- DOMAIN-SUFFIX,tronscan.org
|
||||
|
||||
# > POOL
|
||||
- DOMAIN-SUFFIX,btc.com
|
||||
- DOMAIN-SUFFIX,f2pool.com
|
||||
- DOMAIN-SUFFIX,cbeci.org
|
||||
- DOMAIN-SUFFIX,digiconomist.net
|
||||
- DOMAIN-SUFFIX,1ml.com
|
||||
- DOMAIN-SUFFIX,bitcoinvisuals.com
|
||||
- DOMAIN-SUFFIX,crypto51.app
|
||||
- DOMAIN-SUFFIX,masternodes.online
|
||||
- DOMAIN-SUFFIX,bitnodes.earn.com
|
||||
- DOMAIN-SUFFIX,poolin.com
|
||||
- DOMAIN-SUFFIX,ethermine.org
|
||||
- DOMAIN-SUFFIX,ewapool.net
|
||||
|
||||
# > FTX
|
||||
- DOMAIN-SUFFIX,ftx.com
|
||||
|
||||
# > Metamask
|
||||
- DOMAIN-KEYWORD,metamask
|
||||
- DOMAIN,token-api.metaswap.codefi.network
|
||||
- DOMAIN,min-api.cryptocompare.com
|
||||
|
||||
# > NFT
|
||||
- DOMAIN-SUFFIX,opensea.io
|
||||
- DOMAIN-SUFFIX,nftscan.com
|
||||
- DOMAIN-SUFFIX,makersplace.com
|
||||
- DOMAIN-SUFFIX,nonfungible.com
|
||||
- DOMAIN-SUFFIX,cryptoslam.io
|
||||
- DOMAIN-SUFFIX,cryptoart.io
|
||||
- DOMAIN-SUFFIX,nftcalendar.io
|
||||
- DOMAIN-SUFFIX,nftgo.io
|
||||
|
||||
# > IPFS
|
||||
- DOMAIN-SUFFIX,filecoin.io
|
||||
- DOMAIN-SUFFIX,docs.lotu.sh
|
||||
- DOMAIN-SUFFIX,ipfs.io
|
||||
- DOMAIN-SUFFIX,docs.ipfs.io
|
||||
- DOMAIN-SUFFIX,discuss.ipfs.io
|
||||
|
||||
# > EOS
|
||||
- DOMAIN-SUFFIX,eos.io
|
||||
- DOMAIN-SUFFIX,developers.eos.io
|
||||
- DOMAIN-SUFFIX,block.one
|
||||
- DOMAIN-SUFFIX,eostracker.io
|
||||
- DOMAIN-SUFFIX,eosflare.io
|
||||
- DOMAIN-SUFFIX,eospark.com
|
||||
- DOMAIN-SUFFIX,bloks.io
|
||||
|
||||
# > Lightning
|
||||
- DOMAIN-SUFFIX,lightning.engineering
|
||||
- DOMAIN-SUFFIX,lightning.community
|
||||
- DOMAIN-SUFFIX,acinq.co
|
||||
- DOMAIN-SUFFIX,1ml.com
|
||||
|
||||
# > Token
|
||||
- DOMAIN-SUFFIX,tokenpocket.pro
|
||||
- DOMAIN-SUFFIX,token.im
|
||||
- DOMAIN-SUFFIX,phantom.app
|
||||
- DOMAIN-SUFFIX,tronlink.org
|
||||
- DOMAIN-SUFFIX,myetherwallet.com
|
||||
- DOMAIN-SUFFIX,jaxx.io
|
||||
- DOMAIN-SUFFIX,trustwalletapp.com
|
||||
|
||||
# > Gate
|
||||
- DOMAIN-SUFFIX,gate.ac
|
||||
- DOMAIN-SUFFIX,gate.io
|
||||
|
||||
# > Mexc
|
||||
- DOMAIN-SUFFIX,mexc.com
|
||||
|
||||
# > Dapp
|
||||
- DOMAIN-SUFFIX,sushi.com
|
||||
- DOMAIN-SUFFIX,uniswap.org
|
||||
- DOMAIN-SUFFIX,sunswap.com
|
||||
- DOMAIN-SUFFIX,traderjoexyz.com
|
||||
- DOMAIN-SUFFIX,raydium.io
|
||||
- DOMAIN-SUFFIX,synthetix.io
|
||||
- DOMAIN-SUFFIX,aave.com
|
||||
- DOMAIN-SUFFIX,compound.finance
|
||||
- DOMAIN-SUFFIX,makerdao.com
|
||||
- DOMAIN-SUFFIX,wbtc.network
|
||||
- DOMAIN-SUFFIX,pancakeswap.finance
|
||||
- DOMAIN-SUFFIX,pancakeswap.com
|
||||
- DOMAIN-SUFFIX,mdex.co
|
||||
- DOMAIN-SUFFIX,mdex.one
|
||||
- DOMAIN-SUFFIX,mdex.com
|
||||
- DOMAIN-SUFFIX,mdex.me
|
||||
- DOMAIN-SUFFIX,1inch.io
|
@ -1,25 +0,0 @@
|
||||
payload:
|
||||
# > DAZN
|
||||
# - USER-AGENT,DAZN*
|
||||
|
||||
- PROCESS-NAME,com.dazn
|
||||
|
||||
- DOMAIN-KEYWORD,voddazn
|
||||
|
||||
- DOMAIN-SUFFIX,dazn.com
|
||||
- DOMAIN-SUFFIX,dazn-api.com
|
||||
- DOMAIN-SUFFIX,dazndn.com
|
||||
- DOMAIN-SUFFIX,daznedge.net
|
||||
- DOMAIN-SUFFIX,daznfeeds.com
|
||||
- DOMAIN-SUFFIX,daznservices.com
|
||||
- DOMAIN-SUFFIX,indazn.com
|
||||
- DOMAIN-SUFFIX,indaznlab.com
|
||||
|
||||
- DOMAIN,daznfeeds.com.edgekey.net
|
||||
- DOMAIN,dca-lm-livedazn.secure.footprint.net
|
||||
- DOMAIN,h-dazn.online-metrix.net
|
||||
- DOMAIN,images-daznservices-com.cdn.ampproject.org
|
||||
- DOMAIN,d151l6v8er5bdm.cloudfront.net
|
||||
|
||||
- IP-CIDR,185.42.236.0/24,no-resolve
|
||||
- IP-CIDR,185.42.238.0/24,no-resolve
|
@ -1,8 +0,0 @@
|
||||
payload:
|
||||
# > Discord
|
||||
- DOMAIN-SUFFIX,discord.com
|
||||
- DOMAIN-SUFFIX,discord.gg
|
||||
- DOMAIN-SUFFIX,discord.media
|
||||
- DOMAIN-SUFFIX,discordapp.com
|
||||
- DOMAIN-SUFFIX,discordapp.net
|
||||
- DOMAIN-SUFFIX,discordstatus.com
|
@ -1,11 +0,0 @@
|
||||
payload:
|
||||
# > Discovery Plus
|
||||
- PROCESS-NAME,com.discovery.discoveryplus.mobile
|
||||
- DOMAIN-SUFFIX,content-ause1-ur-discovery1.uplynk.com
|
||||
- DOMAIN-SUFFIX,disco-api.com
|
||||
- DOMAIN-SUFFIX,discoveryplus.com
|
||||
- DOMAIN-SUFFIX,fwmrm.net
|
||||
- DOMAIN-SUFFIX,getblueshift.com
|
||||
- DOMAIN-SUFFIX,litix.io
|
||||
- DOMAIN-SUFFIX,mobile-collector.newrelic.com
|
||||
- DOMAIN-SUFFIX,uplynk.com
|
@ -1,21 +0,0 @@
|
||||
payload:
|
||||
# > Disney Plus
|
||||
# - USER-AGENT,Disney*
|
||||
|
||||
- PROCESS-NAME,com.disney.disneyplus
|
||||
|
||||
- DOMAIN-SUFFIX,adobedtm.com
|
||||
- DOMAIN-SUFFIX,bam.nr-date.net
|
||||
- DOMAIN-SUFFIX,bamgrid.com
|
||||
- DOMAIN-SUFFIX,braze.com
|
||||
- DOMAIN-SUFFIX,cdn.optimizely.com
|
||||
- DOMAIN-SUFFIX,d9.flashtalking.com
|
||||
- DOMAIN-SUFFIX,disney.demdex.net
|
||||
- DOMAIN-SUFFIX,disney.my.sentry.io
|
||||
- DOMAIN-SUFFIX,disneyplus.bn5x.net
|
||||
- DOMAIN-SUFFIX,disneyplus.com
|
||||
- DOMAIN-SUFFIX,disneyplus.com.ssl.sc.omtrdc.net
|
||||
- DOMAIN-SUFFIX,disney-plus.net
|
||||
- DOMAIN-SUFFIX,disney-portal.my.onetrust.com
|
||||
- DOMAIN-SUFFIX,dssott.com
|
||||
- DOMAIN-SUFFIX,registerdisney.go.com
|
@ -1,335 +0,0 @@
|
||||
payload:
|
||||
# China Banks
|
||||
# > Agricultural Bank of China
|
||||
- DOMAIN-SUFFIX,abchina.com
|
||||
- DOMAIN-SUFFIX,abchina.com.cn
|
||||
|
||||
# > Bank of China
|
||||
- DOMAIN-SUFFIX,boc.cn
|
||||
|
||||
# > China Citic Bank
|
||||
- DOMAIN-SUFFIX,citicbank.com
|
||||
- DOMAIN-SUFFIX,ecitic.com
|
||||
- DOMAIN-SUFFIX,ecitic.net
|
||||
|
||||
# > China Construction Bank
|
||||
- DOMAIN-SUFFIX,ccb.com
|
||||
- DOMAIN-SUFFIX,ccb.com.cn
|
||||
|
||||
# > China Everbright Bank
|
||||
- DOMAIN-SUFFIX,cebbank.com
|
||||
|
||||
# > China Merchants Bank
|
||||
# - USER-AGENT,cmb*
|
||||
- DOMAIN-SUFFIX,cmbchina.com
|
||||
- DOMAIN-SUFFIX,cmbimg.com
|
||||
- DOMAIN-SUFFIX,cmbt.cn
|
||||
- DOMAIN-SUFFIX,mbcloud.com
|
||||
|
||||
# > Industrial and Commercial Bank of China
|
||||
# - USER-AGENT,%E4%B8%AD%E5%9B%BD%E5%B7%A5%E5%95%86%E9%93%B6%E8%A1%8C*
|
||||
- DOMAIN-SUFFIX,icbc.com.cn
|
||||
|
||||
# > Ping An Bank
|
||||
- DOMAIN-SUFFIX,pingan.com
|
||||
- DOMAIN-SUFFIX,pingan.com.cn
|
||||
|
||||
# Type
|
||||
# > Beplay
|
||||
- DOMAIN-KEYWORD,beplay
|
||||
|
||||
# > Blizzard
|
||||
# - USER-AGENT,hearthstone*
|
||||
- DOMAIN,cdp.cloud.unity3d.com
|
||||
- DOMAIN-SUFFIX,battle.net
|
||||
- DOMAIN-SUFFIX,battlenet.com
|
||||
- DOMAIN-SUFFIX,blizzard.com
|
||||
|
||||
# > Prior
|
||||
- DOMAIN,client.amplifi.com
|
||||
- DOMAIN,ip.bjango.com
|
||||
- DOMAIN-SUFFIX,alphassl.com
|
||||
- DOMAIN-SUFFIX,edu.cn
|
||||
|
||||
# > RRYS
|
||||
- DOMAIN-SUFFIX,p4pfile.com
|
||||
- DOMAIN-SUFFIX,zmzfile.com
|
||||
|
||||
# > Sony
|
||||
# - USER-AGENT,RemotePlay*
|
||||
- DOMAIN-SUFFIX,playstation.com
|
||||
- DOMAIN-SUFFIX,playstation.net
|
||||
- DOMAIN-SUFFIX,playstationnetwork.com
|
||||
- DOMAIN-SUFFIX,sony.com
|
||||
- DOMAIN-SUFFIX,sonyentertainmentnetwork.com
|
||||
|
||||
# > TeamViewer
|
||||
- IP-CIDR,185.188.32.0/24,no-resolve
|
||||
- IP-CIDR,185.188.33.0/24,no-resolve
|
||||
- IP-CIDR,185.188.34.0/24,no-resolve
|
||||
- IP-CIDR,185.188.35.0/24,no-resolve
|
||||
- IP-CIDR6,2a0b:b580::/48,no-resolve
|
||||
- IP-CIDR6,2a0b:b581::/48,no-resolve
|
||||
- IP-CIDR6,2a0b:b582::/48,no-resolve
|
||||
- IP-CIDR6,2a0b:b583::/48,no-resolve
|
||||
|
||||
# > Tencent
|
||||
- IP-CIDR,182.254.116.0/24,no-resolve
|
||||
|
||||
# > Tencent WeChat (International)
|
||||
- IP-CIDR,101.32.104.0/21,DIRECT,no-resolve
|
||||
- IP-CIDR,101.32.118.0/23,DIRECT,no-resolve
|
||||
- IP-CIDR,101.32.96.0/20,DIRECT,no-resolve
|
||||
- IP-CIDR,129.226.0.0/16,DIRECT,no-resolve
|
||||
- IP-CIDR,183.128.0.0/11,DIRECT,no-resolve
|
||||
- IP-CIDR,183.131.48.0/20,DIRECT,no-resolve
|
||||
|
||||
- DOMAIN-SUFFIX,10010.com
|
||||
- DOMAIN-SUFFIX,10086.cn
|
||||
- DOMAIN-SUFFIX,12306.cn
|
||||
- DOMAIN-SUFFIX,12306.com
|
||||
- DOMAIN-SUFFIX,126.net
|
||||
- DOMAIN-SUFFIX,163.com
|
||||
- DOMAIN-SUFFIX,189.cn
|
||||
- DOMAIN-SUFFIX,360.cn
|
||||
- DOMAIN-SUFFIX,360.com
|
||||
- DOMAIN-SUFFIX,360buy.com
|
||||
- DOMAIN-SUFFIX,360buyimg.com
|
||||
- DOMAIN-SUFFIX,36kr.com
|
||||
- DOMAIN-SUFFIX,51ym.me
|
||||
- DOMAIN-SUFFIX,58.com
|
||||
- DOMAIN-SUFFIX,8686c.com
|
||||
- DOMAIN-SUFFIX,95516.com
|
||||
- DOMAIN-SUFFIX,abercrombie.com
|
||||
- DOMAIN-SUFFIX,acfun.tv
|
||||
- DOMAIN-SUFFIX,adobesc.com
|
||||
- DOMAIN-SUFFIX,air-matters.com
|
||||
- DOMAIN-SUFFIX,air-matters.io
|
||||
- DOMAIN-SUFFIX,aixifan.com
|
||||
- DOMAIN-SUFFIX,akadns.net
|
||||
- DOMAIN-SUFFIX,alibaba.com
|
||||
- DOMAIN-SUFFIX,alibabacloud.com
|
||||
- DOMAIN-SUFFIX,alicdn.com
|
||||
- DOMAIN-SUFFIX,alipay.com
|
||||
- DOMAIN-SUFFIX,alipayobjects.com
|
||||
- DOMAIN-SUFFIX,aliyun.com
|
||||
- DOMAIN-SUFFIX,aliyuncs.com
|
||||
- DOMAIN-SUFFIX,amap.com
|
||||
- DOMAIN-SUFFIX,appshike.com
|
||||
- DOMAIN-SUFFIX,appstore.com
|
||||
- DOMAIN-SUFFIX,autonavi.com
|
||||
- DOMAIN-SUFFIX,bababian.com
|
||||
- DOMAIN-SUFFIX,baidu.com
|
||||
- DOMAIN-SUFFIX,baidupcs.com
|
||||
- DOMAIN-SUFFIX,bdimg.com
|
||||
- DOMAIN-SUFFIX,bdstatic.com
|
||||
- DOMAIN-SUFFIX,beatsbydre.com
|
||||
- DOMAIN-SUFFIX,broadcasthe.net
|
||||
- DOMAIN-SUFFIX,caiyunapp.com
|
||||
- DOMAIN-SUFFIX,ccgslb.com
|
||||
- DOMAIN-SUFFIX,ccgslb.net
|
||||
- DOMAIN-SUFFIX,chinacache.net
|
||||
- DOMAIN-SUFFIX,chunbo.com
|
||||
- DOMAIN-SUFFIX,chunboimg.com
|
||||
- DOMAIN-SUFFIX,clashroyaleapp.com
|
||||
- DOMAIN-SUFFIX,clouddn.com
|
||||
- DOMAIN-SUFFIX,cloudsigma.com
|
||||
- DOMAIN-SUFFIX,cloudxns.net
|
||||
- DOMAIN-SUFFIX,cmct.tv
|
||||
- DOMAIN-SUFFIX,cmfu.com
|
||||
- DOMAIN-SUFFIX,cnbeta.com
|
||||
- DOMAIN-SUFFIX,cnbetacdn.com
|
||||
- DOMAIN-SUFFIX,chdbits.co
|
||||
- DOMAIN-SUFFIX,cnlang.org
|
||||
- DOMAIN-SUFFIX,coolapk.com
|
||||
- DOMAIN-SUFFIX,cn88.net
|
||||
- DOMAIN-SUFFIX,dct-cloud.com
|
||||
- DOMAIN-SUFFIX,didialift.com
|
||||
- DOMAIN-SUFFIX,digicert.com
|
||||
- DOMAIN-SUFFIX,douban.com
|
||||
- DOMAIN-SUFFIX,doubanio.com
|
||||
- DOMAIN-SUFFIX,douyin.com
|
||||
- DOMAIN-SUFFIX,douyu.com
|
||||
- DOMAIN-SUFFIX,douyu.tv
|
||||
- DOMAIN-SUFFIX,douyutv.com
|
||||
- DOMAIN-SUFFIX,duokan.com
|
||||
- DOMAIN-SUFFIX,duoshuo.com
|
||||
- DOMAIN-SUFFIX,dytt8.net
|
||||
- DOMAIN-SUFFIX,easou.com
|
||||
- DOMAIN-SUFFIX,eudic.net
|
||||
- DOMAIN-SUFFIX,ewqcxz.com
|
||||
- DOMAIN-SUFFIX,feng.com
|
||||
- DOMAIN-SUFFIX,fir.im
|
||||
- DOMAIN-SUFFIX,firefox.com
|
||||
- DOMAIN-SUFFIX,frdic.com
|
||||
- DOMAIN-SUFFIX,fresh-ideas.cc
|
||||
- DOMAIN-SUFFIX,gameloft.com
|
||||
- DOMAIN-SUFFIX,garmin.com
|
||||
- DOMAIN-SUFFIX,geetest.com
|
||||
- DOMAIN-SUFFIX,godic.net
|
||||
- DOMAIN-SUFFIX,goodread.com
|
||||
- DOMAIN-SUFFIX,goofish.com
|
||||
- DOMAIN-SUFFIX,gtimg.com
|
||||
- DOMAIN-SUFFIX,haibian.com
|
||||
- DOMAIN-SUFFIX,hao123.com
|
||||
- DOMAIN-SUFFIX,haosou.com
|
||||
- DOMAIN-SUFFIX,hdchina.org
|
||||
- DOMAIN-SUFFIX,hdcmct.org
|
||||
- DOMAIN-SUFFIX,hjfile.cn
|
||||
- DOMAIN-SUFFIX,hkserversolution.com
|
||||
- DOMAIN-SUFFIX,hollisterco.com
|
||||
- DOMAIN-SUFFIX,hongxiu.com
|
||||
- DOMAIN-SUFFIX,hujiang.com
|
||||
- DOMAIN-SUFFIX,hxcdn.net
|
||||
- DOMAIN-SUFFIX,icedropper.com
|
||||
- DOMAIN-SUFFIX,iciba.com
|
||||
- DOMAIN-SUFFIX,ifeng.com
|
||||
- DOMAIN-SUFFIX,ifengimg.com
|
||||
- DOMAIN-SUFFIX,images-amazon.com
|
||||
- DOMAIN-SUFFIX,img4me.com
|
||||
- DOMAIN-SUFFIX,ithome.com
|
||||
- DOMAIN-SUFFIX,ixdzs.com
|
||||
- DOMAIN-SUFFIX,jd.com
|
||||
- DOMAIN-SUFFIX,jd.hk
|
||||
- DOMAIN-SUFFIX,jianshu.com
|
||||
- DOMAIN-SUFFIX,jianshu.io
|
||||
- DOMAIN-SUFFIX,jianshuapi.com
|
||||
- DOMAIN-SUFFIX,jiathis.com
|
||||
- DOMAIN-SUFFIX,jomodns.com
|
||||
- DOMAIN-SUFFIX,jsboxbbs.com
|
||||
- DOMAIN-SUFFIX,knewone.com
|
||||
- DOMAIN-SUFFIX,kuaidi100.com
|
||||
- DOMAIN-SUFFIX,kugou.com
|
||||
- DOMAIN-SUFFIX,lecloud.com
|
||||
- DOMAIN-SUFFIX,lemicp.com
|
||||
- DOMAIN-SUFFIX,letv.com
|
||||
- DOMAIN-SUFFIX,letvcloud.com
|
||||
- DOMAIN-SUFFIX,liyuans.com
|
||||
- DOMAIN-SUFFIX,lizhi.io
|
||||
- DOMAIN-SUFFIX,localizecdn.com
|
||||
- DOMAIN-SUFFIX,lucifr.com
|
||||
- DOMAIN-SUFFIX,luoo.net
|
||||
- DOMAIN-SUFFIX,lxdns.com
|
||||
- DOMAIN-SUFFIX,mai.tn
|
||||
- DOMAIN-SUFFIX,meizu.com
|
||||
- DOMAIN-SUFFIX,metatrader4.com
|
||||
- DOMAIN-SUFFIX,metatrader5.com
|
||||
- DOMAIN-SUFFIX,mi.com
|
||||
- DOMAIN-SUFFIX,miaopai.com
|
||||
- DOMAIN-SUFFIX,miui.com
|
||||
- DOMAIN-SUFFIX,miwifi.com
|
||||
- DOMAIN-SUFFIX,mob.com
|
||||
- DOMAIN-SUFFIX,moji.com
|
||||
- DOMAIN-SUFFIX,moke.com
|
||||
- DOMAIN-SUFFIX,mxhichina.com
|
||||
- DOMAIN-SUFFIX,myqcloud.com
|
||||
- DOMAIN-SUFFIX,myunlu.com
|
||||
- DOMAIN-SUFFIX,ngabbs.com
|
||||
- DOMAIN-SUFFIX,netease.com
|
||||
- DOMAIN-SUFFIX,nfoservers.com
|
||||
- DOMAIN-SUFFIX,nssurge.com
|
||||
- DOMAIN-SUFFIX,nuomi.com
|
||||
- DOMAIN-SUFFIX,ourbits.club
|
||||
- DOMAIN-SUFFIX,ourdvs.com
|
||||
- DOMAIN-SUFFIX,passthepopcorn.me
|
||||
- DOMAIN-SUFFIX,pgyer.com
|
||||
- DOMAIN-SUFFIX,pniao.com
|
||||
- DOMAIN-SUFFIX,privatehd.to
|
||||
- DOMAIN-SUFFIX,qbox.me
|
||||
- DOMAIN-SUFFIX,qcloud.com
|
||||
- DOMAIN-SUFFIX,qdaily.com
|
||||
- DOMAIN-SUFFIX,qdmm.com
|
||||
- DOMAIN-SUFFIX,qhimg.com
|
||||
- DOMAIN-SUFFIX,qidian.com
|
||||
- DOMAIN-SUFFIX,qihucdn.com
|
||||
- DOMAIN-SUFFIX,qin.io
|
||||
- DOMAIN-SUFFIX,qingmang.me
|
||||
- DOMAIN-SUFFIX,qingmang.mobi
|
||||
- DOMAIN-SUFFIX,qiniucdn.com
|
||||
- DOMAIN-SUFFIX,qiniudn.com
|
||||
- DOMAIN-SUFFIX,qq.com
|
||||
- DOMAIN-SUFFIX,qqurl.com
|
||||
- DOMAIN-SUFFIX,rarbg.to
|
||||
- DOMAIN-SUFFIX,redacted.ch
|
||||
- DOMAIN-SUFFIX,rrmj.tv
|
||||
- DOMAIN-SUFFIX,ruguoapp.com
|
||||
- DOMAIN-SUFFIX,sandai.net
|
||||
- DOMAIN-SUFFIX,sf-express.com
|
||||
- DOMAIN-SUFFIX,sinaapp.com
|
||||
- DOMAIN-SUFFIX,sinaimg.cn
|
||||
- DOMAIN-SUFFIX,sinaimg.com
|
||||
- DOMAIN-SUFFIX,sm.ms
|
||||
- DOMAIN-SUFFIX,smzdm.com
|
||||
- DOMAIN-SUFFIX,snwx.com
|
||||
- DOMAIN-SUFFIX,so.com
|
||||
- DOMAIN-SUFFIX,sogou.com
|
||||
- DOMAIN-SUFFIX,sogoucdn.com
|
||||
- DOMAIN-SUFFIX,sohu.com
|
||||
- DOMAIN-SUFFIX,soku.com
|
||||
- DOMAIN-SUFFIX,soso.com
|
||||
- DOMAIN-SUFFIX,sspai.com
|
||||
- DOMAIN-SUFFIX,startssl.com
|
||||
- DOMAIN-SUFFIX,suning.com
|
||||
- DOMAIN-SUFFIX,symcd.com
|
||||
- DOMAIN-SUFFIX,taobao.com
|
||||
- DOMAIN-SUFFIX,tawk.link
|
||||
- DOMAIN-SUFFIX,tawk.to
|
||||
- DOMAIN-SUFFIX,tenpay.com
|
||||
- DOMAIN-SUFFIX,tietuku.com
|
||||
- DOMAIN-SUFFIX,tmall.com
|
||||
- DOMAIN-SUFFIX,tmzvps.com
|
||||
- DOMAIN-SUFFIX,trello.com
|
||||
- DOMAIN-SUFFIX,trellocdn.com
|
||||
- DOMAIN-SUFFIX,totheglory.im
|
||||
- DOMAIN-SUFFIX,ttmeiju.com
|
||||
- DOMAIN-SUFFIX,tudou.com
|
||||
- DOMAIN-SUFFIX,udache.com
|
||||
- DOMAIN-SUFFIX,umengcloud.com
|
||||
- DOMAIN-SUFFIX,upaiyun.com
|
||||
- DOMAIN-SUFFIX,upyun.com
|
||||
- DOMAIN-SUFFIX,uxengine.net
|
||||
- DOMAIN-SUFFIX,wandoujia.com
|
||||
- DOMAIN-SUFFIX,weather.bjango.com
|
||||
- DOMAIN-SUFFIX,weather.com
|
||||
- DOMAIN-SUFFIX,webqxs.com
|
||||
- DOMAIN-SUFFIX,weibo.cn
|
||||
- DOMAIN-SUFFIX,weibo.com
|
||||
- DOMAIN-SUFFIX,weico.cc
|
||||
- DOMAIN-SUFFIX,weiphone.com
|
||||
- DOMAIN-SUFFIX,weiphone.net
|
||||
- DOMAIN-SUFFIX,wenku8.net
|
||||
- DOMAIN-SUFFIX,werewolf.53site.com
|
||||
- DOMAIN-SUFFIX,wkcdn.com
|
||||
- DOMAIN-SUFFIX,xdrig.com
|
||||
- DOMAIN-SUFFIX,xhostfire.com
|
||||
- DOMAIN-SUFFIX,xhscdn.com
|
||||
- DOMAIN-SUFFIX,xiaohongshu.com
|
||||
- DOMAIN-SUFFIX,xiaojukeji.com
|
||||
- DOMAIN-SUFFIX,xiaomi.com
|
||||
- DOMAIN-SUFFIX,xiaomi.net
|
||||
- DOMAIN-SUFFIX,xiaomicp.com
|
||||
- DOMAIN-SUFFIX,ximalaya.com
|
||||
- DOMAIN-SUFFIX,xitek.com
|
||||
- DOMAIN-SUFFIX,xmcdn.com
|
||||
- DOMAIN-SUFFIX,xslb.net
|
||||
- DOMAIN-SUFFIX,yach.me
|
||||
- DOMAIN-SUFFIX,yeepay.com
|
||||
- DOMAIN-SUFFIX,yhd.com
|
||||
- DOMAIN-SUFFIX,yinxiang.com
|
||||
- DOMAIN-SUFFIX,yixia.com
|
||||
- DOMAIN-SUFFIX,ykimg.com
|
||||
- DOMAIN-SUFFIX,youdao.com
|
||||
- DOMAIN-SUFFIX,youku.com
|
||||
- DOMAIN-SUFFIX,yunjiasu-cdn.net
|
||||
- DOMAIN-SUFFIX,zealer.com
|
||||
- DOMAIN-SUFFIX,zgslb.net
|
||||
- DOMAIN-SUFFIX,zhihu.com
|
||||
- DOMAIN-SUFFIX,zhimg.com
|
||||
- DOMAIN-SUFFIX,zimuzu.tv
|
||||
- DOMAIN-SUFFIX,zmz002.com
|
||||
|
||||
- IP-CIDR,1.255.62.0/24,no-resolve
|
||||
|
||||
# > CN
|
||||
- DOMAIN-SUFFIX,gov.cn
|
||||
- DOMAIN-SUFFIX,cn
|
File diff suppressed because it is too large
Load Diff
@ -1,10 +0,0 @@
|
||||
payload:
|
||||
# > F1 TV
|
||||
- DOMAIN,d2n9h2wits23hf.cloudfront.net
|
||||
- DOMAIN,f1prodlive.akamaized.net
|
||||
- DOMAIN,mobile-collector.newrelic.com
|
||||
- DOMAIN-SUFFIX,bitmovin.com
|
||||
- DOMAIN-SUFFIX,f1esports.com
|
||||
- DOMAIN-SUFFIX,f1manager.com
|
||||
- DOMAIN-SUFFIX,f1play.com
|
||||
- DOMAIN-SUFFIX,formula1.com
|
@ -1,37 +0,0 @@
|
||||
payload:
|
||||
# > Google FCM
|
||||
- DOMAIN,alt1-mtalk.google.com
|
||||
- DOMAIN,alt2-mtalk.google.com
|
||||
- DOMAIN,alt3-mtalk.google.com
|
||||
- DOMAIN,alt4-mtalk.google.com
|
||||
- DOMAIN,alt5-mtalk.google.com
|
||||
- DOMAIN,alt6-mtalk.google.com
|
||||
- DOMAIN,alt7-mtalk.google.com
|
||||
- DOMAIN,alt8-mtalk.google.com
|
||||
- DOMAIN,mtalk.google.com
|
||||
- IP-CIDR,64.233.177.188/32,no-resolve
|
||||
- IP-CIDR,64.233.186.188/32,no-resolve
|
||||
- IP-CIDR,64.233.187.188/32,no-resolve
|
||||
- IP-CIDR,64.233.188.188/32,no-resolve
|
||||
- IP-CIDR,64.233.189.188/32,no-resolve
|
||||
- IP-CIDR,74.125.23.188/32,no-resolve
|
||||
- IP-CIDR,74.125.24.188/32,no-resolve
|
||||
- IP-CIDR,74.125.28.188/32,no-resolve
|
||||
- IP-CIDR,74.125.127.188/32,no-resolve
|
||||
- IP-CIDR,74.125.137.188/32,no-resolve
|
||||
- IP-CIDR,74.125.203.188/32,no-resolve
|
||||
- IP-CIDR,74.125.204.188/32,no-resolve
|
||||
- IP-CIDR,74.125.206.188/32,no-resolve
|
||||
- IP-CIDR,108.177.125.188/32,no-resolve
|
||||
- IP-CIDR,142.250.4.188/32,no-resolve
|
||||
- IP-CIDR,142.250.10.188/32,no-resolve
|
||||
- IP-CIDR,142.250.31.188/32,no-resolve
|
||||
- IP-CIDR,142.250.96.188/32,no-resolve
|
||||
- IP-CIDR,172.217.194.188/32,no-resolve
|
||||
- IP-CIDR,172.217.218.188/32,no-resolve
|
||||
- IP-CIDR,172.217.219.188/32,no-resolve
|
||||
- IP-CIDR,172.253.63.188/32,no-resolve
|
||||
- IP-CIDR,172.253.122.188/32,no-resolve
|
||||
- IP-CIDR,173.194.175.188/32,no-resolve
|
||||
- IP-CIDR,173.194.218.188/32,no-resolve
|
||||
- IP-CIDR,209.85.233.188/32,no-resolve
|
@ -1,6 +0,0 @@
|
||||
payload:
|
||||
# > Fox+ (HK|TW|SG)
|
||||
# - USER-AGENT,FOXPlus*
|
||||
- DOMAIN-SUFFIX,akamaized.net
|
||||
- DOMAIN-SUFFIX,foxplus.com
|
||||
- DOMAIN-SUFFIX,theplatform.com
|
@ -1,6 +0,0 @@
|
||||
payload:
|
||||
# > Fox Now
|
||||
# - USER-AGENT,FOX%20NOW*
|
||||
- DOMAIN-SUFFIX,fox.com
|
||||
- DOMAIN-SUFFIX,foxdcg.com
|
||||
- DOMAIN-SUFFIX,uplynk.com
|
@ -1,37 +0,0 @@
|
||||
payload:
|
||||
# > Google FCM
|
||||
- DOMAIN,alt1-mtalk.google.com
|
||||
- DOMAIN,alt2-mtalk.google.com
|
||||
- DOMAIN,alt3-mtalk.google.com
|
||||
- DOMAIN,alt4-mtalk.google.com
|
||||
- DOMAIN,alt5-mtalk.google.com
|
||||
- DOMAIN,alt6-mtalk.google.com
|
||||
- DOMAIN,alt7-mtalk.google.com
|
||||
- DOMAIN,alt8-mtalk.google.com
|
||||
- DOMAIN,mtalk.google.com
|
||||
- IP-CIDR,64.233.177.188/32,no-resolve
|
||||
- IP-CIDR,64.233.186.188/32,no-resolve
|
||||
- IP-CIDR,64.233.187.188/32,no-resolve
|
||||
- IP-CIDR,64.233.188.188/32,no-resolve
|
||||
- IP-CIDR,64.233.189.188/32,no-resolve
|
||||
- IP-CIDR,74.125.23.188/32,no-resolve
|
||||
- IP-CIDR,74.125.24.188/32,no-resolve
|
||||
- IP-CIDR,74.125.28.188/32,no-resolve
|
||||
- IP-CIDR,74.125.127.188/32,no-resolve
|
||||
- IP-CIDR,74.125.137.188/32,no-resolve
|
||||
- IP-CIDR,74.125.203.188/32,no-resolve
|
||||
- IP-CIDR,74.125.204.188/32,no-resolve
|
||||
- IP-CIDR,74.125.206.188/32,no-resolve
|
||||
- IP-CIDR,108.177.125.188/32,no-resolve
|
||||
- IP-CIDR,142.250.4.188/32,no-resolve
|
||||
- IP-CIDR,142.250.10.188/32,no-resolve
|
||||
- IP-CIDR,142.250.31.188/32,no-resolve
|
||||
- IP-CIDR,142.250.96.188/32,no-resolve
|
||||
- IP-CIDR,172.217.194.188/32,no-resolve
|
||||
- IP-CIDR,172.217.218.188/32,no-resolve
|
||||
- IP-CIDR,172.217.219.188/32,no-resolve
|
||||
- IP-CIDR,172.253.63.188/32,no-resolve
|
||||
- IP-CIDR,172.253.122.188/32,no-resolve
|
||||
- IP-CIDR,173.194.175.188/32,no-resolve
|
||||
- IP-CIDR,173.194.218.188/32,no-resolve
|
||||
- IP-CIDR,209.85.233.188/32,no-resolve
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user