Skip to content

Commit

Permalink
Merge pull request #40 from dalil01/main
Browse files Browse the repository at this point in the history
feat: Add passphrase for ssh config
  • Loading branch information
nekiro committed Jan 20, 2024
2 parents e0d1777 + 0114565 commit 894b7ff
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 45 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# IDE
.idea

# Dependency directory
node_modules

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ Execute commands on target server with few easy steps :)
## Options

| Param | default | required | description |
| :------------------ | :-----: | -------: | ------------------------------------------------------------------------------------------------------------ |
| :------------------ | :-----: |---------:|--------------------------------------------------------------------------------------------------------------|
| host | n/a | true | Host to connect to |
| port | 22 | false | Port to connect to |
| key | n/a | true | Private key used for authorization |
| passphrase | n/a | false | Passphrase used to decrypt key |
| user | n/a | true | User used for authorization |
| password | n/a | false | Password used for authorization |
| envs | n/a | false | Json serialized secrets exported to shell |
Expand Down
35 changes: 14 additions & 21 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class ConfigManager {
host: InputParser_1.InputParser.getString("host"),
port: InputParser_1.InputParser.getNumber("port"),
key: InputParser_1.InputParser.getString("key"),
passphrase: InputParser_1.InputParser.getString("passphrase"),
user: InputParser_1.InputParser.getString("user"),
password: InputParser_1.InputParser.getString("password"),
envs: [],
Expand Down Expand Up @@ -229,6 +230,9 @@ function run() {
};
if (configManager.config.key) {
sshConfig.privateKey = configManager.config.key;
if (configManager.config.passphrase) {
sshConfig.passphrase = configManager.config.passphrase;
}
}
else {
sshConfig.password = configManager.config.password;
Expand Down Expand Up @@ -3322,19 +3326,6 @@ module.exports = {
};


/***/ }),

/***/ 4137:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

"use strict";


const binding = __nccwpck_require__(4240);

module.exports = binding.getCPUInfo;


/***/ }),

/***/ 1554:
Expand Down Expand Up @@ -15822,7 +15813,7 @@ const crypto = __nccwpck_require__(6113);

let cpuInfo;
try {
cpuInfo = __nccwpck_require__(4137)();
cpuInfo = __nccwpck_require__(7295)();
} catch {}

const { bindingAvailable, CIPHER_INFO, MAC_INFO } = __nccwpck_require__(5708);
Expand Down Expand Up @@ -16209,7 +16200,7 @@ let AESGCMDecipher;
let ChaChaPolyDecipher;
let GenericDecipher;
try {
binding = __nccwpck_require__(9041);
binding = __nccwpck_require__(9623);
({ AESGCMCipher, ChaChaPolyCipher, GenericCipher,
AESGCMDecipher, ChaChaPolyDecipher, GenericDecipher } = binding);
} catch {}
Expand Down Expand Up @@ -36145,17 +36136,19 @@ module.exports["default"] = exports.default;

/***/ }),

/***/ 4240:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
/***/ 9623:
/***/ ((module) => {

module.exports = eval("require")("./crypto/build/Release/sshcrypto.node");

module.exports = require(__nccwpck_require__.ab + "build/Release/cpufeatures.node")

/***/ }),

/***/ 9041:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
/***/ 7295:
/***/ ((module) => {

module.exports = eval("require")("cpu-features");

module.exports = require(__nccwpck_require__.ab + "lib/protocol/crypto/build/Release/sshcrypto.node")

/***/ }),

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

32 changes: 10 additions & 22 deletions dist/licenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


@vercel/ncc
MIT
Copyright 2018 ZEIT, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

asn1
MIT
Copyright (c) 2011 Mark Cavage, All rights reserved.
Expand Down Expand Up @@ -128,28 +138,6 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


cpu-features
MIT
Copyright Brian White. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

is-stream
MIT
MIT License
Expand Down
2 changes: 2 additions & 0 deletions src/ConfigManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface ConfigInterface {
host: string;
port: number;
key: string;
passphrase: string;
user: string;
password: string;
envs: {key: string; value: string}[];
Expand Down Expand Up @@ -32,6 +33,7 @@ export class ConfigManager {
host: InputParser.getString("host"),
port: InputParser.getNumber("port"),
key: InputParser.getString("key"),
passphrase: InputParser.getString("passphrase"),
user: InputParser.getString("user"),
password: InputParser.getString("password"),
envs: [],
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ async function run(): Promise<void> {

if (configManager.config.key) {
sshConfig.privateKey = configManager.config.key;
if (configManager.config.passphrase) {
sshConfig.passphrase = configManager.config.passphrase;
}
} else {
sshConfig.password = configManager.config.password;
}
Expand Down

0 comments on commit 894b7ff

Please sign in to comment.