ntlf9t: move all LuCI apps to luci feed
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
parent
6f85331c74
commit
d70ee37f48
@ -1,15 +0,0 @@
|
||||
#
|
||||
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI Support for advancedsetting
|
||||
LUCI_DEPENDS:=
|
||||
PKG_VERSION:=1.1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,13 +0,0 @@
|
||||
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
|
||||
|
||||
module("luci.controller.advancedsetting", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/advancedsetting") then
|
||||
return
|
||||
end
|
||||
|
||||
local page
|
||||
page = entry({"admin", "system", "advancedsetting"}, cbi("advancedsetting"), _("Advanced Setting"), 60)
|
||||
page.dependent = true
|
||||
end
|
||||
@ -1,75 +0,0 @@
|
||||
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
|
||||
local fs = require "nixio.fs"
|
||||
local sys = require "luci.sys"
|
||||
m = Map("advancedsetting", translate("Advanced Setting"), translate("Direct editing of built-in Script Documents for various services, unless you know what you are doing, do not easily modify these configuration documents"))
|
||||
s = m:section(TypedSection, "advancedsetting")
|
||||
s.anonymous=true
|
||||
--dnsmasq
|
||||
if nixio.fs.access("/etc/dnsmasq.conf") then
|
||||
s:tab("config1", translate("dnsmasq"),translate("This page is the document content for configuring /etc/dnsmasq.conf. Restart takes effect after application is saved"))
|
||||
conf = s:taboption("config1", Value, "editconf1", nil, translate("Each line of the opening numeric symbol (#) or semicolon (;) is considered a comment; delete (;) and enable the specified option."))
|
||||
conf.template = "cbi/tvalue"
|
||||
conf.rows = 20
|
||||
conf.wrap = "off"
|
||||
function conf.cfgvalue(self, section)
|
||||
return fs.readfile("/etc/dnsmasq.conf") or ""
|
||||
end
|
||||
function conf.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
fs.writefile("/tmp/dnsmasq.conf", value)
|
||||
if (luci.sys.call("cmp -s /tmp/dnsmasq.conf /etc/dnsmasq.conf") == 1) then
|
||||
fs.writefile("/etc/dnsmasq.conf", value)
|
||||
luci.sys.call("/etc/init.d/dnsmasq restart >/dev/null")
|
||||
end
|
||||
fs.remove("/tmp/dnsmasq.conf")
|
||||
end
|
||||
end
|
||||
end
|
||||
--network
|
||||
if nixio.fs.access("/etc/config/network") then
|
||||
s:tab("config2", translate("network"),translate("This page is the document content for configuring /etc/config/network. Restart takes effect after application is saved"))
|
||||
conf = s:taboption("config2", Value, "editconf2", nil, translate("Each line of the opening numeric symbol (#) or semicolon (;) is considered a comment; delete (;) and enable the specified option."))
|
||||
conf.template = "cbi/tvalue"
|
||||
conf.rows = 20
|
||||
conf.wrap = "off"
|
||||
function conf.cfgvalue(self, section)
|
||||
return fs.readfile("/etc/config/network") or ""
|
||||
end
|
||||
function conf.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
fs.writefile("/tmp/netwok", value)
|
||||
if (luci.sys.call("cmp -s /tmp/network /etc/config/network") == 1) then
|
||||
fs.writefile("/etc/config/network", value)
|
||||
luci.sys.call("/etc/init.d/network restart >/dev/null")
|
||||
end
|
||||
fs.remove("/tmp/network")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--hosts
|
||||
if nixio.fs.access("/etc/hosts") then
|
||||
s:tab("config3", translate("hosts"),translate("This page is the document content for configuring /etc/hosts. Restart takes effect after application is saved"))
|
||||
conf = s:taboption("config3", Value, "editconf3", nil, translate("Each line of the opening numeric symbol (#) or semicolon (;) is considered a comment; delete (;) and enable the specified option."))
|
||||
conf.template = "cbi/tvalue"
|
||||
conf.rows = 20
|
||||
conf.wrap = "off"
|
||||
function conf.cfgvalue(self, section)
|
||||
return fs.readfile("/etc/hosts") or ""
|
||||
end
|
||||
function conf.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
fs.writefile("/tmp/etc/hosts", value)
|
||||
if (luci.sys.call("cmp -s /tmp/etc/hosts /etc/hosts") == 1) then
|
||||
fs.writefile("/etc/hosts", value)
|
||||
luci.sys.call("/etc/init.d/dnsmasq restart >/dev/null")
|
||||
end
|
||||
fs.remove("/tmp/etc/hosts")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return m
|
||||
@ -1,21 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "Advanced Setting"
|
||||
msgstr "高级设置"
|
||||
|
||||
msgid "Direct editing of built-in Script Documents for various services, unless you know what you are doing, do not easily modify these configuration documents"
|
||||
msgstr "各类服务内置脚本文档的直接编辑,除非你知道自己在干什么,否则请不要轻易修改这些配置文档"
|
||||
|
||||
msgid "This page is the document content for configuring /etc/dnsmasq.conf. Restart takes effect after application is saved"
|
||||
msgstr "本页是配置/etc/dnsmasq.conf的文档内容。应用保存后重启生效"
|
||||
|
||||
msgid "Each line of the opening numeric symbol (#) or semicolon (;) is considered a comment; delete (;) and enable the specified option."
|
||||
msgstr "开头的数字符号(#)或分号的每一行(;)被视为注释;删除(;)启用指定选项。"
|
||||
|
||||
msgid "This page is the document content for configuring /etc/config/network. Restart takes effect after application is saved"
|
||||
msgstr "本页是配置/etc/config/network的文档内容。"
|
||||
|
||||
msgid "This page is the document content for configuring /etc/hosts. Restart takes effect after application is saved"
|
||||
msgstr "本页是配置/etc/hosts的文档内容。"
|
||||
|
||||
@ -1 +0,0 @@
|
||||
config advancedsetting
|
||||
@ -1,24 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 chenhw2 <https://github.com/chenhw2/>
|
||||
#
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI Support for aliddns
|
||||
LUCI_DESCRIPTION:=LuCI Support for ALiDDNS.
|
||||
LUCI_DEPENDS:=+openssl-util +curl
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_NAME:=luci-app-aliddns
|
||||
PKG_VERSION:=0.3.0
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=chenhw2 <https://github.com/chenhw2/>
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,4 +0,0 @@
|
||||
module("luci.controller.aliddns",package.seeall)
|
||||
function index()
|
||||
entry({"admin","services","aliddns"},cbi("aliddns"),_("AliDDNS"),58)
|
||||
end
|
||||
@ -1,56 +0,0 @@
|
||||
local a=require"luci.sys"
|
||||
local e=luci.model.uci.cursor()
|
||||
local e=require"nixio.fs"
|
||||
require("luci.sys")
|
||||
local t,e,o
|
||||
|
||||
t=Map("aliddns",translate("AliDDNS"))
|
||||
|
||||
e=t:section(TypedSection,"base",translate("Base"))
|
||||
e.anonymous=true
|
||||
|
||||
enable=e:option(Flag,"enable",translate("enable"))
|
||||
enable.rmempty=false
|
||||
|
||||
enable=e:option(Flag,"clean",translate("Clean Before Update"))
|
||||
enable.rmempty=false
|
||||
|
||||
token=e:option(Value,"app_key",translate("Access Key ID"))
|
||||
email=e:option(Value,"app_secret",translate("Access Key Secret"))
|
||||
|
||||
iface=e:option(ListValue,"interface",translate("WAN-IP Source"),translate("Select the WAN-IP Source for AliDDNS, like wan/internet"))
|
||||
iface:value("",translate("Select WAN-IP Source"))
|
||||
iface:value("internet")
|
||||
iface:value("wan")
|
||||
|
||||
iface.rmempty=false
|
||||
main=e:option(Value,"main_domain",translate("Main Domain"),translate("For example: test.github.com -> github.com"))
|
||||
main.rmempty=false
|
||||
sub=e:option(Value,"sub_domain",translate("Sub Domain"),translate("For example: test.github.com -> test"))
|
||||
sub.rmempty=false
|
||||
time=e:option(Value,"time",translate("Inspection Time"),translate("Unit: Minute, Range: 1-59"))
|
||||
time.rmempty=false
|
||||
|
||||
e=t:section(TypedSection,"base",translate("Update Log"))
|
||||
e.anonymous=true
|
||||
local a="/var/log/aliddns.log"
|
||||
tvlog=e:option(TextValue,"sylogtext")
|
||||
tvlog.rows=16
|
||||
tvlog.readonly="readonly"
|
||||
tvlog.wrap="off"
|
||||
|
||||
function tvlog.cfgvalue(e,e)
|
||||
sylogtext=""
|
||||
if a and nixio.fs.access(a) then
|
||||
sylogtext=luci.sys.exec("tail -n 100 %s"%a)
|
||||
end
|
||||
return sylogtext
|
||||
end
|
||||
|
||||
tvlog.write=function(e,e,e)
|
||||
end
|
||||
local e=luci.http.formvalue("cbi.apply")
|
||||
if e then
|
||||
io.popen("/etc/init.d/aliddns restart")
|
||||
end
|
||||
return t
|
||||
@ -1,44 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "AliDDNS"
|
||||
msgstr "阿里DDNS"
|
||||
|
||||
msgid "enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Clean Before Update"
|
||||
msgstr "清除所有同名记录"
|
||||
|
||||
msgid "Base"
|
||||
msgstr "基本设置"
|
||||
|
||||
msgid "WAN-IP Source"
|
||||
msgstr "WAN-IP来源"
|
||||
|
||||
msgid "Select WAN-IP Source"
|
||||
msgstr "选择WAN-IP来源"
|
||||
|
||||
msgid "Select the WAN-IP Source for AliDDNS, like wan/internet"
|
||||
msgstr "动态域名的IP来源,如wan/internet"
|
||||
|
||||
msgid "Main Domain"
|
||||
msgstr "主域名"
|
||||
|
||||
msgid "Sub Domain"
|
||||
msgstr "子域名"
|
||||
|
||||
msgid "For example: test.github.com -> github.com"
|
||||
msgstr "例如: test.github.com 则填: github.com"
|
||||
|
||||
msgid "For example: test.github.com -> test"
|
||||
msgstr "例如: test.github.com, 则填: test"
|
||||
|
||||
msgid "Inspection Time"
|
||||
msgstr "检查时间"
|
||||
|
||||
msgid "Unit: Minute, Range: 1-59"
|
||||
msgstr "域名检查间隔时间,单位分钟,范围1-59"
|
||||
|
||||
msgid "Update Log"
|
||||
msgstr "更新记录"
|
||||
@ -1,4 +0,0 @@
|
||||
|
||||
config base 'base'
|
||||
option enable '0'
|
||||
option time '10'
|
||||
@ -1,64 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
NAME=aliddns
|
||||
|
||||
NE_TIPS='AliDDNS NOT ENABLED'
|
||||
|
||||
restart() {
|
||||
start
|
||||
}
|
||||
|
||||
uci_get_by_name() {
|
||||
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
uci_bool_by_name() {
|
||||
case "$(uci_get_by_name $1 $2)" in
|
||||
1|on|true|yes|enabled) return 0;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
add_hotplug() {
|
||||
cat <<EOF > "/etc/hotplug.d/iface/${START}-${NAME}"
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
[ "Z\$ACTION" = "Zifup" -a "Z\$INTERFACE" = "Zwan" ] || exit 0
|
||||
|
||||
DATE=\$(date +'%Y-%m-%d %H:%M:%S')
|
||||
( sleep 10 && ( echo "\$DATE IFUP-WAN" && /usr/sbin/aliddns ) >> /var/log/aliddns.log 2>&1 ) &
|
||||
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x "/etc/hotplug.d/iface/${START}-${NAME}"
|
||||
}
|
||||
|
||||
start() {
|
||||
$(uci_bool_by_name base enable) || {
|
||||
stop
|
||||
return 0
|
||||
}
|
||||
|
||||
add_hotplug
|
||||
|
||||
sed -i "/${NE_TIPS}/d" /var/log/aliddns.log
|
||||
|
||||
time=$(uci_get_by_name base time 10)
|
||||
[ 0 -lt $time -a $time -lt 60 ] || time=10
|
||||
|
||||
[ -f /etc/crontabs/root ] || mkdir -p /etc/crontabs && touch /etc/crontabs/root
|
||||
sed -i '/aliddns/d' /etc/crontabs/root
|
||||
echo "*/$time * * * * /usr/sbin/aliddns >> /var/log/aliddns.log 2>&1" >> /etc/crontabs/root
|
||||
/etc/init.d/cron restart
|
||||
|
||||
( /usr/sbin/aliddns >> /var/log/aliddns.log 2>&1 ) &
|
||||
}
|
||||
|
||||
stop() {
|
||||
rm -rf "/etc/hotplug.d/iface/${START}-${NAME}"
|
||||
sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1
|
||||
/etc/init.d/cron restart
|
||||
echo "${NE_TIPS}" > /var/log/aliddns.log
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@aliddns[-1]
|
||||
add ucitrack aliddns
|
||||
set ucitrack.@aliddns[-1].init=aliddns
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
exit 0
|
||||
@ -1,164 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
NAME=aliddns
|
||||
log_file=/var/log/$NAME.log
|
||||
|
||||
uci_get_by_name() {
|
||||
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
uci_bool_by_name() {
|
||||
case "$(uci_get_by_name $1 $2)" in
|
||||
1|on|true|yes|enabled) return 0;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
intelnetip() {
|
||||
tmp_ip=`curl -sL --connect-timeout 3 ns1.dnspod.net:6666`
|
||||
if [ "Z$tmp_ip" == "Z" ]; then
|
||||
tmp_ip=`curl -sL --connect-timeout 3 members.3322.org/dyndns/getip`
|
||||
fi
|
||||
if [ "Z$tmp_ip" == "Z" ]; then
|
||||
tmp_ip=`curl -sL --connect-timeout 3 14.215.150.17:6666`
|
||||
fi
|
||||
if [ "Z$tmp_ip" == "Z" ]; then
|
||||
tmp_ip=`curl -sL --connect-timeout 3 whatismyip.akamai.com`
|
||||
fi
|
||||
echo -n $tmp_ip
|
||||
}
|
||||
|
||||
resolve2ip() {
|
||||
# resolve2ip domain<string>
|
||||
domain=$1
|
||||
tmp_ip=`nslookup $domain ns1.alidns.com 2>/dev/null | sed '/^Server/d; /#53$/d' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | tail -n1`
|
||||
if [ "Z$tmp_ip" == "Z" ]; then
|
||||
tmp_ip=`nslookup $domain ns2.alidns.com 2>/dev/null | sed '/^Server/d; /#53$/d' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | tail -n1`
|
||||
fi
|
||||
if [ "Z$tmp_ip" == "Z" ]; then
|
||||
tmp_ip=`nslookup $domain 114.114.115.115 2>/dev/null | sed '/^Server/d; /#53$/d' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | tail -n1`
|
||||
fi
|
||||
if [ "Z$tmp_ip" == "Z" ]; then
|
||||
tmp_ip=`curl -sL --connect-timeout 3 "119.29.29.29/d?dn=$domain"`
|
||||
fi
|
||||
echo -n $tmp_ip
|
||||
}
|
||||
|
||||
check_aliddns() {
|
||||
echo "$DATE WAN-IP: ${ip}"
|
||||
if [ "Z$ip" == "Z" ]; then
|
||||
echo "$DATE ERROR, cant get WAN-IP..."
|
||||
return 0
|
||||
fi
|
||||
current_ip=$(resolve2ip "$sub_dm.$main_dm")
|
||||
if [ "Z$current_ip" == "Z" ]; then
|
||||
rrid='' # NO Resolve IP Means new Record_ID
|
||||
fi
|
||||
echo "$DATE DOMAIN-IP: ${current_ip}"
|
||||
if [ "Z$ip" == "Z$current_ip" ]; then
|
||||
echo "$DATE IP dont need UPDATE..."
|
||||
return 0
|
||||
else
|
||||
echo "$DATE UPDATING..."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
urlencode() {
|
||||
# urlencode url<string>
|
||||
out=''
|
||||
for c in $(echo -n $1 | sed 's/[^\n]/&\n/g'); do
|
||||
case $c in
|
||||
[a-zA-Z0-9._-]) out="$out$c" ;;
|
||||
*) out="$out$(printf '%%%02X' "'$c")" ;;
|
||||
esac
|
||||
done
|
||||
echo -n $out
|
||||
}
|
||||
|
||||
send_request() {
|
||||
# send_request action<string> args<string>
|
||||
local args="AccessKeyId=$ak_id&Action=$1&Format=json&$2&Version=2015-01-09"
|
||||
local hash=$(urlencode $(echo -n "GET&%2F&$(urlencode $args)" | openssl dgst -sha1 -hmac "$ak_sec&" -binary | openssl base64))
|
||||
curl -sSL --connect-timeout 5 "http://alidns.aliyuncs.com/?$args&Signature=$hash"
|
||||
}
|
||||
|
||||
get_recordid() {
|
||||
sed 's/RR/\n/g' | sed -n 's/.*RecordId[^0-9]*\([0-9]*\).*/\1\n/p' | sort -ru | sed /^$/d
|
||||
}
|
||||
|
||||
query_recordid() {
|
||||
send_request "DescribeSubDomainRecords" "SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&SubDomain=$sub_dm.$main_dm&Timestamp=$timestamp"
|
||||
}
|
||||
|
||||
update_record() {
|
||||
send_request "UpdateDomainRecord" "RR=$sub_dm&RecordId=$1&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip"
|
||||
}
|
||||
|
||||
add_record() {
|
||||
send_request "AddDomainRecord&DomainName=$main_dm" "RR=$sub_dm&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip"
|
||||
}
|
||||
|
||||
del_record() {
|
||||
send_request "DeleteDomainRecord" "RecordId=$1&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp"
|
||||
}
|
||||
|
||||
do_ddns_record() {
|
||||
if uci_bool_by_name base clean ; then
|
||||
query_recordid | get_recordid | while read rr; do
|
||||
echo "$DATE Clean record $sub_dm.$main_dm: $rr"
|
||||
del_record $rr >/dev/null
|
||||
timestamp=$(date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ")
|
||||
done
|
||||
rrid=''
|
||||
fi
|
||||
if [ "Z$rrid" == "Z" ]; then
|
||||
rrid=`query_recordid | get_recordid`
|
||||
fi
|
||||
if [ "Z$rrid" == "Z" ]; then
|
||||
rrid=`add_record | get_recordid`
|
||||
echo "$DATE ADD record $rrid"
|
||||
else
|
||||
update_record $rrid >/dev/null 2>&1
|
||||
echo "$DATE UPDATE record $rrid"
|
||||
fi
|
||||
if [ "Z$rrid" == "Z" ]; then
|
||||
# failed
|
||||
echo "$DATE # ERROR, Please Check Config/Time"
|
||||
else
|
||||
# save rrid
|
||||
uci set aliddns.base.record_id=$rrid
|
||||
uci commit aliddns
|
||||
echo "$DATE # UPDATED($ip)"
|
||||
fi
|
||||
}
|
||||
|
||||
clean_log() {
|
||||
if [ $(cat $log_file 2>/dev/null | wc -l) -ge 16 ]; then
|
||||
rm -f $log_file && touch $log_file
|
||||
echo "$DATE Log Cleaned"
|
||||
fi
|
||||
}
|
||||
|
||||
[ -x /usr/bin/openssl -a -x /usr/bin/curl -a -x /bin/sed ] ||
|
||||
( echo "Need [ openssl + curl + sed ]" && exit 1 )
|
||||
|
||||
ak_id=$(uci_get_by_name base app_key)
|
||||
ak_sec=$(uci_get_by_name base app_secret)
|
||||
rrid=$(uci_get_by_name base record_id)
|
||||
main_dm=$(uci_get_by_name base main_domain)
|
||||
sub_dm=$(uci_get_by_name base sub_domain)
|
||||
|
||||
iface=$(uci_get_by_name base interface)
|
||||
if [ "Z$iface" == "Zinternet" -o "Z$iface" == "Z" ]; then
|
||||
ip=$(intelnetip)
|
||||
else
|
||||
ip=$(ubus call network.interface.$iface status | grep '"address"' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')
|
||||
fi
|
||||
|
||||
DATE=$(date +'%Y-%m-%d %H:%M:%S')
|
||||
timestamp=$(date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ")
|
||||
|
||||
clean_log
|
||||
check_aliddns || do_ddns_record
|
||||
@ -1,65 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2017 openwrt-ssr
|
||||
# Copyright (C) 2017 yushi studio <ywb94@qq.com>
|
||||
# Copyright (C) 2018 openwrt-brook-tproxy
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=Brook LuCI interface
|
||||
LUCI_DESCRIPTION:=LuCI Support for Brook.
|
||||
LUCI_DEPENDS:=+ipset +ip +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +brook
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_NAME:=luci-app-brook
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=WouldChar
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
# check if we are on real system
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
echo "Removing rc.d symlink for brook"
|
||||
/etc/init.d/brook disable
|
||||
/etc/init.d/brook stop
|
||||
echo "Removing firewall rule for brook"
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete firewall.brook
|
||||
commit firewall
|
||||
EOF
|
||||
sed -i '/conf-dir/d' /etc/dnsmasq.conf
|
||||
/etc/init.d/dnsmasq restart
|
||||
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete firewall.brook
|
||||
set firewall.brook=include
|
||||
set firewall.brook.type=script
|
||||
set firewall.brook.path=/var/etc/brook.include
|
||||
set firewall.brook.reload=1
|
||||
commit firewall
|
||||
EOF
|
||||
( . /etc/uci-defaults/luci-brook ) && rm -f /etc/uci-defaults/luci-brook
|
||||
chmod 755 /etc/init.d/brook >/dev/null 2>&1
|
||||
/etc/init.d/brook enable >/dev/null 2>&1
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,110 +0,0 @@
|
||||
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
|
||||
-- Copyright (C) 2018 openwrt-brook-tproxy
|
||||
-- Licensed to the public under the GNU General Public License v3.
|
||||
|
||||
module("luci.controller.brook", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/brook") then
|
||||
return
|
||||
end
|
||||
|
||||
if nixio.fs.access("/usr/bin/brook") then
|
||||
entry({"admin", "services", "brook"},alias("admin", "services", "brook", "client"),_("Brook"), 10).dependent = true
|
||||
entry({"admin", "services", "brook", "client"},arcombine(cbi("brook/client"), cbi("brook/client-config")),_("Brook Tproxy"), 10).leaf = true
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "brook", "status"},form("brook/status"),_("Status"), 20).leaf = true
|
||||
entry({"admin", "services", "brook", "refresh"}, call("refresh_data"))
|
||||
entry({"admin", "services", "brook", "custom"},form("brook/gfwlist-custom"),_("Custom List"), 30).leaf = true
|
||||
end
|
||||
|
||||
function refresh_data()
|
||||
local set =luci.http.formvalue("set")
|
||||
local icount =0
|
||||
|
||||
if set == "gfw_data" then
|
||||
if nixio.fs.access("/usr/bin/wget-ssl") then
|
||||
refresh_cmd="wget-ssl --no-check-certificate https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt -O /tmp/gfw.b64"
|
||||
else
|
||||
refresh_cmd="wget -O /tmp/gfw.b64 http://iytc.net/tools/list.b64"
|
||||
end
|
||||
|
||||
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
if sret== 0 then
|
||||
luci.sys.call("/usr/bin/brook-gfw")
|
||||
icount = luci.sys.exec("cat /tmp/gfwnew.txt | wc -l")
|
||||
if tonumber(icount)>1000 then
|
||||
oldcount=luci.sys.exec("cat /etc/dnsmasq.brook/gfw_list.conf | wc -l")
|
||||
if tonumber(icount) ~= tonumber(oldcount) then
|
||||
luci.sys.exec("cp -f /tmp/gfwnew.txt /etc/dnsmasq.brook/gfw_list.conf")
|
||||
retstring=tostring(math.ceil(tonumber(icount)/2))
|
||||
else
|
||||
retstring ="0"
|
||||
end
|
||||
else
|
||||
retstring ="-1"
|
||||
end
|
||||
luci.sys.exec("rm -f /tmp/gfwnew.txt ")
|
||||
else
|
||||
retstring ="-1"
|
||||
end
|
||||
elseif set == "ip_data" then
|
||||
refresh_cmd="wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' 2>/dev/null| awk -F\\| '/CN\\|ipv4/ { printf(\"%s/%d\\n\", $4, 32-log($5)/log(2)) }' > /tmp/china_ip.txt"
|
||||
sret=luci.sys.call(refresh_cmd)
|
||||
icount = luci.sys.exec("cat /tmp/china_ip.txt | wc -l")
|
||||
if sret== 0 and tonumber(icount)>1000 then
|
||||
oldcount=luci.sys.exec("cat /etc/china_ip.txt | wc -l")
|
||||
if tonumber(icount) ~= tonumber(oldcount) then
|
||||
luci.sys.exec("cp -f /tmp/china_ip.txt /etc/china_ip.txt")
|
||||
retstring=tostring(tonumber(icount))
|
||||
else
|
||||
retstring ="0"
|
||||
end
|
||||
else
|
||||
retstring ="-1"
|
||||
end
|
||||
luci.sys.exec("rm -f /tmp/china_ip.txt ")
|
||||
else
|
||||
local need_process = 0
|
||||
if nixio.fs.access("/usr/bin/wget-ssl") then
|
||||
refresh_cmd="wget-ssl --no-check-certificate -O - https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt > /tmp/adnew.conf"
|
||||
need_process = 1
|
||||
else
|
||||
refresh_cmd="wget -O /tmp/ad.conf http://iytc.net/tools/ad.conf"
|
||||
end
|
||||
|
||||
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
if sret== 0 then
|
||||
if need_process == 1 then
|
||||
luci.sys.call("/usr/bin/brook-ad")
|
||||
end
|
||||
icount = luci.sys.exec("cat /tmp/ad.conf | wc -l")
|
||||
if tonumber(icount)>1000 then
|
||||
if nixio.fs.access("/etc/dnsmasq.brook/ad.conf") then
|
||||
oldcount=luci.sys.exec("cat /etc/dnsmasq.brook/ad.conf | wc -l")
|
||||
else
|
||||
oldcount=0
|
||||
end
|
||||
if tonumber(icount) ~= tonumber(oldcount) then
|
||||
luci.sys.exec("cp -f /tmp/ad.conf /etc/dnsmasq.brook/ad.conf")
|
||||
retstring=tostring(math.ceil(tonumber(icount)))
|
||||
if oldcount==0 then
|
||||
luci.sys.call("/etc/init.d/dnsmasq restart")
|
||||
end
|
||||
else
|
||||
retstring ="0"
|
||||
end
|
||||
else
|
||||
retstring ="-1"
|
||||
end
|
||||
luci.sys.exec("rm -f /tmp/ad.conf ")
|
||||
else
|
||||
retstring ="-1"
|
||||
end
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({ ret=retstring ,retcount=icount })
|
||||
end
|
||||
@ -1,44 +0,0 @@
|
||||
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
|
||||
-- Copyright (C) 2018 openwrt-brook-tproxy
|
||||
-- Licensed to the public under the GNU General Public License v3.
|
||||
|
||||
local m, s, o
|
||||
local brook = "brook"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local ipkg = require("luci.model.ipkg")
|
||||
local sid = arg[1]
|
||||
|
||||
local server_table = {}
|
||||
|
||||
m = Map(brook, translate("Edit Brook Server"))
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/brook/client")
|
||||
if m.uci:get(brook, sid) ~= "servers" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Servers Setting ]]--
|
||||
s = m:section(NamedSection, sid, "servers")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(Value, "alias", translate("Alias(optional)"))
|
||||
|
||||
o = s:option(Value, "server", translate("Server Address"))
|
||||
o.datatype = "host"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "server_port", translate("Server Port"))
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "local_port", translate("Local Port"))
|
||||
o.datatype = "port"
|
||||
o.default = 1080
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "password", translate("Password"))
|
||||
o.password = true
|
||||
o.rmempty = false
|
||||
|
||||
return m
|
||||
@ -1,106 +0,0 @@
|
||||
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
|
||||
-- Copyright (C) 2018 openwrt-brook-tproxy
|
||||
-- Licensed to the public under the GNU General Public License v3.
|
||||
|
||||
local m, s, sec, o
|
||||
local brook = "brook"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local ipkg = require("luci.model.ipkg")
|
||||
|
||||
m = Map(brook, translate("Brook Tproxy"))
|
||||
|
||||
local server_table = {}
|
||||
|
||||
uci:foreach(brook, "servers", function(s)
|
||||
if s.alias then
|
||||
server_table[s[".name"]] = s.alias
|
||||
elseif s.server and s.server_port then
|
||||
server_table[s[".name"]] = "%s:%s" %{s.server, s.server_port}
|
||||
end
|
||||
end)
|
||||
|
||||
-- [[ Servers Setting ]]--
|
||||
sec = m:section(TypedSection, "servers", translate("Servers Setting"))
|
||||
sec.anonymous = true
|
||||
sec.addremove = true
|
||||
sec.sortable = true
|
||||
sec.template = "cbi/tblsection"
|
||||
sec.extedit = luci.dispatcher.build_url("admin/services/brook/client/%s")
|
||||
function sec.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(sec.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
o = sec:option(DummyValue, "alias", translate("Alias"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = sec:option(DummyValue, "server", translate("Server Address"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or "?"
|
||||
end
|
||||
|
||||
o = sec:option(DummyValue, "server_port", translate("Server Port"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or "?"
|
||||
end
|
||||
|
||||
-- [[ Global Setting ]]--
|
||||
s = m:section(TypedSection, "global", translate("Global Setting"))
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(ListValue, "global_server", translate("Global Server"))
|
||||
o:value("nil", translate("Disable"))
|
||||
for k, v in pairs(server_table) do o:value(k, v) end
|
||||
o.default = "nil"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "run_mode", translate("Running Mode"))
|
||||
o:value("router", translate("IP Route Mode"))
|
||||
o:value("gfw", translate("GFW List Mode"))
|
||||
|
||||
o = s:option(Value, "tunnel_forward", translate("DNS Server IP and Port"))
|
||||
o.default = "8.8.8.8:53"
|
||||
o.rmempty = false
|
||||
|
||||
-- [[ Proxy Control ]]--
|
||||
s = m:section(TypedSection, "proxy_control", translate("Proxy Control"))
|
||||
s.anonymous = true
|
||||
|
||||
-- Part of WAN
|
||||
s:tab("wan_pc", translate("Interfaces - WAN"))
|
||||
|
||||
o = s:taboption("wan_pc", Value, "wan_bp_list", translate("Bypassed IP List"))
|
||||
o:value("/dev/null", translate("NULL - As Global Proxy"))
|
||||
|
||||
o.default = "/dev/null"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:taboption("wan_pc", DynamicList, "wan_bp_ips", translate("Bypassed IP"))
|
||||
o.datatype = "ip4addr"
|
||||
|
||||
o = s:taboption("wan_pc", DynamicList, "wan_fw_ips", translate("Forwarded IP"))
|
||||
o.datatype = "ip4addr"
|
||||
|
||||
-- Part of LAN
|
||||
s:tab("lan_pc", translate("Interfaces - LAN"))
|
||||
|
||||
o = s:taboption("lan_pc", ListValue, "lan_pc_mode", translate("LAN Host Proxy Control"))
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("w", translate("Allow listed only"))
|
||||
o:value("b", translate("Allow all except listed"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:taboption("lan_pc", DynamicList, "lan_pc_ips", translate("LAN Host List"))
|
||||
o.datatype = "ipaddr"
|
||||
luci.ip.neighbors({ family = 4 }, function(entry)
|
||||
if entry.reachable then
|
||||
o:value(entry.dest:string())
|
||||
end
|
||||
end)
|
||||
|
||||
return m
|
||||
@ -1,23 +0,0 @@
|
||||
local fs = require "nixio.fs"
|
||||
local conffile = "/etc/dnsmasq.brook/custom_list.conf"
|
||||
|
||||
f = SimpleForm("custom", translate("GFW Custom List"), translate("Please refer to the following writing(remove '#' of the head of line in your custom list)"))
|
||||
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows = 20
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
|
||||
function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
if data.conf then
|
||||
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
|
||||
luci.sys.call("/etc/init.d/dnsmasq restart && ipset flush gfwlist")
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return f
|
||||
@ -1,118 +0,0 @@
|
||||
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
|
||||
-- Copyright (C) 2018 openwrt-brook-tproxy
|
||||
-- Licensed to the public under the GNU General Public License v3.
|
||||
|
||||
local IPK_Version="1.0.0"
|
||||
local m, s, o
|
||||
local tproxy_run=0
|
||||
local tunnel_run=0
|
||||
local gfw_count=0
|
||||
local ad_count=0
|
||||
local ip_count=0
|
||||
local gfwmode=0
|
||||
|
||||
local fs = require "nixio.fs"
|
||||
local sys = require "luci.sys"
|
||||
local brook = "brook"
|
||||
|
||||
if nixio.fs.access("/etc/dnsmasq.brook/gfw_list.conf") then
|
||||
gfwmode=1
|
||||
end
|
||||
|
||||
-- html constants
|
||||
font_blue = [[<font color="blue">]]
|
||||
font_off = [[</font>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
local brook_version=translate("Unknown")
|
||||
local brook_bin="/usr/bin/brook"
|
||||
if not fs.access(brook_bin) then
|
||||
brook_version=translate("Not exist")
|
||||
else
|
||||
if not fs.access(brook_bin, "rwx", "rx", "rx") then
|
||||
fs.chmod(brook_bin, 755)
|
||||
end
|
||||
brook_version=sys.exec(brook_bin .. " -v | awk '{print $3}'")
|
||||
if not brook_version or brook_version == "" then
|
||||
brook_version = translate("Unknown")
|
||||
end
|
||||
end
|
||||
|
||||
if gfwmode==1 then
|
||||
gfw_count = tonumber(sys.exec("cat /etc/dnsmasq.brook/gfw_list.conf | wc -l"))/2
|
||||
if nixio.fs.access("/etc/dnsmasq.brook/ad.conf") then
|
||||
ad_count=tonumber(sys.exec("cat /etc/dnsmasq.brook/ad.conf | wc -l"))
|
||||
end
|
||||
end
|
||||
|
||||
if nixio.fs.access("/etc/china_ip.txt") then
|
||||
ip_count = sys.exec("cat /etc/china_ip.txt | wc -l")
|
||||
end
|
||||
|
||||
local icount=sys.exec("ps -w | grep \"brook tproxy\" |grep -v grep| wc -l")
|
||||
if tonumber(icount)>0 then
|
||||
tproxy_run=1
|
||||
end
|
||||
|
||||
icount=sys.exec("ps -w | grep \"brook tunnel\" |grep -v grep| wc -l")
|
||||
if tonumber(icount)>0 then
|
||||
tunnel_run=1
|
||||
end
|
||||
|
||||
m = SimpleForm("Version", translate("Running Status"))
|
||||
m.reset = false
|
||||
m.submit = false
|
||||
|
||||
s=m:field(DummyValue,"tproxy_run",translate("Brook Tproxy"))
|
||||
s.rawhtml = true
|
||||
if tproxy_run == 1 then
|
||||
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
|
||||
else
|
||||
s.value = translate("Not Running")
|
||||
end
|
||||
|
||||
s=m:field(DummyValue,"tunnel_run",translate("DNS Tunnel"))
|
||||
s.rawhtml = true
|
||||
if tunnel_run == 1 then
|
||||
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
|
||||
else
|
||||
s.value = translate("Not Running")
|
||||
end
|
||||
|
||||
if gfwmode==1 then
|
||||
s=m:field(DummyValue,"gfw_data",translate("GFW List Data"))
|
||||
s.rawhtml = true
|
||||
s.template = "brook/refresh"
|
||||
s.value =tostring(math.ceil(gfw_count)) .. " " .. translate("Records")
|
||||
|
||||
s=m:field(DummyValue,"ad_data",translate("Advertising Data"))
|
||||
s.rawhtml = true
|
||||
s.template = "brook/refresh"
|
||||
s.value =tostring(math.ceil(ad_count)) .. " " .. translate("Records")
|
||||
end
|
||||
|
||||
s=m:field(DummyValue,"ip_data",translate("China IP Data"))
|
||||
s.rawhtml = true
|
||||
s.template = "brook/refresh"
|
||||
s.value =ip_count .. " " .. translate("Records")
|
||||
|
||||
s=m:field(DummyValue,"brook_version",translate("Brook Version"))
|
||||
s.rawhtml = true
|
||||
s.value =brook_version
|
||||
|
||||
s=m:field(DummyValue,"brook_project",translate("Brook Project"))
|
||||
s.rawhtml = true
|
||||
s.value =bold_on .. [[<a href="]] .. "https://github.com/txthinking/brook" .. [[" >]]
|
||||
.. "https://github.com/txthinking/brook" .. [[</a>]] .. bold_off
|
||||
|
||||
s=m:field(DummyValue,"ipk_version",translate("IPK Version"))
|
||||
s.rawhtml = true
|
||||
s.value =IPK_Version
|
||||
|
||||
s=m:field(DummyValue,"ipk_project",translate("IPK Project"))
|
||||
s.rawhtml = true
|
||||
s.value =bold_on .. [[<a href="]] .. "https://github.com/WouldChar/openwrt-brook-tproxy" .. [[" >]]
|
||||
.. "https://github.com/WouldChar/openwrt-brook-tproxy" .. [[</a>]] .. bold_off
|
||||
|
||||
return m
|
||||
@ -1,38 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function refresh_data(btn,dataname)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Refresh...%> ';
|
||||
murl=dataname;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "brook","refresh")%>',
|
||||
{ set:murl },
|
||||
function(x,rv)
|
||||
{
|
||||
var s = document.getElementById(dataname+'-status');
|
||||
if (s)
|
||||
{
|
||||
if (rv.ret=="0")
|
||||
s.innerHTML ="<font color='green'>"+"<%:No new data!%> "+"</font>";
|
||||
else if(rv.ret=="-1")
|
||||
{
|
||||
s.innerHTML ="<font color='red'>"+"<%:Refresh Error!%> "+"</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
s.innerHTML ="<font color='green'>"+"<%:Refresh OK!%> "+"<%:Total Records:%>"+rv.ret+"</font>";
|
||||
}
|
||||
}
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Refresh Data %>';
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
//]]></script>
|
||||
|
||||
<input type="button" class="cbi-button cbi-input-reload" value="<%:Refresh Data%> " onclick="return refresh_data(this,'<%=self.option%>')" />
|
||||
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>
|
||||
|
||||
<%+cbi/valuefooter%>
|
||||
@ -1,155 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "Brook Tproxy"
|
||||
msgstr "Brook 透明代理"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Disable"
|
||||
msgstr "停用"
|
||||
|
||||
msgid "Global Setting"
|
||||
msgstr "全局设置"
|
||||
|
||||
msgid "Global Server"
|
||||
msgstr "全局服务器"
|
||||
|
||||
msgid "Servers Setting"
|
||||
msgstr "服务器配置"
|
||||
|
||||
msgid "Alias(optional)"
|
||||
msgstr "别名(可选)"
|
||||
|
||||
msgid "Server Address"
|
||||
msgstr "服务器地址"
|
||||
|
||||
msgid "Server Port"
|
||||
msgstr "服务器端口"
|
||||
|
||||
msgid "Local Port"
|
||||
msgstr "本地端口"
|
||||
|
||||
msgid "Password"
|
||||
msgstr "密码"
|
||||
|
||||
msgid "Proxy Control"
|
||||
msgstr "代理控制"
|
||||
|
||||
msgid "Interfaces - WAN"
|
||||
msgstr "接口 - WAN"
|
||||
|
||||
msgid "Bypassed IP List"
|
||||
msgstr "被忽略IP列表"
|
||||
|
||||
msgid "NULL - As Global Proxy"
|
||||
msgstr "留空 - 作为全局代理"
|
||||
|
||||
msgid "Bypassed IP"
|
||||
msgstr "额外被忽略IP"
|
||||
|
||||
msgid "Forwarded IP"
|
||||
msgstr "强制走代理IP"
|
||||
|
||||
msgid "Interfaces - LAN"
|
||||
msgstr "接口 - LAN"
|
||||
|
||||
msgid "LAN Host Proxy Control"
|
||||
msgstr "内网主机代理控制"
|
||||
|
||||
msgid "Allow listed only"
|
||||
msgstr "仅允许列表内"
|
||||
|
||||
msgid "Allow all except listed"
|
||||
msgstr "仅允许列表外"
|
||||
|
||||
msgid "LAN Host List"
|
||||
msgstr "内网主机列表"
|
||||
|
||||
msgid "Edit Brook Server"
|
||||
msgstr "编辑服务器配置"
|
||||
|
||||
msgid "Alias"
|
||||
msgstr "别名"
|
||||
|
||||
msgid "Server"
|
||||
msgstr "服务器"
|
||||
|
||||
msgid "Status"
|
||||
msgstr "状态"
|
||||
|
||||
msgid "Running Status"
|
||||
msgstr "运行状态"
|
||||
|
||||
msgid "DNS Tunnel"
|
||||
msgstr "DNS 隧道"
|
||||
|
||||
msgid "Unknown"
|
||||
msgstr "未知"
|
||||
|
||||
msgid "Not exist"
|
||||
msgstr "不存在"
|
||||
|
||||
msgid "Brook Version"
|
||||
msgstr "Brook 版本号"
|
||||
|
||||
msgid "Brook Project"
|
||||
msgstr "Brook 项目地址"
|
||||
|
||||
msgid "IPK Version"
|
||||
msgstr "IPK 版本号"
|
||||
|
||||
msgid "IPK Project"
|
||||
msgstr "IPK 项目地址"
|
||||
|
||||
msgid "Not Running"
|
||||
msgstr "未运行"
|
||||
|
||||
msgid "Running"
|
||||
msgstr "运行中"
|
||||
|
||||
msgid "Running Mode"
|
||||
msgstr "运行模式"
|
||||
|
||||
msgid "IP Route Mode"
|
||||
msgstr "IP路由模式"
|
||||
|
||||
msgid "GFW List Mode"
|
||||
msgstr "GFW列表模式"
|
||||
|
||||
msgid "GFW List Data"
|
||||
msgstr "【GFW列表】数据库"
|
||||
|
||||
msgid "China IP Data"
|
||||
msgstr "【国内IP段】数据库"
|
||||
|
||||
msgid "Records"
|
||||
msgstr "条记录"
|
||||
|
||||
msgid "Refresh Data"
|
||||
msgstr "更新数据库"
|
||||
|
||||
msgid "Refresh..."
|
||||
msgstr "正在更新,请稍候.."
|
||||
|
||||
msgid "Refresh OK!"
|
||||
msgstr "更新成功!"
|
||||
|
||||
msgid "Refresh Error!"
|
||||
msgstr "更新失败!"
|
||||
|
||||
msgid "No new data!"
|
||||
msgstr "你已经是最新数据,无需更新!"
|
||||
|
||||
msgid "Total Records:"
|
||||
msgstr "新的总纪录数:"
|
||||
|
||||
msgid "Check Connect"
|
||||
msgstr "检查连通性"
|
||||
|
||||
msgid "Advertising Data"
|
||||
msgstr "【广告屏蔽】数据库"
|
||||
|
||||
msgid "DNS Server IP and Port"
|
||||
msgstr "DNS服务器地址和端口"
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,15 +0,0 @@
|
||||
|
||||
config global
|
||||
option global_server 'nil'
|
||||
option tunnel_forward '8.8.8.8:53'
|
||||
option run_mode 'router'
|
||||
|
||||
config servers
|
||||
option server '127.0.0.1'
|
||||
option server_port '8388'
|
||||
option local_port '1080'
|
||||
option password 'hello!!'
|
||||
|
||||
config proxy_control
|
||||
option lan_pc_mode '0'
|
||||
option wan_bp_list '/etc/china_ip.txt'
|
||||
@ -1,2 +0,0 @@
|
||||
#server=/.example.com/127.0.0.1#5353
|
||||
#ipset=/.example.com/gfwlist
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,229 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (C) 2017 openwrt-ssr
|
||||
# Copyright (C) 2017 yushi studio <ywb94@qq.com>
|
||||
# Copyright (C) 2018 openwrt-brook-tproxy
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
START=90
|
||||
STOP=15
|
||||
|
||||
extra_command "rules"
|
||||
|
||||
SERVICE_DAEMONIZE=1
|
||||
NAME=brook
|
||||
FWI=$(uci get firewall.brook.path 2>/dev/null)
|
||||
|
||||
uci_get_by_name() {
|
||||
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
uci_get_by_type() {
|
||||
local ret=$(uci get $NAME.@$1[0].$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
run_mode=$(uci_get_by_type global run_mode)
|
||||
GLOBAL_SERVER=$(uci_get_by_type global global_server)
|
||||
ip_list=$(uci_get_by_type proxy_control wan_bp_list)
|
||||
|
||||
gen_include() {
|
||||
[ -n "$FWI" ] || return 0
|
||||
extract_rules() {
|
||||
echo "*$1"
|
||||
iptables-save -t $1 | grep Brook
|
||||
echo 'COMMIT'
|
||||
}
|
||||
cat <<-EOF >>$FWI
|
||||
#!/bin/sh
|
||||
iptables-save -c | grep -v "Brook" | iptables-restore -c
|
||||
iptables-restore -n <<-EOT
|
||||
$(extract_rules mangle)
|
||||
EOT
|
||||
EOF
|
||||
return 0
|
||||
}
|
||||
|
||||
gen_iplist() {
|
||||
cat <<-EOF
|
||||
0.0.0.0/8
|
||||
10.0.0.0/8
|
||||
100.64.0.0/10
|
||||
127.0.0.0/8
|
||||
169.254.0.0/16
|
||||
172.16.0.0/12
|
||||
192.0.0.0/24
|
||||
192.0.2.0/24
|
||||
192.88.99.0/24
|
||||
192.168.0.0/16
|
||||
198.18.0.0/15
|
||||
198.51.100.0/24
|
||||
203.0.113.0/24
|
||||
224.0.0.0/4
|
||||
240.0.0.0/4
|
||||
255.255.255.255
|
||||
$1
|
||||
$(for ip in $2; do echo $ip; done)
|
||||
$(cat ${ip_list:=/dev/null} 2>/dev/null)
|
||||
EOF
|
||||
}
|
||||
|
||||
start_rules() {
|
||||
local host=$(uci_get_by_name $GLOBAL_SERVER server)
|
||||
if echo $host| grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >/dev/null; then
|
||||
hostip=${host}
|
||||
elif [ "$host" != "${host#*:[0-9a-fA-F]}" ]; then
|
||||
hostip=${host}
|
||||
else
|
||||
hostip=`ping ${host} -s 1 -c 1 | grep PING | cut -d'(' -f 2 | cut -d')' -f1`
|
||||
if echo $hostip| grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >/dev/null; then
|
||||
hostip=${hostip}
|
||||
else
|
||||
hostip="127.0.0.1"
|
||||
fi
|
||||
fi
|
||||
local bp_ips=$(uci_get_by_type proxy_control wan_bp_ips)
|
||||
local fw_ips=$(uci_get_by_type proxy_control wan_fw_ips)
|
||||
local lan_pc=$(uci_get_by_type proxy_control lan_pc_mode)
|
||||
local pc_ips=$(uci_get_by_type proxy_control lan_pc_ips)
|
||||
|
||||
ip rule add fwmark 1 lookup 100
|
||||
ip route add local 0.0.0.0/0 dev lo table 100
|
||||
|
||||
if [ "$run_mode" = "router" ]; then
|
||||
MATCH_SET="-m set --match-set iplist dst"
|
||||
ipset -! -R <<-EOF || return 1
|
||||
create iplist hash:net
|
||||
$(gen_iplist $hostip $bp_ips | sed -e "s/^/add iplist /")
|
||||
$(for ip in $fw_ips; do echo "add iplist $ip nomatch"; done)
|
||||
EOF
|
||||
else
|
||||
MATCH_SET="-m set ! --match-set gfwlist dst"
|
||||
ipset -N gfwlist iphash 2>/dev/null
|
||||
for ip in $fw_ips; do ipset add gfwlist $ip; done
|
||||
fi
|
||||
|
||||
if [ "$pc_ips" ]; then
|
||||
ipset -! -R <<-EOF || return 1
|
||||
create pclist hash:net
|
||||
$(for ip in $pc_ips; do echo "add pclist $ip"; done)
|
||||
EOF
|
||||
case "$lan_pc" in
|
||||
b)
|
||||
iptables -t mangle -A PREROUTING -m set --match-set pclist src \
|
||||
-j RETURN -m comment --comment "Brook_Proxy_Control"
|
||||
;;
|
||||
w)
|
||||
iptables -t mangle -A PREROUTING -m set ! --match-set pclist src \
|
||||
-j RETURN -m comment --comment "Brook_Proxy_Control"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
iptables -t mangle -A PREROUTING $MATCH_SET -j RETURN -m comment --comment "Brook_Tproxy"
|
||||
|
||||
iptables -t mangle -N Brook
|
||||
|
||||
iptables -t mangle -A Brook -j MARK --set-mark 1
|
||||
iptables -t mangle -A Brook -j ACCEPT
|
||||
|
||||
iptables -t mangle -A PREROUTING -p tcp -m socket -j Brook
|
||||
iptables -t mangle -A PREROUTING -p tcp -j TPROXY --tproxy-mark 0x1/0x1 \
|
||||
--on-port $(uci_get_by_name $GLOBAL_SERVER local_port) \
|
||||
-m comment --comment "Brook_Tproxy"
|
||||
|
||||
iptables -t mangle -A PREROUTING -p udp -m socket -j Brook
|
||||
iptables -t mangle -A PREROUTING -p udp -j TPROXY --tproxy-mark 0x1/0x1 \
|
||||
--on-port $(uci_get_by_name $GLOBAL_SERVER local_port) \
|
||||
-m comment --comment "Brook_Tproxy"
|
||||
|
||||
gen_include
|
||||
}
|
||||
|
||||
start_tunnel() {
|
||||
/usr/bin/brook tunnel -l :5353 \
|
||||
-t $(uci_get_by_type global tunnel_forward 8.8.8.8:53) \
|
||||
-s $(uci_get_by_name $GLOBAL_SERVER server):$(uci_get_by_name $GLOBAL_SERVER server_port) \
|
||||
-p $(uci_get_by_name $GLOBAL_SERVER password) >/dev/null 2>&1 &
|
||||
|
||||
mkdir -p /tmp/dnsmasq.d
|
||||
cat > /tmp/dnsmasq.d/dnsmasq-brook.conf <<EOF
|
||||
conf-dir=/etc/dnsmasq.brook
|
||||
EOF
|
||||
/etc/init.d/dnsmasq restart
|
||||
|
||||
}
|
||||
|
||||
start_tproxy() {
|
||||
/usr/bin/brook tproxy -l :$(uci_get_by_name $GLOBAL_SERVER local_port) \
|
||||
-s $(uci_get_by_name $GLOBAL_SERVER server):$(uci_get_by_name $GLOBAL_SERVER server_port) \
|
||||
-p $(uci_get_by_name $GLOBAL_SERVER password) >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
del_rules() {
|
||||
local on_port=`iptables -t mangle -L PREROUTING | grep Brook |
|
||||
grep -o -E "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\:[0-9]+" |
|
||||
awk -F ':' '{print $2}' | awk 'NR==1'`
|
||||
|
||||
iptables -t mangle -L PREROUTING | grep Brook_Proxy_Control && \
|
||||
(iptables -t mangle -D PREROUTING -m set ! --match-set pclist src \
|
||||
-j RETURN -m comment --comment "Brook_Proxy_Control" || \
|
||||
iptables -t mangle -D PREROUTING -m set --match-set pclist src \
|
||||
-j RETURN -m comment --comment "Brook_Proxy_Control")
|
||||
|
||||
iptables -t mangle -L PREROUTING | grep iplist && MATCH_SET="-m set --match-set iplist dst"
|
||||
iptables -t mangle -L PREROUTING | grep gfwlist && MATCH_SET="-m set ! --match-set gfwlist dst"
|
||||
|
||||
iptables -t mangle -D PREROUTING $MATCH_SET -j RETURN -m comment --comment "Brook_Tproxy"
|
||||
iptables -t mangle -D PREROUTING -p tcp -m socket -j Brook
|
||||
iptables -t mangle -D PREROUTING -p tcp -j TPROXY --tproxy-mark 0x1/0x1 \
|
||||
--on-port $on_port -m comment --comment "Brook_Tproxy"
|
||||
iptables -t mangle -D PREROUTING -p udp -m socket -j Brook
|
||||
iptables -t mangle -D PREROUTING -p udp -j TPROXY --tproxy-mark 0x1/0x1 \
|
||||
--on-port $on_port -m comment --comment "Brook_Tproxy"
|
||||
iptables -t mangle -F Brook
|
||||
iptables -t mangle -X Brook
|
||||
|
||||
ip rule del fwmark 1 lookup 100
|
||||
ip route del local 0.0.0.0/0 dev lo table 100
|
||||
|
||||
if [ -f "$FWI" ]; then
|
||||
rm -f $FWI
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
sysctl -w net.ipv4.ip_forward=1 >/dev/null
|
||||
sysctl -w net.ipv6.conf.all.forwarding=1 >/dev/null
|
||||
|
||||
if ! [ "$GLOBAL_SERVER" = "nil" ]; then
|
||||
start_rules >/dev/null 2>&1 &
|
||||
start_tproxy
|
||||
start_tunnel
|
||||
fi
|
||||
}
|
||||
|
||||
boot() {
|
||||
(sleep 5 && start >/dev/null 2>&1) &
|
||||
}
|
||||
|
||||
stop() {
|
||||
local rules_str=`iptables -t mangle -L| grep Brook`
|
||||
if [ "$rules_str" ]; then
|
||||
del_rules >/dev/null 2>&1 &
|
||||
fi
|
||||
if [ -f "/tmp/dnsmasq.d/dnsmasq-brook.conf" ]; then
|
||||
rm -f /tmp/dnsmasq.d/dnsmasq-brook.conf
|
||||
/etc/init.d/dnsmasq restart
|
||||
fi
|
||||
local process=`ps -w | grep "/usr/bin/brook" |grep -v grep`
|
||||
if [ "$process" ]; then
|
||||
for pid in $(ps -w | grep "/usr/bin/brook" | grep -v grep| awk '{print $1}'); do
|
||||
kill -9 $pid
|
||||
done
|
||||
fi
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@brook[-1]
|
||||
add ucitrack brook
|
||||
set ucitrack.@brook[-1].init=brook
|
||||
commit ucitrack
|
||||
delete firewall.brook
|
||||
set firewall.brook=include
|
||||
set firewall.brook.type=script
|
||||
set firewall.brook.path=/var/etc/brook.include
|
||||
set firewall.brook.reload=1
|
||||
commit firewall
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
@ -1,5 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
if [ -f /tmp/adnew.conf ]; then
|
||||
cat /tmp/adnew.conf | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/ad.conf
|
||||
fi
|
||||
@ -1,28 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
generate_china_banned()
|
||||
{
|
||||
cat $1 | base64 -d > /tmp/gfwlist.txt
|
||||
rm -f $1
|
||||
cat /tmp/gfwlist.txt | sort -u |
|
||||
sed 's#!.\+##; s#|##g; s#@##g; s#http:\/\/##; s#https:\/\/##;' |
|
||||
sed '/\*/d; /apple\.com/d; /sina\.cn/d; /sina\.com\.cn/d; /baidu\.com/d; /byr\.cn/d; /jlike\.com/d; /weibo\.com/d; /zhongsou\.com/d; /youdao\.com/d; /sogou\.com/d; /so\.com/d; /soso\.com/d; /aliyun\.com/d; /taobao\.com/d; /jd\.com/d; /qq\.com/d' |
|
||||
sed '/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$/d' |
|
||||
grep '^[0-9a-zA-Z\.-]\+$' | grep '\.' | sed 's#^\.\+##' | sort -u |
|
||||
awk '
|
||||
BEGIN { prev = "________"; } {
|
||||
cur = $0;
|
||||
if (index(cur, prev) == 1 && substr(cur, 1 + length(prev) ,1) == ".") {
|
||||
} else {
|
||||
print cur;
|
||||
prev = cur;
|
||||
}
|
||||
}' | sort -u
|
||||
}
|
||||
|
||||
generate_china_banned /tmp/gfw.b64 > /tmp/gfw.txt
|
||||
rm -f /tmp/gfwlist.txt
|
||||
datestr=`date`
|
||||
echo -e "# gfw list ipset rules for dnsmasq\n# updated on $datestr\n#" >/tmp/gfwnew.txt
|
||||
sed '/.*/s/.*/server=\/\.&\/127.0.0.1#5353\nipset=\/\.&\/gfwlist/' /tmp/gfw.txt >>/tmp/gfwnew.txt
|
||||
rm -f /tmp/gfw.txt
|
||||
@ -1,18 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=a wired IEEE 802.1x client for Luci
|
||||
LUCI_DESCRIPTION:=This package contains LuCI configuration pages for wired IEEE 802.1x authentication.
|
||||
LUCI_DEPENDS:=+wpad
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_NAME:=luci-app-cd8021x
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=max0y <askmaxwork@gmail.com>
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,8 +0,0 @@
|
||||
-- Copyright (C) 2018 max0y <askmaxwork@gmail.com>
|
||||
-- Licensed to the public under the GNU General Public License v3.
|
||||
|
||||
module("luci.controller.cd8021x", package.seeall)
|
||||
|
||||
function index()
|
||||
entry({"admin", "network", "cd8021x"}, cbi("cd8021x"), _("802.1x Client"), 100).dependent = true
|
||||
end
|
||||
@ -1,41 +0,0 @@
|
||||
-- Copyright (C) 2018 max0y <askmaxwork@gmail.com>
|
||||
-- Licensed to the public under the GNU General Public License v3.
|
||||
|
||||
require("luci.sys")
|
||||
|
||||
local eap_list = {
|
||||
"MD5",
|
||||
"PEAP",
|
||||
"MSCHAPV2",
|
||||
}
|
||||
|
||||
m = Map("cd8021x", translate("802.1x Client"),
|
||||
translate("Configure IEEE 802.1x wired authentication, you may need to edit your WAN interface protocol as <i>DHCP</i> client <a href=\"network\">here</a>"))
|
||||
|
||||
s = m:section(TypedSection, "login", "")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
enable = s:option(Flag, "enable", translate("Enable"))
|
||||
name = s:option(Value, "username", translate("Username"))
|
||||
pass = s:option(Value, "password", translate("Password"))
|
||||
pass.password = true
|
||||
|
||||
ifname = s:option(ListValue, "ifname", translate("Interfaces"))
|
||||
for k, v in ipairs(luci.sys.net.devices()) do
|
||||
if v ~= "lo" then
|
||||
ifname:value(v)
|
||||
end
|
||||
end
|
||||
|
||||
eap = s:option(ListValue, "eap", translate("EAP"))
|
||||
for k, v in ipairs(eap_list) do
|
||||
eap:value(v)
|
||||
end
|
||||
|
||||
local apply = luci.http.formvalue("cbi.apply")
|
||||
if apply then
|
||||
io.popen("/etc/init.d/cd8021x restart")
|
||||
end
|
||||
|
||||
return m
|
||||
@ -1,13 +0,0 @@
|
||||
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "802.1x Client"
|
||||
msgstr "802.1x 客户端"
|
||||
|
||||
msgid ""
|
||||
"Configure IEEE 802.1x wired authentication, you may need to edit your WAN interface "
|
||||
"protocol as <i>DHCP</i> client <a href=\"network\">here</a>"
|
||||
msgstr ""
|
||||
"IEEE 802.1x 有线拨号客户端, 使用前需要将WAN口"
|
||||
"协议修改为<i>DHCP客户端</i>. <a href=\"network\">点击这里</a>"
|
||||
@ -1,6 +0,0 @@
|
||||
|
||||
config login
|
||||
option username ''
|
||||
option password ''
|
||||
option ifname 'eth0'
|
||||
option eap 'MD5'
|
||||
@ -1,55 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
# Copyright (C) 2018 max0y <askmaxwork@gmail.com>
|
||||
# Licensed to the public under the GNU General Public License v3.
|
||||
|
||||
START=65
|
||||
|
||||
run_cd8021x()
|
||||
{
|
||||
local enable
|
||||
config_get_bool enable $1 enable
|
||||
|
||||
if [ $enable ]; then
|
||||
local username
|
||||
local password
|
||||
local ifname
|
||||
local eap
|
||||
|
||||
config_get username $1 username
|
||||
config_get password $1 password
|
||||
config_get ifname $1 ifname
|
||||
config_get eap $1 eap
|
||||
|
||||
killall wpa_supplicant
|
||||
echo -e "ctrl_interface=/var/run/wpa_supplicant\nctrl_interface_group=root\nap_scan=0\nnetwork={\nkey_mgmt=IEEE8021X\neap=$eap\nidentity=\"$username\"\npassword=\"$password\"" > /tmp/cd8021x.conf
|
||||
case "$eap" in
|
||||
"MD5")
|
||||
echo -e "eapol_flags=0\n}" >> /tmp/cd8021x.conf
|
||||
;;
|
||||
"PEAP")
|
||||
echo -e "anonymous_identity=\"$username\"\npairwise=CCMP TKIP\nphase2=\"auth=MSCHAPV2\"\npriority=2\n}" >> /tmp/cd8021x.conf
|
||||
;;
|
||||
"MSCHAPV2")
|
||||
echo -e "eapol_flags=0\nphase1=\"peaplabel=1\"\nphase2=\"auth=MSCHAPV2\"\n}" >> /tmp/cd8021x.conf
|
||||
;;
|
||||
*)
|
||||
esac
|
||||
|
||||
wpa_supplicant -B -c /tmp/cd8021x.conf -i$ifname -Dwired
|
||||
|
||||
echo "cd802.1x client has started."
|
||||
fi
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
config_load cd8021x
|
||||
config_foreach run_cd8021x login
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
killall wpa_supplicant
|
||||
echo "cd802.1x client has stoped."
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
## Copyright (C) 2018 By-Ameng Openwrt.org
|
||||
#
|
||||
## This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=luci-app-cifs
|
||||
LUCI_DEPENDS:=+kmod-fs-cifs +kmod-nls-utf8 +kmod-nls-base +kmod-crypto-hmac +kmod-crypto-md5 +kmod-crypto-misc +cifsmount
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=5
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,16 +0,0 @@
|
||||
-- Copyright 2015
|
||||
-- Matthew
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
module("luci.controller.cifs", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/cifs") then
|
||||
return
|
||||
end
|
||||
|
||||
local page
|
||||
|
||||
page = entry({"admin", "services", "cifs"}, cbi("cifs"), _("Mounting NAT drives"))
|
||||
page.dependent = true
|
||||
end
|
||||
@ -1,109 +0,0 @@
|
||||
-- Copyright 2015
|
||||
-- Matthew
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
local fs = require "nixio.fs"
|
||||
|
||||
local state_msg = ""
|
||||
local ss_redir_on = (luci.sys.call("pidof cifsd > /dev/null") == 0)
|
||||
if ss_redir_on then
|
||||
state_msg = "<b><font color=\"green\">" .. translate("Running") .. "</font></b>"
|
||||
else
|
||||
state_msg = "<b><font color=\"red\">" .. translate("Not running") .. "</font></b>"
|
||||
end
|
||||
|
||||
m = Map("cifs", translate("Mounting NAT drives"),
|
||||
translate("Allows you mounting Nat drives") .. " - " .. state_msg)
|
||||
|
||||
s = m:section(TypedSection, "cifs", "Cifs")
|
||||
s.anonymous = true
|
||||
|
||||
|
||||
|
||||
s:tab("general", translate("General Settings"))
|
||||
|
||||
switch = s:taboption("general", Flag, "enabled", translate("Enable"))
|
||||
switch.rmempty = false
|
||||
|
||||
workgroup = s:taboption("general", Value, "workgroup", translate("Workgroup"))
|
||||
workgroup.default = "WORKGROUP"
|
||||
|
||||
mountarea = s:taboption("general", Value, "mountarea", translate("Mount Area")
|
||||
, translate("All the Mounted NAT Drives will be centralized into this folder."))
|
||||
mountarea.default = "/tmp/mnt"
|
||||
mountarea.rmempty = false
|
||||
|
||||
delay = s:taboption("general", Value, "delay", translate("Delay")
|
||||
,translate("Delay command runing for wait till your drivers online.\n Only work in start mode(/etc/init.d/cifs start) "))
|
||||
delay:value("0")
|
||||
delay:value("3")
|
||||
delay:value("5")
|
||||
delay:value("7")
|
||||
delay:value("10")
|
||||
delay.default = "5"
|
||||
|
||||
|
||||
iocharset = s:taboption("general", Value, "iocharset", translate("Iocharset")
|
||||
, translate("Character Encoding"))
|
||||
iocharset.default = "utf8"
|
||||
|
||||
|
||||
|
||||
s = m:section(TypedSection, "natshare", translate("NAT Drivers"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.template = "cbi/tblsection"
|
||||
|
||||
server = s:option(Value, "server", translate("Server")
|
||||
, translate("Server Name/IP"))
|
||||
server.size = 6
|
||||
server.rmempty = false
|
||||
|
||||
name = s:option(Value, "name", translate("Name")
|
||||
, translate("Mouting Folder Name"))
|
||||
name.size = 6
|
||||
name.rmempty = false
|
||||
|
||||
sec = s:option(Value, "sec", translate("Choose Safety Mode"))
|
||||
sec:value("none")
|
||||
sec:value("krb5")
|
||||
sec:value("krb5i")
|
||||
sec:value("ntlm")
|
||||
sec:value("ntlmi")
|
||||
sec:value("ntlmv2")
|
||||
sec:value("ntlmv2i")
|
||||
sec.rmempty = true
|
||||
sec.size = 7
|
||||
|
||||
agm = s:option(Value, "agm", translate("Arguments"))
|
||||
agm:value("rm", translate"rm: Read Only")
|
||||
agm:value("rw", translate"rw: Read and Write")
|
||||
agm:value("noperm")
|
||||
agm:value("noacl")
|
||||
agm:value("sfu")
|
||||
agm:value("dirctio")
|
||||
agm:value("file_mode=0755,dir_mode=0n755")
|
||||
agm:value("nounix", translate"nounix: Disable Unix Extensions")
|
||||
agm.rmempty = true
|
||||
agm.size = 8
|
||||
|
||||
guest = s:option(Flag, "guest", translate("Using Guest"))
|
||||
guest.rmempty = false
|
||||
guest.enabled = "1"
|
||||
guest.disabled = "0"
|
||||
|
||||
users = s:option(Value, "users", translate("Users"))
|
||||
users.size = 3
|
||||
users.rmempty = true
|
||||
|
||||
pwd = s:option(Value, "pwd", translate("password"))
|
||||
pwd.rmempty = true
|
||||
pwd.size = 3
|
||||
|
||||
local apply = luci.http.formvalue("cbi.apply")
|
||||
if apply then
|
||||
io.popen("/etc/init.d/cifs restart")
|
||||
end
|
||||
|
||||
|
||||
return m
|
||||
@ -1,41 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "Mounting NAT drives"
|
||||
msgstr "挂载网络驱动器"
|
||||
|
||||
msgid "Allows you mounting Nat drives"
|
||||
msgstr "允许挂载网络驱动器"
|
||||
|
||||
msgid "Mount Area"
|
||||
msgstr "挂载目录"
|
||||
|
||||
msgid "All the Mounted NAT Drives will be centralized into this folder."
|
||||
msgstr "所有安装的网络驱动器都将集中到这个文件夹中。"
|
||||
|
||||
msgid "Delay"
|
||||
msgstr "延迟"
|
||||
|
||||
msgid "Delay command runing for wait till your drivers online.\n Only work in start mode(/etc/init.d/cifs start) "
|
||||
msgstr "延迟命令运行,等待驱动程序联机。\n仅在启动模式下工作(/etc/init.d/cifs start)"
|
||||
|
||||
msgid "Iocharset"
|
||||
msgstr "编码"
|
||||
|
||||
msgid "Character Encoding"
|
||||
msgstr "字符编码"
|
||||
|
||||
msgid "NAT Drivers"
|
||||
msgstr "网络硬盘"
|
||||
|
||||
msgid "Server Name/IP"
|
||||
msgstr "服务器名称/ip地址"
|
||||
|
||||
msgid "Mouting Folder Name"
|
||||
msgstr "共享目录/名称"
|
||||
|
||||
msgid "Choose Safety Mode"
|
||||
msgstr "安全模式"
|
||||
|
||||
msgid "Arguments"
|
||||
msgstr "共享权限"
|
||||
@ -1,8 +0,0 @@
|
||||
|
||||
config cifs
|
||||
option enabled '0'
|
||||
option workgroup 'WORKGROUP'
|
||||
option iocharset 'utf8'
|
||||
option delay '5'
|
||||
option mountarea '/tmp/mnt'
|
||||
|
||||
@ -1,184 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
|
||||
ENABLED=0
|
||||
MOUNTAREA=0
|
||||
WORKGROUPD=0
|
||||
IOCHARSET=0
|
||||
DELAY=0
|
||||
GUEST=""
|
||||
USERS=""
|
||||
SEC=""
|
||||
AGM=""
|
||||
|
||||
cifs_header() {
|
||||
local enabled
|
||||
local workgroup
|
||||
local mountarea
|
||||
local delay
|
||||
local iocharset
|
||||
|
||||
config_get enabled $1 enabled
|
||||
config_get mountarea $1 mountarea
|
||||
config_get workgroup $1 workgroup
|
||||
config_get delay $1 delay
|
||||
config_get iocharset $1 iocharset
|
||||
|
||||
ENABLED=$enabled
|
||||
MOUNTAREA=$mountarea
|
||||
WORKGROUPD=$workgroup
|
||||
IOCHARSET=$iocharset
|
||||
|
||||
if [ $delay != 0 ]
|
||||
then
|
||||
DELAY=$delay
|
||||
fi
|
||||
}
|
||||
|
||||
mount_natshare() {
|
||||
local server
|
||||
local name
|
||||
local guest
|
||||
local users
|
||||
local pwd
|
||||
local sec
|
||||
local agm
|
||||
|
||||
local _mount_path
|
||||
local _agm
|
||||
|
||||
config_get server $1 server
|
||||
config_get name $1 name
|
||||
config_get guest $1 guest
|
||||
config_get users $1 users
|
||||
config_get pwd $1 pwd
|
||||
config_get sec $1 sec
|
||||
config_get agm $1 agm
|
||||
|
||||
if [ $guest == 1 ]
|
||||
then
|
||||
GUEST="guest,"
|
||||
USERS=""
|
||||
else if [ $guest == 0 ]
|
||||
then {
|
||||
if [ $users ]
|
||||
then
|
||||
USERS="username=$users,password=$pwd,"
|
||||
GUEST=""
|
||||
else
|
||||
USERS=""
|
||||
GUEST="guest,"
|
||||
fi
|
||||
}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $sec ]
|
||||
then
|
||||
SEC=",sec=$sec"
|
||||
else
|
||||
SEC=""
|
||||
fi
|
||||
|
||||
if [ $agm ]
|
||||
then
|
||||
AGM=",$agm"
|
||||
else
|
||||
AGM=""
|
||||
fi
|
||||
|
||||
natpath="//${server}/$name"
|
||||
|
||||
append _mount_path "$MOUNTAREA/$name"
|
||||
append _agm "-o ${USERS}${GUEST},dom=$WORKGROUPD,iocharset=$IOCHARSET,$SEC,$AGM,vers=1.0"
|
||||
|
||||
sleep 1
|
||||
mkdir -p $_mount_path
|
||||
mount -t cifs $natpath $_mount_path $_agm
|
||||
}
|
||||
|
||||
umount_natshare() {
|
||||
local server
|
||||
local name
|
||||
local _mount_path
|
||||
|
||||
config_get server $1 server
|
||||
config_get name $1 name
|
||||
|
||||
append _mount_path "$MOUNTAREA/$name"
|
||||
|
||||
sleep 1
|
||||
umount -d -l $_mount_path
|
||||
rm -r -f $_mount_path
|
||||
}
|
||||
|
||||
change_natshare() {
|
||||
sleep 1
|
||||
}
|
||||
|
||||
start() {
|
||||
config_load cifs
|
||||
config_foreach cifs_header cifs
|
||||
|
||||
echo "Checking..."
|
||||
|
||||
if [ $ENABLED == 1 ]
|
||||
then {
|
||||
echo "Cifs Mount is Enabled."
|
||||
echo "Starting..."
|
||||
if [ $DELAY != 0 ]
|
||||
then
|
||||
sleep $DELAY
|
||||
echo "DELAY Operation ${DELAY}s"
|
||||
else
|
||||
echo "Not DELAY ${DELAY}s"
|
||||
fi
|
||||
|
||||
config_foreach mount_natshare natshare
|
||||
|
||||
echo "Cifs Mount succeed."
|
||||
}
|
||||
else
|
||||
echo "Cifs Mount is Disabled.Please enter The Web Cotrol Center to enable it."
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "Umounting..."
|
||||
|
||||
config_load cifs
|
||||
config_foreach cifs_header cifs
|
||||
config_foreach umount_natshare natshare
|
||||
|
||||
echo "Cifs Umount succeed."
|
||||
|
||||
}
|
||||
|
||||
restart() {
|
||||
echo 'Umounting... '
|
||||
|
||||
config_load cifs
|
||||
config_foreach cifs_header cifs
|
||||
|
||||
config_foreach umount_natshare natshare
|
||||
|
||||
echo "Cifs Umount succeed."
|
||||
|
||||
echo ''
|
||||
echo 'Checking... '
|
||||
|
||||
if [ $ENABLED == 1 ]
|
||||
then {
|
||||
echo 'Cifs Mmount is Enabled. '
|
||||
echo 'Starting... '
|
||||
|
||||
config_foreach mount_natshare natshare
|
||||
|
||||
echo "Cifs Mount succeed."
|
||||
}
|
||||
else
|
||||
/etc/init.d/cifs disable
|
||||
echo "Cifs Mount is Disabled.Please enter The Web Cotrol Center to enable it."
|
||||
fi
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@cifs[-1]
|
||||
add ucitrack cifs
|
||||
set ucitrack.@cifs[-1].init=cifs
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
/etc/init.d/cifs stop >/dev/null 2>&1
|
||||
/etc/init.d/cifs disable >/dev/null 2>&1
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
@ -1,14 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=cpulimit configuration module
|
||||
LUCI_DEPENDS:=+cpulimit
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,15 +0,0 @@
|
||||
|
||||
module("luci.controller.cpulimit", package.seeall)
|
||||
|
||||
function index()
|
||||
require("luci.i18n")
|
||||
luci.i18n.loadc("cpulimit")
|
||||
if not nixio.fs.access("/etc/config/cpulimit") then
|
||||
return
|
||||
end
|
||||
|
||||
local page = entry({"admin", "system", "cpulimit"}, cbi("cpulimit"), luci.i18n.translate("cpulimit"), 65)
|
||||
page.i18n = "cpulimit"
|
||||
page.dependent = true
|
||||
|
||||
end
|
||||
@ -1,38 +0,0 @@
|
||||
|
||||
m = Map("cpulimit", translate("cpulimit"),translate("cpulimit "))
|
||||
s = m:section(TypedSection, "list", translate("Settings"))
|
||||
s.template = "cbi/tblsection"
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
|
||||
enable = s:option(Flag, "enabled", translate("enable", "enable"))
|
||||
enable.optional = false
|
||||
enable.rmempty = false
|
||||
|
||||
exename = s:option(Value, "exename", translate("exename"), translate("name of the executable program file or path name"))
|
||||
exename.optional = false
|
||||
exename.rmempty = false
|
||||
exename.default = "/usr/bin/transmission-daemon"
|
||||
exename:value("transmission","/usr/bin/transmission-daemon")
|
||||
exename:value("samba","/usr/sbin/smbd")
|
||||
exename:value("mount.ntfs-3g","mount.ntfs-3g")
|
||||
exename:value("vsftpd","/usr/sbin/vsftpd")
|
||||
exename:value("pure-ftpd","/usr/sbin/pure-ftpd")
|
||||
|
||||
limit = s:option(Value, "limit", translate("limit"))
|
||||
limit.optional = false
|
||||
limit.rmempty = false
|
||||
limit.default = "50"
|
||||
limit:value("100","100%")
|
||||
limit:value("90","90%")
|
||||
limit:value("80","80%")
|
||||
limit:value("70","70%")
|
||||
limit:value("60","60%")
|
||||
limit:value("50","50%")
|
||||
limit:value("40","40%")
|
||||
limit:value("30","30%")
|
||||
limit:value("20","20%")
|
||||
limit:value("10","10%")
|
||||
|
||||
|
||||
return m
|
||||
@ -1,30 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-06-28\n"
|
||||
"PO-Revision-Date: 2014-06-28\n"
|
||||
"Last-Translator: Syrone Wong <wong.syrone@gmail.com>\n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
|
||||
msgid "cpulimit"
|
||||
msgstr "CPU占用率限制"
|
||||
|
||||
msgid "Use cpulimit to restrict app's cpu usage."
|
||||
msgstr "利用cpulimit限制应用程序的CPU使用率"
|
||||
|
||||
msgid "Usage restrictions"
|
||||
msgstr "使用率限制"
|
||||
|
||||
msgid "exename"
|
||||
msgstr "进程名称"
|
||||
|
||||
msgid "name of the executable program file or path name"
|
||||
msgstr "可执行文件名称。不能是应用程序路径!"
|
||||
|
||||
msgid "limit"
|
||||
msgstr "占用率限制"
|
||||
@ -1,6 +0,0 @@
|
||||
|
||||
config 'list'
|
||||
option 'exename' '/usr/bin/transmission-daemon'
|
||||
option 'limit' '50'
|
||||
option 'enabled' '0'
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2006-2011 OpenWrt.org
|
||||
. /lib/functions.sh
|
||||
|
||||
START=50
|
||||
|
||||
DEFAULT=/etc/default/cpulimit
|
||||
|
||||
|
||||
start() {
|
||||
/usr/bin/cpulimit.sh start &
|
||||
}
|
||||
|
||||
stop() {
|
||||
killall -9 cpulimit
|
||||
}
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@cpulimit[-1]
|
||||
add ucitrack cpulimit
|
||||
set ucitrack.@cpulimit[-1].init=cpulimit
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
/etc/init.d/cpulimit enable
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
cpulimit_get(){
|
||||
echo cpulimit_get
|
||||
config_get enabled $1 enabled
|
||||
[ $enabled -gt 0 ] || return 1
|
||||
config_get limit $1 limit
|
||||
config_get exename $1 exename
|
||||
cpulimit -l $limit -e $exename &
|
||||
echo cpulimit -l $limit -e $exename
|
||||
}
|
||||
|
||||
|
||||
|
||||
stop() {
|
||||
killall -9 cpulimit
|
||||
# ps -a|grep cpulimit|while read line
|
||||
# do
|
||||
# killall cpulimit>/dev/null 2>&1
|
||||
# done
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"start")
|
||||
echo start
|
||||
killall -9 cpulimit
|
||||
config_load cpulimit
|
||||
config_foreach cpulimit_get list
|
||||
echo end
|
||||
exit 0
|
||||
;;
|
||||
"stop")echo stop; killall -9 cpulimit;;
|
||||
esac
|
||||
@ -1,24 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2006-2017 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for eqos.
|
||||
LUCI_DESCRIPTION:=LuCI support for Easy QoS(Support speed limit based on IP address).
|
||||
LUCI_DEPENDS:=+tc +kmod-sched-core +kmod-ifb
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_NAME:=luci-app-eqos
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
module("luci.controller.eqos", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/eqos") then
|
||||
return
|
||||
end
|
||||
|
||||
local page
|
||||
|
||||
page = entry({"admin", "network", "eqos"}, cbi("eqos"), "EQoS")
|
||||
page.dependent = true
|
||||
end
|
||||
@ -1,39 +0,0 @@
|
||||
local ipc = require "luci.ip"
|
||||
|
||||
local m = Map("eqos", translate("Network speed control service"))
|
||||
|
||||
local s = m:section(TypedSection, "eqos", "")
|
||||
s.anonymous = true
|
||||
|
||||
local e = s:option(Flag, "enabled", translate("Enable"))
|
||||
e.rmempty = false
|
||||
|
||||
local dl = s:option(Value, "download", translate("Download speed (Mbit/s)"), translate("Total bandwidth"))
|
||||
dl.datatype = "and(uinteger,min(1))"
|
||||
|
||||
local ul = s:option(Value, "upload", translate("Upload speed (Mbit/s)"), translate("Total bandwidth"))
|
||||
ul.datatype = "and(uinteger,min(1))"
|
||||
|
||||
s = m:section(TypedSection, "device", translate("Speed limit based on IP address"))
|
||||
s.template = "cbi/tblsection"
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
|
||||
local ip = s:option(Value, "ip", translate("IP address"))
|
||||
|
||||
ipc.neighbors({family = 4, dev = "br-lan"}, function(n)
|
||||
if n.mac and n.dest then
|
||||
ip:value(n.dest:string(), "%s (%s)" %{ n.dest:string(), n.mac })
|
||||
end
|
||||
end)
|
||||
|
||||
dl = s:option(Value, "download", translate("Download speed (Mbit/s)"))
|
||||
dl.datatype = "and(uinteger,min(1))"
|
||||
|
||||
ul = s:option(Value, "upload", translate("Upload speed (Mbit/s)"))
|
||||
ul.datatype = "and(uinteger,min(1))"
|
||||
|
||||
comment = s:option(Value, "comment", translate("Comment"))
|
||||
|
||||
return m
|
||||
@ -1,44 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: LuCi Chinese Translation\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Pootle 2.0.6\n"
|
||||
|
||||
|
||||
msgid "EQoS"
|
||||
msgstr "网速控制"
|
||||
|
||||
msgid "eqos"
|
||||
msgstr "网速控制"
|
||||
|
||||
msgid "Comment"
|
||||
msgstr "注解"
|
||||
|
||||
msgid "Download speed (Mbit/s)"
|
||||
msgstr "下载速度 (Mbit/s)"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "开启"
|
||||
|
||||
msgid "QoS"
|
||||
msgstr "QoS"
|
||||
|
||||
msgid "Network speed control service"
|
||||
msgstr "网速控制服务"
|
||||
|
||||
msgid "Upload speed (Mbit/s)"
|
||||
msgstr "上传速度 (Mbit/s)"
|
||||
|
||||
msgid "Speed limit based on IP address"
|
||||
msgstr "IP限速"
|
||||
|
||||
msgid "Total bandwidth"
|
||||
msgstr "总带宽"
|
||||
|
||||
msgid "Flow control setting"
|
||||
msgstr "流控设置"
|
||||
@ -1,12 +0,0 @@
|
||||
# The bandwidth unit is Mbit/s
|
||||
config eqos
|
||||
option enabled 0
|
||||
option download 100
|
||||
option upload 20
|
||||
|
||||
# Limiting the bandwidth of a single Device
|
||||
#config device
|
||||
# option ip "192.168.1.100"
|
||||
# option download 10
|
||||
# option upload 5
|
||||
# option comment "test"
|
||||
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
[ "$ACTION" = "ifup" ] || exit 0
|
||||
[ "$INTERFACE" = "lan" ] || exit 0
|
||||
|
||||
/etc/init.d/eqos start
|
||||
@ -1,39 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
|
||||
START=50
|
||||
|
||||
parse_device() {
|
||||
local cfg="$1" ip download upload
|
||||
|
||||
config_get ip "$cfg" ip
|
||||
config_get download "$cfg" download
|
||||
config_get upload "$cfg" upload
|
||||
|
||||
eqos add $ip $download $upload
|
||||
}
|
||||
|
||||
eqos_start() {
|
||||
local cfg="$1" enabled download upload
|
||||
|
||||
config_get_bool enabled "$cfg" enabled 0
|
||||
[ $enabled -eq 0 ] && return 0
|
||||
|
||||
config_get download "$cfg" download
|
||||
config_get upload "$cfg" upload
|
||||
|
||||
eqos start $download $upload
|
||||
|
||||
config_foreach parse_device device
|
||||
}
|
||||
|
||||
start() {
|
||||
eqos stop
|
||||
|
||||
config_load eqos
|
||||
config_foreach eqos_start eqos
|
||||
}
|
||||
|
||||
stop() {
|
||||
eqos stop
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q get ucitrack.@eqos[0] > /dev/null || {
|
||||
uci add ucitrack eqos > /dev/null
|
||||
uci set ucitrack.@eqos[0].init=eqos
|
||||
uci commit
|
||||
}
|
||||
|
||||
exit 0
|
||||
@ -1,60 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
dev=br-lan
|
||||
|
||||
stop_qos() {
|
||||
tc qdisc del dev $dev root 2>/dev/null
|
||||
tc qdisc del dev $dev ingress 2>/dev/null
|
||||
tc qdisc del dev ${dev}-ifb root 2>/dev/null
|
||||
ip link del dev ${dev}-ifb 2>/dev/null
|
||||
}
|
||||
|
||||
start_qos() {
|
||||
local dl=$1
|
||||
local up=$2
|
||||
|
||||
tc qdisc add dev $dev root handle 1: htb
|
||||
tc class add dev $dev parent 1: classid 1:1 htb rate ${dl}mbit
|
||||
|
||||
ip link add dev ${dev}-ifb name ${dev}-ifb type ifb
|
||||
ip link set dev ${dev}-ifb up
|
||||
|
||||
tc qdisc add dev ${dev}-ifb root handle 1: htb
|
||||
tc class add dev ${dev}-ifb parent 1: classid 1:1 htb rate ${up}mbit
|
||||
|
||||
tc qdisc add dev $dev ingress
|
||||
tc filter add dev $dev parent ffff: protocol ip u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ${dev}-ifb
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"stop")
|
||||
stop_qos
|
||||
;;
|
||||
"start")
|
||||
stop_qos
|
||||
start_qos $2 $3
|
||||
;;
|
||||
"add")
|
||||
ip="$2"
|
||||
dl="$3"
|
||||
up="$4"
|
||||
|
||||
cnt=$(tc class show dev $dev | wc -l)
|
||||
|
||||
tc class add dev $dev parent 1:1 classid 1:1$cnt htb rate ${dl}mbit ceil ${dl}mbit
|
||||
tc filter add dev $dev parent 1:0 protocol ip u32 match ip dst $ip flowid 1:1$cnt
|
||||
|
||||
tc class add dev ${dev}-ifb parent 1:1 classid 1:1$cnt htb rate ${up}mbit ceil ${up}mbit
|
||||
tc filter add dev ${dev}-ifb parent 1:0 protocol ip u32 match ip src $ip flowid 1:1$cnt
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 <command> [options]"
|
||||
echo "Commands:"
|
||||
echo " start dl_rate up_rate #Total bandwidth (Mbit/s)"
|
||||
echo " stop"
|
||||
echo " add ip dl_rate up_rate #Limiting the bandwidth of a single IP (Mbit/s)"
|
||||
echo "Example:"
|
||||
echo " $0 start 30 20 # Total bandwidth: down 30Mbit/s up 20Mbit/s"
|
||||
echo " $0 add 192.168.22.12 10 2 # down 10Mbit/s up 2Mbit/s"
|
||||
;;
|
||||
esac
|
||||
@ -1,37 +0,0 @@
|
||||
#
|
||||
# Copyright 2016-2019 Xingwang Liao <kuoruan@gmail.com>
|
||||
# Licensed to the public under the Apache License 2.0.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-kcptun
|
||||
PKG_VERSION:=1.5.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_MAINTAINER:=Xingwang Liao <kuoruan@gmail.com>
|
||||
|
||||
LUCI_TITLE:=LuCI support for Kcptun
|
||||
LUCI_DEPENDS:=+jshn +iptables +iptables-mod-tproxy
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/kcptun
|
||||
endef
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
( . /etc/uci-defaults/40_luci-kcptun ) && rm -f /etc/uci-defaults/40_luci-kcptun
|
||||
fi
|
||||
|
||||
chmod 755 "$${IPKG_INSTROOT}/etc/init.d/kcptun" >/dev/null 2>&1
|
||||
ln -sf "../init.d/kcptun" \
|
||||
"$${IPKG_INSTROOT}/etc/rc.d/S99kcptun" >/dev/null 2>&1
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,80 +0,0 @@
|
||||
-- Copyright 2016-2019 Xingwang Liao <kuoruan@gmail.com>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
module("luci.controller.kcptun", package.seeall)
|
||||
|
||||
local http = require "luci.http"
|
||||
local kcp = require "luci.model.kcptun"
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/kcptun") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "kcptun"},
|
||||
firstchild(), _("Kcptun Client")).dependent = false
|
||||
|
||||
entry({"admin", "services", "kcptun", "settings"},
|
||||
cbi("kcptun/settings"), _("Settings"), 1)
|
||||
|
||||
entry({"admin", "services", "kcptun", "servers"},
|
||||
arcombine(cbi("kcptun/servers"), cbi("kcptun/servers-detail")),
|
||||
_("Server Manage"), 2).leaf = true
|
||||
|
||||
entry({"admin", "services", "kcptun", "log"},
|
||||
template("kcptun/log_view"), _("Log"), 3)
|
||||
|
||||
entry({"admin", "services", "kcptun", "status"}, call("action_status"))
|
||||
|
||||
entry({"admin", "services", "kcptun", "log", "data"}, call("action_log_data"))
|
||||
|
||||
entry({"admin", "services", "kcptun", "log", "clear"}, call("action_log_clear")).leaf = true
|
||||
end
|
||||
|
||||
function action_status()
|
||||
local client_file = kcp.get_config_option("client_file")
|
||||
local running = kcp.is_running(client_file)
|
||||
|
||||
http.prepare_content("application/json")
|
||||
http.write_json({
|
||||
client = running
|
||||
})
|
||||
end
|
||||
|
||||
function action_log_data()
|
||||
local util = require "luci.util"
|
||||
|
||||
local log_data = { client = "", syslog = "" }
|
||||
|
||||
local enable_logging = kcp.get_config_option("enable_logging", "0") == "1"
|
||||
|
||||
if enable_logging then
|
||||
local client_log_file = kcp.get_current_log_file("client")
|
||||
log_data.client = util.trim(
|
||||
util.exec("tail -n 50 %s 2>/dev/null | sed 'x;1!H;$!d;x'" % client_log_file))
|
||||
end
|
||||
|
||||
log_data.syslog = util.trim(
|
||||
util.exec("logread | grep kcptun | tail -n 50 | sed 'x;1!H;$!d;x'"))
|
||||
|
||||
http.prepare_content("application/json")
|
||||
http.write_json(log_data)
|
||||
end
|
||||
|
||||
function action_log_clear(type)
|
||||
if type and type ~= "" then
|
||||
local fs = require "nixio.fs"
|
||||
|
||||
local log_file = kcp.get_current_log_file(type)
|
||||
|
||||
if fs.access(log_file) then
|
||||
fs.writefile(log_file, "")
|
||||
else
|
||||
http.status(404, "Not found")
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
http.prepare_content("application/json")
|
||||
http.write_json({ code = 0 })
|
||||
end
|
||||
@ -1,238 +0,0 @@
|
||||
-- Copyright 2016-2019 Xingwang Liao <kuoruan@gmail.com>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
local dsp = require "luci.dispatcher"
|
||||
|
||||
local m, s, o
|
||||
local sid = arg[1]
|
||||
|
||||
local encrypt_methods = {
|
||||
"aes",
|
||||
"aes-128",
|
||||
"aes-192",
|
||||
"salsa20",
|
||||
"blowfish",
|
||||
"twofish",
|
||||
"cast5",
|
||||
"3des",
|
||||
"tea",
|
||||
"xtea",
|
||||
"xor",
|
||||
"none",
|
||||
}
|
||||
|
||||
local modes = {
|
||||
"normal",
|
||||
"fast",
|
||||
"fast2",
|
||||
"fast3",
|
||||
"manual",
|
||||
}
|
||||
|
||||
m = Map("kcptun", "%s - %s" % { translate("Kcptun"), translate("Edit Server") })
|
||||
m.redirect = dsp.build_url("admin/services/kcptun/servers")
|
||||
|
||||
if m.uci:get("kcptun", sid) ~= "servers" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
s = m:section(NamedSection, sid, "servers")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(Value, "alias", "%s (%s)" % { translate("Alias"), translate("optional") })
|
||||
|
||||
o = s:option(Value, "server_addr", translate("Server"))
|
||||
o.datatype = "host"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "server_port", translate("Server Port"))
|
||||
o.datatype = "port"
|
||||
o.placeholder = "29900"
|
||||
|
||||
o = s:option(Value, "listen_addr", "%s (%s)" % { translate("Local Listen Host"), translate("optional") },
|
||||
translate("Local listen host."))
|
||||
o.datatype = "host"
|
||||
o.placeholder = "0.0.0.0"
|
||||
|
||||
o = s:option(Value, "listen_port", translate("Local Port"), translate("Local Listen Port."))
|
||||
o.datatype = "port"
|
||||
o.placeholder = "12948"
|
||||
|
||||
o = s:option(Value, "key", "%s (%s)" % { translate("Key"), translate("optional") },
|
||||
translate("Pre-shared secret for client and server."))
|
||||
o.password = true
|
||||
o.placeholder = "it's a secret"
|
||||
|
||||
o = s:option(Value, "crypt", translate("crypt"), translate("Encrypt Method"))
|
||||
for _, v in ipairs(encrypt_methods) do
|
||||
o:value(v, v:upper())
|
||||
end
|
||||
o.default = "aes"
|
||||
|
||||
o = s:option(ListValue, "mode", translate("mode"), translate("Embedded Mode"))
|
||||
for _, v in ipairs(modes) do
|
||||
o:value(v, v:upper())
|
||||
end
|
||||
o.default = "fast"
|
||||
|
||||
o = s:option(Flag, "nodelay", translate("nodelay"), translate("Enable nodelay Mode."))
|
||||
o:depends("mode", "manual")
|
||||
|
||||
o = s:option(Value, "interval", translate("interval"))
|
||||
o:depends("mode", "manual")
|
||||
o.datatype = "uinteger"
|
||||
o.placeholder = "50"
|
||||
|
||||
o = s:option(ListValue, "resend", translate("resend"))
|
||||
o:depends("mode", "manual")
|
||||
o:value("0", translate("Off"))
|
||||
o:value("1", translate("On"))
|
||||
o:value("2", translate("2nd ACK"))
|
||||
|
||||
o = s:option(Flag, "nc", translate("nc"))
|
||||
o:depends("mode", "manual")
|
||||
|
||||
o = s:option(Value, "mtu", "%s (%s)" % { translate("mtu"), translate("optional") },
|
||||
translate("Maximum transmission unit of UDP packets."))
|
||||
o.datatype = "range(64,9200)"
|
||||
o.placeholder = "1350"
|
||||
|
||||
o = s:option(Value, "sndwnd", "%s (%s)" % { translate("sndwnd"), translate("optional") },
|
||||
translate("Send Window Size(num of packets)."))
|
||||
o.datatype = "min(1)"
|
||||
o.default = "128"
|
||||
o.placeholder = "128"
|
||||
|
||||
o = s:option(Value, "rcvwnd", "%s (%s)" % { translate("rcvwnd"), translate("optional") },
|
||||
translate("Receive Window Size(num of packets)."))
|
||||
o.datatype = "min(1)"
|
||||
o.default = "512"
|
||||
o.placeholder = "512"
|
||||
|
||||
o = s:option(Value, "datashard", "%s (%s)" % { translate("datashard"), translate("optional") },
|
||||
translate("Reed-solomon Erasure Coding - datashard."))
|
||||
o.datatype = "uinteger"
|
||||
o.placeholder = "10"
|
||||
|
||||
o = s:option(Value, "parityshard", "%s (%s)" % { translate("parityshard"), translate("optional") },
|
||||
translate("Reed-solomon Erasure Coding - parityshard."))
|
||||
o.datatype = "uinteger"
|
||||
o.placeholder = "3"
|
||||
|
||||
o = s:option(Value, "dscp", "%s (%s)" % { translate("dscp"), translate("optional") }, translate("DSCP(6bit)"))
|
||||
o.datatype = "uinteger"
|
||||
o.placeholder = "0"
|
||||
|
||||
o = s:option(Flag, "nocomp", translate("nocomp"), translate("Disable Compression?"))
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "quiet", translate("quiet"), translate("Suppress the 'stream open/close' messages"))
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "tcp", translate("tcp"), translate("TCP transmission"))
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "acknodelay", translate("acknodelay"))
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
|
||||
o = s:option(Value, "conn", "%s (%s)" %{ translate("conn"), translate("optional") },
|
||||
translate("Number of UDP connections to server."))
|
||||
o.datatype = "min(1)"
|
||||
o.placeholder = "1"
|
||||
|
||||
o = s:option(Value, "autoexpire", "%s (%s)" % { translate("autoexpire"), translate("optional") },
|
||||
translate("Auto expiration time(in seconds) for a single UDP connection, 0 to disable."))
|
||||
o.datatype = "uinteger"
|
||||
o.placeholder = "0"
|
||||
|
||||
o = s:option(Value, "scavengettl", "%s (%s)" % { translate("scavengettl"), translate("optional") },
|
||||
translate("How long an expired connection can live(in sec), -1 to disable."))
|
||||
o.datatype = "min(-1)"
|
||||
o.placeholder = "600"
|
||||
|
||||
o = s:option(Value, "sockbuf", "%s (%s)" % { translate("sockbuf"), translate("optional") },
|
||||
translate("Send/secv buffer size of udp sockets, default unit is MB."))
|
||||
o.datatype = "uinteger"
|
||||
o.placeholder = "4"
|
||||
o.cfgvalue = function(...)
|
||||
local value = Value.cfgvalue(...)
|
||||
|
||||
if value then
|
||||
return tonumber(value) / 1024 / 1024
|
||||
end
|
||||
end
|
||||
o.write = function(self, section, value)
|
||||
local number = tonumber(value)
|
||||
if number then
|
||||
Value.write(self, section, number * 1024 * 1024)
|
||||
else
|
||||
Value.remove(self, section)
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Value, "smuxver", "%s (%s)" % { translate("smuxver"), translate("optional") },
|
||||
translate("Specify smux version, available 1,2, default: 1"))
|
||||
o:value("1")
|
||||
o:value("2")
|
||||
o.default = "1"
|
||||
|
||||
o = s:option(Value, "smuxbuf", "%s (%s)" % { translate("smuxbuf"), translate("optional") },
|
||||
translate("The overall de-mux buffer, default unit is MB."))
|
||||
o.datatype = "uinteger"
|
||||
o.placeholder = "4"
|
||||
o.cfgvalue = function(...)
|
||||
local value = Value.cfgvalue(...)
|
||||
|
||||
if value then
|
||||
return tonumber(value) / 1024 / 1024
|
||||
end
|
||||
end
|
||||
o.write = function(self, section, value)
|
||||
local number = tonumber(value)
|
||||
if number then
|
||||
Value.write(self, section, number * 1024 * 1024)
|
||||
else
|
||||
Value.remove(self, section)
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Value, "streambuf", "%s (%s)" % { translate("streambuf"), translate("optional") },
|
||||
translate("Per stream receive buffer, default unit is MB."))
|
||||
o.datatype = "uinteger"
|
||||
o.placeholder = "2"
|
||||
o.cfgvalue = function(...)
|
||||
local value = Value.cfgvalue(...)
|
||||
|
||||
if value then
|
||||
return tonumber(value) / 1024 / 1024
|
||||
end
|
||||
end
|
||||
o.write = function(self, section, value)
|
||||
local number = tonumber(value)
|
||||
if number then
|
||||
Value.write(self, section, number * 1024 * 1024)
|
||||
else
|
||||
Value.remove(self, section)
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Value, "keepalive", "%s (%s)" % { translate("keepalive"), translate("optional") },
|
||||
translate("NAT keepalive interval to prevent your router from removing port mapping, default unit is seconds."))
|
||||
o.datatype = "uinteger"
|
||||
o.placeholder = "10"
|
||||
|
||||
o = s:option(Value, "snmpperiod", "%s (%s)" % { translate("snmpperiod"),
|
||||
translate("optional") }, translate("SNMP collect period, in seconds"))
|
||||
o.datatype = "min(1)"
|
||||
o.placeholder = "60"
|
||||
|
||||
return m
|
||||
@ -1,71 +0,0 @@
|
||||
-- Copyright 2016-2019 Xingwang Liao <kuoruan@gmail.com>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
local dsp = require "luci.dispatcher"
|
||||
local http = require "luci.http"
|
||||
|
||||
local m, s, o
|
||||
|
||||
local function get_ip_string(ip)
|
||||
if ip and ip:find(":") then
|
||||
return "[%s]" % ip
|
||||
else
|
||||
return ip or ""
|
||||
end
|
||||
end
|
||||
|
||||
m = Map("kcptun", "%s - %s" % { translate("Kcptun"), translate("Server List") })
|
||||
|
||||
s = m:section(TypedSection, "servers")
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "cbi/tblsection"
|
||||
s.extedit = dsp.build_url("admin/services/kcptun/servers/%s")
|
||||
function s.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
m.uci:save("kcptun")
|
||||
http.redirect(s.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "alias", translate("Alias"))
|
||||
function o.cfgvalue(self, section)
|
||||
return Value.cfgvalue(self, section) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "_server_address", translate("Server Address"))
|
||||
function o.cfgvalue(self, section)
|
||||
local server = m.uci:get("kcptun", section, "server_addr") or "?"
|
||||
local server_port = m.uci:get("kcptun", section, "server_port") or "29900"
|
||||
return "%s:%s" % { get_ip_string(server), server_port }
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "_listen_addres", translate("Listen Address"))
|
||||
function o.cfgvalue(self, section)
|
||||
local local_host = m.uci:get("kcptun", section, "listen_addr") or "0.0.0.0"
|
||||
local local_port = m.uci:get("kcptun", section, "listen_port") or "12984"
|
||||
return "%s:%s" % { get_ip_string(local_host), local_port }
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "crypt", translate("Encrypt Method"))
|
||||
function o.cfgvalue(...)
|
||||
local v = Value.cfgvalue(...)
|
||||
return v and v:upper() or "?"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "mode", translate("Embedded Mode"))
|
||||
function o.cfgvalue(...)
|
||||
local v = Value.cfgvalue(...)
|
||||
return v and v:upper() or "?"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "nocomp", translate("Disable Compression"))
|
||||
function o.cfgvalue(...)
|
||||
local v = Value.cfgvalue(...)
|
||||
return v == "true" and translate("True") or translate("False")
|
||||
end
|
||||
|
||||
return m
|
||||
@ -1,82 +0,0 @@
|
||||
-- Copyright 2016-2019 Xingwang Liao <kuoruan@gmail.com>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local util = require "luci.util"
|
||||
local sys = require "luci.sys"
|
||||
local fs = require "nixio.fs"
|
||||
|
||||
local m, s, o
|
||||
local server_table = { }
|
||||
|
||||
local function get_ip_string(ip)
|
||||
if ip and ip:find(":") then
|
||||
return "[%s]" % ip
|
||||
else
|
||||
return ip or ""
|
||||
end
|
||||
end
|
||||
|
||||
uci:foreach("kcptun", "servers", function(s)
|
||||
if s.alias then
|
||||
server_table[s[".name"]] = s.alias
|
||||
elseif s.server_addr and s.server_port then
|
||||
server_table[s[".name"]] = "%s:%s" % { get_ip_string(s.server_addr), s.server_port }
|
||||
end
|
||||
end)
|
||||
|
||||
m = Map("kcptun", "%s - %s" % { translate("Kcptun"), translate("Settings") })
|
||||
m:append(Template("kcptun/status"))
|
||||
|
||||
s = m:section(NamedSection, "general", "general", translate("General Settings"))
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(ListValue, "server", translate("Server"))
|
||||
o:value("", translate("Disable"))
|
||||
for k, v in pairs(server_table) do
|
||||
o:value(k, v)
|
||||
end
|
||||
|
||||
o = s:option(Value, "client_file", translate("Client File"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "daemon_user", translate("Run Daemon as User"))
|
||||
o:value("")
|
||||
for u in util.execi("cat /etc/passwd | cut -d ':' -f1") do
|
||||
o:value(u)
|
||||
end
|
||||
|
||||
o = s:option(Flag, "enable_logging", translate("Enable Logging"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "log_folder", translate("Log Folder"))
|
||||
o.datatype = "directory"
|
||||
o.placeholder = "/var/log/kcptun"
|
||||
o:depends("enable_logging", "1")
|
||||
o.formvalue = function(...)
|
||||
local v = (Value.formvalue(...) or ""):trim()
|
||||
if v ~= "" then
|
||||
v = string.gsub(v, "\\", "/")
|
||||
if v:sub(1, 1) ~= "/" then
|
||||
v = "/" .. v
|
||||
end
|
||||
|
||||
while v:sub(-1) == "/" do
|
||||
v = v:sub(1, -2)
|
||||
end
|
||||
end
|
||||
|
||||
return v
|
||||
end
|
||||
o.validate = function(self, value, section)
|
||||
if value and not fs.stat(value) then
|
||||
local res, code, msg = fs.mkdir(value)
|
||||
if not res then
|
||||
return nil, msg
|
||||
end
|
||||
end
|
||||
return Value.validate(self, value, section)
|
||||
end
|
||||
|
||||
return m
|
||||
@ -1,58 +0,0 @@
|
||||
-- Copyright 2016-2019 Xingwang Liao <kuoruan@gmail.com>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
local fs = require "nixio.fs"
|
||||
local sys = require "luci.sys"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local util = require "luci.util"
|
||||
|
||||
module("luci.model.kcptun", package.seeall)
|
||||
|
||||
function get_config_option(option, default)
|
||||
return uci:get("kcptun", "general", option) or default
|
||||
end
|
||||
|
||||
function get_current_log_file(type)
|
||||
local log_folder = get_config_option("log_folder", "/var/log/kcptun")
|
||||
return "%s/%s.%s.log" % { log_folder, type, "general" }
|
||||
end
|
||||
|
||||
function is_running(client)
|
||||
if client and client ~= "" then
|
||||
local file_name = client:match(".*/([^/]+)$") or ""
|
||||
if file_name ~= "" then
|
||||
return sys.call("pidof %s >/dev/null" % file_name) == 0
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function get_kcptun_version(file)
|
||||
if file and file ~= "" then
|
||||
if not fs.access(file, "rwx", "rx", "rx") then
|
||||
fs.chmod(file, 755)
|
||||
end
|
||||
|
||||
local info = util.trim(sys.exec("%s -v 2>/dev/null" % file))
|
||||
|
||||
if info ~= "" then
|
||||
local tb = util.split(info, "%s+", nil, true)
|
||||
return tb[1] == "kcptun" and tb[3] or ""
|
||||
end
|
||||
end
|
||||
|
||||
return ""
|
||||
end
|
||||
|
||||
function get_luci_version()
|
||||
local ipkg = require "luci.model.ipkg"
|
||||
|
||||
local package_name = "luci-app-kcptun"
|
||||
local package_info = ipkg.info(package_name) or {}
|
||||
|
||||
if next(package_info) ~= nil then
|
||||
return package_info[package_name]["Version"]
|
||||
end
|
||||
return ""
|
||||
end
|
||||
@ -1,72 +0,0 @@
|
||||
<%#
|
||||
Copyright 2016-2019 Xingwang Liao <kuoruan@gmail.com>
|
||||
Licensed to the public under the Apache License 2.0.
|
||||
-%>
|
||||
|
||||
<% css = [[
|
||||
|
||||
#log_text {
|
||||
padding: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
#log_text pre {
|
||||
word-break: break-all;
|
||||
margin: 0;
|
||||
}
|
||||
.description {
|
||||
background-color: #33ccff;
|
||||
}
|
||||
|
||||
]]
|
||||
%>
|
||||
|
||||
<%+header%>
|
||||
|
||||
<div class="cbi-map">
|
||||
<h2 name="content"><%:Kcptun%> - <%:Log Data%></h2>
|
||||
<fieldset class="cbi-section">
|
||||
<div class="cbi-section-descr">
|
||||
<input type="button" class="cbi-button" value="<%:Clear Log File%>" placeholder="<%:Clear Log File%>" onclick="return log_clear('client', this)" />
|
||||
</div>
|
||||
<fieldset class="cbi-section-node">
|
||||
<div id="log_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /><%:Collecting data...%></div>
|
||||
<div style="text-align:right"><small><%:Refresh every 5 seconds.%></small></div>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function log_clear(type, btn) {
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Processing...%>';
|
||||
|
||||
(new XHR()).get('<%=luci.dispatcher.build_url("admin/services/kcptun/log/clear")%>/' + type,
|
||||
{ token: '<%=token%>' },
|
||||
function(x, json) {
|
||||
btn.disabled = false;
|
||||
btn.value = btn.placeholder;
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
XHR.poll(5, '<%=luci.dispatcher.build_url("admin/services/kcptun/log/data")%>', null,
|
||||
function(x, data) {
|
||||
var logElm = document.getElementById('log_text');
|
||||
if (logElm) {
|
||||
logElm.innerHTML = data
|
||||
? String.format(
|
||||
'<pre>%s%s%s%s</pre>',
|
||||
'<span class="description"><%:Last 50 lines of log file:%></span><br/><br/>',
|
||||
data.client || '<%:No log data.%>',
|
||||
'<br/><br/><span class="description"><%:Last 50 lines of syslog:%></span><br/><br/>',
|
||||
data.syslog || '<%:No log data.%>'
|
||||
)
|
||||
: '<strong><%:Error get log data.%></strong>';
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]></script>
|
||||
|
||||
<%+footer%>
|
||||
@ -1,87 +0,0 @@
|
||||
<%#
|
||||
Copyright 2016-2019 Xingwang Liao <kuoruan@gmail.com>
|
||||
Licensed to the public under the Apache License 2.0.
|
||||
-%>
|
||||
|
||||
<%
|
||||
local kcp = require "luci.model.kcptun"
|
||||
local dsp = require "luci.dispatcher"
|
||||
|
||||
local client_file = kcp.get_config_option("client_file")
|
||||
local client_version = kcp.get_kcptun_version(client_file)
|
||||
local luci_version = kcp.get_luci_version()
|
||||
-%>
|
||||
|
||||
<style type="text/css">
|
||||
.kcptun-status-node {
|
||||
margin-bottom: -18px;
|
||||
}
|
||||
.kcptun-status-item {
|
||||
margin-bottom: 18px;
|
||||
zoom: 1;
|
||||
line-height: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
.kcptun-status-item:before, .kcptun-status-item:after {
|
||||
display: table;
|
||||
content: "";
|
||||
zoom: 1;
|
||||
}
|
||||
.kcptun-status-item-title {
|
||||
width: 180px;
|
||||
float: left;
|
||||
text-align: right;
|
||||
color: #404040;
|
||||
}
|
||||
.kcptun-status-item-value {
|
||||
margin-left: 200px;
|
||||
}
|
||||
.kcptun-status-item-value a {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
<legend><%:Running Status%></legend>
|
||||
<div class="cbi-section-node kcptun-status-node">
|
||||
<div class="kcptun-status-item">
|
||||
<div class="kcptun-status-item-title"><%:Client Status%></div>
|
||||
<div class="kcptun-status-item-value" id="_kcptun-client_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</div>
|
||||
</div>
|
||||
<div class="kcptun-status-item">
|
||||
<div class="kcptun-status-item-title"><%:Client Version%></div>
|
||||
<div class="kcptun-status-item-value">
|
||||
<%- if client_version == "" then -%>
|
||||
<em><%:Invalid Client File.%></em>
|
||||
<% else -%>
|
||||
<%=pcdata(client_version)%>
|
||||
<%- end %>
|
||||
<a href="https://github.com/xtaci/kcptun/releases/latest" target="_blank"><%:Get latest%></a>
|
||||
<a href="https://github.com/kuoruan/openwrt-kcptun/releases/latest" target="_blank"><%:Get latest%> (ipk)</a>
|
||||
</div>
|
||||
</div>
|
||||
<% if luci_version ~= "" then -%>
|
||||
<div class="kcptun-status-item">
|
||||
<div class="kcptun-status-item-title"><%:LuCI Version%></div>
|
||||
<div class="kcptun-status-item-value">
|
||||
<%=pcdata(luci_version)%>
|
||||
<a href="https://github.com/kuoruan/luci-app-kcptun/releases/latest" target="_blank"><%:Get latest%></a>
|
||||
</div>
|
||||
</div>
|
||||
<% end -%>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(5, '<%=dsp.build_url("admin/services/kcptun/status")%>', null,
|
||||
function(x, json) {
|
||||
if (x.status !== 200 || !json) return;
|
||||
var clientStatusElm = document.getElementById('_kcptun-client_status');
|
||||
if (clientStatusElm) {
|
||||
clientStatusElm.innerHTML = json.client ? '<%:Running%>' : '<%:Not Running%>';
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]></script>
|
||||
@ -1,413 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:92
|
||||
msgid "2nd ACK"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:44
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:34
|
||||
msgid "Alias"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:153
|
||||
msgid ""
|
||||
"Auto expiration time(in seconds) for a single UDP connection, 0 to disable."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:29
|
||||
msgid "Clear Log File"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:41
|
||||
msgid "Client File"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:48
|
||||
msgid "Client Status"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:54
|
||||
msgid "Client Version"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:32 luasrc/view/kcptun/status.htm:50
|
||||
msgid "Collecting data..."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:124
|
||||
msgid "DSCP(6bit)"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:36
|
||||
msgid "Disable"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:65
|
||||
msgid "Disable Compression"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:128
|
||||
msgid "Disable Compression?"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:32
|
||||
msgid "Edit Server"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:74
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:59
|
||||
msgid "Embedded Mode"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:50
|
||||
msgid "Enable Logging"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:80
|
||||
msgid "Enable nodelay Mode."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:68
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:53
|
||||
msgid "Encrypt Method"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:66
|
||||
msgid "Error get log data."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:68
|
||||
msgid "False"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:31
|
||||
msgid "General Settings"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:61 luasrc/view/kcptun/status.htm:62
|
||||
#: luasrc/view/kcptun/status.htm:70
|
||||
msgid "Get latest"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:158
|
||||
msgid "How long an expired connection can live(in sec), -1 to disable."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:57
|
||||
msgid "Invalid Client File."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:32
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:17
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:28 luasrc/view/kcptun/log_view.htm:26
|
||||
msgid "Kcptun"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/controller/kcptun.lua:15
|
||||
msgid "Kcptun Client"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:63
|
||||
msgid "Key"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:61
|
||||
msgid "Last 50 lines of log file:"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:63
|
||||
msgid "Last 50 lines of syslog:"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:46
|
||||
msgid "Listen Address"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:32
|
||||
msgid "Loading"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:54
|
||||
msgid "Local Listen Host"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:59
|
||||
msgid "Local Listen Port."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:59
|
||||
msgid "Local Port"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:55
|
||||
msgid "Local listen host."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/controller/kcptun.lua:25
|
||||
msgid "Log"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:26
|
||||
msgid "Log Data"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:53
|
||||
msgid "Log Folder"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:67
|
||||
msgid "LuCI Version"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:98
|
||||
msgid "Maximum transmission unit of UDP packets."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:229
|
||||
msgid ""
|
||||
"NAT keepalive interval to prevent your router from removing port mapping, "
|
||||
"default unit is seconds."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:62 luasrc/view/kcptun/log_view.htm:64
|
||||
msgid "No log data."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:36
|
||||
msgid "None"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:83
|
||||
msgid "Not Running"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:148
|
||||
msgid "Number of UDP connections to server."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:90
|
||||
msgid "Off"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:91
|
||||
msgid "On"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:209
|
||||
msgid "Per stream receive buffer, default unit is MB."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:64
|
||||
msgid "Pre-shared secret for client and server."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:42
|
||||
msgid "Processing..."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:109
|
||||
msgid "Receive Window Size(num of packets)."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:115
|
||||
msgid "Reed-solomon Erasure Coding - datashard."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:120
|
||||
msgid "Reed-solomon Erasure Coding - parityshard."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:33
|
||||
msgid "Refresh every 5 seconds."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:44
|
||||
msgid "Run Daemon as User"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:83
|
||||
msgid "Running"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:45
|
||||
msgid "Running Status"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:234
|
||||
msgid "SNMP collect period, in seconds"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:103
|
||||
msgid "Send Window Size(num of packets)."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:163
|
||||
msgid "Send/secv buffer size of udp sockets, default unit is MB."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:46
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:35
|
||||
msgid "Server"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:39
|
||||
msgid "Server Address"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:17
|
||||
msgid "Server List"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/controller/kcptun.lua:22
|
||||
msgid "Server Manage"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:50
|
||||
msgid "Server Port"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/controller/kcptun.lua:18 luasrc/model/cbi/kcptun/settings.lua:28
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:183
|
||||
msgid "Specify smux version, available 1,2, default: 1"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:133
|
||||
msgid "Suppress the 'stream open/close' messages"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:138
|
||||
msgid "TCP transmission"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:189
|
||||
msgid "The overall de-mux buffer, default unit is MB."
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:68
|
||||
msgid "True"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:143
|
||||
msgid "acknodelay"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:152
|
||||
msgid "autoexpire"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:147
|
||||
msgid "conn"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:68
|
||||
msgid "crypt"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:114
|
||||
msgid "datashard"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:124
|
||||
msgid "dscp"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:83
|
||||
msgid "interval"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:228
|
||||
msgid "keepalive"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:74
|
||||
msgid "mode"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:97
|
||||
msgid "mtu"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:94
|
||||
msgid "nc"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:128
|
||||
msgid "nocomp"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:80
|
||||
msgid "nodelay"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:44
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:54
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:63
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:97
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:102
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:108
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:114
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:119
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:124
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:147
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:152
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:157
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:162
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:182
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:188
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:208
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:228
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:234
|
||||
msgid "optional"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:119
|
||||
msgid "parityshard"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:133
|
||||
msgid "quiet"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:108
|
||||
msgid "rcvwnd"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:88
|
||||
msgid "resend"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:157
|
||||
msgid "scavengettl"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:188
|
||||
msgid "smuxbuf"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:182
|
||||
msgid "smuxver"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:102
|
||||
msgid "sndwnd"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:233
|
||||
msgid "snmpperiod"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:162
|
||||
msgid "sockbuf"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:208
|
||||
msgid "streambuf"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:138
|
||||
msgid "tcp"
|
||||
msgstr ""
|
||||
@ -1,497 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:92
|
||||
msgid "2nd ACK"
|
||||
msgstr "2次 ACK 跨越重传"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:44
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:34
|
||||
msgid "Alias"
|
||||
msgstr "别名"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:153
|
||||
msgid ""
|
||||
"Auto expiration time(in seconds) for a single UDP connection, 0 to disable."
|
||||
msgstr "单个 UDP 连接的自动过期时间 (秒),设置 0 来禁用"
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:29
|
||||
msgid "Clear Log File"
|
||||
msgstr "清理日志文件"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:41
|
||||
msgid "Client File"
|
||||
msgstr "客户端文件"
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:48
|
||||
msgid "Client Status"
|
||||
msgstr "客户端状态"
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:54
|
||||
msgid "Client Version"
|
||||
msgstr "客户端版本"
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:32 luasrc/view/kcptun/status.htm:50
|
||||
msgid "Collecting data..."
|
||||
msgstr "正在收集数据..."
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:124
|
||||
msgid "DSCP(6bit)"
|
||||
msgstr "DSCP(6bit)"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:36
|
||||
msgid "Disable"
|
||||
msgstr "禁用"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:65
|
||||
msgid "Disable Compression"
|
||||
msgstr "禁用压缩"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:128
|
||||
msgid "Disable Compression?"
|
||||
msgstr "是否禁用压缩?"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:32
|
||||
msgid "Edit Server"
|
||||
msgstr "编辑服务端"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:74
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:59
|
||||
msgid "Embedded Mode"
|
||||
msgstr "内置模式"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:50
|
||||
msgid "Enable Logging"
|
||||
msgstr "启用日志记录"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:80
|
||||
msgid "Enable nodelay Mode."
|
||||
msgstr "启用 nodelay 模式"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:68
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:53
|
||||
msgid "Encrypt Method"
|
||||
msgstr "加密方式"
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:66
|
||||
msgid "Error get log data."
|
||||
msgstr "获取日志数据失败。"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:68
|
||||
msgid "False"
|
||||
msgstr "否"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:31
|
||||
msgid "General Settings"
|
||||
msgstr "基本设置"
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:61 luasrc/view/kcptun/status.htm:62
|
||||
#: luasrc/view/kcptun/status.htm:70
|
||||
msgid "Get latest"
|
||||
msgstr "获取最新版"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:158
|
||||
msgid "How long an expired connection can live(in sec), -1 to disable."
|
||||
msgstr "过期连接保留多长时间 (秒),设置 -1 来禁用"
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:57
|
||||
msgid "Invalid Client File."
|
||||
msgstr "客户端文件配置有误"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:32
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:17
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:28 luasrc/view/kcptun/log_view.htm:26
|
||||
msgid "Kcptun"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/controller/kcptun.lua:15
|
||||
msgid "Kcptun Client"
|
||||
msgstr "Kcptun 客户端"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:63
|
||||
msgid "Key"
|
||||
msgstr "密码"
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:61
|
||||
msgid "Last 50 lines of log file:"
|
||||
msgstr "日志文件的最新 50 行:"
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:63
|
||||
msgid "Last 50 lines of syslog:"
|
||||
msgstr "系统日志的最新 50 行:"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:46
|
||||
msgid "Listen Address"
|
||||
msgstr "监听地址"
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:32
|
||||
msgid "Loading"
|
||||
msgstr "正在加载..."
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:54
|
||||
msgid "Local Listen Host"
|
||||
msgstr "本地监听地址"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:59
|
||||
msgid "Local Listen Port."
|
||||
msgstr "本地监听端口"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:59
|
||||
msgid "Local Port"
|
||||
msgstr "本地端口"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:55
|
||||
msgid "Local listen host."
|
||||
msgstr "本地监听主机"
|
||||
|
||||
#: luasrc/controller/kcptun.lua:25
|
||||
msgid "Log"
|
||||
msgstr "日志"
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:26
|
||||
msgid "Log Data"
|
||||
msgstr "日志数据"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:53
|
||||
msgid "Log Folder"
|
||||
msgstr "日志文件夹"
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:67
|
||||
msgid "LuCI Version"
|
||||
msgstr "LuCI 版本"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:98
|
||||
msgid "Maximum transmission unit of UDP packets."
|
||||
msgstr "UDP 数据包的最大传输单元"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:229
|
||||
msgid ""
|
||||
"NAT keepalive interval to prevent your router from removing port mapping, "
|
||||
"default unit is seconds."
|
||||
msgstr "NAT Keepalive 包间隔时间(秒), 防止路由器删除端口映射"
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:62 luasrc/view/kcptun/log_view.htm:64
|
||||
msgid "No log data."
|
||||
msgstr "无日志数据。"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:36
|
||||
msgid "None"
|
||||
msgstr "无"
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:83
|
||||
msgid "Not Running"
|
||||
msgstr "未运行"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:148
|
||||
msgid "Number of UDP connections to server."
|
||||
msgstr "到服务端的 UDP 连接数量"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:90
|
||||
msgid "Off"
|
||||
msgstr "关闭"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:91
|
||||
msgid "On"
|
||||
msgstr "开启"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:209
|
||||
msgid "Per stream receive buffer, default unit is MB."
|
||||
msgstr "每个传输流最大内存大小 (MB)"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:64
|
||||
msgid "Pre-shared secret for client and server."
|
||||
msgstr "客户端和服务端的通信密码"
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:42
|
||||
msgid "Processing..."
|
||||
msgstr "正在操作..."
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:109
|
||||
msgid "Receive Window Size(num of packets)."
|
||||
msgstr "接收窗口大小 (数据包数量)"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:115
|
||||
msgid "Reed-solomon Erasure Coding - datashard."
|
||||
msgstr "前向纠错 - datashard"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:120
|
||||
msgid "Reed-solomon Erasure Coding - parityshard."
|
||||
msgstr "前向纠错 - parityshard"
|
||||
|
||||
#: luasrc/view/kcptun/log_view.htm:33
|
||||
msgid "Refresh every 5 seconds."
|
||||
msgstr "每 5 秒刷新。"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:44
|
||||
msgid "Run Daemon as User"
|
||||
msgstr "以该用户启动"
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:83
|
||||
msgid "Running"
|
||||
msgstr "运行中"
|
||||
|
||||
#: luasrc/view/kcptun/status.htm:45
|
||||
msgid "Running Status"
|
||||
msgstr "运行状态"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:234
|
||||
msgid "SNMP collect period, in seconds"
|
||||
msgstr "SNMP采集周期 (秒)"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:103
|
||||
msgid "Send Window Size(num of packets)."
|
||||
msgstr "发送窗口大小 (数据包数量)"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:163
|
||||
msgid "Send/secv buffer size of udp sockets, default unit is MB."
|
||||
msgstr "发送/接收UDP数据包的缓冲区大小 (MB)"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:46
|
||||
#: luasrc/model/cbi/kcptun/settings.lua:35
|
||||
msgid "Server"
|
||||
msgstr "服务端地址"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:39
|
||||
msgid "Server Address"
|
||||
msgstr "服务端地址"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:17
|
||||
msgid "Server List"
|
||||
msgstr "服务端列表"
|
||||
|
||||
#: luasrc/controller/kcptun.lua:22
|
||||
msgid "Server Manage"
|
||||
msgstr "服务端管理"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:50
|
||||
msgid "Server Port"
|
||||
msgstr "服务端端口"
|
||||
|
||||
#: luasrc/controller/kcptun.lua:18 luasrc/model/cbi/kcptun/settings.lua:28
|
||||
msgid "Settings"
|
||||
msgstr "设置"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:183
|
||||
msgid "Specify smux version, available 1,2, default: 1"
|
||||
msgstr "设置 smux 版本,可选 1, 2。默认:1"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:133
|
||||
msgid "Suppress the 'stream open/close' messages"
|
||||
msgstr "不打印 'stream open/close' 信息"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:138
|
||||
msgid "TCP transmission"
|
||||
msgstr "TCP 传输"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:189
|
||||
msgid "The overall de-mux buffer, default unit is MB."
|
||||
msgstr "缓存大小 (MB)"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers.lua:68
|
||||
msgid "True"
|
||||
msgstr "是"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:143
|
||||
msgid "acknodelay"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:152
|
||||
msgid "autoexpire"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:147
|
||||
msgid "conn"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:68
|
||||
msgid "crypt"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:114
|
||||
msgid "datashard"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:124
|
||||
msgid "dscp"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:83
|
||||
msgid "interval"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:228
|
||||
msgid "keepalive"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:74
|
||||
msgid "mode"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:97
|
||||
msgid "mtu"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:94
|
||||
msgid "nc"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:128
|
||||
msgid "nocomp"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:80
|
||||
msgid "nodelay"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:44
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:54
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:63
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:97
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:102
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:108
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:114
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:119
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:124
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:147
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:152
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:157
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:162
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:182
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:188
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:208
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:228
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:234
|
||||
msgid "optional"
|
||||
msgstr "可选"
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:119
|
||||
msgid "parityshard"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:133
|
||||
msgid "quiet"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:108
|
||||
msgid "rcvwnd"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:88
|
||||
msgid "resend"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:157
|
||||
msgid "scavengettl"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:188
|
||||
msgid "smuxbuf"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:182
|
||||
msgid "smuxver"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:102
|
||||
msgid "sndwnd"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:233
|
||||
msgid "snmpperiod"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:162
|
||||
msgid "sockbuf"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:208
|
||||
msgid "streambuf"
|
||||
msgstr ""
|
||||
|
||||
#: luasrc/model/cbi/kcptun/servers-detail.lua:138
|
||||
msgid "tcp"
|
||||
msgstr ""
|
||||
|
||||
#~ msgid "Auto"
|
||||
#~ msgstr "自动"
|
||||
|
||||
#~ msgid "CPU Architecture"
|
||||
#~ msgstr "CPU 架构"
|
||||
|
||||
#~ msgid "Can't determine ARCH, or ARCH not supported. Please select manually."
|
||||
#~ msgstr "无法自动确定 ARCH,或者不支持该 ARCH,请手动重新选择。"
|
||||
|
||||
#~ msgid "Can't find client in file: %s"
|
||||
#~ msgstr "无法在文件中找到客户端:%s"
|
||||
|
||||
#~ msgid "Can't move new file to path: %s"
|
||||
#~ msgstr "无法移动新文件到:%s"
|
||||
|
||||
#~ msgid "Check Kcptun Update"
|
||||
#~ msgstr "检查 Kcptun 更新"
|
||||
|
||||
#~ msgid "Check LuCI Update"
|
||||
#~ msgstr "检查 LuCI 更新"
|
||||
|
||||
#~ msgid "Click to Update"
|
||||
#~ msgstr "点击更新"
|
||||
|
||||
#~ msgid "Client file is required."
|
||||
#~ msgstr "请指定客户端文件。"
|
||||
|
||||
#~ msgid "Download url is required."
|
||||
#~ msgstr "请指定下载链接。"
|
||||
|
||||
#~ msgid "Downloading..."
|
||||
#~ msgstr "正在下载..."
|
||||
|
||||
#~ msgid "Extracting..."
|
||||
#~ msgstr "正在解压..."
|
||||
|
||||
#~ msgid "File download failed or timed out: %s"
|
||||
#~ msgstr "文件下载失败或超时:%s"
|
||||
|
||||
#~ msgid "File path required."
|
||||
#~ msgstr "请指定文件路径。"
|
||||
|
||||
#~ msgid "Get remote version info failed."
|
||||
#~ msgstr "获取远程版本信息失败。"
|
||||
|
||||
#~ msgid "Make sure that the 'Client File' dictionary has enough space."
|
||||
#~ msgstr "请确保“客户端文件”所在的文件夹具有足够的空间。"
|
||||
|
||||
#~ msgid "Moving..."
|
||||
#~ msgstr "正在移动..."
|
||||
|
||||
#~ msgid "New version found, but failed to get new version download url."
|
||||
#~ msgstr "发现新版本,但是获取下载地址失败。"
|
||||
|
||||
#~ msgid "No Update Found"
|
||||
#~ msgstr "未发现更新"
|
||||
|
||||
#~ msgid "Package update failed."
|
||||
#~ msgstr "软件包升级失败。"
|
||||
|
||||
#~ msgid "Save Config File"
|
||||
#~ msgstr "保留配置文件"
|
||||
|
||||
#~ msgid "Save config file while upgrade LuCI."
|
||||
#~ msgstr "在更新 LuCI 时保留配置文件"
|
||||
|
||||
#~ msgid "The ARCH for checking updates."
|
||||
#~ msgstr "用于检查更新的 ARCH。"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "The client file is not suitable for current device. Please reselect ARCH."
|
||||
#~ msgstr "客户端文件不适用于当前设备,请重新选择 ARCH。"
|
||||
|
||||
#~ msgid "Update Success."
|
||||
#~ msgstr "更新成功!"
|
||||
|
||||
#~ msgid "Update in progress. Are you sure to close window?"
|
||||
#~ msgstr "正在更新,确定关闭窗口?"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "You may need to reload current page after update LuCI. Note that "
|
||||
#~ "translation will not be updated."
|
||||
#~ msgstr "更新 LuCI 之后你可能需要手动刷新当前页面。注意:翻译不会被更新"
|
||||
@ -1,17 +0,0 @@
|
||||
|
||||
config general 'general'
|
||||
option server ''
|
||||
option client_file '/usr/bin/kcptun-client'
|
||||
option daemon_user 'root'
|
||||
option enable_logging '1'
|
||||
|
||||
config servers 'default'
|
||||
option server_addr ''
|
||||
option server_port '29900'
|
||||
option listen_addr '0.0.0.0'
|
||||
option listen_port '12948'
|
||||
option crypt 'aes'
|
||||
option mode 'fast'
|
||||
option nocomp 'false'
|
||||
option quiet 'false'
|
||||
option tcp 'false'
|
||||
@ -1,230 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright 2016-2019 Xingwang Liao <kuoruan@gmail.com>
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
KCPTUN=kcptun
|
||||
CONFIG_FOLDER=/var/etc/$KCPTUN
|
||||
|
||||
if [ -r /usr/share/libubox/jshn.sh ]; then
|
||||
. /usr/share/libubox/jshn.sh
|
||||
elif [ -r /lib/functions/jshn.sh ]; then
|
||||
. /lib/functions/jshn.sh
|
||||
else
|
||||
logger -p daemon.err -t "$KCPTUN" \
|
||||
"Package required: jshn."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
_log() {
|
||||
local level="$1"
|
||||
local msg="$2"
|
||||
|
||||
logger -p "daemon.${level}" -t "$KCPTUN" "$msg"
|
||||
}
|
||||
|
||||
gen_client_config_file() {
|
||||
local config_file="$1"
|
||||
|
||||
json_init
|
||||
json_add_string "remoteaddr" "${server_addr}:${server_port}"
|
||||
json_add_string "localaddr" "${listen_addr}:${listen_port}"
|
||||
|
||||
add_configs() {
|
||||
local type="$1"; shift
|
||||
local k v
|
||||
|
||||
for k in "$@"; do
|
||||
v="$(eval echo "\$$k")"
|
||||
|
||||
if [ -n "$v" ]; then
|
||||
if [ "$type" = "string" ]; then
|
||||
json_add_string "$k" "$v"
|
||||
elif [ "$type" = "int" ]; then
|
||||
json_add_int "$k" "$v"
|
||||
elif [ "$type" = "boolean" ]; then
|
||||
if [ "$v" = "true" ]; then
|
||||
json_add_boolean "$k" "1"
|
||||
else
|
||||
json_add_boolean "$k" "0"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
add_configs "string" key crypt mode
|
||||
add_configs "int" conn autoexpire mtu sndwnd rcvwnd datashard parityshard dscp \
|
||||
nodelay interval resend nc sockbuf smuxver smuxbuf streambuf keepalive scavengettl snmpperiod
|
||||
add_configs "boolean" nocomp acknodelay quiet tcp
|
||||
|
||||
if [ -n "$log_file" ]; then
|
||||
json_add_string "log" "$log_file"
|
||||
fi
|
||||
|
||||
json_close_object
|
||||
|
||||
json_dump -i >"$config_file"
|
||||
}
|
||||
|
||||
add_iptables_rule() {
|
||||
local port="$1"
|
||||
|
||||
iptables-restore --noflush <<-EOF 2>/dev/null
|
||||
*nat
|
||||
:KCPTUN -
|
||||
-A KCPTUN -p tcp --dport $port -j ACCEPT
|
||||
-A INPUT -p tcp -j KCPTUN
|
||||
COMMIT
|
||||
EOF
|
||||
}
|
||||
|
||||
clear_iptables_rule() {
|
||||
iptables-save --counters | grep -vi "KCPTUN" | iptables-restore --counters
|
||||
}
|
||||
|
||||
validate_config_section() {
|
||||
uci_validate_section "$KCPTUN" general "$1" \
|
||||
'server:uciname' \
|
||||
'client_file:string' \
|
||||
'daemon_user:string:root' \
|
||||
'enable_logging:bool:0' \
|
||||
'log_folder:directory:/var/log/kcptun'
|
||||
}
|
||||
|
||||
validate_server_section() {
|
||||
uci_validate_section "$KCPTUN" servers "$1" \
|
||||
'server_addr:host' \
|
||||
'server_port:port:29900' \
|
||||
'listen_addr:host:0.0.0.0' \
|
||||
'listen_port:port:12948' \
|
||||
'key:string' \
|
||||
'crypt:string:aes' \
|
||||
'mode:or("normal","fast","fast2","fast3","manual"):fast' \
|
||||
'conn:min(1)' \
|
||||
'autoexpire:uinteger' \
|
||||
'scavengettl:min(-1)' \
|
||||
'mtu:range(64,9200)' \
|
||||
'sndwnd:min(1)' \
|
||||
'rcvwnd:min(1)' \
|
||||
'datashard:uinteger' \
|
||||
'parityshard:uinteger' \
|
||||
'dscp:uinteger' \
|
||||
'nocomp:or("true", "false")' \
|
||||
'quiet:or("true", "false")' \
|
||||
'tcp:or("true", "false")' \
|
||||
'nodelay:bool' \
|
||||
'interval:uinteger' \
|
||||
'resend:range(0,2)' \
|
||||
'nc:bool' \
|
||||
'acknodelay:or("true", "false")' \
|
||||
'sockbuf:uinteger' \
|
||||
'smuxver:or("1", "2")' \
|
||||
'smuxbuf:uinteger' \
|
||||
'streambuf:uinteger' \
|
||||
'keepalive:uinteger' \
|
||||
'snmpperiod:min(1)'
|
||||
}
|
||||
|
||||
validate_client_file() {
|
||||
local file="$1"
|
||||
|
||||
if [ ! -f "$file" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
test -x "$file" || chmod 755 "$file"
|
||||
|
||||
( $file -v 2>/dev/null | grep -q "$KCPTUN" )
|
||||
}
|
||||
|
||||
start_kcptun_instance() {
|
||||
local section="$1"
|
||||
|
||||
if ! validate_config_section "$section" ; then
|
||||
_log "err" "Config validate failed."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "$server" ] || [ "$server" = "nil" ]; then
|
||||
_log "info" "No server selected, Client will stop."
|
||||
return 0
|
||||
elif ! validate_server_section "$server"; then
|
||||
_log "err" "Server config validation failed."
|
||||
return 1
|
||||
elif [ -z "$server_addr" ] || [ -z "$listen_port" ]; then
|
||||
_log "err" "Server config validation failed."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "$client_file" ]; then
|
||||
_log "err" "Please set client file path, or use auto download."
|
||||
return 1;
|
||||
elif ! validate_client_file "$client_file"; then
|
||||
_log "err" "Client file validation failed."
|
||||
return 1
|
||||
fi
|
||||
|
||||
is_ipv6_address() {
|
||||
echo "$1" | grep -q ":"
|
||||
}
|
||||
|
||||
is_ipv6_address "$server_addr" && server_addr="[${server_addr}]"
|
||||
is_ipv6_address "$listen_addr" && listen_addr="[${listen_addr}]"
|
||||
|
||||
test -d "$CONFIG_FOLDER" || mkdir -p "$CONFIG_FOLDER"
|
||||
|
||||
log_file=""
|
||||
if [ "x$enable_logging" = "x1" ]; then
|
||||
mkdir -p "$log_folder"
|
||||
chown -R "$daemon_user" "$log_folder"
|
||||
log_file="${log_folder}/client.${section}.log"
|
||||
fi
|
||||
|
||||
local config_file="${CONFIG_FOLDER}/client.${section}.json"
|
||||
|
||||
if ! ( gen_client_config_file "$config_file" ); then
|
||||
_log "err" "Can't create config file".
|
||||
return 1
|
||||
fi
|
||||
|
||||
add_iptables_rule "$listen_port"
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$client_file"
|
||||
procd_append_param command -c "$config_file"
|
||||
procd_set_param respawn
|
||||
procd_set_param user "$daemon_user"
|
||||
procd_set_param file "$config_file"
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "$KCPTUN"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
clear_iptables_rule
|
||||
|
||||
config_load "$KCPTUN"
|
||||
config_foreach start_kcptun_instance "general"
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
clear_iptables_rule
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@kcptun[-1]
|
||||
add ucitrack kcptun
|
||||
set ucitrack.@kcptun[-1].init=kcptun
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
general=$(uci -q get kcptun.@general[-1])
|
||||
|
||||
if [ -z "$general" ]; then
|
||||
uci -q add kcptun general
|
||||
fi
|
||||
|
||||
if [ ."$general" != ."general" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
rename kcptun.@general[-1]="general"
|
||||
set kcptun.general.server=""
|
||||
commit kcptun
|
||||
EOF
|
||||
fi
|
||||
|
||||
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
|
||||
exit 0
|
||||
@ -1,16 +0,0 @@
|
||||
# Copyright (C) 2016 Openwrt.org
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for netdata
|
||||
LUCI_DEPENDS:=+netdata
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,9 +0,0 @@
|
||||
module("luci.controller.netdata", package.seeall)
|
||||
|
||||
function index()
|
||||
if not (luci.sys.call("pidof netdata > /dev/null") == 0) then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "system", "netdata"}, template("netdata"), _("NetData"), 10).leaf = true
|
||||
end
|
||||
@ -1,9 +0,0 @@
|
||||
<%+header%>
|
||||
<div class="cbi-map">
|
||||
<h2 name="content"><%=translate("NetData")%></h2>
|
||||
<iframe id="netdata" style="width: 100%; min-height: 1200px; border: none; border-radius: 3px;"></iframe>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
document.getElementById("netdata").src = window.location.protocol + "//" + window.location.hostname + ":19999";
|
||||
</script>
|
||||
<%+footer%>
|
||||
@ -1,5 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
msgid "NetData"
|
||||
msgstr "实时监控"
|
||||
@ -1,20 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015-2016 Openwrt.org
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for ngrokc.
|
||||
LUCI_DESCRIPTION:=LuCI Support for ngrokc.
|
||||
LUCI_DEPENDS:=+ngrokc
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_NAME:=luci-app-ngrokc
|
||||
PKG_VERSION:=1.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,22 +0,0 @@
|
||||
--[[
|
||||
LuCI - Lua Configuration Interface - aria2 support
|
||||
|
||||
Copyright 2014 nanpuyue <nanpuyue@gmail.com>
|
||||
|
||||
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
|
||||
]]--
|
||||
|
||||
module("luci.controller.ngrokc", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/ngrokc") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "ngrokc"}, cbi("ngrokc/overview"), _("Ngrok Settings")).dependent = true
|
||||
entry({"admin", "services", "ngrokc", "detail"}, cbi("ngrokc/detail"), nil ).leaf = true
|
||||
end
|
||||
@ -1,81 +0,0 @@
|
||||
-- Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
-- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
|
||||
-- Copyright 2013 Manuel Munz <freifunk at somakoma dot de>
|
||||
-- Copyright 2014-2015 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
local UCI = (require "luci.model.uci").cursor()
|
||||
local NX = require "nixio"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local UTIL = require "luci.util"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local DTYP = require "luci.cbi.datatypes"
|
||||
|
||||
local apply = luci.http.formvalue("cbi.apply")
|
||||
if apply then
|
||||
luci.sys.exec("/etc/init.d/ngrokc reload &") -- reload configuration
|
||||
end
|
||||
|
||||
-- takeover arguments -- #######################################################
|
||||
local section = arg[1]
|
||||
|
||||
m = Map("ngrokc")
|
||||
m.redirect = DISP.build_url("admin", "services", "ngrokc")
|
||||
|
||||
tunnels = m:section( NamedSection, section, "tunnel", "<h3>" .. translate("Details") .. " : " .. section .. "</h3>")
|
||||
tunnels.instance = section -- arg [1]
|
||||
|
||||
enabled=tunnels:option(Flag, "enabled", translate("Enable"))
|
||||
enabled.anonymous = true
|
||||
enabled.addremove = false
|
||||
|
||||
server=tunnels:option(ListValue, "server", translate("Server"))
|
||||
--server:value("tunnel_mobi", "tunnel.mobi:44433")
|
||||
--server:value("tunnel_org_cn", "tunnel.org.cn:4443")
|
||||
UCI:foreach("ngrokc", "servers", function(s) server:value(s['.name'], s['.name'] .. " ( " .. s.host .. ":" .. s.port .. " ) ") end)
|
||||
|
||||
|
||||
ptype=tunnels:option(ListValue, "type", translate("Type"))
|
||||
ptype:value("tcp", translate("TCP"))
|
||||
ptype:value("http", translate("HTTP"))
|
||||
ptype:value("https", translate("HTTPS"))
|
||||
|
||||
lhost=tunnels:option(Value, "lhost", translate("Local Address"))
|
||||
lhost.rmempty = true
|
||||
lhost.placeholder="127.0.0.1"
|
||||
lhost.datatype = "ip4addr"
|
||||
|
||||
lport=tunnels:option(Value, "lport", translate("Local Port"))
|
||||
lport.datatype = "port"
|
||||
lport.rmempty = false
|
||||
|
||||
custom_domain=tunnels:option(Flag, "custom_domain", translate("Use Custom Domain"))
|
||||
custom_domain.default = "0"
|
||||
custom_domain.disabled = "0"
|
||||
custom_domain.enabled = "1"
|
||||
custom_domain.rmempty = false
|
||||
custom_domain:depends("type", "http")
|
||||
custom_domain:depends("type", "https")
|
||||
|
||||
dname=tunnels:option(Value, "dname", translate("Custom Domain") .. "/" .. translate("SubDomain"), translate("Please set your domain's CNAME or A record to the tunnel server."))
|
||||
dname.datatype = "hostname"
|
||||
dname.rmempty = false
|
||||
dname:depends("type", "http")
|
||||
dname:depends("type", "https")
|
||||
|
||||
hostheader=tunnels:option(Value, "hostheader", "hostheader", translate(""))
|
||||
hostheader.datatype = nil
|
||||
hostheader.rmempty = true
|
||||
hostheader:depends("type", "http")
|
||||
hostheader:depends("type", "https")
|
||||
|
||||
rport=tunnels:option(Value, "rport", translate("Remote Port"))
|
||||
rport.datatype = "port"
|
||||
rport.rmempty = false
|
||||
rport:depends("type", "tcp")
|
||||
|
||||
custom_html=tunnels:option(DummyValue, "none")
|
||||
custom_html.template = "ngrokc/ngrokc_script"
|
||||
|
||||
return m
|
||||
@ -1,108 +0,0 @@
|
||||
-- Mantainer : maz-1 < ohmygod19993 at gmail dot com >
|
||||
|
||||
|
||||
m = Map("ngrokc", translate("Ngrok"),translate("Secure tunnels to localhost."))
|
||||
|
||||
local apply = luci.http.formvalue("cbi.apply")
|
||||
if apply then
|
||||
luci.sys.exec("/etc/init.d/ngrokc reload &") -- reload configuration
|
||||
end
|
||||
|
||||
local DISP = require "luci.dispatcher"
|
||||
local CTRL = require "luci.controller.ngrokc"
|
||||
local HTTP = require "luci.http"
|
||||
local UCI = (require "luci.model.uci").cursor()
|
||||
|
||||
servers=m:section(TypedSection, "servers", translate("Servers"))
|
||||
servers.template = "cbi/tblsection"
|
||||
servers.anonymous = false
|
||||
servers.addremove = true
|
||||
|
||||
|
||||
nhost=servers:option(Value, "host", translate("Ngrok Host"))
|
||||
nhost.rmempty = false
|
||||
nhost.datatype = "host"
|
||||
|
||||
hport=servers:option(Value, "port", translate("Ngrok Port"))
|
||||
hport.rmempty = false
|
||||
hport.datatype = "port"
|
||||
|
||||
servers:option(Value, "atoken", translate("Auth Token")).rmempty = true
|
||||
|
||||
|
||||
tunnel=m:section(TypedSection, "tunnel", translate("Tunnels"))
|
||||
tunnel.template = "cbi/tblsection"
|
||||
tunnel.anonymous = false
|
||||
tunnel.addremove = true
|
||||
|
||||
tunnel.extedit = DISP.build_url("admin", "services", "ngrokc", "detail", "%s")
|
||||
function tunnel.create(self, name)
|
||||
AbstractSection.create(self, name)
|
||||
HTTP.redirect( self.extedit:format(name) )
|
||||
end
|
||||
|
||||
ena=tunnel:option(Flag, "enabled", translate("Enabled"))
|
||||
ena.template = "ngrokc/overview_enabled"
|
||||
ena.rmempty = false
|
||||
|
||||
lport=tunnel:option(DummyValue, "_lport", translate("Local Port"))
|
||||
lport.template = "ngrokc/overview_value"
|
||||
lport.rmempty = false
|
||||
function lport.set_one(self, section)
|
||||
local localport = self.map:get(section, "lport") or ""
|
||||
if localport ~= "" then
|
||||
return localport
|
||||
else
|
||||
return [[<em>]] .. translate("config error") .. [[</em>]]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
server=tunnel:option(DummyValue, "_server", translate("Server"))
|
||||
server.template = "ngrokc/overview_value"
|
||||
server.rmempty = false
|
||||
function server.set_one(self, section)
|
||||
local servername = self.map:get(section, "server") or ""
|
||||
local host = UCI:get("ngrokc", servername, "host") or ""
|
||||
local port = UCI:get("ngrokc", servername, "port") or ""
|
||||
if servername ~= "" or host ~= "" or port ~= "" then
|
||||
return host .. ":" .. port
|
||||
else
|
||||
return [[<em>]] .. translate("config error") .. [[</em>]]
|
||||
end
|
||||
end
|
||||
|
||||
type=tunnel:option(DummyValue, "_type", translate("Type"))
|
||||
type.template = "ngrokc/overview_value"
|
||||
type.rmempty = false
|
||||
function type.set_one(self, section)
|
||||
local tunneltype = self.map:get(section, "type") or ""
|
||||
if tunneltype ~= "" then
|
||||
return string.upper(tunneltype)
|
||||
else
|
||||
return [[<em>]] .. translate("config error") .. [[</em>]]
|
||||
end
|
||||
end
|
||||
|
||||
url=tunnel:option(DummyValue, "_url", translate("URL"))
|
||||
url.template = "ngrokc/overview_value"
|
||||
url.rmempty = false
|
||||
function url.set_one(self, section)
|
||||
local servername = self.map:get(section, "server") or ""
|
||||
local host = UCI:get("ngrokc", servername, "host") or ""
|
||||
local tunneltype = self.map:get(section, "type") or ""
|
||||
local dname = self.map:get(section, "dname") or ""
|
||||
local cusdom = self.map:get(section, "custom_domain") or ""
|
||||
local rport = self.map:get(section, "rport") or ""
|
||||
if tunneltype == "tcp" and rport ~= "" then
|
||||
return "tcp://" .. host .. ":" .. rport
|
||||
elseif cusdom == "1" and dname ~= "" then
|
||||
return tunneltype .. "://" .. dname
|
||||
elseif dname ~= "" then
|
||||
return tunneltype .. "://" .. dname .. "." .. string.gsub(host, "www", "")
|
||||
else
|
||||
return [[<em>]] .. translate("config error") .. [[</em>]]
|
||||
end
|
||||
end
|
||||
|
||||
return m
|
||||
@ -1,10 +0,0 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
confname="<%=section%>"
|
||||
dcheck=document.getElementById("cbid.ngrokc."+confname+".custom_domain");
|
||||
dlabel=document.getElementById("cbi-ngrokc-"+confname+"-dname").firstChild;
|
||||
dhelp=document.getElementById("cbi-ngrokc-"+confname+"-dname").lastChild.lastChild;
|
||||
labels=dlabel.innerHTML.split("/");togglestat();
|
||||
dcheck.onclick=function(){cbi_d_update(this.id);togglestat()}
|
||||
function togglestat() {if(dcheck.checked){dlabel.innerHTML=labels[0];
|
||||
dhelp.style.display="";}else{dlabel.innerHTML=labels[1];dhelp.style.display="none";}}
|
||||
//]]></script>
|
||||
@ -1,15 +0,0 @@
|
||||
|
||||
<!-- ++ BEGIN ++ Ngrok overview_enabled.htm ++ -->
|
||||
<%+cbi/valueheader%>
|
||||
|
||||
<input type="hidden" value="1"<%=
|
||||
attr("name", "cbi.cbe." .. self.config .. "." .. section .. "." .. self.option)
|
||||
%> />
|
||||
<!-- modified to call own function -->
|
||||
<input class="cbi-input-checkbox" onclick="cbi_d_update(this.id)" onchange="onchange_enabled(this.id)" type="checkbox"<%=
|
||||
attr("id", cbid) .. attr("name", cbid) .. attr("value", self.enabled or 1) ..
|
||||
ifattr((self:cfgvalue(section) or self.default) == self.enabled, "checked", "checked")
|
||||
%> />
|
||||
|
||||
<%+cbi/valuefooter%>
|
||||
<!-- ++ END ++ Ngrok overview_enabled.htm ++ -->
|
||||
@ -1,8 +0,0 @@
|
||||
|
||||
<!-- ++ BEGIN ++ Dynamic DNS ++ overview_doubleline.htm ++ -->
|
||||
<%+cbi/valueheader%>
|
||||
|
||||
<span id="<%=cbid%>.one"><%=self:set_one(section)%></span>
|
||||
|
||||
<%+cbi/valuefooter%>
|
||||
<!-- ++ END ++ Dynamic DNS ++ overview_doubleline.htm ++ -->
|
||||
@ -1,71 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "Ngrok Settings"
|
||||
msgstr "Ngrok设置"
|
||||
|
||||
msgid "Ngrok"
|
||||
msgstr "Ngrok反向代理"
|
||||
|
||||
msgid "Secure tunnels to localhost."
|
||||
msgstr "易用而安全的反向代理软件"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Ngrok Host"
|
||||
msgstr "Ngrok服务器"
|
||||
|
||||
msgid "Ngrok Port"
|
||||
msgstr "Ngrok服务器端口"
|
||||
|
||||
msgid "Auth Token"
|
||||
msgstr "令牌"
|
||||
|
||||
msgid "Type"
|
||||
msgstr "类型"
|
||||
|
||||
msgid "Local Address"
|
||||
msgstr "本地地址"
|
||||
|
||||
msgid "Local Port"
|
||||
msgstr "本地端口"
|
||||
|
||||
msgid "Custom Domain"
|
||||
msgstr "自定义域名"
|
||||
|
||||
msgid "SubDomain"
|
||||
msgstr "子域名"
|
||||
|
||||
msgid "Use Custom Domain"
|
||||
msgstr "使用自定义域名"
|
||||
|
||||
msgid "Add Addr Port"
|
||||
msgstr "添加地址端口"
|
||||
|
||||
msgid "Remote Port"
|
||||
msgstr "远程端口"
|
||||
|
||||
msgid "Please set your domain's CNAME or A record to the tunnel server."
|
||||
msgstr "请把域名的CNAME记录或A记录指向Ngrok隧道服务器。"
|
||||
|
||||
msgid "Server"
|
||||
msgstr "服务器"
|
||||
|
||||
msgid "Servers"
|
||||
msgstr "服务器"
|
||||
|
||||
msgid "Tunnels"
|
||||
msgstr "通道"
|
||||
|
||||
msgid "Details"
|
||||
msgstr "详情"
|
||||
|
||||
msgid "Main Settings"
|
||||
msgstr "主要设置"
|
||||
|
||||
msgid "Check interval"
|
||||
msgstr "检查间隔"
|
||||
|
||||
msgid "Second(s). Set to 0 if you don't want to check"
|
||||
msgstr "单位秒。设为0可禁止每隔一段时间检查。"
|
||||
@ -1,15 +0,0 @@
|
||||
|
||||
config servers 'tunnel_org_cn'
|
||||
option host 'tunnel.org.cn'
|
||||
option port '4443'
|
||||
|
||||
config servers 'phiui_com'
|
||||
option host 'phiui.com'
|
||||
option port '4443'
|
||||
|
||||
config tunnel 'tunnel1'
|
||||
option enabled '0'
|
||||
option server 'tunnel_org_cn'
|
||||
option type 'http'
|
||||
option lport '80'
|
||||
option dname 'openwrt'
|
||||
@ -1,61 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
|
||||
START=99
|
||||
|
||||
list_servers() {
|
||||
SERVER_PARAMS=" -SER[Shost:"
|
||||
config_get host "$1" 'host'
|
||||
config_get port "$1" 'port'
|
||||
config_get atoken "$1" 'atoken'
|
||||
SERVER_PARAMS="${SERVER_PARAMS}""${host}"",Sport:""${port}"
|
||||
[ ! $atoken ] && SERVER_PARAMS=${SERVER_PARAMS}"]" || SERVER_PARAMS=${SERVER_PARAMS}",Atoken:${atoken}]"
|
||||
eval ${1}_PARAMS=\$SERVER_PARAMS
|
||||
}
|
||||
|
||||
runnrokc() {
|
||||
eval "exec /usr/bin/ngrokc \$${1}_PARAMS \$${1}_TUNNEL_PARAMS 2>&1 > /dev/null & echo \$! >> /tmp/ngrokc/${1}.pid"
|
||||
}
|
||||
|
||||
list_tunnels() {
|
||||
config_get_bool enabled "$1" 'enabled'
|
||||
config_get type "$1" 'type'
|
||||
config_get lhost "$1" 'lhost'
|
||||
config_get server "$1" 'server'
|
||||
config_get lport "$1" 'lport'
|
||||
config_get custom_domain "$1" 'custom_domain'
|
||||
config_get rport "$1" 'rport'
|
||||
config_get dname "$1" 'dname'
|
||||
config_get hostheader "$1" 'hostheader'
|
||||
[ -z "$lhost" ] && lhost="127.0.0.1"
|
||||
if [ "$enabled" = 1 ]; then
|
||||
eval TUNNEL_PARAMS=\$${server}_TUNNEL_PARAMS
|
||||
TUNNEL_PARAMS=$TUNNEL_PARAMS" -AddTun[Type:${type},Lhost:${lhost},Lport:${lport}"
|
||||
[ -n "$hostheader" ] && TUNNEL_PARAMS=${TUNNEL_PARAMS}",Hostheader:${hostheader}"
|
||||
[ "z"$custom_domain = "z1" ] && DTYPE="Hostname" || DTYPE="Sdname"
|
||||
[ ${type} = "tcp" ] && \
|
||||
TUNNEL_PARAMS=${TUNNEL_PARAMS}",Rport:${rport}]" || \
|
||||
TUNNEL_PARAMS=${TUNNEL_PARAMS}",${DTYPE}:${dname}]"
|
||||
echo $server" : ngrokc"$TUNNEL_PARAMS
|
||||
config_foreach list_servers 'servers'
|
||||
eval ${server}_TUNNEL_PARAMS=\$TUNNEL_PARAMS
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
mkdir -p /tmp/ngrokc
|
||||
config_load 'ngrokc'
|
||||
[ -f /tmp/ngrokc/ngrokc_running ] || \
|
||||
( config_foreach list_tunnels 'tunnel' ; config_foreach runnrokc 'servers'; touch /tmp/ngrokc/ngrokc_running )
|
||||
}
|
||||
|
||||
stop() {
|
||||
kill -2 `pidof ngrokc|sed "s/$$//g"` 2>/dev/null
|
||||
rm -f /tmp/ngrokc/*
|
||||
sleep 2
|
||||
}
|
||||
|
||||
boot() {
|
||||
sleep 10
|
||||
start
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@ngrokc[-1]
|
||||
add ucitrack ngrokc
|
||||
set ucitrack.@ngrokc[-1].init=ngrokc
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
@ -1,14 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=NJIT 802.1X Client for LuCI
|
||||
LUCI_DESCRIPTION:=This package contains LuCI configuration pages for njit8021xclient.
|
||||
LUCI_DEPENDS:=+njit8021xclient
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_NAME:=luci-app-njitclient
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,5 +0,0 @@
|
||||
module("luci.controller.njitclient", package.seeall)
|
||||
|
||||
function index()
|
||||
entry({"admin", "network", "njitclient"}, cbi("njitclient"), _("NJIT Client"), 100)
|
||||
end
|
||||
@ -1,39 +0,0 @@
|
||||
--[[
|
||||
LuCI - Lua Configuration Interface
|
||||
|
||||
Copyright 2010 Jo-Philipp Wich <xm@subsignal.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
|
||||
]]--
|
||||
|
||||
require("luci.sys")
|
||||
|
||||
m = Map("njitclient", translate("NJIT Client"), translate("Configure NJIT 802.11x client."))
|
||||
|
||||
s = m:section(TypedSection, "login", "")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
enable = s:option(Flag, "enable", translate("Enable"))
|
||||
name = s:option(Value, "username", translate("Username"))
|
||||
pass = s:option(Value, "password", translate("Password"))
|
||||
pass.password = true
|
||||
domain = s:option(Value, "domain", translate("Domain"))
|
||||
|
||||
ifname = s:option(ListValue, "ifname", translate("Interfaces"))
|
||||
for k, v in ipairs(luci.sys.net.devices()) do
|
||||
if v ~= "lo" then
|
||||
ifname:value(v)
|
||||
end
|
||||
end
|
||||
|
||||
local apply = luci.http.formvalue("cbi.apply")
|
||||
if apply then
|
||||
io.popen("/etc/init.d/njitclient restart")
|
||||
end
|
||||
|
||||
return m
|
||||
@ -1,6 +0,0 @@
|
||||
|
||||
config login
|
||||
option username ''
|
||||
option password ''
|
||||
option ifname 'eth0'
|
||||
option domain ''
|
||||
@ -1,42 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
START=50
|
||||
|
||||
run_njit()
|
||||
{
|
||||
local enable
|
||||
config_get_bool enable $1 enable
|
||||
|
||||
if [ $enable ]; then
|
||||
local username
|
||||
local password
|
||||
local domain
|
||||
local ifname
|
||||
|
||||
config_get username $1 username
|
||||
config_get password $1 password
|
||||
config_get domain $1 domain
|
||||
config_get ifname $1 ifname
|
||||
|
||||
if [ "$domain" != "" ]; then
|
||||
njit-client $username@$domain $password $ifname &
|
||||
else
|
||||
njit-client $username $password $ifname &
|
||||
fi
|
||||
|
||||
echo "NJIT Client has started."
|
||||
fi
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
config_load njitclient
|
||||
config_foreach run_njit login
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
killall njit-client
|
||||
killall udhcpc
|
||||
|
||||
echo "NJIT Client has stoped."
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
#
|
||||
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI Support for oscam
|
||||
LUCI_DEPENDS:= +oscam
|
||||
PKG_VERSION:=1.7
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,14 +0,0 @@
|
||||
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
|
||||
|
||||
module("luci.controller.oscam", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/oscam") then
|
||||
return
|
||||
end
|
||||
|
||||
local page
|
||||
|
||||
page = entry({"admin", "services", "oscam"}, cbi("oscam"), _("OSCAM"), 60)
|
||||
page.dependent = true
|
||||
end
|
||||
@ -1,50 +0,0 @@
|
||||
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
|
||||
|
||||
local sys = require("luci.sys")
|
||||
local util = require("luci.util")
|
||||
local fs = require("nixio.fs")
|
||||
|
||||
local trport = 8888
|
||||
local button = ""
|
||||
|
||||
if luci.sys.call("pidof oscam >/dev/null") == 0 then
|
||||
m = Map("oscam", translate("oscam"), "%s - %s" %{translate("oscam"), translate("<strong><font color=\"green\">Running</font></strong>")})
|
||||
button = " <input type=\"button\" value=\" " .. translate("Open Web Interface") .. " \" onclick=\"window.open('http://'+window.location.hostname+':" .. trport .. "')\"/>"
|
||||
else
|
||||
m = Map("oscam", translate("oscam"), "%s - %s" %{translate("oscam"), translate("<strong><font color=\"red\">Not Running</font></strong>")})
|
||||
end
|
||||
|
||||
-- Basic
|
||||
s = m:section(TypedSection, "oscam", translate("Settings"), translate("General Settings") .. button)
|
||||
s.anonymous = true
|
||||
|
||||
---- Eanble
|
||||
enable = s:option(Flag, "enabled", translate("Enable"), translate("Enable or disable oscam server"))
|
||||
enable.default = 0
|
||||
enable.rmempty = false
|
||||
|
||||
-- Doman addresss
|
||||
s = m:section(TypedSection, "oscam", translate("oscam conf"),
|
||||
translate("oscam conf"))
|
||||
s.anonymous = true
|
||||
|
||||
---- address
|
||||
addr = s:option(Value, "address",
|
||||
translate(""),
|
||||
translate("-------------------------------------------------------------------- " ..
|
||||
"----------------------------------------------------------------------------. " ..
|
||||
""))
|
||||
|
||||
addr.template = "cbi/tvalue"
|
||||
addr.rows = 30
|
||||
|
||||
function addr.cfgvalue(self, section)
|
||||
return nixio.fs.readfile("/etc/oscam/oscam.conf")
|
||||
end
|
||||
|
||||
function addr.write(self, section, value)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
nixio.fs.writefile("/etc/oscam/oscam.conf", value)
|
||||
end
|
||||
|
||||
return m
|
||||
@ -1,32 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "oscam"
|
||||
msgstr "oscam"
|
||||
|
||||
msgid "<strong><font color=\"green\">Running</font></strong>"
|
||||
msgstr "<strong><font color=\"green\">运行</font></strong>"
|
||||
|
||||
msgid "<strong><font color=\"red\">Not Running</font></strong>"
|
||||
msgstr "<strong><font color=\"red\">未运行</font></strong>"
|
||||
|
||||
msgid "Settings"
|
||||
msgstr "设置"
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "基本设置"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Enable or disable oscam server"
|
||||
msgstr "启用或禁用oscam服务器"
|
||||
|
||||
msgid "oscam conf"
|
||||
msgstr "oscam配置文件"
|
||||
|
||||
msgid "oscam server"
|
||||
msgstr "oscam服务器配置"
|
||||
|
||||
msgid "oscam user"
|
||||
msgstr "oscam用户配置"
|
||||
@ -1,3 +0,0 @@
|
||||
|
||||
config oscam 'config'
|
||||
option enabled '0'
|
||||
@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@oscam[-1]
|
||||
add ucitrack oscam
|
||||
set ucitrack.@oscam[-1].init=oscam
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
|
||||
/etc/init.d/oscam stop
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
@ -1,23 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2010-2011 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI Support for QoSv4.
|
||||
LUCI_DESCRIPTION:=An agent script that makes qosv4 configuration simple.
|
||||
LUCI_DEPENDS:=+tc +iptables-mod-conntrack-extra +iptables-mod-conntrack-extra +iptables-mod-filter +iptables-mod-imq +iptables-mod-ipopt +iptables-mod-nat-extra +iptables-mod-imq +kmod-sched
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_NAME:=luci-app-qosv4
|
||||
PKG_VERSION:=1.1f
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_MAINTAINER:=qq 3341249
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@ -1,17 +0,0 @@
|
||||
module("luci.controller.qosv4", package.seeall)
|
||||
|
||||
function index()
|
||||
require("luci.i18n")
|
||||
luci.i18n.loadc("qosv4")
|
||||
local fs = luci.fs or nixio.fs
|
||||
if not fs.access("/etc/config/qosv4") then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local page = entry({"admin", "network", "qosv4"}, cbi("qosv4"), "QOSv4")
|
||||
page.i18n = "qosv4"
|
||||
page.dependent = true
|
||||
|
||||
|
||||
end
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user