mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: generate ssh key
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
apiRemoveSshKey,
|
||||
apiUpdateSshKey,
|
||||
} from "@/server/db/schema";
|
||||
import { generateSSHKey } from "@/server/utils/filesystem/ssh";
|
||||
import { TRPCError } from "@trpc/server";
|
||||
import {
|
||||
createSshKey,
|
||||
@@ -49,6 +50,9 @@ export const sshRouter = createTRPCRouter({
|
||||
all: adminProcedure.query(async () => {
|
||||
return await db.query.sshKeys.findMany({});
|
||||
}),
|
||||
generate: protectedProcedure.mutation(async () => {
|
||||
return await generateSSHKey();
|
||||
}),
|
||||
update: adminProcedure.input(apiUpdateSshKey).mutation(async ({ input }) => {
|
||||
try {
|
||||
return await updateSSHKeyById(input);
|
||||
|
||||
Reference in New Issue
Block a user