@highstate/common 0.5.5 → 0.6.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.
@@ -3,16 +3,17 @@ import { forUnit, output } from '@highstate/pulumi';
|
|
3
3
|
import { remote } from '@pulumi/command';
|
4
4
|
import '@noble/hashes/utils';
|
5
5
|
import 'micro-key-producer/password.js';
|
6
|
-
import { c as createSshTerminal } from '../ssh-
|
6
|
+
import { c as createSshTerminal } from '../ssh-D_6u85qC.js';
|
7
7
|
|
8
|
-
const { args, secrets, outputs } = forUnit(common.existingServer);
|
8
|
+
const { args, inputs, secrets, outputs } = forUnit(common.existingServer);
|
9
|
+
const privateKey = inputs.sshKeyPair?.privateKey ?? secrets.sshPrivateKey;
|
9
10
|
const hostnameResult = new remote.Command("hostname", {
|
10
11
|
connection: output({
|
11
12
|
host: args.endpoint,
|
12
13
|
port: args.sshPort,
|
13
14
|
user: args.sshUser,
|
14
15
|
password: secrets.sshPassword,
|
15
|
-
privateKey
|
16
|
+
privateKey,
|
16
17
|
dialErrorLimit: 3
|
17
18
|
}),
|
18
19
|
create: "hostname",
|
@@ -23,7 +24,7 @@ const sshCredentials = output({
|
|
23
24
|
user: args.sshUser,
|
24
25
|
port: args.sshPort,
|
25
26
|
password: secrets.sshPassword,
|
26
|
-
privateKey
|
27
|
+
privateKey
|
27
28
|
});
|
28
29
|
var index = outputs({
|
29
30
|
server: {
|
package/dist/index.js
CHANGED
@@ -3,7 +3,7 @@ import { output, ComponentResource } from '@highstate/pulumi';
|
|
3
3
|
import '@highstate/library';
|
4
4
|
import { randomBytes } from '@noble/hashes/utils';
|
5
5
|
import { secureMask } from 'micro-key-producer/password.js';
|
6
|
-
export { c as createSshTerminal } from './ssh-
|
6
|
+
export { c as createSshTerminal } from './ssh-D_6u85qC.js';
|
7
7
|
|
8
8
|
function getServerConnection(server) {
|
9
9
|
return output(server).apply((server2) => ({
|
@@ -11,7 +11,7 @@ function getServerConnection(server) {
|
|
11
11
|
port: server2.sshCredentials?.port ?? 22,
|
12
12
|
user: server2.sshCredentials?.user ?? "root",
|
13
13
|
password: server2.sshCredentials?.password,
|
14
|
-
privateKey: server2.sshCredentials?.
|
14
|
+
privateKey: server2.sshCredentials?.privateKey,
|
15
15
|
dialErrorLimit: 3
|
16
16
|
}));
|
17
17
|
}
|
@@ -3,7 +3,7 @@ function createSshTerminal(credentials, fallbackEndpoint) {
|
|
3
3
|
if (credentials.port) {
|
4
4
|
command.push("-p", credentials.port.toString());
|
5
5
|
}
|
6
|
-
if (credentials.
|
6
|
+
if (credentials.privateKey) {
|
7
7
|
command.push("-i", "/private-key");
|
8
8
|
}
|
9
9
|
const endpoint = credentials.endpoint ?? fallbackEndpoint;
|
@@ -20,7 +20,10 @@ function createSshTerminal(credentials, fallbackEndpoint) {
|
|
20
20
|
command,
|
21
21
|
files: {
|
22
22
|
"/password": credentials.password,
|
23
|
-
"/private-key":
|
23
|
+
"/private-key": {
|
24
|
+
content: credentials.privateKey,
|
25
|
+
mode: 384
|
26
|
+
}
|
24
27
|
}
|
25
28
|
};
|
26
29
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@highstate/common",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.6.1",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"build": "pkgroll --tsconfig=tsconfig.build.json"
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@highstate/pulumi": "^0.
|
25
|
+
"@highstate/pulumi": "^0.6.1",
|
26
26
|
"@noble/hashes": "^1.7.1",
|
27
27
|
"@pulumi/command": "^1.0.2",
|
28
28
|
"micro-key-producer": "^0.7.3"
|
@@ -33,5 +33,5 @@
|
|
33
33
|
"devDependencies": {
|
34
34
|
"pkgroll": "^2.5.1"
|
35
35
|
},
|
36
|
-
"gitHead": "
|
36
|
+
"gitHead": "afe736f7e93b7fcfbae97e2d6e35b07175a8fc76"
|
37
37
|
}
|