Skip to content

Commit

Permalink
feat(node/server): use CBIStaticList for tls cipher selection
Browse files Browse the repository at this point in the history
  • Loading branch information
1715173329 authored Oct 26, 2024
1 parent 83d0c7c commit f46782e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions htdocs/luci-static/resources/homeproxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ return baseclass.extend({
'1.3'
],

CBIStaticList: form.DynamicList.extend({
__name__: 'CBI.StaticList',

renderWidget: function(/* ... */) {
var dl = form.DynamicList.prototype.renderWidget.apply(this, arguments);
dl.querySelector('.add-item ul > li[data-value="-"]').remove();
return dl;
}
}),

calcStringMD5: function(e) {
/* Thanks to https://stackoverflow.com/a/41602636 */
function h(a, b) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/luci-static/resources/view/homeproxy/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ function renderNodeSettings(section, data, features, main_node, routing_mode) {
o.depends('tls', '1');
o.modalonly = true;

o = s.option(form.MultiValue, 'tls_cipher_suites', _('Cipher suites'),
o = s.option(hp.CBIStaticList, 'tls_cipher_suites', _('Cipher suites'),
_('The elliptic curves that will be used in an ECDHE handshake, in preference order. If empty, the default will be used.'));
for (var i of hp.tls_cipher_suites)
o.value(i);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/luci-static/resources/view/homeproxy/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ return view.extend({
o.depends('tls', '1');
o.modalonly = true;

o = s.option(form.MultiValue, 'tls_cipher_suites', _('Cipher suites'),
o = s.option(hp.CBIStaticList, 'tls_cipher_suites', _('Cipher suites'),
_('The elliptic curves that will be used in an ECDHE handshake, in preference order. If empty, the default will be used.'));
for (var i of hp.tls_cipher_suites)
o.value(i);
Expand Down

0 comments on commit f46782e

Please sign in to comment.