1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00
This commit is contained in:
suyuan168 2022-06-09 11:23:58 +08:00
parent 06a4f10a4d
commit 1020d095bc
44 changed files with 3520 additions and 31 deletions

View file

@ -9,9 +9,11 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI for Zerotier
LUCI_DEPENDS:=+zerotier
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-zerotier
PKG_VERSION:=1.0
PKG_RELEASE:=20
include $(TOPDIR)/feeds/luci/luci.mk
include ../../luci.mk
# call BuildPackage - OpenWrt buildroot signature

View file

@ -1,14 +1,13 @@
module("luci.controller.zerotier",package.seeall)
module("luci.controller.zerotier", package.seeall)
function index()
if not nixio.fs.access("/etc/config/zerotier") then
return
end
entry({"admin","vpn"}, firstchild(), "VPN", 45).dependent = false
entry({"admin", "vpn", "zerotier"},firstchild(), _("ZeroTier")).dependent = false
entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
entry({"admin", "vpn", "zerotier"}, alias("admin", "vpn", "zerotier", "general"), _("ZeroTier"), 99)
entry({"admin", "vpn", "zerotier", "general"}, cbi("zerotier/settings"), _("Base Setting"), 1)
entry({"admin", "vpn", "zerotier", "log"}, form("zerotier/info"), _("Interface Info"), 2)

View file

@ -7,9 +7,9 @@ t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 19
function t.cfgvalue()
luci.sys.exec("for i in $(ifconfig | grep 'zt' | awk '{print $1}'); do ifconfig $i; done > /tmp/zero.info")
luci.sys.exec("for i in $(ifconfig | grep 'zt' | awk '{print $1}'); do ifconfig $i; done > /tmp/zero.info")
return fs.readfile(conffile) or ""
end
t.readonly="readonly"
t.readonly = "readonly"
return f

View file

@ -2,7 +2,7 @@ a = Map("zerotier")
a.title = translate("ZeroTier")
a.description = translate("Zerotier is an open source, cross-platform and easy to use virtual LAN")
a:section(SimpleSection).template = "zerotier/zerotier_status"
a:section(SimpleSection).template = "zerotier/zerotier_status"
t = a:section(NamedSection, "sample_config", "zerotier")
t.anonymous = true
@ -10,7 +10,7 @@ t.addremove = false
e = t:option(Flag, "enabled", translate("Enable"))
e.default = 0
e.rmempty=false
e.rmempty = false
e = t:option(DynamicList, "join", translate('ZeroTier Network ID'))
e.password = true

View file

@ -1,11 +1,3 @@
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Gtranslator 2.91.7\n"
"Plural-Forms: nplurals=1; plural=0;\n"
msgid "Zerotier is an open source, cross-platform and easy to use virtual LAN"
msgstr "Zerotier 是一个开源,跨平台,而且适合内网穿透互联的傻瓜配置虚拟 VPN LAN"

View file

@ -110,4 +110,4 @@ stop_service() {
reload_service() {
stop
start
}
}

View file

@ -5,7 +5,8 @@ uci -q batch <<-EOF >/dev/null
add ucitrack zerotier
set ucitrack.@zerotier[-1].init=zerotier
commit ucitrack
delete firewall.zerotier
delete firewall.zerotier
set firewall.zerotier=include
set firewall.zerotier.type=script
set firewall.zerotier.path=/etc/zerotier.start

View file

@ -12,4 +12,4 @@ do
ip_segment="$(ip route | grep "dev $i proto" | awk '{print $1}')"
iptables -t nat -D POSTROUTING -s "${ip_segment}" -j MASQUERADE 2>/dev/null
echo "zt interface $i is stopped!"
done
done

View file

@ -1,11 +0,0 @@
{
"luci-app-zerotier": {
"description": "Grant UCI access for luci-app-zerotier",
"read": {
"uci": [ "zerotier" ]
},
"write": {
"uci": [ "zerotier" ]
}
}
}