Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 232 additions & 0 deletions apps/dokploy/components/dashboard/settings/whitelabel-form.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
"use client";

import { ImageIcon, Loader2 } from "lucide-react";
import { useTranslation } from "next-i18next";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { zodResolver } from "@hookform/resolvers/zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";

type WhitelabelForm = {
whitelabelLogoUrl: string | null;
whitelabelBrandName: string | null;
whitelabelTagline: string | null;
};

export const WhitelabelForm = () => {
const { data: settings, refetch, isLoading } = api.settings.getWebServerSettings.useQuery();
const { mutateAsync, isError, error, isLoading: isUpdating } = api.settings.updateWhitelabel.useMutation();
const { t } = useTranslation("settings");

const whitelabelSchema = z.object({
whitelabelLogoUrl: z
.string()
.optional()
.nullable()
.refine(
(url) => {
if (!url || url.trim() === "") return true;
try {
const parsedUrl = new URL(url);
return parsedUrl.protocol === "https:";
} catch {
return false;
}
},
(url) => {
if (!url || url.trim() === "") return true;
try {
new URL(url);
return t("settings.whitelabel.validation.httpsRequired");
} catch {
return t("settings.whitelabel.validation.invalidUrl");
}
},
)
.transform((val) => (val && val.trim() !== "" ? val.trim() : null)),
whitelabelBrandName: z
.string()
.max(100, t("settings.whitelabel.validation.maxLength", { max: 100 }))
.optional()
.nullable()
.transform((val) => (val && val.trim() !== "" ? val.trim() : null)),
whitelabelTagline: z
.string()
.max(200, t("settings.whitelabel.validation.maxLength", { max: 200 }))
.optional()
.nullable()
.transform((val) => (val && val.trim() !== "" ? val.trim() : null)),
});

const form = useForm<WhitelabelForm>({
resolver: zodResolver(whitelabelSchema),
defaultValues: {
whitelabelLogoUrl: null,
whitelabelBrandName: null,
whitelabelTagline: null,
},
});

useEffect(() => {
if (settings) {
form.reset({
whitelabelLogoUrl: settings.whitelabelLogoUrl || null,
whitelabelBrandName: settings.whitelabelBrandName || null,
whitelabelTagline: settings.whitelabelTagline || null,
});
}
}, [settings, form]);

const onSubmit = async (data: WhitelabelForm) => {
try {
await mutateAsync({
whitelabelLogoUrl: data.whitelabelLogoUrl || null,
whitelabelBrandName: data.whitelabelBrandName || null,
whitelabelTagline: data.whitelabelTagline || null,
});
toast.success(t("settings.whitelabel.success"));
await refetch();
} catch (error) {
toast.error(t("settings.whitelabel.error"));
}
};


return (
<div className="w-full">
<Card className="h-full bg-sidebar p-2.5 rounded-xl max-w-5xl mx-auto">
<div className="rounded-xl bg-background shadow-md">
<CardHeader>
<CardTitle className="text-xl flex flex-row gap-2">
<ImageIcon className="size-6 text-muted-foreground self-center" />
{t("settings.whitelabel.title")}
</CardTitle>
<CardDescription>
{t("settings.whitelabel.description")}
</CardDescription>
</CardHeader>

<CardContent className="space-y-2 py-8 border-t">
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
{isLoading ? (
<div className="flex flex-row gap-2 items-center justify-center text-sm text-muted-foreground min-h-[35vh]">
<span>{t("settings.common.loading")}</span>
<Loader2 className="animate-spin size-4" />
</div>
) : (
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
className="space-y-6"
>
<FormField
control={form.control}
name="whitelabelLogoUrl"
render={({ field }) => (
<FormItem>
<FormLabel>
{t("settings.whitelabel.logoUrl")}
</FormLabel>
<FormControl>
<Input
placeholder={t("settings.whitelabel.logoUrlPlaceholder")}
{...field}
value={field.value || ""}
maxLength={500}
/>
</FormControl>
<FormDescription>
{t("settings.whitelabel.logoUrlDescription")}
</FormDescription>
<FormMessage />
</FormItem>
)}
/>

<FormField
control={form.control}
name="whitelabelBrandName"
render={({ field }) => (
<FormItem>
<FormLabel>
{t("settings.whitelabel.brandName")}
</FormLabel>
<FormControl>
<Input
placeholder={t("settings.whitelabel.brandNamePlaceholder")}
{...field}
value={field.value || ""}
maxLength={100}
/>
</FormControl>
<FormDescription>
{t("settings.whitelabel.brandNameDescription")}
</FormDescription>
<FormMessage />
</FormItem>
)}
/>

<FormField
control={form.control}
name="whitelabelTagline"
render={({ field }) => (
<FormItem>
<FormLabel>
{t("settings.whitelabel.tagline")}
</FormLabel>
<FormControl>
<Input
placeholder={t("settings.whitelabel.taglinePlaceholder")}
{...field}
value={field.value || ""}
maxLength={200}
/>
</FormControl>
<FormDescription>
{t("settings.whitelabel.taglineDescription")}
</FormDescription>
<FormMessage />
</FormItem>
)}
/>

<div className="flex justify-end">
<Button
type="submit"
isLoading={isUpdating}
disabled={isUpdating}
>
{t("settings.common.save")}
</Button>
</div>
</form>
</Form>
)}
</CardContent>
</div>
</Card>
</div>
);
};
30 changes: 25 additions & 5 deletions apps/dokploy/components/layouts/onboarding-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,22 @@ import { Button } from "../ui/button";

interface Props {
children: React.ReactNode;
whitelabelLogoUrl?: string | null;
whitelabelBrandName?: string | null;
whitelabelTagline?: string | null;
}
export const OnboardingLayout = ({ children }: Props) => {

export const OnboardingLayout = ({
children,
whitelabelLogoUrl,
whitelabelBrandName,
whitelabelTagline,
}: Props) => {
const brandName = whitelabelBrandName || "Dokploy";
const tagline =
whitelabelTagline ||
"The Open Source alternative to Netlify, Vercel, Heroku.";

return (
<div className="container relative min-h-svh flex-col items-center justify-center flex lg:max-w-none lg:grid lg:grid-cols-2 lg:px-0 w-full">
<div className="relative hidden h-full flex-col p-10 text-primary dark:border-r lg:flex">
Expand All @@ -17,14 +31,20 @@ export const OnboardingLayout = ({ children }: Props) => {
href="https://dokploy.com"
className="relative z-20 flex items-center text-lg font-medium gap-4 text-primary"
>
<Logo className="size-10" />
Dokploy
<Logo className="size-10" logoUrl={whitelabelLogoUrl || undefined} />
<div className="flex flex-col">
<span>{brandName}</span>
{whitelabelBrandName && (
<span className="text-xs text-muted-foreground">
powered by Dokploy
</span>
)}
</div>
</Link>
<div className="relative z-20 mt-auto">
<blockquote className="space-y-2">
<p className="text-lg text-primary">
&ldquo;The Open Source alternative to Netlify, Vercel,
Heroku.&rdquo;
&ldquo;{tagline}&rdquo;
</p>
</blockquote>
</div>
Expand Down
10 changes: 10 additions & 0 deletions apps/dokploy/components/layouts/side.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
Forward,
GalleryVerticalEnd,
GitBranch,
ImageIcon,
KeyRound,
Loader2,
type LucideIcon,
Expand Down Expand Up @@ -396,6 +397,15 @@ const MENU: Menu = {
// Only enabled for admins in cloud environments
isEnabled: ({ auth, isCloud }) => !!(auth?.role === "owner" && isCloud),
},
{
isSingle: true,
title: "Whitelabel",
url: "/dashboard/settings/whitelabel",
icon: ImageIcon,
// Only enabled for admins in non-cloud environments
isEnabled: ({ auth, isCloud }) =>
!!((auth?.role === "owner" || auth?.role === "admin") && !isCloud),
},
],

help: [
Expand Down
35 changes: 34 additions & 1 deletion apps/dokploy/components/shared/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,40 @@ interface Props {
}

export const Logo = ({ className = "size-14", logoUrl }: Props) => {
if (logoUrl) {
if (logoUrl && logoUrl.trim() !== "") {
// Validate URL to prevent XSS
try {
const url = new URL(logoUrl);
if (url.protocol !== "https:") {
// Fallback to default logo if not HTTPS
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 559 446"
className={className}
>
<path
className="fill-primary stroke-primary"
d="M390 56v12c.1 2.3.5 4 1 6a73 73 0 0 0 12 24c2 2.3 5.7 4 7 7 4 3.4 9.6 6.8 14 9 1.7.6 5.7 1.1 7 2 1.9 1.3 2.9 2.3 0 4v1c-.6 1.8-1.9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2.3 8-3 15.6-3.9 36.3-1 53-1 5.2 0 12-.5 17 0s12.2-1.8 16 1Z"
/>
</svg>
);
}
} catch {
// Invalid URL, fallback to default
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 559 446"
className={className}
>
<path
className="fill-primary stroke-primary"
d="M390 56v12c.1 2.3.5 4 1 6a73 73 0 0 0 12 24c2 2.3 5.7 4 7 7 4 3.4 9.6 6.8 14 9 1.7.6 5.7 1.1 7 2 1.9 1.3 2.9 2.3 0 4v1c-.6 1.8-1.9 3.5-3 5q-3 4-7 7c-4.3 3.2-9.5 6.8-15 7h-1q-2 1.6-5 2h-4c-5.2.7-12.9 2.2-18 0h-6c-1.6 0-3-.8-4-1h-3a17 17 0 0 1-6-2h-1c-2.5-.1-4-1.2-6-2l-4-1c-8.4-2-20.3-6.6-27-12h-1c-4.6-1-9.5-4.3-13.7-6.3s-10.5-3-13.3-6.7h-1c-4-1-8.9-3.5-12-6h-1c-6.8-1.6-13.6-6-20-9-6.5-2.8-14.6-5.7-20-10h-1c-7-1.2-15.4-4-22-6h-97c-5.3 4.3-13.7 4.3-18.7 10.3S90.8 101 88 108c-.4 1.5-.8 2.3-1 4-.2 1.6-.8 4-1 5v51c.2 1.2.8 3.2 1 5 .2 2 .5 3.2 1 5a79 79 0 0 0 6 12c.8.7 1.4 2.2 2 3 1.8 2 4.9 3.4 6 6 9.5 8.3 23.5 10.3 33 18h1c5.1 1.2 12 4.8 16 8h1c4 1 8.9 3.5 12 6h1q4.6 1.2 8 4h1c2 .1 2.6 1.3 4 2 1.6.8 2.7.7 4 2h1q2.5.3 4 2h1c3 .7 6.7 2 9 4h1c4.7.8 13.4 3.1 17 6h1c2.5.1 4 1.3 6 2 1.8.4 3 .8 5 1q3 .4 5 1c1.6-.2 2 0 3 1h1q2.5-.5 4 1h1q2.5-.5 4 1h1c2.2-.2 4.5-.3 6 1h1q4-.4 7 1h45c1.2-.2 3.1-1 5-1h6c1.5-.6 2.9-1.3 5-1h1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1h-3c-1.8 0-2.9-.7-4-1-3.5-.8-7-.7-10-2h-1c-4.1-.7-9.8-1.4-13-4h-1q-4-.6-7-3h-1q-2.5-.2-4-2h-1q-3.4-.9-6-3h-1c-7.2-1.7-13.3-5.9-20.2-8.8-7-2.8-16.2-4.3-22.8-7.2h-11c-14 0-28.9.3-42-1-2.3 0-4.8.3-7 0a6 6 0 0 1-5-5c-1.8-4.8-.4-10.4 0-15 0-4.3-.4-8.7 0-13 .2-3.2 2.2-7.3 4-10q2-3 5-5c2.1-2 5.4-2.3 8-3 15.6-3.9 36.3-1 53-1 5.2 0 12-.5 17 0s12.2-1.8 16 1Z"
/>
</svg>
);
}
return (
<img
src={logoUrl}
Expand Down
4 changes: 4 additions & 0 deletions apps/dokploy/drizzle/0137_add_whitelabel_fields.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Add whitelabel fields to webServerSettings table
ALTER TABLE "webServerSettings" ADD COLUMN IF NOT EXISTS "whitelabelLogoUrl" text;
ALTER TABLE "webServerSettings" ADD COLUMN IF NOT EXISTS "whitelabelBrandName" text;
ALTER TABLE "webServerSettings" ADD COLUMN IF NOT EXISTS "whitelabelTagline" text;
18 changes: 16 additions & 2 deletions apps/dokploy/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ import { api } from "@/utils/api";
const inter = Inter({ subsets: ["latin"] });

export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
getLayout?: (page: ReactElement) => ReactNode;
getLayout?: (
page: ReactElement,
whitelabelProps?: {
whitelabelLogoUrl?: string | null;
whitelabelBrandName?: string | null;
whitelabelTagline?: string | null;
},
) => ReactNode;
theme?: string;
};

Expand All @@ -29,6 +36,13 @@ const MyApp = ({
pageProps: { ...pageProps },
}: AppPropsWithLayout) => {
const getLayout = Component.getLayout ?? ((page) => page);

// Extract whitelabel props for OnboardingLayout
const whitelabelProps = {
whitelabelLogoUrl: pageProps.whitelabelLogoUrl,
whitelabelBrandName: pageProps.whitelabelBrandName,
whitelabelTagline: pageProps.whitelabelTagline,
};

return (
<>
Expand All @@ -52,7 +66,7 @@ const MyApp = ({
<NextTopLoader color="hsl(var(--sidebar-ring))" />
<Toaster richColors />
<SearchCommand />
{getLayout(<Component {...pageProps} />)}
{getLayout(<Component {...pageProps} />, whitelabelProps)}
</ThemeProvider>
</>
);
Expand Down
Loading