Merge pull request #1375 from StevenHessing/luci-app-noddos
[project/luci.git] / applications / luci-app-noddos / luasrc / model / cbi / noddos.lua
1 -- Copyright 2017 Steven Hessing (steven.hessing@gmail.com)
2 -- This is free software, licensed under the GNU General Public License v3.
3 -- /usr/lib/lua/luci/model/cbi/noddos.lua
4
5 m = Map("noddos", translate("Client Firewall"),
6     translate("Noddos controls traffic from the clients on your network to the Internet. " ..
7         "This helps protect your network, the bandwidth on your Internet connection and " ..
8         "the Internet"))
9
10 s = m:section(TypedSection, "noddos", translate("Server Settings"))
11 s.anonymous = true
12 s.addremove = false
13
14 s:option(Flag, "rfc1918",
15     translate("Private networks"),
16     translate("Report traffic to private networks (10/8, 172.16/12, 192.168/16, fd75:6b5d:352c:ed05::/64)")).default=false
17
18 s:option(Flag, "upload",
19     translate("Upload anonimized traffic stats"),
20     translate("Uploading your statistics helps improving device recognition " ..
21         "and discovering hacked devices & botnets"))
22
23 o = s:option(DynamicList, "whitelistipv4",
24     translate("Excluded IPv4 addresses"),
25     translate("Don't monitor these IPv4 addresses"))
26 o.optional = true
27 o.placeholder = "127.0.0.1 192.168.1.1"
28 o.delimiter = " "
29 o.datatype="list(ip4addr)"
30
31 o = s:option(DynamicList, "whitelistipv6",
32     translate("Excluded IPv6 addresses"),
33     translate("Don't monitor these IPv6 addresses"))
34 o.optional = true
35 o.delimiter = " "
36 o.datatype="list(ip6addr)"
37
38 o = s:option(DynamicList, "whitelistmac",
39     translate("Excluded MAC addresses"),
40     translate("Don't monitor these MAC addresses"))
41 o.optional = true
42 o.delimiter = " "
43 o.datatype="list(macaddr)"
44
45 return m
46