node-red-contrib-aedes 0.14.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # node-red-contrib-aedes Changelog
2
2
 
3
+ ## Jul 22, 2025, Version 0.15.0
4
+ ### Notable changes
5
+ - TLS configuration with local filess
6
+
3
7
  ## Jul 02, 2025, Version 0.14.0
4
8
  ### Breaking changes
5
9
  - Dependencies require NodeJS 20
package/README.md CHANGED
@@ -41,6 +41,19 @@ When your Node-RED server address is `https://yourserver/`, you can set the WebS
41
41
 
42
42
  You can also bind the WebSocket to the root `"/"` path and having `wss://yourserver/` WebSocket listening at port `443` (or `ws://yourserver/` at port `80`).
43
43
 
44
+ ## Version Compatibility
45
+
46
+ The current version requires **Node.js >= 20** and **Node-RED >= 3.0**.
47
+
48
+ If you are running an older Node.js version (e.g. on locked-down or legacy hardware), please use version **0.11.x** of this package.
49
+
50
+ To install the compatible version using the `version-11` dist-tag:
51
+ ```sh
52
+ npm install node-red-contrib-aedes@version-11
53
+ ```
54
+
55
+ For more details, see [issue #85](https://github.com/martin-doyle/node-red-contrib-aedes/issues/85).
56
+
44
57
  ## License
45
-
58
+
46
59
  Licensed under [MIT](./LICENSE).
package/aedes.html CHANGED
@@ -14,89 +14,142 @@
14
14
  limitations under the License.
15
15
  -->
16
16
 
17
- <script type="text/x-red" data-template-name="aedes broker">
18
- <div class="form-row">
19
- <label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
20
- <input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
21
- </div>
22
- <div class="form-row">
23
- <ul style="min-width: 600px; margin-bottom: 20px;" id="node-config-aedes-broker-tabs"></ul>
24
- </div>
25
- <div id="node-config-aedes-broker-tabs-content" style="min-height:150px;">
26
- <div id="aedes-broker-tab-connection" style="display:none">
27
- <div class="form-row">
28
- <label for="node-input-mqtt_port"><i class="fa fa-globe"></i> <span data-i18n="aedes-mqtt-broker.label.mqtt_port"></span></label>
29
- <input type="text" id="node-input-mqtt_port" data-i18n="[placeholder]aedes-mqtt-broker.placeholder.mqtt_port">
30
- </div>
31
- <div class="form-row">
32
- <label for="node-input-mqtt_ws_bind"><i class="fa fa-globe"></i> WS bind</label>
33
- <select id="node-input-mqtt_ws_bind" type="text" style="width:30%" text-center>
34
- <option value="path" default>path</option>
35
- <option value="port">port</option>
36
- </select>
37
- </div>
38
- <div class="form-row" id="node-input-mqtt_ws_path-label">
39
- <label for="node-input-mqtt_ws_path"><i class="fa fa-globe"></i> <span data-i18n="aedes-mqtt-broker.label.mqtt_ws_path"></label>
40
- <input type="text" id="node-input-mqtt_ws_path" data-i18n="[placeholder]aedes-mqtt-broker.placeholder.mqtt_ws_path">
41
- </div>
42
- <div class="form-row" id="node-input-mqtt_ws_port-label">
43
- <label for="node-input-mqtt_ws_port"><i class="fa fa-globe"></i> <span data-i18n="aedes-mqtt-broker.label.mqtt_ws_port"></label>
44
- <input type="text" id="node-input-mqtt_ws_port" data-i18n="[placeholder]aedes-mqtt-broker.placeholder.mqtt_ws_port">
45
- </div>
46
- <div class="form-row">
47
- <input type="checkbox" id="node-input-usetls" style="display: inline-block; width: auto; vertical-align: top;">
48
- <label for="node-input-usetls" style="width: auto" data-i18n="aedes-mqtt-broker.label.use-tls"></label>
49
- <div id="node-input-tls" class="hide">
50
- <div class="form-row">
51
- <label style="width: 120px;"><i class="fa fa-file-text-o"></i> <span data-i18n="aedes-mqtt-broker.label.cert"></span></label>
52
- <span class="tls-input-data">
53
- <label class="red-ui-button" for="node-input-certfile"><i class="fa fa-upload"></i> <span data-i18n="aedes-mqtt-broker.label.upload"></span></label>
54
- <input class="hide" type="file" id="node-input-certfile">
55
- <span id="tls-certname" style="width: calc(100% - 280px); overflow: hidden; line-height:34px; height:34px; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle;"> </span>
56
- <button class="red-ui-button red-ui-button-small" id="tls-button-cert-clear" style="margin-left: 10px"><i class="fa fa-times"></i></button>
57
- </span>
58
- <input type="hidden" id="node-input-certname">
59
- <input type="hidden" id="node-input-certdata">
60
- <input class="hide tls-input-path" style="width: calc(100% - 170px);" type="text" id="node-input-cert" data-i18n="[placeholder]aedes-mqtt-broker.placeholder.cert">
61
- </div>
62
- <div class="form-row">
63
- <label style="width: 120px;" for="node-input-key"><i class="fa fa-file-text-o"></i> <span data-i18n="aedes-mqtt-broker.label.key"></span></label>
64
- <span class="tls-input-data">
65
- <label class="red-ui-button" for="node-input-keyfile"><i class="fa fa-upload"></i> <span data-i18n="aedes-mqtt-broker.label.upload"></span></label>
66
- <input class="hide" type="file" id="node-input-keyfile">
67
- <span id="tls-keyname" style="width: calc(100% - 280px); overflow: hidden; line-height:34px; height:34px; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle;"> </span>
68
- <button class="red-ui-button red-ui-button-small" id="tls-button-key-clear" style="margin-left: 10px"><i class="fa fa-times"></i></button>
69
- </span>
70
- <input type="hidden" id="node-input-keyname">
71
- <input type="hidden" id="node-input-keydata">
72
- <input class="hide tls-input-path" style="width: calc(100% - 170px);" type="text" id="node-input-key" data-i18n="[placeholder]tls.placeholder.key">
73
- </div>
74
- </div>
75
- </div>
76
- <div class="form-row">
77
- <label for="node-input-persistence_bind"><i class="fa fa-globe"></i> <span data-i18n="aedes-mqtt-broker.label.persistence_bind"></label>
17
+ <script type="text/html" data-template-name="aedes broker">
18
+ <div class="form-row">
19
+ <label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
20
+ <input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
21
+ </div>
22
+ <div class="form-row">
23
+ <ul style="min-width: 600px; margin-bottom: 20px;" id="node-config-aedes-broker-tabs"></ul>
24
+ </div>
25
+ <div id="node-config-aedes-broker-tabs-content" style="min-height:150px;">
26
+ <div id="aedes-broker-tab-connection" style="display:none">
27
+ <div class="form-row">
28
+ <label for="node-input-mqtt_port"><i class="fa fa-globe"></i> <span
29
+ data-i18n="aedes-mqtt-broker.label.mqtt_port"></span></label>
30
+ <input type="text" id="node-input-mqtt_port"
31
+ data-i18n="[placeholder]aedes-mqtt-broker.placeholder.mqtt_port">
32
+ </div>
33
+ <div class="form-row">
34
+ <label for="node-input-mqtt_ws_bind"><i class="fa fa-globe"></i> WS bind</label>
35
+ <select id="node-input-mqtt_ws_bind" type="text" style="width:30%" text-center>
36
+ <option value="path" default>path</option>
37
+ <option value="port">port</option>
38
+ </select>
39
+ </div>
40
+ <div class="form-row" id="node-input-mqtt_ws_path-label">
41
+ <label for="node-input-mqtt_ws_path"><i class="fa fa-globe"></i> <span
42
+ data-i18n="aedes-mqtt-broker.label.mqtt_ws_path"></label>
43
+ <input type="text" id="node-input-mqtt_ws_path"
44
+ data-i18n="[placeholder]aedes-mqtt-broker.placeholder.mqtt_ws_path">
45
+ </div>
46
+ <div class="form-row" id="node-input-mqtt_ws_port-label">
47
+ <label for="node-input-mqtt_ws_port"><i class="fa fa-globe"></i> <span
48
+ data-i18n="aedes-mqtt-broker.label.mqtt_ws_port"></label>
49
+ <input type="text" id="node-input-mqtt_ws_port"
50
+ data-i18n="[placeholder]aedes-mqtt-broker.placeholder.mqtt_ws_port">
51
+ </div>
52
+ <div class="form-row">
53
+ <input type="checkbox" id="node-input-usetls"
54
+ style="display: inline-block; width: auto; vertical-align: top;">
55
+ <label for="node-input-usetls" style="width: auto" data-i18n="aedes-mqtt-broker.label.use-tls"></label>
56
+ <div id="node-input-tls" class="hide">
57
+ <div class="form-row" id="node-row-uselocalfiles">
58
+ <input type="checkbox" id="node-input-uselocalfiles"
59
+ style="display: inline-block; width: auto; vertical-align: top;">
60
+ <label for="node-input-uselocalfiles" style="width: 70%;"><span
61
+ data-i18n="aedes-mqtt-broker.label.use-local-files"></label>
62
+ </div>
63
+
64
+ <div class="form-row">
65
+ <label style="width: 120px;"><i class="fa fa-file-text-o"></i> <span
66
+ data-i18n="aedes-mqtt-broker.label.cert"></span></label>
67
+ <span class="tls-input-data">
68
+ <label class="red-ui-button" for="node-input-certfile"><i class="fa fa-upload"></i> <span
69
+ data-i18n="aedes-mqtt-broker.label.upload"></span></label>
70
+ <input class="hide" type="file" id="node-input-certfile">
71
+ <span id="tls-certname"
72
+ style="width: calc(100% - 280px); overflow: hidden; line-height:34px; height:34px; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle;">
73
+ </span>
74
+ <button type="button" class="red-ui-button red-ui-button-small" id="tls-button-cert-clear"
75
+ style="margin-left: 10px"><i class="fa fa-times"></i></button>
76
+ </span>
77
+ <input type="hidden" id="node-input-certname">
78
+ <input type="hidden" id="node-input-certdata">
79
+ <input class="hide tls-input-path" style="width: calc(100% - 170px);" type="text"
80
+ id="node-input-cert" data-i18n="[placeholder]aedes-mqtt-broker.placeholder.cert">
81
+ </div>
82
+
83
+ <div class="form-row">
84
+ <label style="width: 120px;" for="node-input-key"><i class="fa fa-file-text-o"></i> <span
85
+ data-i18n="aedes-mqtt-broker.label.key"></span></label>
86
+ <span class="tls-input-data">
87
+ <label class="red-ui-button" for="node-input-keyfile"><i class="fa fa-upload"></i> <span
88
+ data-i18n="aedes-mqtt-broker.label.upload"></span></label>
89
+ <input class="hide" type="file" id="node-input-keyfile">
90
+ <span id="tls-keyname"
91
+ style="width: calc(100% - 280px); overflow: hidden; line-height:34px; height:34px; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle;">
92
+ </span>
93
+ <button type="button" class="red-ui-button red-ui-button-small" id="tls-button-key-clear"
94
+ style="margin-left: 10px"><i class="fa fa-times"></i></button>
95
+ </span>
96
+ <input type="hidden" id="node-input-keyname">
97
+ <input type="hidden" id="node-input-keydata">
98
+ <input class="hide tls-input-path" style="width: calc(100% - 170px);" type="text"
99
+ id="node-input-key" data-i18n="[placeholder]aedes-mqtt-broker.placeholder.key">
100
+ </div>
101
+
102
+ <div class="form-row">
103
+ <label style="width: 120px;" for="node-input-ca"><i class="fa fa-file-text-o"></i> <span
104
+ data-i18n="aedes-mqtt-broker.label.ca"></span></label>
105
+ <span class="tls-input-data">
106
+ <label class="red-ui-button" for="node-input-cafile"><i class="fa fa-upload"></i> <span
107
+ data-i18n="aedes-mqtt-broker.label.upload"></span></label>
108
+ <input class="hide" type="file" title=" " id="node-input-cafile">
109
+ <span id="tls-caname"
110
+ style="width: calc(100% - 280px); overflow: hidden; line-height:34px; height:34px; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle;">
111
+ </span>
112
+ <button type="button" class="red-ui-button red-ui-button-small" id="tls-button-ca-clear"
113
+ style="margin-left: 10px"><i class="fa fa-times"></i></button>
114
+ </span>
115
+ <input type="hidden" id="node-input-caname">
116
+ <input type="hidden" id="node-input-cadata">
117
+ <input class="hide tls-input-path" style="width: calc(100% - 170px);" type="text" id="node-input-ca"
118
+ data-i18n="[placeholder]aedes-mqtt-broker.placeholder.ca">
119
+ </div>
120
+ </div>
121
+ </div>
122
+ </div>
123
+ <div id="aedes-broker-tab-persistence" style="display:none">
124
+ <div class="form-row">
125
+ <label for="node-input-persistence_bind"><i class="fa fa-globe"></i> <span
126
+ data-i18n="aedes-mqtt-broker.label.persistence_bind"></label>
78
127
  <select id="node-input-persistence_bind" type="text" style="width:30%" text-center>
79
128
  <option value="memory" data-i18n="aedes-mqtt-broker.label.persistence_memory" default></option>
80
129
  <option value="mongodb" data-i18n="aedes-mqtt-broker.label.persistence_mongodb"></option>
81
- <option value="level" data-i18n="aedes-mqtt-broker.label.persistence_level"></option>
130
+ <!-- <option value="level" data-i18n="aedes-mqtt-broker.label.persistence_level"></option> -->
82
131
  </select>
83
132
  </div>
84
- <div class="form-row" id="node-row-dburl" class="hide">
85
- <label for="node-input-dburl"><i class="fa fa-database"></i> <span data-i18n="aedes-mqtt-broker.label.dburl"></label>
86
- <input type="text" id="node-input-dburl" data-i18n="[placeholder]aedes-mqtt-broker.placeholder.dburl">
87
- </div>
88
- </div>
89
- <div id="aedes-broker-tab-security" style="display:none">
90
- <div class="form-row">
91
- <label for="node-input-username"><i class="fa fa-user"></i> <span data-i18n="node-red:common.label.username"></span></label>
92
- <input type="text" id="node-input-username" data-i18n="[placeholder]aedes-mqtt-broker.placeholder.username">
93
- </div>
94
- <div class="form-row">
95
- <label for="node-input-password"><i class="fa fa-lock"></i> <span data-i18n="node-red:common.label.password"></span></label>
96
- <input type="password" id="node-input-password" data-i18n="[placeholder]aedes-mqtt-broker.placeholder.password">
97
- </div>
98
- </div>
99
- </div>
133
+ <div class="form-row" id="node-row-dburl" class="hide">
134
+ <label for="node-input-dburl"><i class="fa fa-database"></i> <span
135
+ data-i18n="aedes-mqtt-broker.label.dburl"></label>
136
+ <input type="text" id="node-input-dburl" data-i18n="[placeholder]aedes-mqtt-broker.placeholder.dburl">
137
+ </div>
138
+ </div>
139
+ <div id="aedes-broker-tab-security" style="display:none">
140
+ <div class="form-row">
141
+ <label for="node-input-username"><i class="fa fa-user"></i> <span
142
+ data-i18n="node-red:common.label.username"></span></label>
143
+ <input type="text" id="node-input-username" data-i18n="[placeholder]aedes-mqtt-broker.placeholder.username">
144
+ </div>
145
+ <div class="form-row">
146
+ <label for="node-input-password"><i class="fa fa-lock"></i> <span
147
+ data-i18n="node-red:common.label.password"></span></label>
148
+ <input type="password" id="node-input-password"
149
+ data-i18n="[placeholder]aedes-mqtt-broker.placeholder.password">
150
+ </div>
151
+ </div>
152
+ </div>
100
153
  </script>
101
154
 
102
155
  <script type="text/javascript">
@@ -128,8 +181,10 @@
128
181
  return currentCert === '' || v !== '';
129
182
  }
130
183
  },
184
+ ca: {value:""},
131
185
  certname: { value: '' },
132
186
  keyname: { value: '' },
187
+ caname: {value:""},
133
188
  persistence_bind: { value: 'memory', required: true },
134
189
  dburl: { value: '', required: false },
135
190
  usetls: { value: false }
@@ -138,7 +193,8 @@
138
193
  username: { type: 'text' },
139
194
  password: { type: 'password' },
140
195
  certdata: { type: 'text' },
141
- keydata: { type: 'text' }
196
+ keydata: { type: 'text' },
197
+ cadata: {type:"text"}
142
198
  },
143
199
  color: '#d8bfd8',
144
200
  inputs: 0,
@@ -163,6 +219,10 @@
163
219
  id: 'aedes-broker-tab-connection',
164
220
  label: this._('aedes-mqtt-broker.tabs-label.connection')
165
221
  });
222
+ tabs.addTab({
223
+ id: 'aedes-broker-tab-persistence',
224
+ label: this._('aedes-mqtt-broker.tabs-label.persistence')
225
+ })
166
226
  tabs.addTab({
167
227
  id: 'aedes-broker-tab-security',
168
228
  label: this._('aedes-mqtt-broker.tabs-label.security')
@@ -226,7 +286,7 @@
226
286
  this.usetls = false;
227
287
  $('#node-input-usetls').prop('checked', false);
228
288
  }
229
- function updateTLSOptions () {
289
+ function updateTLSOptions() {
230
290
  if ($('#node-input-usetls').is(':checked')) {
231
291
  $('#node-input-tls').show();
232
292
  } else {
@@ -257,6 +317,9 @@
257
317
  $('#node-input-keyfile').on('change', function () {
258
318
  saveFile('key', this.files[0]);
259
319
  });
320
+ $("#node-input-cafile" ).on("change", function() {
321
+ saveFile("ca", this.files[0]);
322
+ });
260
323
  function clearNameData(prop) {
261
324
  $('#tls-' + prop + 'name').text('');
262
325
  $('#node-input-' + prop + 'data').val('');
@@ -268,10 +331,24 @@
268
331
  $('#tls-button-key-clear').on('click', function () {
269
332
  clearNameData('key');
270
333
  });
334
+ $("#tls-config-button-ca-clear").on("click", function() {
335
+ clearNameData("ca");
336
+ });
271
337
 
272
338
  function updateFileUpload() {
273
- $('.tls-input-data').show();
274
- $('.tls-input-path').hide();
339
+ if ($("#node-input-uselocalfiles").is(':checked')) {
340
+ $(".tls-input-path").show();
341
+ $(".tls-input-data").hide();
342
+ } else {
343
+ $(".tls-input-data").show();
344
+ $(".tls-input-path").hide();
345
+ }
346
+ }
347
+ $("#node-input-uselocalfiles").on("click",function() {
348
+ updateFileUpload();
349
+ });
350
+ if(this.cert || this.key || this.ca) {
351
+ $("#node-input-uselocalfiles").prop('checked',true);
275
352
  }
276
353
  $('#tls-certname').text(this.certname);
277
354
  $('#tls-keyname').text(this.keyname);
@@ -282,8 +359,15 @@
282
359
  if (!$('#node-input-usetls').is(':checked')) {
283
360
  $('#node-input-tls').val('');
284
361
  }
285
- $('#node-input-cert').val('');
286
- $('#node-input-key').val('');
362
+ if ($("#node-input-uselocalfiles").is(':checked')) {
363
+ clearNameData("ca");
364
+ clearNameData("cert");
365
+ clearNameData("key");
366
+ } else {
367
+ $("#node-input-ca").val("");
368
+ $("#node-input-cert").val("");
369
+ $("#node-input-key").val("");
370
+ }
287
371
  }
288
372
  });
289
- </script>
373
+ </script>