sshifu-trust 0.6.3 → 0.7.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/README.md +13 -1
- package/package.json +1 -1
- package/scripts/install.js +11 -5
package/README.md
CHANGED
|
@@ -4,11 +4,23 @@ Configure SSH servers to trust the sshifu certificate authority.
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
+
### Quick Start (Recommended)
|
|
8
|
+
|
|
9
|
+
Use `npx` to run without installing:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
sudo npx sshifu-trust auth.example.com
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Install Globally
|
|
16
|
+
|
|
17
|
+
For frequent use, install globally:
|
|
18
|
+
|
|
7
19
|
```bash
|
|
8
20
|
npm install -g sshifu-trust
|
|
9
21
|
```
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
Then use directly:
|
|
12
24
|
|
|
13
25
|
```bash
|
|
14
26
|
sudo sshifu-trust auth.example.com
|
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -79,20 +79,26 @@ async function main() {
|
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
const
|
|
82
|
+
const isWindows = process.platform === 'win32';
|
|
83
|
+
const archiveExt = isWindows ? '.zip' : '.tar.gz';
|
|
84
|
+
const archiveName = `${PACKAGE_NAME}-${platform}${archiveExt}`;
|
|
83
85
|
const archiveUrl = `https://github.com/${REPO}/releases/download/v${version}/${archiveName}`;
|
|
84
86
|
const archivePath = path.join(binDir, archiveName);
|
|
85
|
-
|
|
87
|
+
|
|
86
88
|
console.log(`[sshifu-trust] Downloading ${archiveUrl}...`);
|
|
87
|
-
|
|
89
|
+
|
|
88
90
|
try {
|
|
89
91
|
await download(archiveUrl, archivePath);
|
|
90
92
|
|
|
91
93
|
// Extract the archive
|
|
92
94
|
console.log(`[sshifu-trust] Extracting...`);
|
|
93
|
-
const archiveBinName = `${PACKAGE_NAME}-${platform}${
|
|
95
|
+
const archiveBinName = `${PACKAGE_NAME}-${platform}${isWindows ? '.exe' : ''}`;
|
|
94
96
|
const extractedPath = path.join(binDir, archiveBinName);
|
|
95
|
-
|
|
97
|
+
if (isWindows) {
|
|
98
|
+
execSync(`powershell -Command "Expand-Archive -Path '${archivePath}' -DestinationPath '${binDir}' -Force"`, { stdio: 'ignore' });
|
|
99
|
+
} else {
|
|
100
|
+
execSync(`tar -xzf "${archivePath}" -C "${binDir}"`, { stdio: 'ignore' });
|
|
101
|
+
}
|
|
96
102
|
|
|
97
103
|
// Rename to expected name if different
|
|
98
104
|
if (archiveBinName !== binName && fs.existsSync(extractedPath)) {
|