Merge pull request #3718 from Dokploy/feat/remove-internationalization

chore(dependencies): update zod version across multiple packages to 3…
This commit is contained in:
Mauricio Siu
2026-02-16 13:23:26 -06:00
committed by GitHub
32 changed files with 2608 additions and 2682 deletions
+1 -1
View File
@@ -20,7 +20,7 @@
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"redis": "4.7.0", "redis": "4.7.0",
"zod": "^3.25.32" "zod": "^3.25.76"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20.16.0", "@types/node": "^20.16.0",
@@ -1,6 +1,5 @@
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { Loader2, Palette, User } from "lucide-react"; import { Loader2, Palette, User } from "lucide-react";
import { useTranslation } from "next-i18next";
import { useEffect, useMemo, useRef, useState } from "react"; import { useEffect, useMemo, useRef, useState } from "react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { toast } from "sonner"; import { toast } from "sonner";
@@ -73,7 +72,6 @@ export const ProfileForm = () => {
isError, isError,
error, error,
} = api.user.update.useMutation(); } = api.user.update.useMutation();
const { t } = useTranslation("settings");
const [gravatarHash, setGravatarHash] = useState<string | null>(null); const [gravatarHash, setGravatarHash] = useState<string | null>(null);
const colorInputRef = useRef<HTMLInputElement>(null); const colorInputRef = useRef<HTMLInputElement>(null);
@@ -157,10 +155,10 @@ export const ProfileForm = () => {
<div> <div>
<CardTitle className="text-xl flex flex-row gap-2"> <CardTitle className="text-xl flex flex-row gap-2">
<User className="size-6 text-muted-foreground self-center" /> <User className="size-6 text-muted-foreground self-center" />
{t("settings.profile.title")} Account
</CardTitle> </CardTitle>
<CardDescription> <CardDescription>
{t("settings.profile.description")} Change the details of your profile here.
</CardDescription> </CardDescription>
</div> </div>
@@ -213,12 +211,9 @@ export const ProfileForm = () => {
name="email" name="email"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel>{t("settings.profile.email")}</FormLabel> <FormLabel>Email</FormLabel>
<FormControl> <FormControl>
<Input <Input placeholder="Email" {...field} />
placeholder={t("settings.profile.email")}
{...field}
/>
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>
@@ -233,7 +228,7 @@ export const ProfileForm = () => {
<FormControl> <FormControl>
<Input <Input
type="password" type="password"
placeholder={t("settings.profile.password")} placeholder="Current Password"
{...field} {...field}
value={field.value || ""} value={field.value || ""}
/> />
@@ -247,13 +242,11 @@ export const ProfileForm = () => {
name="password" name="password"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel> <FormLabel>Password</FormLabel>
{t("settings.profile.password")}
</FormLabel>
<FormControl> <FormControl>
<Input <Input
type="password" type="password"
placeholder={t("settings.profile.password")} placeholder="Password"
{...field} {...field}
value={field.value || ""} value={field.value || ""}
/> />
@@ -268,9 +261,7 @@ export const ProfileForm = () => {
name="image" name="image"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel> <FormLabel>Avatar</FormLabel>
{t("settings.profile.avatar")}
</FormLabel>
<FormControl> <FormControl>
<RadioGroup <RadioGroup
onValueChange={(e) => { onValueChange={(e) => {
@@ -454,7 +445,7 @@ export const ProfileForm = () => {
<div className="flex items-center justify-end gap-2"> <div className="flex items-center justify-end gap-2">
<Button type="submit" isLoading={isUpdating}> <Button type="submit" isLoading={isUpdating}>
{t("settings.common.save")} Save
</Button> </Button>
</div> </div>
</form> </form>
@@ -1,4 +1,3 @@
import { useTranslation } from "next-i18next";
import { toast } from "sonner"; import { toast } from "sonner";
import { UpdateServerIp } from "@/components/dashboard/settings/web-server/update-server-ip"; import { UpdateServerIp } from "@/components/dashboard/settings/web-server/update-server-ip";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
@@ -17,7 +16,6 @@ import { TerminalModal } from "../../web-server/terminal-modal";
import { GPUSupportModal } from "../gpu-support-modal"; import { GPUSupportModal } from "../gpu-support-modal";
export const ShowDokployActions = () => { export const ShowDokployActions = () => {
const { t } = useTranslation("settings");
const { mutateAsync: reloadServer, isLoading } = const { mutateAsync: reloadServer, isLoading } =
api.settings.reloadServer.useMutation(); api.settings.reloadServer.useMutation();
@@ -30,13 +28,11 @@ export const ShowDokployActions = () => {
<DropdownMenu> <DropdownMenu>
<DropdownMenuTrigger asChild disabled={isLoading}> <DropdownMenuTrigger asChild disabled={isLoading}>
<Button isLoading={isLoading} variant="outline"> <Button isLoading={isLoading} variant="outline">
{t("settings.server.webServer.server.label")} Server
</Button> </Button>
</DropdownMenuTrigger> </DropdownMenuTrigger>
<DropdownMenuContent className="w-56" align="start"> <DropdownMenuContent className="w-56" align="start">
<DropdownMenuLabel> <DropdownMenuLabel>Actions</DropdownMenuLabel>
{t("settings.server.webServer.actions")}
</DropdownMenuLabel>
<DropdownMenuSeparator /> <DropdownMenuSeparator />
<DropdownMenuGroup> <DropdownMenuGroup>
<DropdownMenuItem <DropdownMenuItem
@@ -51,17 +47,17 @@ export const ShowDokployActions = () => {
}} }}
className="cursor-pointer" className="cursor-pointer"
> >
<span>{t("settings.server.webServer.reload")}</span> <span>Reload</span>
</DropdownMenuItem> </DropdownMenuItem>
<TerminalModal serverId="local"> <TerminalModal serverId="local">
<span>{t("settings.common.enterTerminal")}</span> <span>Terminal</span>
</TerminalModal> </TerminalModal>
<ShowModalLogs appName="dokploy"> <ShowModalLogs appName="dokploy">
<DropdownMenuItem <DropdownMenuItem
className="cursor-pointer" className="cursor-pointer"
onSelect={(e) => e.preventDefault()} onSelect={(e) => e.preventDefault()}
> >
{t("settings.server.webServer.watchLogs")} View Logs
</DropdownMenuItem> </DropdownMenuItem>
</ShowModalLogs> </ShowModalLogs>
<GPUSupportModal /> <GPUSupportModal />
@@ -70,7 +66,7 @@ export const ShowDokployActions = () => {
className="cursor-pointer" className="cursor-pointer"
onSelect={(e) => e.preventDefault()} onSelect={(e) => e.preventDefault()}
> >
{t("settings.server.webServer.updateServerIp")} Update Server IP
</DropdownMenuItem> </DropdownMenuItem>
</UpdateServerIp> </UpdateServerIp>
@@ -1,4 +1,3 @@
import { useTranslation } from "next-i18next";
import { toast } from "sonner"; import { toast } from "sonner";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { import {
@@ -16,7 +15,6 @@ interface Props {
serverId?: string; serverId?: string;
} }
export const ShowStorageActions = ({ serverId }: Props) => { export const ShowStorageActions = ({ serverId }: Props) => {
const { t } = useTranslation("settings");
const { mutateAsync: cleanAll, isLoading: cleanAllIsLoading } = const { mutateAsync: cleanAll, isLoading: cleanAllIsLoading } =
api.settings.cleanAll.useMutation(); api.settings.cleanAll.useMutation();
@@ -64,13 +62,11 @@ export const ShowStorageActions = ({ serverId }: Props) => {
} }
variant="outline" variant="outline"
> >
{t("settings.server.webServer.storage.label")} Space
</Button> </Button>
</DropdownMenuTrigger> </DropdownMenuTrigger>
<DropdownMenuContent className="w-64" align="start"> <DropdownMenuContent className="w-64" align="start">
<DropdownMenuLabel> <DropdownMenuLabel>Actions</DropdownMenuLabel>
{t("settings.server.webServer.actions")}
</DropdownMenuLabel>
<DropdownMenuSeparator /> <DropdownMenuSeparator />
<DropdownMenuGroup> <DropdownMenuGroup>
<DropdownMenuItem <DropdownMenuItem
@@ -87,9 +83,7 @@ export const ShowStorageActions = ({ serverId }: Props) => {
}); });
}} }}
> >
<span> <span>Clean unused images</span>
{t("settings.server.webServer.storage.cleanUnusedImages")}
</span>
</DropdownMenuItem> </DropdownMenuItem>
<DropdownMenuItem <DropdownMenuItem
className="w-full cursor-pointer" className="w-full cursor-pointer"
@@ -105,9 +99,7 @@ export const ShowStorageActions = ({ serverId }: Props) => {
}); });
}} }}
> >
<span> <span>Clean unused volumes</span>
{t("settings.server.webServer.storage.cleanUnusedVolumes")}
</span>
</DropdownMenuItem> </DropdownMenuItem>
<DropdownMenuItem <DropdownMenuItem
@@ -124,9 +116,7 @@ export const ShowStorageActions = ({ serverId }: Props) => {
}); });
}} }}
> >
<span> <span>Clean stopped containers</span>
{t("settings.server.webServer.storage.cleanStoppedContainers")}
</span>
</DropdownMenuItem> </DropdownMenuItem>
<DropdownMenuItem <DropdownMenuItem
@@ -143,9 +133,7 @@ export const ShowStorageActions = ({ serverId }: Props) => {
}); });
}} }}
> >
<span> <span>Clean Docker Builder & System</span>
{t("settings.server.webServer.storage.cleanDockerBuilder")}
</span>
</DropdownMenuItem> </DropdownMenuItem>
{!serverId && ( {!serverId && (
<DropdownMenuItem <DropdownMenuItem
@@ -160,9 +148,7 @@ export const ShowStorageActions = ({ serverId }: Props) => {
}); });
}} }}
> >
<span> <span>Clean Monitoring</span>
{t("settings.server.webServer.storage.cleanMonitoring")}
</span>
</DropdownMenuItem> </DropdownMenuItem>
)} )}
@@ -180,7 +166,7 @@ export const ShowStorageActions = ({ serverId }: Props) => {
}); });
}} }}
> >
<span>{t("settings.server.webServer.storage.cleanAll")}</span> <span>Clean all</span>
</DropdownMenuItem> </DropdownMenuItem>
</DropdownMenuGroup> </DropdownMenuGroup>
</DropdownMenuContent> </DropdownMenuContent>
@@ -1,4 +1,3 @@
import { useTranslation } from "next-i18next";
import { toast } from "sonner"; import { toast } from "sonner";
import { AlertBlock } from "@/components/shared/alert-block"; import { AlertBlock } from "@/components/shared/alert-block";
import { DialogAction } from "@/components/shared/dialog-action"; import { DialogAction } from "@/components/shared/dialog-action";
@@ -22,7 +21,6 @@ interface Props {
serverId?: string; serverId?: string;
} }
export const ShowTraefikActions = ({ serverId }: Props) => { export const ShowTraefikActions = ({ serverId }: Props) => {
const { t } = useTranslation("settings");
const { mutateAsync: reloadTraefik, isLoading: reloadTraefikIsLoading } = const { mutateAsync: reloadTraefik, isLoading: reloadTraefikIsLoading } =
api.settings.reloadTraefik.useMutation(); api.settings.reloadTraefik.useMutation();
@@ -75,13 +73,11 @@ export const ShowTraefikActions = ({ serverId }: Props) => {
} }
variant="outline" variant="outline"
> >
{t("settings.server.webServer.traefik.label")} Traefik
</Button> </Button>
</DropdownMenuTrigger> </DropdownMenuTrigger>
<DropdownMenuContent className="w-56" align="start"> <DropdownMenuContent className="w-56" align="start">
<DropdownMenuLabel> <DropdownMenuLabel>Actions</DropdownMenuLabel>
{t("settings.server.webServer.actions")}
</DropdownMenuLabel>
<DropdownMenuSeparator /> <DropdownMenuSeparator />
<DropdownMenuGroup> <DropdownMenuGroup>
<DropdownMenuItem <DropdownMenuItem
@@ -100,7 +96,7 @@ export const ShowTraefikActions = ({ serverId }: Props) => {
className="cursor-pointer" className="cursor-pointer"
disabled={isReloadHealthCheckExecuting} disabled={isReloadHealthCheckExecuting}
> >
<span>{t("settings.server.webServer.reload")}</span> <span>Reload</span>
</DropdownMenuItem> </DropdownMenuItem>
<ShowModalLogs <ShowModalLogs
appName="dokploy-traefik" appName="dokploy-traefik"
@@ -111,7 +107,7 @@ export const ShowTraefikActions = ({ serverId }: Props) => {
onSelect={(e) => e.preventDefault()} onSelect={(e) => e.preventDefault()}
className="cursor-pointer" className="cursor-pointer"
> >
{t("settings.server.webServer.watchLogs")} View Logs
</DropdownMenuItem> </DropdownMenuItem>
</ShowModalLogs> </ShowModalLogs>
<EditTraefikEnv serverId={serverId}> <EditTraefikEnv serverId={serverId}>
@@ -119,7 +115,7 @@ export const ShowTraefikActions = ({ serverId }: Props) => {
onSelect={(e) => e.preventDefault()} onSelect={(e) => e.preventDefault()}
className="cursor-pointer" className="cursor-pointer"
> >
<span>{t("settings.server.webServer.traefik.modifyEnv")}</span> <span>Modify Environment</span>
</DropdownMenuItem> </DropdownMenuItem>
</EditTraefikEnv> </EditTraefikEnv>
@@ -176,7 +172,7 @@ export const ShowTraefikActions = ({ serverId }: Props) => {
onSelect={(e) => e.preventDefault()} onSelect={(e) => e.preventDefault()}
className="cursor-pointer" className="cursor-pointer"
> >
<span>{t("settings.server.webServer.traefik.managePorts")}</span> <span>Additional Port Mappings</span>
</DropdownMenuItem> </DropdownMenuItem>
</ManageTraefikPorts> </ManageTraefikPorts>
</DropdownMenuGroup> </DropdownMenuGroup>
@@ -1,7 +1,6 @@
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { Pencil, PlusIcon } from "lucide-react"; import { Pencil, PlusIcon } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { useTranslation } from "next-i18next";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { toast } from "sonner"; import { toast } from "sonner";
@@ -63,8 +62,6 @@ interface Props {
} }
export const HandleServers = ({ serverId, asButton = false }: Props) => { export const HandleServers = ({ serverId, asButton = false }: Props) => {
const { t } = useTranslation("settings");
const utils = api.useUtils(); const utils = api.useUtils();
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);
const { data: canCreateMoreServers, refetch } = const { data: canCreateMoreServers, refetch } =
@@ -365,7 +362,7 @@ export const HandleServers = ({ serverId, asButton = false }: Props) => {
name="ipAddress" name="ipAddress"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel>{t("settings.terminal.ipAddress")}</FormLabel> <FormLabel>IP Address</FormLabel>
<FormControl> <FormControl>
<Input placeholder="192.168.1.100" {...field} /> <Input placeholder="192.168.1.100" {...field} />
</FormControl> </FormControl>
@@ -379,7 +376,7 @@ export const HandleServers = ({ serverId, asButton = false }: Props) => {
name="port" name="port"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel>{t("settings.terminal.port")}</FormLabel> <FormLabel>Port</FormLabel>
<FormControl> <FormControl>
<Input <Input
placeholder="22" placeholder="22"
@@ -409,7 +406,7 @@ export const HandleServers = ({ serverId, asButton = false }: Props) => {
name="username" name="username"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel>{t("settings.terminal.username")}</FormLabel> <FormLabel>Username</FormLabel>
<FormControl> <FormControl>
<Input placeholder="root" {...field} /> <Input placeholder="root" {...field} />
</FormControl> </FormControl>
@@ -13,7 +13,6 @@ import {
} from "lucide-react"; } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { useTranslation } from "next-i18next";
import { toast } from "sonner"; import { toast } from "sonner";
import { AlertBlock } from "@/components/shared/alert-block"; import { AlertBlock } from "@/components/shared/alert-block";
import { DialogAction } from "@/components/shared/dialog-action"; import { DialogAction } from "@/components/shared/dialog-action";
@@ -52,7 +51,6 @@ import { ShowTraefikFileSystemModal } from "./show-traefik-file-system-modal";
import { WelcomeSuscription } from "./welcome-stripe/welcome-suscription"; import { WelcomeSuscription } from "./welcome-stripe/welcome-suscription";
export const ShowServers = () => { export const ShowServers = () => {
const { t } = useTranslation("settings");
const router = useRouter(); const router = useRouter();
const query = router.query; const query = router.query;
const { data, refetch, isLoading } = api.server.all.useQuery(); const { data, refetch, isLoading } = api.server.all.useQuery();
@@ -1,6 +1,5 @@
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { GlobeIcon } from "lucide-react"; import { GlobeIcon } from "lucide-react";
import { useTranslation } from "next-i18next";
import { useEffect } from "react"; import { useEffect } from "react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { toast } from "sonner"; import { toast } from "sonner";
@@ -66,7 +65,6 @@ const addServerDomain = z
type AddServerDomain = z.infer<typeof addServerDomain>; type AddServerDomain = z.infer<typeof addServerDomain>;
export const WebDomain = () => { export const WebDomain = () => {
const { t } = useTranslation("settings");
const { data, refetch } = api.settings.getWebServerSettings.useQuery(); const { data, refetch } = api.settings.getWebServerSettings.useQuery();
const { mutateAsync, isLoading } = const { mutateAsync, isLoading } =
api.settings.assignDomainServer.useMutation(); api.settings.assignDomainServer.useMutation();
@@ -119,10 +117,10 @@ export const WebDomain = () => {
<div className="flex flex-col gap-1"> <div className="flex flex-col gap-1">
<CardTitle className="text-xl flex flex-row gap-2"> <CardTitle className="text-xl flex flex-row gap-2">
<GlobeIcon className="size-6 text-muted-foreground self-center" /> <GlobeIcon className="size-6 text-muted-foreground self-center" />
{t("settings.server.domain.title")} Server Domain
</CardTitle> </CardTitle>
<CardDescription> <CardDescription>
{t("settings.server.domain.description")} Add a domain to your server application.
</CardDescription> </CardDescription>
</div> </div>
</CardHeader> </CardHeader>
@@ -151,9 +149,7 @@ export const WebDomain = () => {
render={({ field }) => { render={({ field }) => {
return ( return (
<FormItem> <FormItem>
<FormLabel> <FormLabel>Domain</FormLabel>
{t("settings.server.domain.form.domain")}
</FormLabel>
<FormControl> <FormControl>
<Input <Input
className="w-full" className="w-full"
@@ -173,9 +169,7 @@ export const WebDomain = () => {
render={({ field }) => { render={({ field }) => {
return ( return (
<FormItem> <FormItem>
<FormLabel> <FormLabel>Let's Encrypt Email</FormLabel>
{t("settings.server.domain.form.letsEncryptEmail")}
</FormLabel>
<FormControl> <FormControl>
<Input <Input
className="w-full" className="w-full"
@@ -216,32 +210,20 @@ export const WebDomain = () => {
render={({ field }) => { render={({ field }) => {
return ( return (
<FormItem className="md:col-span-2"> <FormItem className="md:col-span-2">
<FormLabel> <FormLabel>Certificate Provider</FormLabel>
{t("settings.server.domain.form.certificate.label")}
</FormLabel>
<Select <Select
onValueChange={field.onChange} onValueChange={field.onChange}
value={field.value} value={field.value}
> >
<FormControl> <FormControl>
<SelectTrigger> <SelectTrigger>
<SelectValue <SelectValue placeholder="Select a certificate" />
placeholder={t(
"settings.server.domain.form.certificate.placeholder",
)}
/>
</SelectTrigger> </SelectTrigger>
</FormControl> </FormControl>
<SelectContent> <SelectContent>
<SelectItem value={"none"}> <SelectItem value={"none"}>None</SelectItem>
{t(
"settings.server.domain.form.certificateOptions.none",
)}
</SelectItem>
<SelectItem value={"letsencrypt"}> <SelectItem value={"letsencrypt"}>
{t( Let's Encrypt
"settings.server.domain.form.certificateOptions.letsencrypt",
)}
</SelectItem> </SelectItem>
</SelectContent> </SelectContent>
</Select> </Select>
@@ -254,7 +236,7 @@ export const WebDomain = () => {
<div className="flex w-full justify-end col-span-2"> <div className="flex w-full justify-end col-span-2">
<Button isLoading={isLoading} type="submit"> <Button isLoading={isLoading} type="submit">
{t("settings.common.save")} Save
</Button> </Button>
</div> </div>
</form> </form>
@@ -1,5 +1,4 @@
import { ServerIcon } from "lucide-react"; import { ServerIcon } from "lucide-react";
import { useTranslation } from "next-i18next";
import { import {
Card, Card,
CardContent, CardContent,
@@ -15,7 +14,6 @@ import { ToggleDockerCleanup } from "./servers/actions/toggle-docker-cleanup";
import { UpdateServer } from "./web-server/update-server"; import { UpdateServer } from "./web-server/update-server";
export const WebServer = () => { export const WebServer = () => {
const { t } = useTranslation("settings");
const { data: webServerSettings } = const { data: webServerSettings } =
api.settings.getWebServerSettings.useQuery(); api.settings.getWebServerSettings.useQuery();
@@ -29,18 +27,16 @@ export const WebServer = () => {
<CardHeader className=""> <CardHeader className="">
<CardTitle className="text-xl flex flex-row gap-2"> <CardTitle className="text-xl flex flex-row gap-2">
<ServerIcon className="size-6 text-muted-foreground self-center" /> <ServerIcon className="size-6 text-muted-foreground self-center" />
{t("settings.server.webServer.title")} Web Server
</CardTitle> </CardTitle>
<CardDescription> <CardDescription>Reload or clean the web server.</CardDescription>
{t("settings.server.webServer.description")}
</CardDescription>
</CardHeader> </CardHeader>
{/* <CardHeader> {/* <CardHeader>
<CardTitle className="text-xl"> <CardTitle className="text-xl">
{t("settings.server.webServer.title")} Web Server
</CardTitle> </CardTitle>
<CardDescription> <CardDescription>
{t("settings.server.webServer.description")} Reload or clean the web server.
</CardDescription> </CardDescription>
</CardHeader> */} </CardHeader> */}
<CardContent className="space-y-6 py-6 border-t"> <CardContent className="space-y-6 py-6 border-t">
@@ -1,6 +1,5 @@
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { Settings } from "lucide-react"; import { Settings } from "lucide-react";
import { useTranslation } from "next-i18next";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { z } from "zod"; import { z } from "zod";
import { import {
@@ -52,8 +51,6 @@ interface Props {
} }
const LocalServerConfig = ({ onSave }: Props) => { const LocalServerConfig = ({ onSave }: Props) => {
const { t } = useTranslation("settings");
const form = useForm<Schema>({ const form = useForm<Schema>({
defaultValues: getLocalServerData(), defaultValues: getLocalServerData(),
resolver: zodResolver(Schema), resolver: zodResolver(Schema),
@@ -77,9 +74,7 @@ const LocalServerConfig = ({ onSave }: Props) => {
<div className="flex flex-row items-center gap-2 justify-between w-full"> <div className="flex flex-row items-center gap-2 justify-between w-full">
<div className="flex flex-row gap-2 items-center"> <div className="flex flex-row gap-2 items-center">
<Settings className="h-4 w-4" /> <Settings className="h-4 w-4" />
<span className="dark:hover:text-white"> <span className="dark:hover:text-white">Connection settings</span>
{t("settings.terminal.connectionSettings")}
</span>
</div> </div>
</div> </div>
</AccordionTrigger> </AccordionTrigger>
@@ -96,7 +91,7 @@ const LocalServerConfig = ({ onSave }: Props) => {
name="port" name="port"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel>{t("settings.terminal.port")}</FormLabel> <FormLabel>Port</FormLabel>
<FormControl> <FormControl>
<Input <Input
{...field} {...field}
@@ -124,7 +119,7 @@ const LocalServerConfig = ({ onSave }: Props) => {
name="username" name="username"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel>{t("settings.terminal.username")}</FormLabel> <FormLabel>Username</FormLabel>
<FormControl> <FormControl>
<Input placeholder="root" {...field} /> <Input placeholder="root" {...field} />
</FormControl> </FormControl>
@@ -142,7 +137,7 @@ const LocalServerConfig = ({ onSave }: Props) => {
className="ml-auto" className="ml-auto"
disabled={!form.formState.isDirty} disabled={!form.formState.isDirty}
> >
{t("settings.common.save")} Save
</Button> </Button>
</AccordionContent> </AccordionContent>
</AccordionItem> </AccordionItem>
@@ -1,6 +1,5 @@
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { ArrowRightLeft, Plus, Trash2 } from "lucide-react"; import { ArrowRightLeft, Plus, Trash2 } from "lucide-react";
import { useTranslation } from "next-i18next";
import { useHealthCheckAfterMutation } from "@/hooks/use-health-check-after-mutation"; import { useHealthCheckAfterMutation } from "@/hooks/use-health-check-after-mutation";
import type React from "react"; import type React from "react";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
@@ -56,7 +55,6 @@ const TraefikPortsSchema = z.object({
type TraefikPortsForm = z.infer<typeof TraefikPortsSchema>; type TraefikPortsForm = z.infer<typeof TraefikPortsSchema>;
export const ManageTraefikPorts = ({ children, serverId }: Props) => { export const ManageTraefikPorts = ({ children, serverId }: Props) => {
const { t } = useTranslation("settings");
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const form = useForm<TraefikPortsForm>({ const form = useForm<TraefikPortsForm>({
@@ -84,7 +82,7 @@ export const ManageTraefikPorts = ({ children, serverId }: Props) => {
isExecuting: isHealthCheckExecuting, isExecuting: isHealthCheckExecuting,
} = useHealthCheckAfterMutation({ } = useHealthCheckAfterMutation({
initialDelay: 5000, initialDelay: 5000,
successMessage: t("settings.server.webServer.traefik.portsUpdated"), successMessage: "Ports updated successfully",
onSuccess: () => { onSuccess: () => {
refetchPorts(); refetchPorts();
setOpen(false); setOpen(false);
@@ -129,14 +127,12 @@ export const ManageTraefikPorts = ({ children, serverId }: Props) => {
<DialogContent className="sm:max-w-3xl"> <DialogContent className="sm:max-w-3xl">
<DialogHeader> <DialogHeader>
<DialogTitle className="flex items-center gap-2 text-xl"> <DialogTitle className="flex items-center gap-2 text-xl">
{t("settings.server.webServer.traefik.managePorts")} Additional Port Mappings
</DialogTitle> </DialogTitle>
<DialogDescription className="text-base w-full"> <DialogDescription className="text-base w-full">
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
<div className="flex flex-col gap-1"> <div className="flex flex-col gap-1">
{t( Add or remove additional ports for Traefik
"settings.server.webServer.traefik.managePortsDescription",
)}
<span className="text-sm text-muted-foreground"> <span className="text-sm text-muted-foreground">
{fields.length} port mapping{fields.length !== 1 ? "s" : ""}{" "} {fields.length} port mapping{fields.length !== 1 ? "s" : ""}{" "}
configured configured
@@ -179,9 +175,7 @@ export const ManageTraefikPorts = ({ children, serverId }: Props) => {
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel className="text-sm font-medium text-muted-foreground"> <FormLabel className="text-sm font-medium text-muted-foreground">
{t( Target Port
"settings.server.webServer.traefik.targetPort",
)}
</FormLabel> </FormLabel>
<FormControl> <FormControl>
<Input <Input
@@ -210,9 +204,7 @@ export const ManageTraefikPorts = ({ children, serverId }: Props) => {
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel className="text-sm font-medium text-muted-foreground"> <FormLabel className="text-sm font-medium text-muted-foreground">
{t( Published Port
"settings.server.webServer.traefik.publishedPort",
)}
</FormLabel> </FormLabel>
<FormControl> <FormControl>
<Input <Input
+13 -43
View File
@@ -10,18 +10,9 @@ import {
DropdownMenuSeparator, DropdownMenuSeparator,
DropdownMenuTrigger, DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"; } from "@/components/ui/dropdown-menu";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { authClient } from "@/lib/auth-client"; import { authClient } from "@/lib/auth-client";
import { Languages } from "@/lib/languages";
import { getFallbackAvatarInitials } from "@/lib/utils"; import { getFallbackAvatarInitials } from "@/lib/utils";
import { api } from "@/utils/api"; import { api } from "@/utils/api";
import useLocale from "@/utils/hooks/use-locale";
import { ModeToggle } from "../ui/modeToggle"; import { ModeToggle } from "../ui/modeToggle";
import { SidebarMenuButton } from "../ui/sidebar"; import { SidebarMenuButton } from "../ui/sidebar";
@@ -32,7 +23,6 @@ export const UserNav = () => {
const { data } = api.user.get.useQuery(); const { data } = api.user.get.useQuery();
const { data: isCloud } = api.settings.isCloud.useQuery(); const { data: isCloud } = api.settings.isCloud.useQuery();
const { locale, setLocale } = useLocale();
// const { mutateAsync } = api.auth.logout.useMutation(); // const { mutateAsync } = api.auth.logout.useMutation();
return ( return (
@@ -155,39 +145,19 @@ export const UserNav = () => {
</DropdownMenuItem> </DropdownMenuItem>
)} )}
<DropdownMenuSeparator /> <DropdownMenuSeparator />
<div className="flex items-center justify-between px-2 py-1.5"> <DropdownMenuItem
<DropdownMenuItem className="cursor-pointer"
className="cursor-pointer" onClick={async () => {
onClick={async () => { await authClient.signOut().then(() => {
await authClient.signOut().then(() => { router.push("/");
router.push("/"); });
}); // await mutateAsync().then(() => {
// await mutateAsync().then(() => { // router.push("/");
// router.push("/"); // });
// }); }}
}} >
> Log out
Log out </DropdownMenuItem>
</DropdownMenuItem>
<div className="w-32">
<Select
onValueChange={setLocale}
defaultValue={locale}
value={locale}
>
<SelectTrigger>
<SelectValue placeholder="Select Language" />
</SelectTrigger>
<SelectContent>
{Object.values(Languages).map((language) => (
<SelectItem key={language.code} value={language.code}>
{language.name}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
</div>
</DropdownMenuContent> </DropdownMenuContent>
</DropdownMenu> </DropdownMenu>
); );
-29
View File
@@ -1,29 +0,0 @@
/**
* Sorted list based off of population of the country / speakers of the language.
*/
export const Languages = {
english: { code: "en", name: "English" },
spanish: { code: "es", name: "Español" },
chineseSimplified: { code: "zh-Hans", name: "简体中文" },
chineseTraditional: { code: "zh-Hant", name: "繁體中文" },
portuguese: { code: "pt-br", name: "Português" },
russian: { code: "ru", name: "Русский" },
japanese: { code: "ja", name: "日本語" },
german: { code: "de", name: "Deutsch" },
korean: { code: "ko", name: "한국어" },
french: { code: "fr", name: "Français" },
turkish: { code: "tr", name: "Türkçe" },
italian: { code: "it", name: "Italiano" },
polish: { code: "pl", name: "Polski" },
ukrainian: { code: "uk", name: "Українська" },
persian: { code: "fa", name: "فارسی" },
dutch: { code: "nl", name: "Nederlands" },
indonesian: { code: "id", name: "Bahasa Indonesia" },
kazakh: { code: "kz", name: "Қазақ" },
norwegian: { code: "no", name: "Norsk" },
azerbaijani: { code: "az", name: "Azərbaycan" },
malayalam: { code: "ml", name: "മലയാളം" },
};
export type Language = keyof typeof Languages;
export type LanguageCode = (typeof Languages)[keyof typeof Languages]["code"];
-9
View File
@@ -10,15 +10,6 @@ const nextConfig = {
ignoreBuildErrors: true, ignoreBuildErrors: true,
}, },
transpilePackages: ["@dokploy/server"], transpilePackages: ["@dokploy/server"],
/**
* If you are using `appDir` then you must comment the below `i18n` config out.
*
* @see https://github.com/vercel/next.js/issues/41980
*/
i18n: {
locales: ["en"],
defaultLocale: "en",
},
async headers() { async headers() {
return [ return [
{ {
+12 -15
View File
@@ -8,7 +8,7 @@
"build": "npm run build-server && npm run build-next", "build": "npm run build-server && npm run build-next",
"start": "node -r dotenv/config dist/migration.mjs && node -r dotenv/config dist/server.mjs", "start": "node -r dotenv/config dist/migration.mjs && node -r dotenv/config dist/server.mjs",
"build-server": "tsx esbuild.config.ts", "build-server": "tsx esbuild.config.ts",
"build-next": "next build --webpack", "build-next": "next build",
"setup": "tsx -r dotenv/config setup.ts && sleep 5 && pnpm run migration:run", "setup": "tsx -r dotenv/config setup.ts && sleep 5 && pnpm run migration:run",
"wait-for-postgres": "node -r dotenv/config dist/wait-for-postgres.mjs", "wait-for-postgres": "node -r dotenv/config dist/wait-for-postgres.mjs",
"wait-for-postgres-dev": "tsx -r dotenv/config wait-for-postgres.ts", "wait-for-postgres-dev": "tsx -r dotenv/config wait-for-postgres.ts",
@@ -41,13 +41,13 @@
"dependencies": { "dependencies": {
"resend": "^6.0.2", "resend": "^6.0.2",
"@better-auth/sso": "1.4.18", "@better-auth/sso": "1.4.18",
"@ai-sdk/anthropic": "^2.0.5", "@ai-sdk/anthropic": "^3.0.44",
"@ai-sdk/azure": "^2.0.16", "@ai-sdk/azure": "^3.0.30",
"@ai-sdk/cohere": "^2.0.4", "@ai-sdk/cohere": "^3.0.21",
"@ai-sdk/deepinfra": "^1.0.10", "@ai-sdk/deepinfra": "^2.0.34",
"@ai-sdk/mistral": "^2.0.7", "@ai-sdk/mistral": "^3.0.20",
"@ai-sdk/openai": "^2.0.16", "@ai-sdk/openai": "^3.0.29",
"@ai-sdk/openai-compatible": "^1.0.10", "@ai-sdk/openai-compatible": "^2.0.30",
"@codemirror/autocomplete": "^6.18.6", "@codemirror/autocomplete": "^6.18.6",
"@codemirror/lang-json": "^6.0.1", "@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-yaml": "^6.1.2", "@codemirror/lang-yaml": "^6.1.2",
@@ -95,8 +95,8 @@
"@xterm/addon-clipboard": "0.1.0", "@xterm/addon-clipboard": "0.1.0",
"@xterm/xterm": "^5.5.0", "@xterm/xterm": "^5.5.0",
"adm-zip": "^0.5.16", "adm-zip": "^0.5.16",
"ai": "^5.0.17", "ai": "^6.0.86",
"ai-sdk-ollama": "^0.5.1", "ai-sdk-ollama": "^3.7.0",
"bcrypt": "5.1.1", "bcrypt": "5.1.1",
"better-auth": "1.4.18", "better-auth": "1.4.18",
"bl": "6.0.11", "bl": "6.0.11",
@@ -113,7 +113,6 @@
"drizzle-orm": "^0.41.0", "drizzle-orm": "^0.41.0",
"drizzle-zod": "0.5.1", "drizzle-zod": "0.5.1",
"fancy-ansi": "^0.1.3", "fancy-ansi": "^0.1.3",
"i18next": "^23.16.8",
"input-otp": "^1.4.2", "input-otp": "^1.4.2",
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"lodash": "4.17.21", "lodash": "4.17.21",
@@ -121,7 +120,6 @@
"micromatch": "4.0.8", "micromatch": "4.0.8",
"nanoid": "3.3.11", "nanoid": "3.3.11",
"next": "^16.1.6", "next": "^16.1.6",
"next-i18next": "^15.4.2",
"next-themes": "^0.2.1", "next-themes": "^0.2.1",
"nextjs-toploader": "^3.9.17", "nextjs-toploader": "^3.9.17",
"node-os-utils": "2.0.1", "node-os-utils": "2.0.1",
@@ -139,7 +137,6 @@
"react-day-picker": "8.10.1", "react-day-picker": "8.10.1",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-hook-form": "^7.56.4", "react-hook-form": "^7.56.4",
"react-i18next": "^15.5.2",
"react-markdown": "^9.1.0", "react-markdown": "^9.1.0",
"recharts": "^2.15.3", "recharts": "^2.15.3",
"slugify": "^1.6.6", "slugify": "^1.6.6",
@@ -147,7 +144,7 @@
"ssh2": "1.15.0", "ssh2": "1.15.0",
"stripe": "17.2.0", "stripe": "17.2.0",
"superjson": "^2.2.2", "superjson": "^2.2.2",
"swagger-ui-react": "^5.22.0", "swagger-ui-react": "^5.31.1",
"tailwind-merge": "^2.6.0", "tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"toml": "3.0.0", "toml": "3.0.0",
@@ -156,7 +153,7 @@
"ws": "8.16.0", "ws": "8.16.0",
"xterm-addon-fit": "^0.8.0", "xterm-addon-fit": "^0.8.0",
"yaml": "2.8.1", "yaml": "2.8.1",
"zod": "^3.25.32", "zod": "^3.25.76",
"zod-form-data": "^2.0.7", "zod-form-data": "^2.0.7",
"semver": "7.7.3" "semver": "7.7.3"
}, },
+1 -13
View File
@@ -4,13 +4,11 @@ import type { NextPage } from "next";
import type { AppProps } from "next/app"; import type { AppProps } from "next/app";
import { Inter } from "next/font/google"; import { Inter } from "next/font/google";
import Head from "next/head"; import Head from "next/head";
import { appWithTranslation } from "next-i18next";
import { ThemeProvider } from "next-themes"; import { ThemeProvider } from "next-themes";
import NextTopLoader from "nextjs-toploader"; import NextTopLoader from "nextjs-toploader";
import type { ReactElement, ReactNode } from "react"; import type { ReactElement, ReactNode } from "react";
import { SearchCommand } from "@/components/dashboard/search-command"; import { SearchCommand } from "@/components/dashboard/search-command";
import { Toaster } from "@/components/ui/sonner"; import { Toaster } from "@/components/ui/sonner";
import { Languages } from "@/lib/languages";
import { api } from "@/utils/api"; import { api } from "@/utils/api";
const inter = Inter({ subsets: ["latin"] }); const inter = Inter({ subsets: ["latin"] });
@@ -58,14 +56,4 @@ const MyApp = ({
); );
}; };
export default api.withTRPC( export default api.withTRPC(MyApp);
appWithTranslation(MyApp, {
i18n: {
defaultLocale: "en",
locales: Object.values(Languages).map((language) => language.code),
localeDetection: false,
},
fallbackLng: "en",
keySeparator: false,
}),
);
@@ -6,7 +6,6 @@ import superjson from "superjson";
import { AiForm } from "@/components/dashboard/settings/ai-form"; import { AiForm } from "@/components/dashboard/settings/ai-form";
import { DashboardLayout } from "@/components/layouts/dashboard-layout"; import { DashboardLayout } from "@/components/layouts/dashboard-layout";
import { appRouter } from "@/server/api/root"; import { appRouter } from "@/server/api/root";
import { getLocale, serverSideTranslations } from "@/utils/i18n";
const Page = () => { const Page = () => {
return ( return (
@@ -26,7 +25,6 @@ export async function getServerSideProps(
) { ) {
const { req, res } = ctx; const { req, res } = ctx;
const { user, session } = await validateRequest(req); const { user, session } = await validateRequest(req);
const locale = getLocale(req.cookies);
const helpers = createServerSideHelpers({ const helpers = createServerSideHelpers({
router: appRouter, router: appRouter,
@@ -55,7 +53,6 @@ export async function getServerSideProps(
return { return {
props: { props: {
trpcState: helpers.dehydrate(), trpcState: helpers.dehydrate(),
...(await serverSideTranslations(locale, ["settings"])),
}, },
}; };
} }
@@ -7,7 +7,6 @@ import { DashboardLayout } from "@/components/layouts/dashboard-layout";
import { LicenseKeySettings } from "@/components/proprietary/license-keys/license-key"; import { LicenseKeySettings } from "@/components/proprietary/license-keys/license-key";
import { Card } from "@/components/ui/card"; import { Card } from "@/components/ui/card";
import { appRouter } from "@/server/api/root"; import { appRouter } from "@/server/api/root";
import { getLocale, serverSideTranslations } from "@/utils/i18n";
const Page = () => { const Page = () => {
return ( return (
@@ -35,7 +34,6 @@ export async function getServerSideProps(
ctx: GetServerSidePropsContext<{ serviceId: string }>, ctx: GetServerSidePropsContext<{ serviceId: string }>,
) { ) {
const { req, res } = ctx; const { req, res } = ctx;
const locale = await getLocale(req.cookies);
const { user, session } = await validateRequest(ctx.req); const { user, session } = await validateRequest(ctx.req);
if (!user) { if (!user) {
return { return {
@@ -70,7 +68,6 @@ export async function getServerSideProps(
return { return {
props: { props: {
trpcState: helpers.dehydrate(), trpcState: helpers.dehydrate(),
...(await serverSideTranslations(locale, ["settings"])),
}, },
}; };
} }
@@ -9,7 +9,6 @@ import { ProfileForm } from "@/components/dashboard/settings/profile/profile-for
import { DashboardLayout } from "@/components/layouts/dashboard-layout"; import { DashboardLayout } from "@/components/layouts/dashboard-layout";
import { appRouter } from "@/server/api/root"; import { appRouter } from "@/server/api/root";
import { api } from "@/utils/api"; import { api } from "@/utils/api";
import { getLocale, serverSideTranslations } from "@/utils/i18n";
const Page = () => { const Page = () => {
const { data } = api.user.get.useQuery(); const { data } = api.user.get.useQuery();
@@ -37,7 +36,6 @@ export async function getServerSideProps(
ctx: GetServerSidePropsContext<{ serviceId: string }>, ctx: GetServerSidePropsContext<{ serviceId: string }>,
) { ) {
const { req, res } = ctx; const { req, res } = ctx;
const locale = getLocale(req.cookies);
const { user, session } = await validateRequest(req); const { user, session } = await validateRequest(req);
const helpers = createServerSideHelpers({ const helpers = createServerSideHelpers({
@@ -67,7 +65,6 @@ export async function getServerSideProps(
return { return {
props: { props: {
trpcState: helpers.dehydrate(), trpcState: helpers.dehydrate(),
...(await serverSideTranslations(locale, ["settings"])),
}, },
}; };
} }
@@ -10,7 +10,6 @@ import { DashboardLayout } from "@/components/layouts/dashboard-layout";
import { Card } from "@/components/ui/card"; import { Card } from "@/components/ui/card";
import { appRouter } from "@/server/api/root"; import { appRouter } from "@/server/api/root";
import { api } from "@/utils/api"; import { api } from "@/utils/api";
import { getLocale, serverSideTranslations } from "@/utils/i18n";
const Page = () => { const Page = () => {
const { data: user } = api.user.get.useQuery(); const { data: user } = api.user.get.useQuery();
@@ -42,7 +41,6 @@ export async function getServerSideProps(
ctx: GetServerSidePropsContext<{ serviceId: string }>, ctx: GetServerSidePropsContext<{ serviceId: string }>,
) { ) {
const { req, res } = ctx; const { req, res } = ctx;
const locale = await getLocale(req.cookies);
if (IS_CLOUD) { if (IS_CLOUD) {
return { return {
redirect: { redirect: {
@@ -85,7 +83,6 @@ export async function getServerSideProps(
return { return {
props: { props: {
trpcState: helpers.dehydrate(), trpcState: helpers.dehydrate(),
...(await serverSideTranslations(locale, ["settings"])),
}, },
}; };
} }
@@ -6,7 +6,6 @@ import superjson from "superjson";
import { ShowServers } from "@/components/dashboard/settings/servers/show-servers"; import { ShowServers } from "@/components/dashboard/settings/servers/show-servers";
import { DashboardLayout } from "@/components/layouts/dashboard-layout"; import { DashboardLayout } from "@/components/layouts/dashboard-layout";
import { appRouter } from "@/server/api/root"; import { appRouter } from "@/server/api/root";
import { getLocale, serverSideTranslations } from "@/utils/i18n";
const Page = () => { const Page = () => {
return ( return (
@@ -25,7 +24,6 @@ export async function getServerSideProps(
ctx: GetServerSidePropsContext<{ serviceId: string }>, ctx: GetServerSidePropsContext<{ serviceId: string }>,
) { ) {
const { req, res } = ctx; const { req, res } = ctx;
const locale = await getLocale(req.cookies);
const { user, session } = await validateRequest(req); const { user, session } = await validateRequest(req);
if (!user) { if (!user) {
return { return {
@@ -61,7 +59,6 @@ export async function getServerSideProps(
return { return {
props: { props: {
trpcState: helpers.dehydrate(), trpcState: helpers.dehydrate(),
...(await serverSideTranslations(locale, ["settings"])),
}, },
}; };
} }
@@ -8,7 +8,6 @@ import { EnterpriseFeatureGate } from "@/components/proprietary/enterprise-featu
import { SSOSettings } from "@/components/proprietary/sso/sso-settings"; import { SSOSettings } from "@/components/proprietary/sso/sso-settings";
import { Card } from "@/components/ui/card"; import { Card } from "@/components/ui/card";
import { appRouter } from "@/server/api/root"; import { appRouter } from "@/server/api/root";
import { getLocale, serverSideTranslations } from "@/utils/i18n";
const Page = () => { const Page = () => {
return ( return (
@@ -43,7 +42,6 @@ Page.getLayout = (page: ReactElement) => {
export async function getServerSideProps(ctx: GetServerSidePropsContext) { export async function getServerSideProps(ctx: GetServerSidePropsContext) {
const { req, res } = ctx; const { req, res } = ctx;
const locale = await getLocale(req.cookies);
const { user, session } = await validateRequest(ctx.req); const { user, session } = await validateRequest(ctx.req);
if (!user) { if (!user) {
return { return {
@@ -78,7 +76,6 @@ export async function getServerSideProps(ctx: GetServerSidePropsContext) {
return { return {
props: { props: {
trpcState: helpers.dehydrate(), trpcState: helpers.dehydrate(),
...(await serverSideTranslations(locale, ["settings"])),
}, },
}; };
} }
+1 -2
View File
@@ -39,8 +39,7 @@
"**/*.js", "**/*.js",
".next/types/**/*.ts", ".next/types/**/*.ts",
"env.js", "env.js",
"next.config.mjs", "next.config.mjs"
"next-i18next.config.mjs"
], ],
"exclude": [ "exclude": [
"node_modules", "node_modules",
-16
View File
@@ -1,16 +0,0 @@
import Cookies from "js-cookie";
import type { LanguageCode } from "@/lib/languages";
export default function useLocale() {
const currentLocale = (Cookies.get("DOKPLOY_LOCALE") ?? "en") as LanguageCode;
const setLocale = (locale: LanguageCode) => {
Cookies.set("DOKPLOY_LOCALE", locale, { expires: 365 });
window.location.reload();
};
return {
locale: currentLocale,
setLocale,
};
}
-23
View File
@@ -1,23 +0,0 @@
import type { NextApiRequestCookies } from "next/dist/server/api-utils";
export function getLocale(cookies: NextApiRequestCookies) {
const locale = cookies.DOKPLOY_LOCALE ?? "en";
return locale;
}
import { serverSideTranslations as originalServerSideTranslations } from "next-i18next/serverSideTranslations";
import { Languages } from "@/lib/languages";
export const serverSideTranslations = (
locale: string,
namespaces = ["common"],
) =>
originalServerSideTranslations(locale, namespaces, {
fallbackLng: "en",
keySeparator: false,
i18n: {
defaultLocale: "en",
locales: Object.values(Languages).map((language) => language.code),
localeDetection: false,
},
});
+1 -1
View File
@@ -20,7 +20,7 @@
"pino-pretty": "11.2.2", "pino-pretty": "11.2.2",
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"zod": "^3.25.32" "zod": "^3.25.76"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20.16.0", "@types/node": "^20.16.0",
+27
View File
@@ -0,0 +1,27 @@
# Debug build OOM – orden para probar
Ejecuta desde `packages/server` (o `pnpm --filter=@dokploy/server run <script>` desde la raíz).
1. **`pnpm run build:debug:noEmit`**
Solo typecheck, no escribe archivos.
- Si hace **OOM** → el problema es el análisis de tipos (ej. zod u otras libs).
- Si **pasa** → el problema está en emit (JS o `.d.ts`).
2. **`pnpm run build:debug:noEmit:8gb`**
Mismo que el anterior pero con 8GB de heap.
- Si con 8GB **pasa** y sin 8GB **no** → el typecheck necesita más memoria.
3. **`pnpm run build:debug:noDecl`**
Compila solo JS (sin `declaration`).
- Si hace **OOM** → el problema es emitir JS.
- Si **pasa** → el problema es generar `.d.ts`.
4. **`pnpm run build:debug:declOnly`**
Solo genera declaraciones (`.d.ts`).
- Si hace **OOM** → el cuello de botella son las declaraciones.
5. **`pnpm run build:debug:full`**
Build completo con `--extendedDiagnostics` (imprime estadísticas al final).
- Para ver en qué paso se va la memoria si no has localizado antes.
Con eso sabes si el OOM viene de: typecheck, emit JS o emit declarations, y puedes elegir fix (más memoria, esbuild para JS, o no emitir declarations).
+12 -12
View File
@@ -30,13 +30,13 @@
"generate:drizzle": "pnpm dlx @better-auth/cli generate --output auth-schema2.ts --config src/lib/auth.ts" "generate:drizzle": "pnpm dlx @better-auth/cli generate --output auth-schema2.ts --config src/lib/auth.ts"
}, },
"dependencies": { "dependencies": {
"@ai-sdk/anthropic": "^2.0.5", "@ai-sdk/anthropic": "^3.0.44",
"@ai-sdk/azure": "^2.0.16", "@ai-sdk/azure": "^3.0.30",
"@ai-sdk/cohere": "^2.0.4", "@ai-sdk/cohere": "^3.0.21",
"@ai-sdk/deepinfra": "^1.0.10", "@ai-sdk/deepinfra": "^2.0.34",
"@ai-sdk/mistral": "^2.0.7", "@ai-sdk/mistral": "^3.0.20",
"@ai-sdk/openai": "^2.0.16", "@ai-sdk/openai": "^3.0.29",
"@ai-sdk/openai-compatible": "^1.0.10", "@ai-sdk/openai-compatible": "^2.0.30",
"@better-auth/utils": "0.3.0", "@better-auth/utils": "0.3.0",
"@faker-js/faker": "^8.4.1", "@faker-js/faker": "^8.4.1",
"@octokit/auth-app": "^6.1.3", "@octokit/auth-app": "^6.1.3",
@@ -44,11 +44,11 @@
"@oslojs/crypto": "1.0.1", "@oslojs/crypto": "1.0.1",
"@oslojs/encoding": "1.1.0", "@oslojs/encoding": "1.1.0",
"@react-email/components": "^0.0.21", "@react-email/components": "^0.0.21",
"@better-auth/sso":"1.4.18", "@better-auth/sso": "1.4.18",
"@trpc/server": "^10.45.2", "@trpc/server": "^10.45.2",
"adm-zip": "^0.5.16", "adm-zip": "^0.5.16",
"ai": "^5.0.17", "ai": "^6.0.86",
"ai-sdk-ollama": "^0.5.1", "ai-sdk-ollama": "^3.7.0",
"bcrypt": "5.1.1", "bcrypt": "5.1.1",
"better-auth": "1.4.18", "better-auth": "1.4.18",
"bl": "6.0.11", "bl": "6.0.11",
@@ -81,11 +81,11 @@
"ssh2": "1.15.0", "ssh2": "1.15.0",
"toml": "3.0.0", "toml": "3.0.0",
"ws": "8.16.0", "ws": "8.16.0",
"zod": "^3.25.32", "zod": "^3.25.76",
"semver": "7.7.3" "semver": "7.7.3"
}, },
"devDependencies": { "devDependencies": {
"@better-auth/cli": "1.4.18", "@better-auth/cli": "1.4.18",
"@types/semver": "7.7.1", "@types/semver": "7.7.1",
"@types/adm-zip": "^0.5.7", "@types/adm-zip": "^0.5.7",
"@types/bcrypt": "5.0.2", "@types/bcrypt": "5.0.2",
+172 -150
View File
@@ -2,13 +2,31 @@ import { db } from "@dokploy/server/db";
import { ai } from "@dokploy/server/db/schema"; import { ai } from "@dokploy/server/db/schema";
import { selectAIProvider } from "@dokploy/server/utils/ai/select-ai-provider"; import { selectAIProvider } from "@dokploy/server/utils/ai/select-ai-provider";
import { TRPCError } from "@trpc/server"; import { TRPCError } from "@trpc/server";
import { generateObject } from "ai"; import { generateText, Output } from "ai";
import { desc, eq } from "drizzle-orm"; import { desc, eq } from "drizzle-orm";
import { z } from "zod"; import { z } from "zod";
import { IS_CLOUD } from "../constants"; import { IS_CLOUD } from "../constants";
import { findServerById } from "./server"; import { findServerById } from "./server";
import { getWebServerSettings } from "./web-server-settings"; import { getWebServerSettings } from "./web-server-settings";
interface SuggestionItem {
id: string;
name: string;
shortDescription: string;
description: string;
}
interface SuggestionsOutput {
suggestions: SuggestionItem[];
}
interface DockerOutput {
dockerCompose: string;
envVariables: Array<{ name: string; value: string }>;
domains: Array<{ host: string; port: number; serviceName: string }>;
configFiles?: Array<{ content: string; filePath: string }>;
}
export const getAiSettingsByOrganizationId = async (organizationId: string) => { export const getAiSettingsByOrganizationId = async (organizationId: string) => {
const aiSettings = await db.query.ai.findMany({ const aiSettings = await db.query.ai.findMany({
where: eq(ai.organizationId, organizationId), where: eq(ai.organizationId, organizationId),
@@ -60,7 +78,7 @@ interface Props {
} }
export const suggestVariants = async ({ export const suggestVariants = async ({
organizationId, organizationId: _organizationId,
aiId, aiId,
input, input,
serverId, serverId,
@@ -90,173 +108,177 @@ export const suggestVariants = async ({
ip = "127.0.0.1"; ip = "127.0.0.1";
} }
const { object } = await generateObject({ const suggestionsSchema = z.object({
model, suggestions: z.array(
output: "object", z.object({
schema: z.object({ id: z.string(),
suggestions: z.array( name: z.string(),
z.object({ shortDescription: z.string(),
id: z.string(), description: z.string(),
name: z.string(), }),
shortDescription: z.string(), ),
description: z.string(),
}),
),
}),
prompt: `
Act as advanced DevOps engineer and analyze the user's request to determine the appropriate suggestions (up to 3 items).
CRITICAL - Read the user's request carefully and follow the appropriate strategy:
Strategy A - If the user specifies a PARTICULAR APPLICATION/SERVICE (e.g., "deploy Chatwoot", "install sendingtk/chatwoot:develop", "setup Bitwarden"):
- Generate different deployment VARIANTS of that SAME application
- Each variant should be a different configuration (minimal, full stack, with different databases, development vs production, etc.)
- Example: For "Chatwoot" → "Chatwoot with PostgreSQL", "Chatwoot Development", "Chatwoot Full Stack"
- The name MUST include the specific application name the user mentioned
Strategy B - If the user describes a GENERAL NEED or USE CASE (e.g., "personal blog", "project management tool", "chat application"):
- Suggest different open source projects that fulfill that need
- Each suggestion should be a different tool/platform that solves the same problem
- Example: For "personal blog" → "WordPress", "Ghost", "Hugo with Nginx"
- The name should be the actual project name
Return your response as a JSON object with the following structure:
{
"suggestions": [
{
"id": "project-or-variant-slug",
"name": "Project Name or Variant Name",
"shortDescription": "Brief one-line description",
"description": "Detailed description"
}
]
}
Important rules for the response:
1. Use slug format for the id field (lowercase, hyphenated)
2. Determine which strategy to use based on whether the user specified a particular application or described a general need
3. For Strategy A (specific app): The name must include the app name and describe the variant configuration
4. For Strategy B (general need): The name should be the actual project/tool name that fulfills the need
5. The description field should ONLY contain a plain text description of the project or variant, its features, and use cases
6. Do NOT include any code snippets, configuration examples, or installation instructions in the description
7. The shortDescription should be a single-line summary focusing on key technologies or differentiators
8. All suggestions should be installable in docker and have docker compose support
9. Provide variety in your suggestions - different complexity levels, tech stacks, or approaches
User wants to create a new project with the following details:
${input}
`,
}); });
const suggestionsResult = await generateText({
model,
// @ts-ignore - Zod + AI SDK Output.object() causes excessively deep instantiation
output: Output.object({ schema: suggestionsSchema }),
prompt: `
Act as advanced DevOps engineer and analyze the user's request to determine the appropriate suggestions (up to 3 items).
CRITICAL - Read the user's request carefully and follow the appropriate strategy:
Strategy A - If the user specifies a PARTICULAR APPLICATION/SERVICE (e.g., "deploy Chatwoot", "install sendingtk/chatwoot:develop", "setup Bitwarden"):
- Generate different deployment VARIANTS of that SAME application
- Each variant should be a different configuration (minimal, full stack, with different databases, development vs production, etc.)
- Example: For "Chatwoot" → "Chatwoot with PostgreSQL", "Chatwoot Development", "Chatwoot Full Stack"
- The name MUST include the specific application name the user mentioned
Strategy B - If the user describes a GENERAL NEED or USE CASE (e.g., "personal blog", "project management tool", "chat application"):
- Suggest different open source projects that fulfill that need
- Each suggestion should be a different tool/platform that solves the same problem
- Example: For "personal blog" → "WordPress", "Ghost", "Hugo with Nginx"
- The name should be the actual project name
Return your response as a JSON object with the following structure:
{
"suggestions": [
{
"id": "project-or-variant-slug",
"name": "Project Name or Variant Name",
"shortDescription": "Brief one-line description",
"description": "Detailed description"
}
]
}
Important rules for the response:
1. Use slug format for the id field (lowercase, hyphenated)
2. Determine which strategy to use based on whether the user specified a particular application or described a general need
3. For Strategy A (specific app): The name must include the app name and describe the variant configuration
4. For Strategy B (general need): The name should be the actual project/tool name that fulfills the need
5. The description field should ONLY contain a plain text description of the project or variant, its features, and use cases
6. Do NOT include any code snippets, configuration examples, or installation instructions in the description
7. The shortDescription should be a single-line summary focusing on key technologies or differentiators
8. All suggestions should be installable in docker and have docker compose support
9. Provide variety in your suggestions - different complexity levels, tech stacks, or approaches
User wants to create a new project with the following details:
${input}
`,
});
const object = suggestionsResult.output as SuggestionsOutput | undefined;
if (object?.suggestions?.length) { if (object?.suggestions?.length) {
const dockerSchema = z.object({
dockerCompose: z.string(),
envVariables: z.array(
z.object({
name: z.string(),
value: z.string(),
}),
),
domains: z.array(
z.object({
host: z.string(),
port: z.number(),
serviceName: z.string(),
}),
),
configFiles: z
.array(
z.object({
content: z.string(),
filePath: z.string(),
}),
)
.optional(),
});
const result = []; const result = [];
for (const suggestion of object.suggestions) { for (const suggestion of object.suggestions) {
try { try {
const { object: docker } = await generateObject({ const dockerResult = await generateText({
model, model,
output: "object", // @ts-ignore - Zod + AI SDK Output.object() causes excessively deep instantiation
schema: z.object({ output: Output.object({ schema: dockerSchema }),
dockerCompose: z.string(),
envVariables: z.array(
z.object({
name: z.string(),
value: z.string(),
}),
),
domains: z.array(
z.object({
host: z.string(),
port: z.number(),
serviceName: z.string(),
}),
),
configFiles: z
.array(
z.object({
content: z.string(),
filePath: z.string(),
}),
)
.optional(),
}),
prompt: ` prompt: `
Act as advanced DevOps engineer and generate docker compose with environment variables and domain configurations needed to install the following project. Act as advanced DevOps engineer and generate docker compose with environment variables and domain configurations needed to install the following project.
Return your response as a JSON object with this structure: Return your response as a JSON object with this structure:
{ {
"dockerCompose": "yaml string here", "dockerCompose": "yaml string here",
"envVariables": [{"name": "VAR_NAME", "value": "example_value"}], "envVariables": [{"name": "VAR_NAME", "value": "example_value"}],
"domains": [{"host": "domain.com", "port": 3000, "serviceName": "service"}], "domains": [{"host": "domain.com", "port": 3000, "serviceName": "service"}],
"configFiles": [{"content": "file content", "filePath": "path/to/file"}] "configFiles": [{"content": "file content", "filePath": "path/to/file"}]
} }
Note: configFiles is optional - only include it if configuration files are absolutely required. Note: configFiles is optional - only include it if configuration files are absolutely required.
Follow these rules: Follow these rules:
Docker Compose Rules: Docker Compose Rules:
1. Use placeholder like \${VARIABLE_NAME-default} for generated variables in the docker-compose.yml 1. Use placeholder like \${VARIABLE_NAME-default} for generated variables in the docker-compose.yml
2. Use complex values for passwords/secrets variables 2. Use complex values for passwords/secrets variables
3. Don't set container_name field in services 3. Don't set container_name field in services
4. Don't set version field in the docker compose 4. Don't set version field in the docker compose
5. Don't set ports like 'ports: 3000:3000', use 'ports: "3000"' instead 5. Don't set ports like 'ports: 3000:3000', use 'ports: "3000"' instead
6. If a service depends on a database or other service, INCLUDE that service in the docker-compose 6. If a service depends on a database or other service, INCLUDE that service in the docker-compose
7. Make sure all required services are defined in the docker-compose 7. Make sure all required services are defined in the docker-compose
Docker Image Rules (CRITICAL): Docker Image Rules (CRITICAL):
1. ALWAYS use 'image:' field, NEVER use 'build:' field 1. ALWAYS use 'image:' field, NEVER use 'build:' field
2. NEVER use 'build: .' or any build directive - we don't have local Dockerfiles 2. NEVER use 'build: .' or any build directive - we don't have local Dockerfiles
3. Use images from Docker Hub or other public registries (e.g., docker.io, ghcr.io, quay.io) 3. Use images from Docker Hub or other public registries (e.g., docker.io, ghcr.io, quay.io)
4. For dependencies (databases, redis, etc.), use official images (e.g., postgres:16, redis:7, etc.) 4. For dependencies (databases, redis, etc.), use official images (e.g., postgres:16, redis:7, etc.)
5. Always specify image tags - avoid using 'latest' tag, use specific versions when possible 5. Always specify image tags - avoid using 'latest' tag, use specific versions when possible
6. Examples of correct image usage: 6. Examples of correct image usage:
- image: sendingtk/chatwoot:develop - image: sendingtk/chatwoot:develop
- image: postgres:16-alpine - image: postgres:16-alpine
- image: redis:7-alpine - image: redis:7-alpine
- image: chatwoot/chatwoot:latest - image: chatwoot/chatwoot:latest
7. Examples of INCORRECT usage (DO NOT USE): 7. Examples of INCORRECT usage (DO NOT USE):
- build: . - build: .
- build: ./app - build: ./app
- build: - build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
Volume Mounting and Configuration Rules: Volume Mounting and Configuration Rules:
1. DO NOT create configuration files unless the service CANNOT work without them 1. DO NOT create configuration files unless the service CANNOT work without them
2. Most services can work with just environment variables - USE THEM FIRST 2. Most services can work with just environment variables - USE THEM FIRST
3. Ask yourself: "Can this be configured with an environment variable instead?" 3. Ask yourself: "Can this be configured with an environment variable instead?"
4. If and ONLY IF a config file is absolutely required: 4. If and ONLY IF a config file is absolutely required:
- Keep it minimal with only critical settings - Keep it minimal with only critical settings
- Use "../files/" prefix for all mounts - Use "../files/" prefix for all mounts
- Format: "../files/folder:/container/path" - Format: "../files/folder:/container/path"
5. DO NOT add configuration files for: 5. DO NOT add configuration files for:
- Default configurations that work out of the box - Default configurations that work out of the box
- Settings that can be handled by environment variables - Settings that can be handled by environment variables
- Proxy or routing configurations (these are handled elsewhere) - Proxy or routing configurations (these are handled elsewhere)
Environment Variables Rules: Environment Variables Rules:
1. For the envVariables array, provide ACTUAL example values, not placeholders 1. For the envVariables array, provide ACTUAL example values, not placeholders
2. Use realistic example values (e.g., "[email protected]" for emails, "mypassword123" for passwords) 2. Use realistic example values (e.g., "[email protected]" for emails, "mypassword123" for passwords)
3. DO NOT use \${VARIABLE_NAME-default} syntax in the envVariables values 3. DO NOT use \${VARIABLE_NAME-default} syntax in the envVariables values
4. ONLY include environment variables that are actually used in the docker-compose 4. ONLY include environment variables that are actually used in the docker-compose
5. Every environment variable referenced in the docker-compose MUST have a corresponding entry in envVariables 5. Every environment variable referenced in the docker-compose MUST have a corresponding entry in envVariables
6. Do not include environment variables for services that don't exist in the docker-compose 6. Do not include environment variables for services that don't exist in the docker-compose
For each service that needs to be exposed to the internet: For each service that needs to be exposed to the internet:
1. Define a domain configuration with: 1. Define a domain configuration with:
- host: the domain name for the service in format: {service-name}-{random-3-chars-hex}-${ip ? ip.replaceAll(".", "-") : ""}.traefik.me - host: the domain name for the service in format: {service-name}-{random-3-chars-hex}-${ip ? ip.replaceAll(".", "-") : ""}.traefik.me
- port: the internal port the service runs on - port: the internal port the service runs on
- serviceName: the name of the service in the docker-compose - serviceName: the name of the service in the docker-compose
2. Make sure the service is properly configured to work with the specified port 2. Make sure the service is properly configured to work with the specified port
User's original request: ${input} User's original request: ${input}
Project details: Project details:
${suggestion?.description} ${suggestion?.description}
`, `,
}); });
if (!!docker && !!docker.dockerCompose) { const docker = dockerResult.output as DockerOutput | undefined;
if (docker?.dockerCompose) {
result.push({ result.push({
...suggestion, ...suggestion,
...docker, ...docker,
+1
View File
@@ -34,6 +34,7 @@
"dokploy", "dokploy",
"config", "config",
"dist", "dist",
".next",
"webpack.config.server.js", "webpack.config.server.js",
"migration.ts", "migration.ts",
"setup.ts" "setup.ts"
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.server.json",
"compilerOptions": {
"declaration": false,
"declarationMap": false
}
}
+2299 -2218
View File
File diff suppressed because it is too large Load Diff