diff --git a/apps/dokploy/__test__/traefik/server/update-server-config.test.ts b/apps/dokploy/__test__/traefik/server/update-server-config.test.ts index ba09c2c80..d1a03fedc 100644 --- a/apps/dokploy/__test__/traefik/server/update-server-config.test.ts +++ b/apps/dokploy/__test__/traefik/server/update-server-config.test.ts @@ -60,7 +60,7 @@ const baseSettings: WebServerSettings = { docsUrl: null, errorPageTitle: null, errorPageDescription: null, - metaTitle: null, + ogImageUrl: null, footerText: null, }, cleanupCacheApplications: false, diff --git a/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-settings.tsx b/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-settings.tsx index c20615109..3ba9e80bd 100644 --- a/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-settings.tsx +++ b/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-settings.tsx @@ -47,8 +47,8 @@ const formSchema = z.object({ docsUrl: safeUrlField, errorPageTitle: z.string(), errorPageDescription: z.string(), - metaTitle: z.string(), footerText: z.string(), + ogImageUrl: safeUrlField, }); type FormSchema = z.infer; @@ -193,8 +193,8 @@ export function WhitelabelingSettings() { docsUrl: "", errorPageTitle: "", errorPageDescription: "", - metaTitle: "", footerText: "", + ogImageUrl: "", }, resolver: zodResolver(formSchema), }); @@ -212,8 +212,8 @@ export function WhitelabelingSettings() { docsUrl: data.docsUrl ?? "", errorPageTitle: data.errorPageTitle ?? "", errorPageDescription: data.errorPageDescription ?? "", - metaTitle: data.metaTitle ?? "", footerText: data.footerText ?? "", + ogImageUrl: data.ogImageUrl ?? "", }); } }, [data, form]); @@ -242,8 +242,8 @@ export function WhitelabelingSettings() { docsUrl: values.docsUrl || null, errorPageTitle: values.errorPageTitle || null, errorPageDescription: values.errorPageDescription || null, - metaTitle: values.metaTitle || null, footerText: values.footerText || null, + ogImageUrl: values.ogImageUrl || null, }, }) .then(async () => { @@ -388,6 +388,27 @@ export function WhitelabelingSettings() { )} /> + + ( + + OG Image URL + + + + + Open Graph image used for link previews on social media + and messaging platforms. Recommended size: 1200x630px. + + + + )} + /> @@ -441,32 +462,15 @@ export function WhitelabelingSettings() { - {/* Metadata & Links Section */} + {/* Links Section */} - Metadata & Links + Links - Customize the page title, footer text, and sidebar links. + Customize the footer text and sidebar links. - ( - - Page Title - - - - - Browser tab title. Defaults to "Dokploy" if empty. - - - - )} - /> - @@ -27,6 +41,9 @@ export default function Document({ paint (and for social scrapers), avoiding a flash of / fallback to the default Dokploy branding. */} {title} + + + {customCss && ( tags to prevent XSS breakout customCss = config.customCss ? config.customCss.replace(/<\/\s*style[^>]*>/gi, "") @@ -92,7 +120,9 @@ Document.getInitialProps = async ( globalThis.__SETTINGS_CACHE = { data: { - metaTitle, + appName, + appDescription, + ogImageUrl, faviconHref, customCss, }, @@ -101,8 +131,11 @@ Document.getInitialProps = async ( return { ...initialProps, - metaTitle, + appName, + appDescription, + ogImageUrl, faviconHref, customCss, + baseUrl, }; }; diff --git a/apps/dokploy/public/og.png b/apps/dokploy/public/og.png new file mode 100644 index 000000000..68faf81a1 Binary files /dev/null and b/apps/dokploy/public/og.png differ diff --git a/apps/dokploy/server/api/routers/proprietary/whitelabeling.ts b/apps/dokploy/server/api/routers/proprietary/whitelabeling.ts index bc38c8ff1..81dbb9f53 100644 --- a/apps/dokploy/server/api/routers/proprietary/whitelabeling.ts +++ b/apps/dokploy/server/api/routers/proprietary/whitelabeling.ts @@ -85,7 +85,7 @@ export const whitelabelingRouter = createTRPCRouter({ docsUrl: null, errorPageTitle: null, errorPageDescription: null, - metaTitle: null, + ogImageUrl: null, footerText: null, }, }); diff --git a/packages/server/src/db/schema/web-server-settings.ts b/packages/server/src/db/schema/web-server-settings.ts index c5e84d7b7..ab513e283 100644 --- a/packages/server/src/db/schema/web-server-settings.ts +++ b/packages/server/src/db/schema/web-server-settings.ts @@ -86,8 +86,8 @@ export const webServerSettings = pgTable("webServerSettings", { docsUrl: string | null; errorPageTitle: string | null; errorPageDescription: string | null; - metaTitle: string | null; footerText: string | null; + ogImageUrl: string | null; }>() .default({ appName: null, @@ -100,8 +100,8 @@ export const webServerSettings = pgTable("webServerSettings", { docsUrl: null, errorPageTitle: null, errorPageDescription: null, - metaTitle: null, footerText: null, + ogImageUrl: null, }), // Deployment Configuration (self-hosted only) remoteServersOnly: boolean("remoteServersOnly").notNull().default(false), @@ -223,8 +223,8 @@ export const whitelabelingConfigSchema = z.object({ docsUrl: safeUrl, errorPageTitle: z.string().nullable(), errorPageDescription: z.string().nullable(), - metaTitle: z.string().nullable(), footerText: z.string().nullable(), + ogImageUrl: safeUrl, }); export const apiUpdateWhitelabeling = z.object({ diff --git a/packages/server/src/services/proprietary/whitelabeling.ts b/packages/server/src/services/proprietary/whitelabeling.ts index c1d6e39db..ea024774f 100644 --- a/packages/server/src/services/proprietary/whitelabeling.ts +++ b/packages/server/src/services/proprietary/whitelabeling.ts @@ -10,7 +10,7 @@ export interface PublicWhitelabelingConfig { loginLogoUrl: string | null; faviconUrl: string | null; customCss: string | null; - metaTitle: string | null; + ogImageUrl: string | null; errorPageTitle: string | null; errorPageDescription: string | null; footerText: string | null; @@ -50,7 +50,7 @@ export const getPublicWhitelabelingConfig = loginLogoUrl: config.loginLogoUrl, faviconUrl: config.faviconUrl, customCss: config.customCss, - metaTitle: config.metaTitle, + ogImageUrl: config.ogImageUrl, errorPageTitle: config.errorPageTitle, errorPageDescription: config.errorPageDescription, footerText: config.footerText,