mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-18 18:05:18 +00:00
Merge branch 'canary' into Add-the-ability-to-mark-an-organization-as--default--or-remember-last-used-organization-#1991
This commit is contained in:
@@ -59,7 +59,13 @@ const mySchema = z.discriminatedUnion("type", [
|
|||||||
z
|
z
|
||||||
.object({
|
.object({
|
||||||
type: z.literal("volume"),
|
type: z.literal("volume"),
|
||||||
volumeName: z.string().min(1, "Volume name required"),
|
volumeName: z
|
||||||
|
.string()
|
||||||
|
.min(1, "Volume name required")
|
||||||
|
.regex(
|
||||||
|
/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/,
|
||||||
|
"Invalid volume name. Use letters, numbers, '._-' and start with a letter/number.",
|
||||||
|
),
|
||||||
})
|
})
|
||||||
.merge(mountSchema),
|
.merge(mountSchema),
|
||||||
z
|
z
|
||||||
|
|||||||
@@ -41,7 +41,13 @@ const mySchema = z.discriminatedUnion("type", [
|
|||||||
z
|
z
|
||||||
.object({
|
.object({
|
||||||
type: z.literal("volume"),
|
type: z.literal("volume"),
|
||||||
volumeName: z.string().min(1, "Volume name required"),
|
volumeName: z
|
||||||
|
.string()
|
||||||
|
.min(1, "Volume name required")
|
||||||
|
.regex(
|
||||||
|
/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/,
|
||||||
|
"Invalid volume name. Use letters, numbers, '._-' and start with a letter/number.",
|
||||||
|
),
|
||||||
})
|
})
|
||||||
.merge(mountSchema),
|
.merge(mountSchema),
|
||||||
z
|
z
|
||||||
|
|||||||
+7
-1
@@ -47,7 +47,13 @@ const formSchema = z
|
|||||||
.object({
|
.object({
|
||||||
name: z.string().min(1, "Name is required"),
|
name: z.string().min(1, "Name is required"),
|
||||||
cronExpression: z.string().min(1, "Cron expression is required"),
|
cronExpression: z.string().min(1, "Cron expression is required"),
|
||||||
volumeName: z.string().min(1, "Volume name is required"),
|
volumeName: z
|
||||||
|
.string()
|
||||||
|
.min(1, "Volume name is required")
|
||||||
|
.regex(
|
||||||
|
/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/,
|
||||||
|
"Invalid volume name. Use letters, numbers, '._-' and start with a letter/number.",
|
||||||
|
),
|
||||||
prefix: z.string(),
|
prefix: z.string(),
|
||||||
keepLatestCount: z.coerce
|
keepLatestCount: z.coerce
|
||||||
.number()
|
.number()
|
||||||
|
|||||||
@@ -245,6 +245,7 @@ export const composeRouter = createTRPCRouter({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
await cleanQueuesByCompose(input.composeId);
|
await cleanQueuesByCompose(input.composeId);
|
||||||
|
return { success: true, message: "Queues cleaned successfully" };
|
||||||
}),
|
}),
|
||||||
|
|
||||||
loadServices: protectedProcedure
|
loadServices: protectedProcedure
|
||||||
@@ -405,6 +406,7 @@ export const composeRouter = createTRPCRouter({
|
|||||||
removeOnFail: true,
|
removeOnFail: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
return { success: true, message: "Deployment queued" };
|
||||||
}),
|
}),
|
||||||
redeploy: protectedProcedure
|
redeploy: protectedProcedure
|
||||||
.input(apiRedeployCompose)
|
.input(apiRedeployCompose)
|
||||||
@@ -440,6 +442,7 @@ export const composeRouter = createTRPCRouter({
|
|||||||
removeOnFail: true,
|
removeOnFail: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
return { success: true, message: "Redeployment queued" };
|
||||||
}),
|
}),
|
||||||
stop: protectedProcedure
|
stop: protectedProcedure
|
||||||
.input(apiFindCompose)
|
.input(apiFindCompose)
|
||||||
|
|||||||
@@ -616,6 +616,7 @@ const ARVANCLOUD_IP_RANGES = [
|
|||||||
"37.32.18.0/27",
|
"37.32.18.0/27",
|
||||||
"37.32.19.0/27",
|
"37.32.19.0/27",
|
||||||
"185.215.232.0/22",
|
"185.215.232.0/22",
|
||||||
|
"178.131.120.48/28",
|
||||||
];
|
];
|
||||||
|
|
||||||
const CDN_PROVIDERS: CDNProvider[] = [
|
const CDN_PROVIDERS: CDNProvider[] = [
|
||||||
|
|||||||
@@ -37,7 +37,16 @@ export const generateRandomDomain = ({
|
|||||||
const hash = randomBytes(3).toString("hex");
|
const hash = randomBytes(3).toString("hex");
|
||||||
const slugIp = serverIp.replaceAll(".", "-").replaceAll(":", "-");
|
const slugIp = serverIp.replaceAll(".", "-").replaceAll(":", "-");
|
||||||
|
|
||||||
return `${projectName}-${hash}${slugIp === "" ? "" : `-${slugIp}`}.traefik.me`;
|
// Domain labels have a max length of 63 characters
|
||||||
|
// Reserve space for: hash (6) + separators (1-2) + ip section + dot + traefik.me (10)
|
||||||
|
// Approx: 6 + 2 + (variable ip length) + 11 = ~19-30 chars for other parts
|
||||||
|
const maxProjectNameLength = 40;
|
||||||
|
const truncatedProjectName =
|
||||||
|
projectName.length > maxProjectNameLength
|
||||||
|
? projectName.substring(0, maxProjectNameLength)
|
||||||
|
: projectName;
|
||||||
|
|
||||||
|
return `${truncatedProjectName}-${hash}${slugIp === "" ? "" : `-${slugIp}`}.traefik.me`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const generateHash = (length = 8): string => {
|
export const generateHash = (length = 8): string => {
|
||||||
|
|||||||
Reference in New Issue
Block a user