summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-acme
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-acme')
-rw-r--r--applications/luci-app-acme/htdocs/luci-static/resources/view/acme.js21
1 files changed, 21 insertions, 0 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 66735b5d85..9dd0e23ff7 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
@@ -1,6 +1,7 @@
'use strict';
'require form';
'require fs';
+'require uci';
'require view';
return view.extend({
@@ -64,6 +65,26 @@ return view.extend({
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. " +