mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-19 18:48:52 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -92,12 +92,17 @@ export const domain = z
|
|||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
path: ["stripPath"],
|
path: ["stripPath"],
|
||||||
message: "Strip path can only be enabled when a path other than '/' is specified",
|
message:
|
||||||
|
"Strip path can only be enabled when a path other than '/' is specified",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate internalPath starts with /
|
// Validate internalPath starts with /
|
||||||
if (input.internalPath && input.internalPath !== "/" && !input.internalPath.startsWith("/")) {
|
if (
|
||||||
|
input.internalPath &&
|
||||||
|
input.internalPath !== "/" &&
|
||||||
|
!input.internalPath.startsWith("/")
|
||||||
|
) {
|
||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
path: ["internalPath"],
|
path: ["internalPath"],
|
||||||
|
|||||||
@@ -37,12 +37,17 @@ export const domain = z
|
|||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
path: ["stripPath"],
|
path: ["stripPath"],
|
||||||
message: "Strip path can only be enabled when a path other than '/' is specified",
|
message:
|
||||||
|
"Strip path can only be enabled when a path other than '/' is specified",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate internalPath starts with /
|
// Validate internalPath starts with /
|
||||||
if (input.internalPath && input.internalPath !== "/" && !input.internalPath.startsWith("/")) {
|
if (
|
||||||
|
input.internalPath &&
|
||||||
|
input.internalPath !== "/" &&
|
||||||
|
!input.internalPath.startsWith("/")
|
||||||
|
) {
|
||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
path: ["internalPath"],
|
path: ["internalPath"],
|
||||||
@@ -89,12 +94,17 @@ export const domainCompose = z
|
|||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
path: ["stripPath"],
|
path: ["stripPath"],
|
||||||
message: "Strip path can only be enabled when a path other than '/' is specified",
|
message:
|
||||||
|
"Strip path can only be enabled when a path other than '/' is specified",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate internalPath starts with /
|
// Validate internalPath starts with /
|
||||||
if (input.internalPath && input.internalPath !== "/" && !input.internalPath.startsWith("/")) {
|
if (
|
||||||
|
input.internalPath &&
|
||||||
|
input.internalPath !== "/" &&
|
||||||
|
!input.internalPath.startsWith("/")
|
||||||
|
) {
|
||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
path: ["internalPath"],
|
path: ["internalPath"],
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ export const createDomainLabels = (
|
|||||||
path,
|
path,
|
||||||
customCertResolver,
|
customCertResolver,
|
||||||
stripPath,
|
stripPath,
|
||||||
internalPath
|
internalPath,
|
||||||
} = domain;
|
} = domain;
|
||||||
const routerName = `${appName}-${uniqueConfigKey}-${entrypoint}`;
|
const routerName = `${appName}-${uniqueConfigKey}-${entrypoint}`;
|
||||||
const labels = [
|
const labels = [
|
||||||
@@ -315,20 +315,28 @@ export const createDomainLabels = (
|
|||||||
// Validate stripPath - it should only be used when path is defined and not "/"
|
// Validate stripPath - it should only be used when path is defined and not "/"
|
||||||
if (stripPath) {
|
if (stripPath) {
|
||||||
if (!path || path === "/") {
|
if (!path || path === "/") {
|
||||||
console.warn(`stripPath is enabled but path is not defined or is "/" for domain ${host}`);
|
console.warn(
|
||||||
|
`stripPath is enabled but path is not defined or is "/" for domain ${host}`,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
const middlewareName = `stripprefix-${appName}-${uniqueConfigKey}`;
|
const middlewareName = `stripprefix-${appName}-${uniqueConfigKey}`;
|
||||||
labels.push(`traefik.http.middlewares.${middlewareName}.stripprefix.prefixes=${path}`);
|
labels.push(
|
||||||
|
`traefik.http.middlewares.${middlewareName}.stripprefix.prefixes=${path}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate internalPath - ensure it's a valid path format
|
// Validate internalPath - ensure it's a valid path format
|
||||||
if (internalPath && internalPath !== "/") {
|
if (internalPath && internalPath !== "/") {
|
||||||
if (!internalPath.startsWith("/")) {
|
if (!internalPath.startsWith("/")) {
|
||||||
console.warn(`internalPath "${internalPath}" should start with "/" and not be empty for domain ${host}`);
|
console.warn(
|
||||||
|
`internalPath "${internalPath}" should start with "/" and not be empty for domain ${host}`,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
const middlewareName = `addprefix-${appName}-${uniqueConfigKey}`;
|
const middlewareName = `addprefix-${appName}-${uniqueConfigKey}`;
|
||||||
labels.push(`traefik.http.middlewares.${middlewareName}.addprefix.prefix=${internalPath}`);
|
labels.push(
|
||||||
|
`traefik.http.middlewares.${middlewareName}.addprefix.prefix=${internalPath}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user