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