26 lines · 521 B · TypeScript
RawDownload
import * as ssh2 from "ssh2"; export const generateSSHKey = async (type: "rsa" | "ed25519" = "rsa") => {	try {		if (type === "rsa") {			const keys = ssh2.utils.generateKeyPairSync("rsa", {				bits: 4096,				comment: "dokploy",			});			return {				privateKey: keys.private,				publicKey: keys.public,			};		}		const keys = ssh2.utils.generateKeyPairSync("ed25519", {			comment: "dokploy",		}); 		return {			privateKey: keys.private,			publicKey: keys.public,		};	} catch (error) {		throw error;	}};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t