mirror of
https://github.com/LukeHagar/dokploy.git
synced 2025-12-06 04:19:37 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -137,21 +137,21 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
|
||||
const { data: application } =
|
||||
type === "application"
|
||||
? api.application.one.useQuery(
|
||||
{
|
||||
applicationId: id,
|
||||
},
|
||||
{
|
||||
enabled: !!id,
|
||||
},
|
||||
)
|
||||
{
|
||||
applicationId: id,
|
||||
},
|
||||
{
|
||||
enabled: !!id,
|
||||
},
|
||||
)
|
||||
: api.compose.one.useQuery(
|
||||
{
|
||||
composeId: id,
|
||||
},
|
||||
{
|
||||
enabled: !!id,
|
||||
},
|
||||
);
|
||||
{
|
||||
composeId: id,
|
||||
},
|
||||
{
|
||||
enabled: !!id,
|
||||
},
|
||||
);
|
||||
|
||||
const { mutateAsync, isError, error, isLoading } = domainId
|
||||
? api.domain.update.useMutation()
|
||||
@@ -535,10 +535,13 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
|
||||
{field.value && field.value.includes("*") && (
|
||||
<div className="text-sm text-muted-foreground mt-1">
|
||||
<p>
|
||||
Wildcard subdomains will match any subdomain at the specified level
|
||||
Wildcard subdomains will match any subdomain at the
|
||||
specified level
|
||||
</p>
|
||||
<div>
|
||||
<code>*.example.com</code> will match <code>api.example.com</code>, <code>app.example.com</code>, etc.
|
||||
<code>*.example.com</code> will match{" "}
|
||||
<code>api.example.com</code>,{" "}
|
||||
<code>app.example.com</code>, etc.
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -53,21 +53,21 @@ export const ShowDomains = ({ id, type }: Props) => {
|
||||
const { data: application } =
|
||||
type === "application"
|
||||
? api.application.one.useQuery(
|
||||
{
|
||||
applicationId: id,
|
||||
},
|
||||
{
|
||||
enabled: !!id,
|
||||
},
|
||||
)
|
||||
{
|
||||
applicationId: id,
|
||||
},
|
||||
{
|
||||
enabled: !!id,
|
||||
},
|
||||
)
|
||||
: api.compose.one.useQuery(
|
||||
{
|
||||
composeId: id,
|
||||
},
|
||||
{
|
||||
enabled: !!id,
|
||||
},
|
||||
);
|
||||
{
|
||||
composeId: id,
|
||||
},
|
||||
{
|
||||
enabled: !!id,
|
||||
},
|
||||
);
|
||||
const [validationStates, setValidationStates] = useState<ValidationStates>(
|
||||
{},
|
||||
);
|
||||
@@ -78,7 +78,7 @@ export const ShowDomains = ({ id, type }: Props) => {
|
||||
refetch,
|
||||
isLoading: isLoadingDomains,
|
||||
} = type === "application"
|
||||
? api.domain.byApplicationId.useQuery(
|
||||
? api.domain.byApplicationId.useQuery(
|
||||
{
|
||||
applicationId: id,
|
||||
},
|
||||
@@ -86,7 +86,7 @@ export const ShowDomains = ({ id, type }: Props) => {
|
||||
enabled: !!id,
|
||||
},
|
||||
)
|
||||
: api.domain.byComposeId.useQuery(
|
||||
: api.domain.byComposeId.useQuery(
|
||||
{
|
||||
composeId: id,
|
||||
},
|
||||
@@ -364,7 +364,7 @@ export const ShowDomains = ({ id, type }: Props) => {
|
||||
<>
|
||||
<CheckCircle2 className="size-3 mr-1" />
|
||||
{validationState.message &&
|
||||
validationState.cdnProvider
|
||||
validationState.cdnProvider
|
||||
? `Behind ${validationState.cdnProvider}`
|
||||
: "DNS Valid"}
|
||||
</>
|
||||
|
||||
@@ -160,7 +160,10 @@ export const AddPreviewDomain = ({
|
||||
<FormLabel>Host</FormLabel>
|
||||
<div className="flex gap-2">
|
||||
<FormControl>
|
||||
<Input placeholder="example.com, *.example.com, or *.sub.example.com" {...field} />
|
||||
<Input
|
||||
placeholder="example.com, *.example.com, or *.sub.example.com"
|
||||
{...field}
|
||||
/>
|
||||
</FormControl>
|
||||
<TooltipProvider delayDuration={0}>
|
||||
<Tooltip>
|
||||
@@ -201,11 +204,10 @@ export const AddPreviewDomain = ({
|
||||
<FormMessage />
|
||||
{field.value && field.value.includes("*") && (
|
||||
<div className="text-sm text-muted-foreground mt-1">
|
||||
<p>💡 Wildcard domain detected.</p>
|
||||
<p>
|
||||
💡 Wildcard domain detected.
|
||||
</p>
|
||||
<p>
|
||||
This will match any subdomain at this level (e.g., api.example.com, app.example.com for *.example.com)
|
||||
This will match any subdomain at this level (e.g.,
|
||||
api.example.com, app.example.com for *.example.com)
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -281,7 +281,7 @@ export const ImpersonationBar = () => {
|
||||
<div className="flex items-center gap-4 flex-1 flex-wrap">
|
||||
<Avatar className="h-10 w-10">
|
||||
<AvatarImage
|
||||
className="object-cover"
|
||||
className="object-cover"
|
||||
src={data?.user?.image || ""}
|
||||
alt={data?.user?.name || ""}
|
||||
/>
|
||||
|
||||
@@ -44,7 +44,7 @@ export const UserNav = () => {
|
||||
>
|
||||
<Avatar className="h-8 w-8 rounded-lg">
|
||||
<AvatarImage
|
||||
className="object-cover"
|
||||
className="object-cover"
|
||||
src={data?.user?.image || ""}
|
||||
alt={data?.user?.image || ""}
|
||||
/>
|
||||
|
||||
@@ -37,7 +37,8 @@ export const domain = z
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ["host"],
|
||||
message: "Wildcard domains must start with '*.' (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
message:
|
||||
"Wildcard domains must start with '*.' (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
});
|
||||
}
|
||||
// Check if there are multiple wildcards
|
||||
@@ -53,7 +54,8 @@ export const domain = z
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ["host"],
|
||||
message: "Wildcard must be at the beginning of a subdomain (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
message:
|
||||
"Wildcard must be at the beginning of a subdomain (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -97,7 +99,8 @@ export const domainCompose = z
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ["host"],
|
||||
message: "Wildcard domains must start with '*.' (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
message:
|
||||
"Wildcard domains must start with '*.' (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
});
|
||||
}
|
||||
// Check if there are multiple wildcards
|
||||
@@ -113,8 +116,9 @@ export const domainCompose = z
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ["host"],
|
||||
message: "Wildcard must be at the beginning of a subdomain (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
message:
|
||||
"Wildcard must be at the beginning of a subdomain (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -62,7 +62,8 @@ export const domain = z
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ["host"],
|
||||
message: "Wildcard domains must start with '*.' (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
message:
|
||||
"Wildcard domains must start with '*.' (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
});
|
||||
}
|
||||
// Check if there are multiple wildcards
|
||||
@@ -78,7 +79,8 @@ export const domain = z
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ["host"],
|
||||
message: "Wildcard must be at the beginning of a subdomain (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
message:
|
||||
"Wildcard must be at the beginning of a subdomain (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -147,7 +149,8 @@ export const domainCompose = z
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ["host"],
|
||||
message: "Wildcard domains must start with '*.' (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
message:
|
||||
"Wildcard domains must start with '*.' (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
});
|
||||
}
|
||||
// Check if there are multiple wildcards
|
||||
@@ -163,8 +166,9 @@ export const domainCompose = z
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ["host"],
|
||||
message: "Wildcard must be at the beginning of a subdomain (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
message:
|
||||
"Wildcard must be at the beginning of a subdomain (e.g., '*.example.com' or '*.sub.example.com')",
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -314,10 +314,10 @@ export const createDomainLabels = (
|
||||
} = domain;
|
||||
const routerName = `${appName}-${uniqueConfigKey}-${entrypoint}`;
|
||||
// Generate the Host rule - support wildcards
|
||||
const hostRule = host.includes("*")
|
||||
const hostRule = host.includes("*")
|
||||
? `HostRegexp(\`${host.replace("*", "{subdomain:[a-zA-Z0-9-]+}")}\`)`
|
||||
: `Host(\`${host}\`)`;
|
||||
|
||||
|
||||
const labels = [
|
||||
`traefik.http.routers.${routerName}.rule=${hostRule}${path && path !== "/" ? ` && PathPrefix(\`${path}\`)` : ""}`,
|
||||
`traefik.http.routers.${routerName}.entrypoints=${entrypoint}`,
|
||||
|
||||
@@ -115,7 +115,7 @@ export const createRouterConfig = async (
|
||||
const { host, path, https, uniqueConfigKey, internalPath, stripPath } =
|
||||
domain;
|
||||
// Generate the Host rule - support wildcards
|
||||
const hostRule = host.includes("*")
|
||||
const hostRule = host.includes("*")
|
||||
? `HostRegexp(\`${host.replace("*", "{subdomain:[a-zA-Z0-9-]+}")}\`)`
|
||||
: `Host(\`${host}\`)`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user