ramm 0.0.31 → 0.0.32
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/ramm.js +9 -4
- package/dist/types/ramm.d.ts +2 -2
- package/dist/types/ssh.d.ts +2 -1
- package/package.json +1 -1
package/dist/ramm.js
CHANGED
|
@@ -351,10 +351,14 @@ var addKeyToHostConfig = async (pathToHost, address, pathToKey) => {
|
|
|
351
351
|
`;
|
|
352
352
|
await writeIfNew(pathToHost, text);
|
|
353
353
|
};
|
|
354
|
-
var
|
|
354
|
+
var getServerFingerprint = async (context) => {
|
|
355
355
|
const { stdout } = await execCommandOverSsh('ssh-keyscan -t ed25519 localhost | grep -v "^#"', context);
|
|
356
356
|
return stdout.replace("localhost", context.domain);
|
|
357
357
|
};
|
|
358
|
+
var saveSshFingerptint = async (filePath, context) => {
|
|
359
|
+
const fingerprint = await getServerFingerprint(context);
|
|
360
|
+
await writeIfNewCompletely(filePath, fingerprint);
|
|
361
|
+
};
|
|
358
362
|
async function createSshKey(filePath, comment) {
|
|
359
363
|
printFunction(`${createSshKey.name} ${filePath}`);
|
|
360
364
|
const normalizedPathToKey = normalizePath(filePath);
|
|
@@ -458,11 +462,11 @@ var passVarsServer = async () => {
|
|
|
458
462
|
return jsonData;
|
|
459
463
|
};
|
|
460
464
|
export {
|
|
465
|
+
writeIfNewCompletely,
|
|
461
466
|
writeIfNew,
|
|
462
|
-
writeIfNewCompletely as writeFileIfNotMatch,
|
|
463
467
|
writeFile,
|
|
464
|
-
addSshKeyToUse as setupSshKey,
|
|
465
468
|
setupNftable,
|
|
469
|
+
saveSshFingerptint,
|
|
466
470
|
runPodmanContainerService,
|
|
467
471
|
runPodmanContainer,
|
|
468
472
|
restartSystemdService,
|
|
@@ -475,7 +479,7 @@ export {
|
|
|
475
479
|
installSystemPackage,
|
|
476
480
|
installPodman,
|
|
477
481
|
installBun,
|
|
478
|
-
|
|
482
|
+
getServerFingerprint,
|
|
479
483
|
execCommandRaw,
|
|
480
484
|
execCommandOverSsh,
|
|
481
485
|
execCommandMayError,
|
|
@@ -484,6 +488,7 @@ export {
|
|
|
484
488
|
createAndAddSshKey,
|
|
485
489
|
copyFilesBySsh,
|
|
486
490
|
buildAndRunOverSsh,
|
|
491
|
+
addSshKeyToUse,
|
|
487
492
|
addNftPodmanRule,
|
|
488
493
|
addKeyToHostConfig,
|
|
489
494
|
Context
|
package/dist/types/ramm.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export { restartSystemdService } from "./systemd.ts";
|
|
|
7
7
|
export { installSystemPackage } from "./packages.ts";
|
|
8
8
|
export { printBlock } from "./print.ts";
|
|
9
9
|
export { setupNftable } from "./nft.ts";
|
|
10
|
-
export { writeIfNew, writeFile, writeIfNewCompletely
|
|
11
|
-
export { createAndAddSshKey,
|
|
10
|
+
export { writeIfNew, writeFile, writeIfNewCompletely, normalizeFileContent, } from "./files.ts";
|
|
11
|
+
export { createAndAddSshKey, getServerFingerprint, addKeyToHostConfig, addSshKeyToUse, saveSshFingerptint, } from "./ssh.ts";
|
|
12
12
|
export { normalizePath } from "./path.ts";
|
|
13
13
|
export { createCron } from "./cron.ts";
|
|
14
14
|
export { buildAndRunOverSsh, passVarsClient, passVarsServer } from "./build.ts";
|
package/dist/types/ssh.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Context } from "./context.ts";
|
|
2
2
|
export declare const addKeyToHostConfig: (pathToHost: string, address: string, pathToKey: string) => Promise<void>;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const getServerFingerprint: (context: Context) => Promise<string>;
|
|
4
|
+
export declare const saveSshFingerptint: (filePath: string, context: Context) => Promise<void>;
|
|
4
5
|
export declare const createAndAddSshKey: (filePath: string, comment: string, context: Context) => Promise<void>;
|
|
5
6
|
export declare const addSshKeyToUse: ({ key, fingerprint, filePath, server, }: {
|
|
6
7
|
key: string;
|
package/package.json
CHANGED