summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-acme/htdocs
diff options
context:
space:
mode:
authorSergey Ponomarev <stokito@gmail.com>2023-08-07 22:06:49 +0300
committerSergey Ponomarev <stokito@gmail.com>2023-08-08 00:44:18 +0300
commitf2f41446ceca8eb29ac744b1e2346b659ea00e2b (patch)
tree8c2ef29ca5cff1d5382fe8fc432aaf59ea70d3d7 /applications/luci-app-acme/htdocs
parent9486292d42c2bf8bd6a3495672b6174a9a438050 (diff)
luci-app-acme: Move use_staging and key_type to advanced tab
The options are useful only for experienced users. Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Diffstat (limited to 'applications/luci-app-acme/htdocs')
-rw-r--r--applications/luci-app-acme/htdocs/luci-static/resources/view/acme.js79
1 files changed, 42 insertions, 37 deletions
diff --git a/applications/luci-app-acme/htdocs/luci-static/resources/view/acme.js b/applications/luci-app-acme/htdocs/luci-static/resources/view/acme.js
index 9dd0e23ff7..6380fbe4b4 100644
--- a/applications/luci-app-acme/htdocs/luci-static/resources/view/acme.js
+++ b/applications/luci-app-acme/htdocs/luci-static/resources/view/acme.js
@@ -49,43 +49,6 @@ return view.extend({
o = s.taboption('general', form.Flag, "enabled", _("Enabled"));
o.rmempty = false;
- o = s.taboption('general', form.Flag, "use_staging", _("Use staging server"),
- _("Get certificate from the Letsencrypt staging server " +
- "(use for testing; the certificate won't be valid)."));
- o.rmempty = false;
- o.modalonly = true;
-
- o = s.taboption('general', form.ListValue, 'key_type', _("Key size"),
- _("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, set_value) {
- var 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 set_value;
- };
- o.write = function(section_id, value) {
- // remove old keylength
- uci.unset('acme', section_id, 'keylength');
- uci.set('acme', section_id, 'key_type', value);
- };
-
o = s.taboption('general', form.DynamicList, "domains", _("Domain names"),
_("Domain names to include in the certificate. " +
"The first name will be the subject name, subsequent names will be alt names. " +
@@ -159,6 +122,48 @@ return view.extend({
o.depends("validation_method", "dns");
o.modalonly = true;
+
+ o = s.taboption('advanced', form.Flag, 'use_staging', _('Use staging server'),
+ _(
+ 'Get certificate from the Letsencrypt staging server ' +
+ '(use for testing; the certificate won\'t be valid).'
+ )
+ );
+ o.rmempty = false;
+ o.modalonly = true;
+
+ o = s.taboption('advanced', form.ListValue, 'key_type', _('Key size'),
+ _('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, set_value) {
+ var 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 set_value;
+ };
+ o.write = function(section_id, value) {
+ // remove old keylength
+ uci.unset('acme', section_id, 'keylength');
+ uci.set('acme', section_id, 'key_type', value);
+ };
+
o = s.taboption('advanced', form.Flag, "use_acme_server",
_("Custom ACME CA"), _("Use a custom CA instead of Let's Encrypt."));
o.depends("use_staging", "0");