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 CHANGED
@@ -351,10 +351,14 @@ var addKeyToHostConfig = async (pathToHost, address, pathToKey) => {
351
351
  `;
352
352
  await writeIfNew(pathToHost, text);
353
353
  };
354
- var getServerFingerprintOverSsh = async (context) => {
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
- getServerFingerprintOverSsh,
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
@@ -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 as writeFileIfNotMatch, normalizeFileContent, } from "./files.ts";
11
- export { createAndAddSshKey, getServerFingerprintOverSsh, addKeyToHostConfig, addSshKeyToUse as setupSshKey, } from "./ssh.ts";
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";
@@ -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 getServerFingerprintOverSsh: (context: Context) => Promise<string>;
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ramm",
3
3
  "type": "module",
4
- "version": "0.0.31",
4
+ "version": "0.0.32",
5
5
  "scripts": {
6
6
  "build": "bun build ./src/ramm.ts --target bun --outdir ./dist && cp ./src/bun.sh ./dist/bun.sh",
7
7
  "types": "tsc --project tsconfig.types.json"