ramm 0.0.5 → 0.0.6
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 +6 -0
- package/dist/types/base.d.ts +5 -2
- package/dist/types/context.d.ts +3 -1
- package/dist/types/debug.d.ts +1 -0
- package/dist/types/ramm.d.ts +3 -2
- package/dist/types/ssh.d.ts +4 -0
- package/package.json +1 -1
package/dist/ramm.js
CHANGED
|
@@ -218,6 +218,10 @@ var addNftPodmanRule = async () => {
|
|
|
218
218
|
};
|
|
219
219
|
// src/ssh.ts
|
|
220
220
|
import { debug } from "console";
|
|
221
|
+
var getServerFingerprintBySsh = async (context) => {
|
|
222
|
+
const { output } = await execBySsh('ssh-keyscan -t ed25519 localhost | grep -v "^#"', context);
|
|
223
|
+
return output.replace("localhost", context.domain);
|
|
224
|
+
};
|
|
221
225
|
async function createSshKey(pathToKey, comment) {
|
|
222
226
|
const name = pathToKey.split("/").at(-1);
|
|
223
227
|
const pathToKeyPub = `${pathToKey}.pub`;
|
|
@@ -253,6 +257,8 @@ export {
|
|
|
253
257
|
installSystemPackage,
|
|
254
258
|
installPodman,
|
|
255
259
|
installBun,
|
|
260
|
+
getServerFingerprintBySsh,
|
|
261
|
+
execCommand,
|
|
256
262
|
execBySsh,
|
|
257
263
|
debugBlock,
|
|
258
264
|
createAndAddSshKey,
|
package/dist/types/base.d.ts
CHANGED
|
@@ -8,5 +8,8 @@ export declare const execCommandSilent: (command: string) => Promise<{
|
|
|
8
8
|
output: string;
|
|
9
9
|
spawnResult: import("bun").Subprocess<"ignore", "pipe", "inherit">;
|
|
10
10
|
}>;
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
11
|
+
export declare const copyFilesBySsh: (from: string, to: string, context: Context) => Promise<void>;
|
|
12
|
+
export declare const execBySsh: (command: string, context: Context) => Promise<{
|
|
13
|
+
output: string;
|
|
14
|
+
spawnResult: import("bun").Subprocess<"inherit", "pipe", "inherit">;
|
|
15
|
+
}>;
|
package/dist/types/context.d.ts
CHANGED
|
@@ -3,11 +3,13 @@ export declare class Context {
|
|
|
3
3
|
domain: string;
|
|
4
4
|
userspace: boolean;
|
|
5
5
|
sudo: boolean;
|
|
6
|
-
|
|
6
|
+
sshKey?: string;
|
|
7
|
+
constructor({ name, address, userspace, sudo, sshKey, }: {
|
|
7
8
|
name: string;
|
|
8
9
|
address: string;
|
|
9
10
|
userspace?: boolean;
|
|
10
11
|
sudo?: boolean;
|
|
12
|
+
sshKey?: string;
|
|
11
13
|
});
|
|
12
14
|
getAddress(): string;
|
|
13
15
|
}
|
package/dist/types/debug.d.ts
CHANGED
package/dist/types/ramm.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { execBySsh, execCommand, copyFilesBySsh } from "./base.ts";
|
|
2
2
|
export { Context } from "./context.ts";
|
|
3
3
|
export { installBun } from "./init.ts";
|
|
4
4
|
export { installPodman, runPodmanContainer } from "./podman.ts";
|
|
5
5
|
export { runPodmanContainerService, addNftPodmanRule } from "./podman.ts";
|
|
6
6
|
export { restartSystemdService } from "./systemd.ts";
|
|
7
7
|
export { installSystemPackage } from "./packages.ts";
|
|
8
|
-
export {
|
|
8
|
+
export { debugBlock } from "./debug.ts";
|
|
9
9
|
export { setupNftable } from "./nft.ts";
|
|
10
|
+
export { createAndAddSshKey, getServerFingerprintBySsh } from "./ssh.ts";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Context } from "./context.ts";
|
|
2
|
+
export declare const setupHostConfig: (address: string, pathToKey: string) => void;
|
|
3
|
+
export declare const getServerFingerprintBySsh: (context: Context) => Promise<string>;
|
|
4
|
+
export declare const createAndAddSshKey: (pathToKey: string, comment: string, context: Context) => Promise<void>;
|
package/package.json
CHANGED