luci-app-openclash: sync source
70
package/cnsztl/luci-app-openclash/Makefile
Executable file → Normal file
@ -1,20 +1,21 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-openclash
|
||||
PKG_VERSION=0.30.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_MAINTAINER:=frainzy1477&vernesong <https://github.com/vernesong/OpenClash>
|
||||
PKG_VERSION:=0.33.2
|
||||
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)
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Luci
|
||||
CATEGORY:=LuCI
|
||||
SUBMENU:=3. Applications
|
||||
TITLE:=LuCI support for clash
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+coreutils-nohup +bash +wget
|
||||
DEPENDS:=+luci +luci-base +iptables +coreutils +coreutils-nohup +bash +wget
|
||||
MAINTAINER:=vernesong
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
@ -35,11 +36,66 @@ endef
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/preinst
|
||||
#!/bin/sh
|
||||
if [ -f "/etc/config/openclash" ]; then
|
||||
uci set openclash.config.enable=0 && uci commit openclash
|
||||
cp "/etc/config/openclash" "/tmp/openclash.bak" 2>/dev/null
|
||||
cp "/etc/config/openclash_custom_rules.list" "/tmp/openclash_custom_rules.list.bak" 2>/dev/null
|
||||
cp "/etc/config/openclash_custom_hosts.list" "/tmp/openclash_custom_hosts.list.bak" 2>/dev/null
|
||||
fi
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
rm -rf /tmp/luci*
|
||||
if [ -f "/tmp/openclash.bak" ]; then
|
||||
mv "/tmp/openclash.bak" "/etc/config/openclash" 2>/dev/null
|
||||
mv "/tmp/openclash_custom_rules.list.bak" "/etc/config/openclash_custom_rules.list" 2>/dev/null
|
||||
mv "/tmp/openclash_custom_hosts.list.bak" "/etc/config/openclash_custom_hosts.list" 2>/dev/null
|
||||
fi
|
||||
if [ -f "/tmp/config.yaml" ]; then
|
||||
mv "/tmp/config.yaml" "/etc/openclash/config.yaml" 2>/dev/null
|
||||
elif [ -f "/tmp/config.yml" ]; then
|
||||
mv "/tmp/config.yml" "/etc/openclash/config.yaml" 2>/dev/null
|
||||
fi
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
update=$(uci get openclash.config.update 2>/dev/null)
|
||||
if [ "$update" != 1 ]; then
|
||||
rm -rf /etc/openclash/clash 2>/dev/null
|
||||
uci set openclash.config.enable=0 && uci commit openclash
|
||||
else
|
||||
uci set openclash.config.enable=1 && uci commit openclash
|
||||
fi
|
||||
cp "/etc/config/openclash" "/tmp/openclash.bak" 2>/dev/null
|
||||
cp "/etc/config/openclash_custom_rules.list" "/tmp/openclash_custom_rules.list.bak" 2>/dev/null
|
||||
cp "/etc/config/openclash_custom_hosts.list" "/tmp/openclash_custom_hosts.list.bak" 2>/dev/null
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postrm
|
||||
#!/bin/sh
|
||||
if [ -f "/etc/openclash/config.yaml" ]; then
|
||||
mv "/etc/openclash/config.yaml" "/tmp/config.yaml"
|
||||
fi
|
||||
if [ -f "/etc/openclash/clash" ]; then
|
||||
rm -rf /etc/openclash/config.* 2>/dev/null
|
||||
else
|
||||
rm -rf /etc/openclash 2>/dev/null
|
||||
fi
|
||||
rm -rf /tmp/openclash.log 2>/dev/null
|
||||
rm -rf /tmp/openclash_start.log 2>/dev/null
|
||||
rm -rf /tmp/Proxy_Group 2>/dev/null
|
||||
rm -rf /tmp/openclash_last_version 2>/dev/null
|
||||
rm -rf /tmp/clash_last_version 2>/dev/null
|
||||
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) ./files/* $(1)/
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
7
package/cnsztl/luci-app-openclash/files/etc/config/openclash
Executable file → Normal file
@ -2,6 +2,7 @@
|
||||
config openclash 'config'
|
||||
option proxy_port '7892'
|
||||
option enable '0'
|
||||
option update '0'
|
||||
option en_mode '0'
|
||||
option auto_update '0'
|
||||
option auto_update_time '0'
|
||||
@ -9,5 +10,9 @@ config openclash 'config'
|
||||
option dashboard_password '123456'
|
||||
option rule_source '0'
|
||||
option enable_custom_dns '0'
|
||||
option ipv6_enable '0'
|
||||
option enable_custom_clash_rules '0'
|
||||
option other_rule_auto_update '0'
|
||||
option other_rule_auto_update '0'
|
||||
option core_version '0'
|
||||
option en_mode 'redir-host'
|
||||
option update '0'
|
||||
@ -0,0 +1,6 @@
|
||||
# experimental hosts, support wildcard (e.g. *.clash.dev Even *.foo.*.example.com)
|
||||
# static domain has a higher priority than wildcard domain (foo.example.com > *.example.com)
|
||||
# NOTE: hosts don't work with `fake-ip`
|
||||
|
||||
# '*.clash.dev': 127.0.0.1
|
||||
# 'alpha.clash.dev': '::1'
|
||||
0
package/cnsztl/luci-app-openclash/files/etc/config/openclash_custom_rules.list
Executable file → Normal file
@ -8,26 +8,28 @@ STOP=15
|
||||
CLASH="/etc/openclash/clash"
|
||||
CLASH_CONFIG="/etc/openclash"
|
||||
CRON_FILE="/etc/crontabs/root"
|
||||
CONFIG_FILE="/etc/openclash/config.yml"
|
||||
CONFIG_FILE="/etc/openclash/config.yaml"
|
||||
LOG_FILE="/tmp/openclash.log"
|
||||
START_LOG="/tmp/openclash_start.log"
|
||||
BACKPACK_FILE="/etc/openclash/config.bak"
|
||||
CHANGE_FILE="/tmp/yml_change.yml"
|
||||
RULE_FILE="/tmp/yml_rules.yml"
|
||||
DNS_FILE="/tmp/yml_dns.yml"
|
||||
|
||||
START_BACKPACK="/tmp/config.sbak"
|
||||
CHANGE_FILE="/tmp/yaml_change.yaml"
|
||||
RULE_FILE="/tmp/yaml_rules.yaml"
|
||||
DNS_FILE="/tmp/yaml_dns.yaml"
|
||||
PROXY_FILE="/tmp/yaml_proxy.yaml"
|
||||
HOSTS_FILE="/etc/config/openclash_custom_hosts.list"
|
||||
|
||||
add_cron()
|
||||
{
|
||||
[ -z "`grep "openclash.log" "$CRON_FILE"`" ] && {
|
||||
echo '0 0 * * 0 echo "" > /tmp/openclash.log' >> $CRON_FILE
|
||||
[ -z "$(grep "openclash.sh" "$CRON_FILE")" ] && {
|
||||
[ "$(uci get openclash.config.auto_update 2>/dev/null)" -eq 1 ] && echo "0 $(uci get openclash.config.auto_update_time 2>/dev/null) * * $(uci get openclash.config.config_update_week_time 2>/dev/null) /usr/share/openclash/openclash.sh" >> $CRON_FILE
|
||||
}
|
||||
[ -z "`grep "openclash.sh" "$CRON_FILE"`" ] && {
|
||||
[ "$(uci get openclash.config.auto_update 2>/dev/null)" -eq 1 ] && echo "0 $(uci get openclash.config.auto_update_time 2>/dev/null) * * * /usr/share/openclash/openclash.sh" >> $CRON_FILE
|
||||
}
|
||||
[ -z "`grep "openclash_rule.sh" "$CRON_FILE"`" ] && {
|
||||
[ -z "$(grep "openclash_rule.sh" "$CRON_FILE")" ] && {
|
||||
[ "$(uci get openclash.config.other_rule_auto_update 2>/dev/null)" -eq 1 ] && echo "0 $(uci get openclash.config.other_rule_update_day_time 2>/dev/null) * * $(uci get openclash.config.other_rule_update_week_time 2>/dev/null) /usr/share/openclash/openclash_rule.sh" >> $CRON_FILE
|
||||
}
|
||||
[ -z "$(grep "openclash_ipdb.sh" "$CRON_FILE")" ] && {
|
||||
[ "$(uci get openclash.config.geo_auto_update 2>/dev/null)" -eq 1 ] && echo "0 $(uci get openclash.config.geo_update_day_time 2>/dev/null) * * $(uci get openclash.config.geo_update_week_time 2>/dev/null) /usr/share/openclash/openclash_ipdb.sh" >> $CRON_FILE
|
||||
}
|
||||
crontab $CRON_FILE
|
||||
nohup /usr/share/openclash/openclash_watchdog.sh &
|
||||
}
|
||||
@ -36,84 +38,117 @@ del_cron()
|
||||
{
|
||||
sed -i '/openclash.sh/d' $CRON_FILE 2>/dev/null
|
||||
sed -i '/openclash_rule.sh/d' $CRON_FILE 2>/dev/null
|
||||
sed -i '/openclash_ipdb.sh/d' $CRON_FILE 2>/dev/null
|
||||
/etc/init.d/cron restart
|
||||
}
|
||||
|
||||
yml_check()
|
||||
{
|
||||
#创建启动备份
|
||||
cp "$3" "$5"
|
||||
|
||||
#创建原始备份
|
||||
if [ ! -f "$4" ]; then
|
||||
cp "$3" "$4"
|
||||
cp "$3" "$4"
|
||||
fi
|
||||
|
||||
if [ "$(grep -c '^##Custom DNS##' "$CONFIG_FILE")" -gt 0 ] && [ "$2" = 0 ]; then
|
||||
cp "$4" "$3"
|
||||
#自定义DNS还原
|
||||
if [ "$(grep -c '##Custom DNS##' "$3")" -gt 0 ] && [ "$2" = 0 ] && [ -f "$4" ]; then
|
||||
awk '/^ {0,}nameserver:/,/Proxy:/{print}' "$4" | sed '/^Proxy:/d' >/tmp/bakdns.config 2>/dev/null
|
||||
sed -i '/OpenClash-General-Settings/i\Custom DNS End' "$3" 2>/dev/null
|
||||
sed -i '/^ \{0,\}nameserver:/,/^Custom DNS End$/d' "$3" 2>/dev/null
|
||||
sed -i '/##Custom DNS##/r/tmp/bakdns.config' "$3" 2>/dev/null
|
||||
rm -rf /tmp/bakdns.config 2>/dev/null
|
||||
fi
|
||||
|
||||
yml_dns_check
|
||||
|
||||
if [ "$1" = 0 ]; then
|
||||
if [ -f "$4" ]; then
|
||||
[ ! -z "`grep "OpenClash-General" "$CONFIG_FILE"`" ] && {
|
||||
cp "$4" "$3"
|
||||
}
|
||||
else
|
||||
[ -z "`grep "OpenClash-General" "$CONFIG_FILE"`" ] && {
|
||||
cp "$3" "$4"
|
||||
}
|
||||
fi
|
||||
fi
|
||||
#检查行首空格避免后续操作出错
|
||||
[ ! -z "$(grep "^ \{1,\}Proxy:" $3)" ] && {
|
||||
sed -i "/^ \{1,\}Proxy:/c\Proxy:" "$3"
|
||||
}
|
||||
|
||||
[ ! -z "$(grep "^ \{1,\}Proxy Group:" $3)" ] && {
|
||||
sed -i "/^ \{1,\}Proxy Group:/c\Proxy Group:" "$3"
|
||||
}
|
||||
|
||||
[ ! -z "$(grep "^ \{1,\}Rule:" $3)" ] && {
|
||||
sed -i "/^ \{1,\}Rule:/c\Rule:" "$3"
|
||||
}
|
||||
|
||||
[ ! -z "$(grep "^ \{1,\}dns:" $3)" ] && {
|
||||
sed -i "/^ \{1,\}dns:/c\dns:" "$3"
|
||||
}
|
||||
|
||||
if [ ! -z "$(grep "^ \{1,\}port:" $3)" ] || [ ! -z "$(grep "^ \{1,\}mode:" $3)" ] || [ ! -z "$(grep "^ \{1,\}log-level:" $3)" ]; then
|
||||
cp "$3" /tmp/config.check 2>/dev/null
|
||||
sed -i '/^dns:/,$d' /tmp/config.check 2>/dev/null
|
||||
sed -i 's/^[ \t]*//' /tmp/config.check 2>/dev/null
|
||||
sed -n '/^dns:/,$p' "$3" >> /tmp/config.check 2>/dev/null
|
||||
mv /tmp/config.check "$3" 2>/dev/null
|
||||
fi
|
||||
|
||||
#添加标识
|
||||
sed -i '/OpenClash-General/d' "$3" 2>/dev/null
|
||||
sed -i '/^Proxy:/i\#===================== OpenClash-General-Settings =====================#' "$3" 2>/dev/null
|
||||
}
|
||||
|
||||
#检查DNS设置
|
||||
yml_dns_check()
|
||||
{
|
||||
if [ "$1" -eq 53 ]; then
|
||||
sed -i "/^ listen:/c\ listen: 0.0.0.0:7874" "$2"
|
||||
|
||||
[ -z "$(grep '^dns:' $CONFIG_FILE)" ] && {
|
||||
sed -i '/^Proxy:/i\dns:' "$CONFIG_FILE" 2>/dev/null
|
||||
}
|
||||
|
||||
[ -z "$(grep '^ \{0,\}nameserver:' $CONFIG_FILE)" ] && {
|
||||
sed -i -e '/^Proxy:/i\ nameserver:' "$CONFIG_FILE" 2>/dev/null
|
||||
sed -i "/nameserver:/a\ - tls://8.8.8.8:853" "$CONFIG_FILE" 2>/dev/null
|
||||
sed -i "/nameserver:/a\ - 114.114.114.114" "$CONFIG_FILE" 2>/dev/null
|
||||
}
|
||||
|
||||
dns_port=$(grep "^ \{0,\}listen:" $CONFIG_FILE |awk -F ':' '{print $3}' |awk -F '#' '{print $1}' |tr -cd "[0-9]" 2>/dev/null)
|
||||
if [ -z "$dns_port" ] || [ "$dns_port" -eq 53 ]; then
|
||||
dns_port=7874
|
||||
fi
|
||||
|
||||
[ -z "`grep "^dns:" $CONFIG_FILE`" ] && {
|
||||
sed -i -e "/^Proxy:$/i\dns:"\
|
||||
-e "/^dns:/a\ enable: true"\
|
||||
-e "/enable: true/a\ listen: 0.0.0.0:${1}"\
|
||||
-e "/listen:/a\ enhanced-mode: redir-host"\
|
||||
-e "/enhanced-mode:/a\ nameserver:"\
|
||||
-e "/nameserver:/a\ - 114.114.114.114"\
|
||||
-e "/114.114.114.114/a\ - 119.29.29.29"\
|
||||
-e "/119.29.29.29/a\ - 223.5.5.5"\
|
||||
-e "/223.5.5.5/a\ fallback:"\
|
||||
-e "/fallback:/a\ - tls://dns.rubyfish.cn:853"\
|
||||
-e "/dns.rubyfish.cn:853/a\- tcp://1.1.1.1:53"\
|
||||
-e "/1.1.1.1:53/a\ - tcp://208.67.222.222:443"\
|
||||
-e "/208.67.222.222:443/a\ - tls://dns.google" "$2"
|
||||
}
|
||||
|
||||
if [ ! -z "$(grep "^ \{0,\}listen:" "$CONFIG_FILE")" ]; then
|
||||
sed -i "/^ \{0,\}listen:/c\ listen: 0.0.0.0:${dns_port}" "$CONFIG_FILE" 2>/dev/null
|
||||
else
|
||||
sed -i "/^dns:/a\ listen: 0.0.0.0:${dns_port}" "$CONFIG_FILE" 2>/dev/null
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
#切割配置文件以分开处理
|
||||
yml_cut()
|
||||
{
|
||||
cp "$5" "$2"
|
||||
if [ "$1" = 0 ]; then
|
||||
sed -i '/^Rule:$/,$d' "$2"
|
||||
sed -n '/^Rule:$/,$p' "$5" >"$3"
|
||||
else
|
||||
sed -i '/^Rule:$/,$d' "$2"
|
||||
sed -n '/nameserver:$/,$p' "$2" >"$4"
|
||||
sed -i '/nameserver:$/,$d' "$2"
|
||||
sed -n '/^Rule:$/,$p' "$5" >"$3"
|
||||
fi
|
||||
cp "$4" "$1"
|
||||
sed -i '/^Rule:/,$d' "$1"
|
||||
sed -n '/^ \{0,\}nameserver:/,$p' "$1" >"$3"
|
||||
sed -n '/^ \{0,\}Proxy:/,$p' "$3" >"$5"
|
||||
sed -i '/^ \{0,\}nameserver:/,$d' "$1"
|
||||
sed -i '/^ \{0,\}Proxy:/,$d' "$3"
|
||||
sed -n '/^Rule:/,$p' "$4" >"$2"
|
||||
|
||||
}
|
||||
|
||||
#获取自定义DNS设置
|
||||
yml_dns_get()
|
||||
{
|
||||
|
||||
local section="$1"
|
||||
local dns_type=""
|
||||
local dns_address=""
|
||||
config_get_bool "enabled" "$section" "enabled" "1"
|
||||
config_get "port" "$section" "port" ""
|
||||
config_get "type" "$section" "type" ""
|
||||
config_get "ip" "$section" "ip" ""
|
||||
config_get "group" "$section" "group" ""
|
||||
|
||||
if [ "$enabled" = "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -z "$ip" ]; then
|
||||
return
|
||||
@ -125,6 +160,8 @@ yml_dns_get()
|
||||
dns_type="- tls://"
|
||||
elif [ "$type" = "udp" ]; then
|
||||
dns_type="- "
|
||||
elif [ "$type" = "https" ]; then
|
||||
dns_type="- https://"
|
||||
fi
|
||||
|
||||
if [ ! -z "$port" ] && [ ! -z "$ip" ]; then
|
||||
@ -139,8 +176,7 @@ yml_dns_get()
|
||||
if [ "$group" = "nameserver" ]; then
|
||||
echo " $dns_type$dns_address" >>/etc/openclash/config.namedns
|
||||
else
|
||||
grep "fallback:$" /etc/openclash/config.falldns 1>/dev/null
|
||||
if [ "$?" -ne "0" ]; then
|
||||
if [ -z "$(grep "fallback:$" /etc/openclash/config.falldns 2>/dev/null)" ]; then
|
||||
echo " fallback:" >/etc/openclash/config.falldns
|
||||
fi
|
||||
echo " $dns_type$dns_address" >>/etc/openclash/config.falldns
|
||||
@ -151,32 +187,116 @@ yml_dns_get()
|
||||
|
||||
}
|
||||
|
||||
#添加自定义DNS设置
|
||||
yml_dns_custom()
|
||||
{
|
||||
[ "$1" = 1 ] && {
|
||||
echo " nameserver:" >/etc/openclash/config.namedns
|
||||
config_load "openclash"
|
||||
config_foreach yml_dns_get "dns_servers"
|
||||
sed -i '/nameserver:$/i\##Custom DNS##' "$2" 2>/dev/null
|
||||
sed -i '/OpenClash-General-Settings/i\Custom DNS End' "$2" 2>/dev/null
|
||||
sed -i '/nameserver:$/,/^Custom DNS End$/d' "$2" 2>/dev/null
|
||||
sed -i '/^##Custom DNS##$/r/etc/openclash/config.falldns' "$2" 2>/dev/null
|
||||
sed -i '/^##Custom DNS##$/r/etc/openclash/config.namedns' "$2" 2>/dev/null
|
||||
rm -rf /etc/openclash/config.namedns 2>/dev/null
|
||||
rm -rf /etc/openclash/config.falldns 2>/dev/null
|
||||
if [ "$1" = 1 ]; then
|
||||
echo " nameserver:" >/etc/openclash/config.namedns
|
||||
config_load "openclash"
|
||||
config_foreach yml_dns_get "dns_servers"
|
||||
sed -i '/^ \{0,\}nameserver:/i\##Custom DNS##' "$2" 2>/dev/null
|
||||
sed -i '/OpenClash-General-Settings/i\Custom DNS End' "$2" 2>/dev/null
|
||||
sed -i '/^ \{0,\}nameserver:/,/^Custom DNS End$/d' "$2" 2>/dev/null
|
||||
sed -i '/##Custom DNS##/r/etc/openclash/config.falldns' "$2" 2>/dev/null
|
||||
sed -i '/##Custom DNS##/r/etc/openclash/config.namedns' "$2" 2>/dev/null
|
||||
rm -rf /etc/openclash/config.namedns 2>/dev/null
|
||||
rm -rf /etc/openclash/config.falldns 2>/dev/null
|
||||
else
|
||||
sed -i "/^ \{0,\}nameserver:/c\ nameserver:" "$2" 2>/dev/null
|
||||
sed -i "/^ \{0,\}fallback:/c\ fallback:" "$2" 2>/dev/null
|
||||
if [ ! -z "$(grep "^ \{0,1\}- " $2)" ]; then
|
||||
sed -i "s/^ \{0,\}- / - /" "$2" 2>/dev/null #添加参数空格
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
#添加自定义Hosts设置
|
||||
yml_hosts_custom()
|
||||
{
|
||||
if [ "$en_mode" = "redir-host" ]; then
|
||||
if [ -z "$(grep '^ \{0,\}hosts:' $1)" ]; then
|
||||
echo " hosts:" >>"$1" 2>/dev/null
|
||||
else
|
||||
if [ -z "$(grep '^ hosts:' $1)" ]; then
|
||||
sed -i "/hosts:/c\ hosts:" "$1" 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
sed -i "s/^ \{0,\}/ /" "$2" 2>/dev/null #修改参数空格
|
||||
sed -i "1i\##Custom HOSTS##" "$2" 2>/dev/null
|
||||
echo "##Custom HOSTS END##" >>"$2" 2>/dev/null
|
||||
sed -i '/##Custom HOSTS##/,/##Custom HOSTS END##/d' "$1" 2>/dev/null
|
||||
sed -i '/^ hosts:/r/etc/config/openclash_custom_hosts.list' "$1" 2>/dev/null
|
||||
sed -i '/##Custom HOSTS##/d' "$2" 2>/dev/null
|
||||
sed -i '/##Custom HOSTS END##/d' "$2" 2>/dev/null
|
||||
else
|
||||
sed -i '/^ *$/d' "$1" 2>/dev/null
|
||||
lastl = `sed -n -e '/hosts:/=' "$1" 2>/dev/null`
|
||||
lasthl = `sed -n '$=' "$1" 2>/dev/null`
|
||||
if [ "$lastl" = "$lasthl" ]; then
|
||||
sed -i '/^ \{0,\}hosts:/d' "$1" 2>/dev/null
|
||||
fi
|
||||
sed -i '/##Custom HOSTS##/,/##Custom HOSTS END##/d' "$1" 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
#获取认证信息
|
||||
yml_auth_get()
|
||||
{
|
||||
local section="$1"
|
||||
config_get_bool "enabled" "$section" "enabled" "1"
|
||||
config_get "username" "$section" "username" ""
|
||||
config_get "password" "$section" "password" ""
|
||||
|
||||
if [ "$enabled" = "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -z "$username" ] || [ -z "$password" ]; then
|
||||
return
|
||||
else
|
||||
echo " - $username:$password" >>/etc/openclash/config.auth
|
||||
fi
|
||||
}
|
||||
|
||||
#添加认证信息
|
||||
yml_auth_custom()
|
||||
{
|
||||
if [ ! -z "$(grep "^authentication:" "$1")" ]; then
|
||||
sed -i '/^dns:/i\#authentication' "$1" 2>/dev/null
|
||||
sed -i '/^authentication:/,/^#authentication/d' "$1" 2>/dev/null
|
||||
fi
|
||||
[ -f /etc/openclash/config.auth ] && {
|
||||
sed -i '/^dns:/i\authentication:' "$1" 2>/dev/null
|
||||
sed -i '/^authentication:/r/etc/openclash/config.auth' "$1" 2>/dev/null
|
||||
rm -rf /etc/openclash/config.auth 2>/dev/null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
start()
|
||||
{
|
||||
echo "OpenClash 开始启动..." >$START_LOG
|
||||
enable=$(uci get openclash.config.enable 2>/dev/null)
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
if [ ! -f $CONFIG_FILE ] && [ -f $BACKPACK_FILE ]; then
|
||||
#禁止多个实例
|
||||
status=$(ps|grep -c /etc/init.d/openclash)
|
||||
[ "$status" -gt "3" ] && exit 0
|
||||
|
||||
if [ ! -f "$CONFIG_FILE" ] && [ "$(ls -l /etc/openclash/config.yml 2>/dev/null |awk '{print int($5/1024)}')" -gt 0 ]; then
|
||||
mv "/etc/openclash/config.yml" "$CONFIG_FILE"
|
||||
fi
|
||||
if [ ! -f "$CONFIG_FILE" ] && [ -f "$BACKPACK_FILE" ]; then
|
||||
cp $BACKPACK_FILE $CONFIG_FILE
|
||||
fi
|
||||
if [ "$enable" -eq 1 ] && [ -f $CONFIG_FILE ]; then
|
||||
echo "第一步: 获取配置中..." >$START_LOG
|
||||
|
||||
echo "OpenClash 开始启动..." >$START_LOG
|
||||
enable=$(uci get openclash.config.enable 2>/dev/null)
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
if [ "$enable" -eq 1 ] && [ -f "$CONFIG_FILE" ]; then
|
||||
#检查是否存在核心文件
|
||||
[ ! -f "$CLASH" ] && {
|
||||
echo "OpenClash 核心文件不存在,开始下载..." >$START_LOG
|
||||
nohup /usr/share/openclash/openclash_core.sh &
|
||||
exit 0
|
||||
}
|
||||
echo "第一步: 获取配置..." >$START_LOG
|
||||
en_mode=$(uci get openclash.config.en_mode 2>/dev/null)
|
||||
enable_custom_dns=$(uci get openclash.config.enable_custom_dns 2>/dev/null)
|
||||
rule_source=$(uci get openclash.config.rule_source 2>/dev/null)
|
||||
@ -184,45 +304,50 @@ if [ "$enable" -eq 1 ] && [ -f $CONFIG_FILE ]; then
|
||||
da_password=$(uci get openclash.config.dashboard_password 2>/dev/null)
|
||||
cn_port=$(uci get openclash.config.cn_port 2>/dev/null)
|
||||
proxy_port=$(uci get openclash.config.proxy_port 2>/dev/null)
|
||||
ipv6_enable=$(uci get openclash.config.ipv6_enable 2>/dev/null)
|
||||
http_port=$(uci get openclash.config.http_port 2>/dev/null)
|
||||
socks_port=$(uci get openclash.config.socks_port 2>/dev/null)
|
||||
echo "第二步: 配置文件检查..." >$START_LOG
|
||||
yml_check "$en_mode" "$enable_custom_dns" "$CONFIG_FILE" "$BACKPACK_FILE"
|
||||
current_mode=$(grep "enhanced-mode:" $CONFIG_FILE |awk -F ' ' '{print $2}' 2>/dev/null)
|
||||
dns_port=`grep listen: $CONFIG_FILE |awk -F ':' '{print $3}' |tr -cd "[0-9]"`
|
||||
yml_dns_check "$dns_port" "$CONFIG_FILE"
|
||||
yml_check "$en_mode" "$enable_custom_dns" "$CONFIG_FILE" "$BACKPACK_FILE" "$START_BACKPACK"
|
||||
grep "^ \{0,\}nameserver:" $CONFIG_FILE >/dev/null 2>&1 && grep "^ \{0,\}Proxy:" $CONFIG_FILE >/dev/null 2>&1 && grep "^ \{0,\}Proxy Group:" $CONFIG_FILE >/dev/null 2>&1 && grep "^ \{0,\}Rule:" $CONFIG_FILE >/dev/null 2>&1
|
||||
if [ "$?" -ne "0" ]; then
|
||||
nohup $CLASH -d "$CLASH_CONFIG" >> $LOG_FILE 2>&1 &
|
||||
echo "错误: 配置文件完整性检查不通过,已自动还原配置文件,请根据日志信息对照模板格式检查修改配置文件!" >$START_LOG
|
||||
mv $START_BACKPACK $CONFIG_FILE
|
||||
stop
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "第三步: 修改配置文件..." >$START_LOG
|
||||
yml_cut "$enable_custom_dns" "$CHANGE_FILE" "$RULE_FILE" "$DNS_FILE" "$CONFIG_FILE"
|
||||
config_load "openclash"
|
||||
config_foreach yml_auth_get "authentication"
|
||||
yml_auth_custom "$CONFIG_FILE"
|
||||
yml_cut "$CHANGE_FILE" "$RULE_FILE" "$DNS_FILE" "$CONFIG_FILE" "$PROXY_FILE"
|
||||
yml_dns_custom "$enable_custom_dns" "$DNS_FILE"
|
||||
sh /usr/share/openclash/yml_change.sh "$LOGTIME" "$en_mode" "$enable_custom_dns" "$da_password" "$cn_port" "$proxy_port" "$current_mode" "$CHANGE_FILE" &
|
||||
yml_hosts_custom "$CHANGE_FILE" "$HOSTS_FILE"
|
||||
sh /usr/share/openclash/yml_change.sh "$LOGTIME" "$en_mode" "$enable_custom_dns" "$da_password" "$cn_port" "$proxy_port" "$CHANGE_FILE" "$ipv6_enable" "$http_port" "$socks_port" &
|
||||
sh /usr/share/openclash/yml_rules_change.sh "$LOGTIME" "$rule_source" "$enable_custom_clash_rules" "$RULE_FILE" &
|
||||
wait
|
||||
cat $CHANGE_FILE $DNS_FILE $RULE_FILE > $CONFIG_FILE 2>/dev/null
|
||||
rm -rf /tmp/yml_* 2>/dev/null
|
||||
echo "第四步: 配置文件完整性检查..." >$START_LOG
|
||||
grep "^Proxy Group:$" $CONFIG_FILE 1>/dev/null && grep "^Rule:$" $CONFIG_FILE 1>/dev/null && grep "^- GEOIP" $CONFIG_FILE 1>/dev/null && grep "nameserver:$" $CONFIG_FILE 1>/dev/null
|
||||
if [ "$?" -ne "0" ]; then
|
||||
echo "错误: 配置文件完整性检查不通过,已自动还原配置文件,请对照模板格式检查修改配置文件..." >$START_LOG
|
||||
cp $BACKPACK_FILE $CONFIG_FILE
|
||||
echo "${LOGTIME} OpenClash Config Error,Please Check And Try Again" >>$LOG_FILE
|
||||
sleep 20
|
||||
echo "" >$START_LOG
|
||||
elif [ ! -z "`sed -n '/nameserver:/{n;p}' $CONFIG_FILE |grep 'fallback:'`" ]; then
|
||||
echo "错误: 配置文件DNS选项下的Nameserver必须设置服务器,已自动还原配置文件,请修改好后再重新启动..." >$START_LOG
|
||||
echo "${LOGTIME} Nameserver Must Be Set, Please Change Your Configrations In Config.yml" >>$LOG_FILE
|
||||
cp $BACKPACK_FILE $CONFIG_FILE
|
||||
sleep 20
|
||||
cat $CHANGE_FILE $DNS_FILE $PROXY_FILE $RULE_FILE > $CONFIG_FILE 2>/dev/null
|
||||
rm -rf /tmp/yaml_* 2>/dev/null
|
||||
echo "第四步: DNS设置检查..." >$START_LOG
|
||||
if [ ! -z "$(sed -n '/^ \{0,\}nameserver:/{n;p}' $CONFIG_FILE |grep '^ \{0,\}fallback:')" ] || [ ! -z "$(sed -n '/^ \{0,\}nameserver:/{n;p}' $CONFIG_FILE |grep 'OpenClash-General')" ]; then
|
||||
echo "错误: 配置文件DNS选项下的Nameserver必须设置服务器,已自动还原配置文件,请重新设置!" >$START_LOG
|
||||
echo "${LOGTIME} Nameserver Must Be Set, Please Change Your Configrations In Config.yaml" >>$LOG_FILE
|
||||
mv $START_BACKPACK $CONFIG_FILE
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "第五步: 启动 Clash 主程序..." >$START_LOG
|
||||
nohup $CLASH -d "$CLASH_CONFIG" > $LOG_FILE 2>&1 &
|
||||
nohup $CLASH -d "$CLASH_CONFIG" >> $LOG_FILE 2>&1 &
|
||||
|
||||
echo "第六步: 设置 OpenClash 防火墙规则..." >$START_LOG
|
||||
ln -s /usr/share/openclash/web /www/openclash 2>/dev/null
|
||||
ln -s /usr/share/openclash/yacd /www/openclash 2>/dev/null
|
||||
|
||||
uci set firewall.@defaults[0].flow_offloading=1
|
||||
uci commit firewall
|
||||
uci commit firewall
|
||||
/etc/init.d/firewall restart >/dev/null 2>&1
|
||||
lan_ip=$(uci get network.lan.ipaddr)
|
||||
|
||||
|
||||
iptables -t nat -N openclash
|
||||
iptables -t nat -N openclash_dns
|
||||
iptables -t nat -A openclash -d 0.0.0.0/8 -j RETURN
|
||||
@ -233,6 +358,7 @@ if [ "$enable" -eq 1 ] && [ -f $CONFIG_FILE ]; then
|
||||
iptables -t nat -A openclash -d 192.168.0.0/16 -j RETURN
|
||||
iptables -t nat -A openclash -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t nat -A openclash -d 240.0.0.0/4 -j RETURN
|
||||
iptables -t nat -A openclash -p tcp --dport 22 -j ACCEPT
|
||||
iptables -t nat -A openclash_dns -p udp -j REDIRECT --to-ports "$dns_port"
|
||||
iptables -t nat -A openclash_dns -p tcp -j REDIRECT --to-ports "$dns_port"
|
||||
iptables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port"
|
||||
@ -240,36 +366,56 @@ if [ "$enable" -eq 1 ] && [ -f $CONFIG_FILE ]; then
|
||||
iptables -t nat -I PREROUTING 1 -p udp --dport 53 -j openclash_dns
|
||||
iptables -t nat -A PREROUTING -p tcp -j openclash
|
||||
|
||||
if [ "$ipv6_enable" -eq 1 ]; then
|
||||
ip6tables -t nat -N openclash
|
||||
ip6tables -t nat -N openclash_dns
|
||||
ip6tables -t nat -A openclash_dns -p udp -j REDIRECT --to-ports "$dns_port"
|
||||
ip6tables -t nat -A openclash_dns -p tcp -j REDIRECT --to-ports "$dns_port"
|
||||
ip6tables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port"
|
||||
ip6tables -t nat -I PREROUTING 1 -p tcp --dport 53 -j openclash_dns
|
||||
ip6tables -t nat -I PREROUTING 1 -p udp --dport 53 -j openclash_dns
|
||||
ip6tables -t nat -A PREROUTING -p tcp -j openclash
|
||||
fi
|
||||
|
||||
echo "第七步: 重启 Dnsmasq 程序..." >$START_LOG
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
if pidof clash >/dev/null; then
|
||||
echo "第八步: 添加 OpenClash 计划任务,启动进程守护程序..." >$START_LOG
|
||||
add_cron
|
||||
echo "OpenClash 启动成功,请等待服务器上线!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Start Successfully" >> $LOG_FILE
|
||||
echo "${LOGTIME} OpenClash Start Successful" >> $LOG_FILE
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "错误: OpenClash 启动失败,请到日志页面查看详细错误信息!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Can Not Start, Please Check The Error Info And Try Again" >> $LOG_FILE
|
||||
sleep 20
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
stop
|
||||
stop && echo "" >$START_LOG
|
||||
fi
|
||||
fi
|
||||
rm -rf $START_BACKPACK 2>/dev/null
|
||||
fi
|
||||
else
|
||||
echo "错误: OpenClash 缺少配置文件,请上传或更新配置文件!" >$START_LOG
|
||||
echo "${LOGTIME} config.yml Missing Or Clash Not Enable" >> $LOG_FILE
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
if [ ! -f "$CONFIG_FILE" ]; then
|
||||
echo "错误: OpenClash 缺少配置文件,请上传或更新配置文件!" >$START_LOG
|
||||
echo "${LOGTIME} Config Not Found" >> $LOG_FILE
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "错误: 请从 OpenClash 客户端界面启动程序!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Must Be Start From The Luci Page" >> $LOG_FILE
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
stop()
|
||||
{
|
||||
echo "OpenClash 开始关闭..." >$START_LOG
|
||||
echo "第一步: 删除 OpenClash 防火墙规则..." >$START_LOG
|
||||
#ipv4
|
||||
iptables -t nat -F openclash >/dev/null 2>&1
|
||||
iptables -t nat -F openclash_dns >/dev/null 2>&1
|
||||
|
||||
@ -280,6 +426,17 @@ stop()
|
||||
|
||||
iptables -t nat -X openclash >/dev/null 2>&1
|
||||
iptables -t nat -X openclash_dns >/dev/null 2>&1
|
||||
#ipv6
|
||||
ip6tables -t nat -F openclash >/dev/null 2>&1
|
||||
ip6tables -t nat -F openclash_dns >/dev/null 2>&1
|
||||
|
||||
nat6_clashs=$(ip6tables -nvL PREROUTING -t nat 2>/dev/null | sed 1,2d | sed -n '/openclash/=' | sort -r)
|
||||
for nat6_clash in $nat6_clashs; do
|
||||
ip6tables -t nat -D PREROUTING "$nat6_clash" >/dev/null 2>&1
|
||||
done
|
||||
|
||||
ip6tables -t nat -X openclash >/dev/null 2>&1
|
||||
ip6tables -t nat -X openclash_dns >/dev/null 2>&1
|
||||
|
||||
uci set firewall.@defaults[0].flow_offloading=1
|
||||
uci commit firewall
|
||||
@ -291,31 +448,28 @@ stop()
|
||||
echo "第三步: 关闭 Clash 主程序..." >$START_LOG
|
||||
kill -9 "$(pidof clash|sed 's/$//g')" 2>/dev/null
|
||||
|
||||
echo "第四步: 删除 OpenClash 计划任务..." >$START_LOG
|
||||
del_cron
|
||||
|
||||
echo "第五步: 重启 Dnsmasq 程序..." >$START_LOG
|
||||
echo "第四步: 重启 Dnsmasq 程序..." >$START_LOG
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
|
||||
echo "第六步: 删除 OpenClash 残留文件..." >$START_LOG
|
||||
echo "第五步:删除 OpenClash 残留文件..." >$START_LOG
|
||||
rule_source=$(uci get openclash.config.rule_source 2>/dev/null)
|
||||
if [ "$rule_source" != 0 ]; then
|
||||
rm -rf /tmp/clash_rule.yml >/dev/null 2>&1
|
||||
rm -rf /tmp/Proxy_Group >/dev/null 2>&1
|
||||
fi
|
||||
enable=$(uci get openclash.config.enable 2>/dev/null)
|
||||
if [ "$enable" -eq 0 ]; then
|
||||
rm -rf $LOG_FILE
|
||||
rm -rf /www/openclash 2> /dev/null
|
||||
rm -rf /tmp/openclash_last_version 2> /dev/null
|
||||
sed -i '/openclash.log/d' $CRON_FILE
|
||||
rm -rf $LOG_FILE 2>/dev/null
|
||||
rm -rf /www/openclash 2>/dev/null
|
||||
rm -rf /tmp/openclash_last_version 2>/dev/null
|
||||
rm -rf /tmp/clash_last_version 2>/dev/null
|
||||
echo "OpenClash 关闭成功!" >$START_LOG
|
||||
rm -rf $START_LOG
|
||||
else
|
||||
echo "OpenClash 关闭成功!" >$START_LOG
|
||||
sleep 5
|
||||
rm -rf $START_LOG
|
||||
fi
|
||||
|
||||
del_cron
|
||||
|
||||
echo "CLASH STOP"
|
||||
echo "OpenClash Already Stop"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,58 @@
|
||||
Rule:
|
||||
##source:ConnersHua
|
||||
# Feeb
|
||||
- DOMAIN-KEYWORD,epochtimes,REJECT
|
||||
- DOMAIN-SUFFIX,881903.com,REJECT
|
||||
- DOMAIN-SUFFIX,aboluowang.com,REJECT
|
||||
- DOMAIN-SUFFIX,bannedbook.org,REJECT
|
||||
- DOMAIN-SUFFIX,china21.org,REJECT
|
||||
- DOMAIN-SUFFIX,chinaaffairs.org,REJECT
|
||||
- DOMAIN-SUFFIX,dajiyuan.com,REJECT
|
||||
- DOMAIN-SUFFIX,dalianmeng.org,REJECT
|
||||
- DOMAIN-SUFFIX,dkn.tv,REJECT
|
||||
- DOMAIN-SUFFIX,dongtaiwang.com,REJECT
|
||||
- DOMAIN-SUFFIX,edoors.com,REJECT
|
||||
- DOMAIN-SUFFIX,epochweekly.com,REJECT
|
||||
- DOMAIN-SUFFIX,falundafa.org,REJECT
|
||||
- DOMAIN-SUFFIX,fgmtv.org,REJECT
|
||||
- DOMAIN-SUFFIX,gardennetworks.com,REJECT
|
||||
- DOMAIN-SUFFIX,gongyiluntan.org,REJECT
|
||||
- DOMAIN-SUFFIX,gpass1.com,REJECT
|
||||
- DOMAIN-SUFFIX,hrichina.org,REJECT
|
||||
- DOMAIN-SUFFIX,huanghuagang.org,REJECT
|
||||
- DOMAIN-SUFFIX,internetfreedom.org,REJECT
|
||||
- DOMAIN-SUFFIX,kanzhongguo.com,REJECT
|
||||
- DOMAIN-SUFFIX,lagranepoca.com,REJECT
|
||||
- DOMAIN-SUFFIX,mh4u.org,REJECT
|
||||
- DOMAIN-SUFFIX,mhradio.org,REJECT
|
||||
- DOMAIN-SUFFIX,minghui.org,REJECT
|
||||
- DOMAIN-SUFFIX,newrealmstudios.ca,REJECT
|
||||
- DOMAIN-SUFFIX,ntdtv.com,REJECT
|
||||
- DOMAIN-SUFFIX,ogate.org,REJECT
|
||||
- DOMAIN-SUFFIX,open.com.hk,REJECT
|
||||
- DOMAIN-SUFFIX,organcare.org.tw,REJECT
|
||||
- DOMAIN-SUFFIX,qxbbs.org,REJECT
|
||||
- DOMAIN-SUFFIX,renminbao.com,REJECT
|
||||
- DOMAIN-SUFFIX,secretchina.com,REJECT
|
||||
- DOMAIN-SUFFIX,shenyun.com,REJECT
|
||||
- DOMAIN-SUFFIX,shenyunperformingarts.org,REJECT
|
||||
- DOMAIN-SUFFIX,shenzhoufilm.com,REJECT
|
||||
- DOMAIN-SUFFIX,soundofhope.org,REJECT
|
||||
- DOMAIN-SUFFIX,theepochtimes.com,REJECT
|
||||
- DOMAIN-SUFFIX,tiandixing.org,REJECT
|
||||
- DOMAIN-SUFFIX,tuidang.org,REJECT
|
||||
- DOMAIN-SUFFIX,velkaepocha.sk,REJECT
|
||||
- DOMAIN-SUFFIX,watchinese.com,REJECT
|
||||
- DOMAIN-SUFFIX,wixsite.com,REJECT
|
||||
- DOMAIN-SUFFIX,wujie.net,REJECT
|
||||
- DOMAIN-SUFFIX,wujieliulan.com,REJECT
|
||||
- DOMAIN-SUFFIX,xinsheng.net,REJECT
|
||||
- DOMAIN-SUFFIX,zhengjian.org,REJECT
|
||||
- DOMAIN-SUFFIX,zhuichaguoji.org,REJECT
|
||||
|
||||
# Internet Service Provider Hijacking Protection 运营商劫持保护
|
||||
- DOMAIN-SUFFIX,17gouwuba.com,Hijacking
|
||||
- DOMAIN-SUFFIX,186078.com,Hijacking
|
||||
- DOMAIN-SUFFIX,189zj.cn,Hijacking
|
||||
- DOMAIN-SUFFIX,285680.com,Hijacking
|
||||
- DOMAIN-SUFFIX,3721zh.com,Hijacking
|
||||
@ -48,6 +99,7 @@ Rule:
|
||||
- DOMAIN-SUFFIX,jdkic.com,Hijacking
|
||||
- DOMAIN-SUFFIX,jiubuhua.com,Hijacking
|
||||
- DOMAIN-SUFFIX,jwg365.cn,Hijacking
|
||||
- DOMAIN-SUFFIX,kawo77.com,Hijacking
|
||||
- DOMAIN-SUFFIX,kualianyingxiao.cn,Hijacking
|
||||
- DOMAIN-SUFFIX,kumihua.com,Hijacking
|
||||
- DOMAIN-SUFFIX,linktech.cn,Hijacking
|
||||
@ -56,6 +108,8 @@ Rule:
|
||||
- DOMAIN-SUFFIX,minisplat.cn,Hijacking
|
||||
- DOMAIN-SUFFIX,mkitgfs.com,Hijacking
|
||||
- DOMAIN-SUFFIX,mlnbike.com,Hijacking
|
||||
- DOMAIN-SUFFIX,mobjump.com,Hijacking
|
||||
- DOMAIN-SUFFIX,nbkbgd.cn,Hijacking
|
||||
- DOMAIN-SUFFIX,newapi.com,Hijacking
|
||||
- DOMAIN-SUFFIX,pinzhitmall.com,Hijacking
|
||||
- DOMAIN-SUFFIX,poppyta.com,Hijacking
|
||||
@ -129,6 +183,7 @@ Rule:
|
||||
- IP-CIDR,115.182.16.79/32,Hijacking
|
||||
- IP-CIDR,118.144.88.126/32,Hijacking
|
||||
- IP-CIDR,118.144.88.215/32,Hijacking
|
||||
- IP-CIDR,118.144.88.216/32,Hijacking
|
||||
- IP-CIDR,120.76.189.132/32,Hijacking
|
||||
- IP-CIDR,124.14.21.147/32,Hijacking
|
||||
- IP-CIDR,124.14.21.151/32,Hijacking
|
||||
@ -214,6 +269,9 @@ Rule:
|
||||
- DOMAIN-SUFFIX,nflximg.net,ForeignMedia
|
||||
- DOMAIN-SUFFIX,nflxso.net,ForeignMedia
|
||||
- DOMAIN-SUFFIX,nflxvideo.net,ForeignMedia
|
||||
# > Pornhub
|
||||
- DOMAIN-SUFFIX,phncdn.com,ForeignMedia
|
||||
- DOMAIN-SUFFIX,pornhub.com,ForeignMedia
|
||||
# > Amazon Prime Video (US|JP)
|
||||
# USER-AGENT,InstantVideo.US*,ForeignMedia
|
||||
# USER-AGENT,Prime%20Video*,ForeignMedia
|
||||
@ -234,6 +292,7 @@ Rule:
|
||||
# > Hulu
|
||||
- DOMAIN-SUFFIX,hulu.com,ForeignMedia
|
||||
- DOMAIN-SUFFIX,huluim.com,ForeignMedia
|
||||
- DOMAIN-SUFFIX,hulustream.com,ForeignMedia
|
||||
# > PBS
|
||||
# USER-AGENT,PBS*,ForeignMedia
|
||||
- DOMAIN-SUFFIX,pbs.org,ForeignMedia
|
||||
@ -254,6 +313,7 @@ Rule:
|
||||
- DOMAIN,videos-f.jwpsrv.com,ForeignMedia
|
||||
# > ViuTV
|
||||
# USER-AGENT,ViuTV*,ForeignMedia
|
||||
- DOMAIN-SUFFIX,nowe.com,ForeignMedia
|
||||
- DOMAIN-SUFFIX,viu.tv,ForeignMedia
|
||||
- DOMAIN,api.viu.now.com,ForeignMedia
|
||||
# > (JP)
|
||||
@ -276,6 +336,10 @@ Rule:
|
||||
- DOMAIN-SUFFIX,bbci.co.uk,ForeignMedia
|
||||
- DOMAIN-KEYWORD,bbcfmt,ForeignMedia
|
||||
- DOMAIN-KEYWORD,uk-live,ForeignMedia
|
||||
# > All4
|
||||
# USER-AGENT,All4*,ForeignMedia
|
||||
- DOMAIN-SUFFIX,c4assets.com,ForeignMedia
|
||||
- DOMAIN-SUFFIX,channel4.com,ForeignMedia
|
||||
# > (TW)
|
||||
# > Bahamut
|
||||
# USER-AGENT,Anime*,ForeignMedia
|
||||
@ -379,6 +443,10 @@ Rule:
|
||||
- DOMAIN-SUFFIX,line-apps.com,PROXY
|
||||
- DOMAIN-SUFFIX,line-scdn.net,PROXY
|
||||
- DOMAIN-SUFFIX,naver.jp,PROXY
|
||||
- IP-CIDR,103.2.30.0/23,PROXY
|
||||
- IP-CIDR,125.209.208.0/20,PROXY
|
||||
- IP-CIDR,147.92.128.0/17,PROXY
|
||||
- IP-CIDR,203.104.144.0/21,PROXY
|
||||
# > Other
|
||||
- DOMAIN-SUFFIX,4shared.com,PROXY
|
||||
- DOMAIN-SUFFIX,881903.com,PROXY
|
||||
@ -389,6 +457,7 @@ Rule:
|
||||
- DOMAIN-SUFFIX,amazon.co.jp,PROXY
|
||||
- DOMAIN-SUFFIX,apigee.com,PROXY
|
||||
- DOMAIN-SUFFIX,apk-dl.com,PROXY
|
||||
- DOMAIN-SUFFIX,apkfind.com,PROXY
|
||||
- DOMAIN-SUFFIX,apkmirror.com,PROXY
|
||||
- DOMAIN-SUFFIX,apkmonk.com,PROXY
|
||||
- DOMAIN-SUFFIX,apkpure.com,PROXY
|
||||
@ -413,6 +482,7 @@ Rule:
|
||||
- DOMAIN-SUFFIX,bloglovin.com,PROXY
|
||||
- DOMAIN-SUFFIX,bloomberg.cn,PROXY
|
||||
- DOMAIN-SUFFIX,bloomberg.com,PROXY
|
||||
- DOMAIN-SUFFIX,blubrry.com,PROXY
|
||||
- DOMAIN-SUFFIX,book.com.tw,PROXY
|
||||
- DOMAIN-SUFFIX,booklive.jp,PROXY
|
||||
- DOMAIN-SUFFIX,books.com.tw,PROXY
|
||||
@ -422,6 +492,7 @@ Rule:
|
||||
- DOMAIN-SUFFIX,bwh1.net,PROXY
|
||||
- DOMAIN-SUFFIX,castbox.fm,PROXY
|
||||
- DOMAIN-SUFFIX,cbc.ca,PROXY
|
||||
- DOMAIN-SUFFIX,cccat.cc,PROXY
|
||||
- DOMAIN-SUFFIX,cdw.com,PROXY
|
||||
- DOMAIN-SUFFIX,change.org,PROXY
|
||||
- DOMAIN-SUFFIX,ck101.com,PROXY
|
||||
@ -547,6 +618,7 @@ Rule:
|
||||
- DOMAIN-SUFFIX,ok.ru,PROXY
|
||||
- DOMAIN-SUFFIX,okex.com,PROXY
|
||||
- DOMAIN-SUFFIX,orientaldaily.com.my,PROXY
|
||||
- DOMAIN-SUFFIX,overcast.fm,PROXY
|
||||
- DOMAIN-SUFFIX,paltalk.com,PROXY
|
||||
- DOMAIN-SUFFIX,pbxes.com,PROXY
|
||||
- DOMAIN-SUFFIX,pcdvd.com.tw,PROXY
|
||||
@ -556,7 +628,6 @@ Rule:
|
||||
- DOMAIN-SUFFIX,pixiv.net,PROXY
|
||||
- DOMAIN-SUFFIX,player.fm,PROXY
|
||||
- DOMAIN-SUFFIX,plurk.com,PROXY
|
||||
- DOMAIN-SUFFIX,pornhub.com,PROXY
|
||||
- DOMAIN-SUFFIX,prism-break.org,PROXY
|
||||
- DOMAIN-SUFFIX,proxifier.com,PROXY
|
||||
- DOMAIN-SUFFIX,pts.org.tw,PROXY
|
||||
@ -578,17 +649,20 @@ Rule:
|
||||
- DOMAIN-SUFFIX,scribd.com,PROXY
|
||||
- DOMAIN-SUFFIX,seatguru.com,PROXY
|
||||
- DOMAIN-SUFFIX,shadowsocks.org,PROXY
|
||||
- DOMAIN-SUFFIX,shopee.tw,PROXY
|
||||
- DOMAIN-SUFFIX,slideshare.net,PROXY
|
||||
- DOMAIN-SUFFIX,softfamous.com,PROXY
|
||||
- DOMAIN-SUFFIX,soundcloud.com,PROXY
|
||||
- DOMAIN-SUFFIX,startpage.com,PROXY
|
||||
- DOMAIN-SUFFIX,steamcommunity.com,PROXY
|
||||
- DOMAIN-SUFFIX,steemit.com,PROXY
|
||||
- DOMAIN-SUFFIX,steemitwallet.com,PROXY
|
||||
- DOMAIN-SUFFIX,t66y.com,PROXY
|
||||
- DOMAIN-SUFFIX,tapatalk.com,PROXY
|
||||
- DOMAIN-SUFFIX,teco-hk.org,PROXY
|
||||
- DOMAIN-SUFFIX,teco-mo.org,PROXY
|
||||
- DOMAIN-SUFFIX,teddysun.com,PROXY
|
||||
- DOMAIN-SUFFIX,theguardian.com,PROXY
|
||||
- DOMAIN-SUFFIX,theinitium.com,PROXY
|
||||
- DOMAIN-SUFFIX,tineye.com,PROXY
|
||||
- DOMAIN-SUFFIX,torproject.org,PROXY
|
||||
@ -614,14 +688,18 @@ Rule:
|
||||
- DOMAIN-SUFFIX,whoer.net,PROXY
|
||||
- DOMAIN-SUFFIX,wikimapia.org,PROXY
|
||||
- DOMAIN-SUFFIX,wikipedia.org,PROXY
|
||||
- DOMAIN-SUFFIX,winudf.com,PROXY
|
||||
- DOMAIN-SUFFIX,wire.com,PROXY
|
||||
- DOMAIN-SUFFIX,workflow.is,PROXY
|
||||
- DOMAIN-SUFFIX,worldcat.org,PROXY
|
||||
- DOMAIN-SUFFIX,wsj.com,PROXY
|
||||
- DOMAIN-SUFFIX,wsj.net,PROXY
|
||||
- DOMAIN-SUFFIX,xboxlive.com,PROXY
|
||||
- DOMAIN-SUFFIX,xhamster.com,PROXY
|
||||
- DOMAIN-SUFFIX,xnxx.com,PROXY
|
||||
- DOMAIN-SUFFIX,xvideos.com,PROXY
|
||||
- DOMAIN-SUFFIX,yahoo.com,PROXY
|
||||
- DOMAIN-SUFFIX,yandex.ru,PROXY
|
||||
- DOMAIN-SUFFIX,yesasia.com,PROXY
|
||||
- DOMAIN-SUFFIX,yes-news.com,PROXY
|
||||
- DOMAIN-SUFFIX,yomiuri.co.jp,PROXY
|
||||
@ -688,21 +766,32 @@ Rule:
|
||||
|
||||
# (The Most Popular Sites)
|
||||
# > Apple
|
||||
# > Apple URL Shortener
|
||||
# >> Apple URL Shortener
|
||||
- DOMAIN-SUFFIX,appsto.re,PROXY
|
||||
# > TestFlight
|
||||
# >> TestFlight
|
||||
- DOMAIN,beta.itunes.apple.com,PROXY
|
||||
# > iBooks Store download
|
||||
- DOMAIN,testflight.apple.com,PROXY
|
||||
# >> iBooks Store download
|
||||
- DOMAIN,books.itunes.apple.com,PROXY
|
||||
# > iTunes Store Moveis Trailers
|
||||
# >> iTunes Store Moveis Trailers
|
||||
- DOMAIN,hls.itunes.apple.com,PROXY
|
||||
# App Store Preview
|
||||
# >> App Store Preview
|
||||
- DOMAIN,apps.apple.com,PROXY
|
||||
- DOMAIN,itunes.apple.com,PROXY
|
||||
# > Spotlight
|
||||
# >> Spotlight
|
||||
- DOMAIN,api-glb-sea.smoot.apple.com,PROXY
|
||||
# > Dictionary
|
||||
# >> Dictionary
|
||||
- DOMAIN,lookup-api.apple.com,PROXY
|
||||
# PROCESS-NAME,LookupViewService,PROXY
|
||||
# >> Apple News and Apple Map TOMTOM Version
|
||||
- DOMAIN,gspe1-ssl.ls.apple.com,PROXY
|
||||
# USER-AGENT,AppleNews*,PROXY
|
||||
# USER-AGENT,com.apple.news*,PROXY
|
||||
- DOMAIN-SUFFIX,apple.news,PROXY
|
||||
- DOMAIN,news-client.apple.com,PROXY
|
||||
- DOMAIN,news-edge.apple.com,PROXY
|
||||
- DOMAIN,news-events.apple.com,PROXY
|
||||
- DOMAIN,apple.comscoreresearch.com,PROXY
|
||||
# > Google
|
||||
- DOMAIN-SUFFIX,abc.xyz,PROXY
|
||||
- DOMAIN-SUFFIX,android.com,PROXY
|
||||
@ -795,6 +884,7 @@ Rule:
|
||||
- DOMAIN-SUFFIX,signal.org,PROXY
|
||||
- DOMAIN-SUFFIX,sparknotes.com,PROXY
|
||||
- DOMAIN-SUFFIX,streetvoice.com,PROXY
|
||||
- DOMAIN-SUFFIX,supertop.co,PROXY
|
||||
- DOMAIN-SUFFIX,ttvnw.net,PROXY
|
||||
- DOMAIN-SUFFIX,tv.com,PROXY
|
||||
- DOMAIN-SUFFIX,twitchcdn.net,PROXY
|
||||
@ -808,29 +898,17 @@ Rule:
|
||||
- DOMAIN-SUFFIX,yimg.com,PROXY
|
||||
|
||||
# China Area Network
|
||||
# > App Store Download || iBooks Sample
|
||||
- DOMAIN-SUFFIX,itunes.apple.com,Apple
|
||||
# > Apple Music
|
||||
- DOMAIN,aod.itunes.apple.com,Apple
|
||||
- DOMAIN,audio.itunes.apple.com,Apple
|
||||
- DOMAIN,audio-ssl.itunes.apple.com,Apple
|
||||
- DOMAIN,streamingaudio.itunes.apple.com,Apple
|
||||
# > Apple TV
|
||||
- DOMAIN,ocvideo.apple.com,Apple
|
||||
# > Apple News and Apple Map TOMTOM Version
|
||||
- DOMAIN,gspe1-ssl.ls.apple.com,Apple
|
||||
# PROCESS-NAME,News,Apple
|
||||
# > Apple
|
||||
- DOMAIN-SUFFIX,aaplimg.com,Apple
|
||||
- DOMAIN-SUFFIX,apple.co,DIRECT
|
||||
- DOMAIN-SUFFIX,apple.com,DIRECT
|
||||
- DOMAIN-SUFFIX,appstore.com,DIRECT
|
||||
- DOMAIN-SUFFIX,apple.co,Apple
|
||||
- DOMAIN-SUFFIX,apple.com,Apple
|
||||
- DOMAIN-SUFFIX,appstore.com,Apple
|
||||
- DOMAIN-SUFFIX,cdn-apple.com,Apple
|
||||
- DOMAIN-SUFFIX,crashlytics.com,DIRECT
|
||||
- DOMAIN-SUFFIX,icloud.com,DIRECT
|
||||
- DOMAIN-SUFFIX,crashlytics.com,Apple
|
||||
- DOMAIN-SUFFIX,icloud.com,Apple
|
||||
- DOMAIN-SUFFIX,icloud-content.com,Apple
|
||||
- DOMAIN-SUFFIX,me.com,DIRECT
|
||||
- DOMAIN-SUFFIX,mzstatic.com,DIRECT
|
||||
- DOMAIN-SUFFIX,me.com,Apple
|
||||
- DOMAIN-SUFFIX,mzstatic.com,Apple
|
||||
# > Microsoft
|
||||
- DOMAIN-SUFFIX,microsoft.com,DIRECT
|
||||
- DOMAIN-SUFFIX,msecnd.net,DIRECT
|
||||
@ -860,6 +938,7 @@ Rule:
|
||||
- DOMAIN-SUFFIX,qq.com,DIRECT
|
||||
- DOMAIN-SUFFIX,tencent.com,DIRECT
|
||||
# > Alibaba
|
||||
# USER-AGENT,%E4%BC%98%E9%85%B7*,DIRECT
|
||||
- DOMAIN-SUFFIX,alibaba.com,DIRECT
|
||||
- DOMAIN-SUFFIX,alicdn.com,DIRECT
|
||||
- DOMAIN-SUFFIX,alikunlun.com,DIRECT
|
||||
@ -874,13 +953,18 @@ Rule:
|
||||
- DOMAIN-SUFFIX,xiami.com,DIRECT
|
||||
- DOMAIN-SUFFIX,xiami.net,DIRECT
|
||||
# > NetEase
|
||||
# USER-AGENT,NeteaseMusic*,DIRECT
|
||||
# USER-AGENT,%E7%BD%91%E6%98%93%E4%BA%91%E9%9F%B3%E4%B9%90*,DIRECT
|
||||
- DOMAIN-SUFFIX,163.com,DIRECT
|
||||
- DOMAIN-SUFFIX,126.net,DIRECT
|
||||
- DOMAIN-SUFFIX,127.net,DIRECT
|
||||
- DOMAIN-SUFFIX,163yun.com,DIRECT
|
||||
- DOMAIN-SUFFIX,lofter.com,DIRECT
|
||||
- DOMAIN-SUFFIX,ydstatic.com,DIRECT
|
||||
# > Sohu
|
||||
- DOMAIN-SUFFIX,sohu.com,DIRECT
|
||||
- DOMAIN-SUFFIX,sohucs.com,DIRECT
|
||||
- DOMAIN-SUFFIX,sohu-inc.com,DIRECT
|
||||
- DOMAIN-SUFFIX,v-56.com,DIRECT
|
||||
# > Sina
|
||||
- DOMAIN-SUFFIX,weibo.com,DIRECT
|
||||
@ -907,8 +991,10 @@ Rule:
|
||||
# > Meitu
|
||||
- DOMAIN-SUFFIX,meitu.com,DIRECT
|
||||
- DOMAIN-SUFFIX,meitudata.com,DIRECT
|
||||
- DOMAIN-SUFFIX,meitustat.com,DIRECT
|
||||
- DOMAIN-SUFFIX,meipai.com,DIRECT
|
||||
# > YYeTs
|
||||
# USER-AGENT,YYeTs*,DIRECT
|
||||
- DOMAIN-SUFFIX,jstucdn.com,DIRECT
|
||||
- DOMAIN-SUFFIX,zimuzu.io,DIRECT
|
||||
- DOMAIN-SUFFIX,zimuzu.tv,DIRECT
|
||||
@ -930,8 +1016,10 @@ Rule:
|
||||
# > ChinaNet
|
||||
- DOMAIN-SUFFIX,21cn.com,DIRECT
|
||||
# > ByteDance
|
||||
- DOMAIN-SUFFIX,feiliao.com,DIRECT
|
||||
- DOMAIN-SUFFIX,pstatp.com,DIRECT
|
||||
- DOMAIN-SUFFIX,snssdk.com,DIRECT
|
||||
- DOMAIN-SUFFIX,iesdouyin.com,DIRECT
|
||||
- DOMAIN-SUFFIX,toutiao.com,DIRECT
|
||||
# > 360
|
||||
- DOMAIN-SUFFIX,qhres.com,DIRECT
|
||||
@ -960,12 +1048,15 @@ Rule:
|
||||
- DOMAIN,speedtest.macpaw.com,DIRECT
|
||||
# > Other
|
||||
- DOMAIN-SUFFIX,cn,DIRECT
|
||||
- DOMAIN-SUFFIX,beitaichufang.com,DIRECT
|
||||
- DOMAIN-SUFFIX,cailianpress.com,DIRECT
|
||||
- DOMAIN-SUFFIX,chunyu.mobi,DIRECT
|
||||
- DOMAIN-SUFFIX,chushou.tv,DIRECT
|
||||
- DOMAIN-SUFFIX,cloudflare.com,DIRECT
|
||||
- DOMAIN-SUFFIX,cmbchina.com,DIRECT
|
||||
- DOMAIN-SUFFIX,cmbimg.com,DIRECT
|
||||
- DOMAIN-SUFFIX,dfcfw.com,DIRECT
|
||||
- DOMAIN-SUFFIX,douban.com,DIRECT
|
||||
- DOMAIN-SUFFIX,doubanio.com,DIRECT
|
||||
- DOMAIN-SUFFIX,douyu.com,DIRECT
|
||||
- DOMAIN-SUFFIX,dxycdn.com,DIRECT
|
||||
@ -973,21 +1064,29 @@ Rule:
|
||||
- DOMAIN-SUFFIX,futunn.com,DIRECT
|
||||
- DOMAIN-SUFFIX,geilicdn.com,DIRECT
|
||||
- DOMAIN-SUFFIX,hicloud.com,DIRECT
|
||||
- DOMAIN-SUFFIX,huya.com,DIRECT
|
||||
- DOMAIN-SUFFIX,infinitynewtab.com,DIRECT
|
||||
- DOMAIN-SUFFIX,ithome.com,DIRECT
|
||||
- DOMAIN-SUFFIX,keepcdn.com,DIRECT
|
||||
- DOMAIN-SUFFIX,kkmh.com,DIRECT
|
||||
- DOMAIN-SUFFIX,ksosoft.com,DIRECT
|
||||
- DOMAIN-SUFFIX,luojilab.com,DIRECT
|
||||
- DOMAIN-SUFFIX,maoyun.tv,DIRECT
|
||||
- DOMAIN-SUFFIX,meituan.net,DIRECT
|
||||
- DOMAIN-SUFFIX,mobike.com,DIRECT
|
||||
- DOMAIN-SUFFIX,mubu.com,DIRECT
|
||||
- DOMAIN-SUFFIX,myzaker.com,DIRECT
|
||||
- DOMAIN-SUFFIX,nvidia.com,DIRECT
|
||||
- DOMAIN-SUFFIX,paypal.com,DIRECT
|
||||
- DOMAIN-SUFFIX,paypalobjects.com,DIRECT
|
||||
- DOMAIN-SUFFIX,ronghub.com,DIRECT
|
||||
- DOMAIN-SUFFIX,ruguoapp.com,DIRECT
|
||||
- DOMAIN-SUFFIX,smzdm.com,DIRECT
|
||||
- DOMAIN-SUFFIX,snapdrop.net,DIRECT
|
||||
- DOMAIN-SUFFIX,sogo.com,DIRECT
|
||||
- DOMAIN-SUFFIX,sogou.com,DIRECT
|
||||
- DOMAIN-SUFFIX,sogoucdn.com,DIRECT
|
||||
- DOMAIN-SUFFIX,sspai.com,DIRECT
|
||||
- DOMAIN-SUFFIX,teamviewer.com,DIRECT
|
||||
- DOMAIN-SUFFIX,tianyancha.com,DIRECT
|
||||
- DOMAIN-SUFFIX,udacity.com,DIRECT
|
||||
@ -999,8 +1098,6 @@ Rule:
|
||||
- DOMAIN-SUFFIX,zhihu.com,DIRECT
|
||||
- DOMAIN-SUFFIX,zhimg.com,DIRECT
|
||||
- DOMAIN-SUFFIX,zhuihd.com,DIRECT
|
||||
# USER-AGENT,NeteaseMusic*,DIRECT
|
||||
# USER-AGENT,%E7%BD%91%E6%98%93%E4%BA%91%E9%9F%B3%E4%B9%90*,DIRECT
|
||||
|
||||
# Local Area Network
|
||||
- DOMAIN-SUFFIX,local,DIRECT
|
||||
@ -1053,4 +1150,4 @@ Rule:
|
||||
# GeoIP China
|
||||
- GEOIP,CN,DIRECT
|
||||
|
||||
- MATCH,Final
|
||||
- MATCH,Final
|
||||
@ -76,4 +76,4 @@ Rule:
|
||||
|
||||
- GEOIP,CN,PROXY
|
||||
|
||||
- MATCH,DIRECT
|
||||
- MATCH,DIRECT
|
||||
BIN
package/cnsztl/luci-app-openclash/files/etc/openclash/Country.mmdb
Executable file → Normal file
@ -0,0 +1,159 @@
|
||||
# Copyright (c) 2018 Dreamacro
|
||||
|
||||
# port of HTTP
|
||||
port: 7890 # 此项将被接管
|
||||
|
||||
# port of SOCKS5
|
||||
socks-port: 7891 # 此项将被接管
|
||||
|
||||
# redir port for Linux and macOS
|
||||
redir-port: 7892 # 此项将被接管
|
||||
|
||||
allow-lan: true # 此项将被接管为true
|
||||
|
||||
# Rule / Global/ Direct (default is Rule)
|
||||
mode: Rule
|
||||
|
||||
# set log level to stdout (default is info)
|
||||
# info / warning / error / debug / silent
|
||||
log-level: info
|
||||
|
||||
# A RESTful API for clash
|
||||
external-controller: 0.0.0.0:9090 # 此项将被接管
|
||||
|
||||
# you can put the static web resource (such as clash-dashboard) to a directory, and clash would serve in `${API}/ui`
|
||||
# input is a relative path to the configuration directory or an absolute path
|
||||
external-ui: "/usr/share/openclash/dashboard" # 此项将被接管
|
||||
|
||||
# Secret for RESTful API (Optional)
|
||||
secret: '123456' # 此项将被接管
|
||||
|
||||
# experimental feature
|
||||
experimental:
|
||||
ignore-resolve-fail: true # ignore dns resolve fail, default value is true
|
||||
|
||||
# authentication of local SOCKS5/HTTP(S) server
|
||||
authentication: # 此项将被接管
|
||||
- "user1:pass1"
|
||||
- "user2:pass2"
|
||||
|
||||
dns: # 此参数必须保留,不能删除,如订阅配置无包括此项的所有DNS设置,OpenClash将自动添加
|
||||
enable: true # set true to enable dns (default is false) # 此项将被接管为true
|
||||
ipv6: false # default is false # 此项将被接管
|
||||
listen: 0.0.0.0:53 # 端口为53时将被接管为7874
|
||||
enhanced-mode: redir-host # or fake-ip # 此项可被接管
|
||||
fake-ip-range: 198.18.0.1/16 # if you don't know what it is, don't change it # 此项将被接管
|
||||
# experimental hosts, support wildcard (e.g. *.clash.dev Even *.foo.*.example.com)
|
||||
# static domain has a higher priority than wildcard domain (foo.example.com > *.example.com)
|
||||
# NOTE: hosts don't work with `fake-ip`
|
||||
# hosts:
|
||||
# '*.clash.dev': 127.0.0.1
|
||||
# 'alpha.clash.dev': '::1'
|
||||
nameserver: # 此参数必须保留,不能删除
|
||||
- 114.114.114.114
|
||||
- tls://dns.rubyfish.cn:853 # dns over tls
|
||||
- https://1.1.1.1/dns-query # dns over https
|
||||
fallback: # concurrent request with nameserver, fallback used when GEOIP country isn't CN
|
||||
- tcp://1.1.1.1
|
||||
|
||||
# 以上设置您可直接覆盖到配置文件,无需更改
|
||||
# Openclash 不会对下方服务器设置进行任何更改,请确保设置正确
|
||||
|
||||
Proxy: # 此参数必须保留,不能删除
|
||||
|
||||
# shadowsocks
|
||||
# The types of cipher are consistent with go-shadowsocks2
|
||||
# support AEAD_AES_128_GCM AEAD_AES_192_GCM AEAD_AES_256_GCM AEAD_CHACHA20_POLY1305 AES-128-CTR AES-192-CTR AES-256-CTR AES-128-CFB AES-192-CFB AES-256-CFB CHACHA20-IETF XCHACHA20
|
||||
# In addition to what go-shadowsocks2 supports, it also supports chacha20 rc4-md5 xchacha20-ietf-poly1305
|
||||
- { name: "ss1", type: ss, server: server, port: 443, cipher: AEAD_CHACHA20_POLY1305, password: "password", udp: true }
|
||||
|
||||
# old obfs configuration remove after prerelease
|
||||
- name: "ss2"
|
||||
type: ss
|
||||
server: server
|
||||
port: 443
|
||||
cipher: AEAD_CHACHA20_POLY1305
|
||||
password: "password"
|
||||
plugin: obfs
|
||||
plugin-opts:
|
||||
mode: tls # or http
|
||||
# host: bing.com
|
||||
|
||||
- name: "ss3"
|
||||
type: ss
|
||||
server: server
|
||||
port: 443
|
||||
cipher: AEAD_CHACHA20_POLY1305
|
||||
password: "password"
|
||||
plugin: v2ray-plugin
|
||||
plugin-opts:
|
||||
mode: websocket # no QUIC now
|
||||
# tls: true # wss
|
||||
# skip-cert-verify: true
|
||||
# host: bing.com
|
||||
# path: "/"
|
||||
# headers:
|
||||
# custom: value
|
||||
|
||||
# vmess
|
||||
# cipher support auto/aes-128-gcm/chacha20-poly1305/none
|
||||
- { name: "vmess", type: vmess, server: server, port: 443, uuid: uuid, alterId: 32, cipher: auto }
|
||||
# with tls
|
||||
- { name: "vmess", type: vmess, server: server, port: 443, uuid: uuid, alterId: 32, cipher: auto, tls: true }
|
||||
# with tls and skip-cert-verify
|
||||
- { name: "vmess", type: vmess, server: server, port: 443, uuid: uuid, alterId: 32, cipher: auto, tls: true, skip-cert-verify: true }
|
||||
# with ws-path and ws-headers
|
||||
- { name: "vmess", type: vmess, server: server, port: 443, uuid: uuid, alterId: 32, cipher: auto, network: ws, ws-path: /path, ws-headers: { Host: v2ray.com } }
|
||||
# with ws + tls
|
||||
- { name: "vmess", type: vmess, server: server, port: 443, uuid: uuid, alterId: 32, cipher: auto, network: ws, ws-path: /path, tls: true }
|
||||
|
||||
# socks5
|
||||
- { name: "socks", type: socks5, server: server, port: 443 }
|
||||
# socks5 with authentication
|
||||
- { name: "socks", type: socks5, server: server, port: 443, username: "username", password: "password" }
|
||||
# with tls
|
||||
- { name: "socks", type: socks5, server: server, port: 443, tls: true }
|
||||
# with tls and skip-cert-verify
|
||||
- { name: "socks", type: socks5, server: server, port: 443, tls: true, skip-cert-verify: true }
|
||||
|
||||
# http
|
||||
- { name: "http", type: http, server: server, port: 443 }
|
||||
# http with authentication
|
||||
- { name: "http", type: http, server: server, port: 443, username: "username", password: "password" }
|
||||
# with tls (https)
|
||||
- { name: "http", type: http, server: server, port: 443, tls: true }
|
||||
# with tls (https) and skip-cert-verify
|
||||
- { name: "http", type: http, server: server, port: 443, tls: true, skip-cert-verify: true }
|
||||
|
||||
# Openclash 不会对下方策略组设置进行任何更改,请确保设置正确
|
||||
|
||||
Proxy Group: # 此参数必须保留,不能删除
|
||||
|
||||
# url-test select which proxy will be used by benchmarking speed to a URL.
|
||||
- { name: "auto", type: url-test, proxies: ["ss1", "ss2", "vmess1"], url: "http://www.gstatic.com/generate_204", interval: 300 }
|
||||
|
||||
# fallback select an available policy by priority. The availability is tested by accessing an URL, just like an auto url-test group.
|
||||
- { name: "fallback-auto", type: fallback, proxies: ["ss1", "ss2", "vmess1"], url: "http://www.gstatic.com/generate_204", interval: 300 }
|
||||
|
||||
# load-balance: The request of the same eTLD will be dial on the same proxy.
|
||||
- { name: "load-balance", type: load-balance, proxies: ["ss1", "ss2", "vmess1"], url: "http://www.gstatic.com/generate_204", interval: 300 }
|
||||
|
||||
# select is used for selecting proxy or proxy group
|
||||
# you can use RESTful API to switch proxy, is recommended for use in GUI.
|
||||
- { name: "Proxy", type: select, proxies: ["ss1", "ss2", "vmess1", "auto"] }
|
||||
|
||||
Rule: # 此参数必须保留,不能删除
|
||||
# 如果您将一直使用第三方规则,下方可以留空。
|
||||
- DOMAIN-SUFFIX,google.com,auto
|
||||
- DOMAIN-KEYWORD,google,auto
|
||||
- DOMAIN,google.com,auto
|
||||
- DOMAIN-SUFFIX,ad.com,REJECT
|
||||
- IP-CIDR,127.0.0.0/8,DIRECT
|
||||
# rename SOURCE-IP-CIDR and would remove after prerelease
|
||||
- SRC-IP-CIDR,192.168.1.201/32,DIRECT
|
||||
- GEOIP,CN,DIRECT
|
||||
- DST-PORT,80,DIRECT
|
||||
- SRC-PORT,7777,DIRECT
|
||||
# FINAL would remove after prerelease
|
||||
# you also can use `FINAL,Proxy` or `FINAL,,Proxy` now
|
||||
- MATCH,auto
|
||||
17
package/cnsztl/luci-app-openclash/files/etc/openclash/lhie1.yml → package/cnsztl/luci-app-openclash/files/etc/openclash/lhie1.yaml
Executable file → Normal file
@ -571,7 +571,6 @@ Rule:
|
||||
- DOMAIN-SUFFIX,rqd.qq.com,AdBlock
|
||||
- DOMAIN,btrace.qq.com,AdBlock
|
||||
- DOMAIN,mtrace.qq.com,AdBlock
|
||||
- DOMAIN,oth.eve.mdt.qq.com,AdBlock
|
||||
- DOMAIN,pingma.qq.com,AdBlock
|
||||
- DOMAIN,pingtcss.qq.com,AdBlock
|
||||
- DOMAIN,splashqqlive.gtimg.com,AdBlock
|
||||
@ -781,15 +780,15 @@ Rule:
|
||||
#USER-AGENT,AppleNews*,Proxy
|
||||
# > Apple
|
||||
- DOMAIN-SUFFIX,aaplimg.com,Apple
|
||||
- DOMAIN-SUFFIX,apple.co,Domestic
|
||||
- DOMAIN-SUFFIX,apple.com,Domestic
|
||||
- DOMAIN-SUFFIX,appstore.com,Domestic
|
||||
- DOMAIN-SUFFIX,apple.co,Apple
|
||||
- DOMAIN-SUFFIX,apple.com,Apple
|
||||
- DOMAIN-SUFFIX,appstore.com,Apple
|
||||
- DOMAIN-SUFFIX,cdn-apple.com,Apple
|
||||
- DOMAIN-SUFFIX,crashlytics.com,Domestic
|
||||
- DOMAIN-SUFFIX,icloud.com,Domestic
|
||||
- DOMAIN-SUFFIX,crashlytics.com,Apple
|
||||
- DOMAIN-SUFFIX,icloud.com,Apple
|
||||
- DOMAIN-SUFFIX,icloud-content.com,Apple
|
||||
- DOMAIN-SUFFIX,me.com,Domestic
|
||||
- DOMAIN-SUFFIX,mzstatic.com,Domestic
|
||||
- DOMAIN-SUFFIX,me.com,Apple
|
||||
- DOMAIN-SUFFIX,mzstatic.com,Apple
|
||||
# > Microsoft
|
||||
- DOMAIN-SUFFIX,microsoft.com,Domestic
|
||||
- DOMAIN-SUFFIX,windows.net,Domestic
|
||||
@ -895,8 +894,6 @@ Rule:
|
||||
# > ChinaNetCenter
|
||||
- DOMAIN-SUFFIX,chinanetcenter.com,Domestic
|
||||
- DOMAIN-SUFFIX,wangsu.com,Domestic
|
||||
# > CloudFlare
|
||||
- DOMAIN-SUFFIX,cloudflare.com,Domestic
|
||||
# > IP Query
|
||||
- DOMAIN-SUFFIX,ipip.net,Domestic
|
||||
- DOMAIN-SUFFIX,ip.cn,Domestic
|
||||
4
package/cnsztl/luci-app-openclash/files/etc/openclash/openclash_version
Executable file → Normal file
184
package/cnsztl/luci-app-openclash/files/usr/lib/lua/luci/controller/openclash.lua
Executable file → Normal file
@ -7,17 +7,19 @@ function index()
|
||||
|
||||
|
||||
entry({"admin", "services", "openclash"},alias("admin", "services", "openclash", "client"), _("OpenClash"), 50).dependent = true
|
||||
entry({"admin", "services", "openclash", "client"},cbi("openclash/client"),_("Clash Global State"), 20).leaf = true
|
||||
entry({"admin", "services", "openclash", "client"},form("openclash/client"),_("Overview"), 20).leaf = true
|
||||
entry({"admin", "services", "openclash", "status"},call("action_status")).leaf=true
|
||||
entry({"admin", "services", "openclash", "state"},call("action_state")).leaf=true
|
||||
entry({"admin", "services", "openclash", "startlog"},call("action_start")).leaf=true
|
||||
entry({"admin", "services", "openclash", "currentversion"},call("action_currentversion"))
|
||||
entry({"admin", "services", "openclash", "lastversion"},call("action_lastversion"))
|
||||
entry({"admin", "services", "openclash", "config"},cbi("openclash/config"),_("Server Config"), 30).leaf = true
|
||||
entry({"admin", "services", "openclash", "settings"},cbi("openclash/settings"),_("Clash Settings"), 40).leaf = true
|
||||
entry({"admin", "services", "openclash", "update"},cbi("openclash/update"),_("Update Setting"), 50).leaf = true
|
||||
entry({"admin", "services", "openclash", "rule"},cbi("openclash/rule"),_("Rules Setting"), 60).leaf = true
|
||||
entry({"admin", "services", "openclash", "log"},cbi("openclash/log"),_("Logs"), 70).leaf = true
|
||||
entry({"admin", "services", "openclash", "update"},call("action_update"))
|
||||
entry({"admin", "services", "openclash", "update_ma"},call("action_update_ma"))
|
||||
entry({"admin", "services", "openclash", "opupdate"},call("action_opupdate"))
|
||||
entry({"admin", "services", "openclash", "coreupdate"},call("action_coreupdate"))
|
||||
entry({"admin", "services", "openclash", "settings"},cbi("openclash/settings"),_("Takeover Settings"), 30).leaf = true
|
||||
entry({"admin", "services", "openclash", "config"},form("openclash/config"),_("Server Config"), 40).leaf = true
|
||||
entry({"admin", "services", "openclash", "log"},form("openclash/log"),_("Logs"), 50).leaf = true
|
||||
|
||||
|
||||
end
|
||||
@ -36,31 +38,90 @@ local function is_watchdog()
|
||||
end
|
||||
|
||||
local function config_check()
|
||||
return luci.sys.call("grep '^Proxy Group:$' /etc/openclash/config.yml 1>/dev/null && grep '^Rule:$' /etc/openclash/config.yml 1>/dev/null && grep '^- GEOIP' /etc/openclash/config.yml 1>/dev/null && grep ' nameserver:$' /etc/openclash/config.yml 1>/dev/null") == 0
|
||||
local yaml = luci.sys.call("ls -l /etc/openclash/config.yaml >/dev/null 2>&1")
|
||||
local yml = luci.sys.call("ls -l /etc/openclash/config.yml >/dev/null 2>&1")
|
||||
local nameserver,proxy,group,rule
|
||||
if (yaml == 0) then
|
||||
nameserver = luci.sys.call("egrep '^ {0,}nameserver:' /etc/openclash/config.yaml >/dev/null 2>&1")
|
||||
proxy = luci.sys.call("egrep '^ {0,}Proxy:' /etc/openclash/config.yaml >/dev/null 2>&1")
|
||||
group = luci.sys.call("egrep '^ {0,}Proxy Group:' /etc/openclash/config.yaml >/dev/null 2>&1")
|
||||
rule = luci.sys.call("egrep '^ {0,}Rule:' /etc/openclash/config.yaml >/dev/null 2>&1")
|
||||
else
|
||||
if (yml == 0) then
|
||||
nameserver = luci.sys.call("egrep '^ {0,}nameserver:' /etc/openclash/config.yml >/dev/null 2>&1")
|
||||
proxy = luci.sys.call("egrep '^ {0,}Proxy:' /etc/openclash/config.yml >/dev/null 2>&1")
|
||||
group = luci.sys.call("egrep '^ {0,}Proxy Group:' /etc/openclash/config.yml >/dev/null 2>&1")
|
||||
rule = luci.sys.call("egrep '^ {0,}Rule:' /etc/openclash/config.yml >/dev/null 2>&1")
|
||||
end
|
||||
end
|
||||
if (yaml == 0) or (yml == 0) then
|
||||
if (nameserver == 0) then
|
||||
nameserver = ""
|
||||
else
|
||||
nameserver = " - DNS服务器"
|
||||
end
|
||||
if (proxy == 0) then
|
||||
proxy = ""
|
||||
else
|
||||
proxy = " - 代理服务器"
|
||||
end
|
||||
if (group == 0) then
|
||||
group = ""
|
||||
else
|
||||
group = " - 策略组"
|
||||
end
|
||||
if (rule == 0) then
|
||||
rule = ""
|
||||
else
|
||||
rule = " - 规则"
|
||||
end
|
||||
return nameserver..proxy..group..rule
|
||||
elseif (yaml ~= 0) and (yml ~= 0) then
|
||||
return "1"
|
||||
end
|
||||
end
|
||||
|
||||
local function cn_port()
|
||||
return luci.sys.exec("uci get openclash.config.cn_port 2>/dev/null")
|
||||
end
|
||||
|
||||
local function mode()
|
||||
return luci.sys.exec("uci get openclash.config.en_mode 2>/dev/null")
|
||||
end
|
||||
|
||||
local function config()
|
||||
return luci.sys.exec("ls -l --full-time /etc/openclash/config.bak|awk '{print $6,$7;}' 2>/dev/null")
|
||||
local config_update = luci.sys.exec("ls -l --full-time /etc/openclash/config.bak 2>/dev/null |awk '{print $6,$7;}'")
|
||||
if (config_update ~= "") then
|
||||
return config_update
|
||||
else
|
||||
local yaml = luci.sys.call("ls -l /etc/openclash/config.yaml >/dev/null 2>&1")
|
||||
if (yaml == 0) then
|
||||
return "0"
|
||||
else
|
||||
local yml = luci.sys.call("ls -l /etc/openclash/config.yml >/dev/null 2>&1")
|
||||
if (yml == 0) then
|
||||
return "0"
|
||||
else
|
||||
return "1"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function ipdb()
|
||||
return luci.sys.exec("ls -l --full-time /etc/openclash/Country.mmdb|awk '{print $6,$7;}' 2>/dev/null")
|
||||
return luci.sys.exec("ls -l --full-time /etc/openclash/Country.mmdb 2>/dev/null |awk '{print $6,$7;}'")
|
||||
end
|
||||
|
||||
local function lhie1()
|
||||
return luci.sys.exec("ls -l --full-time /etc/openclash/lhie1.yml|awk '{print $6,$7;}' 2>/dev/null")
|
||||
return luci.sys.exec("ls -l --full-time /etc/openclash/lhie1.yaml 2>/dev/null |awk '{print $6,$7;}'")
|
||||
end
|
||||
|
||||
local function ConnersHua()
|
||||
return luci.sys.exec("ls -l --full-time /etc/openclash/ConnersHua.yml|awk '{print $6,$7;}' 2>/dev/null")
|
||||
return luci.sys.exec("ls -l --full-time /etc/openclash/ConnersHua.yaml 2>/dev/null |awk '{print $6,$7;}'")
|
||||
end
|
||||
|
||||
local function ConnersHua_return()
|
||||
return luci.sys.exec("ls -l --full-time /etc/openclash/ConnersHua_return.yml|awk '{print $6,$7;}' 2>/dev/null")
|
||||
return luci.sys.exec("ls -l --full-time /etc/openclash/ConnersHua_return.yaml 2>/dev/null |awk '{print $6,$7;}'")
|
||||
end
|
||||
|
||||
local function daip()
|
||||
@ -72,17 +133,73 @@ local function dase()
|
||||
end
|
||||
|
||||
local function check_lastversion()
|
||||
return luci.sys.exec("sh /usr/share/openclash/openclash_version.sh && sed -n '/^data:/,$p' /tmp/openclash_last_version 2>/dev/null")
|
||||
return luci.sys.exec("sh /usr/share/openclash/openclash_version.sh && sed -n '/^https:/,$p' /tmp/openclash_last_version 2>/dev/null")
|
||||
end
|
||||
|
||||
local function check_currentversion()
|
||||
return luci.sys.exec("sed -n '/^data:/,$p' /etc/openclash/openclash_version 2>/dev/null")
|
||||
return luci.sys.exec("sed -n '/^data:image/,$p' /etc/openclash/openclash_version 2>/dev/null")
|
||||
end
|
||||
|
||||
local function startlog()
|
||||
return luci.sys.exec("sed -n '$p' /tmp/openclash_start.log 2>/dev/null")
|
||||
end
|
||||
|
||||
local function coremodel()
|
||||
return luci.sys.exec("cat /proc/cpuinfo |grep 'cpu model' 2>/dev/null |awk -F ': ' '{print $2}' 2>/dev/null")
|
||||
end
|
||||
|
||||
local function coremodel2()
|
||||
return luci.sys.exec("opkg status libc 2>/dev/null |grep 'Architecture' |awk -F ': ' '{print $2}' 2>/dev/null")
|
||||
end
|
||||
|
||||
local function corecv()
|
||||
if not nixio.fs.access("/etc/openclash/clash") then
|
||||
return "0"
|
||||
else
|
||||
return luci.sys.exec("/etc/openclash/clash -v 2>/dev/null 2>/dev/null |awk -F ' ' '{print $2}'")
|
||||
end
|
||||
end
|
||||
|
||||
local function corelv()
|
||||
return luci.sys.exec("sh /usr/share/openclash/clash_version.sh && sed -n 1p /tmp/clash_last_version 2>/dev/null")
|
||||
end
|
||||
|
||||
local function opcv()
|
||||
return luci.sys.exec("sed -n 1p /etc/openclash/openclash_version 2>/dev/null")
|
||||
end
|
||||
|
||||
local function oplv()
|
||||
return luci.sys.exec("sh /usr/share/openclash/openclash_version.sh && sed -n 1p /tmp/openclash_last_version 2>/dev/null |sed 's/^v//g' 2>/dev/null")
|
||||
end
|
||||
|
||||
local function opup()
|
||||
return luci.sys.exec("uci set openclash.config.update=1 && uci commit openclash && rm -rf /tmp/openclash_last_version 2>/dev/null && sh /usr/share/openclash/openclash_version.sh && sh /usr/share/openclash/openclash_update.sh 2>/dev/null")
|
||||
end
|
||||
|
||||
local function coreup()
|
||||
return luci.sys.exec("uci set openclash.config.enable=1 && uci commit openclash && rm -rf /tmp/clash_last_version 2>/dev/null && sh /usr/share/openclash/clash_version.sh && sh /usr/share/openclash/openclash_core.sh 2>/dev/null")
|
||||
end
|
||||
|
||||
local function corever()
|
||||
return luci.sys.exec("uci get openclash.config.core_version 2>/dev/null")
|
||||
end
|
||||
|
||||
local function upchecktime()
|
||||
local corecheck = luci.sys.exec("ls -l --full-time /tmp/clash_last_version 2>/dev/null |awk '{print $6,$7;}'")
|
||||
local opcheck
|
||||
if not corecheck or corecheck == "" then
|
||||
opcheck = luci.sys.exec("ls -l --full-time /tmp/openclash_last_version 2>/dev/null |awk '{print $6,$7;}'")
|
||||
if not opcheck or opcheck == "" then
|
||||
return "1"
|
||||
else
|
||||
return opcheck
|
||||
end
|
||||
else
|
||||
return corecheck
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function action_status()
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({
|
||||
@ -91,7 +208,8 @@ function action_status()
|
||||
daip = daip(),
|
||||
dase = dase(),
|
||||
web = is_web(),
|
||||
cn_port = cn_port();
|
||||
cn_port = cn_port(),
|
||||
mode = mode();
|
||||
})
|
||||
end
|
||||
function action_state()
|
||||
@ -126,3 +244,39 @@ function action_start()
|
||||
startlog = startlog();
|
||||
})
|
||||
end
|
||||
|
||||
function action_update()
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({
|
||||
coremodel = coremodel(),
|
||||
coremodel2 = coremodel2(),
|
||||
corecv = corecv(),
|
||||
corelv = corelv(),
|
||||
opcv = opcv(),
|
||||
corever = corever(),
|
||||
upchecktime = upchecktime(),
|
||||
oplv = oplv();
|
||||
})
|
||||
end
|
||||
|
||||
function action_update_ma()
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({
|
||||
oplv = oplv(),
|
||||
corever = corever();
|
||||
})
|
||||
end
|
||||
|
||||
function action_opupdate()
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({
|
||||
opup = opup();
|
||||
})
|
||||
end
|
||||
|
||||
function action_coreupdate()
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({
|
||||
coreup = coreup();
|
||||
})
|
||||
end
|
||||
10
package/cnsztl/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/client.lua
Executable file → Normal file
@ -4,6 +4,7 @@ local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
|
||||
local t = {
|
||||
{enable, disable}
|
||||
@ -18,15 +19,18 @@ o = s:option(Button, "enable")
|
||||
o.inputtitle = translate("Enable Clash")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
os.execute("uci set openclash.config.enable=1 && uci commit openclash && /etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
end
|
||||
|
||||
o = s:option(Button, "disable")
|
||||
o.inputtitle = translate("Disable Clash")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
os.execute("uci set openclash.config.enable=0 && uci commit openclash && /etc/init.d/openclash stop >/dev/null 2>&1 &")
|
||||
uci:set("openclash", "config", "enable", 0)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash stop >/dev/null 2>&1 &")
|
||||
end
|
||||
|
||||
m = Map("openclash")
|
||||
|
||||
129
package/cnsztl/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/config.lua
Executable file → Normal file
@ -4,25 +4,23 @@ local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
|
||||
|
||||
local http = luci.http
|
||||
local fs = require "luci.openclash"
|
||||
local CHIF = "0"
|
||||
|
||||
ful = SimpleForm("upload", translate("Server Configuration"), nil)
|
||||
ful.reset = false
|
||||
ful.submit = false
|
||||
|
||||
sul =ful:section(SimpleSection, "", translate(""))
|
||||
sul =ful:section(SimpleSection, "")
|
||||
o = sul:option(FileUpload, "")
|
||||
o.title = translate("Upload Clash Configuration")
|
||||
o.template = "openclash/clash_upload"
|
||||
o.description = translate("NB: Rename your config file to config.yml before upload. file will save to /etc/openclash")
|
||||
o.template = "openclash/upload"
|
||||
um = sul:option(DummyValue, "", nil)
|
||||
um.template = "openclash/clash_dvalue"
|
||||
um.template = "openclash/dvalue"
|
||||
|
||||
local dir, fd
|
||||
local dir, fd, clash
|
||||
clash = "/etc/openclash/clash"
|
||||
dir = "/etc/openclash/"
|
||||
http.setfilehandler(
|
||||
HTTP.setfilehandler(
|
||||
function(meta, chunk, eof)
|
||||
if not fd then
|
||||
if not meta then return end
|
||||
@ -40,35 +38,120 @@ http.setfilehandler(
|
||||
if eof and fd then
|
||||
fd:close()
|
||||
fd = nil
|
||||
um.value = translate("File saved to") .. ' "/etc/openclash/' .. meta.file .. '"'
|
||||
SYS.exec("cp /etc/openclash/config.yml /etc/openclash/config.bak")
|
||||
if (meta.file == "config.yml") then
|
||||
SYS.call("cp /etc/openclash/config.yml /etc/openclash/config.bak")
|
||||
SYS.call("mv /etc/openclash/config.yml /etc/openclash/config.yaml")
|
||||
elseif (meta.file == "config.yaml") then
|
||||
SYS.call("cp /etc/openclash/config.yaml /etc/openclash/config.bak")
|
||||
end
|
||||
if (meta.file == "clash") then
|
||||
NXFS.chmod(clash, 755)
|
||||
end
|
||||
um.value = translate("File saved to") .. ' "/etc/openclash"'
|
||||
CHIF = "1"
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
if luci.http.formvalue("upload") then
|
||||
local f = luci.http.formvalue("ulfile")
|
||||
if HTTP.formvalue("upload") then
|
||||
local f = HTTP.formvalue("ulfile")
|
||||
if #f <= 0 then
|
||||
um.value = translate("No specify upload file.")
|
||||
end
|
||||
end
|
||||
|
||||
m = Map("openclash")
|
||||
s = m:section(TypedSection, "openclash")
|
||||
s.anonymous = true
|
||||
s.addremove=false
|
||||
m = SimpleForm("openclash")
|
||||
m.reset = false
|
||||
m.submit = false
|
||||
|
||||
local tab = {
|
||||
{user, default}
|
||||
}
|
||||
|
||||
local conf = "/etc/openclash/config.yml"
|
||||
sev = s:option(TextValue, "conf")
|
||||
sev.readonly=true
|
||||
sev.description = translate("Changes to config file must be made from source")
|
||||
s = m:section(Table, tab)
|
||||
|
||||
local conf = "/etc/openclash/config.yaml"
|
||||
local yconf = "/etc/openclash/config.yml"
|
||||
local dconf = "/etc/openclash/default.yaml"
|
||||
local bconf = "/etc/openclash/config.bak"
|
||||
|
||||
sev = s:option(Value, "user")
|
||||
sev.template = "cbi/tvalue"
|
||||
sev.description = translate("You Can Modify config file Here, Except The Settings That Were Taken Over")
|
||||
sev.rows = 20
|
||||
sev.wrap = "off"
|
||||
sev.cfgvalue = function(self, section)
|
||||
return NXFS.readfile(conf) or ""
|
||||
return NXFS.readfile(conf) or NXFS.readfile(yconf) or NXFS.readfile(bconf) or NXFS.readfile(dconf) or ""
|
||||
end
|
||||
sev.write = function(self, section, value)
|
||||
if (CHIF == "0") then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
NXFS.writefile("/etc/openclash/config.yaml", value)
|
||||
end
|
||||
end
|
||||
|
||||
def = s:option(Value, "default")
|
||||
def.template = "cbi/tvalue"
|
||||
def.description = translate("Default Config File With Correct General-Settings")
|
||||
def.rows = 20
|
||||
def.wrap = "off"
|
||||
def.readonly = true
|
||||
def.cfgvalue = function(self, section)
|
||||
return NXFS.readfile(dconf) or ""
|
||||
end
|
||||
def.write = function(self, section, value)
|
||||
end
|
||||
|
||||
|
||||
local t = {
|
||||
{Commit, Apply, Download}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Commit")
|
||||
o.inputtitle = translate("Commit Configurations")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
SYS.call("uci commit openclash")
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply")
|
||||
o.inputtitle = translate("Apply Configurations")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
SYS.call("uci set openclash.config.enable=1 && uci commit openclash && /etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Download")
|
||||
o.inputtitle = translate("Download Configurations")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function ()
|
||||
local sPath, sFile, fd, block
|
||||
sPath = "/etc/openclash/config.yaml"
|
||||
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
|
||||
|
||||
return ful , m
|
||||
|
||||
1
package/cnsztl/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/log.lua
Executable file → Normal file
@ -22,7 +22,6 @@ log.cfgvalue = function(self, section)
|
||||
return NXFS.readfile(clog) or ""
|
||||
end
|
||||
log.write = function(self, section, value)
|
||||
NXFS.writefile(clog, value:gsub("\r\n", "\n"))
|
||||
end
|
||||
|
||||
return m
|
||||
@ -1,123 +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"
|
||||
|
||||
m = Map("openclash", translate("Rules Setting"))
|
||||
s = m:section(TypedSection, "openclash")
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(ListValue, "enable_custom_clash_rules", translate("Custom Clash Rules"))
|
||||
o.description = translate("Use Custom Rules")
|
||||
o:value("0", translate("Disable Custom Clash Rules"))
|
||||
o:value("1", translate("Enable Custom Clash Rules"))
|
||||
o.default = 0
|
||||
|
||||
o = s:option(ListValue, "rule_source", translate("Enable Other Rules"))
|
||||
o.description = translate("Use Other Rules")
|
||||
o:value("0", translate("Disable Other Rules"))
|
||||
o:value("lhie1", translate("lhie1 Rules"))
|
||||
o:value("ConnersHua", translate("ConnersHua Rules"))
|
||||
o:value("ConnersHua_return", translate("ConnersHua Return Rules"))
|
||||
|
||||
os.execute("awk '/Proxy Group:/,/Rule:/{print}' /etc/openclash/config.yml |grep ^- |grep name: |sed 's/,.*//' |awk -F 'name: ' '{print $2}' |sed 's/\"//g' >/tmp/Proxy_Group 2>&1")
|
||||
os.execute("echo 'DIRECT' >>/tmp/Proxy_Group")
|
||||
os.execute("echo 'REJECT' >>/tmp/Proxy_Group")
|
||||
file = io.open("/tmp/Proxy_Group", "r");
|
||||
|
||||
o = s:option(ListValue, "GlobalTV", translate("GlobalTV"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:option(ListValue, "AsianTV", translate("AsianTV"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:option(ListValue, "Proxy", translate("Proxy"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
o:depends("rule_source", "ConnersHua_return")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:option(ListValue, "Apple", translate("Apple"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:option(ListValue, "AdBlock", translate("AdBlock"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:option(ListValue, "Domestic", translate("Domestic"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:option(ListValue, "Others", translate("Others"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
o:depends("rule_source", "ConnersHua_return")
|
||||
o.description = translate("Choose Proxy Group, Base On Your Servers Group in config.yml")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:close()
|
||||
|
||||
custom_rules = s:option(Value, "custom_rules", translate("Custom Clash Rules Here"), translate("For More Go Github:https://github.com/Dreamacro/clash"))
|
||||
custom_rules.template = "cbi/tvalue"
|
||||
custom_rules.rows = 20
|
||||
custom_rules.wrap = "off"
|
||||
custom_rules:depends("enable_custom_clash_rules", 1)
|
||||
|
||||
function custom_rules.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/config/openclash_custom_rules.list") or ""
|
||||
end
|
||||
function custom_rules.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n", "\n")
|
||||
NXFS.writefile("/etc/config/openclash_custom_rules.list", value)
|
||||
end
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Apply}
|
||||
}
|
||||
|
||||
a = SimpleForm("apply")
|
||||
a.reset = false
|
||||
a.submit = false
|
||||
s = a:section(Table, t)
|
||||
|
||||
o = s:option(Button, "Commit")
|
||||
o.inputtitle = translate("Commit Configurations")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
os.execute("uci commit openclash")
|
||||
end
|
||||
|
||||
o = s:option(Button, "Apply")
|
||||
o.inputtitle = translate("Apply Configurations")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
os.execute("uci commit openclash && /etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
return m , a
|
||||
418
package/cnsztl/luci-app-openclash/files/usr/lib/lua/luci/model/cbi/openclash/settings.lua
Executable file → Normal file
@ -4,70 +4,284 @@ local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
|
||||
local t = {
|
||||
{Commit, Apply}
|
||||
}
|
||||
|
||||
a = SimpleForm("apply")
|
||||
a.reset = false
|
||||
a.submit = false
|
||||
s = a:section(Table, t)
|
||||
|
||||
o = s:option(Button, "Commit")
|
||||
o.inputtitle = translate("Commit Configurations")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
os.execute("uci commit openclash")
|
||||
end
|
||||
|
||||
o = s:option(Button, "Apply")
|
||||
o.inputtitle = translate("Apply Configurations")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
os.execute("uci commit openclash && /etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
m = Map("openclash", translate("Clash Settings"))
|
||||
m = Map("openclash", translate("Takeover Settings"))
|
||||
m.pageaction = false
|
||||
|
||||
s = m:section(TypedSection, "openclash")
|
||||
s.title = translate("Will Modify The Config File Or Subscribe According To The Settings On This Page")
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(ListValue, "en_mode", translate("Select Mode"))
|
||||
o.description = translate("Will to Take Over Your General Settings, Network Error Try Flush DNS Cache")
|
||||
o:value("0", translate("Disable Mode Control"))
|
||||
s:tab("settings", translate("General Settings"))
|
||||
s:tab("rules", translate("Rules Setting"))
|
||||
s:tab("dashboard", translate("Dashboard Settings"))
|
||||
s:tab("config_update", translate("Config Update"))
|
||||
s:tab("rules_update", translate("Rules Update"))
|
||||
s:tab("geo_update", translate("GEOIP Update"))
|
||||
s:tab("version_update", translate("Version Update"))
|
||||
|
||||
---- General Settings
|
||||
o = s:taboption("settings", ListValue, "core_version", translate("Chose to Download"))
|
||||
o.description = translate("For Core Update, Wrong Version Will Not Work")
|
||||
o:value("linux-386")
|
||||
o:value("linux-amd64", translate("linux-amd64(x86-64)"))
|
||||
o:value("linux-armv5")
|
||||
o:value("linux-armv6")
|
||||
o:value("linux-armv7")
|
||||
o:value("linux-armv8")
|
||||
o:value("linux-mips-hardfloat")
|
||||
o:value("linux-mips-softfloat")
|
||||
o:value("linux-mips64")
|
||||
o:value("linux-mips64le")
|
||||
o:value("linux-mipsle")
|
||||
o:value("0", translate("Not Set"))
|
||||
o.default=0
|
||||
|
||||
o = s:taboption("settings", ListValue, "en_mode", translate("Select Mode"))
|
||||
o.description = translate("Select Mode For OpenClash Work, Network Error Try Flush DNS Cache")
|
||||
o:value("redir-host", translate("redir-host"))
|
||||
o:value("fake-ip", translate("fake-ip"))
|
||||
o.default = 0
|
||||
o.default = "redir-host"
|
||||
|
||||
o = s:option(ListValue, "enable_custom_dns", translate("Custom DNS Setting"))
|
||||
o = s:taboption("settings", ListValue, "enable_custom_dns", translate("Custom DNS Setting"))
|
||||
o.description = translate("Set OpenClash Upstream DNS Resolve Server")
|
||||
o:value("0", translate("Disable Custom DNS Setting"))
|
||||
o:value("1", translate("Enable Custom DNS Setting"))
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("1", translate("Enable"))
|
||||
o.default = 0
|
||||
|
||||
o = s:option(Value, "proxy_port")
|
||||
o.title = translate("Clash config redir-port")
|
||||
o = s:taboption("settings", ListValue, "ipv6_enable", translate("Enable ipv6 Resolve"))
|
||||
o.description = translate("Force Enable to Resolve ipv6 DNS Requests")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("1", translate("Enable"))
|
||||
o.default=0
|
||||
|
||||
o = s:taboption("settings", Value, "proxy_port")
|
||||
o.title = translate("Redir Port")
|
||||
o.default = 7892
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o.description = translate("Clash Redir Port, Please Make Sure Ports Available")
|
||||
o.description = translate("Please Make Sure Ports Available")
|
||||
|
||||
o = s:option(Value, "cn_port")
|
||||
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")
|
||||
|
||||
---- Rules Settings
|
||||
o = s:taboption("rules", ListValue, "enable_custom_clash_rules", translate("Custom Clash Rules"))
|
||||
o.description = translate("Use Custom Rules")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("1", translate("Enable"))
|
||||
o.default = 0
|
||||
|
||||
o = s:taboption("rules", ListValue, "rule_source", translate("Enable Other Rules"))
|
||||
o.description = translate("Use Other Rules")
|
||||
o:value("0", translate("Disable Other Rules"))
|
||||
o:value("lhie1", translate("lhie1 Rules"))
|
||||
o:value("ConnersHua", translate("ConnersHua Rules"))
|
||||
o:value("ConnersHua_return", translate("ConnersHua Return Rules"))
|
||||
|
||||
SYS.call("awk '/Proxy Group:/,/Rule:/{print}' /etc/openclash/config.yaml 2>/dev/null |egrep '^ {0,}-' |grep name: |sed 's/,.*//' |awk -F 'name: ' '{print $2}' |sed 's/\"//g' >/tmp/Proxy_Group 2>&1")
|
||||
SYS.call("echo 'DIRECT' >>/tmp/Proxy_Group")
|
||||
SYS.call("echo 'REJECT' >>/tmp/Proxy_Group")
|
||||
file = io.open("/tmp/Proxy_Group", "r");
|
||||
|
||||
o = s:taboption("rules", ListValue, "GlobalTV", translate("GlobalTV"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:taboption("rules", ListValue, "AsianTV", translate("AsianTV"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:taboption("rules", ListValue, "Proxy", translate("Proxy"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
o:depends("rule_source", "ConnersHua_return")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:taboption("rules", ListValue, "Apple", translate("Apple"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:taboption("rules", ListValue, "AdBlock", translate("AdBlock"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:taboption("rules", ListValue, "Domestic", translate("Domestic"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:seek("set")
|
||||
o = s:taboption("rules", ListValue, "Others", translate("Others"))
|
||||
o:depends("rule_source", "lhie1")
|
||||
o:depends("rule_source", "ConnersHua")
|
||||
o:depends("rule_source", "ConnersHua_return")
|
||||
o.description = translate("Choose Proxy Group, Base On Your Servers Group in config.yaml")
|
||||
for l in file:lines() do
|
||||
o:value(l)
|
||||
end
|
||||
file:close()
|
||||
|
||||
---- update Settings
|
||||
o = s:taboption("config_update", ListValue, "auto_update", translate("Auto Update"))
|
||||
o.description = translate("Auto Update Server subscription")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("1", translate("Enable"))
|
||||
o.default=0
|
||||
|
||||
o = s:taboption("config_update", ListValue, "config_update_week_time", translate("Update Time (Every Week)"))
|
||||
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("7", translate("Every Sunday"))
|
||||
o.default=1
|
||||
|
||||
o = s:taboption("config_update", ListValue, "auto_update_time", translate("Update time (every day)"))
|
||||
for t = 0,23 do
|
||||
o:value(t, t..":00")
|
||||
end
|
||||
o.default=0
|
||||
o.rmempty = false
|
||||
|
||||
o = s:taboption("config_update", ListValue, "config_update_url_type", translate("Update Url Type"))
|
||||
o:value("clash", translate("Clash"))
|
||||
o:value("v2ray", translate("V2ray"))
|
||||
o:value("surge", translate("Surge"))
|
||||
o.description = translate("Power By fndroid,Use Other Rules If V2ray Subcription")
|
||||
o.default="clash"
|
||||
|
||||
o = s:taboption("config_update", Value, "subscribe_url")
|
||||
o.title = translate("Subcription Url")
|
||||
o.description = translate("Server Subscription Address")
|
||||
o.rmempty = true
|
||||
|
||||
o = s:taboption("config_update", Button, translate("Config File Update"))
|
||||
o.title = translate("Update Subcription")
|
||||
o.inputtitle = translate("Check And Update")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("sh /usr/share/openclash/openclash.sh >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
o = s:taboption("rules_update", ListValue, "other_rule_auto_update", translate("Auto Update"))
|
||||
o.description = translate("Auto Update Other Rules")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("1", translate("Enable"))
|
||||
o.default=0
|
||||
|
||||
o = s:taboption("rules_update", ListValue, "other_rule_update_week_time", translate("Update Time (Every Week)"))
|
||||
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("7", translate("Every Sunday"))
|
||||
o.default=1
|
||||
|
||||
o = s:taboption("rules_update", ListValue, "other_rule_update_day_time", translate("Update time (every day)"))
|
||||
for t = 0,23 do
|
||||
o:value(t, t..":00")
|
||||
end
|
||||
o.default=0
|
||||
|
||||
o = s:taboption("rules_update", Button, translate("Other Rules Update"))
|
||||
o.title = translate("Update Other Rules")
|
||||
o.inputtitle = translate("Check And Update")
|
||||
o.description = translate("Other Rules Update(Only in Use)")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("sh /usr/share/openclash/openclash_rule.sh >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
o = s:taboption("geo_update", ListValue, "geo_auto_update", translate("Auto Update"))
|
||||
o.description = translate("Auto Update GEOIP Database")
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("1", translate("Enable"))
|
||||
o.default=0
|
||||
|
||||
o = s:taboption("geo_update", ListValue, "geo_update_week_time", translate("Update Time (Every Week)"))
|
||||
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("7", translate("Every Sunday"))
|
||||
o.default=1
|
||||
|
||||
o = s:taboption("geo_update", ListValue, "geo_update_day_time", translate("Update time (every day)"))
|
||||
for t = 0,23 do
|
||||
o:value(t, t..":00")
|
||||
end
|
||||
o.default=0
|
||||
|
||||
o = s:taboption("geo_update", Button, translate("GEOIP Update"))
|
||||
o.title = translate("Update GEOIP Database")
|
||||
o.inputtitle = translate("Check And Update")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("sh /usr/share/openclash/openclash_ipdb.sh >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
---- Dashboard Settings
|
||||
o = s:taboption("dashboard", Value, "cn_port")
|
||||
o.title = translate("Dashboard Port")
|
||||
o.default = 9090
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o.description = translate("Dashboard hostname is Your Router IP. Dashboard:192.168.1.1/openclash")
|
||||
o.description = translate("Dashboard Address Example: 192.168.1.1/openclash、192.168.1.1:9090/ui")
|
||||
|
||||
o = s:option(Value, "dashboard_password")
|
||||
o = s:taboption("dashboard", Value, "dashboard_password")
|
||||
o.title = translate("Dashboard Secret")
|
||||
o.default = 123456
|
||||
o.rmempty = false
|
||||
o.rmempty = true
|
||||
o.description = translate("Set Dashboard Secret")
|
||||
|
||||
---- version update
|
||||
core_update = s:taboption("version_update", DummyValue, "", nil)
|
||||
core_update.template = "openclash/update"
|
||||
|
||||
-- [[ Edit Server ]] --
|
||||
s = m:section(TypedSection, "dns_servers", translate("Add Custom DNS Servers"))
|
||||
s.anonymous = true
|
||||
@ -76,32 +290,132 @@ s.sortable = false
|
||||
s.template = "cbi/tblsection"
|
||||
s.rmempty = false
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"), translate("(Enable or Disable)"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- group
|
||||
o = s:option(ListValue, "group", translate("DNS Server Group"))
|
||||
o:value("nameserver", translate("Nameserver"))
|
||||
o:value("fallback", translate("Fallback"))
|
||||
o.default = "udp"
|
||||
o.description = translate("(NameServer Group Must Be Set)")
|
||||
o:value("nameserver", translate("NameServer"))
|
||||
o:value("fallback", translate("FallBack"))
|
||||
o.default = "nameserver"
|
||||
o.rempty = false
|
||||
|
||||
---- IP address
|
||||
o = s:option(Value, "ip", translate("DNS Server IP"))
|
||||
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 = false
|
||||
o.rmempty = true
|
||||
|
||||
---- port
|
||||
o = s:option(Value, "port", translate("DNS Server Port"))
|
||||
o.placeholder = "53"
|
||||
o.description = translate("(Require When Use Non-Standard Port)")
|
||||
o.datatype = "port"
|
||||
o.rempty = false
|
||||
o.rempty = true
|
||||
|
||||
---- type
|
||||
o = s:option(ListValue, "type", translate("DNS Server Type"))
|
||||
o:value("udp", translate("udp"))
|
||||
o:value("tcp", translate("tcp"))
|
||||
o:value("tls", translate("tls"))
|
||||
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.default = "udp"
|
||||
o.rempty = false
|
||||
|
||||
return m, a
|
||||
-- [[ 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
|
||||
|
||||
s = m:section(TypedSection, "openclash", translate("Set Custom Rules, Will Add When Flag Turn on"))
|
||||
s.anonymous = true
|
||||
|
||||
custom_rules = s:option(Value, "custom_rules")
|
||||
custom_rules.template = "cbi/tvalue"
|
||||
custom_rules.description = translate("Custom Rules Here, For More Go Github:https://github.com/Dreamacro/clash/blob/master/README.md")
|
||||
custom_rules.rows = 20
|
||||
custom_rules.wrap = "off"
|
||||
|
||||
function custom_rules.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/config/openclash_custom_rules.list") or ""
|
||||
end
|
||||
function custom_rules.write(self, section, value)
|
||||
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
NXFS.writefile("/etc/config/openclash_custom_rules.list", value)
|
||||
end
|
||||
end
|
||||
|
||||
s = m:section(TypedSection, "openclash", translate("Set Custom Hosts, Only Work with Redir-Host Mode"))
|
||||
s.anonymous = true
|
||||
|
||||
custom_hosts = s:option(Value, "custom_hosts")
|
||||
custom_hosts.template = "cbi/tvalue"
|
||||
custom_hosts.description = translate("Custom Hosts Here, For More Go Github:https://github.com/Dreamacro/clash/blob/master/README.md")
|
||||
custom_hosts.rows = 20
|
||||
custom_hosts.wrap = "off"
|
||||
|
||||
function custom_hosts.cfgvalue(self, section)
|
||||
return NXFS.readfile("/etc/config/openclash_custom_hosts.list") or ""
|
||||
end
|
||||
function custom_hosts.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
NXFS.writefile("/etc/config/openclash_custom_hosts.list", value)
|
||||
end
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Commit")
|
||||
o.inputtitle = translate("Commit Configurations")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
uci:commit("openclash")
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply")
|
||||
o.inputtitle = translate("Apply Configurations")
|
||||
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 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
return m
|
||||
|
||||
|
||||
|
||||
@ -1,97 +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"
|
||||
|
||||
m = Map("openclash", translate("Update Setting"))
|
||||
s = m:section(TypedSection, "openclash", translate("Subscription Update"))
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "auto_update", translate("Auto Update"))
|
||||
o.description = translate("Auto Update Server subscription")
|
||||
o.default=0
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "auto_update_time", translate("Update time (every day)"))
|
||||
for t = 0,23 do
|
||||
o:value(t, t..":00")
|
||||
end
|
||||
o.default=0
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "subscribe_url")
|
||||
o.title = translate("Subcription Url")
|
||||
o.description = translate("Server Subscription Address")
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(Button,translate("Config File Update"))
|
||||
o.title = translate("Update Subcription")
|
||||
o.inputtitle = translate("Update Configuration")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
SYS.call("uci commit openclash && sh /usr/share/openclash/openclash.sh >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
f = m:section(TypedSection, "openclash", translate("Other Rules Update(Only in Use)"))
|
||||
f.anonymous = true
|
||||
o = f:option(Flag, "other_rule_auto_update", translate("Auto Update"))
|
||||
o.description = translate("Auto Update Other Rules")
|
||||
o.default=0
|
||||
o.rmempty = false
|
||||
|
||||
o = f:option(ListValue, "other_rule_update_week_time", translate("Update Time (Every Week)"))
|
||||
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("7", translate("Every Sunday"))
|
||||
o.default=1
|
||||
|
||||
o = f:option(ListValue, "other_rule_update_day_time", translate("Update time (every day)"))
|
||||
for t = 0,23 do
|
||||
o:value(t, t..":00")
|
||||
end
|
||||
o.default=0
|
||||
|
||||
o = f:option(Button,translate("Other Rules Update"))
|
||||
o.title = translate("Update Other Rules")
|
||||
o.inputtitle = translate("Start Update Other Rules")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
SYS.call("uci commit openclash && sh /usr/share/openclash/openclash_rule.sh >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
u = m:section(TypedSection, "openclash", translate("GEOIP(By MaxMind) Update"))
|
||||
u.anonymous = true
|
||||
o = u:option(Button,translate("GEOIP Database Update"))
|
||||
o.title = translate("Update GEOIP Database")
|
||||
o.inputtitle = translate("Start Update GEOIP Database")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
SYS.call("sh /usr/share/openclash/openclash_ipdb.sh >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit}
|
||||
}
|
||||
|
||||
a = SimpleForm("apply")
|
||||
a.reset = false
|
||||
a.submit = false
|
||||
s = a:section(Table, t)
|
||||
|
||||
o = s:option(Button, "Commit")
|
||||
o.inputtitle = translate("Commit Configurations")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
os.execute("uci commit openclash")
|
||||
end
|
||||
|
||||
return m , a
|
||||
@ -0,0 +1,40 @@
|
||||
--[[
|
||||
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 fs = require "nixio.fs"
|
||||
|
||||
local type = type
|
||||
|
||||
--- LuCI filesystem library.
|
||||
module "luci.openclash"
|
||||
|
||||
--- 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
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<span style="color: green">
|
||||
<%
|
||||
local val = self:cfgvalue(section) or self.default or ""
|
||||
write(pcdata(val))
|
||||
%>
|
||||
</span>
|
||||
<%+cbi/valuefooter%>
|
||||
@ -1,5 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<label class="cbi-value" style="display:inline-block;" for="ulfile"></label>
|
||||
<input class="cbi-input-file" style="width: 400px" type="file" id="ulfile" name="ulfile" />
|
||||
<input type="submit" class="cbi-button cbi-input-reload" name="upload" value="<%:Upload%>" />
|
||||
<%+cbi/valuefooter%>
|
||||
27
package/cnsztl/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/developer.htm
Executable file → Normal file
@ -1,8 +1,8 @@
|
||||
<fieldset class="cbi-section">
|
||||
<table>
|
||||
<tr><td width="25%"> Clash 主程序发布: </td><td width="25%" align="left" id="_binupdate"><%:Collecting data...%></td><td width="25%"> OpenClash 客户端发布: </td><td width="25%" align="left" id="_openupdate"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> Clash 主程序开发: Dreamacro </td><td width="25%" align="left" id="_Dreamacro"><%:Collecting data...%></td><td width="25%"> OpenClash 客户端开发: vernesong </td><td width="25%" align="left" id="_vernesong"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> Clash 客户端开发: frainzy1477 </td><td width="25%" align="left" id="_frainzy1477"><%:Collecting data...%></td><td width="25%"> MyIP: SukkaW </td><td width="25%" align="left" id="_SukkaW"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> Clash 核心发布: </td><td width="25%" align="left" id="_binupdate"><%:Collecting data...%></td><td width="25%"> OpenClash 客户端发布: </td><td width="25%" align="left" id="_openupdate"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> Clash 核心开发: Dreamacro </td><td width="25%" align="left" id="_Dreamacro"><%:Collecting data...%></td><td width="25%"> OpenClash 客户端开发: vernesong </td><td width="25%" align="left" id="_vernesong"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> Luci For Clash: frainzy1477 </td><td width="25%" align="left" id="_frainzy1477"><%:Collecting data...%></td><td width="25%"> MyIP: SukkaW </td><td width="25%" align="left" id="_SukkaW"><%:Collecting data...%></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
@ -13,14 +13,13 @@
|
||||
var SukkaW = document.getElementById('_SukkaW');
|
||||
var binupdate = document.getElementById('_binupdate');
|
||||
var openupdate = document.getElementById('_openupdate');
|
||||
var github = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAMAAACKeiw+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpGRjUyRDgzQjhBRDcxMUU5ODM5RkRFNTEzOTgzREM4RiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpGRjUyRDgzQzhBRDcxMUU5ODM5RkRFNTEzOTgzREM4RiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkZGNTJEODM5OEFENzExRTk4MzlGREU1MTM5ODNEQzhGIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkZGNTJEODNBOEFENzExRTk4MzlGREU1MTM5ODNEQzhGIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+F8FkZAAAAddQTFRF////AAAAAQEBAgICcnJyAwMDVVBLZmZma2trFxcXDQ0NCwsLjY2NuLi4UFBQurq6e3t7NjY2PDw8m5ubSEhISkpKMDAw7OTe/vv5cXFxqKiovLy819fX1MvEtbW1hX56UEtG5t/YhX54/f39WVlZmpqaLyso4drU1s7HXFxcVVFNf39/WVJM0dLSoKCgk5OTfHx8ysrKLi4uvb29RkZG6+vrp52Vr6+v1MzGpZuU5d7Z8uvkvrSr8Orkw8PD1cvCWFNNqaKdx720PDczxLqxw7qzQUFBV1dXQDs3qZ+W8fHx0Ma9t62ksbGxubq7IiIhCAgInp6eDg4O5t7Xsami7u7u/fv5oaGhcHBwISIjbGxsJiYnqamp0snA/Pz8o6Oj8PDw1tbWwbivz8/PBwcHUE1L//38g3pzOzs7wcHBSEVFZWVlq6ur29LLn5+fpJuSfHZyIB8f5OTkyMjIYGBgJCIfPj4+ubCoMCwpPDg0FBQUtKqhQEBATEpH6ubi4tnRDg8Qs7Oz1s3F8uvm6enpHhsZvrSsVFBMioN8JiYmsaql+vby/fr3IiIiKioqZ2Bb9/PvhH13HhwaVlRR6eDZPz8/MzMzDQ0OEQ8OOzg0kImCnZSL////7wd0TgAAAJ10Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AMv8vEwAAAF8SURBVHjabNNlY4MwEAbgO2jn1rm7u7u7u7u7u7u7a3/scmSsDHYfmuR9gKbNAcbf2r30e+rqGJkvyDRlIE98yvG31ktUfFSEf+qxScmDqKkME6fiPzUmczZbiIKSBJF9fHF+ZlO9V42rgAIrdp1w0TdkycI84tENNisFAN8X3fRSwkHUeCxb2LHw/YpxIT0tAlTlQGkFY3+aJKp5m9KTawiQ9rKq5jIpDodmGkRvNbdsUn4ODzS4gKY6KT+DSRo8tBxHf8QCvBE7aLmB2Ar2iS20bMN5h9hZyxaU10EgDY0pag26oTwS1qQfGK9mJ+mIPsFNYrH7r06IUjwDxmjE9lcUlo9NWKnjutIKxh7EWTBHHDaY95P16gzWP8deTeedj2gDjmyVzO+dkpsi1J04i331IthZ3uZyTpMbZ483UxVisGJbST+6JbdiMaKjk23IAGd7rnOmRj6ktd5TyafK1+DejLVnG2dbhh85qpco7M66lnNMvVm6nH4LMAB50ohVhJZ1iwAAAABJRU5ErkJggg=="
|
||||
var release = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAeCAMAAAAfOR5kAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpDNTk0NDQzNThBRDgxMUU5OTgwMkVGQkFDRDdENTg1MyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpDNTk0NDQzNjhBRDgxMUU5OTgwMkVGQkFDRDdENTg1MyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkM1OTQ0NDMzOEFEODExRTk5ODAyRUZCQUNEN0Q1ODUzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkM1OTQ0NDM0OEFEODExRTk5ODAyRUZCQUNEN0Q1ODUzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+JpJc6gAAAPZQTFRFAAAA////+Pj4/v7+/f39+/v7AQEB39/f/Pz88vLyKysr3d3dCgoKpqam6urq4eHh7e3t4+Pj5eXlycnJ9PT09fX1BQUF9/f3AgICy8vLDg4OYmJi2NjY2tra8PDwz8/PNDQ0Pz8/v7+/ra2tu7u7wcHBQkJCjo6Om5ubXFxcXV1dDAwMCQkJLS0trKyszMzMIyMjRUVF0tLSxMTEeXl5ZWVlJiYm+vr61NTUjY2NyMjIXl5ekZGR6OjoV1dXoqKiLi4uRkZGT09P7OzsdnZ2fn5+xsbGsbGx1tbW5+fnFhYW3t7e8fHxY2NjkJCQJSUlERER////3OeyVgAAAFJ0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////AK0tDHEAAAD0SURBVHjajNHXUsMwEAXQKxfshFSSEDoEEnrvvYeS0O7//wyWZEaOpQf2YUd7ZrRaSWBwtesxE+3ybEywAGDdC57mL1/mKmHrKym9hN8g40dlbKv8kfAhrKgk3LR0zE975/iGEEt2k5KPRTjiFRsuXkXRxfu4d/E3nl18i7qLp8ETWzsCDAYWy6fi2cEo7rQomeJuxuDkdUDNZNzY1Pi4HCpA+icLmt/T8o8nNI//jwtTimuGw71qdXhUUmN0o6je8BSLsvoSmdSWCz9t0sveZsX0joyeZ49snmrcqo1OEj9ILbZzA1L0gU+feSbXjs36V4ABANF7Sn61vZbYAAAAAElFTkSuQmCC"
|
||||
Dreamacro.innerHTML = '<img src="'+github+'" alt="Dreamacro" width="30" onclick="return Dreamacro_rediret()">';
|
||||
vernesong.innerHTML = '<img src="'+github+'" alt="vernesong" width="30" onclick="return vernesong_rediret()">';
|
||||
frainzy1477.innerHTML = '<img src="'+github+'" alt="frainzy1477" width="30" onclick="return frainzy1477_rediret()">';
|
||||
SukkaW.innerHTML = '<img src="'+github+'" alt="SukkaW" width="30" onclick="return SukkaW_rediret()">';
|
||||
binupdate.innerHTML = '<img src="'+release+'" alt="binupdate" width="30" height="30" onclick="return binupdate_rediret()">';
|
||||
openupdate.innerHTML = '<img src="'+release+'" alt="openupdate" width="30" height="30" onclick="return openupdate_rediret()">';
|
||||
var github = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABiCAMAAACRZYZ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3FpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo1Y2NjZGI4My1kMGJiLWExNDUtYmYyNy03ZmRkMTJmY2EwYTQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RENEOUYxRjE5RjJDMTFFOUEwNjVGMTc0MUI4MUNFQzgiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RENEOUYxRjA5RjJDMTFFOUEwNjVGMTc0MUI4MUNFQzgiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjVjY2NkYjgzLWQwYmItYTE0NS1iZjI3LTdmZGQxMmZjYTBhNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo1Y2NjZGI4My1kMGJiLWExNDUtYmYyNy03ZmRkMTJmY2EwYTQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4s6CIvAAACdlBMVEX+/v78/PzExMT9/f35+fn19fX4+Pj6+vrX19fy8vL7+/sICAjr6+vq6urd3d3x8fFDQ0Obm5vw8PDc3Nz29vYoKCi5ubnn5+cPDw/h4eHY2NiOjo6Dg4NLS0vs7OxFRUXv7+/t7e3u7u4vLy8JCQkQEBANDQ0DAwMGBgYEBARpaWnBwcGvr6/39/fQ0NDNzc3IyMh8fHy7u7uEhISjo6MrKytgYGCGhoZ6enqZmZnS0tI0NDShoaGxsbFlZWUgICAWFhYlJSVMTEwsLCwKCgo6OjqUlJQcHBwaGhr09PQpKSldXV2fn5+4uLiQkJACAgLo6Ojp6elGRkba2tqWlpYBAQHZ2dmnp6fFxcWSkpKurq5KSkqysrI9PT0FBQWYmJhnZ2e9vb1zc3NERETz8/N4eHh+fn5mZmbHx8eIiIiKioq1tbVhYWGoqKhXV1cTExMeHh6srKxqamqLi4ukpKTb29sqKirCwsKmpqbOzs5aWlo8PDyMjIzV1dWdnZ2zs7OFhYXl5eUXFxd0dHQHBweenp7W1tZ9fX0iIiLg4OAtLS2NjY3AwMCgoKCJiYmwsLCPj4/U1NRWVlYRERFPT0+Hh4dsbGxvb2/Pz8/Dw8MdHR0uLi5NTU2+vr4fHx/R0dE5OTm/v7+ioqJQUFDGxsbJyckUFBTKyso2NjZRUVEZGRmtra3i4uImJiZSUlLe3t6CgoJUVFRtbW3Ly8sYGBjMzMwwMDDT09NJSUkkJCRISEi2trZkZGRBQUEMDAy6uro/Pz9/f39ra2sODg4nJycSEhJ7e3s7OzsVFRVycnIyMjJcXFxbW1t2dnYbGxv///8AAAD///9H5/bkAAAA0nRSTlP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wD8iKrvAAAFUElEQVR42qya90PbOBTHZRKTQQgBMgoByipll00H0E1bRhfr2l6v+7r3uLbXvXvd19t777333svqf3SpTRzbT4ptyd/fkJ7ex9iK9PSe0B2L8lxeVx//qKO4PdJ3qHhXbXzlloOi1bHIilFJxs2X92CgT1adimY7Awnc2JyFqare0RbjhbhfWVuDTTT54RaRAyKunI0taVZbOSNk44k/sGVV7y9jgKDBSdiW7tsp2IWMhrBtffaxLYjnCmbS1LB1yOm5mFFnCq1C7sUcyrUEQfdjLvX4zSHuVZhTh3LMIA2/YG5VlaWHlE/ATuhyOognCzujHDpE+NIhBv6ugQaR5mPHdMZFgWzCDupNMmQQO6pcEiSgt/nzrM2XF9r0r74hCCFot87iSUmS3Ld2WSXU3nInBjTpG/0AslVvIEiyShdbQUxbpFgL+uYdRshSff8bUlKebjPEmEc1Xq7vmW6ALNB3D0gpuZuVtpn/nHq7zhsMBt8vzOgu6uhTWvtFjWm9YU9GOsjXhqfLl7QqmPve4OkGJOmVGVvXE5mua1pmcNOrhbiMcY9PYlKm8VW6NZBc0MkG8Rv9XExBwAPgTDaIABz5VMhh7NB/AiEfJCGuSvgADn0T5avchUyBXV42yFLoqXscMgd2tbJB2qCnhxSISPoZCywMRPKULUNIYVYNG2QhwdViGfIgocfP9rpcBFcLpATER+gYkhgVIDiLJSCvw+ZnJGath962JyDXsVO/d8oLW5uAwE9yVuLQMeBuD0JhGM8FeCBhwiRG+aBtgsQleJadgurgcYkPcgI4vIHGIJgPEgQOr6Mf4Svkg5QCh/3oqFPLPH25D6HVoC3MBxEmGx0+jS45tSuqEPCb+A/NchriP2d0uBvB89siTsgSo8OfURU8ijn94avQJKencA5cQgib2Tt8kGyYDUMR0HaVD3IcOJyJJoK2Ij7INeBwBtoH2tr5IMXAYTEiHKU8PAzXCPD3GDoJIYU8EEIQuQYdgY0dPBBCIiuKYk6Fj/TIy4tchKivix1yDyHNKqI7RwlsxAyphs7mJ0KilwiQ86yMBwjOWhOQUVIozrgS+0m+mhIQoYrQsYTthf1KchW+G9VvJuF/YKCgOSRPG+Sjw6fEZMYM2/NYWE10FJUhrnnknEmJPUYJJX+ZqZwZt9KSPzYWMc80WpJq/GCqyYh89XeF1qLF4onL0zJCyyHlJ5MF6p6yLDFA1KV6egOmMwAFhul5qtlqRuLzZNP38ihxg9bsdq83jzoJBN+Fm2mLOXUqRFJLGQPKczcbTOctf6QREi5MDFWaJNwSp1I1S5Q6pLxWKo//0Gid5SKsuOYFqVe1STXNTi9T0IiVsNJlxuiTtJA8TY/8zIYD2EXyJxkwgRToc5CtqZ5v5fH9OusyMkRMz/jGkOjUxsTKHv+XtihKm8dPpS2luox54QLNR1amf48mPKNN4X3pIEdgGn0byHYNfaH8+fuBBhokNw3jcUKuXmpXuyvU4Lnx6vFYuvxElM54SyJVHdwpgzyr62IGHeIj109Sn+USR3BiSKGDclMqcfAT73+yl14425naGEUuyLF0JcB4yu5aHjvkt/TFzBXaROj6w1u83iHvs80v2oN0mpVlD5BGFdmCPGpeYI7aiShJkJNWSuWF52ClzQbkCWv1+DwQpK2xDAmVWL6+0GUYOmwVEkc2LmIE9SWwFdYgFQft3fZAe7UxwhVLkHrB9uWYnHiN+RTWnEc6y5iu+WwcTkbJtTTI9nGDyv0FzBeWysdekH2M0iBKor+iq5zr6hVq7Iw8t42+eDW9G5n6vGDi5H8BBgCTacDsFxo/3wAAAABJRU5ErkJggg=="
|
||||
Dreamacro.innerHTML = '<img src="https://avatars3.githubusercontent.com/u/8615343?s=460&v=4" alt="Dreamacro" width="30" onerror="return imgerrorfun()" onclick="return Dreamacro_rediret()" />';
|
||||
vernesong.innerHTML = '<img src="https://avatars2.githubusercontent.com/u/42875168?s=460&v=4" alt="vernesong" width="30" onerror="return imgerrorfun()" onclick="return vernesong_rediret()" />';
|
||||
frainzy1477.innerHTML = '<img src="https://avatars2.githubusercontent.com/u/49537471?s=460&v=4" alt="frainzy1477" width="30" onerror="return imgerrorfun()" onclick="return frainzy1477_rediret()" />';
|
||||
SukkaW.innerHTML = '<img src="https://avatars0.githubusercontent.com/u/40715044?s=460&v=4" alt="SukkaW" width="30" onerror="return imgerrorfun()" onclick="return SukkaW_rediret()" />';
|
||||
binupdate.innerHTML = '<img src="'+github+'" alt="binupdate" width="30" height="30" onclick="return binupdate_rediret()" />';
|
||||
openupdate.innerHTML = '<img src="'+github+'" alt="openupdate" width="30" height="30" onclick="return openupdate_rediret()" />';
|
||||
|
||||
function Dreamacro_rediret()
|
||||
{
|
||||
@ -52,5 +51,11 @@
|
||||
url6='https://github.com/vernesong/OpenClash/releases';
|
||||
window.open(url6);
|
||||
}
|
||||
|
||||
function imgerrorfun(){
|
||||
var img=event.srcElement;
|
||||
img.src=github;
|
||||
img.onerror=null;
|
||||
}
|
||||
|
||||
//]]></script>
|
||||
@ -0,0 +1,13 @@
|
||||
<%+cbi/valueheader%>
|
||||
<div style="text-align: center; margin:0 auto; display: block; width: 100%; text-overflow: ellipsis;">
|
||||
<div>
|
||||
<%:Rename your config file to config.yaml before upload what would be save to /etc/openclash%>
|
||||
</div>
|
||||
<div style="color: green; transform:translateY(80%);">
|
||||
<%
|
||||
local val = self:cfgvalue(section) or self.default or ""
|
||||
write(pcdata(val))
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
<%+cbi/valuefooter%>
|
||||
347
package/cnsztl/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/myip.htm
Executable file → Normal file
@ -1,28 +1,339 @@
|
||||
|
||||
<!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="//www.taobao.com">
|
||||
<link rel="dns-prefetch" href="//ipv4.ip.sb">
|
||||
<link rel="dns-prefetch" href="//myip.ipip.net">
|
||||
<link rel="dns-prefetch" href="//api.ipify.org">
|
||||
<link rel="dns-prefetch" href="//api.ttt.sh">
|
||||
<link rel="dns-prefetch" href="//api.skk.moe">
|
||||
<link rel="dns-prefetch" href="//dt.skk.moe">
|
||||
<link rel="preconnect" href="https://www.taobao.com">
|
||||
<link rel="preconnect" href="https://ipv4.ip.sb">
|
||||
<link rel="preconnect" href="https://myip.ipip.net">
|
||||
<link rel="preconnect" href="https://api.ipify.org">
|
||||
<link rel="preconnect" href="https://api.ttt.sh">
|
||||
<link rel="preconnect" href="https://api.skk.moe">
|
||||
<link rel="preconnect" href="https://dt.skk.moe">
|
||||
<link rel="shortcut icon" type="image/ico" href="https://cdn.jsdelivr.net/npm/skx@0.0.1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,minimal-ui">
|
||||
<title>IP 地址查询</title>
|
||||
<style>
|
||||
.ip-title {
|
||||
font-weight: bold;
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
width: 25%;
|
||||
vertical-align:bottom;
|
||||
}
|
||||
|
||||
.ip-state_title {
|
||||
font-weight: bold;
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
width: 52%;
|
||||
vertical-align:bottom;
|
||||
transform:translateY(5%);
|
||||
}
|
||||
|
||||
.ip-result {
|
||||
color: #444;
|
||||
font-size:16px;
|
||||
white-space: nowrap; /*强制span不换行*/
|
||||
display: inline-block; /*将span当做块级元素对待*/
|
||||
width: 29%; /*限制宽度*/
|
||||
overflow: hidden; /*超出宽度部分隐藏*/
|
||||
text-overflow: ellipsis; /*超出部分以点号代替*/
|
||||
vertical-align:bottom;
|
||||
transform:translateY(8%);
|
||||
}
|
||||
|
||||
.ip-geo {
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
white-space: nowrap; /*强制span不换行*/
|
||||
display: inline-block; /*将span当做块级元素对待*/
|
||||
width: 40%; /*限制宽度*/
|
||||
overflow: hidden; /*超出宽度部分隐藏*/
|
||||
text-overflow: ellipsis; /*超出部分以点号代替*/
|
||||
vertical-align:bottom;
|
||||
transform:translateY(15%);
|
||||
}
|
||||
|
||||
.ip-checking {
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 29%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
transform:translateY(12%);
|
||||
}
|
||||
|
||||
.sk-text-success {
|
||||
color: #32b643;
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 48%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: left;
|
||||
transform:translateY(12%);
|
||||
}
|
||||
|
||||
.sk-text-error {
|
||||
color: #e85600;
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 48%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: left;
|
||||
transform:translateY(12%);
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 5px 0 6px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<fieldset class="cbi-section">
|
||||
<table>
|
||||
<tr><td align="left"><input type="button" class="cbi-button cbi-button-reload" value="<%:刷新%>" onclick="refreshFrame(200)"/></td></tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr><td><iframe id="myip" name="myip" src="https://ip.skk.moe/simple/" scrolling="no" onerror="return refreshFrame(5000)" onload="iFrameHeight()" frameborder="0" style="padding: 0px; width:100%; height:120%; float:left; margin:0; padding:0;"></iframe></td></tr>
|
||||
<tr><td width="100%">
|
||||
<body>
|
||||
<div style="display: flex;">
|
||||
<div style="width: 51%">
|
||||
<h3>IP 地址</h3>
|
||||
<p>
|
||||
<span class="ip-title">IP 登录设备:</span><span class="ip-result" id="ip-webrtc"></span> <span class="ip-geo" id="ip-webrtc-cz88"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-title">IPIP 国内:</span><span class="ip-result" id="ip-ipipnet"></span> <span class="ip-geo" id="ip-ipipnet-geo"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-title">淘宝 国内:</span><span class="ip-result" id="ip-taobao"></span> <span class="ip-geo" id="ip-taobao-ipip"></span>
|
||||
</p>
|
||||
<p>
|
||||
<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>
|
||||
<span class="ip-title">IPIFY 海外:</span><span class="ip-result" id="ip-ipify"></span> <span class="ip-geo" id="ip-ipify-ipip"></span>
|
||||
</p>
|
||||
</div>
|
||||
<div style="width: 49%">
|
||||
<h3>网站访问检查</h3>
|
||||
<p>
|
||||
<span class="ip-state_title">百度搜索:</span><span id="http-baidu"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-state_title">网易云音乐:</span><span id="http-163"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-state_title">GitHub:</span><span id="http-github"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-state_title">Facebook:</span><span id="http-facebook"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-state_title">YouTube:</span><span id="http-youtube"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p style="float: right; margin-top: 30px; font-size:15px; padding-right: 10px">Powered by <a onclick="return ip_skk()" href="javascript:void(0);">ip.skk.moe</a></p>
|
||||
</div>
|
||||
</td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<script>
|
||||
function ip_skk()
|
||||
{
|
||||
url2='https://ip.skk.moe';
|
||||
window.open(url2);
|
||||
}
|
||||
const $$ = document;
|
||||
$$.getElementById('ip-webrtc').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-taobao').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipify').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipipnet').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipsb').innerHTML = '查询中...';
|
||||
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) => {
|
||||
IP.get(`https://api.skk.moe/network/parseIp/ipip/${ip}`, 'json')
|
||||
.then(resp => {
|
||||
let x = '';
|
||||
for (let i of resp.data) {
|
||||
x += (i !== '') ? `${i} ` : '';
|
||||
}
|
||||
$$.getElementById(elID).innerHTML = x;
|
||||
//$$.getElementById(elID).innerHTML = `${resp.data.country} ${resp.data.regionName} ${resp.data.city} ${resp.data.isp}`;
|
||||
})
|
||||
},
|
||||
getWebrtcIP: () => {
|
||||
window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
|
||||
let pc = new RTCPeerConnection({ iceServers: [] }),
|
||||
noop = () => { };
|
||||
|
||||
pc.createDataChannel('');
|
||||
pc.createOffer(pc.setLocalDescription.bind(pc), noop);
|
||||
pc.onicecandidate = (ice) => {
|
||||
if (!ice || !ice.candidate || !ice.candidate.candidate) {
|
||||
$$.getElementById('ip-webrtc').innerHTML = '没有查询到 IP';
|
||||
return;
|
||||
}
|
||||
let ip = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(ice.candidate.candidate)[1];
|
||||
$$.getElementById('ip-webrtc').innerHTML = ip;
|
||||
IP.parseIPIpip(ip, 'ip-webrtc-cz88');
|
||||
pc.onicecandidate = noop;
|
||||
};
|
||||
},
|
||||
getIpipnetIP: () => {
|
||||
IP.get(`https://myip.ipip.net/?z=${random}`, 'text')
|
||||
.then((resp) => {
|
||||
let data = resp.data.replace('当前 IP:', '').split(' 来自于:');
|
||||
$$.getElementById('ip-ipipnet').innerHTML = `${data[0]}`;
|
||||
$$.getElementById('ip-ipipnet-geo').innerHTML = `${data[1]}`;
|
||||
});
|
||||
},
|
||||
getTaobaoIP: (data) => {
|
||||
$$.getElementById('ip-taobao').innerHTML = data.ip;
|
||||
IP.parseIPIpip(data.ip, 'ip-taobao-ipip');
|
||||
},
|
||||
getIpsbIP: (data) => {
|
||||
$$.getElementById('ip-ipsb').innerHTML = data.address;
|
||||
$$.getElementById('ip-ipsb-geo').innerHTML = `${data.country} ${data.province} ${data.city} ${data.isp.name}`
|
||||
},
|
||||
getIpifyIP: () => {
|
||||
IP.get(`https://api.ipify.org/?format=json&z=${random}`, 'json')
|
||||
.then(resp => {
|
||||
$$.getElementById('ip-ipify').innerHTML = resp.data.ip;
|
||||
return resp.data.ip;
|
||||
})
|
||||
.then(ip => {
|
||||
IP.parseIPIpip(ip, 'ip-ipify-ipip');
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
window.ipCallback = (data) => IP.getTaobaoIP(data);
|
||||
$$.getElementById('http-baidu').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
$$.getElementById('http-163').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
$$.getElementById('http-github').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
$$.getElementById('http-facebook').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
$$.getElementById('http-youtube').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
let HTTP = {
|
||||
checker: (domain, cbElID) => {
|
||||
let img = new Image;
|
||||
let timeout = setTimeout(() => {
|
||||
img.onerror = img.onload = null;
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-error">连接超时</span>'
|
||||
}, 5000);
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function iFrameHeight() {
|
||||
var ifm = document.getElementById("myip");
|
||||
var subWeb = document.frames ? document.frames["myip"].document : ifm.contentDocument;
|
||||
if (ifm != null && subWeb != null) {
|
||||
ifm.height = subWeb.body.scrollHeight;
|
||||
ifm.width = subWeb.body.scrollWidth;
|
||||
}
|
||||
}
|
||||
function refreshFrame(delay)
|
||||
{
|
||||
setTimeout(function(){ document.getElementById('myip').src="https://ip.skk.moe/simple/"; }, delay);
|
||||
}
|
||||
img.onerror = () => {
|
||||
clearTimeout(timeout);
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-error">无法访问</span>'
|
||||
}
|
||||
|
||||
//]]></script>
|
||||
img.onload = () => {
|
||||
clearTimeout(timeout);
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-success">连接正常</span>'
|
||||
}
|
||||
|
||||
img.src = `https://${domain}/favicon.ico?${+(new Date)}`
|
||||
},
|
||||
runcheck: () => {
|
||||
HTTP.checker('www.baidu.com', 'http-baidu');
|
||||
HTTP.checker('s1.music.126.net/style', 'http-163');
|
||||
HTTP.checker('github.com', 'http-github');
|
||||
HTTP.checker('www.facebook.com', 'http-facebook');
|
||||
HTTP.checker('www.youtube.com', 'http-youtube');
|
||||
}
|
||||
};
|
||||
|
||||
HTTP.runcheck();
|
||||
IP.getIpipnetIP();
|
||||
IP.getIpifyIP();
|
||||
IP.getWebrtcIP();
|
||||
|
||||
window.onload=myip_Load();
|
||||
|
||||
function myip_Load()
|
||||
{
|
||||
var tbip = document.getElementsByTagName('HEAD').item(0);
|
||||
var tbipScript= document.createElement("script");
|
||||
tbipScript.async = "async";
|
||||
tbipScript.src='https://www.taobao.com/help/getip.php';
|
||||
tbip.appendChild( tbipScript);
|
||||
|
||||
var sbip = document.getElementsByTagName('HEAD').item(0);
|
||||
var sbipScript= document.createElement("script");
|
||||
sbipScript.async = "async";
|
||||
sbipScript.src='https://ipv4.ip.sb/addrinfo?callback=IP.getIpsbIP';
|
||||
sbip.appendChild( sbipScript);
|
||||
|
||||
const $$ = document;
|
||||
random = parseInt(Math.random() * 100000000);
|
||||
window.ipCallback = (data) => IP.getTaobaoIP(data);
|
||||
HTTP.runcheck();
|
||||
IP.getIpipnetIP();
|
||||
IP.getIpifyIP();
|
||||
IP.getWebrtcIP();
|
||||
setTimeout("myip_Load()",1000*8);
|
||||
}
|
||||
|
||||
</script>
|
||||
<script async="async" src="https://www.taobao.com/help/getip.php"></script>
|
||||
<script async="async" src="https://ipv4.ip.sb/addrinfo?callback=IP.getIpsbIP"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
54
package/cnsztl/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/state.htm
Executable file → Normal file
@ -1,9 +1,9 @@
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
<table>
|
||||
<tr><td width="100%" colspan="4" align="center"><b> 一些必要的状态显示,运行前请确保各项目显示正常,需要更新请到更新设置页面操作 </b></td></tr>
|
||||
<tr><td width="25%"> OpenClash 配置文件状态 </td><td width="25%" align="left" id="_config_check"><%:Collecting data...%></td><td width="25%"> OpenClash 配置文件更新日期 </td><td width="25%"v align="left" id="_config"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> GEOIP(By MaxMind) 数据库日期 </td><td width="25%" align="left" id="_ipdb"><%:Collecting data...%></td><td width="25%"> lhie1 规则更新日期 </td><td width="25%" align="left" id="_lhie1"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="100%" colspan="4" align="center"><b> 一些必要的状态显示,运行前请确保各项目显示正常,需要更新请到接管设置页面操作 </b></td></tr>
|
||||
<tr><td width="25%"> 启动参数检查(配置文件) </td><td width="25%" align="left" id="_config_check"><%:Collecting data...%></td><td width="25%"> 配置文件更新日期 </td><td width="25%" align="left" id="_config"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> GEOIP(By MaxMind)数据库日期 </td><td width="25%" align="left" id="_ipdb"><%:Collecting data...%></td><td width="25%"> lhie1 规则更新日期 </td><td width="25%" align="left" id="_lhie1"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> ConnersHua 规则更新日期 </td><td width="25%" align="left" id="_ConnersHua"><%:Collecting data...%></td><td width="25%"> ConnersHua 回国规则更新日期 </td><td width="25%" align="left" id="_ConnersHua_return"><%:Collecting data...%></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
@ -15,10 +15,52 @@
|
||||
var ConnersHua = document.getElementById('_ConnersHua');
|
||||
var ConnersHua_return = document.getElementById('_ConnersHua_return');
|
||||
var config_check = document.getElementById('_config_check');
|
||||
XHR.poll(2, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
config_check.innerHTML = status.config_check ? '<b><font color=green><%:Config Normal%></font></b>' : '<b><font color=red><%:Config Abnormal%></font></b>';
|
||||
config.innerHTML = status.config ? "<b><font color=green>"+status.config+"</font></b>" : "<b><font color=red>"+"<%:File No Update%>"+"</font></b>";
|
||||
if (status.config_check == "") {
|
||||
config_check.innerHTML = '<b><font color=green><%:Config Normal%></font></b>';
|
||||
}
|
||||
else if (status.config_check == "1") {
|
||||
config_check.innerHTML = '<b><font color=red><%:未找到配置文件%></font></b>';
|
||||
}
|
||||
else {
|
||||
config_check.innerHTML = '<b><font color=red>'+status.config_check+'<%: - 参数异常%></font></b>';
|
||||
}
|
||||
if (status.config == "1") {
|
||||
config.innerHTML = "<b><font color=red><%:未找到配置文件%></font></b>";
|
||||
}
|
||||
else if (status.config == "0") {
|
||||
config.innerHTML = "<b><font color=green><%:原始配置文件%></font></b>";
|
||||
}
|
||||
else {
|
||||
config.innerHTML = "<b><font color=green>"+status.config+"</font></b>";
|
||||
}
|
||||
ipdb.innerHTML = status.ipdb ? "<b><font color=green>"+status.ipdb+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
lhie1.innerHTML = status.lhie1 ? "<b><font color=green>"+status.lhie1+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
ConnersHua.innerHTML = status.ConnersHua ? "<b><font color=green>"+status.ConnersHua+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
ConnersHua_return.innerHTML = status.ConnersHua_return ? "<b><font color=green>"+status.ConnersHua_return+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
}
|
||||
});
|
||||
XHR.poll(10, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if (status.config_check == "") {
|
||||
config_check.innerHTML = '<b><font color=green><%:Config Normal%></font></b>';
|
||||
}
|
||||
else if (status.config_check == "1") {
|
||||
config_check.innerHTML = '<b><font color=red><%:未找到配置文件%></font></b>';
|
||||
}
|
||||
else {
|
||||
config_check.innerHTML = '<b><font color=red>'+status.config_check+'<%: - 参数异常%></font></b>';
|
||||
}
|
||||
if (status.config == "1") {
|
||||
config.innerHTML = "<b><font color=red><%:未找到配置文件%></font></b>";
|
||||
}
|
||||
else if (status.config == "0") {
|
||||
config.innerHTML = "<b><font color=green><%:原始配置文件%></font></b>";
|
||||
}
|
||||
else {
|
||||
config.innerHTML = "<b><font color=green>"+status.config+"</font></b>";
|
||||
}
|
||||
ipdb.innerHTML = status.ipdb ? "<b><font color=green>"+status.ipdb+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
lhie1.innerHTML = status.lhie1 ? "<b><font color=green>"+status.lhie1+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
ConnersHua.innerHTML = status.ConnersHua ? "<b><font color=green>"+status.ConnersHua+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
|
||||
108
package/cnsztl/luci-app-openclash/files/usr/lib/lua/luci/view/openclash/status.htm
Executable file → Normal file
@ -0,0 +1,216 @@
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
|
||||
<table>
|
||||
<tr><td width="100%" colspan="4" align="center" id="update_tip"><b> 注意:如下载失败可手动下载并上传,内核路径为:/etc/openclash </b></td></tr>
|
||||
<tr><td width="25%"> 已选择编译版本 </td><td width="25%" align="left" id="CORE_VERSION"><%:Collecting data...%></td><td width="25%"> 上次检查更新时间 </td><td width="25%" align="left" id="CHECKTIME"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> 处理器架构(PROC) </td><td width="25%" align="left" id="CPU_MODEL"><%:Collecting data...%></td><td width="25%"> 处理器架构(OPKG) </td><td width="25%" align="left" id="CPU_MODEL2"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> 当前内核版本 </td><td width="25%" align="left" id="CORE_CV"><%:Collecting data...%></td><td width="25%"> 当前客户端版本 </td><td width="25%" align="left" id="OP_CV"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> 最新内核版本 </td><td width="25%" align="left" id="CORE_LV"><%:Collecting data...%></td><td width="25%"> 最新客户端版本 </td><td width="25%" align="left" id="OP_LV"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> 更新内核</td><td width="25%" align="left" id="core_up"><%:Collecting data...%></td><td width="25%"> 更新客户端 </td><td width="25%" align="left" id="op_up"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"> 下载最新版本内核</td><td width="25%" align="left" id="ma_core_up"><%:Collecting data...%></td><td width="25%"> 下载最新版本客户端 </td><td width="25%" align="left" id="ma_op_up"><%:Collecting data...%></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 cpu_model2 = document.getElementById('CPU_MODEL2');
|
||||
var core_cv = document.getElementById('CORE_CV');
|
||||
var core_lv = document.getElementById('CORE_LV');
|
||||
var op_cv = document.getElementById('OP_CV');
|
||||
var op_lv = document.getElementById('OP_LV');
|
||||
var core_up = document.getElementById('core_up');
|
||||
var op_up = document.getElementById('op_up');
|
||||
var update_tip = document.getElementById('update_tip');
|
||||
var ma_core_up = document.getElementById('ma_core_up');
|
||||
var ma_op_up = document.getElementById('ma_op_up');
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.corever != "0\n" && status.corever != "" ) {
|
||||
core_version.innerHTML = "<b><font color=green>"+status.corever+"</font></b>";
|
||||
}
|
||||
else {
|
||||
core_version.innerHTML = "<b><font color=red><%:未选择编译版本,请到全局设置中配置%></font></b>";
|
||||
}
|
||||
if ( status.upchecktime != "1" ) {
|
||||
checktime.innerHTML = "<b><font color=green>"+status.upchecktime+"</font></b>";
|
||||
}
|
||||
else {
|
||||
checktime.innerHTML = "<b><font color=red><%:查询更新失败%></font></b>";
|
||||
}
|
||||
cpu_model.innerHTML = status.coremodel ? "<b><font color=green>"+status.coremodel+"</font></b>" : "<b><font color=red><%:Model Not Found%></font></b>";
|
||||
cpu_model2.innerHTML = status.coremodel2 ? "<b><font color=green>"+status.coremodel2+"</font></b>" : "<b><font color=red><%:Model Not Found%></font></b>";
|
||||
if ( status.corecv == "0" ) {
|
||||
core_cv.innerHTML = "<b><font color=red><%:File Not Exist%></font></b>";
|
||||
}
|
||||
else if (status.corecv != "") {
|
||||
core_cv.innerHTML = "<b><font color=green>"+status.corecv+"</font></b>";
|
||||
}
|
||||
else {
|
||||
core_cv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
}
|
||||
if ( status.corelv != "" && status.corelv != status.corecv && status.corecv != "" && status.corecv != "0" && status.corelv != "\n" ) {
|
||||
core_lv.innerHTML = "<b><font color=green>"+status.corelv+"<%:<New>%></font></b>";
|
||||
}
|
||||
else if (status.corelv != "" && status.corelv != "\n" ) {
|
||||
core_lv.innerHTML = "<b><font color=green>"+status.corelv+"</font></b>";
|
||||
}
|
||||
else {
|
||||
core_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
}
|
||||
op_cv.innerHTML = status.opcv ? "<b><font color=green>"+status.opcv+"</font></b>" : "<b><font color=red><%:Unknown%></font></b>";
|
||||
if ( status.oplv != "" && status.oplv != "\n" && "v"+status.oplv != status.opcv && status.opcv != "" ) {
|
||||
op_lv.innerHTML = "<b><font color=green>v"+status.oplv+"<%:<New>%></font></b>";
|
||||
}
|
||||
else if (status.oplv != "" && status.oplv != "\n") {
|
||||
op_lv.innerHTML = "<b><font color=green>v"+status.oplv+"</font></b>";
|
||||
}
|
||||
else {
|
||||
op_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.corever != "0\n" && status.corever != "" ) {
|
||||
core_version.innerHTML = "<b><font color=green>"+status.corever+"</font></b>";
|
||||
}
|
||||
else {
|
||||
core_version.innerHTML = "<b><font color=red><%:未选择编译版本,请到全局设置中配置%></font></b>";
|
||||
}
|
||||
if ( status.upchecktime != "1" ) {
|
||||
checktime.innerHTML = "<b><font color=green>"+status.upchecktime+"</font></b>";
|
||||
}
|
||||
else {
|
||||
checktime.innerHTML = "<b><font color=red><%:查询更新失败%></font></b>";
|
||||
}
|
||||
cpu_model.innerHTML = status.coremodel ? "<b><font color=green>"+status.coremodel+"</font></b>" : "<b><font color=red><%:Model Not Found%></font></b>";
|
||||
cpu_model2.innerHTML = status.coremodel2 ? "<b><font color=green>"+status.coremodel2+"</font></b>" : "<b><font color=red><%:Model Not Found%></font></b>";
|
||||
if ( status.corecv == "0" ) {
|
||||
core_cv.innerHTML = "<b><font color=red><%:File Not Exist%></font></b>";
|
||||
}
|
||||
else if (status.corecv != "") {
|
||||
core_cv.innerHTML = "<b><font color=green>"+status.corecv+"</font></b>";
|
||||
}
|
||||
else {
|
||||
core_cv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
}
|
||||
if ( status.corelv != "" && status.corelv != status.corecv && status.corecv != "" && status.corecv != "0" && status.corelv != "\n" ) {
|
||||
core_lv.innerHTML = "<b><font color=green>"+status.corelv+"<%:<New>%></font></b>";
|
||||
}
|
||||
else if (status.corelv != "" && status.corelv != "\n" ) {
|
||||
core_lv.innerHTML = "<b><font color=green>"+status.corelv+"</font></b>";
|
||||
}
|
||||
else {
|
||||
core_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
}
|
||||
op_cv.innerHTML = status.opcv ? "<b><font color=green>"+status.opcv+"</font></b>" : "<b><font color=red><%:Unknown%></font></b>";
|
||||
if ( status.oplv != "" && status.oplv != "\n" && "v"+status.oplv != status.opcv && status.opcv != "" ) {
|
||||
op_lv.innerHTML = "<b><font color=green>v"+status.oplv+"<%:<New>%></font></b>";
|
||||
}
|
||||
else if (status.oplv != "" && status.oplv != "\n") {
|
||||
op_lv.innerHTML = "<b><font color=green>v"+status.oplv+"</font></b>";
|
||||
}
|
||||
else {
|
||||
op_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
core_up.innerHTML = '<input type="button" class="cbi-button cbi-button-reload" value="<%:检查并更新%>" onclick="return core_update(this)"/>';
|
||||
op_up.innerHTML = '<input type="button" class="cbi-button cbi-button-reload" value="<%:检查并更新%>" onclick="return op_update(this)"/>';
|
||||
ma_core_up.innerHTML = '<input type="button" class="cbi-button cbi-button-reload" value="<%:下载到本地%>" onclick="return ma_core_update(this)"/>';
|
||||
ma_op_up.innerHTML = '<input type="button" class="cbi-button cbi-button-reload" value="<%:下载到本地%>" onclick="return ma_op_update(this)"/>';
|
||||
|
||||
function core_update(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:运行中...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "coreupdate")%>', status.coreup, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.value = '<%:检查并更新%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function op_update(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:运行中...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "opupdate")%>', status.opup, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.value = '<%:检查并更新%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ma_core_update(btn)
|
||||
{
|
||||
btn.value = '<%:下载到本地%>';
|
||||
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\n" ) {
|
||||
url1='https://github.com/vernesong/OpenClash/releases/download/Clash/clash-'+status.corever+'.tar.gz';
|
||||
window.open(url1);
|
||||
}
|
||||
else {
|
||||
alert('未选择编译版本,请到全局设置中配置!')
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function ma_op_update(btn)
|
||||
{
|
||||
btn.value = '<%:下载到本地%>';
|
||||
btn.disabled = false;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_ma")%>', status.oplv, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.oplv != "" && status.oplv != "\n" ) {
|
||||
url2='https://github.com/vernesong/OpenClash/releases/download/v'+status.oplv+'/luci-app-openclash_'+status.oplv+'_all.ipk';
|
||||
window.open(url2);
|
||||
}
|
||||
else {
|
||||
alert('最新版本获取失败,请稍后再试!')
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
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><%: 注意:如下载失败可手动下载并上传,内核路径为:/etc/openclash %></font></b>';
|
||||
}
|
||||
if(rdmdl==2)
|
||||
{
|
||||
update_tip.innerHTML = '<b><font><%: 注意:客户端只支持通过IPK安装的版本进行更新,因为随系统编译的版本更新后不会释放旧版本的闪存空间 %></font></b>';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
XHR.poll(2, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', status.startlog, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.startlog != "\n" && status.startlog != "" ) {
|
||||
update_tip.innerHTML = '<b><font color="green">'+status.startlog+'</font></b>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//]]></script>
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
<%+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="ulfile"><%:Upload Config%>
|
||||
<input class="cbi-input-file" style="width: 30%" type="file" id="ulfile" name="ulfile" />
|
||||
<input type="submit" class="cbi-button cbi-input-reload" name="upload" value="<%:Upload%>" />
|
||||
</div>
|
||||
<%+cbi/valuefooter%>
|
||||
12
package/cnsztl/luci-app-openclash/files/usr/share/openclash/clash_version.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
CKTIME=$(date "+%Y-%m-%d-%H")
|
||||
LAST_OPVER="/tmp/clash_last_version"
|
||||
version_url="https://github.com/vernesong/OpenClash/raw/master/core_version"
|
||||
if [ "$CKTIME" != "$(grep "CheckTime" $LAST_OPVER 2>/dev/null |awk -F ':' '{print $2}')" ]; then
|
||||
wget-ssl --no-check-certificate --quiet --timeout=5 --tries=2 "$version_url" -O $LAST_OPVER
|
||||
if [ "$?" -eq "0" ] && [ "$(ls -l $LAST_OPVER 2>/dev/null |awk '{print int($5)}')" -gt 0 ]; then
|
||||
echo "CheckTime:$CKTIME" >>$LAST_OPVER
|
||||
else
|
||||
rm -rf $LAST_OPVER
|
||||
fi
|
||||
fi
|
||||
0
package/cnsztl/luci-app-openclash/files/usr/share/openclash/dashboard/img/33343e6117c37aaef8886179007ba6b5.png
Executable file → Normal file
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
4
package/cnsztl/luci-app-openclash/files/usr/share/openclash/dashboard/index.html
Executable file → Normal file
@ -4,8 +4,8 @@
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Clash</title>
|
||||
<link href="main.5b2a02b81ea75793d649.css" rel="stylesheet"></head>
|
||||
<link href="main.09f6f4281ae3598cbadf.css" rel="stylesheet"></head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="text/javascript" src="js/1.bundle.5b2a02b81ea75793d649.min.js"></script><script type="text/javascript" src="js/bundle.5b2a02b81ea75793d649.min.js"></script></body>
|
||||
<script type="text/javascript" src="js/1.bundle.09f6f4281ae3598cbadf.min.js"></script><script type="text/javascript" src="js/bundle.09f6f4281ae3598cbadf.min.js"></script></body>
|
||||
</html>
|
||||
|
||||
@ -1,39 +1,53 @@
|
||||
#!/bin/sh
|
||||
START_LOG="/tmp/openclash_start.log"
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
echo "开始下载配置文件..." >$START_LOG
|
||||
CONFIG_FILE="/etc/openclash/config.yaml"
|
||||
LOG_FILE="/tmp/openclash.log"
|
||||
BACKPACK_FILE="/etc/openclash/config.bak"
|
||||
URL_TYPE=$(uci get openclash.config.config_update_url_type 2>/dev/null)
|
||||
subscribe_url=$(uci get openclash.config.subscribe_url 2>/dev/null)
|
||||
wget-ssl --no-check-certificate "$subscribe_url" -O /tmp/config.yml
|
||||
if [ "$?" -eq "0" ]; then
|
||||
if [ "$URL_TYPE" == "V2ray" ]; then
|
||||
echo "开始下载v2ray配置文件..." >$START_LOG
|
||||
subscribe_url=`echo $subscribe_url |sed 's/{/%7B/g;s/}/%7D/g;s/:/%3A/g;s/\"/%22/g;s/,/%2C/g;s/?/%3F/g;s/=/%3D/g;s/&/%26/g;s/\//%2F/g'`
|
||||
wget-ssl --no-check-certificate --quiet --timeout=10 --tries=2 https://tgbot.lbyczf.com/v2rayn2clash?url="$subscribe_url" -O /tmp/config.yaml
|
||||
elif [ "$URL_TYPE" == "surge" ]; then
|
||||
echo "开始下载Surge配置文件..." >$START_LOG
|
||||
subscribe_url=`echo $subscribe_url |sed 's/{/%7B/g;s/}/%7D/g;s/:/%3A/g;s/\"/%22/g;s/,/%2C/g;s/?/%3F/g;s/=/%3D/g;s/&/%26/g;s/\//%2F/g'`
|
||||
wget-ssl --no-check-certificate --timeout=10 --debug --tries=2 https://tgbot.lbyczf.com/surge2clash?url="$subscribe_url" -O /tmp/config.yaml
|
||||
else
|
||||
echo "开始下载Clash配置文件..." >$START_LOG
|
||||
wget-ssl --no-check-certificate --quiet --timeout=10 --tries=2 "$subscribe_url" -O /tmp/config.yaml
|
||||
fi
|
||||
if [ "$?" -eq "0" ] && [ "$(ls -l /tmp/config.yaml |awk '{print int($5/1024)}')" -ne 0 ]; then
|
||||
echo "配置文件下载成功,检查是否有更新..." >$START_LOG
|
||||
if [ -f /etc/openclash/config.yml ]; then
|
||||
cmp -s /etc/openclash/config.bak /tmp/config.yml
|
||||
if [ -f "$CONFIG_FILE" ]; then
|
||||
cmp -s "$BACKPACK_FILE" /tmp/config.yaml
|
||||
if [ "$?" -ne "0" ]; then
|
||||
echo "配置文件有更新,开始替换..." >$START_LOG
|
||||
mv /tmp/config.yml /etc/openclash/config.yml 2>/dev/null\
|
||||
&& cp /etc/openclash/config.yml /etc/openclash/config.bak\
|
||||
mv /tmp/config.yaml "$CONFIG_FILE" 2>/dev/null\
|
||||
&& cp "$CONFIG_FILE" "$BACKPACK_FILE"\
|
||||
&& echo "配置文件替换成功,开始启动 OpenClash ..." >$START_LOG\
|
||||
&& /etc/init.d/openclash restart 2>/dev/null
|
||||
echo "${LOGTIME} Config Update Successful" >>/tmp/openclash.log
|
||||
echo "${LOGTIME} Config Update Successful" >>$LOG_FILE
|
||||
else
|
||||
echo "配置文件没有任何更新,停止继续操作..." >$START_LOG
|
||||
rm -rf /tmp/config.yml
|
||||
echo "${LOGTIME} Updated Config No Change, Do Nothing" >>/tmp/openclash.log
|
||||
rm -rf /tmp/config.yaml
|
||||
echo "${LOGTIME} Updated Config No Change, Do Nothing" >>$LOG_FILE
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
else
|
||||
echo "配置文件下载成功,本地没有配置文件,开始创建 ..." >$START_LOG
|
||||
mv /tmp/config.yml /etc/openclash/config.yml 2>/dev/null\
|
||||
&& cp /etc/openclash/config.yml /etc/openclash/config.bak\
|
||||
mv /tmp/config.yaml "$CONFIG_FILE" 2>/dev/null\
|
||||
&& cp "$CONFIG_FILE" "$BACKPACK_FILE"\
|
||||
&& echo "配置文件创建成功,开始启动 OpenClash ..." >$START_LOG\
|
||||
&& /etc/init.d/openclash restart 2>/dev/null
|
||||
echo "${LOGTIME} Config Update Successful" >>/tmp/openclash.log
|
||||
echo "${LOGTIME} Config Update Successful" >>$LOG_FILE
|
||||
fi
|
||||
else
|
||||
echo "配置文件下载失败,请检查网络或稍后再试!" >$START_LOG
|
||||
echo "${LOGTIME} Config Update Error" >>/tmp/openclash.log
|
||||
rm -rf /tmp/config.yml 2>/dev/null
|
||||
echo "${LOGTIME} Config Update Error" >>$LOG_FILE
|
||||
#rm -rf /tmp/config.yaml 2>/dev/null
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
|
||||
@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
#禁止多个实例
|
||||
status=$(ps|grep -c /usr/share/openclash/openclash_core.sh)
|
||||
[ "$status" -gt "3" ] && exit 0
|
||||
|
||||
START_LOG="/tmp/openclash_start.log"
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
LOG_FILE="/tmp/openclash.log"
|
||||
CPU_MODEL=$(uci get openclash.config.core_version 2>/dev/null)
|
||||
|
||||
if [ "$(/etc/openclash/clash -v 2>/dev/null |awk -F ' ' '{print $2}')" != "$(sed -n 1p /tmp/clash_last_version 2>/dev/null)" ] || [ -z "$(/etc/openclash/clash -v 2>/dev/null |awk -F ' ' '{print $2}')" ] || [ ! -f /etc/openclash/clash ]; then
|
||||
if [ "$CPU_MODEL" != 0 ]; then
|
||||
echo "开始下载 OpenClash 内核..." >$START_LOG
|
||||
wget-ssl --no-check-certificate --quiet --timeout=10 --tries=5 https://github.com/vernesong/OpenClash/releases/download/Clash/clash-"$CPU_MODEL".tar.gz -O /tmp/clash.tar.gz
|
||||
if [ "$?" -eq "0" ] && [ "$(ls -l /tmp/clash.tar.gz |awk '{print int($5/1024)}')" -ne 0 ]; then
|
||||
tar zxvf /tmp/clash.tar.gz -C /tmp >/dev/null 2>&1\
|
||||
&& rm -rf /tmp/clash.tar.gz >/dev/null 2>&1\
|
||||
&& chmod 4755 /tmp/clash\
|
||||
&& chown root:root /tmp/clash
|
||||
/etc/init.d/openclash stop
|
||||
echo "OpenClash 内核下载成功,开始更新..." >$START_LOG\
|
||||
&& rm -rf /etc/openclash/clash\
|
||||
&& mv /tmp/clash /etc/openclash/clash >/dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
/etc/init.d/openclash start
|
||||
echo "核心程序更新成功!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Core Update Successful" >>$LOG_FILE
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "核心程序更新失败,请确认设备闪存空间足够后再试!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Core Update Error" >>$LOG_FILE
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
else
|
||||
echo "核心程序下载失败,请检查网络或稍后再试!" >$START_LOG
|
||||
rm -rf /tmp/clash.tar.gz >/dev/null 2>&1
|
||||
echo "${LOGTIME} OpenClash Core Update Error" >>$LOG_FILE
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
else
|
||||
echo "未选择编译版本,请到全局设置中选择后再试!" >$START_LOG
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
else
|
||||
echo "核心程序没有更新,停止继续操作!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Core No Change, Do Nothing" >>$LOG_FILE
|
||||
rm -rf /tmp/clash >/dev/null 2>&1
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
@ -1,27 +1,28 @@
|
||||
#!/bin/sh
|
||||
START_LOG="/tmp/openclash_start.log"
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
LOG_FILE="/tmp/openclash.log"
|
||||
echo "开始下载 GEOIP 数据库..." >$START_LOG
|
||||
wget-ssl --no-check-certificate https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz -O /tmp/ipdb.tar.gz
|
||||
if [ "$?" -eq "0" ]; then
|
||||
wget-ssl --no-check-certificate --quiet --timeout=10 --tries=2 https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz -O /tmp/ipdb.tar.gz
|
||||
if [ "$?" -eq "0" ] && [ "$(ls -l /tmp/ipdb.tar.gz |awk '{print int($5/1024)}')" -ne 0 ]; then
|
||||
echo "GEOIP 数据库下载成功,检查数据库版本是否更新..." >$START_LOG
|
||||
tar zxvf /tmp/ipdb.tar.gz -C /tmp >/dev/null 2>&1\
|
||||
&& rm -rf /tmp/ipdb.tar.gz >/dev/null 2>&1
|
||||
cmp -s /tmp/GeoLite2-Country_*/GeoLite2-Country.mmdb /etc/openclash/Country.mmdb
|
||||
if [ "$?" -ne "0" ]; then
|
||||
echo "数据库版本有更新,开始替换数据库版本..." >$START_LOG
|
||||
/etc/init.d/openclash stop\
|
||||
/etc/init.d/openclash stop
|
||||
echo "数据库版本有更新,开始替换数据库版本..." >$START_LOG\
|
||||
&& mv /tmp/GeoLite2-Country_*/GeoLite2-Country.mmdb /etc/openclash/Country.mmdb >/dev/null 2>&1\
|
||||
&& /etc/init.d/openclash start\
|
||||
&& echo "删除下载缓存..." >$START_LOG\
|
||||
&& rm -rf /tmp/GeoLite2-Country_* >/dev/null 2>&1
|
||||
echo "GEOIP 数据库更新成功!" >$START_LOG
|
||||
echo "${LOGTIME} GEOIP Database Update Successful" >>/tmp/openclash.log
|
||||
echo "${LOGTIME} GEOIP Database Update Successful" >>$LOG_FILE
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "数据库版本没有更新,停止继续操作..." >$START_LOG
|
||||
echo "${LOGTIME} Updated GEOIP Database No Change, Do Nothing" >>/tmp/openclash.log
|
||||
echo "${LOGTIME} Updated GEOIP Database No Change, Do Nothing" >>$LOG_FILE
|
||||
rm -rf /tmp/GeoLite2-Country_* >/dev/null 2>&1
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
@ -29,7 +30,7 @@
|
||||
else
|
||||
echo "GEOIP 数据库下载失败,请检查网络或稍后再试!" >$START_LOG
|
||||
rm -rf /tmp/ipdb.tar.gz >/dev/null 2>&1
|
||||
echo "${LOGTIME} GEOIP Database Update Error" >>/tmp/openclash.log
|
||||
echo "${LOGTIME} GEOIP Database Update Error" >>$LOG_FILE
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
@ -1,41 +1,48 @@
|
||||
#!/bin/sh
|
||||
START_LOG="/tmp/openclash_start.log"
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
LOG_FILE="/tmp/openclash.log"
|
||||
echo "开始获取使用中的第三方规则名称..." >$START_LOG
|
||||
rule_source=$(uci get openclash.config.rule_source 2>/dev/null)
|
||||
echo "开始下载使用中的第三方规则..." >$START_LOG
|
||||
if [ "$rule_source" = "lhie1" ]; then
|
||||
wget-ssl --no-check-certificate https://raw.githubusercontent.com/lhie1/Rules/master/Clash/Rule.yml -O /tmp/rules.yml
|
||||
wget-ssl --no-check-certificate --quiet --timeout=10 --tries=2 https://raw.githubusercontent.com/lhie1/Rules/master/Clash/Rule.yml -O /tmp/rules.yaml
|
||||
elif [ "$rule_source" = "ConnersHua" ]; then
|
||||
wget-ssl --no-check-certificate https://raw.githubusercontent.com/ConnersHua/Profiles/master/Clash/Global.yml -O /tmp/rules.yml
|
||||
sed -i -n '/^Rule:$/,$p' /tmp/rules.yml
|
||||
wget-ssl --no-check-certificate --quiet --timeout=10 --tries=2 https://raw.githubusercontent.com/ConnersHua/Profiles/master/Clash/Pro.yaml -O /tmp/rules.yaml
|
||||
sed -i -n '/^Rule:/,$p' /tmp/rules.yaml
|
||||
elif [ "$rule_source" = "ConnersHua_return" ]; then
|
||||
wget-ssl --no-check-certificate https://raw.githubusercontent.com/ConnersHua/Profiles/master/Clash/China.yml -O /tmp/rules.yml
|
||||
sed -i -n '/^Rule:$/,$p' /tmp/rules.yml
|
||||
wget-ssl --no-check-certificate --quiet --timeout=10 --tries=2 https://raw.githubusercontent.com/ConnersHua/Profiles/master/Clash/BacktoCN.yaml -O /tmp/rules.yaml
|
||||
sed -i -n '/^Rule:/,$p' /tmp/rules.yaml
|
||||
fi
|
||||
if [ "$?" -eq "0" ] && [ "$rule_source" != 0 ]; then
|
||||
if [ "$?" -eq "0" ] && [ "$rule_source" != 0 ] && [ "$(ls -l /tmp/rules.yaml |awk '{print int($5/1024)}')" -ne 0 ]; then
|
||||
echo "下载成功,开始预处理规则文件..." >$START_LOG
|
||||
sed -i "/^Rule:$/a\##source:${rule_source}" /tmp/rules.yml >/dev/null 2>&1
|
||||
sed -i "/^Rule:/a\##source:${rule_source}" /tmp/rules.yaml >/dev/null 2>&1
|
||||
echo "检查下载的规则文件是否有更新..." >$START_LOG
|
||||
cmp -s /etc/openclash/"$rule_source".yml /tmp/rules.yml
|
||||
cmp -s /etc/openclash/"$rule_source".yaml /tmp/rules.yaml
|
||||
if [ "$?" -ne "0" ]; then
|
||||
echo "检测到下载的规则文件有更新,开始替换..." >$START_LOG
|
||||
mv /tmp/rules.yml /etc/openclash/"$rule_source".yml >/dev/null 2>&1
|
||||
sed -i '/^Rule:$/a\##updated' /etc/openclash/"$rule_source".yml >/dev/null 2>&1
|
||||
mv /tmp/rules.yaml /etc/openclash/"$rule_source".yaml >/dev/null 2>&1
|
||||
sed -i '/^Rule:/a\##updated' /etc/openclash/"$rule_source".yaml >/dev/null 2>&1
|
||||
echo "替换成功,重新加载 OpenClash 应用新规则..." >$START_LOG
|
||||
/etc/init.d/openclash reload 2>/dev/null
|
||||
echo "${LOGTIME} Other Rules Update Successful" >>/tmp/openclash.log
|
||||
echo "${LOGTIME} Other Rules Update Successful" >>$LOG_FILE
|
||||
else
|
||||
echo "检测到下载的规则文件没有更新,停止继续操作..." >$START_LOG
|
||||
rm -rf /tmp/rules.yml >/dev/null 2>&1
|
||||
echo "${LOGTIME} Updated Other Rules No Change, Do Nothing" >>/tmp/openclash.log
|
||||
rm -rf /tmp/rules.yaml >/dev/null 2>&1
|
||||
echo "${LOGTIME} Updated Other Rules No Change, Do Nothing" >>$LOG_FILE
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
elif [ "$rule_source" = 0 ]; then
|
||||
echo "未启用第三方规则,更新程序终止!" >$START_LOG
|
||||
rm -rf /tmp/rules.yaml >/dev/null 2>&1
|
||||
echo "${LOGTIME} Other Rules Not Enable, Update Stop" >>$LOG_FILE
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "第三方规则下载失败,请检查网络或稍后再试!" >$START_LOG
|
||||
rm -rf /tmp/rules.yml >/dev/null 2>&1
|
||||
echo "${LOGTIME} Other Rules Update Error" >>/tmp/openclash.log
|
||||
rm -rf /tmp/rules.yaml >/dev/null 2>&1
|
||||
echo "${LOGTIME} Other Rules Update Error" >>$LOG_FILE
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
@ -0,0 +1,67 @@
|
||||
#!/bin/sh
|
||||
#禁止多个实例
|
||||
status=$(ps|grep -c /usr/share/openclash/openclash_update.sh)
|
||||
[ "$status" -gt "3" ] && exit 0
|
||||
|
||||
START_LOG="/tmp/openclash_start.log"
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
LOG_FILE="/tmp/openclash.log"
|
||||
LAST_OPVER="/tmp/openclash_last_version"
|
||||
LAST_VER=$(sed -n 1p "$LAST_OPVER" 2>/dev/null |sed "s/^v//g")
|
||||
if [ "$(sed -n 1p /etc/openclash/openclash_version 2>/dev/null)" != "$(sed -n 1p $LAST_OPVER 2>/dev/null)" ] && [ -f "$LAST_OPVER" ]; then
|
||||
echo "开始下载 OpenClash-$LAST_VER ..." >$START_LOG
|
||||
wget-ssl --no-check-certificate --quiet --timeout=10 --tries=5 https://github.com/vernesong/OpenClash/releases/download/v"$LAST_VER"/luci-app-openclash_"$LAST_VER"_all.ipk -O /tmp/openclash.ipk
|
||||
if [ "$?" -eq "0" ] && [ "$(ls -l /tmp/openclash.ipk |awk '{print int($5/1024)}')" -ne 0 ]; then
|
||||
echo "OpenClash-$LAST_VER 下载成功,开始更新,更新过程请不要刷新页面和进行其他操作..." >$START_LOG
|
||||
cat > /tmp/openclash_update.sh <<"EOF"
|
||||
#!/bin/sh
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
START_LOG="/tmp/openclash_start.log"
|
||||
LOG_FILE="/tmp/openclash.log"
|
||||
echo "正在卸载旧版本,更新过程请不要刷新页面和进行其他操作... ..." >$START_LOG
|
||||
opkg remove luci-app-openclash\
|
||||
&& echo "正在安装新版本,更新过程请不要刷新页面和进行其他操作 ..." >$START_LOG\
|
||||
&& opkg install /tmp/openclash.ipk
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "OpenClash 更新成功!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Update Successful" >>$LOG_FILE
|
||||
rm -rf /tmp/openclash.ipk >/dev/null 2>&1
|
||||
uci set openclash.config.update=0
|
||||
uci commit openclash
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "OpenClash 更新失败,文件保存在/tmp/openclash.ipk,请尝试手动更新!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Update Fail" >>$LOG_FILE
|
||||
uci set openclash.config.update=0
|
||||
uci commit openclash
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
EOF
|
||||
chmod 4755 /tmp/openclash_update.sh
|
||||
nohup /tmp/openclash_update.sh &
|
||||
else
|
||||
echo "OpenClash-$LAST_VER 下载失败,请检查网络或稍后再试!" >$START_LOG
|
||||
rm -rf /tmp/openclash.ipk >/dev/null 2>&1
|
||||
echo "${LOGTIME} OpenClash Update Error" >>$LOG_FILE
|
||||
uci set openclash.config.update=0
|
||||
uci commit openclash
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
elif [ ! -f "$LAST_OPVER" ]; then
|
||||
echo "获取版本信息失败,请稍后再试..." >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Version Check Error, Please Try Again After A few seconds" >>$LOG_FILE
|
||||
uci set openclash.config.update=0
|
||||
uci commit openclash
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "OpenClash 没有更新,停止继续操作!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Version No Change, Do Nothing" >>$LOG_FILE
|
||||
uci set openclash.config.update=0
|
||||
uci commit openclash
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
fi
|
||||
@ -1,22 +1,20 @@
|
||||
#!/bin/sh
|
||||
START_LOG="/tmp/openclash_start.log"
|
||||
CKTIME=$(date "+%Y-%m-%d-%H")
|
||||
LAST_OPVER="/tmp/openclash_last_version"
|
||||
version_url="https://github.com/vernesong/OpenClash/raw/master/version"
|
||||
echo "开始获取最新版本..." >$START_LOG
|
||||
wget-ssl --no-check-certificate --timeout=3 --tries=2 "$version_url" -O /tmp/openclash_last_version
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "版本获取成功..." >$START_LOG
|
||||
if [ -f /etc/openclash/openclash_version ]; then
|
||||
echo "对比版本信息..." >$START_LOG
|
||||
if [ "$(sed -n 1p /etc/openclash/openclash_version)" = "$(sed -n 1p /tmp/openclash_last_version)" ]; then
|
||||
echo "" >/tmp/openclash_last_version
|
||||
echo "本地已安装最新版本!" >$START_LOG
|
||||
sleep 10
|
||||
if [ "$CKTIME" != "$(grep "CheckTime" $LAST_OPVER 2>/dev/null |awk -F ':' '{print $2}')" ]; then
|
||||
wget-ssl --no-check-certificate --quiet --timeout=10 --tries=2 "$version_url" -O $LAST_OPVER
|
||||
if [ "$?" -eq "0" ] && [ "$(ls -l $LAST_OPVER 2>/dev/null |awk '{print int($5)}')" -gt 0 ]; then
|
||||
if [ "$(sed -n 1p /etc/openclash/openclash_version 2>/dev/null)" = "$(sed -n 1p $LAST_OPVER 2>/dev/null)" ]; then
|
||||
sed -i "/^https:/i\CheckTime:${CKTIME}" "$LAST_OPVER" 2>/dev/null
|
||||
sed -i '/^https:/,$d' $LAST_OPVER
|
||||
else
|
||||
sed -i "/^https:/i\CheckTime:${CKTIME}" "$LAST_OPVER" 2>/dev/null
|
||||
fi
|
||||
else
|
||||
rm -rf "$LAST_OPVER"
|
||||
fi
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "" >/tmp/openclash_last_version
|
||||
echo "版本获取失败,请稍后再试!" >$START_LOG
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
elif [ "$(sed -n 1p /etc/openclash/openclash_version 2>/dev/null)" = "$(sed -n 1p $LAST_OPVER 2>/dev/null)" ]; then
|
||||
sed -i '/^CheckTime:/,$d' $LAST_OPVER
|
||||
echo "CheckTime:$CKTIME" >>$LAST_OPVER
|
||||
fi
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
status=`ps|grep -c openclash_watchdog.sh`
|
||||
status=$(ps|grep -c openclash_watchdog.sh)
|
||||
[ "$status" -gt "3" ] && echo "another clash_watchdog.sh is running,exit "
|
||||
[ "$status" -gt "3" ] && exit 0
|
||||
|
||||
@ -14,5 +14,11 @@ if [ "$enable" -eq 1 ]; then
|
||||
/etc/init.d/openclash restart
|
||||
fi
|
||||
fi
|
||||
## Log File Size Manage:
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
LOGSIZE=`ls -l /tmp/openclash.log |awk '{print int($5/1024)}'`
|
||||
if [ "$LOGSIZE" -gt 90 ]; then
|
||||
echo "[$LOGTIME] Watchdog: Size Limit, Clean Up All Log Records." > /tmp/openclash.log
|
||||
fi
|
||||
sleep 60
|
||||
done 2>/dev/null
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
._1EnK5MMInH{width:100%;height:100%;display:flex;justify-content:center;align-items:center}._39z9L5I2ao{--color1:#ddd;--size:40px;width:var(--size);height:var(--size);margin:10px;background-color:var(--color1);border-radius:100%;-webkit-animation:_1DSWK2a-pe 1s ease-in-out infinite;animation:_1DSWK2a-pe 1s ease-in-out infinite}@-webkit-keyframes _1DSWK2a-pe{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}@keyframes _1DSWK2a-pe{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}
|
||||
._1rJPiLWN4s{position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden;padding:20px;background:var(--color-background);color:var(--color-text);text-align:center}._3h_IywJG1l{color:#2a477a;opacity:.6;display:flex;justify-content:center;padding:40px}.aXXDDfyTjE,._3h_IywJG1l{align-items:center}.aXXDDfyTjE{display:inline-flex;color:var(--color-text-secondary)}.aXXDDfyTjE:active,.aXXDDfyTjE:hover{color:#387cec}.aXXDDfyTjE svg{margin-right:5px}
|
||||
._30oJwXNik9{background:var(--color-bg-sidebar);position:relative}._1SsCcpJvxN{display:block}._2r8EkOI78X{display:flex;align-items:center;justify-content:center;padding:25px 0 15px;color:#2a477a;transition:color .3s ease-in-out}@media (max-width:768px){._2r8EkOI78X{padding:0}}._2r8EkOI78X:hover{-webkit-animation:_2KRqAfqV8c .3s ease-in-out 0s infinite alternate;animation:_2KRqAfqV8c .3s ease-in-out 0s infinite alternate}._2r8EkOI78X img{width:80px;height:80px}@-webkit-keyframes _2KRqAfqV8c{0%{color:#2a477a}to{color:#1f52ac}}@keyframes _2KRqAfqV8c{0%{color:#2a477a}to{color:#1f52ac}}@media (max-width:768px){._2vUQ0Hs_C5{display:flex;justify-content:space-between;overflow:scroll}}._8mEn9Wlw1n{color:var(--color-text);text-decoration:none;display:flex;align-items:center;padding:8px 20px}@media (max-width:768px){._8mEn9Wlw1n{flex-direction:column}}._8mEn9Wlw1n svg{color:var(--color-icon)}._1WyHmd6t6y{background:var(--color-sb-active-row-bg)}@media (max-width:768px){._1WyHmd6t6y{background:none;border-bottom:2px solid #387cec}}._2eMIYGbP9O{padding-left:14px}@media (max-width:768px){._2eMIYGbP9O{padding-left:0;padding-top:5px}}.nURY8qkFLS{--sz:50px;position:absolute;bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--sz);height:var(--sz);padding:20px 0;display:flex;justify-content:center;align-items:center}@media (max-width:768px){.nURY8qkFLS{display:none}}.nURY8qkFLS svg{display:block;color:var(--color-icon)}
|
||||
.SNYKRrv_2I{height:76px;display:flex;align-items:center}.VG1cD2OYvg{padding:0 40px;text-align:left;margin:0}
|
||||
._37kQcxVR4T{color:var(--color-text);display:flex;align-items:center}._1U3kUwas7v,.-Hr5Z5iYfF{padding-top:10px;padding-bottom:10px;width:200px}._1U3kUwas7v div:first-child,.-Hr5Z5iYfF div:first-child{color:var(--color-text-secondary)}._1U3kUwas7v div:nth-child(2),.-Hr5Z5iYfF div:nth-child(2){padding:10px 0 0;font-size:2em}.-Hr5Z5iYfF{padding-right:20px}._1U3kUwas7v{padding-left:20px}
|
||||
._2rN7aLQPCl{padding:10px 40px}
|
||||
._1u5AP7XMF9{padding:0 40px 5px}._2zeyKJDdFH{position:relative;height:40px}._3DQ7SXxKRA{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:0;width:100%}._1f-XUgRxH1{-webkit-appearance:none;background-color:var(--color-input-bg);background-image:none;border-radius:20px;border:1px solid var(--color-input-border);box-sizing:border-box;color:#c1c1c1;display:inline-block;font-size:inherit;height:40px;outline:none;padding:0 15px 0 35px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}._3PLtWxZwrd{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:10px}
|
||||
._2tpN_G7FeO{display:flex;align-items:center;flex-wrap:wrap;font-size:.9em;padding:10px}._3wuPHKqO5W{color:#eee;flex-shrink:0;text-align:center;width:66px;background:green;border-radius:5px;padding:3px 5px;margin:0 8px}.IwiVCclCSC{flex-shrink:0;color:#999;font-size:14px}._3I1beKAMFt{flex-shrink:0;display:flex;font-family:Roboto Mono,Menlo,monospace;align-items:center;padding:8px 0;width:100%;white-space:pre;overflow:auto}._2MDNI6JESq{margin:0;padding:0;color:var(--color-text)}._2MDNI6JESq li,._2MDNI6JESq li.even{background:var(--color-background)}._3KX1sKJ1QD{padding:10px 40px}._19_8g6kTIV{display:flex;flex-direction:column;align-items:center;justify-content:center;color:#2d2d30}._19_8g6kTIV div:nth-child(2){color:var(--color-text-secondary);font-size:1.4em;opacity:.6}._3ljFcrWmBC{opacity:.3}
|
||||
input.nJQwngxVo8[type=checkbox]{--white:#fff;--grey:#d3d3d3;--color-theme:#047aff;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;background-color:darken(var(--white),2%);border:1px solid var(--grey);border-radius:26px;box-shadow:inset 0 0 0 1px var(--grey);cursor:pointer;height:28px;position:relative;transition:border .25s .15s,box-shadow .25s .3s,padding .25s;width:44px;vertical-align:top}input.nJQwngxVo8[type=checkbox]:after{background-color:var(--white);border:1px solid var(--grey);border-radius:24px;box-shadow:inset 0 -3px 3px rgba(0,0,0,.025),0 1px 4px rgba(0,0,0,.15),0 4px 4px rgba(0,0,0,.1);content:"";display:block;height:26px;left:0;position:absolute;right:16px;top:0;transition:border .25s .15s,left .25s .1s,right .15s .175s}input.nJQwngxVo8[type=checkbox]:checked{border-color:var(--color-theme);box-shadow:inset 0 0 0 13px var(--color-theme);padding-left:18px;transition:border .25s,box-shadow .25s,padding .25s .15s}input.nJQwngxVo8[type=checkbox]:checked:after{border-color:var(--color-theme);left:16px;right:0;transition:border .25s,left .15s .25s,right .25s .175s}
|
||||
._3evbv-Ui87{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid #525252;color:var(--color-text);background:var(--color-toggle-bg);display:flex;position:relative}._3evbv-Ui87 input{position:absolute;left:0;opacity:0}._3evbv-Ui87 label{flex:1;z-index:2;display:flex;align-items:center;justify-content:center;padding:10px 0;cursor:pointer}._1ok8KIb1RH{z-index:1;position:absolute;display:block;left:0;height:100%;transition:left .2s ease-out;background:var(--color-toggle-selected)}
|
||||
._2S85tjFa1n{-webkit-appearance:none;background-color:var(--color-input-bg);background-image:none;border-radius:4px;border:1px solid var(--color-input-border);box-sizing:border-box;color:#c1c1c1;display:inline-block;font-size:inherit;height:40px;outline:none;padding:0 15px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}._2S85tjFa1n:focus{border-color:var(--color-focus-blue)}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
|
||||
._2A0HoxnDqc{-webkit-appearance:none;outline:none;color:var(--color-btn-fg);background:var(--color-btn-bg);border:1px solid #555;border-radius:100px;padding:6px 12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._2A0HoxnDqc:focus{border-color:var(--color-focus-blue)}._2A0HoxnDqc:hover{background:#387cec;border:1px solid #387cec;color:#fff}._2A0HoxnDqc:active{-webkit-transform:scale(.97);transform:scale(.97)}
|
||||
._2id19fefQX{display:flex;flex-wrap:wrap}._2QQQyNTKoG{flex-grow:0;flex-wrap:0;margin-right:10px;margin-bottom:10px;cursor:pointer;border:2px solid transparent}.XJkW0wZSAx{border-color:#387cec}
|
||||
._2OZZRrEL0J{padding:10px 40px 40px}._2OZZRrEL0J>div{width:360px}.lF_ZoyIdZN{padding:10px 40px 40px}.VduFBb2hWX{padding:0 40px}.VduFBb2hWX>div{border-top:1px dashed #373737}._2NQoBOQcGA{padding:16px 0}
|
||||
.ctrHyq7uir{position:fixed;top:0;right:0;left:0;bottom:0;background:#444;z-index:1024}._17mHpKiOUD{outline:none;position:absolute;color:#ddd;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background:#444;padding:20px;border-radius:10px}
|
||||
._1r-KsYFNaj{position:relative;padding:10px 0}._1r-KsYFNaj input{-webkit-appearance:none;background-color:transparent;background-image:none;border:none;border-radius:0;border-bottom:1px solid var(--color-input-border);box-sizing:border-box;color:#c1c1c1;display:inline-block;font-size:inherit;height:40px;outline:none;padding:0 8px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}._1r-KsYFNaj input:focus{border-color:var(--color-focus-blue)}._1r-KsYFNaj label{position:absolute;left:8px;bottom:22px;transition:-webkit-transform .15s ease-in-out;transition:transform .15s ease-in-out;transition:transform .15s ease-in-out,-webkit-transform .15s ease-in-out;-webkit-transform-origin:0 0;transform-origin:0 0}._1r-KsYFNaj input:focus+label,._1r-KsYFNaj label.Hn6h5kxOg7{-webkit-transform:scale(.75) translateY(-25px);transform:scale(.75) translateY(-25px)}._1r-KsYFNaj input:focus+label{color:var(--color-focus-blue)}
|
||||
._3hz7LVhvUv:focus{outline:none}._3HF-KB9mgO{display:flex;justify-content:center;align-items:center}._3HF-KB9mgO ._3HzgPICn91{color:#2d2d30;opacity:.4;transition:opacity .4s}._3HF-KB9mgO ._3HzgPICn91:hover{opacity:.7}._1wpZuvoD5I{padding:30px 0 10px}.L7jTy-EFJ2{display:flex}.L7jTy-EFJ2 div{flex:1 1 auto}.L7jTy-EFJ2 div:nth-child(2){flex-grow:0;flex-basis:120px;margin-left:10px}._2fehqRU9GV{padding:30px 0 10px;display:flex;justify-content:flex-end;align-items:center}
|
||||
._3D3ZNp4oBz{background:none;position:fixed;top:0;bottom:0;left:0;right:0;-webkit-transform:none;transform:none;padding:0;border-radius:0}.tgH3yv-xGR{position:absolute;top:10%;left:50%;-webkit-transform:translate(-50%);transform:translate(-50%);max-width:376px;margin:0 auto}._3MMuzHtwZL{background:#222}
|
||||
@font-face{font-family:Roboto Mono;font-style:normal;font-weight:400;src:local("Roboto Mono"),local("RobotoMono-Regular"),url(https://cdn.jsdelivr.net/npm/@hsjs/fonts@0.0.1/robotomono/v5/L0x5DF4xlVMF-BfR8bXMIjhLq3-cXbKD.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}.border-bottom,.border-left,.border-top{position:relative}.border-top:before{top:0}.border-bottom:after,.border-top:before{position:absolute;content:"";height:1px;width:100%;-webkit-transform:scaleY(.5) translateZ(0);transform:scaleY(.5) translateZ(0);left:0;right:0;background:#555}.border-bottom:after{bottom:0}.border-left:before{position:absolute;content:"";height:100%;width:1px;-webkit-transform:scaleX(.5) translateZ(0);transform:scaleX(.5) translateZ(0);top:0;bottom:0;background:#555;left:0}*,:after,:before{box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,PingFang SC,Microsoft YaHei,微软雅黑;margin:0;padding:0;--color-focus-blue:#1a73e8}body,body.dark{--color-background:#202020;--color-text:#ddd;--color-text-secondary:#ccc;--color-bg-sidebar:#2d2d30;--color-sb-active-row-bg:#494b4e;--color-input-bg:#2d2d30;--color-input-border:#3f3f3f;--color-toggle-bg:#353535;--color-toggle-selected:#181818;--color-icon:#c7c7c7;--color-btn-bg:#232323;--color-btn-fg:#bebebe}body.light{--color-background:#fbfbfb;--color-text:#222;--color-text-secondary:#646464;--color-bg-sidebar:#e7e7e7;--color-sb-active-row-bg:#d0d0d0;--color-input-bg:#fff;--color-input-border:silver;--color-toggle-bg:#fff;--color-toggle-selected:#d7d7d7;--color-icon:#5b5b5b;--color-btn-bg:#f4f4f4;--color-btn-fg:#101010}
|
||||
._35EMVy62Je{display:flex;background:var(--color-background);color:var(--color-text);min-height:300px;height:100vh}@media (max-width:768px){._35EMVy62Je{flex-direction:column}}.AwL8oIubvP{flex-grow:1;overflow:auto}
|
||||
@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{RnhZ:function(s,j,a){var e={"./af":"K/tc","./af.js":"K/tc","./ar":"jnO4","./ar-dz":"o1bE","./ar-dz.js":"o1bE","./ar-kw":"Qj4J","./ar-kw.js":"Qj4J","./ar-ly":"HP3h","./ar-ly.js":"HP3h","./ar-ma":"CoRJ","./ar-ma.js":"CoRJ","./ar-sa":"gjCT","./ar-sa.js":"gjCT","./ar-tn":"bYM6","./ar-tn.js":"bYM6","./ar.js":"jnO4","./az":"SFxW","./az.js":"SFxW","./be":"H8ED","./be.js":"H8ED","./bg":"hKrs","./bg.js":"hKrs","./bm":"p/rL","./bm.js":"p/rL","./bn":"kEOa","./bn.js":"kEOa","./bo":"0mo+","./bo.js":"0mo+","./br":"aIdf","./br.js":"aIdf","./bs":"JVSJ","./bs.js":"JVSJ","./ca":"1xZ4","./ca.js":"1xZ4","./cs":"PA2r","./cs.js":"PA2r","./cv":"A+xa","./cv.js":"A+xa","./cy":"l5ep","./cy.js":"l5ep","./da":"DxQv","./da.js":"DxQv","./de":"tGlX","./de-at":"s+uk","./de-at.js":"s+uk","./de-ch":"u3GI","./de-ch.js":"u3GI","./de.js":"tGlX","./dv":"WYrj","./dv.js":"WYrj","./el":"jUeY","./el.js":"jUeY","./en-SG":"zavE","./en-SG.js":"zavE","./en-au":"Dmvi","./en-au.js":"Dmvi","./en-ca":"OIYi","./en-ca.js":"OIYi","./en-gb":"Oaa7","./en-gb.js":"Oaa7","./en-ie":"4dOw","./en-ie.js":"4dOw","./en-il":"czMo","./en-il.js":"czMo","./en-nz":"b1Dy","./en-nz.js":"b1Dy","./eo":"Zduo","./eo.js":"Zduo","./es":"iYuL","./es-do":"CjzT","./es-do.js":"CjzT","./es-us":"Vclq","./es-us.js":"Vclq","./es.js":"iYuL","./et":"7BjC","./et.js":"7BjC","./eu":"D/JM","./eu.js":"D/JM","./fa":"jfSC","./fa.js":"jfSC","./fi":"gekB","./fi.js":"gekB","./fo":"ByF4","./fo.js":"ByF4","./fr":"nyYc","./fr-ca":"2fjn","./fr-ca.js":"2fjn","./fr-ch":"Dkky","./fr-ch.js":"Dkky","./fr.js":"nyYc","./fy":"cRix","./fy.js":"cRix","./ga":"USCx","./ga.js":"USCx","./gd":"9rRi","./gd.js":"9rRi","./gl":"iEDd","./gl.js":"iEDd","./gom-latn":"DKr+","./gom-latn.js":"DKr+","./gu":"4MV3","./gu.js":"4MV3","./he":"x6pH","./he.js":"x6pH","./hi":"3E1r","./hi.js":"3E1r","./hr":"S6ln","./hr.js":"S6ln","./hu":"WxRl","./hu.js":"WxRl","./hy-am":"1rYy","./hy-am.js":"1rYy","./id":"UDhR","./id.js":"UDhR","./is":"BVg3","./is.js":"BVg3","./it":"bpih","./it-ch":"bxKX","./it-ch.js":"bxKX","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./jv":"tUCv","./jv.js":"tUCv","./ka":"IBtZ","./ka.js":"IBtZ","./kk":"bXm7","./kk.js":"bXm7","./km":"6B0Y","./km.js":"6B0Y","./kn":"PpIw","./kn.js":"PpIw","./ko":"Ivi+","./ko.js":"Ivi+","./ku":"JCF/","./ku.js":"JCF/","./ky":"lgnt","./ky.js":"lgnt","./lb":"RAwQ","./lb.js":"RAwQ","./lo":"sp3z","./lo.js":"sp3z","./lt":"JvlW","./lt.js":"JvlW","./lv":"uXwI","./lv.js":"uXwI","./me":"KTz0","./me.js":"KTz0","./mi":"aIsn","./mi.js":"aIsn","./mk":"aQkU","./mk.js":"aQkU","./ml":"AvvY","./ml.js":"AvvY","./mn":"lYtQ","./mn.js":"lYtQ","./mr":"Ob0Z","./mr.js":"Ob0Z","./ms":"6+QB","./ms-my":"ZAMP","./ms-my.js":"ZAMP","./ms.js":"6+QB","./mt":"G0Uy","./mt.js":"G0Uy","./my":"honF","./my.js":"honF","./nb":"bOMt","./nb.js":"bOMt","./ne":"OjkT","./ne.js":"OjkT","./nl":"+s0g","./nl-be":"2ykv","./nl-be.js":"2ykv","./nl.js":"+s0g","./nn":"uEye","./nn.js":"uEye","./pa-in":"8/+R","./pa-in.js":"8/+R","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ro":"lyxo","./ro.js":"lyxo","./ru":"lXzo","./ru.js":"lXzo","./sd":"Z4QM","./sd.js":"Z4QM","./se":"//9w","./se.js":"//9w","./si":"7aV9","./si.js":"7aV9","./sk":"e+ae","./sk.js":"e+ae","./sl":"gVVK","./sl.js":"gVVK","./sq":"yPMs","./sq.js":"yPMs","./sr":"zx6S","./sr-cyrl":"E+lV","./sr-cyrl.js":"E+lV","./sr.js":"zx6S","./ss":"Ur1D","./ss.js":"Ur1D","./sv":"X709","./sv.js":"X709","./sw":"dNwA","./sw.js":"dNwA","./ta":"PeUW","./ta.js":"PeUW","./te":"XLvN","./te.js":"XLvN","./tet":"V2x9","./tet.js":"V2x9","./tg":"Oxv6","./tg.js":"Oxv6","./th":"EOgW","./th.js":"EOgW","./tl-ph":"Dzi0","./tl-ph.js":"Dzi0","./tlh":"z3Vd","./tlh.js":"z3Vd","./tr":"DoHr","./tr.js":"DoHr","./tzl":"z1FC","./tzl.js":"z1FC","./tzm":"wQk9","./tzm-latn":"tT3J","./tzm-latn.js":"tT3J","./tzm.js":"wQk9","./ug-cn":"YRex","./ug-cn.js":"YRex","./uk":"raLr","./uk.js":"raLr","./ur":"UpQW","./ur.js":"UpQW","./uz":"Loxo","./uz-latn":"AQ68","./uz-latn.js":"AQ68","./uz.js":"Loxo","./vi":"KSF8","./vi.js":"KSF8","./x-pseudo":"/X5v","./x-pseudo.js":"/X5v","./yo":"fzPg","./yo.js":"fzPg","./zh-cn":"XDpg","./zh-cn.js":"XDpg","./zh-hk":"SatO","./zh-hk.js":"SatO","./zh-tw":"kOpN","./zh-tw.js":"kOpN"};function n(s){var j=r(s);return a(j)}function r(s){if(!a.o(e,s)){var j=new Error("Cannot find module '"+s+"'");throw j.code="MODULE_NOT_FOUND",j}return e[s]}n.keys=function(){return Object.keys(e)},n.resolve=r,s.exports=n,n.id="RnhZ"}}]);
|
||||
@ -1 +0,0 @@
|
||||
[0522/053329.127:ERROR:crash_report_database_win.cc(428)] unexpected header
|
||||
@ -1,4 +0,0 @@
|
||||
._2V-RqIAl7n{border-radius:20px;margin:10px 0;padding:3px 0;color:#eee}
|
||||
.NpfXwxWAxo{position:relative;height:90px}._250hnPTi2J{position:absolute;bottom:0;left:20%;display:flex;align-items:center;justify-content:center}._28H2QsOrtc{position:absolute;top:0;left:0;width:100%;height:100%}._3kdi5nima5{width:100%;padding-right:20px;overflow:hidden;text-overflow:ellipsis;margin:10px 0;font-size:1.1em}
|
||||
._3PCSxT0l14>h2{margin-top:0}._3PCSxT0l14>h2 span:nth-child(2){font-size:12px;color:#777;font-weight:400;margin:0 .3em}._1yYRIyvlRd{display:flex;flex-wrap:wrap}._1OcDlvlM5R{width:300px;padding:10px 5px;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out}._1OcDlvlM5R._3oAxPKtZFv{cursor:pointer}._1OcDlvlM5R._3oAxPKtZFv:hover{-webkit-transform:scale(1.1);transform:scale(1.1)}
|
||||
._1myfcMimT9{padding:10px 40px}._1khaX45NQe{position:fixed;right:20px;bottom:20px}
|
||||
@ -1,2 +0,0 @@
|
||||
._3eSLieOhVX{display:flex;align-items:center;padding:10px 40px}._2n1pW09UvV{width:40px;padding-right:15px;color:var(--color-text-secondary);opacity:.4}.t1XJIwvW7A{display:flex;align-items:center;font-size:12px;opacity:.8}._1fNf8kj0HA{padding:10px 0;font-family:Roboto Mono,Menlo,monospace;font-size:19px}._3yJmN0tON0{width:110px}
|
||||
._2Tux7NhweE{position:fixed;right:20px;bottom:20px}
|
||||
@ -1 +0,0 @@
|
||||
!function(e){function t(t){for(var n,o,u=t[0],i=t[1],f=t[2],l=0,d=[];l<u.length;l++)o=u[l],a[o]&&d.push(a[o][0]),a[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(s&&s(t);d.length;)d.shift()();return c.push.apply(c,f||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,o=1;o<r.length;o++){var i=r[o];0!==a[i]&&(n=!1)}n&&(c.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={5:0},a={5:0},c=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{2:1,4:1}[e]&&t.push(o[e]=new Promise(function(t,r){for(var n=({1:"chartjs",2:"proxies",4:"rules",7:"vendors~chartjs"}[e]||e)+"."+{1:"3492c684ba7d8497de04",2:"462629c0ce55931a9066",4:"0051e218ebc63aef81f1",7:"60c4bfacb0e342e6819f",8:"c1eaea41bb4791c0be2b"}[e]+".css",a=u.p+n,c=document.getElementsByTagName("link"),i=0;i<c.length;i++){var f=(s=c[i]).getAttribute("data-href")||s.getAttribute("href");if("stylesheet"===s.rel&&(f===n||f===a))return t()}var l=document.getElementsByTagName("style");for(i=0;i<l.length;i++){var s;if((f=(s=l[i]).getAttribute("data-href"))===n||f===a)return t()}var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onload=t,d.onerror=function(t){var n=t&&t.target&&t.target.src||a,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.code="CSS_CHUNK_LOAD_FAILED",c.request=n,delete o[e],d.parentNode.removeChild(d),r(c)},d.href=a,document.getElementsByTagName("head")[0].appendChild(d)}).then(function(){o[e]=0}));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise(function(t,n){r=a[e]=[t,n]});t.push(r[2]=n);var c,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+""+({1:"chartjs",2:"proxies",4:"rules",7:"vendors~chartjs"}[e]||e)+"."+{1:"707c4e7f2cfb4dfd187a",2:"687ac8f8aaa8ce3509ca",4:"a68d49f3a80e76d735e1",7:"c9231179be225dfb8564",8:"45fc79574f18cfbcc680"}[e]+".js"}(e),c=function(t){i.onerror=i.onload=null,clearTimeout(f);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src,c=new Error("Loading chunk "+e+" failed.\n("+n+": "+o+")");c.type=n,c.request=o,r[1](c)}a[e]=void 0}};var f=setTimeout(function(){c({type:"timeout",target:i})},12e4);i.onerror=i.onload=c,document.head.appendChild(i)}return Promise.all(t)},u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="",u.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],f=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var s=f;r()}([]);
|
||||
@ -1 +0,0 @@
|
||||
/*! modern-normalize | MIT License | https://github.com/sindresorhus/modern-normalize */html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}hr{height:0}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{padding:0}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}
|
||||
@ -0,0 +1 @@
|
||||
yacd.haishan.me
|
||||
@ -0,0 +1,21 @@
|
||||
/*! modern-normalize | MIT License | https://github.com/sindresorhus/modern-normalize */html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}:root{-moz-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}hr{height:0}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{padding:0}progress{vertical-align:initial}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}
|
||||
._1EnK5MMInH{width:100%;height:100%;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center}._39z9L5I2ao{--color1:#ddd;--size:40px;width:var(--size);height:var(--size);margin:10px;background-color:var(--color1);border-radius:100%;-webkit-animation:_1DSWK2a-pe 1s ease-in-out infinite;animation:_1DSWK2a-pe 1s ease-in-out infinite}@-webkit-keyframes _1DSWK2a-pe{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}@keyframes _1DSWK2a-pe{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}
|
||||
._1rJPiLWN4s{position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden;padding:20px;background:var(--color-background);color:var(--color-text);text-align:center}._3h_IywJG1l{color:#2a477a;opacity:.6;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;padding:40px}.aXXDDfyTjE,._3h_IywJG1l{-webkit-box-align:center;align-items:center}.aXXDDfyTjE{display:-webkit-inline-box;display:inline-flex;color:var(--color-text-secondary)}.aXXDDfyTjE:active,.aXXDDfyTjE:hover{color:#387cec}.aXXDDfyTjE svg{margin-right:5px}
|
||||
._30oJwXNik9{background:var(--color-bg-sidebar);position:relative}._1SsCcpJvxN{display:block}._2r8EkOI78X{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;padding:25px 0 15px;color:#2a477a;-webkit-transition:color .3s ease-in-out;transition:color .3s ease-in-out}@media (max-width:768px){._2r8EkOI78X{display:none}}._2r8EkOI78X:hover{-webkit-animation:_2KRqAfqV8c .3s ease-in-out 0s infinite alternate;animation:_2KRqAfqV8c .3s ease-in-out 0s infinite alternate}._2r8EkOI78X img{width:80px;height:80px}@-webkit-keyframes _2KRqAfqV8c{0%{color:#2a477a}to{color:#1f52ac}}@keyframes _2KRqAfqV8c{0%{color:#2a477a}to{color:#1f52ac}}@media (max-width:768px){._2vUQ0Hs_C5{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;overflow:scroll}}._8mEn9Wlw1n{color:var(--color-text);text-decoration:none;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;padding:8px 20px}@media (max-width:768px){._8mEn9Wlw1n{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}._8mEn9Wlw1n svg{color:var(--color-icon)}._1WyHmd6t6y{background:var(--color-sb-active-row-bg)}@media (max-width:768px){._1WyHmd6t6y{background:none;border-bottom:2px solid #387cec}}._2eMIYGbP9O{padding-left:14px}@media (max-width:768px){._2eMIYGbP9O{padding-left:0;padding-top:5px}}.nURY8qkFLS{--sz:50px;position:absolute;bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--sz);height:var(--sz);padding:20px 0;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center}@media (max-width:768px){.nURY8qkFLS{display:none}}.nURY8qkFLS svg{display:block;color:var(--color-icon)}
|
||||
.SNYKRrv_2I{height:76px;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.VG1cD2OYvg{padding:0 40px;text-align:left;margin:0}
|
||||
._37kQcxVR4T{color:var(--color-text);display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}._1U3kUwas7v,.-Hr5Z5iYfF{padding-top:10px;padding-bottom:10px;width:200px}._1U3kUwas7v div:first-child,.-Hr5Z5iYfF div:first-child{color:var(--color-text-secondary)}._1U3kUwas7v div:nth-child(2),.-Hr5Z5iYfF div:nth-child(2){padding:10px 0 0;font-size:2em}.-Hr5Z5iYfF{padding-right:20px}._1U3kUwas7v{padding-left:20px}
|
||||
._2rN7aLQPCl{padding:10px 40px}
|
||||
._1u5AP7XMF9{padding:0 40px 5px}._2zeyKJDdFH{position:relative;height:40px}._3DQ7SXxKRA{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:0;width:100%}._1f-XUgRxH1{-webkit-appearance:none;background-color:var(--color-input-bg);background-image:none;border-radius:20px;border:1px solid var(--color-input-border);box-sizing:border-box;color:#c1c1c1;display:inline-block;font-size:inherit;height:40px;outline:none;padding:0 15px 0 35px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}._3PLtWxZwrd{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:10px}
|
||||
._2tpN_G7FeO{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;flex-wrap:wrap;font-size:.9em;padding:10px}._3wuPHKqO5W{color:#eee;flex-shrink:0;text-align:center;width:66px;background:green;border-radius:5px;padding:3px 5px;margin:0 8px}.IwiVCclCSC{flex-shrink:0;color:#999;font-size:14px}._3I1beKAMFt{flex-shrink:0;display:-webkit-box;display:flex;font-family:Roboto Mono,Menlo,monospace;-webkit-box-align:center;align-items:center;padding:8px 0;width:100%;white-space:pre;overflow:auto}._2MDNI6JESq{margin:0;padding:0;color:var(--color-text)}._2MDNI6JESq li,._2MDNI6JESq li.even{background:var(--color-background)}._3KX1sKJ1QD{padding:10px 40px}._19_8g6kTIV{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;color:#2d2d30}._19_8g6kTIV div:nth-child(2){color:var(--color-text-secondary);font-size:1.4em;opacity:.6}._3ljFcrWmBC{opacity:.3}
|
||||
input.nJQwngxVo8[type=checkbox]{--white:#fff;--grey:#d3d3d3;--color-theme:#047aff;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;background-color:darken(var(--white),2%);border:1px solid var(--grey);border-radius:26px;box-shadow:inset 0 0 0 1px var(--grey);cursor:pointer;height:28px;position:relative;-webkit-transition:border .25s .15s,box-shadow .25s .3s,padding .25s;transition:border .25s .15s,box-shadow .25s .3s,padding .25s;width:44px;vertical-align:top}input.nJQwngxVo8[type=checkbox]:after{background-color:var(--white);border:1px solid var(--grey);border-radius:24px;box-shadow:inset 0 -3px 3px rgba(0,0,0,.025),0 1px 4px rgba(0,0,0,.15),0 4px 4px rgba(0,0,0,.1);content:"";display:block;height:26px;left:0;position:absolute;right:16px;top:0;-webkit-transition:border .25s .15s,left .25s .1s,right .15s .175s;transition:border .25s .15s,left .25s .1s,right .15s .175s}input.nJQwngxVo8[type=checkbox]:checked{border-color:var(--color-theme);box-shadow:inset 0 0 0 13px var(--color-theme);padding-left:18px;-webkit-transition:border .25s,box-shadow .25s,padding .25s .15s;transition:border .25s,box-shadow .25s,padding .25s .15s}input.nJQwngxVo8[type=checkbox]:checked:after{border-color:var(--color-theme);left:16px;right:0;-webkit-transition:border .25s,left .15s .25s,right .25s .175s;transition:border .25s,left .15s .25s,right .25s .175s}
|
||||
._3evbv-Ui87{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid #525252;color:var(--color-text);background:var(--color-toggle-bg);display:-webkit-box;display:flex;position:relative}._3evbv-Ui87 input{position:absolute;left:0;opacity:0}._3evbv-Ui87 label{-webkit-box-flex:1;flex:1;z-index:2;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;padding:10px 0;cursor:pointer}._1ok8KIb1RH{z-index:1;position:absolute;display:block;left:0;height:100%;-webkit-transition:left .2s ease-out;transition:left .2s ease-out;background:var(--color-toggle-selected)}
|
||||
._2S85tjFa1n{-webkit-appearance:none;background-color:var(--color-input-bg);background-image:none;border-radius:4px;border:1px solid var(--color-input-border);box-sizing:border-box;color:#c1c1c1;display:inline-block;font-size:inherit;height:40px;outline:none;padding:0 15px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}._2S85tjFa1n:focus{border-color:var(--color-focus-blue)}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
|
||||
._2A0HoxnDqc{-webkit-appearance:none;outline:none;color:var(--color-btn-fg);background:var(--color-btn-bg);border:1px solid #555;border-radius:100px;padding:6px 12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._2A0HoxnDqc:focus{border-color:var(--color-focus-blue)}._2A0HoxnDqc:hover{background:#387cec;border:1px solid #387cec;color:#fff}._2A0HoxnDqc:active{-webkit-transform:scale(.97);transform:scale(.97)}
|
||||
._2id19fefQX{display:-webkit-box;display:flex;flex-wrap:wrap}._2QQQyNTKoG{-webkit-box-flex:0;flex-grow:0;margin-right:10px;margin-bottom:10px;cursor:pointer;border:2px solid transparent}.XJkW0wZSAx{border-color:#387cec}
|
||||
._2OZZRrEL0J{padding:10px 40px 40px}._2OZZRrEL0J>div{width:360px}.lF_ZoyIdZN{padding:10px 40px 40px}.VduFBb2hWX{padding:0 40px}.VduFBb2hWX>div{border-top:1px dashed #373737}._2NQoBOQcGA{padding:16px 0}
|
||||
.ctrHyq7uir{position:fixed;top:0;right:0;left:0;bottom:0;background:#444;z-index:1024}._17mHpKiOUD{outline:none;position:absolute;color:#ddd;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background:#444;padding:20px;border-radius:10px}
|
||||
._1r-KsYFNaj{position:relative;padding:10px 0}._1r-KsYFNaj input{-webkit-appearance:none;background-color:initial;background-image:none;border:none;border-radius:0;border-bottom:1px solid var(--color-input-border);box-sizing:border-box;color:#c1c1c1;display:inline-block;font-size:inherit;height:40px;outline:none;padding:0 8px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}._1r-KsYFNaj input:focus{border-color:var(--color-focus-blue)}._1r-KsYFNaj label{position:absolute;left:8px;bottom:22px;-webkit-transition:-webkit-transform .15s ease-in-out;transition:-webkit-transform .15s ease-in-out;transition:transform .15s ease-in-out;transition:transform .15s ease-in-out,-webkit-transform .15s ease-in-out;-webkit-transform-origin:0 0;transform-origin:0 0}._1r-KsYFNaj input:focus+label,._1r-KsYFNaj label.Hn6h5kxOg7{-webkit-transform:scale(.75) translateY(-25px);transform:scale(.75) translateY(-25px)}._1r-KsYFNaj input:focus+label{color:var(--color-focus-blue)}
|
||||
._3hz7LVhvUv:focus{outline:none}._3HF-KB9mgO{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center}._3HF-KB9mgO ._3HzgPICn91{color:#2d2d30;opacity:.4;-webkit-transition:opacity .4s;transition:opacity .4s}._3HF-KB9mgO ._3HzgPICn91:hover{opacity:.7}._1wpZuvoD5I{padding:30px 0 10px}.L7jTy-EFJ2{display:-webkit-box;display:flex}.L7jTy-EFJ2 div{-webkit-box-flex:1;flex:1 1 auto}.L7jTy-EFJ2 div:nth-child(2){-webkit-box-flex:0;flex-grow:0;flex-basis:120px;margin-left:10px}._2fehqRU9GV{padding:30px 0 10px;display:-webkit-box;display:flex;-webkit-box-pack:end;justify-content:flex-end;-webkit-box-align:center;align-items:center}
|
||||
._3D3ZNp4oBz{background:none;position:fixed;top:0;bottom:0;left:0;right:0;-webkit-transform:none;transform:none;padding:0;border-radius:0}.tgH3yv-xGR{position:absolute;top:10%;left:50%;-webkit-transform:translate(-50%);transform:translate(-50%);max-width:376px;margin:0 auto}._3MMuzHtwZL{background:#222}
|
||||
@font-face{font-family:Roboto Mono;font-style:normal;font-weight:400;src:local("Roboto Mono"),local("RobotoMono-Regular"),url(https://cdn.jsdelivr.net/npm/@hsjs/fonts@0.0.1/robotomono/v5/L0x5DF4xlVMF-BfR8bXMIjhLq3-cXbKD.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}.border-bottom,.border-left,.border-top{position:relative}.border-top:before{top:0}.border-bottom:after,.border-top:before{position:absolute;content:"";height:1px;width:100%;-webkit-transform:scaleY(.5) translateZ(0);transform:scaleY(.5) translateZ(0);left:0;right:0;background:#555}.border-bottom:after{bottom:0}.border-left:before{position:absolute;content:"";height:100%;width:1px;-webkit-transform:scaleX(.5) translateZ(0);transform:scaleX(.5) translateZ(0);top:0;bottom:0;background:#555;left:0}*,:after,:before{box-sizing:border-box}:root{--font-mono:"Roboto Mono",Menlo,monospace;--color-focus-blue:#1a73e8}body{font-family:Merriweather Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,PingFang SC,Microsoft YaHei,微软雅黑;margin:0;padding:0}body,body.dark{--color-background:#202020;--color-text:#ddd;--color-text-secondary:#ccc;--color-bg-sidebar:#2d2d30;--color-sb-active-row-bg:#494b4e;--color-input-bg:#2d2d30;--color-input-border:#3f3f3f;--color-toggle-bg:#353535;--color-toggle-selected:#181818;--color-icon:#c7c7c7;--color-btn-bg:#232323;--color-btn-fg:#bebebe;--color-bg-proxy-selected:#303030}body.light{--color-background:#fbfbfb;--color-text:#222;--color-text-secondary:#646464;--color-bg-sidebar:#e7e7e7;--color-sb-active-row-bg:#d0d0d0;--color-input-bg:#fff;--color-input-border:silver;--color-toggle-bg:#fff;--color-toggle-selected:#d7d7d7;--color-icon:#5b5b5b;--color-btn-bg:#f4f4f4;--color-btn-fg:#101010;--color-bg-proxy-selected:#cfcfcf}
|
||||
._35EMVy62Je{display:-webkit-box;display:flex;background:var(--color-background);color:var(--color-text);min-height:300px;height:100vh}@media (max-width:768px){._35EMVy62Je{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}.AwL8oIubvP{-webkit-box-flex:1;flex-grow:1;overflow:auto}
|
||||
@ -7,33 +7,34 @@
|
||||
<link rel="icon" type="image/png" sizes="128x128" href="yacd-128.png">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name=viewport content="width=device-width, initial-scale=1">
|
||||
<meta name="application-name" content="Clash Dashboard">
|
||||
<meta name="description" content="Clash Dashboard">
|
||||
<meta name="application-name" content="yacd">
|
||||
<meta name="description" content="Yet Another Clash Dashboard">
|
||||
<meta name="theme-color" content="#202020">
|
||||
<title>Clash Dashboard</title>
|
||||
<title>yacd - Yet Another Clash Dashboard</title>
|
||||
<link rel="prefetch" href="https://cdn.jsdelivr.net/npm/@hsjs/fonts@0.0.1/robotomono/v5/L0x5DF4xlVMF-BfR8bXMIjhLq3-cXbKD.woff2">
|
||||
<link rel="prefetch" href="https://fonts.loli.net/css?family=Merriweather+Sans:400,700&display=swap" rel="stylesheet">
|
||||
<meta property="og:image" content="https://user-images.githubusercontent.com/1166872/47304841-536f3d80-d65a-11e8-8908-1917127dafc5.png">
|
||||
<meta property="og:site_name" content="yacd">
|
||||
<meta property="og:type" content="object">
|
||||
<meta property="og:description" content="Clash Dashboard">
|
||||
<meta property="og:title" content="yacd">
|
||||
<meta property="og:url" content="http://yacd.haishan.me">
|
||||
<meta property="og:description" content="Yet Another Clash Dashboard">
|
||||
|
||||
|
||||
<link href="vendors~app.31d7bcb28b9aaba65968.css" rel="stylesheet">
|
||||
|
||||
<link href="app.0a46527a296fe87c6f7a.css" rel="stylesheet">
|
||||
<link href="app.5a1265735d78e67da9fe.css" rel="stylesheet">
|
||||
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
|
||||
<script src="runtime~app.ebef38faf2aa388ee472.js" type="text/javascript"></script>
|
||||
<script src="runtime~app.dc7b6d94c7fe054b4bce.js" type="text/javascript"></script>
|
||||
|
||||
<script src="react~app.2889399d0f29b961e8c2.js" type="text/javascript"></script>
|
||||
<script src="core-js~app.b0e192aa2040bbc66d02.js" type="text/javascript"></script>
|
||||
|
||||
<script src="vendors~app.3aefabaae8e43cd5bd7f.js" type="text/javascript"></script>
|
||||
<script src="react~app.6097406f382313d294e3.js" type="text/javascript"></script>
|
||||
|
||||
<script src="app.9b891454b1d74a441519.js" type="text/javascript"></script>
|
||||
<script src="app.6cc7f04cc66718dd2c90.js" type="text/javascript"></script>
|
||||
|
||||
|
||||
</body>
|
||||
@ -0,0 +1,4 @@
|
||||
._2V-RqIAl7n{border-radius:20px;padding:3px 0;color:#eee}
|
||||
.NpfXwxWAxo{position:relative;padding:10px;border-radius:10px;background-color:var(--color-bg-proxy-selected)}.NpfXwxWAxo._2zD7drviYH{background-color:var(--color-focus-blue);color:#ddd}._1rVl-Kdmss{font-family:var(--font-mono)}._3kdi5nima5{width:100%;overflow:hidden;text-overflow:ellipsis;margin-bottom:5px;font-size:1.1em}._12JM32OJa5{height:30px;display:-webkit-box;display:flex;-webkit-box-align:end;align-items:flex-end}
|
||||
._3PCSxT0l14>h2{margin-top:0}._3PCSxT0l14>h2 span:nth-child(2){font-size:12px;color:#777;font-weight:400;margin:0 .3em}._1yYRIyvlRd{display:-webkit-box;display:flex;flex-wrap:wrap}._1OcDlvlM5R{max-width:280px;min-width:150px;margin:10px;-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out}._1OcDlvlM5R._3oAxPKtZFv{cursor:pointer}._1OcDlvlM5R._3oAxPKtZFv:hover{-webkit-transform:translateY(-2px);transform:translateY(-2px)}
|
||||
.pWc1mov26e{padding-bottom:50px}._1myfcMimT9{padding:10px 40px}._1khaX45NQe{position:fixed;z-index:1;right:20px;bottom:20px}
|
||||
@ -0,0 +1 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{D46e:function(e,a,t){e.exports={header:"_3PCSxT0l14",list:"_1yYRIyvlRd",proxy:"_1OcDlvlM5R",proxySelectable:"_3oAxPKtZFv"}},FWZb:function(e,a,t){e.exports={proxy:"NpfXwxWAxo",now:"_2zD7drviYH",proxyType:"_1rVl-Kdmss",proxyName:"_3kdi5nima5",proxyLatencyWrap:"_12JM32OJa5"}},L5YO:function(e,a,t){e.exports={body:"pWc1mov26e",group:"_1myfcMimT9",fabgrp:"_1khaX45NQe"}},RbL9:function(e,a,t){e.exports={proxyLatency:"_2V-RqIAl7n"}},wyCT:function(e,a,t){"use strict";t.r(a);var n=t("o0o1"),r=t.n(n),c=t("HaE+"),o=t("q1tI"),l=t.n(o),s=t("u4Dv"),p=t("DKqX"),m=t("rePB"),i=t("17x9"),u=t.n(i),y=t("TSYQ"),b=t.n(y),x=t("RbL9"),d=t.n(x),f={good:"#67C23A",normal:"#E6A23C",bad:"#F56C6C",na:"#909399"};function v(e){var a=e.latency,t=a.number,n=a.error,r=Object(o.useMemo)(function(){return function(e,a){return""!==a?f.na:e<200?f.good:e<400?f.normal:f.bad}(t,n)},[t,n]);return l.a.createElement("span",{className:d.a.proxyLatency,style:{color:r}},""!==n?l.a.createElement("span",null,n):l.a.createElement("span",null,t," ms"))}v.propTypes={latency:u.a.shape({number:u.a.number,error:u.a.string})};var E=t("FWZb"),O=t.n(E),w=t("EQlU"),N=function(e){return{proxies:Object(w.d)(e),delay:Object(w.c)(e)}};function j(e){var a=e.now,t=e.name,n=Object(s.c)(N),r=n.proxies,c=n.delay[t],o=r[t];return l.a.createElement("div",{className:b()(O.a.proxy,Object(m.a)({},O.a.now,a))},l.a.createElement("div",{className:O.a.proxyName},t),l.a.createElement("div",{className:O.a.proxyType,style:{opacity:a?.6:.2}},o.type),l.a.createElement("div",{className:O.a.proxyLatencyWrap},c?l.a.createElement(v,{latency:c}):null))}j.propTypes={now:u.a.bool,name:u.a.string};var g=j,h=t("D46e"),_=t.n(h),T=function(e){return{proxies:Object(w.d)(e)}};function k(e){var a=e.name,t=Object(s.c)(T).proxies,n=Object(s.b)({switchProxy:w.g}),r=t[a],c=r.all;return l.a.createElement("div",{className:_.a.group},l.a.createElement("div",{className:_.a.header},l.a.createElement("h2",null,l.a.createElement("span",null,a),l.a.createElement("span",null,r.type))),l.a.createElement("div",{className:_.a.list},c.map(function(e){var t="Selector"===r.type,c=b()(_.a.proxy,Object(m.a)({},_.a.proxySelectable,t));return l.a.createElement("div",{className:c,key:e,onClick:function(){t&&n.switchProxy(a,e)}},l.a.createElement(g,{isSelectable:t,name:e,now:e===r.now}))})))}k.propTypes={name:u.a.string};var L=t("5Wrh"),C=t("L5YO"),D=t.n(C);t.d(a,"default",function(){return W});var P=function(e){return{proxies:Object(w.d)(e),groupNames:Object(w.e)(e)}},A={fetchProxies:w.b,requestDelayAll:w.f};function W(){var e=Object(s.b)(A),a=e.fetchProxies,t=e.requestDelayAll;Object(o.useEffect)(function(){Object(c.a)(r.a.mark(function e(){return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a();case 2:case"end":return e.stop()}},e)}))()},[a,t]);var n=Object(s.c)(P).groupNames;return l.a.createElement(l.a.Fragment,null,l.a.createElement(p.a,{title:"Proxies"}),l.a.createElement("div",{className:D.a.body},l.a.createElement("div",{className:D.a.fabgrp},l.a.createElement(L.a,{label:"Test Latency",onClick:t})),n.map(function(e){return l.a.createElement("div",{className:D.a.group,key:e},l.a.createElement(k,{name:e}))})))}}}]);
|
||||
@ -0,0 +1,2 @@
|
||||
._3eSLieOhVX{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;padding:10px 40px}._2n1pW09UvV{width:40px;padding-right:15px;color:var(--color-text-secondary);opacity:.4}.t1XJIwvW7A{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;font-size:12px;opacity:.8}._1fNf8kj0HA{padding:10px 0;font-family:Roboto Mono,Menlo,monospace;font-size:19px}._3yJmN0tON0{width:110px}
|
||||
._2Tux7NhweE{position:fixed;right:20px;bottom:20px}
|
||||
@ -0,0 +1 @@
|
||||
!function(e){function t(t){for(var n,o,c=t[0],l=t[1],f=t[2],s=t[3]||[],d=0,h=[];d<c.length;d++)o=c[d],a[o]&&h.push(a[o][0]),a[o]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(p&&p(t),i.push.apply(i,s);h.length;)h.shift()();return u.push.apply(u,f||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,o=1;o<r.length;o++){var f=r[o];0!==a[f]&&(n=!1)}n&&(u.splice(t--,1),e=l(l.s=r[0]))}return 0===u.length&&(i.forEach(function(e){if(void 0===a[e]){a[e]=null;var t=document.createElement("link");l.nc&&t.setAttribute("nonce",l.nc),t.rel="prefetch",t.as="script",t.href=c(e),document.head.appendChild(t)}}),i.length=0),e}var n={},o={5:0},a={5:0},u=[],i=[];function c(e){return l.p+""+({2:"proxies",4:"rules",6:"vendors~chartjs"}[e]||e)+"."+{2:"993826afdebb153e0805",4:"6f76e629fb04fefe588a",6:"429cb8fa2f4d9b575993",7:"a322784ecacd704a28c6"}[e]+".js"}function l(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{2:1,4:1}[e]&&t.push(o[e]=new Promise(function(t,r){for(var n=({2:"proxies",4:"rules",6:"vendors~chartjs"}[e]||e)+"."+{2:"9022775a13e050c1509f",4:"1fba3c440f97fe0e3bb1",6:"7d5d6ed1822d5d0495fb",7:"80c51b1d7a5a45aaeac0"}[e]+".css",a=l.p+n,u=document.getElementsByTagName("link"),i=0;i<u.length;i++){var c=(s=u[i]).getAttribute("data-href")||s.getAttribute("href");if("stylesheet"===s.rel&&(c===n||c===a))return t()}var f=document.getElementsByTagName("style");for(i=0;i<f.length;i++){var s;if((c=(s=f[i]).getAttribute("data-href"))===n||c===a)return t()}var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onload=t,d.onerror=function(t){var n=t&&t.target&&t.target.src||a,u=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");u.code="CSS_CHUNK_LOAD_FAILED",u.request=n,delete o[e],d.parentNode.removeChild(d),r(u)},d.href=a,document.getElementsByTagName("head")[0].appendChild(d)}).then(function(){o[e]=0}));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise(function(t,n){r=a[e]=[t,n]});t.push(r[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,l.nc&&i.setAttribute("nonce",l.nc),i.src=c(e);var f=new Error;u=function(t){i.onerror=i.onload=null,clearTimeout(s);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;f.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",f.name="ChunkLoadError",f.type=n,f.request=o,r[1](f)}a[e]=void 0}};var s=setTimeout(function(){u({type:"timeout",target:i})},12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(t)},l.m=e,l.c=n,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(r,n,function(t){return e[t]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="",l.oe=function(e){throw console.error(e),e};var f=window.webpackJsonp=window.webpackJsonp||[],s=f.push.bind(f);f.push=t,f=f.slice();for(var d=0;d<f.length;d++)t(f[d]);var p=s;r()}([]);
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
@ -1,48 +1,104 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$7" ]; then
|
||||
sed -i "/^dns:$/a\ enhanced-mode: ${2}" "$8"
|
||||
elif [ "$7" != "$2" ] && [ "$2" != "0" ]; then
|
||||
sed -i "s/${7}$/${2}/" "$8"
|
||||
fi
|
||||
if [ "$2" = "fake-ip" ]; then
|
||||
if [ ! -z "`grep "fake-ip-range:" "$8"`" ]; then
|
||||
sed -i "/fake-ip-range:/c\ fake-ip-range: 198.18.0.1/16" "$8"
|
||||
|
||||
if [ -z "$(grep '^ enhanced-mode: $2' "$7")" ]; then
|
||||
if [ ! -z "$(grep "^ enhanced-mode:" "$7")" ]; then
|
||||
sed -i "/^ enhanced-mode:/c\ enhanced-mode: ${2}" "$7"
|
||||
else
|
||||
sed -i "/enhanced-mode:/a\ fake-ip-range: 198.18.0.1/16" "$8"
|
||||
sed -i "/^dns:/a\ enhanced-mode: ${2}" "$7"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$2" = "fake-ip" ]; then
|
||||
if [ ! -z "$(grep "^ \{0,\}fake-ip-range:" "$7")" ]; then
|
||||
sed -i "/^ \{0,\}fake-ip-range:/c\ fake-ip-range: 198.18.0.1/16" "$7"
|
||||
else
|
||||
sed -i "/enhanced-mode:/a\ fake-ip-range: 198.18.0.1/16" "$7"
|
||||
fi
|
||||
else
|
||||
sed -i '/fake-ip-range:/d' "$8" 2>/dev/null
|
||||
sed -i '/^ \{0,\}fake-ip-range:/d' "$7" 2>/dev/null
|
||||
fi
|
||||
sed -i '/^##Custom DNS##$/d' "$8" 2>/dev/null
|
||||
|
||||
sed -i '/##Custom DNS##/d' "$7" 2>/dev/null
|
||||
|
||||
if [ ! -z "`grep "^redir-port:" "$8"`" ]; then
|
||||
sed -i "/^redir-port:/c\redir-port: ${6}" "$8"
|
||||
else
|
||||
sed -i "3i\redir-port: ${6}" "$8"
|
||||
|
||||
if [ -z "$(grep '^redir-port: $6' "$7")" ]; then
|
||||
if [ ! -z "$(grep "^redir-port:" "$7")" ]; then
|
||||
sed -i "/^redir-port:/c\redir-port: ${6}" "$7"
|
||||
else
|
||||
sed -i "3i\redir-port: ${6}" "$7"
|
||||
fi
|
||||
fi
|
||||
if [ ! -z "`grep "^external-controller:" "$8"`" ]; then
|
||||
sed -i "/^external-controller:/c\external-controller: 0.0.0.0:${5}" "$8"
|
||||
else
|
||||
sed -i "3i\external-controller: 0.0.0.0:${5}" "$8"
|
||||
|
||||
if [ -z "$(grep '^port: $9' "$7")" ]; then
|
||||
if [ ! -z "$(grep "^port:" "$7")" ]; then
|
||||
sed -i "/^port:/c\port: ${9}" "$7"
|
||||
else
|
||||
sed -i "3i\port: ${9}" "$7"
|
||||
fi
|
||||
fi
|
||||
if [ ! -z "`grep "^secret:" "$8"`" ]; then
|
||||
sed -i "/^secret:/c\secret: '${4}'" "$8"
|
||||
else
|
||||
sed -i "3i\secret: '${4}'" "$8"
|
||||
|
||||
if [ -z "$(grep '^socks-port: $10' "$7")" ]; then
|
||||
if [ ! -z "$(grep "^socks-port:" "$7")" ]; then
|
||||
sed -i "/^socks-port:/c\socks-port: ${10}" "$7"
|
||||
else
|
||||
sed -i "3i\socks-port: ${10}" "$7"
|
||||
fi
|
||||
fi
|
||||
if [ ! -z "`grep "^ enable:" "$8"`" ]; then
|
||||
sed -i "/^ enable:/c\ enable: true" "$8"
|
||||
else
|
||||
sed -i "/^dns:/a\ enable: true" "$8"
|
||||
|
||||
if [ -z "$(grep '^external-controller: 0.0.0.0:$5' "$7")" ]; then
|
||||
if [ ! -z "$(grep "^external-controller:" "$7")" ]; then
|
||||
sed -i "/^external-controller:/c\external-controller: 0.0.0.0:${5}" "$7"
|
||||
else
|
||||
sed -i "3i\external-controller: 0.0.0.0:${5}" "$7"
|
||||
fi
|
||||
fi
|
||||
if [ ! -z "`grep "^allow-lan:" "$8"`" ]; then
|
||||
sed -i "/^allow-lan:/c\allow-lan: true" "$8"
|
||||
else
|
||||
sed -i "3i\allow-lan: true" "$8"
|
||||
|
||||
if [ -z "$(grep '^secret: $4' "$7")" ]; then
|
||||
if [ ! -z "$(grep "^secret:" "$7")" ]; then
|
||||
sed -i "/^secret:/c\secret: '${4}'" "$7"
|
||||
else
|
||||
sed -i "3i\secret: '${4}'" "$7"
|
||||
fi
|
||||
fi
|
||||
if [ ! -z "`grep "^external-ui:" "$8"`" ]; then
|
||||
sed -i '/^external-ui:/c\external-ui: "/usr/share/openclash/dashboard"' "$8"
|
||||
else
|
||||
sed -i '3i\external-ui: "/usr/share/openclash/dashboard"' "$8"
|
||||
|
||||
if [ -z "$(grep "^ enable: true" "$7")" ]; then
|
||||
if [ ! -z "$(grep "^ \{0,\}enable:" "$7")" ]; then
|
||||
sed -i "/^ \{0,\}enable:/c\ enable: true" "$7"
|
||||
else
|
||||
sed -i "/^dns:/a\ enable: true" "$7"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$(grep "^allow-lan: true" "$7")" ]; then
|
||||
if [ ! -z "$(grep "^allow-lan:" "$7")" ]; then
|
||||
sed -i "/^allow-lan:/c\allow-lan: true" "$7"
|
||||
else
|
||||
sed -i "3i\allow-lan: true" "$7"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$(grep '^external-ui: "/usr/share/openclash/dashboard"' "$7")" ]; then
|
||||
if [ ! -z "$(grep "^external-ui:" "$7")" ]; then
|
||||
sed -i '/^external-ui:/c\external-ui: "/usr/share/openclash/dashboard"' "$7"
|
||||
else
|
||||
sed -i '3i\external-ui: "/usr/share/openclash/dashboard"' "$7"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$8" -eq 1 ]; then
|
||||
if [ -z "$(grep " ipv6: true" "$7")" ]; then
|
||||
if [ ! -z "$(grep "^ \{0,\}ipv6:" "$7")" ]; then
|
||||
sed -i "/^ \{0,\}ipv6:/c\ ipv6: true" "$7"
|
||||
else
|
||||
sed -i "/^ \{0,\}enable: true/i\ ipv6: true" "$7"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [ -z "$(grep " ipv6: false" "$7")" ]; then
|
||||
if [ ! -z "$(grep "^ \{0,\}ipv6:" "$7")" ]; then
|
||||
sed -i "/^ \{0,\}ipv6:/c\ ipv6: false" "$7"
|
||||
else
|
||||
sed -i "/^ \{0,\}enable: true/a\ ipv6: false" "$7"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
|
||||
check_def=0
|
||||
if [ "$2" != 0 ]; then
|
||||
if [ ! -f /etc/openclash/"$2".yml ]; then
|
||||
echo "${1} /etc/openclash/"$2".yml Not Exist, Will Use Self Rules, Please Update and Try Again" >>/tmp/clash.log
|
||||
if [ ! -f /etc/openclash/"$2".yaml ]; then
|
||||
echo "${1} /etc/openclash/"$2".yaml Not Exist, Will Use Self Rules, Please Update and Try Again" >>/tmp/openclash.log
|
||||
exit 0
|
||||
else
|
||||
rulesource=$(grep '##source:' "$4" |awk -F ':' '{print $2}')
|
||||
@ -12,9 +12,9 @@ if [ "$2" != 0 ]; then
|
||||
}
|
||||
|
||||
[ "$check_def" -ne 1 ] && {
|
||||
grep "^##updated$" /etc/openclash/"$2".yml 1>/dev/null
|
||||
grep "^##updated$" /etc/openclash/"$2".yaml 1>/dev/null
|
||||
[ "$?" -eq "0" ] && {
|
||||
sed -i '/^##updated$/d' /etc/openclash/"$2".yml
|
||||
sed -i '/^##updated$/d' /etc/openclash/"$2".yaml
|
||||
check_def=1
|
||||
}
|
||||
}
|
||||
@ -54,8 +54,8 @@ if [ "$2" != 0 ]; then
|
||||
Domestic=$(uci get openclash.config.Domestic 2>/dev/null)
|
||||
Others=$(uci get openclash.config.Others 2>/dev/null)
|
||||
if [ "$2" = "lhie1" ]; then
|
||||
sed -i '/^Rule:$/,$d' "$4"
|
||||
cat /etc/openclash/lhie1.yml >> "$4"
|
||||
sed -i '/^Rule:/,$d' "$4"
|
||||
cat /etc/openclash/lhie1.yaml >> "$4"
|
||||
sed -i -e "s/,GlobalTV$/,${GlobalTV}#d/g" -e "/Rule:/a\##GlobalTV:${GlobalTV}"\
|
||||
-e "s/,AsianTV$/,${AsianTV}#d/g" -e "/Rule:/a\##AsianTV:${AsianTV}"\
|
||||
-e "s/,Proxy$/,${Proxy}#d/g" -e "/Rule:/a\##Proxy:${Proxy}"\
|
||||
@ -65,8 +65,8 @@ if [ "$2" != 0 ]; then
|
||||
-e "s/,Others$/,${Others}#d/g" -e "/Rule:/a\##Others:${Others}"\
|
||||
-e "s/#d$//g" "$4"
|
||||
elif [ "$2" = "ConnersHua" ]; then
|
||||
sed -i '/^Rule:$/,$d' "$4"
|
||||
cat /etc/openclash/ConnersHua.yml >> "$4"
|
||||
sed -i '/^Rule:/,$d' "$4"
|
||||
cat /etc/openclash/ConnersHua.yaml >> "$4"
|
||||
sed -i -e "s/,ForeignMedia$/,${GlobalTV}#d/g" -e "/Rule:/a\##GlobalTV:${GlobalTV}"\
|
||||
-e "s/,DomesticMedia$/,${AsianTV}#d/g" -e "/Rule:/a\##AsianTV:${AsianTV}"\
|
||||
-e "s/,PROXY$/,${Proxy}#d/g" -e "/Rule:/a\##Proxy:${Proxy}"\
|
||||
@ -76,8 +76,8 @@ if [ "$2" != 0 ]; then
|
||||
-e "s/,Final$/,${Others}#d/g" -e "/Rule:/a\##Others:${Others}"\
|
||||
-e "s/#d$//g" "$4"
|
||||
else
|
||||
sed -i '/^Rule:$/,$d' "$4"
|
||||
cat /etc/openclash/ConnersHua_return.yml >> "$4"
|
||||
sed -i '/^Rule:/,$d' "$4"
|
||||
cat /etc/openclash/ConnersHua_return.yaml >> "$4"
|
||||
sed -i -e "s/,PROXY$/,${Proxy}#d/g" -e "/Rule:/a\##Proxy:${Proxy}"\
|
||||
-e "s/,DIRECT$/,${Others}#d/g" -e "/Rule:/a\##Others:${Others}"\
|
||||
-e "s/#d$//g" "$4"
|
||||
@ -89,8 +89,8 @@ elif [ "$2" = 0 ]; then
|
||||
grep '##source:' "$4" 1>/dev/null
|
||||
if [ "$?" -eq "0" ]; then
|
||||
cp /etc/openclash/config.bak /etc/openclash/configrules.bak
|
||||
sed -i -n '/^Rule:$/,$p' /etc/openclash/configrules.bak
|
||||
sed -i '/^Rule:$/,$d' "$4"
|
||||
sed -i -n '/^Rule:/,$p' /etc/openclash/configrules.bak
|
||||
sed -i '/^Rule:/,$d' "$4"
|
||||
cat /etc/openclash/configrules.bak >> "$4"
|
||||
rm -rf /etc/openclash/configrules.bak
|
||||
fi
|
||||
@ -101,7 +101,7 @@ fi
|
||||
sed -i '/^##Custom Rules$/d' "$4" 2>/dev/null
|
||||
sed -i '/^##Custom Rules End$/d' "$4" 2>/dev/null
|
||||
[ "$3" = 1 ] && {
|
||||
sed -i '/^Rule:$/a\##Custom Rules End' "$4" 2>/dev/null
|
||||
sed -i '/^Rule:$/a\##Custom Rules' "$4" 2>/dev/null
|
||||
sed -i '/^Rule:/a\##Custom Rules End' "$4" 2>/dev/null
|
||||
sed -i '/^Rule:/a\##Custom Rules' "$4" 2>/dev/null
|
||||
sed -i '/^##Custom Rules$/r/etc/config/openclash_custom_rules.list' "$4" 2>/dev/null
|
||||
}
|
||||
291
package/cnsztl/luci-app-openclash/i18n/zh-cn/openclash.zh-cn.po
Executable file → Normal file
@ -1,29 +1,57 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "clash"
|
||||
msgstr "clash"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: zh_CN\n"
|
||||
|
||||
msgid "OpenClash"
|
||||
msgstr "OpenClash"
|
||||
|
||||
msgid "A Clash Client For OpenWrt"
|
||||
msgstr "一个运行在OpenWrt上的Clash客户端"
|
||||
msgstr "一个运行在OpenWrt上的Clash客户端,兼容Shadowsocks、Vmess等协议,根据灵活的规则配置实现策略代理"
|
||||
|
||||
msgid "Will Modify The Config File Or Subscribe According To The Settings On This Page"
|
||||
msgstr "将按照以下设置本地化配置文件和获取订阅"
|
||||
|
||||
msgid "Technical Support"
|
||||
msgstr "技术支持"
|
||||
|
||||
msgid "Clash Global State"
|
||||
msgid "Overview"
|
||||
msgstr "运行状态"
|
||||
|
||||
msgid "Clash Settings"
|
||||
msgid "Takeover Settings"
|
||||
msgstr "接管设置"
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "全局设置"
|
||||
|
||||
msgid "Config Normal"
|
||||
msgstr "配置文件正常"
|
||||
msgid "Config Update"
|
||||
msgstr "配置文件订阅"
|
||||
|
||||
msgid "Config Abnormal"
|
||||
msgstr "配置文件(异常/不存在)"
|
||||
msgid "Rules Update"
|
||||
msgstr "第三方规则订阅"
|
||||
|
||||
msgid "Dashboard Settings"
|
||||
msgstr "外部控制"
|
||||
|
||||
msgid "GEOIP数据库订阅"
|
||||
msgstr "外部控制"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Disable"
|
||||
msgstr "停用"
|
||||
|
||||
msgid "RUNNING"
|
||||
msgstr "运行中"
|
||||
|
||||
msgid "NOT RUNNING"
|
||||
msgstr "未运行"
|
||||
|
||||
msgid "(Enable or Disable)"
|
||||
msgstr "(仅添加选中的设置)"
|
||||
|
||||
msgid "Config Normal"
|
||||
msgstr "检查通过"
|
||||
|
||||
msgid "File Not Exist"
|
||||
msgstr "文件不存在"
|
||||
@ -31,9 +59,6 @@ msgstr "文件不存在"
|
||||
msgid "Not Set"
|
||||
msgstr "未设置"
|
||||
|
||||
msgid "File No Update"
|
||||
msgstr "原始/不存在(配置文件)"
|
||||
|
||||
msgid "Server Configuration"
|
||||
msgstr "配置文件"
|
||||
|
||||
@ -43,12 +68,6 @@ msgstr "服务器日志"
|
||||
msgid "Logs"
|
||||
msgstr "服务器日志"
|
||||
|
||||
msgid "Update Setting"
|
||||
msgstr "更新设置"
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "全局设置"
|
||||
|
||||
msgid "Enable Clash"
|
||||
msgstr "启动 OpenClash"
|
||||
|
||||
@ -61,137 +80,172 @@ msgstr "保存配置"
|
||||
msgid "Apply Configurations"
|
||||
msgstr "应用配置"
|
||||
|
||||
msgid "Download Configurations"
|
||||
msgstr "下载配置"
|
||||
|
||||
msgid "Select Mode"
|
||||
msgstr "运行模式"
|
||||
msgstr "OpenClash 运行模式"
|
||||
|
||||
msgid "redir-host"
|
||||
msgstr "Redir-Host模式"
|
||||
msgstr "Redir-Host 模式"
|
||||
|
||||
msgid "fake-ip"
|
||||
msgstr "Fake-IP模式"
|
||||
msgstr "Fake-IP 模式"
|
||||
|
||||
msgid "Will to Take Over Your General Settings, Network Error Try Flush DNS Cache"
|
||||
msgstr "启用将接管配置文件的模式设置,如客户端的网络无法连接请尝试清除DNS缓存"
|
||||
|
||||
msgid "Disable Mode Control"
|
||||
msgstr "使用配置文件设定的模式"
|
||||
msgid "Select Mode For OpenClash Work, Network Error Try Flush DNS Cache"
|
||||
msgstr "选择运行模式,如客户端的网络无法连接请尝试清除DNS缓存"
|
||||
|
||||
msgid "Custom DNS Setting"
|
||||
msgstr "自定义DNS服务器"
|
||||
msgstr "自定义上游DNS服务器"
|
||||
|
||||
msgid "Use Custom Rules"
|
||||
msgstr "添加并启用自定义规则"
|
||||
msgstr "启用后将把自定义规则增加到配置文件并优先匹配,规则请到下方文本框编辑"
|
||||
|
||||
msgid "Add Custom DNS Servers"
|
||||
msgstr "添加自定义DNS服务器"
|
||||
msgstr "设置自定义上游DNS服务器,在上方全局设置中启用本功能后生效"
|
||||
|
||||
msgid "Set OpenClash Upstream DNS Resolve Server"
|
||||
msgstr "自定义DNS上游服务器,将替换配置文件内的DNS服务器设置"
|
||||
|
||||
msgid "Disable Custom DNS Setting"
|
||||
msgstr "不使用自定义DNS服务器"
|
||||
msgstr "启用将覆盖配置文件内的设置,请先在下方配置好服务器"
|
||||
|
||||
msgid "DNS Server Group"
|
||||
msgstr "上游DNS服务器分组"
|
||||
msgstr "服务器分组"
|
||||
|
||||
msgid "DNS Server IP"
|
||||
msgstr "DNS服务器IP"
|
||||
msgid "(NameServer Group Must Be Set)"
|
||||
msgstr "(NameServer 组必须设置)"
|
||||
|
||||
msgid "DNS Server Address"
|
||||
msgstr "服务器地址"
|
||||
|
||||
msgid "(Do Not Add Type Ahead)"
|
||||
msgstr "(请勿添加类型前缀)"
|
||||
|
||||
msgid "DNS Server Port"
|
||||
msgstr "DNS服务器端口"
|
||||
msgstr "服务器端口"
|
||||
|
||||
msgid "(Require When Use Non-Standard Port)"
|
||||
msgstr "(使用非标准端口时必须填写)"
|
||||
|
||||
msgid "DNS Server Type"
|
||||
msgstr "DNS服务器类型"
|
||||
msgstr "服务器类型"
|
||||
|
||||
msgid "Enable Custom DNS Setting"
|
||||
msgstr "使用自定义DNS服务器"
|
||||
msgid "(Communication protocol)"
|
||||
msgstr "(通讯协议)"
|
||||
|
||||
msgid "Enable ipv6 Resolve"
|
||||
msgstr "IPV6类型DNS解析"
|
||||
|
||||
msgid "Force Enable to Resolve ipv6 DNS Requests"
|
||||
msgstr ""
|
||||
"允许解析IPV6类型的DNS请求,如果您没有公网IPV6地址但开启了IPV6的DHCP服务,客户端连接可能会出现异常"
|
||||
|
||||
msgid "Rules Setting"
|
||||
msgstr "规则设置"
|
||||
msgstr "规则设置(访问控制)"
|
||||
|
||||
msgid "Server Config"
|
||||
msgstr "配置文件"
|
||||
|
||||
msgid "Upload Clash Configuration"
|
||||
msgid "Upload Config"
|
||||
msgstr "上传配置文件"
|
||||
|
||||
msgid "Upload"
|
||||
msgstr "上传"
|
||||
|
||||
msgid "File saved to"
|
||||
msgstr "文件已成功上传到"
|
||||
|
||||
msgid "upload file error."
|
||||
msgstr "文件上传失败"
|
||||
|
||||
msgid "No specify upload file."
|
||||
msgstr "未指定上传文件"
|
||||
|
||||
msgid ""
|
||||
"NB: Rename your config file to config.yml before upload. file will save to /"
|
||||
"etc/openclash"
|
||||
msgstr ""
|
||||
"注意:上传之前,请将配置文件重命名为config.yml,文件将保存到 /etc/openclash 文件夹"
|
||||
"Rename your config file to config.yaml before upload what would be save to /etc/openclash"
|
||||
msgstr "注意:上传之前请将配置文件重命名为 config.yaml ,文件将被保存到 /etc/openclash"
|
||||
|
||||
msgid "Clash Redir Port, Please Make Sure Ports Available"
|
||||
msgstr "OpenClash转发端口,请确保端口可用"
|
||||
|
||||
msgid "Subscription Update"
|
||||
msgstr "配置文件"
|
||||
msgid "Please Make Sure Ports Available"
|
||||
msgstr "请确保端口可用"
|
||||
|
||||
msgid "Subcription Url"
|
||||
msgstr "订阅URL"
|
||||
msgstr "订阅地址"
|
||||
|
||||
msgid "Update Url Type"
|
||||
msgstr "订阅地址类型"
|
||||
|
||||
msgid "Power By fndroid,Use Other Rules If V2ray Subcription"
|
||||
msgstr "API提供:Fndroid,V2ray类型的订阅可配合第三方规则使用"
|
||||
|
||||
msgid "Update Subcription"
|
||||
msgstr "更新订阅配置"
|
||||
|
||||
msgid "Update Configuration"
|
||||
msgstr "点击更新配置文件"
|
||||
|
||||
msgid "Update time (every day)"
|
||||
msgstr "更新时间(每天)"
|
||||
|
||||
msgid "Auto Update"
|
||||
msgstr "自动更新"
|
||||
|
||||
msgid "Check And Update"
|
||||
msgstr "检查并更新"
|
||||
|
||||
msgid "After clash start running, wait a moment for servers to resolve,enjoy"
|
||||
msgstr "运行后,请等待服务器上线"
|
||||
|
||||
msgid "Clash config redir-port"
|
||||
msgstr "转发端口"
|
||||
msgid "Redir Port"
|
||||
msgstr "流量转发端口"
|
||||
|
||||
msgid "SOCKS5 Port"
|
||||
msgstr "SOCKS5 代理端口"
|
||||
|
||||
msgid "HTTP(S) Port"
|
||||
msgstr "HTTP(S) 代理端口"
|
||||
|
||||
msgid "Set Authentication of SOCKS5/HTTP(S)"
|
||||
msgstr "设置SOCKS5/HTTP(S)认证信息"
|
||||
|
||||
msgid "Not Null"
|
||||
msgstr "空值无效"
|
||||
|
||||
msgid "Server Subscription Address"
|
||||
msgstr "服务器订阅地址"
|
||||
msgstr "配置文件订阅地址"
|
||||
|
||||
msgid "Auto Update Server subscription"
|
||||
msgstr "自动更新服务器订阅"
|
||||
msgstr "自动更新配置文件"
|
||||
|
||||
msgid "Daily Server subscription update time"
|
||||
msgstr "每日服务器订阅更新时间"
|
||||
msgid "You Can Modify config file Here, Except The Settings That Were Taken Over"
|
||||
msgstr "您可以在下方直接修改配置文件, 仅支持未被接管的设置"
|
||||
|
||||
msgid "Under Server Config You Can Manually Upload Configuration From PC"
|
||||
msgstr "或在配置文件页面手动上载配置"
|
||||
|
||||
msgid "Changes to config file must be made from source"
|
||||
msgstr "必须从源文件更改配置文件"
|
||||
msgid "Default Config File With Correct General-Settings"
|
||||
msgstr "参考配置文件,方便您查询各项参数注释和正确的设置、顺序"
|
||||
|
||||
msgid "Dashboard Secret"
|
||||
msgstr "管理页面登录密码"
|
||||
msgstr "管理页面登录密钥"
|
||||
|
||||
msgid "Set Dashboard Secret"
|
||||
msgstr "设置您的管理页面登录密码"
|
||||
msgstr "设置您的管理页面登录密钥"
|
||||
|
||||
msgid "Dashboard hostname is Your Router IP. Dashboard:192.168.1.1/openclash"
|
||||
msgstr "登录主机名是您的路由器IP, 管理页面地址示例:192.168.1.1/openclash、192.168.1.1:9090/ui"
|
||||
msgid "Dashboard Address Example: 192.168.1.1/openclash、192.168.1.1:9090/ui"
|
||||
msgstr "管理页面地址示例: 192.168.1.1/openclash、192.168.1.1:9090/ui"
|
||||
|
||||
msgid "Dashboard Port"
|
||||
msgstr "管理页面端口"
|
||||
|
||||
msgid "GEOIP(By MaxMind) Update"
|
||||
msgstr "GEOIP 数据库(By MaxMind)"
|
||||
msgid "GEOIP Update"
|
||||
msgstr "GEOIP数据库订阅"
|
||||
|
||||
msgid "Auto Update GEOIP Database"
|
||||
msgstr "自动更新GEOIP数据库"
|
||||
|
||||
msgid "Update GEOIP Database"
|
||||
msgstr "更新GEOIP数据库"
|
||||
|
||||
msgid "Start Update GEOIP Database"
|
||||
msgstr "点击更新GEOIP数据库"
|
||||
|
||||
msgid "Other Rules Update(Only in Use)"
|
||||
msgstr "第三方规则(仅对正在使用的规则生效)"
|
||||
msgstr "正在使用第三方规则时才能更新"
|
||||
|
||||
msgid "Enable Other Rules"
|
||||
msgstr "第三方规则"
|
||||
|
||||
msgid "Use Other Rules"
|
||||
msgstr "选择并启用第三方规则,将替换配置文件内的所有规则"
|
||||
msgstr "选择并启用第三方规则后将覆盖配置文件内的所有规则 (不包括自定义规则)"
|
||||
|
||||
msgid "Disable Other Rules"
|
||||
msgstr "不使用第三方规则"
|
||||
@ -206,11 +260,14 @@ msgid "ConnersHua Return Rules"
|
||||
msgstr "ConnersHua 回国规则"
|
||||
|
||||
msgid "Auto Update Other Rules"
|
||||
msgstr "启用第三方规则自动更新"
|
||||
msgstr "正在使用第三方规则时更新设置才会生效"
|
||||
|
||||
msgid "Update Time (Every Week)"
|
||||
msgstr "更新时间(每周)"
|
||||
|
||||
msgid "Every Day"
|
||||
msgstr "每天"
|
||||
|
||||
msgid "Every Monday"
|
||||
msgstr "每周一"
|
||||
|
||||
@ -235,9 +292,6 @@ msgstr "每周日"
|
||||
msgid "Update Other Rules"
|
||||
msgstr "更新第三方规则"
|
||||
|
||||
msgid "Start Update Other Rules"
|
||||
msgstr "点击更新第三方规则"
|
||||
|
||||
msgid "GlobalTV"
|
||||
msgstr "国际流媒体流量"
|
||||
|
||||
@ -259,20 +313,67 @@ msgstr "国内流量"
|
||||
msgid "Others"
|
||||
msgstr "未匹配到规则的流量"
|
||||
|
||||
msgid "Choose Proxy Group, Base On Your Servers Group in config.yml"
|
||||
msgstr "指定流量(策略)的代理方式,服务器组信息来源于您的config.yml"
|
||||
msgid "Choose Proxy Group, Base On Your Servers Group in config.yaml"
|
||||
msgstr "指定流量(策略)的代理方式,只支持选择(服务器组),信息来源于您的配置文件"
|
||||
|
||||
msgid "Custom Clash Rules"
|
||||
msgstr "自定义规则"
|
||||
msgstr "自定义规则(访问控制)"
|
||||
|
||||
msgid "Custom Clash Rules Here"
|
||||
msgstr "设置自定义规则"
|
||||
msgid "Custom Rules Here, For More Go Github:https://github.com/Dreamacro/clash/blob/master/README.md"
|
||||
msgstr "设置自定义规则,详细信息请前往Github( https://github.com/Dreamacro/clash/blob/master/README.md )查询"
|
||||
|
||||
msgid "Disable Custom Clash Rules"
|
||||
msgstr "不设置自定义规则"
|
||||
msgid "Custom Hosts Here, For More Go Github:https://github.com/Dreamacro/clash/blob/master/README.md"
|
||||
msgstr "设置自定义Hosts,详细信息请前往Github( https://github.com/Dreamacro/clash/blob/master/README.md )查询"
|
||||
|
||||
msgid "Enable Custom Clash Rules"
|
||||
msgstr "设置自定义规则"
|
||||
msgid "Set Custom Rules, Will Add When Flag Turn on"
|
||||
msgstr "设置自定义规则,在上方规则设置中启用本功能后生效"
|
||||
|
||||
msgid "For More Go Github:https://github.com/Dreamacro/clash"
|
||||
msgstr "更多规则信息请前往Github( https://github.com/Dreamacro/clash )查询"
|
||||
msgid "Set Custom Hosts, Only Work with Redir-Host Mode"
|
||||
msgstr "设置自定义Hosts,仅在Redir-Host模式下生效(不会覆盖配置文件设置)"
|
||||
|
||||
msgid "Version Update"
|
||||
msgstr "版本更新"
|
||||
|
||||
msgid "CPU Model"
|
||||
msgstr "处理器架构"
|
||||
|
||||
msgid "Model Not Found"
|
||||
msgstr "处理器架构识别失败"
|
||||
|
||||
msgid "Current Core Version"
|
||||
msgstr "当前内核版本"
|
||||
|
||||
msgid "Last Core Version"
|
||||
msgstr "最新内核版本"
|
||||
|
||||
msgid "Unknown"
|
||||
msgstr "查询失败"
|
||||
|
||||
msgid "<New>"
|
||||
msgstr "<可更新>"
|
||||
|
||||
msgid "Chose to Download"
|
||||
msgstr "选择内核编译版本"
|
||||
|
||||
msgid "For Core Update, Wrong Version Will Not Work"
|
||||
msgstr "下载、更新内核前须设置,错误的版本将不能正常运行"
|
||||
|
||||
msgid "Update Core File"
|
||||
msgstr "更新内核"
|
||||
|
||||
msgid "Download Form https://github.com/vernesong/OpenClash/releases/tag/Clash If Fail"
|
||||
msgstr ""
|
||||
"如下载失败可前往 https://github.com/vernesong/OpenClash/releases/tag/Clash 手动下载并上传"
|
||||
|
||||
msgid "Last OpenClash Version"
|
||||
msgstr "最新客户端版本"
|
||||
|
||||
msgid "Current OpenClash Version"
|
||||
msgstr "当前客户端版本"
|
||||
|
||||
msgid "Update OpenClash"
|
||||
msgstr "更新客户端"
|
||||
|
||||
msgid "Only For IPK Install Type Or Not Release Memory"
|
||||
msgstr ""
|
||||
"只支持通过IPK安装的版本进行更新,因为随系统编译的版本更新后不会释放旧版本的闪存空间"
|
||||
|
||||