smart-home-engine 1.1.2 → 1.1.4

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.
@@ -1,4 +1,4 @@
1
- import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-DvaCcW0R.js";/*!-----------------------------------------------------------------------------
1
+ import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-DmNh4UvK.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -172,7 +172,7 @@
172
172
  }
173
173
  })();
174
174
  </script>
175
- <script type="module" crossorigin src="/assets/index-DvaCcW0R.js"></script>
175
+ <script type="module" crossorigin src="/assets/index-DmNh4UvK.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
178
  <link rel="stylesheet" crossorigin href="/assets/index-DKIgEFlE.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-home-engine",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Node.js based script runner for use in MQTT based Smart Home environments",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -160,4 +160,4 @@ async function generateKeypair(identityFile) {
160
160
  return fs.readFileSync(expandedPath + '.pub', 'utf8').trim();
161
161
  }
162
162
 
163
- module.exports = { runCommand, readRemoteFile, uploadFile, uploadContent, testConnection, generateKeypair };
163
+ module.exports = { expandHome, runCommand, readRemoteFile, uploadFile, uploadContent, testConnection, generateKeypair };
@@ -660,6 +660,20 @@ module.exports = { router };
660
660
  // Note: these routes are mounted on the same router but defined after module.exports
661
661
  // because they add to `router` (which is already exported by reference).
662
662
 
663
+ /** GET /she/broker/ssh/pubkey — Read existing public key (if any) */
664
+ router.get('/ssh/pubkey', (req, res) => {
665
+ try {
666
+ const bc = getBrokerConfig(req);
667
+ const identityFile = sshDeploy.expandHome((bc.ssh && bc.ssh.identityFile) || DEFAULT_SSH_KEY);
668
+ const pubPath = identityFile + '.pub';
669
+ if (!fs.existsSync(pubPath)) return res.json({ publicKey: null });
670
+ const publicKey = fs.readFileSync(pubPath, 'utf8').trim();
671
+ res.json({ publicKey });
672
+ } catch (err) {
673
+ handleError(res, err);
674
+ }
675
+ });
676
+
663
677
  /** POST /she/broker/ssh/keygen — Generate SSH keypair */
664
678
  router.post('/ssh/keygen', async (req, res) => {
665
679
  try {