-
Notifications
You must be signed in to change notification settings - Fork 2.8k
luci-app-acme: support --cert-profile option #8187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ngehrsitz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tohojo There was no version to increment in the Makefile, is that not necessary here?
| o = s.taboption('advanced', form.Value, 'cert_profile', _('Certificate Profile')); | ||
| o.optional = true; | ||
| o.modalonly = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
order? It doesn't appear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This screenshot was captured without the change. My question was in general if you can control the order since the order here does not match the one in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order of what? The order the elements appear in? Code order = appearance order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the code it is:
- Keytype
luci/applications/luci-app-acme/htdocs/luci-static/resources/view/acme/acme.js
Lines 245 to 275 in 6efab68
o = s.taboption('advanced', form.ListValue, 'key_type', _('Key type'), _('Key size (and type) for the generated certificate.') ); o.value('rsa2048', _('RSA 2048 bits')); o.value('rsa3072', _('RSA 3072 bits')); o.value('rsa4096', _('RSA 4096 bits')); o.value('ec256', _('ECC 256 bits')); o.value('ec384', _('ECC 384 bits')); o.rmempty = false; o.optional = true; o.modalonly = true; o.cfgvalue = function(section_id) { let keylength = uci.get('acme', section_id, 'keylength'); if (keylength) { // migrate the old keylength to a new keytype switch (keylength) { case '2048': return 'rsa2048'; case '3072': return 'rsa3072'; case '4096': return 'rsa4096'; case 'ec-256': return 'ec256'; case 'ec-384': return 'ec384'; default: return ''; // bad value } } return this.super('cfgvalue', arguments); }; o.write = function(section_id, value) { // remove old keylength uci.unset('acme', section_id, 'keylength'); uci.set('acme', section_id, 'key_type', value); }; - URL
luci/applications/luci-app-acme/htdocs/luci-static/resources/view/acme/acme.js
Lines 277 to 284 in 6efab68
o = s.taboption('advanced', form.Value, "acme_server", _("ACME server URL"), _('Use a custom CA instead of Let\'s Encrypt.') + ' ' + _('Custom ACME server directory URL.') + '<br />' + '<a href="https://github.com/acmesh-official/acme.sh/wiki/Server" target="_blank">' + _('See more') + '</a>' + '<br />' + _('Default') + ' <code>letsencrypt</code>' ); o.placeholder = "https://api.buypass.com/acme/directory"; o.optional = true; o.modalonly = true; - Staging
luci/applications/luci-app-acme/htdocs/luci-static/resources/view/acme/acme.js
Lines 286 to 294 in 6efab68
o = s.taboption('advanced', form.Flag, 'staging', _('Use staging server'), _( 'Get certificate from the Letsencrypt staging server ' + '(use for testing; the certificate won\'t be valid).' ) ); o.depends('acme_server', ''); o.optional = true; o.modalonly = true; - Days
luci/applications/luci-app-acme/htdocs/luci-static/resources/view/acme/acme.js
Lines 296 to 300 in 6efab68
o = s.taboption('advanced', form.Value, 'days', _('Days until renewal')); o.optional = true; o.placeholder = 'acme.sh default (60 days)'; o.datatype = 'uinteger'; o.modalonly = true;
But in the Screenshot it´s
- Staging
- Keytype
- URL
- Days
Thus not the order it is defined in...
This comment has been minimized.
This comment has been minimized.
This makes the new --cert-profile option from openwrt/packages#28237 available in Luci. Signed-off-by: Norman Gehrsitz <git@gehrsitz.eu>
bd5be0f to
c186253
Compare
Failed checksIssues marked with an ❌ are failing checks. Commit c186253
For more details, see the full job log. Something broken? Consider providing feedback. |
|
@stokito any thoughts? |
|
Thank you for the PR, it looks good. Maybe only it would be better to add a description with a known profile names and with a link to LE profiles page. Also we may call the I think we should merge it but... The IP address cert is always was a questionable thing. In fact, even if you don't have a domain... well okay, get one for free from DDNS. But this is another tool to use and if we can avoid it, then yes the IP cert would be better. And still, a user must see some domain for a safety reason. Otherwise it will be easier to make a fishing attack. Not sure if browsers do allow the IP certs and maybe they are only for tools like wget/curl but even in this case why would you use them with a router. Ok, back to the PR. Can we get an IP cert without a profile (maybe just specify shorter days)? If yes, then lets just forget about profiles and make a single checkbox "IP addr cert". We also have a strict check for a domain name on the UI so a user anyway won't be able to issue such a cert. |
|
My use case for shortlived certs is that I want to notice any issues with my certificate automation as fast as possible. With 90 day certificates it can take a long time until I actually notice that it´s broken. With shortlived certs I can just monitor if the Certificate Transparency notifications come in every week. |
|
What does |
|
https://github.com/acmesh-official/acme.sh/wiki/Profile-selection @ngehrsitz please turn the PR from Draft so it can be merged. From code perspective all looks good, the feature looks like needed. You may ignore my ranting |
|
Merged. Thanks @ngehrsitz |

This makes the new
--cert-profileoption from openwrt/packages#28237 available using Luci.Signed-off-by: <my@email.address>row (viagit commit --signoff)<package name>: titlefirst line subject for packagesPKG_VERSIONin the Makefile