luci-app: tidy up code (#8277)

1.文件尾部添加换行并删除多余的换行

2.整理代码,看起来更直观

3.更正文件的权限

4.将一些文件的CR LF末行符全部转为LF
This commit is contained in:
Beginner 2021-11-21 14:48:21 +08:00 committed by GitHub
parent 3c36b75de5
commit 95f915abf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
155 changed files with 804 additions and 793 deletions

0
package/lean/ddns-scripts_dnspod/update_dnspod_cn.sh Normal file → Executable file
View File

0
package/lean/ddns-scripts_dnspod/update_dnspod_com.sh Normal file → Executable file
View File

0
package/lean/dns2socks/Makefile Executable file → Normal file
View File

0
package/lean/dsmboot/files/dsmboot Normal file → Executable file
View File

View File

View File

@ -15,4 +15,3 @@ PKG_RELEASE:=75
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -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

View File

@ -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

View File

@ -21,4 +21,3 @@ function f.handle(self, state, data)
end
return f

View File

@ -21,4 +21,3 @@ function f.handle(self, state, data)
end
return f

View File

@ -21,4 +21,3 @@ function f.handle(self, state, data)
end
return f

View File

@ -21,4 +21,3 @@ function f.handle(self, state, data)
end
return f

View File

@ -21,4 +21,3 @@ function f.handle(self, state, data)
end
return f

View File

@ -15,4 +15,3 @@ PKG_RELEASE:=10
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -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

View File

@ -1,7 +1,9 @@
-- 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"
@ -9,17 +11,17 @@ 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

View File

@ -12,4 +12,3 @@ LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -357,4 +357,3 @@ msgstr "已有文件将被覆盖,是否继续?"
msgid "Percentage"
msgstr "百分比"

View File

1
package/lean/luci-app-arpbind/Makefile Executable file → Normal file
View File

@ -15,4 +15,3 @@ PKG_RELEASE:=3
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -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

View File

@ -14,4 +14,3 @@ PKG_RELEASE:=8
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -1,4 +1,5 @@
module("luci.controller.autoreboot",package.seeall)
function index()
if not nixio.fs.access("/etc/config/autoreboot") then
return

View File

@ -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

View File

@ -4,4 +4,3 @@ config login
option hour '5'
option week '3'
option enable '0'

View File

@ -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

View File

@ -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

View File

View File

@ -1,4 +1,3 @@
module("luci.controller.cpufreq", package.seeall)
function index()

View File

@ -1,4 +1,5 @@
module("luci.controller.dnsforwarder", package.seeall)
function index()
if not nixio.fs.access("/etc/config/dnsforwarder") then
return

View File

@ -25,19 +25,20 @@ end
if dnsforwarder_on and string.sub(listen_port,1,14) == "127.0.0.1#5053" then
state_msg=state_msg .. "DNSmasq已经将流量定向至本软件"
state_msg = state_msg .. "DNSmasq已经将流量定向至本软件"
elseif dnsforwarder_on then
state_msg=state_msg .. "<b><font color=\"red\"></font></b>"
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>"
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使用效果更佳。默认上游服务器为114DNSSSR和Redsocks的GFWList模式要依赖本软件包提供的功能").. "<br><br>状态 - " .. state_msg)
s=m:section(TypedSection,"arguments", translate("通用配置"))
m = Map("dnsforwarder",translate("dnsforwarder"),translate("Dnsforwarder是企业级DNS服务器可以通过TCP协议进行DNS解析,可以方便的使用iptables进行透明代理配合ipset、GFWList使用效果更佳。默认上游服务器为114DNSSSR和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"))
@ -46,28 +47,28 @@ s.anonymous=true
view_addr.default = "127.0.0.1:5053"
-- ---------------------------------------------------
s1=m:section(TypedSection,"config",translate("标准配置"))
s1.addremove=false
s1.anonymous=true
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_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.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.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"
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([[&lt;IP1[:PORT],IP2[:PORT],...&gt; &lt;DOMAIN1,DOMAIN2,...&gt; &lt;on|PROXY1[:PORT],PROXY2[:PORT],...&gt;<br/>
TCP <br/>
@ -75,7 +76,7 @@ s1.anonymous=true
&lt;DOMAIN1,DOMAIN2,...&gt TCP <br/>
&lt;no|PROXY1[:PORT],PROXY2[:PORT],...&gt使 Socks5 使 1080 `no' 代表不使用代理]]))
tcp_group.placeholder = "8.8.8.8 * on"
tcp_group.default=tcp_group.placeholder
tcp_group.default = tcp_group.placeholder
udp_group = s1:option(DynamicList,"udp_group",translate("解析策略(UDP)"),translate([[&lt;IP1[:PORT],IP2[:PORT],...&gt; &lt;DOMAIN1,DOMAIN2,...&gt; &lt;on|off&gt;<br/>
UDP <br/>
&lt;IP1[:PORT],IP2[:PORT],...&gt UDP 使 53 <br/>
@ -83,11 +84,11 @@ s1.anonymous=true
&lt;on|off&gt`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
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"
group_file.datatype = "file"
s1:option(DummyValue,"nothing"," ",translate([[
<b>(TCP)&gt解析策略(UDP)&gt解析策略()</b><br/>
1.<br/>
@ -98,15 +99,15 @@ s1.anonymous=true
2.2 .
]]))
block_ip = s1:option(DynamicList,"block_ip",translate("DNS黑名单"),translate("阻挡含有以上 IP 地址的 DNS 数据包,IPv6 地址不用加方括号"))
block_ip.datatype="ipaddr"
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"
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>
@ -114,19 +115,19 @@ s1.anonymous=true
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"
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.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.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"
@ -134,9 +135,9 @@ s1.anonymous=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.default = "false"
cache_ignore.disabled = "false"
cache_ignore.enabled = "true"
cache_ignore:depends ({cache="true"})
cache_control = s1:option(DynamicList,"cache_control",translate("控制域名的缓存行为"),translate([[
&lt;DOMAIN&gt; [$ [$] ]&lt;TYPE&gt; [ARGUMENT]<br/>
@ -159,15 +160,15 @@ s1.anonymous=true
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"
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
view_cfg.readonly = true
function view_cfg.cfgvalue()
return nixio.fs.readfile(CONFIG_FILE) or ""

View File

@ -9,13 +9,13 @@ function sync_value_to_file(value, file)
end
end
m = Map("dnsforwarder", translate("运行日志"),translate("如果想观察日志需要在配置文件中写明LogOn true 和 LogFileFolder /var/log"))
s=m:section(TypedSection,"arguments","")
s.addremove=false
s.anonymous=true
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)
@ -25,7 +25,4 @@ gfwlist.cfgvalue = function(self, section)
return fs.readfile(log) or ""
end
return m

1
package/lean/luci-app-docker/Makefile Executable file → Normal file
View File

@ -15,4 +15,3 @@ PKG_RELEASE:=12
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,3 @@
config docker
option wan_mode '0'

0
package/lean/luci-app-easymesh/Makefile Executable file → Normal file
View File

View 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" }

View File

View File

View File

@ -15,4 +15,3 @@ PKG_RELEASE:=6
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -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

View File

@ -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"
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

View File

@ -9,6 +9,6 @@ t.rows = 15
function t.cfgvalue()
return fs.readfile(conffile) or ""
end
t.readonly="readonly"
t.readonly = "readonly"
return f

View File

@ -14,5 +14,3 @@ PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -15,5 +15,3 @@ PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -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

View File

@ -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
View File

View File

View File

@ -63,4 +63,3 @@ leasetime.default = "1h"
leasetime.rmempty = true
return m

View File

@ -1,4 +1,5 @@
module("luci.controller.haproxy", package.seeall)
function index()
if not nixio.fs.access("/etc/config/haproxy") then
return

View 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

View File

@ -14,5 +14,3 @@ PKG_RELEASE:=11
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -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

View File

@ -1,5 +1,5 @@
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"

View File

@ -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"

View File

@ -15,4 +15,3 @@ PKG_RELEASE:=6
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -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

View File

@ -1,7 +1,9 @@
-- 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"
@ -9,15 +11,15 @@ 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

View File

@ -14,5 +14,3 @@ PKG_RELEASE:=3
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -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

View File

@ -1,5 +1,3 @@
m = Map("mwan3helper")
m.title = translate("MWAN3 Helper")
m.description = translate("MWAN3 Helper generate IPSets")

View File

@ -1,5 +1,3 @@
m = Map("mwan3helper")
m.title = translate("MWAN3 IPSets")

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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>

View File

@ -14,4 +14,3 @@ PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

View 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

View File

@ -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

View File

View 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
View File

View File

@ -14,5 +14,3 @@ PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -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

View File

@ -15,7 +15,3 @@ PKG_RELEASE:=13
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -1,4 +1,3 @@
module("luci.controller.pptp-server", package.seeall)
function index()
@ -7,13 +6,13 @@ function index()
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", "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

View File

@ -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"

View File

@ -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>

View File

@ -15,4 +15,3 @@ PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -11,8 +11,8 @@ function index()
end
function act_status()
local e={}
e.running=luci.sys.call("ps | grep ps3netsrv |grep -v grep >/dev/null") == 0
local e = {}
e.running = luci.sys.call("ps | grep ps3netsrv |grep -v grep >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -1,7 +1,9 @@
-- Copyright 2020 Lean <coolsnowwolf@gmail.com>
-- Licensed to the public under the Apache License 2.0.
m = Map("ps3netsrv", translate("PS3 NET Server"), translate("PS3NETSRV is ISO/PKG server for Sony PlayStation 3 webMAN-MOD plugin"))
m = Map("ps3netsrv")
m.title = translate("PS3 NET Server")
m.description = translate("PS3NETSRV is ISO/PKG server for Sony PlayStation 3 webMAN-MOD plugin")
m:section(SimpleSection).template = "ps3netsrv/ps3netsrv_status"
@ -9,15 +11,15 @@ s = m:section(TypedSection, "ps3netsrv")
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
db_path=s:option(Value, "dir", translate("Dir Path"))
db_path = s:option(Value, "dir", translate("Dir Path"))
db_path.default = "/root"
db_path.rmempty = false
port=s:option(Value, "port", translate("Port"))
port = s:option(Value, "port", translate("Port"))
port.rmempty = false
port.datatype = "port"

View File

@ -13,5 +13,3 @@ PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -16,8 +16,8 @@ h = s:taboption("general", Flag, "homes", translate("Share home-directories"),
"network shares"))
h.rmempty = false
macos = s:taboption("general", Flag, "macos", translate("Enable macOS compatible shares"),
translate("Enables Apple's AAPL extension globally and adds macOS compatibility options to all shares."))
macos = s:taboption("general", Flag, "macos", translate("Enable macOS compatible shares"))
macos.description = translate("Enables Apple's AAPL extension globally and adds macOS compatibility options to all shares.")
macos.rmempty = false
if nixio.fs.access("/usr/sbin/nmbd") then

View File

@ -15,5 +15,3 @@ PKG_RELEASE:=7
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -11,8 +11,8 @@ function index()
end
function act_status()
local e={}
e.running=luci.sys.call("ps -w | grep ssrs.json |grep -v grep >/dev/null") == 0
local e = {}
e.running = luci.sys.call("ps -w | grep ssrs.json |grep -v grep >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -1,7 +1,7 @@
local a,t,e
local m, s
local o=require"nixio.fs"
local n={
local o = require"nixio.fs"
local n = {
"none",
"aes-128-ctr",
"aes-192-ctr",
@ -15,7 +15,8 @@ local n={
"chacha20",
"chacha20-ietf-poly1305",
}
local s={
local s = {
"origin",
"verify_deflate",
"auth_sha1_v4",
@ -28,6 +29,7 @@ local s={
"auth_chain_e",
"auth_chain_f",
}
local i={
"plain",
"http_simple",
@ -36,42 +38,44 @@ local i={
"tls1.2_ticket_auth",
"tls1.2_ticket_fastauth",
}
local o={
"false",
"true",
}
a= Map("ssrs", translate("ShadowSocksR Server Config"))
a = Map("ssrs")
a.title = translate("ShadowSocksR Server Config")
a.description = translate("ShadowsocksR Python Server is a fork of the Shadowsocks project, claimed to be superior in terms of security and stability")
a:section(SimpleSection).template = "ssrs/ssrs_status"
t=a:section(TypedSection,"server",translate(""))
t.anonymous=true
t.addremove=false
t = a:section(TypedSection,"server",translate(""))
t.anonymous = true
t.addremove = false
e=t:option(Flag,"enable",translate("Enable"))
e.rmempty=false
e = t:option(Flag, "enable", translate("Enable"))
e.rmempty = false
e=t:option(Value,"server_port",translate("Server Port"))
e.datatype="port"
e.rmempty=false
e.default=139
e = t:option(Value, "server_port", translate("Server Port"))
e.datatype = "port"
e.rmempty = false
e.default = 139
e=t:option(Value,"password",translate("Password"))
e.password=true
e.rmempty=false
e = t:option(Value, "password", translate("Password"))
e.password = true
e.rmempty = false
e=t:option(ListValue,"encrypt_method",translate("Encrypt Method"))
e = t:option(ListValue, "encrypt_method", translate("Encrypt Method"))
for a,t in ipairs(n)do e:value(t)end
e.rmempty=false
e.rmempty = false
e=t:option(ListValue,"protocol",translate("Protocol"))
e = t:option(ListValue, "protocol", translate("Protocol"))
for a,t in ipairs(s)do e:value(t)end
e.rmempty=false
e.rmempty = false
e=t:option(ListValue,"obfs",translate("Obfs"))
e = t:option(ListValue,"obfs",translate("Obfs"))
for a,t in ipairs(i)do e:value(t)end
e.rmempty=false
e.rmempty = false
return a

1
package/lean/luci-app-syncdial/Makefile Executable file → Normal file
View File

@ -14,4 +14,3 @@ PKG_RELEASE:=25
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
#Makefile for syncdial

View File

@ -1,4 +1,5 @@
module("luci.controller.syncdial",package.seeall)
function index()
if not nixio.fs.access("/etc/config/syncdial") then
return

View File

@ -1,62 +1,89 @@
local e=require"nixio.fs"
local e = require"nixio.fs"
require("luci.tools.webadmin")
local e="mwan3 status | grep -c \"is online and tracking is active\""
local e=io.popen(e,"r")
local t=e:read("*a")
local e = "mwan3 status | grep -c \"is online and tracking is active\""
local e = io.popen(e,"r")
local t = e:read("*a")
e:close()
m=Map("syncdial",translate("多线多拨"),
translate("使用macvlan驱动创建多个虚拟WAN口支持并发多拨 <br />当前在线接口数量:")..t)
s=m:section(TypedSection,"syncdial",translate(" "))
s.anonymous=true
o=s:option(Flag,"enabled","启用")
o.rmempty=false
o=s:option(Flag,"syncon","启用并发多拨")
o.rmempty=false
o=s:option(ListValue,"dial_type",translate("多拨类型"))
o:value("1",translate("单线多拨"))
o:value("2",translate("双线多拨"))
o.rmempty=false
o=s:option(Value,"wanselect",translate("选择外网接口"),translate("指定要多拨的外网接口如wan"))
m = Map("syncdial")
m.title = translate("多线多拨")
m.description = translate("使用macvlan驱动创建多个虚拟WAN口支持并发多拨 <br />当前在线接口数量:")..t
s = m:section(TypedSection, "syncdial")
s.anonymous = true
o = s:option(Flag, "enabled", translate("启用"))
o.rmempty = false
o = s:option(Flag, "syncon", translate("启用并发多拨"))
o.rmempty = false
o = s:option(ListValue, "dial_type", translate("多拨类型"))
o:value("1", translate("单线多拨"))
o:value("2", translate("双线多拨"))
o.rmempty = false
o = s:option(Value, "wanselect", translate("选择外网接口"))
o.description = translate("指定要多拨的外网接口如wan")
luci.tools.webadmin.cbi_add_networks(o)
o.optional=false
o.rmempty=false
o=s:option(Value,"wannum","虚拟WAN接口数量")
o.datatype="range(0,249)"
o.optional=false
o.default=1
o=s:option(Flag,"bindwan","绑定物理接口")
o.rmempty=false
o=s:option(Value,"wanselect2",translate("选择第二个外网接口"),translate("<font color=\"red\">指定要多拨的第二个外网接口如wan2</font>"))
o.optional = false
o.rmempty = false
o = s:option(Value, "wannum", translate("虚拟WAN接口数量"))
o.datatype = "range(0,249)"
o.optional = false
o.default = 1
o = s:option(Flag, "bindwan", translate("绑定物理接口"))
o.rmempty = false
o = s:option(Value, "wanselect2", translate("选择第二个外网接口"))
o.description = translate("<font color=\"red\">指定要多拨的第二个外网接口如wan2</font>")
luci.tools.webadmin.cbi_add_networks(o)
o.optional=false
o:depends("dial_type","2")
o=s:option(Value,"wannum2",translate("第二条线虚拟WAN接口数量"),translate("设置第二条线的拨号数"))
o.datatype="range(0,249)"
o.optional=false
o.default=1
o = s:option(Value, "wannum2", translate("第二条线虚拟WAN接口数量"))
o.description = translate("设置第二条线的拨号数")
o.datatype = "range(0,249)"
o.optional = false
o.default = 1
o:depends("dial_type","2")
o=s:option(Flag,"bindwan2","绑定物理接口","第二条线生成的虚拟接口绑定当前物理接口")
o.rmempty=false
o = s:option(Flag, "bindwan2", translate("绑定物理接口"))
o.description = translate("第二条线生成的虚拟接口绑定当前物理接口")
o.rmempty = false
o:depends("dial_type","2")
o=s:option(Flag,"dialchk","启用掉线检测")
o.rmempty=false
o=s:option(Value,"dialnum","最低在线接口数量","如果在线接口数量小于这个值则重拨。")
o.datatype="range(0,248)"
o.optional=false
o.default=2
o=s:option(Value,"dialnum2","第二条线最低在线接口数量","如果第二条线在线接口数量小于这个值则重拨。")
o.datatype="range(0,248)"
o.optional=false
o.default=2
o = s:option(Flag, "dialchk", translate("启用掉线检测"))
o.rmempty = false
o = s:option(Value, "dialnum", translate("最低在线接口数量"))
o.description = translate("如果在线接口数量小于这个值则重拨。")
o.datatype = "range(0,248)"
o.optional = false
o.default = 2
o = s:option(Value, "dialnum2", translate("第二条线最低在线接口数量"))
o.description = translate("如果第二条线在线接口数量小于这个值则重拨。")
o.datatype = "range(0,248)"
o.optional = false
o.default = 2
o:depends("dial_type","2")
o=s:option(Value,"dialwait","重拨等待时间","重拨时,接口全部下线后下一次拨号前的等待时间。单位:秒 最小值5秒")
o.datatype="and(uinteger,min(5))"
o.optional=false
o=s:option(Flag,"old_frame","使用旧的macvlan创建方式")
o.rmempty=false
o=s:option(Flag,"nomwan","不自动配置MWAN3负载均衡","需要自定义负载均衡设置或者要使用策略路由的用户选择")
o.rmempty=false
o=s:option(DummyValue,"_redial","重新并发拨号")
o.template="syncdial/redial_button"
o.width="10%"
o = s:option(Value, "dialwait", translate("重拨等待时间"))
o.description = translate("重拨时,接口全部下线后下一次拨号前的等待时间。单位:秒 最小值5秒")
o.datatype = "and(uinteger,min(5))"
o.optional = false
o = s:option(Flag, "old_frame", translate("使用旧的macvlan创建方式"))
o.rmempty = false
o = s:option(Flag, "nomwan", translate("不自动配置MWAN3负载均衡"))
o.description = translate("需要自定义负载均衡设置或者要使用策略路由的用户选择")
o.rmempty = false
o = s:option(DummyValue, "_redial", translate("重新并发拨号"))
o.template = "syncdial/redial_button"
o.width = "10%"
return m

View File

View File

View File

@ -14,4 +14,3 @@ PKG_RELEASE:=3
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

Some files were not shown because too many files have changed in this diff Show More