ramm 0.0.31 → 0.0.33
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 +10 -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,15 @@ 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 normalizedPath = normalizePath(filePath);
|
|
360
|
+
const fingerprint = await getServerFingerprint(context);
|
|
361
|
+
await writeIfNewCompletely(filePath, normalizedPath);
|
|
362
|
+
};
|
|
358
363
|
async function createSshKey(filePath, comment) {
|
|
359
364
|
printFunction(`${createSshKey.name} ${filePath}`);
|
|
360
365
|
const normalizedPathToKey = normalizePath(filePath);
|
|
@@ -458,11 +463,11 @@ var passVarsServer = async () => {
|
|
|
458
463
|
return jsonData;
|
|
459
464
|
};
|
|
460
465
|
export {
|
|
466
|
+
writeIfNewCompletely,
|
|
461
467
|
writeIfNew,
|
|
462
|
-
writeIfNewCompletely as writeFileIfNotMatch,
|
|
463
468
|
writeFile,
|
|
464
|
-
addSshKeyToUse as setupSshKey,
|
|
465
469
|
setupNftable,
|
|
470
|
+
saveSshFingerptint,
|
|
466
471
|
runPodmanContainerService,
|
|
467
472
|
runPodmanContainer,
|
|
468
473
|
restartSystemdService,
|
|
@@ -475,7 +480,7 @@ export {
|
|
|
475
480
|
installSystemPackage,
|
|
476
481
|
installPodman,
|
|
477
482
|
installBun,
|
|
478
|
-
|
|
483
|
+
getServerFingerprint,
|
|
479
484
|
execCommandRaw,
|
|
480
485
|
execCommandOverSsh,
|
|
481
486
|
execCommandMayError,
|
|
@@ -484,6 +489,7 @@ export {
|
|
|
484
489
|
createAndAddSshKey,
|
|
485
490
|
copyFilesBySsh,
|
|
486
491
|
buildAndRunOverSsh,
|
|
492
|
+
addSshKeyToUse,
|
|
487
493
|
addNftPodmanRule,
|
|
488
494
|
addKeyToHostConfig,
|
|
489
495
|
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