mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: add deployable option to randomize and prevent colission in duplicate templates
This commit is contained in:
@@ -46,6 +46,7 @@ import {
|
||||
findServerById,
|
||||
loadServices,
|
||||
randomizeComposeFile,
|
||||
randomizeDeployableComposeFile,
|
||||
removeCompose,
|
||||
removeComposeDirectory,
|
||||
removeDeploymentsByComposeId,
|
||||
@@ -216,6 +217,21 @@ export const composeRouter = createTRPCRouter({
|
||||
}
|
||||
return await randomizeComposeFile(input.composeId, input.suffix);
|
||||
}),
|
||||
randomizeDeployableCompose: protectedProcedure
|
||||
.input(apiRandomizeCompose)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
const compose = await findComposeById(input.composeId);
|
||||
if (compose.project.adminId !== ctx.user.adminId) {
|
||||
throw new TRPCError({
|
||||
code: "UNAUTHORIZED",
|
||||
message: "You are not authorized to randomize this compose",
|
||||
});
|
||||
}
|
||||
return await randomizeDeployableComposeFile(
|
||||
input.composeId,
|
||||
input.suffix,
|
||||
);
|
||||
}),
|
||||
getConvertedCompose: protectedProcedure
|
||||
.input(apiFindCompose)
|
||||
.query(async ({ input, ctx }) => {
|
||||
|
||||
Reference in New Issue
Block a user