mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-15 18:03:30 +00:00
luci-app: tidy up code (#8277)
1.文件尾部添加换行并删除多余的换行 2.整理代码,看起来更直观 3.更正文件的权限 4.将一些文件的CR LF末行符全部转为LF
This commit is contained in:
parent
3c36b75de5
commit
95f915abf1
0
package/lean/ddns-scripts_dnspod/update_dnspod_cn.sh
Normal file → Executable file
0
package/lean/ddns-scripts_dnspod/update_dnspod_cn.sh
Normal file → Executable file
0
package/lean/ddns-scripts_dnspod/update_dnspod_com.sh
Normal file → Executable file
0
package/lean/ddns-scripts_dnspod/update_dnspod_com.sh
Normal file → Executable file
0
package/lean/dns2socks/Makefile
Executable file → Normal file
0
package/lean/dns2socks/Makefile
Executable file → Normal file
0
package/lean/dsmboot/files/dsmboot
Normal file → Executable file
0
package/lean/dsmboot/files/dsmboot
Normal file → Executable file
0
package/lean/ipv6-helper/files/root/etc/hotplug.d/iface/60-6in4
Normal file → Executable file
0
package/lean/ipv6-helper/files/root/etc/hotplug.d/iface/60-6in4
Normal file → Executable file
0
package/lean/k3-brcmfmac4366c-firmware/files/lib/firmware/brcm/brcmfmac4366c-pcie.bin
Normal file → Executable file
0
package/lean/k3-brcmfmac4366c-firmware/files/lib/firmware/brcm/brcmfmac4366c-pcie.bin
Normal file → Executable file
@ -15,4 +15,3 @@ PKG_RELEASE:=75
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
@ -21,16 +21,16 @@ function index()
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("pgrep adbyby >/dev/null")==0
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pgrep adbyby >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
||||
|
||||
function refresh_data()
|
||||
local set =luci.http.formvalue("set")
|
||||
local icount =0
|
||||
local set = luci.http.formvalue("set")
|
||||
local icount = 0
|
||||
|
||||
if set == "rule_data" then
|
||||
luci.sys.exec("/usr/share/adbyby/rule-update")
|
||||
@ -38,7 +38,7 @@ luci.sys.exec("/usr/share/adbyby/rule-update")
|
||||
|
||||
if tonumber(icount)>0 then
|
||||
if nixio.fs.access("/usr/share/adbyby/rules/") then
|
||||
oldcount=luci.sys.exec("/usr/share/adbyby/rule-count '/usr/share/adbyby/rules/'")
|
||||
oldcount = luci.sys.exec("/usr/share/adbyby/rule-count '/usr/share/adbyby/rules/'")
|
||||
else
|
||||
oldcount=0
|
||||
end
|
||||
@ -54,14 +54,14 @@ luci.sys.exec("/usr/share/adbyby/rule-update")
|
||||
retstring ="0"
|
||||
end
|
||||
else
|
||||
refresh_cmd="uclient-fetch -q --no-check-certificate -O - 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt' > /tmp/adnew.conf"
|
||||
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
refresh_cmd = "uclient-fetch -q --no-check-certificate -O - 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt' > /tmp/adnew.conf"
|
||||
sret = luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
if sret== 0 then
|
||||
luci.sys.call("/usr/share/adbyby/ad-update")
|
||||
icount = luci.sys.exec("cat /tmp/ad.conf | wc -l")
|
||||
if tonumber(icount)>0 then
|
||||
if nixio.fs.access("/usr/share/adbyby/dnsmasq.adblock") then
|
||||
oldcount=luci.sys.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l")
|
||||
oldcount = luci.sys.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l")
|
||||
else
|
||||
oldcount=0
|
||||
end
|
||||
@ -83,4 +83,4 @@ end
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({ ret=retstring ,retcount=icount})
|
||||
end
|
||||
end
|
||||
|
@ -54,4 +54,4 @@ end
|
||||
o = s:option(DynamicList, "subscribe_url", translate("Anti-AD Rules Subscribe"))
|
||||
o.rmempty = true
|
||||
|
||||
return m
|
||||
return m
|
||||
|
@ -18,21 +18,18 @@ m:section(SimpleSection).template = "adbyby/adbyby_status"
|
||||
s = m:section(TypedSection, "adbyby")
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "enable")
|
||||
o.title = translate("Enable")
|
||||
o = s:option(Flag, "enable", translate("Enable"))
|
||||
o.default = 0
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "wan_mode")
|
||||
o.title = translate("Running Mode")
|
||||
o = s:option(ListValue, "wan_mode", translate("Running Mode"))
|
||||
o:value("0", translate("Global Mode (The slowest and the best effects)"))
|
||||
o:value("1", translate("Plus + Mode (Filter domain name list and blacklist website.Recommended)"))
|
||||
o:value("2", translate("No filter Mode (Must set in Client Filter Mode Settings manually)"))
|
||||
o.default = 1
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Button, "restart")
|
||||
o.title = translate("Adbyby and Rule state")
|
||||
o = s:option(Button, "restart", translate("Adbyby and Rule state"))
|
||||
o.inputtitle = translate("Update Adbyby Rules Manually")
|
||||
o.description = string.format("<strong>"..translate("Last Update Checked")..":</strong> %s<br /><strong>"..translate("Lazy Rule")..":</strong>%s <br /><strong>"..translate("Video Rule")..":</strong>%s", UD, DL, DV)
|
||||
o.inputstyle = "reload"
|
||||
@ -42,28 +39,28 @@ o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
|
||||
end
|
||||
|
||||
t=m:section(TypedSection,"acl_rule",translate("<strong>Client Filter Mode Settings</strong>"),
|
||||
translate("Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default."))
|
||||
t.template="cbi/tblsection"
|
||||
t.sortable=true
|
||||
t.anonymous=true
|
||||
t.addremove=true
|
||||
t = m:section(TypedSection, "acl_rule", translate("<strong>Client Filter Mode Settings</strong>"))
|
||||
t.description = translate("Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default.")
|
||||
t.template = "cbi/tblsection"
|
||||
t.sortable = true
|
||||
t.anonymous = true
|
||||
t.addremove = true
|
||||
|
||||
e=t:option(Value,"ipaddr",translate("IP Address"))
|
||||
e.width="40%"
|
||||
e.datatype="ip4addr"
|
||||
e.placeholder="0.0.0.0/0"
|
||||
e = t:option(Value, "ipaddr", translate("IP Address"))
|
||||
e.width = "40%"
|
||||
e.datatype = "ip4addr"
|
||||
e.placeholder = "0.0.0.0/0"
|
||||
luci.ip.neighbors({ family = 4 }, function(entry)
|
||||
if entry.reachable then
|
||||
e:value(entry.dest:string())
|
||||
end
|
||||
end)
|
||||
|
||||
e=t:option(ListValue,"filter_mode",translate("Filter Mode"))
|
||||
e.width="40%"
|
||||
e.default="disable"
|
||||
e.rmempty=false
|
||||
e:value("disable",translate("No filter"))
|
||||
e:value("global",translate("Global filter"))
|
||||
e = t:option(ListValue, "filter_mode", translate("Filter Mode"))
|
||||
e.width = "40%"
|
||||
e.default = "disable"
|
||||
e.rmempty = false
|
||||
e:value("disable", translate("No filter"))
|
||||
e:value("global", translate("Global filter"))
|
||||
|
||||
return m
|
||||
return m
|
||||
|
@ -21,4 +21,3 @@ function f.handle(self, state, data)
|
||||
end
|
||||
|
||||
return f
|
||||
|
||||
|
@ -21,4 +21,3 @@ function f.handle(self, state, data)
|
||||
end
|
||||
|
||||
return f
|
||||
|
||||
|
@ -21,4 +21,3 @@ function f.handle(self, state, data)
|
||||
end
|
||||
|
||||
return f
|
||||
|
||||
|
@ -21,4 +21,3 @@ function f.handle(self, state, data)
|
||||
end
|
||||
|
||||
return f
|
||||
|
||||
|
@ -21,4 +21,3 @@ function f.handle(self, state, data)
|
||||
end
|
||||
|
||||
return f
|
||||
|
||||
|
@ -19,4 +19,4 @@ XHR.poll(3, '<%=url([[admin]], [[services]], [[adbyby]], [[run]])%>', null,
|
||||
<p id="adbyby_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
@ -15,4 +15,3 @@ PKG_RELEASE:=10
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
@ -13,8 +13,8 @@ function index()
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("pgrep shairport-sync >/dev/null")==0
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pgrep shairport-sync >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
@ -1,25 +1,27 @@
|
||||
-- Copyright 2020 Lean <coolsnowwolf@gmail.com>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
m = Map("shairport-sync", translate("Apple AirPlay 2 Receiver"), translate("Apple AirPlay 2 Receiver is a simple AirPlay server implementation"))
|
||||
m = Map("shairport-sync")
|
||||
m.title = translate("Apple AirPlay 2 Receiver")
|
||||
m.description = translate("Apple AirPlay 2 Receiver is a simple AirPlay server implementation")
|
||||
|
||||
m:section(SimpleSection).template = "shairport-sync/shairport-sync_status"
|
||||
m:section(SimpleSection).template = "shairport-sync/shairport-sync_status"
|
||||
|
||||
s = m:section(TypedSection, "shairport-sync")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
enable=s:option(Flag, "enabled", translate("Enabled"))
|
||||
enable = s:option(Flag, "enabled", translate("Enabled"))
|
||||
enable.default = "0"
|
||||
enable.rmempty = false
|
||||
|
||||
respawn=s:option(Flag, "respawn", translate("Respawn"))
|
||||
respawn = s:option(Flag, "respawn", translate("Respawn"))
|
||||
respawn.default = false
|
||||
|
||||
apname = s:option(Value, "name", translate("Airport Name"))
|
||||
apname.rmempty = false
|
||||
|
||||
auth=s:option(Flag, "auth", translate("Password Auth"))
|
||||
auth = s:option(Flag, "auth", translate("Password Auth"))
|
||||
auth.default = false
|
||||
|
||||
pw = s:option(Value, "password", translate("Password"))
|
||||
@ -28,7 +30,7 @@ pw.password = true
|
||||
pw.default = ""
|
||||
pw:depends("auth", "1")
|
||||
|
||||
interpolation=s:option(ListValue, "interpolation", translate("Interpolation"))
|
||||
interpolation = s:option(ListValue, "interpolation", translate("Interpolation"))
|
||||
interpolation:value("basic", translate("Internal Basic Resampler"))
|
||||
interpolation:value("soxr", translate("High quality SoX Resampler (fast CPU required)"))
|
||||
|
||||
@ -36,32 +38,32 @@ port=s:option(Value, "port", translate("Port"))
|
||||
port.rmempty = false
|
||||
port.datatype = "port"
|
||||
|
||||
alsa_output_device=s:option(ListValue, "alsa_output_device", translate("Alsa Output Device"))
|
||||
alsa_output_device = s:option(ListValue, "alsa_output_device", translate("Alsa Output Device"))
|
||||
alsa_output_device:value("", translate("default"))
|
||||
alsa_output_device:value("hw:0", translate("1st Soundcard (hw:0)"))
|
||||
alsa_output_device:value("hw:1", translate("2nd Soundcard (hw:1)"))
|
||||
alsa_output_device:value("hw:2", translate("3rd Soundcard (hw:2)"))
|
||||
|
||||
alsa_mixer_control_name=s:option(ListValue, "alsa_mixer_control_name", translate("Alsa Mixer Control Name"))
|
||||
alsa_mixer_control_name = s:option(ListValue, "alsa_mixer_control_name", translate("Alsa Mixer Control Name"))
|
||||
alsa_mixer_control_name:value("", translate("default (software volume)"))
|
||||
alsa_mixer_control_name:value("PCM", translate("PCM"))
|
||||
alsa_mixer_control_name:value("Speaker", translate("Speaker"))
|
||||
|
||||
alsa_output_rate=s:option(ListValue, "alsa_output_rate", translate("Alsa Output Rate"))
|
||||
alsa_output_rate = s:option(ListValue, "alsa_output_rate", translate("Alsa Output Rate"))
|
||||
alsa_output_rate:value("auto", translate("auto"))
|
||||
alsa_output_rate:value("44100", translate("44.1kHz"))
|
||||
alsa_output_rate:value("88200", translate("88.2kHz"))
|
||||
alsa_output_rate:value("176400", translate("176.4kHz"))
|
||||
alsa_output_rate:value("352800", translate("352.8kHz"))
|
||||
|
||||
alsa_buffer_length=s:option(Value, "alsa_buffer_length", translate("Alsa Buffer Length"))
|
||||
alsa_buffer_length = s:option(Value, "alsa_buffer_length", translate("Alsa Buffer Length"))
|
||||
alsa_buffer_length.default = "6615"
|
||||
|
||||
allow_session_interruption=s:option(ListValue, "sesctl_session_interruption", translate("Allow session interruption"))
|
||||
allow_session_interruption = s:option(ListValue, "sesctl_session_interruption", translate("Allow session interruption"))
|
||||
allow_session_interruption:value("no", translate("Not allow"))
|
||||
allow_session_interruption:value("yes", translate("Allow"))
|
||||
|
||||
session_timeout=s:option(Value, "sesctl_session_timeout", translate("Session timeout"))
|
||||
session_timeout = s:option(Value, "sesctl_session_timeout", translate("Session timeout"))
|
||||
session_timeout.default = "120"
|
||||
|
||||
return m
|
||||
return m
|
||||
|
@ -19,4 +19,4 @@ XHR.poll(3, '<%=url([[admin]], [[services]], [[shairport-sync]], [[run]])%>', nu
|
||||
<p id="shairport-sync_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
@ -12,4 +12,3 @@ LUCI_PKGARCH:=all
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
@ -27,7 +27,7 @@ end
|
||||
|
||||
m = Map("amule", translate("aMule"), translate("aMule is a ED2K/KAD client for all platforms.") .. "<br/><a href=\"https://github.com/maz-1\">luci interface by maz-1</a>")
|
||||
|
||||
m:section(SimpleSection).template = "amule/overview_status"
|
||||
m:section(SimpleSection).template = "amule/overview_status"
|
||||
|
||||
s = m:section(TypedSection, "amule", translate("aMule Settings"))
|
||||
s.addremove = false
|
||||
|
@ -357,4 +357,3 @@ msgstr "已有文件将被覆盖,是否继续?"
|
||||
|
||||
msgid "Percentage"
|
||||
msgstr "百分比"
|
||||
|
||||
|
0
package/lean/luci-app-amule/root/etc/hotplug.d/iface/20-amule
Normal file → Executable file
0
package/lean/luci-app-amule/root/etc/hotplug.d/iface/20-amule
Normal file → Executable file
1
package/lean/luci-app-arpbind/Makefile
Executable file → Normal file
1
package/lean/luci-app-arpbind/Makefile
Executable file → Normal file
@ -15,4 +15,3 @@ PKG_RELEASE:=3
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
@ -3,8 +3,9 @@
|
||||
local sys = require "luci.sys"
|
||||
local ifaces = sys.net:devices()
|
||||
|
||||
m = Map("arpbind", translate("IP/MAC Binding"),
|
||||
translatef("ARP is used to convert a network address (e.g. an IPv4 address) to a physical address such as a MAC address.Here you can add some static ARP binding rules."))
|
||||
m = Map("arpbind")
|
||||
m.title = translate("IP/MAC Binding")
|
||||
m.description = translatef("ARP is used to convert a network address (e.g. an IPv4 address) to a physical address such as a MAC address.Here you can add some static ARP binding rules.")
|
||||
|
||||
s = m:section(TypedSection, "arpbind", translate("Rules"))
|
||||
s.template = "cbi/tblsection"
|
||||
@ -39,5 +40,3 @@ a.default = "br-lan"
|
||||
a.rmempty = false
|
||||
|
||||
return m
|
||||
|
||||
|
||||
|
@ -14,4 +14,3 @@ PKG_RELEASE:=8
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
module("luci.controller.autoreboot",package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/autoreboot") then
|
||||
return
|
||||
|
@ -1,36 +1,38 @@
|
||||
require("luci.sys")
|
||||
|
||||
m=Map("autoreboot",translate("Scheduled Reboot"),translate("Scheduled reboot Setting"))
|
||||
m = Map("autoreboot")
|
||||
m.title = translate("Scheduled Reboot")
|
||||
m.description = translate("Scheduled reboot Setting")
|
||||
|
||||
s=m:section(TypedSection,"login","")
|
||||
s.addremove=false
|
||||
s.anonymous=true
|
||||
s = m:section(TypedSection, "login")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
enable=s:option(Flag,"enable",translate("Enable"))
|
||||
enable = s:option(Flag,"enable" ,translate("Enable"))
|
||||
enable.rmempty = false
|
||||
enable.default=0
|
||||
enable.default = 0
|
||||
|
||||
week=s:option(ListValue,"week",translate("Week Day"))
|
||||
week:value(7,translate("Everyday"))
|
||||
week:value(1,translate("Monday"))
|
||||
week:value(2,translate("Tuesday"))
|
||||
week:value(3,translate("Wednesday"))
|
||||
week:value(4,translate("Thursday"))
|
||||
week:value(5,translate("Friday"))
|
||||
week:value(6,translate("Saturday"))
|
||||
week:value(0,translate("Sunday"))
|
||||
week.default=0
|
||||
week = s:option(ListValue, "week", translate("Week Day"))
|
||||
week:value(7, translate("Everyday"))
|
||||
week:value(1, translate("Monday"))
|
||||
week:value(2, translate("Tuesday"))
|
||||
week:value(3, translate("Wednesday"))
|
||||
week:value(4, translate("Thursday"))
|
||||
week:value(5, translate("Friday"))
|
||||
week:value(6, translate("Saturday"))
|
||||
week:value(0, translate("Sunday"))
|
||||
week.default = 0
|
||||
|
||||
hour=s:option(Value,"hour",translate("Hour"))
|
||||
hour = s:option(Value, "hour", translate("Hour"))
|
||||
hour.datatype = "range(0,23)"
|
||||
hour.rmempty = false
|
||||
|
||||
pass=s:option(Value,"minute",translate("Minute"))
|
||||
pass = s:option(Value, "minute", translate("Minute"))
|
||||
pass.datatype = "range(0,59)"
|
||||
pass.rmempty = false
|
||||
|
||||
|
||||
local e=luci.http.formvalue("cbi.apply")
|
||||
local e = luci.http.formvalue("cbi.apply")
|
||||
if e then
|
||||
io.popen("/etc/init.d/autoreboot restart")
|
||||
end
|
||||
|
@ -4,4 +4,3 @@ config login
|
||||
option hour '5'
|
||||
option week '3'
|
||||
option enable '0'
|
||||
|
||||
|
@ -1,22 +1,22 @@
|
||||
#
|
||||
# <https://github.com/KFERMercer/luci-app-baidupcs-web>
|
||||
#
|
||||
# Copyright (C) 2020 KFERMercer <KFER.Mercer@gmail.com>
|
||||
# Copyright (C) 2020 [CTCGFW] Project OpenWRT
|
||||
#
|
||||
# THIS IS FREE SOFTWARE, LICENSED UNDER GPLv3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-baidupcs-web
|
||||
LUCI_TITLE:=LuCI support for BaiduPCS-Go
|
||||
LUCI_DEPENDS:=+baidupcs-web +wget +openssl-util
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=5
|
||||
PKG_MAINTAINER:=<https://github.com/KFERMercer/luci-app-baidupcs-web>
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
#
|
||||
# <https://github.com/KFERMercer/luci-app-baidupcs-web>
|
||||
#
|
||||
# Copyright (C) 2020 KFERMercer <KFER.Mercer@gmail.com>
|
||||
# Copyright (C) 2020 [CTCGFW] Project OpenWRT
|
||||
#
|
||||
# THIS IS FREE SOFTWARE, LICENSED UNDER GPLv3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-baidupcs-web
|
||||
LUCI_TITLE:=LuCI support for BaiduPCS-Go
|
||||
LUCI_DEPENDS:=+baidupcs-web +wget +openssl-util
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=5
|
||||
PKG_MAINTAINER:=<https://github.com/KFERMercer/luci-app-baidupcs-web>
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
@ -10,9 +10,9 @@ function index()
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("pgrep baidupcs-web >/dev/null")==0
|
||||
-- e.port=luci.sys.exec("uci get baidupcs-web.config.port")
|
||||
local e = {}
|
||||
e.running=luci.sys.call("pgrep baidupcs-web >/dev/null") == 0
|
||||
-- e.port = luci.sys.exec("uci get baidupcs-web.config.port")
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
@ -1,11 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@baidupcs-web[-1]
|
||||
add ucitrack baidupcs-web
|
||||
set ucitrack.@baidupcs-web[-1].init=baidupcs-web
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@baidupcs-web[-1]
|
||||
add ucitrack baidupcs-web
|
||||
set ucitrack.@baidupcs-web[-1].init=baidupcs-web
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
|
@ -1,6 +1,8 @@
|
||||
local fs = require "nixio.fs"
|
||||
|
||||
m = Map("cifs", translate("Mount SMB/CIFS Netshare"), translate("Mount SMB/CIFS Netshare for OpenWrt"))
|
||||
m = Map("cifs")
|
||||
m.title = translate("Mount SMB/CIFS Netshare")
|
||||
m.description = translate("Mount SMB/CIFS Netshare for OpenWrt")
|
||||
|
||||
s = m:section(TypedSection, "cifs")
|
||||
s.anonymous = true
|
||||
|
0
package/lean/luci-app-cifsd/root/etc/uci-defaults/luci-cifsd
Normal file → Executable file
0
package/lean/luci-app-cifsd/root/etc/uci-defaults/luci-cifsd
Normal file → Executable file
@ -1,4 +1,3 @@
|
||||
|
||||
module("luci.controller.cpufreq", package.seeall)
|
||||
|
||||
function index()
|
||||
|
@ -1,19 +1,19 @@
|
||||
#
|
||||
# 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:=LuCI for Dnsforwarder
|
||||
LUCI_DEPENDS:=+dnsforwarder
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=3.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_MAINTAINER:=Dennis <openwrt@tossp.com>
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
#
|
||||
# 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:=LuCI for Dnsforwarder
|
||||
LUCI_DEPENDS:=+dnsforwarder
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=3.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_MAINTAINER:=Dennis <openwrt@tossp.com>
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
@ -1,4 +1,5 @@
|
||||
module("luci.controller.dnsforwarder", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/dnsforwarder") then
|
||||
return
|
||||
@ -7,4 +8,4 @@ function index()
|
||||
entry({"admin", "services", "dnsforwarder"}, alias("admin", "services", "dnsforwarder", "general"), _("Dnsforwarder")).dependent = true
|
||||
entry({"admin", "services", "dnsforwarder", "general"}, cbi("dnsforwarder/general"), _("General") ,10).leaf = true
|
||||
entry({"admin", "services", "dnsforwarder", "log"}, cbi("dnsforwarder/log"), _("LOG"), 30).leaf = true
|
||||
end
|
||||
end
|
||||
|
@ -1,185 +1,186 @@
|
||||
--Alex<1886090@gmail.com>
|
||||
--Dennis<code@tossp.com>
|
||||
local fs = require "nixio.fs"
|
||||
local CONFIG_FILE = "/tmp/dnsforwarder.conf";
|
||||
|
||||
function sync_value_to_file(value, file)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = nixio.fs.readfile(file)
|
||||
if value ~= old_value then
|
||||
nixio.fs.writefile(file, value)
|
||||
end
|
||||
|
||||
end
|
||||
local state_msg = ""
|
||||
|
||||
local dnsforwarder_on = (luci.sys.call("pidof dnsforwarder > /dev/null") == 0)
|
||||
local resolv_file = luci.sys.exec("uci get dhcp.@dnsmasq[0].resolvfile")
|
||||
local listen_port = luci.sys.exec("uci get dhcp.@dnsmasq[0].server")
|
||||
|
||||
if dnsforwarder_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
|
||||
|
||||
|
||||
if dnsforwarder_on and string.sub(listen_port,1,14) == "127.0.0.1#5053" then
|
||||
state_msg=state_msg .. ",DNSmasq已经将流量定向至本软件"
|
||||
elseif dnsforwarder_on then
|
||||
state_msg=state_msg .. "<b><font color=\"red\"></font></b>"
|
||||
end
|
||||
|
||||
if resolv_file=="" then
|
||||
|
||||
else if dnsforwarder_on then
|
||||
state_msg=state_msg .. "<b><font color=\"red\"></font></b>"
|
||||
end
|
||||
end
|
||||
m=Map("dnsforwarder",translate("dnsforwarder"),translate("Dnsforwarder是企业级DNS服务器,可以通过TCP协议进行DNS解析,可以方便的使用iptables进行透明代理,配合ipset、GFWList使用效果更佳。默认上游服务器为114DNS,SSR和Redsocks的GFWList模式要依赖本软件包提供的功能").. "<br><br>状态 - " .. state_msg)
|
||||
s=m:section(TypedSection,"arguments", translate("通用配置"))
|
||||
s.addremove=false
|
||||
s.anonymous=true
|
||||
view_enable = s:option(Flag,"enabled",translate("Enable"))
|
||||
view_dnsmasq = s:option(Flag,"dnsmasq",translate("设置成DNSmasq的上游服务器"),translate("让DNSMasq从本软件获得解析结果,支持GFWList模式"))
|
||||
view_addr = s:option(Value,"addr",translate("转发地址"),translate("请填写dnsforwarder的监听地址,默认127.0.0.1:5053,如果填写<b><font color=\"red\">208.67.222.222:5353</font></b>那么可不通过该软件获得无污染结果"))
|
||||
view_addr.default = "127.0.0.1:5053"
|
||||
|
||||
-- ---------------------------------------------------
|
||||
s1=m:section(TypedSection,"config",translate("标准配置"))
|
||||
s1.addremove=false
|
||||
s1.anonymous=true
|
||||
log_enable = s1:option(Flag,"log",translate("打开文件日志"))
|
||||
log_enable.rmempty=false
|
||||
log_enable.default="false"
|
||||
log_enable.disabled="false"
|
||||
log_enable.enabled="true"
|
||||
log_size = s1:option(Value,"log_size",translate("单个日志文件大小的临界值(字节)"),translate("当日志文件大小超过这个临界值后,当前的日志文件将会被重命名,然后建立一个新的日志文件,继续记录日志"))
|
||||
log_size.datatype="uinteger"
|
||||
log_size.default="102400"
|
||||
log_size:depends ({log="true"})
|
||||
log_path = s1:option(Value,"log_path",translate("设定日志文件所在的文件夹"),translate("日志文件初始的文件名为 `dnsforwarder.log',当超过临界值之后,将会被重命名为 `dnsforwarder.log.1'、`dnsforwarder.log.2' 等等,然后重新建立一个 dnsforwarder.log' 文件"))
|
||||
log_path.datatype="directory"
|
||||
log_path.default="/var/log/"
|
||||
log_path.readonly=true
|
||||
log_path:depends ({log="true"})
|
||||
gfw_enable = s1:option(Flag,"gfw",translate("使用GFW列表"))
|
||||
gfw_enable.rmempty=false
|
||||
gfw_enable.default="true"
|
||||
gfw_enable.disabled="false"
|
||||
gfw_enable.enabled="true"
|
||||
udp_local = s1:option(DynamicList,"udp_local",translate("本地监听"),translate("设置在本地开启的接口的IP地址和端口,可以是本地回环地址 (127.0.0.1) ,本地局域网,以及互联网<br/>如果是 IPv6 地址,请在IP两端加上方括号(不包含端口部分),例如 [::1]:53 (本地回环)、[fe80::699c:f79a:9bb6:1]:5353<br/>如果不指定端口,则默认为 53"))
|
||||
tcp_group = s1:option(DynamicList,"tcp_group",translate("解析策略(TCP)"),translate([[格式:<IP1[:PORT],IP2[:PORT],...> <DOMAIN1,DOMAIN2,...> <on|PROXY1[:PORT],PROXY2[:PORT],...><br/>
|
||||
设置一个 TCP 上游服务器组,并指定通过这些上游服务器查询的域名<br/>
|
||||
第一部分参数“<IP1[:PORT],IP2[:PORT],...>”,用于指定 TCP 上游服务器,不写端口则默认使用 53 端口<br/>
|
||||
第二部分参数“<DOMAIN1,DOMAIN2,...>”,用于指定通过这些 TCP 上游服务器查询的域名,可以包含通配符<br/>
|
||||
第三部分参数“<no|PROXY1[:PORT],PROXY2[:PORT],...>”,用于指定查询时使用的 Socks5 代理,不写端口则默认使用 1080 端口。`no' 代表不使用代理]]))
|
||||
tcp_group.placeholder = "8.8.8.8 * on"
|
||||
tcp_group.default=tcp_group.placeholder
|
||||
udp_group = s1:option(DynamicList,"udp_group",translate("解析策略(UDP)"),translate([[格式:<IP1[:PORT],IP2[:PORT],...> <DOMAIN1,DOMAIN2,...> <on|off><br/>
|
||||
设置一个 UDP 上游服务器组,并指定通过这些上游服务器查询的域名<br/>
|
||||
第一部分参数“<IP1[:PORT],IP2[:PORT],...>”,用于指定 UDP 上游服务器,不写端口则默认使用 53 端口<br/>
|
||||
第二部分参数“<DOMAIN1,DOMAIN2,...>”,用于指定通过这些 UDP 上游服务器查询的域名,可以包含通配符<br/>
|
||||
第三部分参数“<on|off>”,用于指定是否开启并发查询,`on' 为开启,`off' 为不开启<br/>
|
||||
并发查询指的是,向所有指定的 UDP 服务器发送查询请求,取最先接受到的未屏蔽的回复作为查询结果,并丢弃其余的回复]]))
|
||||
udp_group.placeholder = "9.9.9.9,119.29.29.29,223.5.5.5,114.114.114.114 * on"
|
||||
udp_group.default=udp_group.placeholder
|
||||
group_file = s1:option(DynamicList,"group_file",translate("解析策略(文件)"),translate([[
|
||||
从文件加载服务器组,
|
||||
服务器组文件的写法<a href="https://github.com/holmium/dnsforwarder/wiki/GroupFile-%E7%9A%84%E5%86%99%E6%B3%95-%7C-How-to-write-GroupFiles" target="_blank">点击这里查看</a>。]]))
|
||||
group_file.datatype="file"
|
||||
s1:option(DummyValue,"nothing"," ",translate([[
|
||||
解析策略优先级:<b>解析策略(TCP)>解析策略(UDP)>解析策略(文件)</b><br/>
|
||||
1.对于没有指定服务器的域名,会随机选择一个服务器组进行查询。<br/>
|
||||
2.如果某域名匹配多个服务器组,则选择的顺序如下:<br/>
|
||||
2.1 优先选择不含通配符的匹配项,如果仍然有多条匹配,则选择匹配度最高的那个,
|
||||
如果匹配度相同的情况下仍然有多条匹配,则选择最后一个。
|
||||
(例如 `ipv6.microsoft.com' 比 `microsoft.com' 对于域名 `teredo.ipv6.microsoft.com' 的匹配度更高)<br/>
|
||||
2.2 然后选择包含通配符的匹配项,如果有多条匹配,则选择第一个.
|
||||
]]))
|
||||
block_ip = s1:option(DynamicList,"block_ip",translate("DNS黑名单"),translate("阻挡含有以上 IP 地址的 DNS 数据包,IPv6 地址不用加方括号"))
|
||||
block_ip.datatype="ipaddr"
|
||||
block_ip.delimiter = ","
|
||||
ip_substituting = s1:option(DynamicList,"ip_substituting",translate("替换 DNS 数据包"),translate("替换 DNS 数据包中的 IP 地址(只支持 IPv4 地址),例如:<br/><code>127.0.0.1 1.2.0.127</code>的效果是把 DNS 数据包中所有的 127.0.0.1 地址替换为 1.2.0.127,仅替换通过服务器(TCP 和 UDP)查询而来的 DNS 数据包,对于缓存中和 Hosts 中的结果无效"))
|
||||
ip_substituting.placeholder = "127.0.0.1 1.2.0.127"
|
||||
block_negative_resp = s1:option(Flag,"block_negative_resp",translate("过滤失败请求"),translate("是否过滤来自上游服务器的查询未成功的响应。查询未成功指:格式错误、服务器错误、域名不存在和服务器拒绝请求等,参见 RFC 6895,`2.3. RCODE Assignment'"))
|
||||
block_negative_resp.rmempty=false
|
||||
block_negative_resp.default="false"
|
||||
block_negative_resp.disabled="false"
|
||||
block_negative_resp.enabled="true"
|
||||
append_host = s1:option(DynamicList,"append_host",translate("附加hosts"),translate([[
|
||||
写法与HOSTS文件中的一样,同样支持通配符,IPv6 地址不用加方括号<br>
|
||||
也可以定义 CName 的 Hosts 项,例如:<code>www.google.cn *.google.com</code>,这样所有匹配 *.google.com 的域名都将指向 www.google.cn 的 IP 地址<br>
|
||||
如果使某些域名跳过在 hosts 中的查询,可以<code>@@ *.012345.com</code>这样所有匹配 *.012345.com 的域名都不会在 hosts 中查询<br>
|
||||
各种 hosts 的优先级从高到低:1.带 `@@' 的禁止项 2.一般 hosts 项 3.CName hosts 项<br>
|
||||
]]))
|
||||
block_ipv6 = s1:option(Flag,"block_ipv6",translate("拒绝IPv6 地址"),translate("如果一个域名在 Hosts 被指定了一个 IPv4 地址(包括文件 Hosts 和 `AppendHosts' 指定的 Hosts),那么拒绝对这个域名的 IPv6 地址查询"))
|
||||
block_ipv6.rmempty=false
|
||||
block_ipv6.default="false"
|
||||
block_ipv6.disabled="false"
|
||||
block_ipv6.enabled="true"
|
||||
|
||||
cache = s1:option(Flag,"cache",translate("使用缓存"),translate("是否使用缓存"))
|
||||
cache.rmempty=false
|
||||
cache.default="false"
|
||||
cache.disabled="false"
|
||||
cache.enabled="true"
|
||||
cache_size = s1:option(Value,"cache_size",translate("缓存大小 (字节)"),translate("缓存大小不能小于 102400 (100KB)"))
|
||||
cache_size.datatype="min(102400)"
|
||||
cache_size.default="1048576"
|
||||
cache_size:depends ({cache="true"})
|
||||
cache_file = s1:option(Value,"cache_file",translate("缓存文件"))
|
||||
cache_file.default="/tmp/dnsforwarder.cache"
|
||||
cache_file.readonly=true
|
||||
cache_file:depends ({cache="true"})
|
||||
cache_ignore = s1:option(Flag,"cache_ignore",translate("忽略TTL"),translate("为 `true' 时将忽略 TTL,此时所有的缓存条目将不会被移除,为 `false' 时不忽略 TTL,缓存条目将会按照 TTL 的时间来移除"))
|
||||
cache_ignore.rmempty=false
|
||||
cache_ignore.default="false"
|
||||
cache_ignore.disabled="false"
|
||||
cache_ignore.enabled="true"
|
||||
cache_ignore:depends ({cache="true"})
|
||||
cache_control = s1:option(DynamicList,"cache_control",translate("控制域名的缓存行为"),translate([[
|
||||
单条格式:<DOMAIN> [$ [$] ]<TYPE> [ARGUMENT]<br/>
|
||||
<DOMAIN> 是域名;[$ [$] ] 是传染设定;<TYPE> 是类型;[ARGUMENT] 是参数<br/>
|
||||
<DOMAIN> 支持通配符,支持尾部匹配<br/>
|
||||
<TYPE> 有以下可选项(均为小写):<br>
|
||||
orig : 使用原先的 TTL,即不改变指定域名记录的 TTL,此类型无需 [ARGUMENT] 参数<br>
|
||||
nocache : 不缓存指定域名记录,此类型无需 [ARGUMENT] 参数<br>
|
||||
fixed : 将指定域名记录的 TTL 修改为一个预先指定的常数值,这个值通过 [ARGUMENT] 参数指定<br>
|
||||
vari : 将指定域名记录的 TTL 修改为一个预先规定的变量,这个变量通过 [ARGUMENT] 参数指定,此时 [ARGUMENT] 参数的格式为 `ax+b',其中 a、b 为非负整数(需用户手工指定),x 为记录原先的 TTL 值(不需要用户指定)。此选项必须为 `ax+b' 的形式,不能是 `ax-b' 或者其它的变体形<br>
|
||||
<br/>传染机制:<br/>
|
||||
主动传染 (此为默认情况):主动传染 : 所有的域名记录不论是否存在单独指定的控制条目,均使用上级域名控制条目<br>
|
||||
被动传染(<TYPE> 前加一个 `$'): 如果存在单独指定的控制条目,那么使用单独指定的控制条目,否则使用上级域名的控制条目<br>
|
||||
不传染(<TYPE> 前加两个 `$'): 如果存在单独指定的控制条目,那么使用单独指定的控制条目,如果没有则不修改记录的 TTL 值<br>
|
||||
只有被查询的域名控制条目才具有传染性质<br/>
|
||||
<br/>常见例子:<br/>
|
||||
<code>* fixed 300</code>强制使所有缓存的条目的 TTL 为 300<br/>
|
||||
<code>* vari 2x+0</code>将所有缓存条目的 TTL 加倍。即原来为300,现在为600<br/>
|
||||
]]))
|
||||
cache_control:depends ({cache="true"})
|
||||
|
||||
domain_statistic = s1:option(Flag,"domain_statistic",translate("启用域名统计"),translate("域名信息统计会依照模板文件记录域名的查询情况<b>目前只能生成到<code>/root/.dnsforwarder/statistic.html</code>会影响闪存寿命不建议开启</b>"))
|
||||
domain_statistic.rmempty=false
|
||||
domain_statistic.default="false"
|
||||
domain_statistic.disabled="false"
|
||||
domain_statistic.enabled="true"
|
||||
|
||||
view_cfg = s1:option(TextValue, "1", nil)
|
||||
view_cfg.rmempty = false
|
||||
view_cfg.rows = 24
|
||||
view_cfg.readonly=true
|
||||
|
||||
function view_cfg.cfgvalue()
|
||||
return nixio.fs.readfile(CONFIG_FILE) or ""
|
||||
end
|
||||
function view_cfg.write(self, section, value)
|
||||
end
|
||||
|
||||
-- ---------------------------------------------------
|
||||
local apply = luci.http.formvalue("cbi.apply")
|
||||
if apply then
|
||||
os.execute("/etc/init.d/dnsforwarder makeconfig >/dev/null 2>&1 &")
|
||||
os.execute("/etc/init.d/dnsforwarder restart >/dev/null 2>&1 &")
|
||||
end
|
||||
|
||||
return m
|
||||
--Alex<1886090@gmail.com>
|
||||
--Dennis<code@tossp.com>
|
||||
local fs = require "nixio.fs"
|
||||
local CONFIG_FILE = "/tmp/dnsforwarder.conf";
|
||||
|
||||
function sync_value_to_file(value, file)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = nixio.fs.readfile(file)
|
||||
if value ~= old_value then
|
||||
nixio.fs.writefile(file, value)
|
||||
end
|
||||
|
||||
end
|
||||
local state_msg = ""
|
||||
|
||||
local dnsforwarder_on = (luci.sys.call("pidof dnsforwarder > /dev/null") == 0)
|
||||
local resolv_file = luci.sys.exec("uci get dhcp.@dnsmasq[0].resolvfile")
|
||||
local listen_port = luci.sys.exec("uci get dhcp.@dnsmasq[0].server")
|
||||
|
||||
if dnsforwarder_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
|
||||
|
||||
|
||||
if dnsforwarder_on and string.sub(listen_port,1,14) == "127.0.0.1#5053" then
|
||||
state_msg = state_msg .. ",DNSmasq已经将流量定向至本软件"
|
||||
elseif dnsforwarder_on then
|
||||
state_msg = state_msg .. "<b><font color=\"red\"></font></b>"
|
||||
end
|
||||
|
||||
if resolv_file=="" then
|
||||
|
||||
else if dnsforwarder_on then
|
||||
state_msg = state_msg .. "<b><font color=\"red\"></font></b>"
|
||||
end
|
||||
end
|
||||
|
||||
m = Map("dnsforwarder",translate("dnsforwarder"),translate("Dnsforwarder是企业级DNS服务器,可以通过TCP协议进行DNS解析,可以方便的使用iptables进行透明代理,配合ipset、GFWList使用效果更佳。默认上游服务器为114DNS,SSR和Redsocks的GFWList模式要依赖本软件包提供的功能").. "<br><br>状态 - " .. state_msg)
|
||||
s = m:section(TypedSection,"arguments", translate("通用配置"))
|
||||
s.addremove=false
|
||||
s.anonymous=true
|
||||
view_enable = s:option(Flag,"enabled",translate("Enable"))
|
||||
view_dnsmasq = s:option(Flag,"dnsmasq",translate("设置成DNSmasq的上游服务器"),translate("让DNSMasq从本软件获得解析结果,支持GFWList模式"))
|
||||
view_addr = s:option(Value,"addr",translate("转发地址"),translate("请填写dnsforwarder的监听地址,默认127.0.0.1:5053,如果填写<b><font color=\"red\">208.67.222.222:5353</font></b>那么可不通过该软件获得无污染结果"))
|
||||
view_addr.default = "127.0.0.1:5053"
|
||||
|
||||
-- ---------------------------------------------------
|
||||
s1 = m:section(TypedSection,"config",translate("标准配置"))
|
||||
s1.addremove = false
|
||||
s1.anonymous = true
|
||||
log_enable = s1:option(Flag,"log",translate("打开文件日志"))
|
||||
log_enable.rmempty = false
|
||||
log_enable.default = "false"
|
||||
log_enable.disabled = "false"
|
||||
log_enable.enabled = "true"
|
||||
log_size = s1:option(Value,"log_size",translate("单个日志文件大小的临界值(字节)"),translate("当日志文件大小超过这个临界值后,当前的日志文件将会被重命名,然后建立一个新的日志文件,继续记录日志"))
|
||||
log_size.datatype = "uinteger"
|
||||
log_size.default = "102400"
|
||||
log_size:depends ({log="true"})
|
||||
log_path = s1:option(Value,"log_path",translate("设定日志文件所在的文件夹"),translate("日志文件初始的文件名为 `dnsforwarder.log',当超过临界值之后,将会被重命名为 `dnsforwarder.log.1'、`dnsforwarder.log.2' 等等,然后重新建立一个 dnsforwarder.log' 文件"))
|
||||
log_path.datatype = "directory"
|
||||
log_path.default = "/var/log/"
|
||||
log_path.readonly = true
|
||||
log_path:depends ({log="true"})
|
||||
gfw_enable = s1:option(Flag,"gfw",translate("使用GFW列表"))
|
||||
gfw_enable.rmempty = false
|
||||
gfw_enable.default = "true"
|
||||
gfw_enable.disabled = "false"
|
||||
gfw_enable.enabled = "true"
|
||||
udp_local = s1:option(DynamicList,"udp_local",translate("本地监听"),translate("设置在本地开启的接口的IP地址和端口,可以是本地回环地址 (127.0.0.1) ,本地局域网,以及互联网<br/>如果是 IPv6 地址,请在IP两端加上方括号(不包含端口部分),例如 [::1]:53 (本地回环)、[fe80::699c:f79a:9bb6:1]:5353<br/>如果不指定端口,则默认为 53"))
|
||||
tcp_group = s1:option(DynamicList,"tcp_group",translate("解析策略(TCP)"),translate([[格式:<IP1[:PORT],IP2[:PORT],...> <DOMAIN1,DOMAIN2,...> <on|PROXY1[:PORT],PROXY2[:PORT],...><br/>
|
||||
设置一个 TCP 上游服务器组,并指定通过这些上游服务器查询的域名<br/>
|
||||
第一部分参数“<IP1[:PORT],IP2[:PORT],...>”,用于指定 TCP 上游服务器,不写端口则默认使用 53 端口<br/>
|
||||
第二部分参数“<DOMAIN1,DOMAIN2,...>”,用于指定通过这些 TCP 上游服务器查询的域名,可以包含通配符<br/>
|
||||
第三部分参数“<no|PROXY1[:PORT],PROXY2[:PORT],...>”,用于指定查询时使用的 Socks5 代理,不写端口则默认使用 1080 端口。`no' 代表不使用代理]]))
|
||||
tcp_group.placeholder = "8.8.8.8 * on"
|
||||
tcp_group.default = tcp_group.placeholder
|
||||
udp_group = s1:option(DynamicList,"udp_group",translate("解析策略(UDP)"),translate([[格式:<IP1[:PORT],IP2[:PORT],...> <DOMAIN1,DOMAIN2,...> <on|off><br/>
|
||||
设置一个 UDP 上游服务器组,并指定通过这些上游服务器查询的域名<br/>
|
||||
第一部分参数“<IP1[:PORT],IP2[:PORT],...>”,用于指定 UDP 上游服务器,不写端口则默认使用 53 端口<br/>
|
||||
第二部分参数“<DOMAIN1,DOMAIN2,...>”,用于指定通过这些 UDP 上游服务器查询的域名,可以包含通配符<br/>
|
||||
第三部分参数“<on|off>”,用于指定是否开启并发查询,`on' 为开启,`off' 为不开启<br/>
|
||||
并发查询指的是,向所有指定的 UDP 服务器发送查询请求,取最先接受到的未屏蔽的回复作为查询结果,并丢弃其余的回复]]))
|
||||
udp_group.placeholder = "9.9.9.9,119.29.29.29,223.5.5.5,114.114.114.114 * on"
|
||||
udp_group.default = udp_group.placeholder
|
||||
group_file = s1:option(DynamicList,"group_file",translate("解析策略(文件)"),translate([[
|
||||
从文件加载服务器组,
|
||||
服务器组文件的写法<a href="https://github.com/holmium/dnsforwarder/wiki/GroupFile-%E7%9A%84%E5%86%99%E6%B3%95-%7C-How-to-write-GroupFiles" target="_blank">点击这里查看</a>。]]))
|
||||
group_file.datatype = "file"
|
||||
s1:option(DummyValue,"nothing"," ",translate([[
|
||||
解析策略优先级:<b>解析策略(TCP)>解析策略(UDP)>解析策略(文件)</b><br/>
|
||||
1.对于没有指定服务器的域名,会随机选择一个服务器组进行查询。<br/>
|
||||
2.如果某域名匹配多个服务器组,则选择的顺序如下:<br/>
|
||||
2.1 优先选择不含通配符的匹配项,如果仍然有多条匹配,则选择匹配度最高的那个,
|
||||
如果匹配度相同的情况下仍然有多条匹配,则选择最后一个。
|
||||
(例如 `ipv6.microsoft.com' 比 `microsoft.com' 对于域名 `teredo.ipv6.microsoft.com' 的匹配度更高)<br/>
|
||||
2.2 然后选择包含通配符的匹配项,如果有多条匹配,则选择第一个.
|
||||
]]))
|
||||
block_ip = s1:option(DynamicList,"block_ip",translate("DNS黑名单"),translate("阻挡含有以上 IP 地址的 DNS 数据包,IPv6 地址不用加方括号"))
|
||||
block_ip.datatype = "ipaddr"
|
||||
block_ip.delimiter = ","
|
||||
ip_substituting = s1:option(DynamicList,"ip_substituting",translate("替换 DNS 数据包"),translate("替换 DNS 数据包中的 IP 地址(只支持 IPv4 地址),例如:<br/><code>127.0.0.1 1.2.0.127</code>的效果是把 DNS 数据包中所有的 127.0.0.1 地址替换为 1.2.0.127,仅替换通过服务器(TCP 和 UDP)查询而来的 DNS 数据包,对于缓存中和 Hosts 中的结果无效"))
|
||||
ip_substituting.placeholder = "127.0.0.1 1.2.0.127"
|
||||
block_negative_resp = s1:option(Flag,"block_negative_resp",translate("过滤失败请求"),translate("是否过滤来自上游服务器的查询未成功的响应。查询未成功指:格式错误、服务器错误、域名不存在和服务器拒绝请求等,参见 RFC 6895,`2.3. RCODE Assignment'"))
|
||||
block_negative_resp.rmempty = false
|
||||
block_negative_resp.default = "false"
|
||||
block_negative_resp.disabled = "false"
|
||||
block_negative_resp.enabled = "true"
|
||||
append_host = s1:option(DynamicList,"append_host",translate("附加hosts"),translate([[
|
||||
写法与HOSTS文件中的一样,同样支持通配符,IPv6 地址不用加方括号<br>
|
||||
也可以定义 CName 的 Hosts 项,例如:<code>www.google.cn *.google.com</code>,这样所有匹配 *.google.com 的域名都将指向 www.google.cn 的 IP 地址<br>
|
||||
如果使某些域名跳过在 hosts 中的查询,可以<code>@@ *.012345.com</code>这样所有匹配 *.012345.com 的域名都不会在 hosts 中查询<br>
|
||||
各种 hosts 的优先级从高到低:1.带 `@@' 的禁止项 2.一般 hosts 项 3.CName hosts 项<br>
|
||||
]]))
|
||||
block_ipv6 = s1:option(Flag,"block_ipv6",translate("拒绝IPv6 地址"),translate("如果一个域名在 Hosts 被指定了一个 IPv4 地址(包括文件 Hosts 和 `AppendHosts' 指定的 Hosts),那么拒绝对这个域名的 IPv6 地址查询"))
|
||||
block_ipv6.rmempty = false
|
||||
block_ipv6.default = "false"
|
||||
block_ipv6.disabled = "false"
|
||||
block_ipv6.enabled = "true"
|
||||
|
||||
cache = s1:option(Flag,"cache",translate("使用缓存"),translate("是否使用缓存"))
|
||||
cache.rmempty = false
|
||||
cache.default = "false"
|
||||
cache.disabled = "false"
|
||||
cache.enabled = "true"
|
||||
cache_size = s1:option(Value,"cache_size",translate("缓存大小 (字节)"),translate("缓存大小不能小于 102400 (100KB)"))
|
||||
cache_size.datatype = "min(102400)"
|
||||
cache_size.default = "1048576"
|
||||
cache_size:depends ({cache="true"})
|
||||
cache_file = s1:option(Value,"cache_file",translate("缓存文件"))
|
||||
cache_file.default="/tmp/dnsforwarder.cache"
|
||||
cache_file.readonly=true
|
||||
cache_file:depends ({cache="true"})
|
||||
cache_ignore = s1:option(Flag,"cache_ignore",translate("忽略TTL"),translate("为 `true' 时将忽略 TTL,此时所有的缓存条目将不会被移除,为 `false' 时不忽略 TTL,缓存条目将会按照 TTL 的时间来移除"))
|
||||
cache_ignore.rmempty=false
|
||||
cache_ignore.default = "false"
|
||||
cache_ignore.disabled = "false"
|
||||
cache_ignore.enabled = "true"
|
||||
cache_ignore:depends ({cache="true"})
|
||||
cache_control = s1:option(DynamicList,"cache_control",translate("控制域名的缓存行为"),translate([[
|
||||
单条格式:<DOMAIN> [$ [$] ]<TYPE> [ARGUMENT]<br/>
|
||||
<DOMAIN> 是域名;[$ [$] ] 是传染设定;<TYPE> 是类型;[ARGUMENT] 是参数<br/>
|
||||
<DOMAIN> 支持通配符,支持尾部匹配<br/>
|
||||
<TYPE> 有以下可选项(均为小写):<br>
|
||||
orig : 使用原先的 TTL,即不改变指定域名记录的 TTL,此类型无需 [ARGUMENT] 参数<br>
|
||||
nocache : 不缓存指定域名记录,此类型无需 [ARGUMENT] 参数<br>
|
||||
fixed : 将指定域名记录的 TTL 修改为一个预先指定的常数值,这个值通过 [ARGUMENT] 参数指定<br>
|
||||
vari : 将指定域名记录的 TTL 修改为一个预先规定的变量,这个变量通过 [ARGUMENT] 参数指定,此时 [ARGUMENT] 参数的格式为 `ax+b',其中 a、b 为非负整数(需用户手工指定),x 为记录原先的 TTL 值(不需要用户指定)。此选项必须为 `ax+b' 的形式,不能是 `ax-b' 或者其它的变体形<br>
|
||||
<br/>传染机制:<br/>
|
||||
主动传染 (此为默认情况):主动传染 : 所有的域名记录不论是否存在单独指定的控制条目,均使用上级域名控制条目<br>
|
||||
被动传染(<TYPE> 前加一个 `$'): 如果存在单独指定的控制条目,那么使用单独指定的控制条目,否则使用上级域名的控制条目<br>
|
||||
不传染(<TYPE> 前加两个 `$'): 如果存在单独指定的控制条目,那么使用单独指定的控制条目,如果没有则不修改记录的 TTL 值<br>
|
||||
只有被查询的域名控制条目才具有传染性质<br/>
|
||||
<br/>常见例子:<br/>
|
||||
<code>* fixed 300</code>强制使所有缓存的条目的 TTL 为 300<br/>
|
||||
<code>* vari 2x+0</code>将所有缓存条目的 TTL 加倍。即原来为300,现在为600<br/>
|
||||
]]))
|
||||
cache_control:depends ({cache="true"})
|
||||
|
||||
domain_statistic = s1:option(Flag,"domain_statistic",translate("启用域名统计"),translate("域名信息统计会依照模板文件记录域名的查询情况<b>目前只能生成到<code>/root/.dnsforwarder/statistic.html</code>会影响闪存寿命不建议开启</b>"))
|
||||
domain_statistic.rmempty = false
|
||||
domain_statistic.default = "false"
|
||||
domain_statistic.disabled = "false"
|
||||
domain_statistic.enabled = "true"
|
||||
|
||||
view_cfg = s1:option(TextValue, "1", nil)
|
||||
view_cfg.rmempty = false
|
||||
view_cfg.rows = 24
|
||||
view_cfg.readonly = true
|
||||
|
||||
function view_cfg.cfgvalue()
|
||||
return nixio.fs.readfile(CONFIG_FILE) or ""
|
||||
end
|
||||
function view_cfg.write(self, section, value)
|
||||
end
|
||||
|
||||
-- ---------------------------------------------------
|
||||
local apply = luci.http.formvalue("cbi.apply")
|
||||
if apply then
|
||||
os.execute("/etc/init.d/dnsforwarder makeconfig >/dev/null 2>&1 &")
|
||||
os.execute("/etc/init.d/dnsforwarder restart >/dev/null 2>&1 &")
|
||||
end
|
||||
|
||||
return m
|
||||
|
@ -1,31 +1,28 @@
|
||||
local fs = require "nixio.fs"
|
||||
local log = "/var/log/dnsforwarder.log"
|
||||
|
||||
function sync_value_to_file(value, file)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = nixio.fs.readfile(file)
|
||||
if value ~= old_value then
|
||||
nixio.fs.writefile(file, value)
|
||||
end
|
||||
end
|
||||
|
||||
m = Map("dnsforwarder", translate("运行日志"),translate("如果想观察日志,需要在配置文件中写明LogOn true 和 LogFileFolder /var/log"))
|
||||
s=m:section(TypedSection,"arguments","")
|
||||
s.addremove=false
|
||||
s.anonymous=true
|
||||
|
||||
|
||||
|
||||
|
||||
gfwlist = s:option(TextValue, "gfwlist",nil, nil)
|
||||
gfwlist.description = translate("日志文件默认位置:" .. log)
|
||||
gfwlist.rows = 26
|
||||
gfwlist.wrap = "off"
|
||||
gfwlist.cfgvalue = function(self, section)
|
||||
return fs.readfile(log) or ""
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
return m
|
||||
local fs = require "nixio.fs"
|
||||
local log = "/var/log/dnsforwarder.log"
|
||||
|
||||
function sync_value_to_file(value, file)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = nixio.fs.readfile(file)
|
||||
if value ~= old_value then
|
||||
nixio.fs.writefile(file, value)
|
||||
end
|
||||
end
|
||||
|
||||
m = Map("dnsforwarder")
|
||||
m.title = translate("运行日志")
|
||||
m.description = translate("如果想观察日志,需要在配置文件中写明LogOn true 和 LogFileFolder /var/log")
|
||||
|
||||
s = m:section(TypedSection,"arguments","")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
gfwlist = s:option(TextValue, "gfwlist",nil, nil)
|
||||
gfwlist.description = translate("日志文件默认位置:" .. log)
|
||||
gfwlist.rows = 26
|
||||
gfwlist.wrap = "off"
|
||||
gfwlist.cfgvalue = function(self, section)
|
||||
return fs.readfile(log) or ""
|
||||
end
|
||||
|
||||
return m
|
||||
|
@ -1,8 +1,8 @@
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Running"
|
||||
msgstr "运行中"
|
||||
|
||||
msgid "Not running"
|
||||
msgstr "未运行"
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Running"
|
||||
msgstr "运行中"
|
||||
|
||||
msgid "Not running"
|
||||
msgstr "未运行"
|
||||
|
1
package/lean/luci-app-docker/Makefile
Executable file → Normal file
1
package/lean/luci-app-docker/Makefile
Executable file → Normal file
@ -15,4 +15,3 @@ PKG_RELEASE:=12
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
@ -10,8 +10,8 @@ function index()
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("pgrep /usr/bin/dockerd >/dev/null")==0
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pgrep /usr/bin/dockerd >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
end
|
||||
|
@ -8,7 +8,7 @@ end
|
||||
m = Map("dockerd", "Docker CE", translate("Docker is a set of platform-as-a-service (PaaS) products that use OS-level virtualization to deliver software in packages called containers.") .. button)
|
||||
|
||||
|
||||
m:section(SimpleSection).template = "docker/docker_status"
|
||||
m:section(SimpleSection).template = "docker/docker_status"
|
||||
|
||||
s = m:section(TypedSection, "docker")
|
||||
s.anonymous = true
|
||||
@ -17,7 +17,7 @@ wan_mode = s:option(Flag, "wan_mode", translate("Enable WAN access Docker"), tra
|
||||
wan_mode.default = 0
|
||||
wan_mode.rmempty = false
|
||||
|
||||
o=s:option(DummyValue,"readme",translate(" "))
|
||||
o.description=translate("<a href=\"../../../../DockerReadme.pdf\" target=\"_blank\" />"..translate("Download DockerReadme.pdf").."</a>")
|
||||
o = s:option(DummyValue,"readme",translate(" "))
|
||||
o.description = translate("<a href=\"../../../../DockerReadme.pdf\" target=\"_blank\" />"..translate("Download DockerReadme.pdf").."</a>")
|
||||
|
||||
return m
|
||||
|
@ -19,4 +19,4 @@ XHR.poll(3, '<%=url([[admin]], [[services]], [[docker]], [[status]])%>', null,
|
||||
<p id="docker_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
config docker
|
||||
option wan_mode '0'
|
||||
|
||||
|
0
package/lean/luci-app-easymesh/Makefile
Executable file → Normal file
0
package/lean/luci-app-easymesh/Makefile
Executable file → Normal file
3
package/lean/luci-app-easymesh/luasrc/controller/easymesh.lua
Executable file → Normal file
3
package/lean/luci-app-easymesh/luasrc/controller/easymesh.lua
Executable file → Normal file
@ -1,4 +1,4 @@
|
||||
#-- Copyright (C) 2021 dz <dingzhong110@gmail.com>
|
||||
-- Copyright (C) 2021 dz <dingzhong110@gmail.com>
|
||||
|
||||
module("luci.controller.easymesh", package.seeall)
|
||||
|
||||
@ -8,7 +8,6 @@ function index()
|
||||
end
|
||||
|
||||
local page
|
||||
|
||||
page = entry({"admin", "network", "easymesh"}, cbi("easymesh"), _("EASY MESH"), 60)
|
||||
page.dependent = true
|
||||
page.acl_depends = { "luci-app-easymesh" }
|
||||
|
0
package/lean/luci-app-easymesh/luasrc/model/cbi/easymesh.lua
Executable file → Normal file
0
package/lean/luci-app-easymesh/luasrc/model/cbi/easymesh.lua
Executable file → Normal file
0
package/lean/luci-app-easymesh/root/etc/config/easymesh
Executable file → Normal file
0
package/lean/luci-app-easymesh/root/etc/config/easymesh
Executable file → Normal file
@ -15,4 +15,3 @@ PKG_RELEASE:=6
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
module("luci.controller.familycloud", package.seeall)
|
||||
|
||||
function index()
|
||||
@ -9,15 +8,14 @@ function index()
|
||||
entry({"admin", "services", "familycloud"}, firstchild(), _("天翼家庭云/云盘提速"), 80).dependent = false
|
||||
|
||||
entry({"admin", "services", "familycloud", "general"}, cbi("familycloud/familycloud"), _("Base Setting"), 1)
|
||||
entry({"admin", "services", "familycloud", "log"}, form("familycloud/familycloudlog"), _("Log"), 2)
|
||||
entry({"admin", "services", "familycloud", "log"}, form("familycloud/familycloud_log"), _("Log"), 2)
|
||||
|
||||
entry({"admin", "services", "familycloud", "status"}, call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("ps | grep speedup.sh | grep -v grep >/dev/null")==0
|
||||
local e = {}
|
||||
e.running = luci.sys.call("ps | grep speedup.sh | grep -v grep >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
mp = Map("familycloud", translate("天翼家庭云/天翼云盘提速"))
|
||||
mp = Map("familycloud")
|
||||
mp.title = translate("天翼家庭云/天翼云盘提速")
|
||||
mp.description = translate("天翼家庭云/天翼云盘提速 (最高可达500Mbps)")
|
||||
|
||||
mp:section(SimpleSection).template = "familycloud/familycloud_status"
|
||||
mp:section(SimpleSection).template = "familycloud/familycloud_status"
|
||||
|
||||
s = mp:section(TypedSection, "familycloud")
|
||||
s.anonymous=true
|
||||
s.addremove=false
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
enabled = s:option(Flag, "enabled", translate("启用提速"))
|
||||
enabled.default = 0
|
||||
|
@ -9,6 +9,6 @@ t.rows = 15
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
t.readonly="readonly"
|
||||
t.readonly = "readonly"
|
||||
|
||||
return f
|
||||
return f
|
@ -19,4 +19,4 @@ XHR.poll(3, '<%=url([[admin]], [[services]], [[familycloud]], [[status]])%>', nu
|
||||
<p id="familycloud_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
@ -14,5 +14,3 @@ PKG_RELEASE:=2
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
||||
|
@ -15,5 +15,3 @@ PKG_RELEASE:=2
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
local o=require"luci.dispatcher"
|
||||
local e=require("luci.model.ipkg")
|
||||
local s=require"nixio.fs"
|
||||
local e=luci.model.uci.cursor()
|
||||
local i="frp"
|
||||
local o = require"luci.dispatcher"
|
||||
local e = require("luci.model.ipkg")
|
||||
local s = require"nixio.fs"
|
||||
local e = luci.model.uci.cursor()
|
||||
local i = "frp"
|
||||
local a,t,e
|
||||
local n={}
|
||||
local n = {}
|
||||
|
||||
a = Map("frp")
|
||||
a.title = translate("Frp Setting")
|
||||
@ -195,14 +195,14 @@ end
|
||||
e = t:option(DummyValue,"remote_port",translate("Remote Port"))
|
||||
e.width = "10%"
|
||||
e.cfgvalue = function(t,b)
|
||||
local t=a.uci:get(i,b,"type")or""
|
||||
local t = a.uci:get(i,b,"type")or""
|
||||
if t==""or b==""then return""end
|
||||
if t=="http" then
|
||||
local b=a.uci:get(i,"common","vhost_http_port")or"" return b end
|
||||
local b = a.uci:get(i,"common","vhost_http_port")or"" return b end
|
||||
if t=="https" then
|
||||
local b=a.uci:get(i,"common","vhost_https_port")or"" return b end
|
||||
local b = a.uci:get(i,"common","vhost_https_port")or"" return b end
|
||||
if t=="tcp" or t=="udp" then
|
||||
local b=a.uci:get(i,b,"remote_port")or"" return b end
|
||||
local b = a.uci:get(i,b,"remote_port")or"" return b end
|
||||
end
|
||||
|
||||
e = t:option(DummyValue, "local_ip", translate("Local Host Address"))
|
||||
@ -225,7 +225,7 @@ end
|
||||
|
||||
e = t:option(DummyValue, "use_compression", translate("Use Compression"))
|
||||
e.width = "15%"
|
||||
e.cfgvalue=function(t,n)
|
||||
e.cfgvalue = function(t,n)
|
||||
local t = a.uci:get(i,n,"use_compression")or""
|
||||
local b
|
||||
if t==""or b==""then return""end
|
||||
|
@ -24,31 +24,31 @@ o.disabled = "false"
|
||||
o.defalut = o.enabled
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "tls_only", translate("Enforce frps only accept TLS connection"),
|
||||
translatef("Requirements: frpc v0.25.0+, frps v0.32.0+"))
|
||||
o = s:option(Flag, "tls_only", translate("Enforce frps only accept TLS connection"))
|
||||
o.description = translatef("Requirements: frpc v0.25.0+, frps v0.32.0+")
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
o.default = o.disabled
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "bind_udp_port", translate("UDP bind port"),
|
||||
translatef("Optional: udp port to help make udp hole to penetrate nat"))
|
||||
o = s:option(Value, "bind_udp_port", translate("UDP bind port"))
|
||||
o.description = translatef("Optional: udp port to help make udp hole to penetrate nat")
|
||||
o.datatype = "port"
|
||||
|
||||
o = s:option(Value, "kcp_bind_port", translate("KCP bind port"),
|
||||
translatef("Optional: udp port used for kcp protocol, it can be same with 'bind port'; if not set, kcp is disabled in frps"))
|
||||
o = s:option(Value, "kcp_bind_port", translate("KCP bind port"))
|
||||
o.description = translatef("Optional: udp port used for kcp protocol, it can be same with 'bind port'; if not set, kcp is disabled in frps")
|
||||
o.datatype = "port"
|
||||
|
||||
o = s:option(Value, "vhost_http_port", translate("vhost http port"),
|
||||
translatef("Optional: if you want to support virtual host, you must set the http port for listening"))
|
||||
o = s:option(Value, "vhost_http_port", translate("vhost http port"))
|
||||
o.description = translatef("Optional: if you want to support virtual host, you must set the http port for listening")
|
||||
o.datatype = "port"
|
||||
|
||||
o = s:option(Value, "vhost_https_port", translate("vhost https port"),
|
||||
translatef("Optional: Note: http port and https port can be same with bind_port"))
|
||||
o = s:option(Value, "vhost_https_port", translate("vhost https port"))
|
||||
o.description = translatef("Optional: Note: http port and https port can be same with bind_port")
|
||||
o.datatype = "port"
|
||||
|
||||
o = s:option(DynamicList, "extra_setting", translate("Extra Settings"),
|
||||
translatef("List of extra settings will be added to config file. Format: option=value, eg. <code>detailed_errors_to_client=false</code>.(NO SPACE!)"))
|
||||
o = s:option(DynamicList, "extra_setting", translate("Extra Settings"))
|
||||
o.description = translatef("List of extra settings will be added to config file. Format: option=value, eg. <code>detailed_errors_to_client=false</code>.(NO SPACE!)")
|
||||
o.placeholder = "option=value"
|
||||
|
||||
return m
|
0
package/lean/luci-app-frps/root/etc/init.d/frps
Normal file → Executable file
0
package/lean/luci-app-frps/root/etc/init.d/frps
Normal file → Executable file
0
package/lean/luci-app-frps/root/etc/uci-defaults/40_luci-frps
Normal file → Executable file
0
package/lean/luci-app-frps/root/etc/uci-defaults/40_luci-frps
Normal file → Executable file
@ -63,4 +63,3 @@ leasetime.default = "1h"
|
||||
leasetime.rmempty = true
|
||||
|
||||
return m
|
||||
|
||||
|
3
package/lean/luci-app-haproxy-tcp/luasrc/controller/haproxy.lua
Executable file → Normal file
3
package/lean/luci-app-haproxy-tcp/luasrc/controller/haproxy.lua
Executable file → Normal file
@ -1,8 +1,9 @@
|
||||
module("luci.controller.haproxy", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/haproxy") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "haproxy"}, cbi("haproxy"), _("HAProxy")).dependent = true
|
||||
end
|
||||
end
|
||||
|
47
package/lean/luci-app-haproxy-tcp/luasrc/model/cbi/haproxy.lua
Executable file → Normal file
47
package/lean/luci-app-haproxy-tcp/luasrc/model/cbi/haproxy.lua
Executable file → Normal file
@ -16,11 +16,11 @@ if haproxy_on then
|
||||
else
|
||||
state_msg = "<b><font color=\"red\">" .. translate("Not running") .. "</font></b>"
|
||||
end
|
||||
m=Map("haproxy",translate("HAProxy"),translate("HAProxy能够检测Shadowsocks服务器的连通情况,从而实现负载均衡和高可用的功能,支持主备用服务器宕机自动切换,并且可以设置多个主服务器用于分流,规定每个分流节点的流量比例等。前提条件是你的所有Shadowsocks服务器的【加密方式】和【密码】一致。<br><br>使用方法:配置好你的Shadowsocks服务器ip地址和端口,然后开启Shadowsocks服务,将服务器地址填写为【127.0.0.1】,端口【2222】,其他参数和之前一样即可,你可以通过访问【路由器的IP:1111/haproxy】输入用户名admin,密码root来观察各节点健康状况,红色为宕机,绿色正常,使用说明请<a href='http://www.right.com.cn/forum/thread-198649-1-1.html'>点击这里</a>") .. "<br><br>后台监控页面:<a href='http://" .. router_ip .. ":1111/haproxy'>" .. router_ip .. ":1111/haproxy</a> 用户名admin,密码root" .. "<br><br>状态 - " .. state_msg)
|
||||
s=m:section(TypedSection,"arguments","")
|
||||
s.addremove=false
|
||||
s.anonymous=true
|
||||
view_enable = s:option(Flag,"enabled",translate("Enable"))
|
||||
m = Map("haproxy", translate("HAProxy"), translate("HAProxy能够检测Shadowsocks服务器的连通情况,从而实现负载均衡和高可用的功能,支持主备用服务器宕机自动切换,并且可以设置多个主服务器用于分流,规定每个分流节点的流量比例等。前提条件是你的所有Shadowsocks服务器的【加密方式】和【密码】一致。<br><br>使用方法:配置好你的Shadowsocks服务器ip地址和端口,然后开启Shadowsocks服务,将服务器地址填写为【127.0.0.1】,端口【2222】,其他参数和之前一样即可,你可以通过访问【路由器的IP:1111/haproxy】输入用户名admin,密码root来观察各节点健康状况,红色为宕机,绿色正常,使用说明请<a href='http://www.right.com.cn/forum/thread-198649-1-1.html'>点击这里</a>") .. "<br><br>后台监控页面:<a href='http://" .. router_ip .. ":1111/haproxy'>" .. router_ip .. ":1111/haproxy</a> 用户名admin,密码root" .. "<br><br>状态 - " .. state_msg)
|
||||
s = m:section(TypedSection,"arguments","")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
view_enable = s:option(Flag, "enabled", translate("Enable"))
|
||||
--通过读写配置文件控制HAProxy这种方式已经弃用
|
||||
--view_cfg = s:option(TextValue, "1", nil)
|
||||
--view_cfg.rmempty = false
|
||||
@ -32,36 +32,37 @@ s=m:section(TypedSection,"arguments","")
|
||||
--function view_cfg.write(self, section, value)
|
||||
-- sync_value_to_file(value, "/etc/haproxy.cfg")
|
||||
--end
|
||||
s=m:section(TypedSection,"main_server","<b>" .. translate("Main Server List") .. "<b>")
|
||||
s.anonymous=true
|
||||
s.addremove=true
|
||||
o=s:option(Value,"server_name",translate("Display Name"),translate("Only English Characters,No spaces"))
|
||||
s = m:section(TypedSection, "main_server","<b>" .. translate("Main Server List") .. "<b>")
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
o = s:option(Value, "server_name", translate("Display Name"), translate("Only English Characters,No spaces"))
|
||||
o.rmempty = false
|
||||
|
||||
o=s:option(Flag,"validate",translate("validate"))
|
||||
o = s:option(Flag,"validate",translate("validate"))
|
||||
|
||||
o=s:option(Value,"server_ip",translate("Proxy Server IP"))
|
||||
o = s:option(Value, "server_ip", translate("Proxy Server IP"))
|
||||
|
||||
o=s:option(Value,"server_port",translate("Proxy Server Port"))
|
||||
o.datatype="uinteger"
|
||||
o=s:option(Value,"server_weight",translate("Weight"))
|
||||
o.datatype="uinteger"
|
||||
o = s:option(Value, "server_port", translate("Proxy Server Port"))
|
||||
o.datatype = "uinteger"
|
||||
o = s:option(Value, "server_weight", translate("Weight"))
|
||||
o.datatype = "uinteger"
|
||||
|
||||
s=m:section(TypedSection,"backup_server","<b>" .. translate("Backup Server List") .. "<b>")
|
||||
s.anonymous=true
|
||||
s.addremove=true
|
||||
o=s:option(Value,"server_name",translate("Display Name"),translate("Only English Characters,No spaces"))
|
||||
s = m:section(TypedSection,"backup_server","<b>" .. translate("Backup Server List") .. "<b>")
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
o = s:option(Value, "server_name", translate("Display Name"), translate("Only English Characters,No spaces"))
|
||||
o.rmempty = false
|
||||
|
||||
o=s:option(Flag,"validate",translate("validate"))
|
||||
o = s:option(Flag, "validate", translate("validate"))
|
||||
|
||||
o=s:option(Value,"server_ip",translate("Proxy Server IP"))
|
||||
o = s:option(Value, "server_ip", translate("Proxy Server IP"))
|
||||
|
||||
o=s:option(Value,"server_port",translate("Proxy Server Port"))
|
||||
o.datatype="uinteger"
|
||||
o = s:option(Value, "server_port", translate("Proxy Server Port"))
|
||||
o.datatype = "uinteger"
|
||||
-- ---------------------------------------------------
|
||||
local apply = luci.http.formvalue("cbi.apply")
|
||||
if apply then
|
||||
os.execute("/etc/haproxy_init.sh restart >/dev/null 2>&1 &")
|
||||
end
|
||||
|
||||
return m
|
||||
|
@ -14,5 +14,3 @@ PKG_RELEASE:=11
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
module("luci.controller.ipsec-server", package.seeall)
|
||||
|
||||
function index()
|
||||
@ -7,13 +6,13 @@ function index()
|
||||
end
|
||||
|
||||
entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
|
||||
entry({"admin", "vpn", "ipsec-server"}, cbi("ipsec-server/ipsec-server"), _("IPSec VPN Server"), 80).dependent = false
|
||||
entry({"admin", "vpn", "ipsec-server"}, cbi("ipsec-server"), _("IPSec VPN Server"), 80).dependent = false
|
||||
entry({"admin", "vpn", "ipsec-server", "status"}, call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("pgrep ipsec >/dev/null")==0
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pgrep ipsec >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
mp = Map("ipsec", translate("IPSec VPN Server"))
|
||||
mp = Map("ipsec")
|
||||
mp.title = translate("IPSec VPN Server")
|
||||
mp.description = translate("IPSec VPN connectivity using the native built-in VPN Client on iOS or Andriod (IKEv1 with PSK and Xauth)")
|
||||
|
||||
mp:section(SimpleSection).template = "ipsec/ipsec_status"
|
||||
mp:section(SimpleSection).template = "ipsec/ipsec_status"
|
||||
|
||||
s = mp:section(NamedSection, "ipsec", "service")
|
||||
s.anonymouse = true
|
@ -19,4 +19,4 @@ XHR.poll(3, '<%=url([[admin]], [[vpn]], [[ipsec-server]], [[status]])%>', null,
|
||||
<p id="ipsec_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
@ -1,6 +1,8 @@
|
||||
m = Map("kodexplorer", translate("KodExplorer"), translate(
|
||||
"KodExplorer is a fast and efficient private cloud and online document management system that provides secure, controllable, easy-to-use and highly customizable private cloud products for personal websites, enterprise private cloud deployment, network storage, online document management, and online office. With Windows style interface and operation habits, it can be used quickly without adaptation. It supports online preview of hundreds of common file formats and is extensible and easy to customize."))
|
||||
m:append(Template("kodexplorer/status"))
|
||||
m = Map("kodexplorer")
|
||||
m.title = translate("KodExplorer")
|
||||
m.description = translate("KodExplorer is a fast and efficient private cloud and online document management system that provides secure, controllable, easy-to-use and highly customizable private cloud products for personal websites, enterprise private cloud deployment, network storage, online document management, and online office. With Windows style interface and operation habits, it can be used quickly without adaptation. It supports online preview of hundreds of common file formats and is extensible and easy to customize.")
|
||||
|
||||
m:section(SimpleSection).template = "kodexplorer/kodexplorer_status"
|
||||
|
||||
s = m:section(TypedSection, "global", translate("Global Settings"))
|
||||
s.anonymous = true
|
||||
@ -14,41 +16,36 @@ o.datatype = "port"
|
||||
o.default = 8081
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "memory_limit", translate("Maximum memory usage"),
|
||||
translate(
|
||||
"If your device has a lot of memory, you can increase it."))
|
||||
o = s:option(Value, "memory_limit", translate("Maximum memory usage"))
|
||||
o.description = translate("If your device has a lot of memory, you can increase it.")
|
||||
o.default = "8M"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "post_max_size", translate("Maximum POST capacity"),
|
||||
translate(
|
||||
"This value cannot be greater than the maximum memory usage"))
|
||||
o = s:option(Value, "post_max_size", translate("Maximum POST capacity"))
|
||||
o.description = translate("This value cannot be greater than the maximum memory usage")
|
||||
o.default = "12M"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "upload_max_filesize",
|
||||
translate("Maximum memory usage for uploading files"), translate(
|
||||
"This value cannot be greater than the POST maximum capacity"))
|
||||
o = s:option(Value, "upload_max_filesize", translate("Maximum memory usage for uploading files"))
|
||||
o.description = translate("This value cannot be greater than the POST maximum capacity")
|
||||
o.default = "12M"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "storage_device_path", translate("Storage device path"),
|
||||
translate(
|
||||
"It is recommended to insert a usb flash drive or hard disk and enter the path. For example, /mnt/sda1/"))
|
||||
o = s:option(Value, "storage_device_path", translate("Storage device path"))
|
||||
o.description = translate("It is recommended to insert a usb flash drive or hard disk and enter the path. For example, /mnt/sda1/")
|
||||
o.default = "/mnt/sda1/"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "project_directory", translate("Project directory"),
|
||||
translate(
|
||||
"It is recommended to insert a usb flash drive or hard disk and enter the path. For example, /mnt/sda1/kodexplorer"))
|
||||
o = s:option(Value, "project_directory", translate("Project directory"))
|
||||
o.description = translate("It is recommended to insert a usb flash drive or hard disk and enter the path. For example, /mnt/sda1/kodexplorer")
|
||||
o.default = "/mnt/sda1/kodexplorer"
|
||||
o.rmempty = false
|
||||
|
||||
s:append(Template("kodexplorer/version"))
|
||||
s:section(SimpleSection).template = "kodexplorer/kodexplorer_version"
|
||||
|
||||
o = s:option(Button, "_download", translate("Manually update"), translate(
|
||||
"Make sure you have enough space.<br /><font style='color:red'>Be sure to fill out the device path and store path for the first run, and then save the application. Then manually download, otherwise can not use!</font>"))
|
||||
o.template = "kodexplorer/download"
|
||||
o = s:option(Button, "_download", translate("Manually update"))
|
||||
o.description = translate("Make sure you have enough space.<br /><font style='color:red'>Be sure to fill out the device path and store path for the first run, and then save the application. Then manually download, otherwise can not use!</font>")
|
||||
o.template = "kodexplorer/kodexplorer_download"
|
||||
o.inputstyle = "apply"
|
||||
o.btnclick = "downloadClick(this);"
|
||||
o.id = "download_btn"
|
||||
|
@ -172,4 +172,4 @@
|
||||
<% else %>
|
||||
-
|
||||
<% end %>
|
||||
<%+cbi/valuefooter%>
|
||||
<%+cbi/valuefooter%>
|
@ -35,4 +35,4 @@ local dsp = require "luci.dispatcher"
|
||||
var url = window.location.host+":<%=luci.sys.exec("uci -q get kodexplorer.@global[0].port"):gsub("^%s*(.-)%s*$", "%1")%>";
|
||||
window.open('http://'+url,'target','');
|
||||
}
|
||||
//]]></script>
|
||||
//]]></script>
|
@ -14,4 +14,4 @@ local app_version = api.get_version()
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
@ -15,4 +15,3 @@ PKG_RELEASE:=6
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
module("luci.controller.forked-daapd", package.seeall)
|
||||
|
||||
function index()
|
||||
@ -11,8 +10,8 @@ function index()
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("pgrep forked-daapd >/dev/null")==0
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pgrep forked-daapd >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
end
|
||||
|
@ -1,23 +1,25 @@
|
||||
-- Copyright 2020 Lean <coolsnowwolf@gmail.com>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
m = Map("forked-daapd", translate("Music Remote Center"), translate("Music Remote Center is a DAAP (iTunes Remote), MPD (Music Player Daemon) and RSP (Roku) media server."))
|
||||
m = Map("forked-daapd")
|
||||
m.title = translate("Music Remote Center")
|
||||
m.description = translate("Music Remote Center is a DAAP (iTunes Remote), MPD (Music Player Daemon) and RSP (Roku) media server.")
|
||||
|
||||
m:section(SimpleSection).template = "forked-daapd/forked-daapd_status"
|
||||
m:section(SimpleSection).template = "forked-daapd/forked-daapd_status"
|
||||
|
||||
s = m:section(TypedSection, "forked-daapd")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
enable=s:option(Flag, "enabled", translate("Enabled"))
|
||||
enable = s:option(Flag, "enabled", translate("Enabled"))
|
||||
enable.default = "0"
|
||||
enable.rmempty = false
|
||||
|
||||
port=s:option(Value, "port", translate("Port"))
|
||||
port = s:option(Value, "port", translate("Port"))
|
||||
port.rmempty = false
|
||||
port.datatype = "port"
|
||||
|
||||
db_path=s:option(Value, "db_path", translate("Database File Path"))
|
||||
db_path = s:option(Value, "db_path", translate("Database File Path"))
|
||||
db_path.default = "/opt/forked-daapd-songs3.db"
|
||||
db_path.rmempty = false
|
||||
|
||||
@ -25,7 +27,7 @@ directories=s:option(Value, "directories", translate("Music Directorie Path"))
|
||||
directories.default = "/opt/music"
|
||||
directories.rmempty = false
|
||||
|
||||
readme=s:option(DummyValue,"readme",translate("Readme"))
|
||||
readme.description=translate("About iOS Remote Pairing: <br />1. Open the web interface <br /> 2. Start iPhone Remote APP, go to Settings, Add Library<br />3. Enter the pair code in the web interface")
|
||||
readme = s:option(DummyValue, "readme", translate("Readme"))
|
||||
readme.description = translate("About iOS Remote Pairing: <br />1. Open the web interface <br /> 2. Start iPhone Remote APP, go to Settings, Add Library<br />3. Enter the pair code in the web interface")
|
||||
|
||||
return m
|
||||
return m
|
||||
|
@ -19,4 +19,4 @@ XHR.poll(3, '<%=url([[admin]], [[nas]], [[forked-daapd]], [[run]])%>', null,
|
||||
<p id="forked-daapd_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
@ -14,5 +14,3 @@ PKG_RELEASE:=3
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
||||
|
@ -15,8 +15,8 @@ function index()
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("pgrep mwan3dns >/dev/null")==0
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pgrep mwan3dns >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
m = Map("mwan3helper")
|
||||
m.title = translate("MWAN3 Helper")
|
||||
m.description = translate("MWAN3 Helper generate IPSets")
|
||||
|
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
m = Map("mwan3helper")
|
||||
m.title = translate("MWAN3 IPSets")
|
||||
|
||||
|
@ -19,4 +19,4 @@ XHR.poll(3, '<%=url([[admin]], [[services]], [[mwan3helper]], [[status]])%>', nu
|
||||
<p id="mwan3helper_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
@ -11,13 +11,13 @@ function index()
|
||||
end
|
||||
|
||||
entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
|
||||
entry({"admin", "vpn", "n2n_v2", "status"}, call("n2n_status")).leaf = true
|
||||
entry({"admin", "vpn", "n2n_v2", "status"}, call("act_status")).leaf = true
|
||||
entry({"admin", "vpn", "n2n_v2"}, cbi("n2n_v2"), _("N2N v2 VPN"), 45).dependent = true
|
||||
end
|
||||
|
||||
function n2n_status()
|
||||
local status = {}
|
||||
status.running = luci.sys.call("pgrep edge >/dev/null")==0
|
||||
function act_status()
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pgrep edge >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(status)
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
@ -22,12 +22,11 @@ function get_mask(v)
|
||||
v:value("30", "255.255.255.252(30)")
|
||||
end
|
||||
|
||||
m = Map("n2n_v2", translate("N2N v2 VPN"), translatef(
|
||||
"n2n is a layer-two peer-to-peer virtual private network (VPN) which allows users to exploit features typical of P2P applications at network instead of application level."))
|
||||
m = Map("n2n_v2")
|
||||
m.title = translate("N2N v2 VPN")
|
||||
m.description = translatef("n2n is a layer-two peer-to-peer virtual private network (VPN) which allows users to exploit features typical of P2P applications at network instead of application level.")
|
||||
|
||||
-- Basic config
|
||||
-- edge
|
||||
m:section(SimpleSection).template = "n2n_v2/status"
|
||||
m:section(SimpleSection).template = "n2n_v2/n2n_v2_status"
|
||||
|
||||
s = m:section(TypedSection, "edge", translate("N2N Edge Settings"))
|
||||
s.anonymous = true
|
||||
|
@ -0,0 +1,20 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(5, '<%=url([[admin]], [[vpn]], [[n2n_v2]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('n2n_v2_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
tb.innerHTML = "<em><b style='color:green;'>N2N v2 VPN <%:RUNNING%></b></em>";
|
||||
} else {
|
||||
tb.innerHTML = "<em><b style='color:red;'>N2N v2 VPN <%:NOT RUNNING%></b></em>";
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="n2n_v2_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
@ -1,20 +0,0 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(5, '<%=url([[admin]], [[vpn]], [[n2n_v2]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var status = document.getElementById('n2n_status');
|
||||
if (data && status) {
|
||||
if (data.running) {
|
||||
status.innerHTML = "<em><b style='color:green;'>N2N v2 VPN <%:RUNNING%></b></em>";
|
||||
} else {
|
||||
status.innerHTML = "<em><b style='color:red;'>N2N v2 VPN <%:NOT RUNNING%></b></em>";
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="n2n_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
@ -3,4 +3,4 @@ module("luci.controller.netdata", package.seeall)
|
||||
function index()
|
||||
|
||||
entry({"admin", "status", "netdata"}, template("netdata/netdata"), _("NetData"), 10).leaf = true
|
||||
end
|
||||
end
|
||||
|
@ -14,4 +14,3 @@ PKG_RELEASE:=1
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
0
package/lean/luci-app-nfs/root/etc/uci-defaults/luci-nfs
Normal file → Executable file
0
package/lean/luci-app-nfs/root/etc/uci-defaults/luci-nfs
Normal file → Executable file
@ -5,7 +5,7 @@ function index()
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "nps"}, cbi("nps"), _("Nps"), 100).dependent = true
|
||||
entry({"admin", "services", "nps"}, cbi("nps"), _("Nps Penetrate"), 100).dependent = true
|
||||
entry({"admin", "services", "nps", "status"}, call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
m = Map("nps")
|
||||
m.title = translate("Nps")
|
||||
m.title = translate("Nps Penetrate")
|
||||
m.description = translate("Nps is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.")
|
||||
|
||||
m:section(SimpleSection).template = "nps/nps_status"
|
||||
@ -43,12 +43,12 @@ crypt.description = translate("Encrypted the communication between Npc and Nps,
|
||||
crypt.default = "1"
|
||||
crypt.rmempty = false
|
||||
|
||||
log_level = s:option(ListValue,"log_level",translate("Log Level"))
|
||||
log_level:value(0,"Emergency", translate("Emergency"))
|
||||
log_level:value(2,"Critical", translate("Critical"))
|
||||
log_level:value(3,"Error", translate("Error"))
|
||||
log_level:value(4,"Warning", translate("Warning"))
|
||||
log_level:value(7,"Debug", translate("Debug"))
|
||||
log_level = s:option(ListValue, "log_level", translate("Log Level"))
|
||||
log_level:value("0", "Emergency")
|
||||
log_level:value("2", "Critical")
|
||||
log_level:value("3", "Error")
|
||||
log_level:value("4", "Warning")
|
||||
log_level:value("7", "Debug")
|
||||
log_level.default = "3"
|
||||
|
||||
return m
|
||||
|
0
package/lean/luci-app-nps/luasrc/view/nps/nps_status.htm
Executable file → Normal file
0
package/lean/luci-app-nps/luasrc/view/nps/nps_status.htm
Executable file → Normal file
@ -1,4 +1,4 @@
|
||||
msgid "Nps"
|
||||
msgid "Nps Penetrate"
|
||||
msgstr "Nps 内网穿透"
|
||||
|
||||
msgid "Nps is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet."
|
||||
|
0
package/lean/luci-app-nps/root/etc/config/nps
Executable file → Normal file
0
package/lean/luci-app-nps/root/etc/config/nps
Executable file → Normal file
@ -14,5 +14,3 @@ PKG_RELEASE:=2
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
||||
|
@ -6,4 +6,4 @@ function index()
|
||||
end
|
||||
|
||||
entry({"admin", "services", "pppoe-relay"}, cbi("pppoe-relay"), _("PPPoE Relay"), 90).dependent = true
|
||||
end
|
||||
end
|
||||
|
@ -1,19 +1,21 @@
|
||||
local s=require"luci.sys"
|
||||
local s = require"luci.sys"
|
||||
local net = require "luci.model.network".init()
|
||||
local ifaces = s.net:devices()
|
||||
local m,s,o
|
||||
|
||||
m=Map("pppoe-relay",translate("PPPoE Relay"))
|
||||
m = Map("pppoe-relay")
|
||||
m.title = translate("PPPoE Relay")
|
||||
m.description = translate("Opening the PPPoE relay allows devices in the Intranet to create a separate PPPoE connection that can cross NAT.")
|
||||
s=m:section(TypedSection,"service")
|
||||
s.addremove=true
|
||||
s.anonymous=true
|
||||
|
||||
s = m:section(TypedSection, "service")
|
||||
s.addremove = true
|
||||
s.anonymous = true
|
||||
s.template="cbi/tblsection"
|
||||
|
||||
o=s:option(Flag,"enabled",translate("Enabled"))
|
||||
o.rmempty=false
|
||||
o = s:option(Flag,"enabled",translate("Enabled"))
|
||||
o.rmempty = false
|
||||
|
||||
o=s:option(ListValue,"server_interface",translate("Server Interface"))
|
||||
o = s:option(ListValue, "server_interface", translate("Server Interface"))
|
||||
for _, iface in ipairs(ifaces) do
|
||||
if not (iface == "lo" or iface:match("^ifb.*") or iface:match("gre*")) then
|
||||
local nets = net:get_interface(iface)
|
||||
@ -25,9 +27,9 @@ for _, iface in ipairs(ifaces) do
|
||||
o:value(iface, ((#nets > 0) and "%s (%s)" % {iface, nets} or iface))
|
||||
end
|
||||
end
|
||||
o.rmempty=true
|
||||
o.rmempty = true
|
||||
|
||||
o=s:option(ListValue,"client_interface",translate("Client Interface"))
|
||||
o = s:option(ListValue, "client_interface", translate("Client Interface"))
|
||||
for _, iface in ipairs(ifaces) do
|
||||
if not (iface == "lo" or iface:match("^ifb.*") or iface:match("gre*")) then
|
||||
local nets = net:get_interface(iface)
|
||||
@ -39,13 +41,13 @@ for _, iface in ipairs(ifaces) do
|
||||
o:value(iface, ((#nets > 0) and "%s (%s)" % {iface, nets} or iface))
|
||||
end
|
||||
end
|
||||
o.rmempty=true
|
||||
o.rmempty = true
|
||||
|
||||
o=s:option(Button,"is_run",translate("Check"))
|
||||
o = s:option(Button, "is_run", translate("Check"))
|
||||
function o.write(self, section)
|
||||
local server_interface = m.uci:get('pppoe-relay',section,"server_interface")
|
||||
local client_interface = m.uci:get('pppoe-relay',section,"client_interface")
|
||||
isrun=luci.sys.call("ps | grep '/usr/sbin/pppoe-relay -S "..server_interface.." -C "..client_interface.."' | grep -v 'grep' >/dev/null")
|
||||
isrun = luci.sys.call("ps | grep '/usr/sbin/pppoe-relay -S "..server_interface.." -C "..client_interface.."' | grep -v 'grep' >/dev/null")
|
||||
if isrun == 1 then
|
||||
o.description = "<script>alert('"..translate("NOT RUNNING").."');</script>"
|
||||
else
|
||||
|
@ -15,7 +15,3 @@ PKG_RELEASE:=13
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
module("luci.controller.pptp-server", package.seeall)
|
||||
|
||||
function index()
|
||||
@ -6,14 +5,14 @@ function index()
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
|
||||
entry({"admin", "vpn", "pptp-server"}, cbi("pptp-server/pptp-server"), _("PPTP VPN Server"), 80).dependent=false
|
||||
entry({"admin", "vpn", "pptp-server","status"},call("act_status")).leaf=true
|
||||
entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
|
||||
entry({"admin", "vpn", "pptp-server"}, cbi("pptp-server"), _("PPTP VPN Server"), 80).dependent = false
|
||||
entry({"admin", "vpn", "pptp-server","status"},call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("pgrep pptpd >/dev/null")==0
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pgrep pptpd >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
mp = Map("pptpd", translate("PPTP VPN Server"))
|
||||
mp = Map("pptpd")
|
||||
mp.title = translate("PPTP VPN Server")
|
||||
mp.description = translate("PPTP VPN Server connectivity using the native built-in VPN Client on Windows/Linux or Andriod")
|
||||
|
||||
mp:section(SimpleSection).template = "pptp/pptp_status"
|
||||
mp:section(SimpleSection).template = "pptp-server/pptp-server_status"
|
||||
|
||||
s = mp:section(NamedSection, "pptpd", "service")
|
||||
s.anonymouse = true
|
||||
@ -15,8 +15,8 @@ localip = s:option(Value, "localip", translate("Local IP"))
|
||||
localip.datatype = "ip4addr"
|
||||
|
||||
clientip = s:option(Value, "remoteip", translate("Client IP"))
|
||||
clientip.datatype = "string"
|
||||
clientip.description = translate("LAN DHCP reserved start-to-end IP addresses with the same subnet mask")
|
||||
clientip.datatype = "string"
|
||||
|
||||
remotedns = s:option(Value, "remotedns", translate("Remote Client DNS"))
|
||||
remotedns.datatype = "ip4addr"
|
@ -1,7 +1,7 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[vpn]], [[pptp-server]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('pptp_status');
|
||||
var tb = document.getElementById('pptp-server_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
var links = '<em><b><font color=green>PPTP VPN Server <%:RUNNING%></font></b></em>';
|
||||
@ -16,7 +16,7 @@ XHR.poll(3, '<%=url([[admin]], [[vpn]], [[pptp-server]], [[status]])%>', null,
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="pptp_status">
|
||||
<p id="pptp-server_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
</fieldset>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user