iptunnel.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. uci = require "luci.model.uci"
  2. cursor = uci:cursor_state()
  3. m = Map("cjdns", translate("cjdns"),
  4. translate("Implements an encrypted IPv6 network using public-key \
  5. cryptography for address allocation and a distributed hash table for \
  6. routing. This provides near-zero-configuration networking, and prevents \
  7. many of the security and scalability issues that plague existing \
  8. networks."))
  9. m.on_after_commit = function(self)
  10. os.execute("/etc/init.d/cjdns restart")
  11. end
  12. -- Outgoing
  13. outgoing = m:section(TypedSection, "iptunnel_outgoing", translate("Outgoing IP Tunnel Connections"),
  14. translate("Enter the public keys of the nodes that will provide Internet access."))
  15. outgoing.anonymous = true
  16. outgoing.addremove = true
  17. outgoing.template = "cbi/tblsection"
  18. outgoing:option(Value, "public_key", translate("Public Key")).size = 55
  19. -- Allowed
  20. allowed = m:section(TypedSection, "iptunnel_allowed", translate("Allowed IP Tunnel Connections"),
  21. translate("Enter the public key of the node you will provide Internet access to, along with the \
  22. IPv4 and/or IPv6 address you will assign them."))
  23. allowed.anonymous = true
  24. allowed.addremove = true
  25. public_key = allowed:option(Value, "public_key", translate("Public Key"))
  26. public_key.template = "cjdns/value"
  27. public_key.size = 55
  28. ipv4 = allowed:option(Value, "ipv4", translate("IPv4"))
  29. ipv4.template = "cjdns/value"
  30. ipv4.datatype = 'ipaddr'
  31. ipv4.size = 55
  32. ipv6 = allowed:option(Value, "ipv6", translate("IPv6"),
  33. translate("IPv6 addresses should be entered <em>without</em> brackets here, e.g. <code>2001:123:ab::10</code>."))
  34. ipv6.template = "cjdns/value"
  35. ipv6.datatype = 'ip6addr'
  36. ipv6.size = 55
  37. return m