mirror of
https://github.com/andwati/dokploy.git
synced 2026-10-29 08:12:15 +00:00
refactor: implement safe URL validation for whitelabeling settings in both client and server schemas
This commit is contained in:
@@ -187,16 +187,23 @@ export const apiUpdateDockerCleanup = z.object({
|
||||
});
|
||||
|
||||
// Whitelabeling validation schemas
|
||||
const safeUrl = z
|
||||
.string()
|
||||
.refine((url) => /^https?:\/\//i.test(url), {
|
||||
message: "Only http:// and https:// URLs are allowed",
|
||||
})
|
||||
.nullable();
|
||||
|
||||
export const whitelabelingConfigSchema = z.object({
|
||||
appName: z.string().nullable(),
|
||||
appDescription: z.string().nullable(),
|
||||
logoUrl: z.string().nullable(),
|
||||
faviconUrl: z.string().nullable(),
|
||||
logoUrl: safeUrl,
|
||||
faviconUrl: safeUrl,
|
||||
primaryColor: z.string().nullable(),
|
||||
customCss: z.string().nullable(),
|
||||
loginLogoUrl: z.string().nullable(),
|
||||
supportUrl: z.string().nullable(),
|
||||
docsUrl: z.string().nullable(),
|
||||
loginLogoUrl: safeUrl,
|
||||
supportUrl: safeUrl,
|
||||
docsUrl: safeUrl,
|
||||
errorPageTitle: z.string().nullable(),
|
||||
errorPageDescription: z.string().nullable(),
|
||||
metaTitle: z.string().nullable(),
|
||||
|
||||
Reference in New Issue
Block a user