acme-cbi.lua 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 = "string"
  23. ae = s:option(Value, "account_email", translate("Account email"),
  24. translate("Email address to associate with account key."))
  25. ae.rmempty = false
  26. d = s:option(Flag, "debug", translate("Enable debug logging"))
  27. d.rmempty = false
  28. cs = m:section(TypedSection, "cert", translate("Certificate config"))
  29. cs.anonymous = false
  30. cs.addremove = true
  31. e = cs:option(Flag, "enabled", translate("Enabled"))
  32. e.rmempty = false
  33. us = cs:option(Flag, "use_staging", translate("Use staging server"),
  34. translate("Get certificate from the Letsencrypt staging server " ..
  35. "(use for testing; the certificate won't be valid)."))
  36. us.rmempty = false
  37. kl = cs:option(Value, "keylength", translate("Key length"),
  38. translate("Number of bits (minimum 2048)."))
  39. kl.rmempty = false
  40. kl.datatype = "and(uinteger,min(2048))"
  41. u = cs:option(Flag, "update_uhttpd", translate("Use for uhttpd"),
  42. translate("Update the uhttpd config with this certificate once issued " ..
  43. "(only select this for one certificate)."))
  44. u.rmempty = false
  45. dom = cs:option(DynamicList, "domains", translate("Domain names"),
  46. translate("Domain names to include in the certificate. " ..
  47. "The first name will be the subject name, subsequent names will be alt names. " ..
  48. "Note that all domain names must point at the router in the global DNS."))
  49. dom.datatype = "list(string)"
  50. return m