luci-app-vpnbypass: switch to luci-tree Makefile, i18n support
[project/luci.git] / applications / luci-app-fwknopd / luasrc / model / cbi / fwknopd.lua
1 -- Copyright 2015 Jonathan Bennett <jbennett@incomsystems.biz>
2 -- Licensed to the public under the GNU General Public License v2.
3
4 m = Map("fwknopd", translate("Firewall Knock Operator"))
5
6 s = m:section(TypedSection, "global", translate("Enable Uci/Luci control")) -- Set uci control on or off
7 s.anonymous=true
8 s:option(Flag, "uci_enabled", translate("Enable config overwrite"), translate("When unchecked, the config files in /etc/fwknopd will be used as is, ignoring any settings here."))
9 qr = s:option(DummyValue, "note0", "dummy")
10 qr.template = "fwknopd-qr"
11 qr:depends("uci_enabled", "1")
12
13 s = m:section(TypedSection, "access", translate("access.conf stanzas")) -- set the access.conf settings
14 s.anonymous=true
15 s.addremove=true
16 s.dynamic=true
17 s:option(Value, "SOURCE", "SOURCE", translate("Use ANY for any source ip"))
18 k1 = s:option(Value, "KEY", "KEY", translate("Define the symmetric key used for decrypting an incoming SPA packet that is encrypted by the fwknop client with Rijndael."))
19 k1:depends("keytype", translate("Normal Key"))
20 k2 = s:option(Value, "KEY_BASE64", "KEY_BASE64", translate("Define the symmetric key used for decrypting an incoming SPA \
21                                                 packet that is encrypted by the fwknop client with Rijndael."))
22 k2:depends("keytype", translate("Base 64 key"))
23 l1 = s:option(ListValue, "keytype", "Key type")
24 l1:value("Normal Key", "Normal Key")
25 l1:value("Base 64 key", "Base 64 key")
26 k3 = s:option(Value, "HMAC_KEY", "HMAC_KEY", "The hmac key")
27 k3:depends("hkeytype", "Normal Key")
28 k4 = s:option(Value, "HMAC_KEY_BASE64", "HMAC_KEY_BASE64", translate("The base64 hmac key"))
29 k4:depends("hkeytype", "Base 64 key")
30 l2 = s:option(ListValue, "hkeytype", "HMAC Key type")
31 l2:value("Normal Key", "Normal Key")
32 l2:value("Base 64 key", "Base 64 key")
33 s:option(Value, "OPEN_PORTS", "OPEN_PORTS", translate("Define a set of ports and protocols (tcp or udp) that will be opened if a valid knock sequence is seen. \
34                                         If this entry is not set, fwknopd will attempt to honor any proto/port request specified in the SPA data \
35                                         (unless of it matches any “RESTRICT_PORTS” entries). Multiple entries are comma-separated."))
36 s:option(Value, "FW_ACCESS_TIMEOUT", "FW_ACCESS_TIMEOUT", translate("Define the length of time access will be granted by fwknopd through the firewall after a \
37                                         valid knock sequence from a source IP address. If “FW_ACCESS_TIMEOUT” is not set then the default \
38                                         timeout of 30 seconds will automatically be set."))
39 s:option(Value, "REQUIRE_SOURCE_ADDRESS", "REQUIRE_SOURCE_ADDRESS", translate("Force all SPA packets to contain a real IP address within the encrypted data. \
40                                         This makes it impossible to use the -s command line argument on the fwknop client command line, so either -R \
41                                         has to be used to automatically resolve the external address (if the client behind a NAT) or the client must \
42                                         know the external IP and set it via the -a argument."))
43 s:option(DummyValue, "note1", translate("Enter custom access.conf variables below:"))
44
45 s = m:section(TypedSection, "config", translate("fwknopd.conf config options")) 
46 s.anonymous=true
47 s.dynamic=true
48 s:option(Value, "MAX_SPA_PACKET_AGE", "MAX_SPA_PACKET_AGE", translate("Maximum age in seconds that an SPA packet will be accepted. defaults to 120 seconds"))
49 s:option(Value, "PCAP_INTF", "PCAP_INTF", translate("Specify the ethernet interface on which fwknopd will sniff packets."))
50 s:option(Value, "ENABLE_IPT_FORWARDING", "ENABLE_IPT_FORWARDING", translate("Allow SPA clients to request access to services through an iptables firewall instead of just to it."))
51 s:option(DummyValue, "note2", translate("Enter custom fwknopd.conf variables below:"))
52
53 return m
54