You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
3.0 KiB

  1. --[[
  2. LuCI - Lua Configuration Interface
  3. Copyright 2016 Toke Høiland-Jørgensen <toke@toke.dk>
  4. # This program is free software; you can redistribute it and/or modify it under
  5. # the terms of the GNU General Public License as published by the Free Software
  6. # Foundation; either version 3 of the License, or (at your option) any later
  7. # version.
  8. ]]--
  9. m = Map("acme", translate("ACME certificates"),
  10. translate("This configures ACME (Letsencrypt) automatic certificate installation. " ..
  11. "Simply fill out this to have the router configured with Letsencrypt-issued " ..
  12. "certificates for the web interface. " ..
  13. "Note that the domain names in the certificate must already be configured to " ..
  14. "point at the router's public IP address. " ..
  15. "Once configured, issuing certificates can take a while. " ..
  16. "Check the logs for progress and any errors."))
  17. s = m:section(TypedSection, "acme", translate("ACME global config"))
  18. s.anonymous = true
  19. st = s:option(Value, "state_dir", translate("State directory"),
  20. translate("Where certs and other state files are kept."))
  21. st.rmempty = false
  22. st.datatype = "directory"
  23. ae = s:option(Value, "account_email", translate("Account email"),
  24. translate("Email address to associate with account key."))
  25. ae.rmempty = false
  26. ae.datatype = "minlength(1)"
  27. d = s:option(Flag, "debug", translate("Enable debug logging"))
  28. d.rmempty = false
  29. cs = m:section(TypedSection, "cert", translate("Certificate config"))
  30. cs.anonymous = false
  31. cs.addremove = true
  32. e = cs:option(Flag, "enabled", translate("Enabled"))
  33. e.rmempty = false
  34. us = cs:option(Flag, "use_staging", translate("Use staging server"),
  35. translate("Get certificate from the Letsencrypt staging server " ..
  36. "(use for testing; the certificate won't be valid)."))
  37. us.rmempty = false
  38. kl = cs:option(Value, "keylength", translate("Key length"),
  39. translate("Number of bits (minimum 2048)."))
  40. kl.rmempty = false
  41. kl.datatype = "and(uinteger,min(2048))"
  42. u = cs:option(Flag, "update_uhttpd", translate("Use for uhttpd"),
  43. translate("Update the uhttpd config with this certificate once issued " ..
  44. "(only select this for one certificate)."))
  45. u.rmempty = false
  46. wr = cs:option(Value, "webroot", translate("Webroot directory"),
  47. translate("Webserver root directory. Set this to the webserver " ..
  48. "document root to run Acme in webroot mode. The web " ..
  49. "server must be accessible from the internet on port 80."))
  50. wr.rmempty = false
  51. dom = cs:option(DynamicList, "domains", translate("Domain names"),
  52. translate("Domain names to include in the certificate. " ..
  53. "The first name will be the subject name, subsequent names will be alt names. " ..
  54. "Note that all domain names must point at the router in the global DNS."))
  55. dom.datatype = "list(string)"
  56. return m