ramm 0.0.26 → 0.0.27

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
@@ -384,6 +384,17 @@ var createAndAddSshKey = async (pathToKey, comment, context) => {
384
384
  debug(`Key is: ${pubKey}`);
385
385
  await addSshKeyToAuthorized(pubKey, context);
386
386
  };
387
+ var setupSshKey = async ({
388
+ key,
389
+ fingerprint,
390
+ pathToFile,
391
+ server
392
+ }) => {
393
+ await writeIfNewCompletely(pathToFile, key);
394
+ await execCommand(`chmod 0600 ${pathToFile}`);
395
+ await writeIfNew("~/.ssh/known_hosts", fingerprint);
396
+ await addKeyToHostConfig("~/.ssh/config", server, pathToFile);
397
+ };
387
398
  // src/cron.ts
388
399
  var createCron = async ({
389
400
  time,
@@ -446,6 +457,7 @@ export {
446
457
  writeIfNew,
447
458
  writeIfNewCompletely as writeFileIfNotMatch,
448
459
  writeFile,
460
+ setupSshKey,
449
461
  setupNftable,
450
462
  runPodmanContainerService,
451
463
  runPodmanContainer,
@@ -8,7 +8,7 @@ export { installSystemPackage } from "./packages.ts";
8
8
  export { debugBlock } from "./debug.ts";
9
9
  export { setupNftable } from "./nft.ts";
10
10
  export { writeIfNew, writeFile, writeIfNewCompletely as writeFileIfNotMatch, normalizeFileContent, } from "./files.ts";
11
- export { createAndAddSshKey, getServerFingerprintBySsh, addKeyToHostConfig, } from "./ssh.ts";
11
+ export { createAndAddSshKey, getServerFingerprintBySsh, addKeyToHostConfig, setupSshKey, } 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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ramm",
3
3
  "type": "module",
4
- "version": "0.0.26",
4
+ "version": "0.0.27",
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"