smart-home-engine 1.5.2 → 1.5.3
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/dist/web/assets/{index-2mEyVxdB.css → index-CTq7JERy.css} +1 -1
- package/dist/web/assets/{index-Dqazvoyw.js → index-D7MHM_y0.js} +70 -70
- package/dist/web/assets/{tsMode-I6dmzngW.js → tsMode-Da1DKsao.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/src/lib/mosquitto-conf.js +9 -2
- package/src/web/broker-api.js +10 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-
|
|
1
|
+
import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-D7MHM_y0.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
package/dist/web/index.html
CHANGED
|
@@ -172,10 +172,10 @@
|
|
|
172
172
|
}
|
|
173
173
|
})();
|
|
174
174
|
</script>
|
|
175
|
-
<script type="module" crossorigin src="/assets/index-
|
|
175
|
+
<script type="module" crossorigin src="/assets/index-D7MHM_y0.js"></script>
|
|
176
176
|
<link rel="modulepreload" crossorigin href="/assets/monaco-langs-BW2J83t5.js">
|
|
177
177
|
<link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
|
|
178
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
178
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CTq7JERy.css">
|
|
179
179
|
</head>
|
|
180
180
|
<body>
|
|
181
181
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@ const execFileAsync = promisify(execFile);
|
|
|
29
29
|
// NOTE: 'plugin_opt_dynsec_config_file' is kept here only for migration —
|
|
30
30
|
// when read from an old conf it is normalised to 'plugin_opt_config_file' on
|
|
31
31
|
// the same line that recognises it (see parseText below).
|
|
32
|
-
const MANAGED_SINGLE_KEYS = new Set(['allow_anonymous', 'persistence', 'persistence_location', 'log_dest', 'log_type', 'plugin', 'plugin_opt_config_file', 'plugin_opt_dynsec_config_file']);
|
|
32
|
+
const MANAGED_SINGLE_KEYS = new Set(['per_listener_settings', 'allow_anonymous', 'persistence', 'persistence_location', 'log_dest', 'log_type', 'plugin', 'plugin_opt_config_file', 'plugin_opt_dynsec_config_file']);
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Parse mosquitto.conf text into a structured object.
|
|
@@ -121,6 +121,7 @@ function isListenerSubkey(key) {
|
|
|
121
121
|
'use_identity_as_username',
|
|
122
122
|
'tls_version',
|
|
123
123
|
'websockets_log_level',
|
|
124
|
+
'allow_anonymous',
|
|
124
125
|
].includes(key);
|
|
125
126
|
}
|
|
126
127
|
|
|
@@ -143,6 +144,9 @@ function applyListenerKey(listener, key, value) {
|
|
|
143
144
|
case 'use_identity_as_username':
|
|
144
145
|
listener.tls.use_identity_as_username = value === 'true';
|
|
145
146
|
break;
|
|
147
|
+
case 'allow_anonymous':
|
|
148
|
+
listener.allow_anonymous = value === 'true';
|
|
149
|
+
break;
|
|
146
150
|
default:
|
|
147
151
|
break;
|
|
148
152
|
}
|
|
@@ -160,7 +164,7 @@ function serialise(conf) {
|
|
|
160
164
|
// Managed single-key entries first
|
|
161
165
|
const { managed = {}, listeners = [], passthrough = [] } = conf;
|
|
162
166
|
|
|
163
|
-
const keyOrder = ['allow_anonymous', 'persistence', 'persistence_location', 'log_dest', 'log_type', 'plugin', 'plugin_opt_config_file'];
|
|
167
|
+
const keyOrder = ['per_listener_settings', 'allow_anonymous', 'persistence', 'persistence_location', 'log_dest', 'log_type', 'plugin', 'plugin_opt_config_file'];
|
|
164
168
|
for (const key of keyOrder) {
|
|
165
169
|
if (managed[key] === undefined) continue;
|
|
166
170
|
const val = managed[key];
|
|
@@ -188,6 +192,9 @@ function serialise(conf) {
|
|
|
188
192
|
if (tls.use_identity_as_username !== undefined) {
|
|
189
193
|
lines.push(`use_identity_as_username ${tls.use_identity_as_username ? 'true' : 'false'}`);
|
|
190
194
|
}
|
|
195
|
+
if (l.allow_anonymous !== undefined) {
|
|
196
|
+
lines.push(`allow_anonymous ${l.allow_anonymous ? 'true' : 'false'}`);
|
|
197
|
+
}
|
|
191
198
|
lines.push('');
|
|
192
199
|
}
|
|
193
200
|
|
package/src/web/broker-api.js
CHANGED
|
@@ -77,7 +77,10 @@ function handleError(res, err) {
|
|
|
77
77
|
* MQTT client and stored in app.locals.mqttState.
|
|
78
78
|
*/
|
|
79
79
|
router.get('/status', (req, res) => {
|
|
80
|
+
const bc = getBrokerConfig(req);
|
|
80
81
|
const ds = dynsec.getStatus();
|
|
82
|
+
const sshConfigured = !!(bc.ssh && bc.ssh.host);
|
|
83
|
+
const sshHost = sshConfigured ? bc.ssh.host : null;
|
|
81
84
|
|
|
82
85
|
// Prefer $SYS data from the she-admin MQTT client: it has admin role ACLs
|
|
83
86
|
// that explicitly allow $SYS/# even when the main client is denied by
|
|
@@ -86,7 +89,12 @@ router.get('/status', (req, res) => {
|
|
|
86
89
|
// Fall back to the main MQTT client's state store for any topics not yet
|
|
87
90
|
// received by the dynsec client (e.g. when dynsec is not configured).
|
|
88
91
|
if (_store) {
|
|
89
|
-
const sysPrefixes = [
|
|
92
|
+
const sysPrefixes = [
|
|
93
|
+
'$SYS/broker/version', '$SYS/broker/uptime',
|
|
94
|
+
'$SYS/broker/clients/', '$SYS/broker/messages/',
|
|
95
|
+
'$SYS/broker/subscriptions/', '$SYS/broker/retained messages/',
|
|
96
|
+
'$SYS/broker/bytes/', '$SYS/broker/heap/',
|
|
97
|
+
];
|
|
90
98
|
for (const [topic, entry] of _store.mqttEntries()) {
|
|
91
99
|
if (!sys[topic] && sysPrefixes.some((p) => topic.startsWith(p))) {
|
|
92
100
|
sys[topic] = entry;
|
|
@@ -94,7 +102,7 @@ router.get('/status', (req, res) => {
|
|
|
94
102
|
}
|
|
95
103
|
}
|
|
96
104
|
|
|
97
|
-
res.json({ dynsec: ds, sys, sshKeyDefault: DEFAULT_SSH_KEY });
|
|
105
|
+
res.json({ dynsec: ds, sys, sshKeyDefault: DEFAULT_SSH_KEY, sshConfigured, sshHost });
|
|
98
106
|
});
|
|
99
107
|
|
|
100
108
|
// ── mosquitto.conf ─────────────────────────────────────────────────────────────
|