Merge Mainline

This commit is contained in:
Tianling Shen 2020-12-25 19:25:12 +08:00
commit f100ec81b7
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
18 changed files with 416 additions and 53 deletions

View File

@ -60,7 +60,8 @@ luci-theme-edge source: [garypang13/luci-theme-edge](https://github.com//garypan
luci-app-beardropper source: [NateLol/natelol](https://github.com/NateLol/natelol).<br/>
luci-app-vssr source: [jerrykuku/luci-app-vssr](https://github.com/jerrykuku/luci-app-vssr).<br/>
luci-proto-modemmanager source: [nickberry17/luci-proto-modemmanager](https://github.com/nickberry17/luci-proto-modemmanager).<br/>
luci-theme-infinityfreedom source: [xiaoqingfengATGH/luci-theme-infinityfreedom](https://github.com/xiaoqingfengATGH/luci-theme-infinityfreedom).
luci-theme-infinityfreedom source: [xiaoqingfengATGH/luci-theme-infinityfreedom](https://github.com/xiaoqingfengATGH/luci-theme-infinityfreedom).<br/>
luci-proto-minieap source: [ysc3839/luci-proto-minieap](https://github.com/ysc3839/luci-proto-minieap).
## License
### Depend on their own License.

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.41.12
PKG_VERSION:=0.41.13
PKG_RELEASE:=beta
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>

View File

@ -462,6 +462,6 @@ function action_refresh_log()
end
function action_del_log()
luci.sys.exec("echo '' > /tmp/openclash.log")
luci.sys.exec(": > /tmp/openclash.log")
return
end

View File

@ -57,7 +57,7 @@ o = s:taboption("op_mode", Flag, "enable_udp_proxy", font_red..bold_on..translat
o.description = translate("Select Mode For UDP Traffics, The Servers Must Support UDP while Choose Proxy")
o:depends("en_mode", "redir-host")
o:depends("en_mode", "fake-ip")
o.default = "1"
o.default=1
o = s:taboption("op_mode", ListValue, "stack_type", translate("Select Stack Type"))
o.description = translate("Select Stack Type For Tun Mode, According To The Running Speed on Your Machine")
@ -83,7 +83,7 @@ o.default=0
o = s:taboption("op_mode", Flag, "common_ports", font_red..bold_on..translate("Common Ports Proxy Mode")..bold_off..font_off)
o.description = translate("Only Common Ports, Prevent BT/P2P Passing")
o.default = "0"
o.default=0
o:depends("en_mode", "redir-host")
o:depends("en_mode", "redir-host-tun")
o:depends("en_mode", "redir-host-vpn")
@ -91,7 +91,7 @@ o:depends("en_mode", "redir-host-mix")
o = s:taboption("op_mode", Flag, "china_ip_route", translate("China IP Route"))
o.description = translate("Bypass The China Network Flows, Improve Performance")
o.default = "0"
o.default=0
o:depends("en_mode", "redir-host")
o:depends("en_mode", "redir-host-tun")
o:depends("en_mode", "redir-host-vpn")
@ -99,7 +99,7 @@ o:depends("en_mode", "redir-host-mix")
o = s:taboption("op_mode", Flag, "small_flash_memory", translate("Small Flash Memory"))
o.description = translate("Move Core And GEOIP Data File To /tmp/etc/openclash For Small Flash Memory Device")
o.default = "0"
o.default=0
---- Operation Mode
switch_mode = s:taboption("op_mode", DummyValue, "", nil)
@ -145,7 +145,7 @@ o.default = "silent"
o = s:taboption("settings", Flag, "intranet_allowed", translate("Only intranet allowed"))
o.description = translate("When Enabled, The Control Panel And The Connection Broker Port Will Not Be Accessible From The Public Network")
o.default = 0
o.default=0
o = s:taboption("settings", Value, "proxy_port")
o.title = translate("Redir Port")
@ -178,11 +178,11 @@ o.description = translate("Please Make Sure Ports Available")
---- DNS Settings
o = s:taboption("dns", Flag, "enable_redirect_dns", font_red..bold_on..translate("Redirect Local DNS Setting")..bold_off..font_off)
o.description = translate("Set Local DNS Redirect")
o.default = 1
o.default=1
o = s:taboption("dns", Flag, "enable_custom_dns", font_red..bold_on..translate("Custom DNS Setting")..bold_off..font_off)
o.description = font_red..bold_on..translate("Set OpenClash Upstream DNS Resolve Server")..bold_off..font_off
o.default = 0
o.default=0
o = s:taboption("dns", Flag, "ipv6_enable", translate("Enable ipv6 Resolve"))
o.description = font_red..bold_on..translate("Enable Clash to Resolve ipv6 DNS Requests")..bold_off..font_off
@ -300,7 +300,7 @@ o.description = translate("In The Fake-IP Mode, Only Pure IP Requests Are Suppor
---- Rules Settings
o = s:taboption("rules", Flag, "rule_source", translate("Enable Other Rules"))
o.description = translate("Use Other Rules")
o.default = 0
o.default=0
if op_mode == "fake-ip" then
o = s:taboption("rules", Flag, "enable_custom_clash_rules", font_red..bold_on..translate("Custom Clash Rules(Access Control)")..bold_off..font_off)
@ -308,7 +308,7 @@ else
o = s:taboption("rules", Flag, "enable_custom_clash_rules", font_red..bold_on..translate("Custom Clash Rules")..bold_off..font_off)
end
o.description = translate("Use Custom Rules")
o.default = 0
o.default=0
custom_rules = s:taboption("rules", Value, "custom_rules")
custom_rules:depends("enable_custom_clash_rules", 1)

View File

@ -52,7 +52,7 @@ function line_tolocal(str){
}else{
strt[i]=v;}})
var old_log_line = sessionStorage.log_line;
if ( old_log_line != null) {
if ( old_log_line != null && strt.length != null ) {
if (old_log_line - strt.length < 0) {
sessionStorage.log_line = strt.length;
return strt.slice('-'+(strt.length-old_log_line))
@ -68,11 +68,14 @@ function line_tolocal(str){
return strt
}
}
else if ( strt.length != null ) {
sessionStorage.log_line = strt.length;
return strt
}
else {
sessionStorage.log_line = strt.length;
return strt
}
sessionStorage.log_line = "0";
return strt
}
}
function poll_log(){

View File

@ -922,15 +922,10 @@ do_run_file()
nohup /usr/share/openclash/openclash_core.sh "$core_type" &
}
if [ "$china_ip_route" = "1" ]; then
if [ ! -f "$chnr_path" ]; then
echo "检测到大陆白名单列表不存在,准备开始下载..." >$START_LOG
nofile=1
nohup /usr/share/openclash/openclash_chnroute.sh &
else
ipset -! flush china_ip_route 2>/dev/null
ipset -! restore </etc/openclash/china_ip_route.ipset 2>/dev/null
fi
if [ "$china_ip_route" = "1" ] && [ ! -f "$chnr_path" ]; then
echo "检测到大陆白名单列表不存在,准备开始下载..." >$START_LOG
nofile=1
nohup /usr/share/openclash/openclash_chnroute.sh &
fi
if [ "$nofile" = "1" ]; then
@ -1238,6 +1233,11 @@ cat > "/var/etc/openclash.include" <<-EOF
/etc/init.d/openclash reload >/dev/null 2>&1
EOF
if [ "$china_ip_route" = "1" ] && [ -f "/etc/openclash/china_ip_route.ipset" ]; then
ipset -! flush china_ip_route 2>/dev/null
ipset -! restore </etc/openclash/china_ip_route.ipset 2>/dev/null
fi
#lan_ac
if [ "$operation_mode" = "redir-host" ] && [ "$en_mode" = "redir-host" ]; then
if [ "$lan_ac_mode" = "0" ]; then
@ -1356,7 +1356,7 @@ if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 3 ]; then
fi
iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1
if [ "$en_mode" = "redir-host" ]; then
iptables -t mangle -A openclash -m set --match-set china_ip_route dst -j RETURN >/dev/null 2>&1
iptables -t nat -A openclash_output -m set --match-set china_ip_route dst -j RETURN >/dev/null 2>&1
fi
if [ "$intranet_allowed" -eq 1 ]; then
iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -p tcp -j DNAT --to-destination "$lan_ip:$proxy_port"

View File

@ -73,6 +73,7 @@ EOF
cat >> "$DEBUG_LOG" <<-EOF
#===================== 系统信息 =====================#
主机型号: $(cat /tmp/sysinfo/model 2>/dev/null)
固件版本: $(cat /usr/lib/os-release 2>/dev/null |grep OPENWRT_RELEASE 2>/dev/null |awk -F '"' '{print $2}' 2>/dev/null)
LuCI版本: $(opkg status luci 2>/dev/null |grep 'Version' |awk -F ': ' '{print $2}' 2>/dev/null)
@ -92,6 +93,7 @@ EOF
cat >> "$DEBUG_LOG" <<-EOF
#===================== 依赖检查 =====================#
dnsmasq-full: $(ts_re "$(opkg status dnsmasq-full 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
coreutils: $(ts_re "$(opkg status coreutils 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
coreutils-nohup: $(ts_re "$(opkg status coreutils-nohup 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
@ -102,11 +104,16 @@ ca-certificates: $(ts_re "$(opkg status ca-certificates 2>/dev/null |grep 'Statu
ipset: $(ts_re "$(opkg status ipset 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
ip-full: $(ts_re "$(opkg status ip-full 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
iptables-mod-tproxy: $(ts_re "$(opkg status iptables-mod-tproxy 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
kmod-ipt-tproxy: $(ts_re "$(opkg status kmod-ipt-tproxy 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
iptables-mod-extra: $(ts_re "$(opkg status iptables-mod-extra 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
kmod-ipt-extra: $(ts_re "$(opkg status kmod-ipt-extra 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
libcap: $(ts_re "$(opkg status libcap 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
libcap-bin: $(ts_re "$(opkg status libcap-bin 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
ruby: $(ts_re "$(opkg status ruby 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
ruby-yaml: $(ts_re "$(opkg status ruby-yaml 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
ruby-psych: $(ts_re "$(opkg status ruby-psych 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
ruby-pstore: $(ts_re "$(opkg status ruby-pstore 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
ruby-dbm: $(ts_re "$(opkg status ruby-dbm 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
kmod-tun(TUN模式): $(ts_re "$(opkg status kmod-tun 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
luci-compat(Luci-19.07): $(ts_re "$(opkg status luci-compat 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
EOF
@ -115,6 +122,7 @@ EOF
cat >> "$DEBUG_LOG" <<-EOF
#===================== 内核检查 =====================#
EOF
if pidof clash >/dev/null; then
cat >> "$DEBUG_LOG" <<-EOF
@ -209,6 +217,7 @@ fi
cat >> "$DEBUG_LOG" <<-EOF
#===================== 插件设置 =====================#
当前配置文件: $RAW_CONFIG_FILE
启动配置文件: $CONFIG_FILE
运行模式: $en_mode
@ -282,7 +291,15 @@ iptables-save -t mangle >> "$DEBUG_LOG" 2>/dev/null
cat >> "$DEBUG_LOG" <<-EOF
#===================== IPSET状态 =====================#
EOF
ipset list |grep "Name:" >> "$DEBUG_LOG"
cat >> "$DEBUG_LOG" <<-EOF
#===================== 路由表状态 =====================#
EOF
echo "#route -n" >> "$DEBUG_LOG"
route -n >> "$DEBUG_LOG" 2>/dev/null
@ -295,6 +312,7 @@ if [ "$en_mode" != "fake-ip" ] && [ "$en_mode" != "redir-host" ]; then
cat >> "$DEBUG_LOG" <<-EOF
#===================== Tun设备状态 =====================#
EOF
ip tuntap list >> "$DEBUG_LOG" 2>/dev/null
fi
@ -302,12 +320,14 @@ fi
cat >> "$DEBUG_LOG" <<-EOF
#===================== 端口占用状态 =====================#
EOF
netstat -nlp |grep clash >> "$DEBUG_LOG" 2>/dev/null
cat >> "$DEBUG_LOG" <<-EOF
#===================== 测试本机DNS查询 =====================#
EOF
nslookup www.baidu.com >> "$DEBUG_LOG" 2>/dev/null
@ -315,6 +335,7 @@ if [ -s "/tmp/resolv.conf.auto" ]; then
cat >> "$DEBUG_LOG" <<-EOF
#===================== resolv.conf.auto =====================#
EOF
cat /tmp/resolv.conf.auto >> "$DEBUG_LOG"
fi
@ -323,6 +344,7 @@ if [ -s "/tmp/resolv.conf.d/resolv.conf.auto" ]; then
cat >> "$DEBUG_LOG" <<-EOF
#===================== resolv.conf.d =====================#
EOF
cat /tmp/resolv.conf.d/resolv.conf.auto >> "$DEBUG_LOG"
fi
@ -330,12 +352,14 @@ fi
cat >> "$DEBUG_LOG" <<-EOF
#===================== 测试本机网络连接 =====================#
EOF
curl -I -m 5 www.baidu.com >> "$DEBUG_LOG" 2>/dev/null
cat >> "$DEBUG_LOG" <<-EOF
#===================== 测试本机网络下载 =====================#
EOF
VERSION_URL="https://raw.githubusercontent.com/vernesong/OpenClash/master/version"
if pidof clash >/dev/null; then
@ -347,6 +371,7 @@ fi
cat >> "$DEBUG_LOG" <<-EOF
#===================== 最近运行日志 =====================#
EOF
tail -n 50 "/tmp/openclash.log" >> "$DEBUG_LOG" 2>/dev/null

View File

@ -16,7 +16,7 @@ urlencode() {
if [ "$#" -eq "1" ]; then
data=$(curl -s -o /dev/null -w %{url_effective} --get --data-urlencode "$1" "")
if [ ! -z "$data" ]; then
echo "${data##/?}"
echo "$(echo ${data##/?} |sed 's/\//%2f/g' |sed 's/:/%3a/g' |sed 's/?/%3f/g' |sed 's/(/%28/g' |sed 's/)/%29/g' |sed 's/\^/%5e/g' |sed 's/=/%3d/g' |sed 's/|/%7c/g')"
fi
fi
}
@ -36,7 +36,7 @@ restore_history() {
GROUP_STATE_NUM=$(expr "$GROUP_STATE_NUM" + 1)
GROUP_STATE=$(GROUP_STATE "$GROUP_NAME")
done
curl -m 5 --retry 2 -H "Authorization: Bearer ${SECRET}" -H "Content-Type:application/json" -X PUT -d '{"name":"'"$NOW_NAME"'"}' http://"$LAN_IP":"$PORT"/proxies/"$GROUP_NAME" >/dev/null 2>&1
curl -m 5 --retry 2 -H "Authorization: Bearer ${SECRET}" -H "Content-Type:application/json" -X PUT -d '{"name":"'"$NOW_NAME"'"}' http://"$LAN_IP":"$PORT"/proxies/"$GROUP_NAME" >> "$LOG_FILE"
}
close_all_conection() {

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,16 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-proto-minieap
PKG_VERSION:=2.1
PKG_RELEASE:=1
PKG_MAINTAINER:=Richard Yu <yurichard3839@gmail.com>
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
LUCI_TITLE:=LuCI support for MiniEAP
LUCI_DEPENDS:=
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,100 @@
local map, section, net = ...
local l = section.tab_names
for i, v in ipairs(l) do
if v == "firewall" then
table.remove(l, i)
break
end
end
section.tabs["firewall"] = nil
l = section.tabs["advanced"].childs
for i, v in ipairs(l) do
if v.option == "delegate" then
table.remove(l, i)
break
end
end
section:tab("rjv3", translate("RJv3 Plugin Settings"), nil)
local i = #section.tab_names
local t = section.tab_names
t[i], t[i-1] = t[i-1], t[i]
local o = section:taboption("general", Value, "username", translate("Username"))
o = section:taboption("general", Value, "password", translate("Password"))
o.password = true
o = section:taboption("general", DynamicList, "module", translate("Packet plugins"))
o.rmempty = true
o.datatype = "list(string)"
o:value("rjv3", "rjv3")
o:value("printer", "printer")
o = section:taboption("advanced", Value, "max_fail", translate("Max fail"))
o.datatype = "uinteger"
o.placeholder = "3"
o = section:taboption("advanced", Value, "max_retries", translate("Max retries"))
o.datatype = "uinteger"
o.placeholder = "3"
o = section:taboption("advanced", Flag, "no_auto_reauth", translate("No auto reauth"))
o = section:taboption("advanced", Value, "wait_after_fail", translate("Wait after fail"))
o.datatype = "uinteger"
o.placeholder = "30"
o = section:taboption("advanced", Value, "stage_timeout", translate("Stage timeout"))
o.datatype = "uinteger"
o.placeholder = "5"
o = section:taboption("advanced", Value, "auth_round", translate("Auth Round"))
o.datatype = "uinteger"
o.placeholder = "1"
o = section:taboption("advanced", Value, "log_file", translate("Log file"))
o.placeholder = "/var/log/minieap.log"
-- rjv3 plugin
o = section:taboption("rjv3", Value, "heartbeat", translate("Heartbeat interval"))
o.datatype = "uinteger"
o.placeholder = "60"
o = section:taboption("rjv3", ListValue, "eap_bcast_addr", translate("EAP broadcast address"))
o:value(0, translate("Standard")) -- BROADCAST_STANDARD
o:value(1, translate("RJ private")) -- BROADCAST_RJ
-- o:value(2, translate("BROADCAST_CER")) -- BROADCAST_CER
o = section:taboption("rjv3", ListValue, "dhcp_type", translate("DHCP type"))
o:value(0, translate("Disabled")) -- DHCP_NONE
o:value(1, translate("Double Auth")) -- DHCP_DOUBLE_AUTH
o:value(2, translate("DHCP After Auth")) -- DHCP_AFTER_AUTH
o:value(3, translate("DHCP Before Auth")) -- DHCP_BEFORE_AUTH
o = section:taboption("rjv3", DynamicList, "rj_option", translate("RJ option"))
o.rmempty = true
o.placeholder = "<type>:<value>[:r]"
o = section:taboption("rjv3", Value, "service", translate("Service name"))
o.placeholder = "internet"
o = section:taboption("rjv3", Value, "version_str", translate("Version string"))
o.placeholder = "RG-SU For Linux V1.0"
o = section:taboption("rjv3", Value, "dhcp_script", translate("DHCP script"))
o = section:taboption("rjv3", Value, "fake_dns1", translate("Fake DNS 1"))
o.datatype = "ip4addr"
o = section:taboption("rjv3", Value, "fake_dns2", translate("Fake DNS 2"))
o.datatype = "ip4addr"
o = section:taboption("rjv3", Value, "fake_serial", translate("Fake HDD serial"))
o = section:taboption("rjv3", Value, "max_dhcp_count", translate("Max DHCP count"))
o.datatype = "uinteger"
o.placeholder = "3"

View File

@ -0,0 +1,20 @@
local netmod = luci.model.network
local proto = netmod:register_protocol("minieap")
function proto.get_i18n(self)
return luci.i18n.translate("MiniEAP client")
end
function proto.is_installed(self)
return nixio.fs.access("/lib/netifd/proto/minieap.sh")
end
function proto.opkg_package(self)
return "minieap"
end
if netmod["register_error_code"] then
netmod:register_error_code("MISSING_USER_OR_PASS", luci.i18n.translate("Missing username or password"))
netmod:register_error_code("EXIT_FAILURE", luci.i18n.translate("Program exited with failure. See system log for more information."))
end

View File

@ -0,0 +1,95 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Auth Round"
msgstr ""
msgid "DHCP After Auth"
msgstr ""
msgid "DHCP Before Auth"
msgstr ""
msgid "DHCP script"
msgstr ""
msgid "DHCP type"
msgstr ""
msgid "Disabled"
msgstr ""
msgid "Double Auth"
msgstr ""
msgid "EAP broadcast address"
msgstr ""
msgid "Fake DNS 1"
msgstr ""
msgid "Fake DNS 2"
msgstr ""
msgid "Fake HDD serial"
msgstr ""
msgid "Heartbeat interval"
msgstr ""
msgid "Log file"
msgstr ""
msgid "Max DHCP count"
msgstr ""
msgid "Max fail"
msgstr ""
msgid "Max retries"
msgstr ""
msgid "MiniEAP client"
msgstr ""
msgid "Missing username or password"
msgstr ""
msgid "No auto reauth"
msgstr ""
msgid "Packet plugins"
msgstr ""
msgid "Password"
msgstr ""
msgid "Program exited with failure. See system log for more information."
msgstr ""
msgid "RJ option"
msgstr ""
msgid "RJ private"
msgstr ""
msgid "RJv3 Plugin Settings"
msgstr ""
msgid "Service name"
msgstr ""
msgid "Stage timeout"
msgstr ""
msgid "Standard"
msgstr ""
msgid "Username"
msgstr ""
msgid "Version string"
msgstr ""
msgid "Wait after fail"
msgstr ""

View File

@ -0,0 +1,95 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Auth Round"
msgstr "认证次数"
msgid "DHCP After Auth"
msgstr "认证后 DHCP"
msgid "DHCP Before Auth"
msgstr "认证前 DHCP"
msgid "DHCP script"
msgstr "DHCP 脚本"
msgid "DHCP type"
msgstr "DHCP 方式"
msgid "Disabled"
msgstr "禁用"
msgid "Double Auth"
msgstr "二次认证"
msgid "EAP broadcast address"
msgstr "EAP 广播地址"
msgid "Fake DNS 1"
msgstr "自定义主 DNS 地址"
msgid "Fake DNS 2"
msgstr "自定义次 DNS 地址"
msgid "Fake HDD serial"
msgstr "自定义硬盘序列号"
msgid "Heartbeat interval"
msgstr "心跳间隔"
msgid "Log file"
msgstr "日志文件"
msgid "Max DHCP count"
msgstr "最大 DHCP 次数"
msgid "Max fail"
msgstr "最大失败次数"
msgid "Max retries"
msgstr "最大重试次数"
msgid "MiniEAP client"
msgstr "MiniEAP 客户端"
msgid "Missing username or password"
msgstr "用户名或密码为空"
msgid "No auto reauth"
msgstr "不自动重新认证"
msgid "Packet plugins"
msgstr "数据包插件"
msgid "Password"
msgstr "密码"
msgid "Program exited with failure. See system log for more information."
msgstr "程序出错退出。查看系统日志获取更多信息。"
msgid "RJ option"
msgstr "锐捷选项"
msgid "RJ private"
msgstr "锐捷私有"
msgid "RJv3 Plugin Settings"
msgstr "RJv3 插件设置"
msgid "Service name"
msgstr "服务名称"
msgid "Stage timeout"
msgstr "阶段超时"
msgid "Standard"
msgstr "标准"
msgid "Username"
msgstr "用户名"
msgid "Version string"
msgstr "版本字符串"
msgid "Wait after fail"
msgstr "失败后等待时间"

View File

@ -17,7 +17,9 @@ define Package/autocore-arm
TITLE:=Arm auto core loadbalance script.
MAINTAINER:=CN_SZTL
DEPENDS:=@(TARGET_bcm27xx||TARGET_bcm53xx||TARGET_mvebu||TARGET_ipq40xx||TARGET_ipq806x||TARGET_rockchip) \
+TARGET_bcm53xx:nvram +(TARGET_ipq40xx||TARGET_ipq806x):lm-sensors
+TARGET_bcm27xx:bcm27xx-userland \
+TARGET_bcm53xx:nvram \
+(TARGET_ipq40xx||TARGET_ipq806x):lm-sensors
VARIANT:=arm
endef

View File

@ -4,7 +4,9 @@ cpu_arch="$(cat "/proc/cpuinfo" | grep "model name" | sed -n "1p" | awk -F ': '
[ -z "${cpu_arch}" ] && cpu_arch="ARMv8 Processor"
cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)"
if grep -q "bcm53xx" "/etc/openwrt_release"; then
if grep -q "bcm27xx" "/etc/openwrt_release"; then
cpu_freq="$(expr $(vcgencmd measure_clock arm | awk -F '=' '{print $2}') / 1000000)Mhz"
elif grep -q "bcm53xx" "/etc/openwrt_release"; then
cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz"
elif grep -q "mvebu" "/etc/openwrt_release"; then
cpu_freq="$(cat "/proc/cpuinfo" | grep "BogoMIPS" | sed -n "1p" | awk -F ': ' '{print $2}')MHz"
@ -17,6 +19,10 @@ fi
if grep -q "ipq" "/etc/openwrt_release"; then
echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq})"
else
cpu_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C"
if grep -q "bcm27xx" "/etc/openwrt_release"; then
cpu_temp="$(vcgencmd measure_temp | awk -F '=' '{print $2}' | awk -F "'" '{print $1}')°C"
else
cpu_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C"
fi
echo -n "${cpu_arch} x ${cpu_cores} (${big_cpu_freq}${cpu_freq}, ${cpu_temp})"
fi

View File

@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
PKG_VERSION:=4
PKG_RELEASE:=3
PKG_DATE:=20201211
PKG_RELEASE:=4
PKG_DATE:=20201221
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

View File

@ -382,15 +382,15 @@ run_socks() {
;;
xray)
lua $API_GEN_XRAY -node $node -socks_proxy_port $socks_port > $config_file
ln_start_bin "$(first_type $(config_t_get global_app xray_file notset)/xray xray)" xray $log_file -config="$config_file"
ln_start_bin "$(first_type $(config_t_get global_app xray_file) xray)" xray $log_file -config="$config_file"
;;
v2ray)
lua $API_GEN_XRAY -node $node -socks_proxy_port $socks_port > $config_file
ln_start_bin "$(first_type $(config_t_get global_app v2ray_file notset)/v2ray v2ray)" v2ray $log_file -config="$config_file"
ln_start_bin "$(first_type $(config_t_get global_app v2ray_file) v2ray)" v2ray $log_file -config="$config_file"
;;
trojan-go)
lua $API_GEN_TROJAN -node $node -run_type client -local_addr $bind -local_port $socks_port -server_host $server_host -server_port $port > $config_file
ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file notset) trojan-go)" trojan-go $log_file -config "$config_file"
ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file) trojan-go)" trojan-go $log_file -config "$config_file"
;;
trojan*)
lua $API_GEN_TROJAN -node $node -run_type client -local_addr $bind -local_port $socks_port -server_host $server_host -server_port $port > $config_file
@ -406,7 +406,7 @@ run_socks() {
[ "$protocol" == "wsclient" ] && {
[ "$brook_tls" == "1" ] && server_host="wss://${server_host}" || server_host="ws://${server_host}"
}
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_SOCKS_$id" $log_file "$protocol" --socks5 "$bind:$socks_port" -s "$server_host:$port" -p "$(config_n_get $node password)"
ln_start_bin "$(first_type $(config_t_get global_app brook_file) brook)" "brook_SOCKS_$id" $log_file "$protocol" --socks5 "$bind:$socks_port" -s "$server_host:$port" -p "$(config_n_get $node password)"
;;
ss|ssr)
lua $API_GEN_SS -node $node -local_addr "0.0.0.0" -local_port $socks_port -server_host $server_host -server_port $port > $config_file
@ -418,7 +418,7 @@ run_socks() {
[ "$http_port" != "0" ] && [ "$http_config_file" != "nil" ] && {
lua $API_GEN_XRAY_PROTO -local_proto http -local_address "0.0.0.0" -local_port $http_port -server_proto socks -server_address "127.0.0.1" -server_port $socks_port -server_username $_username -server_password $_password > $http_config_file
echo lua $API_GEN_XRAY_PROTO -local_proto http -local_address "0.0.0.0" -local_port $http_port -server_proto socks -server_address "127.0.0.1" -server_port $socks_port -server_username $_username -server_password $_password
ln_start_bin "$(first_type $(config_t_get global_app xray_file notset)/xray xray)" xray $log_file -config="$http_config_file"
ln_start_bin "$(first_type $(config_t_get global_app xray_file) xray)" xray $log_file -config="$http_config_file"
}
unset _username _password _auth
}
@ -467,17 +467,17 @@ run_redir() {
xray)
local loglevel=$(config_t_get global loglevel "warning")
lua $API_GEN_XRAY -node $node -proto udp -redir_port $local_port -loglevel $loglevel > $config_file
ln_start_bin "$(first_type $(config_t_get global_app xray_file notset)/xray xray)" xray $log_file -config="$config_file"
ln_start_bin "$(first_type $(config_t_get global_app xray_file) xray)" xray $log_file -config="$config_file"
;;
v2ray)
local loglevel=$(config_t_get global loglevel "warning")
lua $API_GEN_XRAY -node $node -proto udp -redir_port $local_port -loglevel $loglevel > $config_file
ln_start_bin "$(first_type $(config_t_get global_app v2ray_file notset)/v2ray v2ray)" v2ray $log_file -config="$config_file"
ln_start_bin "$(first_type $(config_t_get global_app v2ray_file) v2ray)" v2ray $log_file -config="$config_file"
;;
trojan-go)
local loglevel=$(config_t_get global trojan_loglevel "2")
lua $API_GEN_TROJAN -node $node -run_type nat -local_addr "0.0.0.0" -local_port $local_port -loglevel $loglevel > $config_file
ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file notset) trojan-go)" trojan-go $log_file -config "$config_file"
ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file) trojan-go)" trojan-go $log_file -config "$config_file"
;;
trojan*)
local loglevel=$(config_t_get global trojan_loglevel "2")
@ -492,7 +492,7 @@ run_redir() {
if [ "$protocol" == "wsclient" ]; then
echolog "Brook的WebSocket不支持UDP转发"
else
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_udp_${index}" $log_file tproxy -l ":$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)"
ln_start_bin "$(first_type $(config_t_get global_app brook_file) brook)" "brook_udp_${index}" $log_file tproxy -l ":$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)"
fi
;;
ss|ssr)
@ -517,7 +517,7 @@ run_redir() {
[ -n "$kcptun_server_host" ] && run_kcptun_ip=$(get_host_ip $network_type $kcptun_server_host)
KCPTUN_REDIR_PORT=$(get_new_port $KCPTUN_REDIR_PORT tcp)
kcptun_params="-l 0.0.0.0:$KCPTUN_REDIR_PORT -r $run_kcptun_ip:$kcptun_port $kcptun_config"
ln_start_bin "$(first_type $(config_t_get global_app kcptun_client_file notset) kcptun-client)" "kcptun_tcp_${index}" $log_file $kcptun_params
ln_start_bin "$(first_type $(config_t_get global_app kcptun_client_file) kcptun-client)" "kcptun_tcp_${index}" $log_file $kcptun_params
fi
fi
local _socks_flag _socks_address _socks_port _socks_username _socks_password
@ -534,19 +534,19 @@ run_redir() {
local extra_param="tcp"
[ "${index}" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && extra_param="tcp,udp"
lua $API_GEN_XRAY -node $node -proto $extra_param -redir_port $local_port -loglevel $loglevel > $config_file
ln_start_bin "$(first_type $(config_t_get global_app xray_file notset)/xray xray)" xray $log_file -config="$config_file"
ln_start_bin "$(first_type $(config_t_get global_app xray_file) xray)" xray $log_file -config="$config_file"
;;
v2ray)
local loglevel=$(config_t_get global loglevel "warning")
local extra_param="tcp"
[ "${index}" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && extra_param="tcp,udp"
lua $API_GEN_XRAY -node $node -proto $extra_param -redir_port $local_port -loglevel $loglevel > $config_file
ln_start_bin "$(first_type $(config_t_get global_app v2ray_file notset)/v2ray v2ray)" v2ray $log_file -config="$config_file"
ln_start_bin "$(first_type $(config_t_get global_app v2ray_file) v2ray)" v2ray $log_file -config="$config_file"
;;
trojan-go)
local loglevel=$(config_t_get global trojan_loglevel "2")
lua $API_GEN_TROJAN -node $node -run_type nat -local_addr "0.0.0.0" -local_port $local_port -loglevel $loglevel > $config_file
ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file notset) trojan-go)" trojan-go $log_file -config "$config_file"
ln_start_bin "$(first_type $(config_t_get global_app trojan_go_file) trojan-go)" trojan-go $log_file -config "$config_file"
;;
trojan*)
local loglevel=$(config_t_get global trojan_loglevel "2")
@ -566,7 +566,7 @@ run_redir() {
if [ "$protocol" == "wsclient" ]; then
[ "$brook_tls" == "1" ] && server_ip="wss://${server_ip}" || server_ip="ws://${server_ip}"
socks_port=$(get_new_port 2081 tcp)
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_${index}" $log_file wsclient --socks5 "127.0.0.1:$socks_port" -s "$server_ip:$port" -p "$(config_n_get $node password)"
ln_start_bin "$(first_type $(config_t_get global_app brook_file) brook)" "brook_tcp_${index}" $log_file wsclient --socks5 "127.0.0.1:$socks_port" -s "$server_ip:$port" -p "$(config_n_get $node password)"
_socks_flag=1
_socks_address="127.0.0.1"
_socks_port=$socks_port
@ -577,12 +577,12 @@ run_redir() {
server_ip=127.0.0.1
port=$KCPTUN_REDIR_PORT
}
ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_${index}" $log_file tproxy -l ":$local_port" -s "$server_ip:$port" -p "$(config_n_get $node password)"
ln_start_bin "$(first_type $(config_t_get global_app brook_file) brook)" "brook_tcp_${index}" $log_file tproxy -l ":$local_port" -s "$server_ip:$port" -p "$(config_n_get $node password)"
fi
;;
ss|ssr)
if [ "$kcptun_use" == "1" ]; then
lua $API_GEN_SS -node $node -local_addr "0.0.0.0" -local_port $socks_port -server_host "127.0.0.1" -server_port $KCPTUN_REDIR_PORT > $config_file
lua $API_GEN_SS -node $node -local_addr "0.0.0.0" -local_port $local_port -server_host "127.0.0.1" -server_port $KCPTUN_REDIR_PORT > $config_file
process=1
[ "${index}" == 1 ] && [ "$UDP_NODE1" == "tcp" ] && echolog "Kcptun不支持UDP转发"
else
@ -1260,7 +1260,7 @@ start() {
start_redir UDP udp
start_dns
add_dnsmasq
source $APP_PATH/iptables.sh start
source $APP_PATH/iptables.sh start &
/etc/init.d/dnsmasq restart >/dev/null 2>&1
echolog "重启 dnsmasq 服务[$?]"
}