diff --git a/package/ntlf9t/luci-app-smartdns/Makefile b/package/ntlf9t/luci-app-smartdns/Makefile index c46f8bb533..d79d6ae28e 100644 --- a/package/ntlf9t/luci-app-smartdns/Makefile +++ b/package/ntlf9t/luci-app-smartdns/Makefile @@ -1,13 +1,25 @@ -# This is free software, licensed under the Apache License, Version 2.0 . +# +# Copyright 2018-2020 Nick Peng +# Licensed to the public under the GPL V3 License. include $(TOPDIR)/rules.mk -LUCI_TITLE:=Luci for smartdns server +PKG_LICENSE:=GPL-3.0-or-later +PKG_MAINTAINER:=Nick Peng +PKG_VERSION:=1.2020.30 +PKG_RELEASE:=1 + +LUCI_TITLE:=LuCI for smartdns +LUCI_DESCRIPTION:=Provides Luci for smartdns LUCI_DEPENDS:=+smartdns LUCI_PKGARCH:=all -PKG_NAME:=luci-app-smartdns -PKG_VERSION:=2 -PKG_RELEASE:=2 + +define Package/$(PKG_NAME)/config +# shown in make menuconfig +help + $(LUCI_TITLE) + Version: $(PKG_VERSION)-$(PKG_RELEASE) +endef include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/ntlf9t/luci-app-smartdns/htdocs/luci-static/resources/view/smartdns/smartdns.js b/package/ntlf9t/luci-app-smartdns/htdocs/luci-static/resources/view/smartdns/smartdns.js index e9e6b52272..4d137753c7 100644 --- a/package/ntlf9t/luci-app-smartdns/htdocs/luci-static/resources/view/smartdns/smartdns.js +++ b/package/ntlf9t/luci-app-smartdns/htdocs/luci-static/resources/view/smartdns/smartdns.js @@ -201,7 +201,7 @@ return L.view.extend({ _("Attempts to serve old responses from cache with a TTL of 0 in the response without waiting for the actual resolution to finish.")); o.rmempty = false; o.default = o.disabled; - + // Redirect; o = s.taboption("settings", form.ListValue, "redirect", _("Redirect"), _("SmartDNS redirect mode")); o.placeholder = "none"; @@ -253,7 +253,7 @@ return L.view.extend({ // dns server group; o = s.taboption("seconddns", form.Value, "seconddns_server_group", _("Server Group"), - _("Query DNS through specific dns server group, such as office, home.")); + _("Query DNS through specific dns server group, such as office, home.")); o.rmempty = true; o.placeholder = "default"; o.datatype = "hostname"; @@ -305,8 +305,7 @@ return L.view.extend({ // custom settings; o = s.taboption("custom", form.TextValue, "custom_conf", - _(""), - _("smartdns custom settings")); + "", _("smartdns custom settings")); o.rows = 20; o.cfgvalue = function (section_id) { @@ -390,6 +389,15 @@ return L.view.extend({ o.depends("type", "tls") o.depends("type", "https") + // certificate verify + o = s.taboption("advanced", form.Flag, "no_check_certificate", _("No check certificate"), + _("Do not check certificate.")) + o.rmempty = false + o.default = o.disabled + o.modalonly = true; + o.depends("type", "tls") + o.depends("type", "https") + // SNI host name o = s.taboption("advanced", form.Value, "host_name", _("TLS SNI name"), _("Sets the server name indication for query.")) @@ -482,4 +490,3 @@ return L.view.extend({ return m.render(); } }); - diff --git a/package/ntlf9t/luci-app-smartdns/luasrc/controller/smartdns.lua b/package/ntlf9t/luci-app-smartdns/luasrc/controller/smartdns.lua deleted file mode 100644 index 667f8bc073..0000000000 --- a/package/ntlf9t/luci-app-smartdns/luasrc/controller/smartdns.lua +++ /dev/null @@ -1,27 +0,0 @@ --- --- Copyright (C) 2018-2020 Ruilin Peng (Nick) . --- --- smartdns is free software: you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation, either version 3 of the License, or --- (at your option) any later version. --- --- smartdns is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . - -module("luci.controller.smartdns", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/smartdns") then - return - end - - local page - page = entry({"admin", "services", "smartdns"}, view("smartdns/smartdns"), _("SmartDNS"), 60) - page.dependent = true -end diff --git a/package/ntlf9t/luci-app-smartdns/po/zh_Hans/smartdns.po b/package/ntlf9t/luci-app-smartdns/po/zh_Hans/smartdns.po index 4cab4feb22..efa305a8cc 100644 --- a/package/ntlf9t/luci-app-smartdns/po/zh_Hans/smartdns.po +++ b/package/ntlf9t/luci-app-smartdns/po/zh_Hans/smartdns.po @@ -226,6 +226,12 @@ msgstr "校验TLS主机名" msgid "Set TLS hostname to verify." msgstr "设置校验TLS主机名。" +msgid "No check certificate" +msgstr "跳过证书检查" + +msgid "Do not check certificate." +msgstr "不检查服务器证书。" + msgid "TLS SNI name" msgstr "TLS SNI名称" diff --git a/package/ntlf9t/luci-app-smartdns/root/usr/share/luci/menu.d/luci-app-smartdns.json b/package/ntlf9t/luci-app-smartdns/root/usr/share/luci/menu.d/luci-app-smartdns.json new file mode 100644 index 0000000000..91b4402484 --- /dev/null +++ b/package/ntlf9t/luci-app-smartdns/root/usr/share/luci/menu.d/luci-app-smartdns.json @@ -0,0 +1,12 @@ +{ + "admin/services/smartdns": { + "title": "SmartDNS", + "action": { + "type": "view", + "path": "smartdns/smartdns" + }, + "depends": { + "uci": { "smartdns": true } + } + } +} diff --git a/package/ntlf9t/luci-app-smartdns/root/usr/share/rpcd/acl.d/luci-app-smartdns.json b/package/ntlf9t/luci-app-smartdns/root/usr/share/rpcd/acl.d/luci-app-smartdns.json index 4bb0660a48..e06c436df9 100644 --- a/package/ntlf9t/luci-app-smartdns/root/usr/share/rpcd/acl.d/luci-app-smartdns.json +++ b/package/ntlf9t/luci-app-smartdns/root/usr/share/rpcd/acl.d/luci-app-smartdns.json @@ -5,19 +5,21 @@ "file": { "uci": [ "smartdns" ], "/etc/smartdns/*": [ "read" ], - "/usr/sbin/iptables": [ "exec" ], - "/usr/sbin/ip6tables": [ "exec" ], + "/usr/sbin/iptables -t nat -nL PREROUTING": [ "exec" ], + "/usr/sbin/ip6tables -t nat -nL PREROUTING": [ "exec" ], "/usr/sbin/smartdns": [ "exec" ] }, "ubus": { "service": [ "list" ] - } + }, + "uci": [ "smartdns" ] }, "write": { "file": { "uci": [ "smartdns" ], "/etc/smartdns/*": [ "write" ] - } + }, + "uci": [ "smartdns" ] } } }