OpenClash: bump to v0.34.4-beta
This commit is contained in:
parent
f392932c24
commit
07106cfbc8
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-openclash
|
||||
PKG_VERSION:=0.34.2
|
||||
PKG_VERSION:=0.34.4
|
||||
PKG_RELEASE:=beta
|
||||
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
|
||||
|
||||
@ -30,7 +30,6 @@ define Build/Prepare
|
||||
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
|
||||
chmod 0755 ${CURDIR}/files/etc/init.d/openclash
|
||||
chmod -R 0755 ${CURDIR}/files/usr/share/openclash/
|
||||
chmod -R 0755 ${CURDIR}/files/usr/lib/lua/luci/model/cbi/openclash/
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
@ -73,6 +72,8 @@ elif [ -f "/tmp/config.yml" ]; then
|
||||
mv "/tmp/config.yml" "/etc/openclash/config.yaml" 2>/dev/null
|
||||
fi
|
||||
uci set openclash.config.enable=0 2>/dev/null && uci commit openclash 2>/dev/null
|
||||
chmod 0755 /etc/init.d/openclash 2>/dev/null
|
||||
chmod -R 0755 /usr/share/openclash/ 2>/dev/null
|
||||
rm -rf /tmp/luci*
|
||||
endef
|
||||
|
||||
|
||||
@ -55,3 +55,5 @@ interface.music.163.com
|
||||
#win10本地连接检测
|
||||
msftconnecttest.com
|
||||
msftncsi.com
|
||||
#QQ快捷登录
|
||||
qq.com
|
||||
@ -234,40 +234,44 @@ yml_dns_custom()
|
||||
else
|
||||
sed -i "/^ \{0,\}nameserver:/c\ nameserver:" "$2" 2>/dev/null
|
||||
sed -i "/^ \{0,\}fallback:/c\ fallback:" "$2" 2>/dev/null
|
||||
fi
|
||||
|
||||
#fallback-filter
|
||||
if [ ! -z "$(grep '^ \{0,\}fallback:' $2)" ]; then
|
||||
if [ -z "$(grep '^ \{0,\}fallback-filter:' $2)" ]; then
|
||||
sed -i '/OpenClash-General-Settings/i\ fallback-filter:' "$2" 2>/dev/null
|
||||
sed -i '/OpenClash-General-Settings/i\ geoip: true' "$2" 2>/dev/null
|
||||
sed -i '/OpenClash-General-Settings/i\ ipcidr:' "$2" 2>/dev/null
|
||||
sed -i '/OpenClash-General-Settings/i\ - 240.0.0.0/4' "$2" 2>/dev/null
|
||||
else
|
||||
if [ -z "$(grep '^ fallback-filter:' $2)" ]; then
|
||||
sed -i "/fallback-filter:/c\ fallback-filter:" "$2" 2>/dev/null
|
||||
fi
|
||||
if [ -z "$(grep '^ geoip: true' $2)" ]; then
|
||||
sed -i "/geoip: true/c\ geoip: true" "$2" 2>/dev/null
|
||||
fi
|
||||
if [ -z "$(grep '^ ipcidr:' $2)" ]; then
|
||||
sed -i "/ipcidr:/c\ ipcidr:" "$2" 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
if [ -z "$(grep "^ - " $2)" ]; then
|
||||
sed -i '/^ \{0,\}nameserver:/,/^ \{0,\}fallback-filter:/ {s/^ \{0,\}- / - /}' "$2" 2>/dev/null #修改参数空格
|
||||
fi
|
||||
if [ -z "$(grep "^ - " $2)" ]; then
|
||||
sed -i '/^ \{0,\}ipcidr:/,/OpenClash-General-Settings/ {s/^ \{0,\}- / - /}' "$2" 2>/dev/null #修改参数空格
|
||||
fi
|
||||
else #删除fallback-filter
|
||||
if [ ! -z "$(grep '^ \{0,\}ipcidr:' $2)" ]; then
|
||||
sed -i '/^ \{0,\}ipcidr:/,/OpenClash-General-Settings/ {/^ \{0,\}-/d}' "$2" 2>/dev/null
|
||||
fi
|
||||
if [ ! -z "$(grep "^ \{0,1\}- " $2)" ]; then
|
||||
sed -i "s/^ \{0,\}- / - /" "$2" 2>/dev/null #添加参数空格
|
||||
fi
|
||||
sed -i '/fallback-filter:/d' "$2" 2>/dev/null
|
||||
sed -i '/geoip:/d' "$2" 2>/dev/null
|
||||
sed -i '/ipcidr:/d' "$2" 2>/dev/null
|
||||
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 '/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
|
||||
}
|
||||
|
||||
#获取认证信息
|
||||
@ -351,47 +355,46 @@ if [ "$enable" -eq 1 ] && [ -f "$CONFIG_FILE" ]; then
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "第三步: 修改配置文件..." >$START_LOG
|
||||
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"
|
||||
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" "$lan_ip" &
|
||||
sh /usr/share/openclash/yml_rules_change.sh "$LOGTIME" "$rule_source" "$enable_custom_clash_rules" "$RULE_FILE" &
|
||||
wait
|
||||
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_BACKUP $CONFIG_FILE
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "第五步: 启动 Clash 主程序..." >$START_LOG
|
||||
nohup $CLASH -d "$CLASH_CONFIG" >> $LOG_FILE 2>&1 &
|
||||
echo "第三步: 修改配置文件..." >$START_LOG
|
||||
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" "$CHANGE_FILE" "$ipv6_enable" "$http_port" "$socks_port" "$lan_ip" "$HOSTS_FILE" &
|
||||
sh /usr/share/openclash/yml_rules_change.sh "$LOGTIME" "$rule_source" "$enable_custom_clash_rules" "$RULE_FILE" &
|
||||
wait
|
||||
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_BACKUP $CONFIG_FILE
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
echo "第五步: 启动 Clash 主程序..." >$START_LOG
|
||||
nohup $CLASH -d "$CLASH_CONFIG" >> $LOG_FILE 2>&1 &
|
||||
|
||||
echo "第六步: 设置控制面板..." >$START_LOG
|
||||
ln -s /usr/share/openclash/yacd /www/openclash 2>/dev/null
|
||||
echo "第六步: 设置控制面板..." >$START_LOG
|
||||
ln -s /usr/share/openclash/yacd /www/openclash 2>/dev/null
|
||||
|
||||
echo "第七步: 设置 OpenClash 防火墙规则..." >$START_LOG
|
||||
if [ -z "$(uci get firewall.openclash)" ] || [ -z "$(uci get ucitrack.@openclash[-1].init)" ]; then
|
||||
uci delete ucitrack.@openclash[-1] >/dev/null 2>&1
|
||||
uci add ucitrack openclash >/dev/null 2>&1
|
||||
uci set ucitrack.@openclash[-1].init=openclash >/dev/null 2>&1
|
||||
uci commit ucitrack >/dev/null 2>&1
|
||||
uci delete firewall.openclash >/dev/null 2>&1
|
||||
uci set firewall.openclash=include >/dev/null 2>&1
|
||||
uci set firewall.openclash.type=script >/dev/null 2>&1
|
||||
uci set firewall.openclash.path=/var/etc/openclash.include >/dev/null 2>&1
|
||||
uci set firewall.openclash.reload=1 >/dev/null 2>&1
|
||||
uci commit firewall >/dev/null 2>&1
|
||||
fi
|
||||
mkdir -p /var/etc
|
||||
cat > "/var/etc/openclash.include" <<-EOF
|
||||
echo "第七步: 设置 OpenClash 防火墙规则..." >$START_LOG
|
||||
if [ -z "$(uci get firewall.openclash 2>/dev/null)" ] || [ -z "$(uci get ucitrack.@openclash[-1].init 2>/dev/null)" ]; then
|
||||
uci delete ucitrack.@openclash[-1] >/dev/null 2>&1
|
||||
uci add ucitrack openclash >/dev/null 2>&1
|
||||
uci set ucitrack.@openclash[-1].init=openclash >/dev/null 2>&1
|
||||
uci commit ucitrack >/dev/null 2>&1
|
||||
uci delete firewall.openclash >/dev/null 2>&1
|
||||
uci set firewall.openclash=include >/dev/null 2>&1
|
||||
uci set firewall.openclash.type=script >/dev/null 2>&1
|
||||
uci set firewall.openclash.path=/var/etc/openclash.include >/dev/null 2>&1
|
||||
uci set firewall.openclash.reload=1 >/dev/null 2>&1
|
||||
uci commit firewall >/dev/null 2>&1
|
||||
fi
|
||||
mkdir -p /var/etc
|
||||
cat > "/var/etc/openclash.include" <<-EOF
|
||||
iptables -t nat -N openclash
|
||||
iptables -t nat -A openclash -d 0.0.0.0/8 -j RETURN
|
||||
iptables -t nat -A openclash -d 10.0.0.0/8 -j RETURN
|
||||
@ -407,52 +410,59 @@ iptables -t nat -A PREROUTING -p tcp -j openclash
|
||||
iptables -t nat -A OUTPUT -p tcp -d 198.18.0.1/16 -j REDIRECT --to-ports "$proxy_port"
|
||||
EOF
|
||||
|
||||
if [ "$ipv6_enable" -eq 1 ]; then
|
||||
cat >> "/var/etc/openclash.include" <<-EOF
|
||||
if [ "$ipv6_enable" -eq 1 ]; then
|
||||
cat >> "/var/etc/openclash.include" <<-EOF
|
||||
ip6tables -t nat -N openclash
|
||||
ip6tables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port"
|
||||
ip6tables -t nat -A PREROUTING -p tcp -j openclash
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
/etc/init.d/firewall restart >/dev/null 2>&1
|
||||
/etc/init.d/miniupnpd restart >/dev/null 2>&1
|
||||
|
||||
echo "第八步: 重启 Dnsmasq 程序..." >$START_LOG
|
||||
if [ "$(iptables -t nat -nL PREROUTING --line-number |grep dpt:53 |wc -l)" -gt 2 ]; then
|
||||
echo "发现53端口被劫持,请将OpenClash设置为劫持53端口程序的上游DNS服务器!" >$START_LOG
|
||||
echo "${LOGTIME} Warring: OpenClash May Can Not Take Over DNS, Please Use OpenClash for Upstream DNS Resolve Server" >> $LOG_FILE
|
||||
sleep 5
|
||||
fi
|
||||
[ "$enable_redirect_dns" != "0" ] && {
|
||||
change_dns
|
||||
}
|
||||
fake_block "$en_mode" "$direct_dns"
|
||||
/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 Successful" >> $LOG_FILE
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
if [ "$rule_source" != 0 ] || [ "$enable_custom_clash_rules" != 0 ]; then
|
||||
echo "错误: OpenClash 启动失败,尝试还原规则并重新启动 Clash 主程序..." >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Can Not Start, Try Use Backup Rules Start Again" >> $LOG_FILE
|
||||
mv "$BACKUP_FILE" /etc/openclash/configrules.bak
|
||||
sed -i -n '/^Rule:/,$p' /etc/openclash/configrules.bak
|
||||
sed -i '/^Rule:/,$d' "$CONFIG_FILE"
|
||||
cat /etc/openclash/configrules.bak >> "$CONFIG_FILE"
|
||||
rm -rf /etc/openclash/configrules.bak
|
||||
nohup $CLASH -d "$CLASH_CONFIG" >> $LOG_FILE 2>&1 &
|
||||
sleep 3
|
||||
if pidof clash >/dev/null; then
|
||||
add_cron
|
||||
echo "OpenClash 使用备份规则启动成功,请更新、检查变动的规则后重试!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Start Successful With Backup Rules Config, Please Check Or Update Other Rules And Retry" >> $LOG_FILE
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
/etc/init.d/firewall restart >/dev/null 2>&1
|
||||
/etc/init.d/miniupnpd restart >/dev/null 2>&1
|
||||
|
||||
echo "第八步: 重启 Dnsmasq 程序..." >$START_LOG
|
||||
if [ "$(iptables -t nat -nL PREROUTING --line-number |grep dpt:53 |wc -l)" -gt 2 ]; then
|
||||
echo "发现53端口被劫持,请将OpenClash设置为劫持53端口程序的上游DNS服务器!" >$START_LOG
|
||||
echo "${LOGTIME} Warring: OpenClash May Can Not Take Over DNS, Please Use OpenClash for Upstream DNS Resolve Server" >> $LOG_FILE
|
||||
sleep 5
|
||||
fi
|
||||
[ "$enable_redirect_dns" != "0" ] && {
|
||||
change_dns
|
||||
}
|
||||
fake_block "$en_mode" "$direct_dns"
|
||||
/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 Successful" >> $LOG_FILE
|
||||
sleep 5
|
||||
echo "" >$START_LOG
|
||||
else
|
||||
if [ "$rule_source" != 0 ] || [ "$enable_custom_clash_rules" != 0 ]; then
|
||||
echo "错误: OpenClash 启动失败,尝试还原规则并重新启动 Clash 主程序..." >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Can Not Start, Try Use Backup Rules Start Again" >> $LOG_FILE
|
||||
mv "$BACKUP_FILE" /etc/openclash/configrules.bak
|
||||
sed -i -n '/^Rule:/,$p' /etc/openclash/configrules.bak
|
||||
sed -i '/^Rule:/,$d' "$CONFIG_FILE"
|
||||
cat /etc/openclash/configrules.bak >> "$CONFIG_FILE"
|
||||
rm -rf /etc/openclash/configrules.bak
|
||||
nohup $CLASH -d "$CLASH_CONFIG" >> $LOG_FILE 2>&1 &
|
||||
sleep 3
|
||||
if pidof clash >/dev/null; then
|
||||
add_cron
|
||||
echo "OpenClash 使用备份规则启动成功,请更新、检查变动的规则后重试!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Start Successful With Backup Rules Config, Please Check Or Update Other Rules And Retry" >> $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 10
|
||||
echo "" >$START_LOG
|
||||
stop && echo "" >$START_LOG
|
||||
fi
|
||||
else
|
||||
echo "错误: OpenClash 启动失败,请到日志页面查看详细错误信息!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Can Not Start, Please Check The Error Info And Try Again" >> $LOG_FILE
|
||||
@ -460,17 +470,10 @@ fi
|
||||
echo "" >$START_LOG
|
||||
stop && echo "" >$START_LOG
|
||||
fi
|
||||
else
|
||||
echo "错误: OpenClash 启动失败,请到日志页面查看详细错误信息!" >$START_LOG
|
||||
echo "${LOGTIME} OpenClash Can Not Start, Please Check The Error Info And Try Again" >> $LOG_FILE
|
||||
sleep 10
|
||||
echo "" >$START_LOG
|
||||
stop && echo "" >$START_LOG
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
rm -rf $START_BACKUP 2>/dev/null
|
||||
fi
|
||||
else
|
||||
subscribe_url=$(uci get openclash.config.subscribe_url 2>/dev/null)
|
||||
if [ ! -f "$CONFIG_FILE" ] && [ ! -z "$subscribe_url" ]; then
|
||||
|
||||
@ -43,24 +43,27 @@ authentication: # 此项将被接管
|
||||
- "user1:pass1"
|
||||
- "user2:pass2"
|
||||
|
||||
# # 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)
|
||||
#hosts:
|
||||
#'*.clash.dev': 127.0.0.1
|
||||
#'alpha.clash.dev': '::1'
|
||||
|
||||
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
|
||||
fallback-filter:
|
||||
geoip: true # default
|
||||
ipcidr: # ips in these subnets will be considered polluted
|
||||
- 240.0.0.0/4
|
||||
|
||||
# 以上设置您可直接覆盖到配置文件,无需更改
|
||||
# Openclash 不会对下方服务器设置进行任何更改,请确保设置正确
|
||||
@ -68,17 +71,20 @@ dns: # 如订阅配置无包括此项的所有DNS设置,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 }
|
||||
# The supported ciphers(encrypt methods):
|
||||
# aes-128-gcm aes-192-gcm aes-256-gcm
|
||||
# aes-128-cfb aes-192-cfb aes-256-cfb
|
||||
# aes-128-ctr aes-192-ctr aes-256-ctr
|
||||
# rc4-md5 chacha20 chacha20-ietf xchacha20
|
||||
# chacha20-ietf-poly1305 xchacha20-ietf-poly1305
|
||||
- { name: "ss1", type: ss, server: server, port: 443, cipher: chacha20-ietf-poly1305, password: "password", udp: true }
|
||||
|
||||
# old obfs configuration remove after prerelease
|
||||
- name: "ss2"
|
||||
type: ss
|
||||
server: server
|
||||
port: 443
|
||||
cipher: AEAD_CHACHA20_POLY1305
|
||||
cipher: chacha20-ietf-poly1305
|
||||
password: "password"
|
||||
plugin: obfs
|
||||
plugin-opts:
|
||||
@ -89,7 +95,7 @@ Proxy: # 此参数必须保留,不能删除
|
||||
type: ss
|
||||
server: server
|
||||
port: 443
|
||||
cipher: AEAD_CHACHA20_POLY1305
|
||||
cipher: chacha20-ietf-poly1305
|
||||
password: "password"
|
||||
plugin: v2ray-plugin
|
||||
plugin-opts:
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -35,14 +35,14 @@ o.rmempty = false
|
||||
|
||||
o = s:option(Value, "test_url", translate("Test URL"))
|
||||
o.default = "http://www.gstatic.com/generate_204"
|
||||
o.rmempty = true
|
||||
o.rmempty = false
|
||||
o:depends("type", "url-test")
|
||||
o:depends("type", "fallback")
|
||||
o:depends("type", "load-balance")
|
||||
|
||||
o = s:option(Value, "test_interval", translate("Test Interval(s)"))
|
||||
o.default = "300"
|
||||
o.rmempty = true
|
||||
o.rmempty = false
|
||||
o:depends("type", "url-test")
|
||||
o:depends("type", "fallback")
|
||||
o:depends("type", "load-balance")
|
||||
|
||||
@ -10,11 +10,6 @@ local sid = arg[1]
|
||||
local uuid = luci.sys.exec("cat /proc/sys/kernel/random/uuid")
|
||||
|
||||
local encrypt_methods_ss = {
|
||||
-- aead
|
||||
"AEAD_AES_128_GCM",
|
||||
"AEAD_AES_192_GCM",
|
||||
"AEAD_AES_256_GCM",
|
||||
"AEAD_CHACHA20_POLY1305",
|
||||
|
||||
-- stream
|
||||
"rc4-md5",
|
||||
@ -29,6 +24,7 @@ local encrypt_methods_ss = {
|
||||
"aes-256-gcm",
|
||||
"chacha20",
|
||||
"chacha20-ietf",
|
||||
"xchacha20",
|
||||
"chacha20-ietf-poly1305",
|
||||
"xchacha20-ietf-poly1305",
|
||||
}
|
||||
@ -62,7 +58,7 @@ o:value("http", translate("HTTP(S)"))
|
||||
|
||||
o.description = translate("Using incorrect encryption mothod may causes service fail to start")
|
||||
|
||||
o = s:option(Value, "name", translate("Alias"))
|
||||
o = s:option(Value, "name", translate("Server Alias"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "server", translate("Server Address"))
|
||||
@ -75,7 +71,7 @@ o.rmempty = false
|
||||
|
||||
o = s:option(Value, "password", translate("Password"))
|
||||
o.password = true
|
||||
o.rmempty = true
|
||||
o.rmempty = false
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "cipher", translate("Encrypt Method"))
|
||||
@ -89,14 +85,14 @@ o.rmempty = true
|
||||
o:depends("type", "vmess")
|
||||
|
||||
o = s:option(ListValue, "udp", translate("UDP Enable"))
|
||||
o.rmempty = false
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "obfs", translate("obfs-mode"))
|
||||
o.rmempty = false
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("tls")
|
||||
@ -105,7 +101,7 @@ o:value("websocket", translate("websocket (ws)"))
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "obfs_vmess", translate("obfs-mode"))
|
||||
o.rmempty = false
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("websocket", translate("websocket (ws)"))
|
||||
@ -116,6 +112,7 @@ o.datatype = "host"
|
||||
o.rmempty = true
|
||||
o:depends("obfs", "tls")
|
||||
o:depends("obfs", "http")
|
||||
o:depends("obfs", "websocket")
|
||||
|
||||
o = s:option(Value, "custom", translate("ws-headers"))
|
||||
o.rmempty = true
|
||||
@ -125,7 +122,7 @@ o:depends("obfs_vmess", "websocket")
|
||||
-- [[ WS部分 ]]--
|
||||
|
||||
-- WS路径
|
||||
o = s:option(Value, "path", translate("ws-Path"))
|
||||
o = s:option(Value, "path", translate("ws-path"))
|
||||
o.rmempty = true
|
||||
o:depends("obfs", "websocket")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
@ -161,7 +158,8 @@ o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "vmess")
|
||||
o:depends("obfs", "websocket")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
|
||||
@ -171,7 +169,8 @@ o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "vmess")
|
||||
o:depends("obfs", "websocket")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
|
||||
|
||||
@ -41,7 +41,17 @@ o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
luci.sys.call("/usr/share/openclash/yml_proxys_set.sh >/dev/null 2>&1 &")
|
||||
local refresh_config = uci:get("openclash", "config", "create_config")
|
||||
if (refresh_config == "1") then
|
||||
luci.sys.call("/usr/share/openclash/yml_proxys_set.sh >/dev/null 2>&1")
|
||||
uci:delete_all("openclash", "servers", function(s) return true end)
|
||||
uci:delete_all("openclash", "groups", function(s) return true end)
|
||||
luci.sys.call("/usr/share/openclash/yml_groups_get.sh >/dev/null 2>&1")
|
||||
luci.sys.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
else
|
||||
luci.sys.call("/usr/share/openclash/yml_proxys_set.sh >/dev/null 2>&1")
|
||||
luci.sys.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
end
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
@ -56,7 +66,7 @@ o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
uci:delete_all("openclash", "servers", function(s) return true end)
|
||||
uci:delete_all("openclash", "groups", function(s) return true end)
|
||||
luci.sys.call("sh /usr/share/openclash/yml_groups_get.sh 2>/dev/null")
|
||||
luci.sys.call("sh /usr/share/openclash/yml_groups_get.sh 2>/dev/null")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
|
||||
end
|
||||
|
||||
@ -123,7 +133,7 @@ function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "name", translate("Alias"))
|
||||
o = s:option(DummyValue, "name", translate("Server Alias"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
@ -21,8 +21,9 @@ s:tab("geo_update", translate("GEOIP Update"))
|
||||
s:tab("version_update", translate("Version Update"))
|
||||
|
||||
---- General Settings
|
||||
local cpu_model=SYS.exec("opkg status libc 2>/dev/null |grep 'Architecture' |awk -F ': ' '{print $2}' 2>/dev/null")
|
||||
o = s:taboption("settings", ListValue, "core_version", translate("Chose to Download"))
|
||||
o.description = translate("For Core Update, Wrong Version Will Not Work")
|
||||
o.description = translate("CPU Model")..': '..cpu_model..', '..translate("Select Based On Your CPU Model 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")
|
||||
@ -242,6 +243,7 @@ o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("rm -rf /etc/openclash/config.bak 2>/dev/null")
|
||||
SYS.call("sh /usr/share/openclash/openclash.sh >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
function binupdate_rediret()
|
||||
{
|
||||
url5='https://github.com/Dreamacro/clash/releases';
|
||||
url5='https://github.com/vernesong/OpenClash/releases/tag/Clash';
|
||||
window.open(url5);
|
||||
}
|
||||
function openupdate_rediret()
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<link rel="dns-prefetch" href="//api.skk.moe">
|
||||
<link rel="dns-prefetch" href="//d.skk.moe">
|
||||
<link rel="preconnect" href="https://whois.pconline.com.cn">
|
||||
<link rel="preconnect" href="https://ipv4.ip.sb">
|
||||
<link rel="preconnect" href="https://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">
|
||||
@ -142,7 +142,7 @@
|
||||
<span class="ip-title">太平洋 国内:</span><span class="ip-result" id="ip-pcol"></span> <span class="ip-geo" id="ip-pcol-ipip"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-title">IPAPI 海外:</span><span class="ip-result" id="ip-ipapi"></span> <span class="ip-geo" id="ip-ipapi-geo"></span>
|
||||
<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>
|
||||
@ -184,7 +184,7 @@
|
||||
$$.getElementById('ip-pcol').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipify').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipipnet').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipapi').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipsb').innerHTML = '查询中...';
|
||||
let random = parseInt(Math.random() * 100000000);
|
||||
let IP = {
|
||||
get: (url, type) =>
|
||||
@ -246,7 +246,6 @@
|
||||
$$.getElementById('ip-ipipnet-geo').innerHTML = `${data[1]}`;
|
||||
});
|
||||
},
|
||||
|
||||
getIPApiIP: () => {
|
||||
IP.get(`https://ipapi.co/json?z=${random}`, 'json')
|
||||
.then(resp => {
|
||||
@ -303,13 +302,16 @@
|
||||
HTTP.runcheck();
|
||||
IP.getIpipnetIP();
|
||||
IP.getIpifyIP();
|
||||
IP.getIPApiIP();
|
||||
IP.getWebrtcIP();
|
||||
|
||||
function getPcolIP(data){
|
||||
$$.getElementById('ip-pcol').innerHTML = data.ip;
|
||||
IP.parseIPIpip(data.ip, 'ip-pcol-ipip');
|
||||
};
|
||||
function getIpsbIP(data){
|
||||
$$.getElementById('ip-ipsb').innerHTML = data.address;
|
||||
$$.getElementById('ip-ipsb-geo').innerHTML = `${data.country} ${data.province} ${data.city} ${data.isp.name}`
|
||||
};
|
||||
|
||||
window.onload=myip_Load();
|
||||
|
||||
@ -321,19 +323,25 @@
|
||||
pcipScript.src='https://whois.pconline.com.cn/ipJson.jsp?callback=getPcolIP';
|
||||
pcip.appendChild(pcipScript);
|
||||
|
||||
var sbip = document.getElementsByTagName('HEAD').item(0);
|
||||
var sbipScript= document.createElement("script");
|
||||
sbipScript.defer = "defer";
|
||||
sbipScript.src='https://ip.sb/addrinfo?callback=getIpsbIP';
|
||||
sbip.appendChild(sbipScript);
|
||||
|
||||
const $$ = document;
|
||||
random = parseInt(Math.random() * 100000000);
|
||||
HTTP.runcheck();
|
||||
IP.getIpipnetIP();
|
||||
IP.getIpifyIP();
|
||||
IP.getIPApiIP();
|
||||
IP.getWebrtcIP();
|
||||
|
||||
setTimeout("myip_Load()",1000*8);
|
||||
setTimeout("myip_Load()",1000*20);
|
||||
}
|
||||
|
||||
</script>
|
||||
<script defer="defer" src="https://whois.pconline.com.cn/ipJson.jsp?callback=getPcolIP"></script>
|
||||
<script defer="defer" src="https://ip.sb/addrinfo?callback=getIpsbIP"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
<table>
|
||||
<tr><td width="100%" colspan="4" align="center"><b> 一些必要的状态显示,运行前请确保各项目显示正常,需要更新请到接管设置页面操作 </b></td></tr>
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center">
|
||||
<b> 一些必要的状态显示,运行前请确保各项目显示正常,需要更新请到全局设置页面操作 </b>
|
||||
</p>
|
||||
</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>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -33,7 +33,7 @@
|
||||
core_version.innerHTML = "<b><font color=green>"+status.corever+"</font></b>";
|
||||
}
|
||||
else {
|
||||
core_version.innerHTML = "<b><font color=red><%:未选择编译版本,请到全局设置中配置%></font></b>";
|
||||
core_version.innerHTML = "<b><font color=red><%:未选择编译版本,请到常规设置标签中配置%></font></b>";
|
||||
}
|
||||
if ( status.upchecktime != "1" ) {
|
||||
checktime.innerHTML = "<b><font color=green>"+status.upchecktime+"</font></b>";
|
||||
@ -80,7 +80,7 @@
|
||||
core_version.innerHTML = "<b><font color=green>"+status.corever+"</font></b>";
|
||||
}
|
||||
else {
|
||||
core_version.innerHTML = "<b><font color=red><%:未选择编译版本,请到全局设置中配置%></font></b>";
|
||||
core_version.innerHTML = "<b><font color=red><%:未选择编译版本,请到常规设置标签中配置%></font></b>";
|
||||
}
|
||||
if ( status.upchecktime != "1" ) {
|
||||
checktime.innerHTML = "<b><font color=green>"+status.upchecktime+"</font></b>";
|
||||
@ -158,7 +158,7 @@
|
||||
window.open(url1);
|
||||
}
|
||||
else {
|
||||
alert('未选择编译版本,请到全局设置中配置!')
|
||||
alert('未选择编译版本,请到常规设置标签中配置!')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link rel="icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/Dreamacro/clash/docs/logo.png" />
|
||||
<title>Clash</title>
|
||||
<link href="main.45da5278717379ab5871.css" rel="stylesheet"></head>
|
||||
<link href="main.b2b352082cb77749cd2e.css" rel="stylesheet"></head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="text/javascript" src="js/1.bundle.45da5278717379ab5871.min.js"></script><script type="text/javascript" src="js/bundle.45da5278717379ab5871.min.js"></script></body>
|
||||
<script type="text/javascript" src="js/1.bundle.b2b352082cb77749cd2e.min.js"></script><script type="text/javascript" src="js/bundle.b2b352082cb77749cd2e.min.js"></script></body>
|
||||
</html>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -13,7 +13,7 @@
|
||||
*/
|
||||
@font-face {
|
||||
font-family: "clash-iconfont";
|
||||
src: url("//at.alicdn.com/t/font_841708_6gtmjlak9k2.ttf?t=1551607902712") format("truetype");
|
||||
src: url("//at.alicdn.com/t/font_841708_z4foe3sarr8.ttf?t=1567008313882") format("truetype");
|
||||
}
|
||||
.clash-iconfont {
|
||||
font-family: "clash-iconfont" !important;
|
||||
@ -80,6 +80,18 @@
|
||||
content: "";
|
||||
}
|
||||
|
||||
.icon-sort::before {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.icon-sort-descending::before {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.icon-sort-ascending::before {
|
||||
content: "";
|
||||
}
|
||||
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
@ -4728,6 +4740,10 @@ body ::-webkit-scrollbar-thumb {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.proxies-container .proxies-action-icon {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.proxies-speed-test {
|
||||
line-height: 32px;
|
||||
margin: 0 2px 0 6px;
|
||||
@ -123,3 +123,35 @@
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#添加自定义Hosts设置
|
||||
|
||||
if [ "$2" = "redir-host" ]; then
|
||||
if [ -z "$(grep '^ \{0,\}hosts:' $7)" ]; then
|
||||
sed -i '/^dns:/i\hosts:' "$7" 2>/dev/null
|
||||
else
|
||||
if [ ! -z "$(grep '^ \{1,\}hosts:' $7)" ]; then
|
||||
sed -i '/^ \{1,\}hosts:/d' "$7" 2>/dev/null
|
||||
sed -i '/^dns:/i\hosts:' "$7" 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
sed -i "s/^ \{0,\}/ /" "$12" 2>/dev/null #修改参数空格
|
||||
sed -i "1i\##Custom HOSTS##" "$12" 2>/dev/null
|
||||
echo "##Custom HOSTS END##" >>"$12" 2>/dev/null
|
||||
sed -i '/##Custom HOSTS##/,/##Custom HOSTS END##/d' "$7" 2>/dev/null
|
||||
sed -i '/^hosts:/r/etc/config/openclash_custom_hosts.list' "$7" 2>/dev/null
|
||||
sed -i '/##Custom HOSTS##/d' "$12" 2>/dev/null
|
||||
sed -i '/##Custom HOSTS END##/d' "$12" 2>/dev/null
|
||||
else
|
||||
sed -i '/##Custom HOSTS##/,/##Custom HOSTS END##/d' "$7" 2>/dev/null
|
||||
sed -i '/^ *$/d' "$7" 2>/dev/null #删除空行
|
||||
hostlen=$(sed -n '/hosts:/=' "$7" 2>/dev/null)
|
||||
lasthlen=$(sed -n '$=' "$7" 2>/dev/null) #兼容旧版本
|
||||
dnslen=$(sed -n '/dns:/=' "$7" 2>/dev/null)
|
||||
if [ "$hostlen" = "$lasthlen" ] && [ ! -z "$hostlen" ]; then
|
||||
sed -i '/^ \{0,\}hosts:/d' "$7" 2>/dev/null
|
||||
fi
|
||||
if [ "$hostlen" = "$(expr $dnslen - 1)" ] && [ ! -z "$hostlen" ]; then
|
||||
sed -i '/^ \{0,\}hosts:/d' "$7" 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
@ -42,9 +42,9 @@ do
|
||||
#name
|
||||
group_name=$(grep "name:" $single_group |awk -F 'name:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
#test_url
|
||||
group_test_url=$(grep "url:" $single_group |awk -F 'url:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
group_test_url=$(grep "url:" $single_group |awk -F 'url:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g' |sed 's/ \{0,\}\}$//g' 2>/dev/null)
|
||||
#test_interval
|
||||
group_test_interval=$(grep "interval:" $single_group |awk -F 'interval:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
group_test_interval=$(grep "interval:" $single_group |awk -F 'interval:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g' |sed 's/ \{0,\}\}$//g' 2>/dev/null)
|
||||
|
||||
|
||||
|
||||
|
||||
@ -53,6 +53,10 @@ yml_groups_set()
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -z "$test_url" ] || [ -z "$test_interval" ] && [ "$type" != "select" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
echo "- name: $name" >>$GROUP_FILE
|
||||
echo " type: $type" >>$GROUP_FILE
|
||||
echo " proxies:" >>$GROUP_FILE
|
||||
|
||||
@ -44,11 +44,11 @@ do
|
||||
#port
|
||||
port=$(grep "port:" $single_server |awk -F 'port:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
#cipher
|
||||
cipher=$(grep "cipher:" $single_server |awk -F 'cipher:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
cipher=$(grep "cipher:" $single_server |awk -F 'cipher:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g' |sed 's/ \{0,\}\}$//g' 2>/dev/null)
|
||||
#password
|
||||
password=$(grep "password:" $single_server |awk -F 'password:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
password=$(grep "password:" $single_server |awk -F 'password:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g' |sed 's/ \{0,\}\}$//g' 2>/dev/null)
|
||||
#udp
|
||||
udp=$(grep "udp:" $single_server |awk -F 'udp:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
udp=$(grep "udp:" $single_server |awk -F 'udp:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g' |sed 's/ \{0,\}\}$//g' 2>/dev/null)
|
||||
#plugin:
|
||||
plugin=$(grep "plugin:" $single_server |awk -F 'plugin:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
#plugin-opts:
|
||||
@ -60,9 +60,9 @@ do
|
||||
#mode:
|
||||
mode=$(grep "mode:" $single_server |awk -F 'mode:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
#tls:
|
||||
tls=$(grep "tls:" $single_server |sed 's/,.*//' |awk -F 'tls:' '{print $2}' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
tls=$(grep "tls:" $single_server |awk -F 'tls:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g' |sed 's/ \{0,\}\}$//g' 2>/dev/null)
|
||||
#skip-cert-verify:
|
||||
verify=$(grep "skip-cert-verify:" $single_server |awk -F 'skip-cert-verify:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
verify=$(grep "skip-cert-verify:" $single_server |awk -F 'skip-cert-verify:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g' |sed 's/ \{0,\}\}$//g' 2>/dev/null)
|
||||
#host:
|
||||
host=$(grep "host:" $single_server |awk -F 'host:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
#Host:
|
||||
@ -70,15 +70,15 @@ do
|
||||
#path:
|
||||
path=$(grep "path:" $single_server |awk -F 'path:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
#ws-path:
|
||||
ws_path=$(grep "ws-path:" $single_server |awk -F 'ws-path:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
ws_path=$(grep "ws-path:" $single_server |awk -F 'ws-path:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g' |sed 's/ \{0,\}\}$//g' 2>/dev/null)
|
||||
#headers_custom:
|
||||
headers=$(grep "custom:" $single_server |awk -F 'custom:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
headers=$(grep "custom:" $single_server |awk -F 'custom:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g' |sed 's/ \{0,\}\}$//g' 2>/dev/null)
|
||||
#uuid:
|
||||
uuid=$(grep "uuid:" $single_server |awk -F 'uuid:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
#alterId:
|
||||
alterId=$(grep "alterId:" $single_server |awk -F 'alterId:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
#network
|
||||
network=$(grep "network:" $single_server |awk -F 'network:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
network=$(grep "network:" $single_server |awk -F 'network:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g' |sed 's/ \{0,\}\}$//g' 2>/dev/null)
|
||||
#username
|
||||
username=$(grep "username:" $single_server |awk -F 'username:' '{print $2}' |sed 's/,.*//' |sed 's/\"//g' |sed 's/^ \{0,\}//g')
|
||||
|
||||
|
||||
@ -40,13 +40,12 @@ yml_servers_set()
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "$port" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -z "$udp" ] && [ -z "$obfs" ]; then
|
||||
udp=", udp: $udp"
|
||||
if [ -z "$password" ] && [ "$type" = "ss" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$obfs" != "none" ]; then
|
||||
@ -55,19 +54,16 @@ yml_servers_set()
|
||||
else
|
||||
obfss="plugin: obfs"
|
||||
fi
|
||||
else
|
||||
obfs=""
|
||||
fi
|
||||
|
||||
if [ ! -z "$udp" ] && [ "$obfs" = "none" ]; then
|
||||
udp=", udp: $udp"
|
||||
fi
|
||||
|
||||
if [ "$obfs_vmess" != "none" ]; then
|
||||
if [ "$type" = "vmess" ] && [ "$obfs" = "websocket" ]; then
|
||||
obfs_vmess=", network: ws"
|
||||
else
|
||||
obfs_vmess=""
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -z "$host" ]; then
|
||||
host="host: $host"
|
||||
fi
|
||||
@ -112,12 +108,22 @@ cat >> "$SERVER_FILE" <<-EOF
|
||||
udp: $udp
|
||||
EOF
|
||||
fi
|
||||
if [ ! -z "$obfss" ]; then
|
||||
if [ ! -z "$obfss" ] && [ ! -z "$host" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
$obfss
|
||||
plugin-opts:
|
||||
mode: $obfs
|
||||
$host
|
||||
EOF
|
||||
fi
|
||||
if [ ! -z "$tls" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
$tls
|
||||
EOF
|
||||
fi
|
||||
if [ ! -z "$skip_cert_verify" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
$skip_cert_verify
|
||||
EOF
|
||||
fi
|
||||
if [ ! -z "$path" ]; then
|
||||
@ -303,7 +309,7 @@ fi
|
||||
if [ "$create_config" != "0" ]; then
|
||||
echo "Rule:" >>$SERVER_FILE
|
||||
uci commit openclash
|
||||
cat $SERVER_FILE > "/etc/openclash/config.yaml" 2>/dev/null
|
||||
cat "$SERVER_FILE" > "/etc/openclash/config.yaml" 2>/dev/null
|
||||
else
|
||||
echo "正在更新配置文件服务器节点信息..." >$START_LOG
|
||||
/usr/share/openclash/yml_groups_set.sh
|
||||
@ -317,4 +323,3 @@ echo "配置文件更新完成!" >$START_LOG
|
||||
rm -rf $SERVER_FILE 2>/dev/null
|
||||
rm -rf /tmp/Proxy_Server 2>/dev/null
|
||||
rm -rf /tmp/yaml_groups.yaml 2>/dev/null
|
||||
/etc/init.d/openclash restart >/dev/null 2>&1 &
|
||||
|
||||
@ -21,7 +21,7 @@ msgid "Global Settings"
|
||||
msgstr "全局设置"
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "基本设置"
|
||||
msgstr "常规设置"
|
||||
|
||||
msgid "DNS Setting"
|
||||
msgstr "DNS设置"
|
||||
@ -382,8 +382,8 @@ msgstr "<可更新>"
|
||||
msgid "Chose to Download"
|
||||
msgstr "选择内核编译版本"
|
||||
|
||||
msgid "For Core Update, Wrong Version Will Not Work"
|
||||
msgstr "下载、更新内核前须设置,错误的版本将不能正常运行"
|
||||
msgid "Select Based On Your CPU Model For Core Update, Wrong Version Will Not Work"
|
||||
msgstr "请根据CPU架构选择以便下载、更新对应内核,错误的版本将不能正常运行"
|
||||
|
||||
msgid "Update Core File"
|
||||
msgstr "更新内核"
|
||||
@ -435,8 +435,8 @@ msgstr "只更新配置文件服务器节点信息"
|
||||
msgid "Type"
|
||||
msgstr "节点类型"
|
||||
|
||||
msgid "Alias"
|
||||
msgstr "节点别名(请勿重名)"
|
||||
msgid "Server Alias"
|
||||
msgstr "别名(请勿重名)"
|
||||
|
||||
msgid "Server Address"
|
||||
msgstr "服务器地址"
|
||||
@ -466,7 +466,7 @@ msgid "obfs-mode"
|
||||
msgstr "传输协议"
|
||||
|
||||
msgid "obfs-hosts"
|
||||
msgstr "混淆参数"
|
||||
msgstr "混淆参数(HOST)"
|
||||
|
||||
msgid "Auth Username"
|
||||
msgstr "登录用户名"
|
||||
@ -502,7 +502,7 @@ msgid "Choose The Operation Mode"
|
||||
msgstr "设置策略组挑选服务器节点的工作方式"
|
||||
|
||||
msgid "Group Name"
|
||||
msgstr "策略组别名(请勿重名)"
|
||||
msgstr "别名(请勿重名)"
|
||||
|
||||
msgid "Test URL"
|
||||
msgstr "检测地址(URL)"
|
||||
@ -511,28 +511,28 @@ msgid "Test Interval(s)"
|
||||
msgstr "检测频率(秒)"
|
||||
|
||||
msgid "Select"
|
||||
msgstr "手动选择"
|
||||
msgstr "手动选择(Select)"
|
||||
|
||||
msgid "URL-Test"
|
||||
msgstr "最低延迟"
|
||||
msgstr "最低延迟(URL-Test)"
|
||||
|
||||
msgid "Fallback"
|
||||
msgstr "故障切换"
|
||||
msgstr "故障切换(Fallback)"
|
||||
|
||||
msgid "Load-Balance"
|
||||
msgstr "负载均衡"
|
||||
msgstr "负载均衡(Load-Balance)"
|
||||
|
||||
msgid "Other Group"
|
||||
msgstr "包含其他策略组"
|
||||
msgstr "包含其他策略组(请勿重复添加)"
|
||||
|
||||
msgid "The added Proxy Groups Must Exist"
|
||||
msgstr "添加的策略组必须已创建"
|
||||
msgstr "注意:修改配置文件前添加的策略组必须已创建"
|
||||
|
||||
msgid "Proxy Group"
|
||||
msgstr "添加到策略组"
|
||||
msgstr "添加到策略组(请勿重复添加)"
|
||||
|
||||
msgid "No Need Set when Config Create, The added Proxy Groups Must Exist"
|
||||
msgstr "使用一键生成配置文件功能时无需设置,填写的策略组必须已创建"
|
||||
msgstr "注意:使用一键生成配置文件功能时无需设置此项,修改配置文件前添加的策略组必须已创建"
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user