mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: last used at
This commit is contained in:
@@ -55,7 +55,9 @@ export const apiUpdateSshKey = createSchema
|
|||||||
.pick({
|
.pick({
|
||||||
name: true,
|
name: true,
|
||||||
description: true,
|
description: true,
|
||||||
|
lastUsedAt: true,
|
||||||
})
|
})
|
||||||
|
.partial()
|
||||||
.merge(
|
.merge(
|
||||||
createSchema
|
createSchema
|
||||||
.pick({
|
.pick({
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { createWriteStream } from "node:fs";
|
import { createWriteStream } from "node:fs";
|
||||||
import path, { join } from "node:path";
|
import path, { join } from "node:path";
|
||||||
|
import { updateSSHKeyById } from "@/server/api/services/ssh-key";
|
||||||
import { APPLICATIONS_PATH, COMPOSE_PATH, SSH_PATH } from "@/server/constants";
|
import { APPLICATIONS_PATH, COMPOSE_PATH, SSH_PATH } from "@/server/constants";
|
||||||
import { TRPCError } from "@trpc/server";
|
import { TRPCError } from "@trpc/server";
|
||||||
import { recreateDirectory } from "../filesystem/directory";
|
import { recreateDirectory } from "../filesystem/directory";
|
||||||
@@ -40,6 +41,13 @@ export const cloneGitRepository = async (
|
|||||||
`\nCloning Repo Custom ${customGitUrl} to ${outputPath}: ✅\n`,
|
`\nCloning Repo Custom ${customGitUrl} to ${outputPath}: ✅\n`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (customGitSSHKeyId) {
|
||||||
|
await updateSSHKeyById({
|
||||||
|
sshKeyId: customGitSSHKeyId,
|
||||||
|
lastUsedAt: new Date().toISOString(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await spawnAsync(
|
await spawnAsync(
|
||||||
"git",
|
"git",
|
||||||
[
|
[
|
||||||
@@ -66,6 +74,7 @@ export const cloneGitRepository = async (
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
writeStream.write(`\nCloned Custom Git ${customGitUrl}: ✅\n`);
|
writeStream.write(`\nCloned Custom Git ${customGitUrl}: ✅\n`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
writeStream.write(`\nERROR Cloning Custom Git: ${error}: ❌\n`);
|
writeStream.write(`\nERROR Cloning Custom Git: ${error}: ❌\n`);
|
||||||
|
|||||||
Reference in New Issue
Block a user