luci-app-cjdns: import package from SeattleMeshnet/meshbox
[feed/routing.git] / 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 -- UDP Interfaces
37 udp_interfaces = m:section(TypedSection, "udp_interface", translate("UDP Interfaces"),
38 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>."))
39 udp_interfaces.anonymous = true
40 udp_interfaces.addremove = true
41 udp_interfaces.template = "cbi/tblsection"
42
43 udp_address = udp_interfaces:option(Value, "address", translate("IP Address"))
44 udp_address.placeholder = "0.0.0.0"
45 udp_interfaces:option(Value, "port", translate("Port")).datatype = "portrange"
46
47 -- Ethernet Interfaces
48 eth_interfaces = m:section(TypedSection, "eth_interface", translate("Ethernet Interfaces"),
49 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."))
50 eth_interfaces.anonymous = true
51 eth_interfaces.addremove = true
52 eth_interfaces.template = "cbi/tblsection"
53
54 eth_bind = eth_interfaces:option(Value, "bind", translate("Network Interface"))
55 eth_bind.placeholder = "br-lan"
56 eth_beacon = eth_interfaces:option(Value, "beacon", translate("Beacon Mode"))
57 eth_beacon:value(0, translate("0 -- Disabled"))
58 eth_beacon:value(1, translate("1 -- Accept beacons"))
59 eth_beacon:value(2, translate("2 -- Accept and send beacons"))
60 eth_beacon.default = 2
61 eth_beacon.datatype = "integer(range(0,2))"
62
63 return m