luci-app-olsr: handle empty result for non-status tables
[oweals/luci.git] / modules / luci-mod-system / luasrc / model / cbi / admin_system / dropbear.lua
1 -- Copyright 2008 Steven Barth <steven@midlink.org>
2 -- Copyright 2011-2018 Jo-Philipp Wich <jo@mein.io>
3 -- Licensed to the public under the Apache License 2.0.
4
5 m = Map("dropbear", translate("SSH Access"),
6         translate("Dropbear offers <abbr title=\"Secure Shell\">SSH</abbr> network shell access and an integrated <abbr title=\"Secure Copy\">SCP</abbr> server"))
7 m.apply_on_parse = true
8
9 s = m:section(TypedSection, "dropbear", translate("Dropbear Instance"))
10 s.anonymous = true
11 s.addremove = true
12
13
14 ni = s:option(Value, "Interface", translate("Interface"),
15         translate("Listen only on the given interface or, if unspecified, on all"))
16
17 ni.template    = "cbi/network_netlist"
18 ni.nocreate    = true
19 ni.unspecified = true
20
21
22 pt = s:option(Value, "Port", translate("Port"),
23         translate("Specifies the listening port of this <em>Dropbear</em> instance"))
24
25 pt.datatype = "port"
26 pt.default  = 22
27
28
29 pa = s:option(Flag, "PasswordAuth", translate("Password authentication"),
30         translate("Allow <abbr title=\"Secure Shell\">SSH</abbr> password authentication"))
31
32 pa.enabled  = "on"
33 pa.disabled = "off"
34 pa.default  = pa.enabled
35 pa.rmempty  = false
36
37
38 ra = s:option(Flag, "RootPasswordAuth", translate("Allow root logins with password"),
39         translate("Allow the <em>root</em> user to login with password"))
40
41 ra.enabled  = "on"
42 ra.disabled = "off"
43 ra.default  = ra.enabled
44
45
46 gp = s:option(Flag, "GatewayPorts", translate("Gateway ports"),
47         translate("Allow remote hosts to connect to local SSH forwarded ports"))
48
49 gp.enabled  = "on"
50 gp.disabled = "off"
51 gp.default  = gp.disabled
52
53 return m