Add support for miniupnpd and cjdns
[librecmc/package-feed.git] / net / luci-app-cjdns / luasrc / model / cbi / cjdns / settings.lua
1 m = Map("cjdns", translate("cjdns"),
2   translate("Implements an encrypted IPv6 network using public-key \
3     cryptography for address allocation and a distributed hash table for \
4     routing. This provides near-zero-configuration networking, and prevents \
5     many of the security and scalability issues that plague existing \
6     networks."))
7
8 m.on_after_commit = function(self)
9   os.execute("/etc/init.d/cjdns restart")
10 end
11
12 s = m:section(NamedSection, "cjdns", nil, translate("Settings"))
13 s.addremove = false
14
15 -- Identity
16 s:tab("identity", translate("Identity"))
17 node6 = s:taboption("identity", Value, "ipv6", translate("IPv6 address"),
18       translate("This node's IPv6 address within the cjdns network."))
19 node6.datatype = "ip6addr"
20 pbkey = s:taboption("identity", Value, "public_key", translate("Public key"),
21       translate("Used for packet encryption and authentication."))
22 pbkey.datatype = "string"
23 prkey = s:taboption("identity", Value, "private_key", translate("Private key"),
24       translate("Keep this private. When compromised, generate a new keypair and IPv6."))
25 prkey.datatype = "string"
26
27 -- Admin Interface
28 s:tab("admin", translate("Admin API"), translate("The Admin API can be used by other applications or services to configure and inspect cjdns' routing and peering.<br/><br/>Documentation: <a href=\"https://github.com/cjdelisle/cjdns/tree/master/admin#cjdns-admin-api\">admin/README.md</a>"))
29 aip = s:taboption("admin", Value, "admin_address", translate("IP Address"),
30       translate("IPv6 addresses should be entered like so: <code>[2001::1]</code>."))
31 apt = s:taboption("admin", Value, "admin_port", translate("Port"))
32 apt.datatype = "port"
33 apw = s:taboption("admin", Value, "admin_password", translate("Password"))
34 apw.datatype = "string"
35
36 -- Security
37 s:tab("security", translate("Security"), translate("Functionality related to hardening the cjdroute process."))
38 s:taboption("security", Flag, "seccomp", translate("SecComp sandboxing"))
39
40 -- UDP Interfaces
41 udp_interfaces = m:section(TypedSection, "udp_interface", translate("UDP Interfaces"),
42   translate("These interfaces allow peering via public IP networks, such as the Internet, or many community-operated wireless networks. IPv6 addresses should be entered with square brackets, like so: <code>[2001::1]</code>."))
43 udp_interfaces.anonymous = true
44 udp_interfaces.addremove = true
45 udp_interfaces.template = "cbi/tblsection"
46
47 udp_address = udp_interfaces:option(Value, "address", translate("IP Address"))
48 udp_address.placeholder = "0.0.0.0"
49 udp_interfaces:option(Value, "port", translate("Port")).datatype = "portrange"
50
51 -- Ethernet Interfaces
52 eth_interfaces = m:section(TypedSection, "eth_interface", translate("Ethernet Interfaces"),
53   translate("These interfaces allow peering via local Ethernet networks, such as home or office networks, or phone tethering. If an interface name is set to \"all\" each available device will be used."))
54 eth_interfaces.anonymous = true
55 eth_interfaces.addremove = true
56 eth_interfaces.template = "cbi/tblsection"
57
58 eth_bind = eth_interfaces:option(Value, "bind", translate("Network Interface"))
59 eth_bind.placeholder = "br-lan"
60 eth_beacon = eth_interfaces:option(Value, "beacon", translate("Beacon Mode"))
61 eth_beacon:value(0, translate("0 -- Disabled"))
62 eth_beacon:value(1, translate("1 -- Accept beacons"))
63 eth_beacon:value(2, translate("2 -- Accept and send beacons"))
64 eth_beacon.default = 2
65 eth_beacon.datatype = "integer(range(0,2))"
66
67 return m