mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-04 21:45:26 +02:00
Compare commits
52 Commits
migration/
...
v0.14.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ecd1627c8 | ||
|
|
572579af91 | ||
|
|
b296b6bbf0 | ||
|
|
5c8721406a | ||
|
|
be934065d9 | ||
|
|
8162dcfb71 | ||
|
|
46f7d43595 | ||
|
|
59bb59ee24 | ||
|
|
0e433a3d36 | ||
|
|
819de5a32e | ||
|
|
5cd624c7ea | ||
|
|
89c7e96df0 | ||
|
|
0e136ffb8f | ||
|
|
6b4e52fb37 | ||
|
|
db9136d981 | ||
|
|
a93f18eb4a | ||
|
|
467acc4d4d | ||
|
|
01e5cf0852 | ||
|
|
df9fad088f | ||
|
|
2644b638d1 | ||
|
|
acd722678e | ||
|
|
727e50648e | ||
|
|
349bc89851 | ||
|
|
9f6f872536 | ||
|
|
e378d89477 | ||
|
|
63e7eacae9 | ||
|
|
f4ab588516 | ||
|
|
4d8a0ba58f | ||
|
|
e88cd11041 | ||
|
|
5f174a883b | ||
|
|
536a6ba2ff | ||
|
|
213fa08210 | ||
|
|
d5c6a601d8 | ||
|
|
452793c8e5 | ||
|
|
385fbf4af5 | ||
|
|
3590f3bed2 | ||
|
|
9b2fcaea31 | ||
|
|
5abcc82215 | ||
|
|
ee855452e3 | ||
|
|
d000b526d3 | ||
|
|
9bf88b90c3 | ||
|
|
b1a48d4636 | ||
|
|
c34c4b244e | ||
|
|
bb59a0cd3f | ||
|
|
44e6a117dd | ||
|
|
bfdc73f8d1 | ||
|
|
64ada7020a | ||
|
|
4706adc0c0 | ||
|
|
e01d92d1d9 | ||
|
|
fe22890311 | ||
|
|
2b7c7632f4 | ||
|
|
1b7244e841 |
@@ -1,161 +0,0 @@
|
|||||||
import { AlertBlock } from "@/components/shared/alert-block";
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import {
|
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogDescription,
|
|
||||||
DialogFooter,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
DialogTrigger,
|
|
||||||
} from "@/components/ui/dialog";
|
|
||||||
import {
|
|
||||||
Form,
|
|
||||||
FormControl,
|
|
||||||
FormField,
|
|
||||||
FormItem,
|
|
||||||
FormLabel,
|
|
||||||
FormMessage,
|
|
||||||
} from "@/components/ui/form";
|
|
||||||
import { Input } from "@/components/ui/input";
|
|
||||||
import { Textarea } from "@/components/ui/textarea";
|
|
||||||
import { api } from "@/utils/api";
|
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
|
||||||
import { ImportIcon, SquarePen } from "lucide-react";
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
import { useForm } from "react-hook-form";
|
|
||||||
import { toast } from "sonner";
|
|
||||||
import { z } from "zod";
|
|
||||||
|
|
||||||
const updateComposeSchema = z.object({
|
|
||||||
name: z.string().min(1, {
|
|
||||||
message: "Name is required",
|
|
||||||
}),
|
|
||||||
description: z.string().optional(),
|
|
||||||
});
|
|
||||||
|
|
||||||
type UpdateCompose = z.infer<typeof updateComposeSchema>;
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
composeId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const ImportTemplate = ({ composeId }: Props) => {
|
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
|
||||||
const utils = api.useUtils();
|
|
||||||
const { mutateAsync, error, isError, isLoading } =
|
|
||||||
api.compose.update.useMutation();
|
|
||||||
const { data } = api.compose.one.useQuery(
|
|
||||||
{
|
|
||||||
composeId,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
enabled: !!composeId,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
const form = useForm<UpdateCompose>({
|
|
||||||
defaultValues: {
|
|
||||||
description: data?.description ?? "",
|
|
||||||
name: data?.name ?? "",
|
|
||||||
},
|
|
||||||
resolver: zodResolver(updateComposeSchema),
|
|
||||||
});
|
|
||||||
useEffect(() => {
|
|
||||||
if (data) {
|
|
||||||
form.reset({
|
|
||||||
description: data.description ?? "",
|
|
||||||
name: data.name,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [data, form, form.reset]);
|
|
||||||
|
|
||||||
const onSubmit = async (formData: UpdateCompose) => {
|
|
||||||
await mutateAsync({
|
|
||||||
name: formData.name,
|
|
||||||
composeId: composeId,
|
|
||||||
description: formData.description || "",
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
toast.success("Compose updated succesfully");
|
|
||||||
utils.compose.one.invalidate({
|
|
||||||
composeId: composeId,
|
|
||||||
});
|
|
||||||
setIsOpen(false);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
toast.error("Error to update the Compose");
|
|
||||||
})
|
|
||||||
.finally(() => {});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Dialog open={isOpen} onOpenChange={setIsOpen}>
|
|
||||||
<DialogTrigger asChild>
|
|
||||||
<Button variant="ghost">
|
|
||||||
<ImportIcon className="size-5 text-muted-foreground" />
|
|
||||||
</Button>
|
|
||||||
</DialogTrigger>
|
|
||||||
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
|
|
||||||
<DialogHeader>
|
|
||||||
<DialogTitle>Import Template</DialogTitle>
|
|
||||||
<DialogDescription>Import external template</DialogDescription>
|
|
||||||
</DialogHeader>
|
|
||||||
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
|
|
||||||
|
|
||||||
<div className="grid gap-4">
|
|
||||||
<div className="grid items-center gap-4">
|
|
||||||
<Form {...form}>
|
|
||||||
<form
|
|
||||||
onSubmit={form.handleSubmit(onSubmit)}
|
|
||||||
id="hook-form-update-compose"
|
|
||||||
className="grid w-full gap-4 "
|
|
||||||
>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="name"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>Name</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<Input placeholder="Tesla" {...field} />
|
|
||||||
</FormControl>
|
|
||||||
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="description"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>Description</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<Textarea
|
|
||||||
placeholder="Description about your project..."
|
|
||||||
className="resize-none"
|
|
||||||
{...field}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<DialogFooter>
|
|
||||||
<Button
|
|
||||||
isLoading={isLoading}
|
|
||||||
form="hook-form-update-compose"
|
|
||||||
type="submit"
|
|
||||||
>
|
|
||||||
Update
|
|
||||||
</Button>
|
|
||||||
</DialogFooter>
|
|
||||||
</form>
|
|
||||||
</Form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -5,7 +5,6 @@ import { ShowDeploymentsCompose } from "@/components/dashboard/compose/deploymen
|
|||||||
import { ShowDomainsCompose } from "@/components/dashboard/compose/domains/show-domains";
|
import { ShowDomainsCompose } from "@/components/dashboard/compose/domains/show-domains";
|
||||||
import { ShowEnvironmentCompose } from "@/components/dashboard/compose/enviroment/show";
|
import { ShowEnvironmentCompose } from "@/components/dashboard/compose/enviroment/show";
|
||||||
import { ShowGeneralCompose } from "@/components/dashboard/compose/general/show";
|
import { ShowGeneralCompose } from "@/components/dashboard/compose/general/show";
|
||||||
import { ImportTemplate } from "@/components/dashboard/compose/import-template";
|
|
||||||
import { ShowDockerLogsCompose } from "@/components/dashboard/compose/logs/show";
|
import { ShowDockerLogsCompose } from "@/components/dashboard/compose/logs/show";
|
||||||
import { ShowMonitoringCompose } from "@/components/dashboard/compose/monitoring/show";
|
import { ShowMonitoringCompose } from "@/components/dashboard/compose/monitoring/show";
|
||||||
import { UpdateCompose } from "@/components/dashboard/compose/update-compose";
|
import { UpdateCompose } from "@/components/dashboard/compose/update-compose";
|
||||||
@@ -207,7 +206,6 @@ const Service = (
|
|||||||
<TabsTrigger value="advanced">Advanced</TabsTrigger>
|
<TabsTrigger value="advanced">Advanced</TabsTrigger>
|
||||||
</TabsList>
|
</TabsList>
|
||||||
<div className="flex flex-row gap-2">
|
<div className="flex flex-row gap-2">
|
||||||
<ImportTemplate composeId={composeId} />
|
|
||||||
<UpdateCompose composeId={composeId} />
|
<UpdateCompose composeId={composeId} />
|
||||||
|
|
||||||
{(auth?.rol === "admin" || user?.canDeleteServices) && (
|
{(auth?.rol === "admin" || user?.canDeleteServices) && (
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ services:
|
|||||||
hard: 262144
|
hard: 262144
|
||||||
|
|
||||||
plausible:
|
plausible:
|
||||||
image: ghcr.io/plausible/community-edition:v2.1.0
|
image: ghcr.io/plausible/community-edition:v2.1.4
|
||||||
restart: always
|
restart: always
|
||||||
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
|
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export const templates: TemplateData[] = [
|
|||||||
{
|
{
|
||||||
id: "plausible",
|
id: "plausible",
|
||||||
name: "Plausible",
|
name: "Plausible",
|
||||||
version: "v2.1.0",
|
version: "v2.1.4",
|
||||||
description:
|
description:
|
||||||
"Plausible is a open source, self-hosted web analytics platform that lets you track website traffic and user behavior.",
|
"Plausible is a open source, self-hosted web analytics platform that lets you track website traffic and user behavior.",
|
||||||
logo: "plausible.svg",
|
logo: "plausible.svg",
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { randomBytes } from "node:crypto";
|
import { randomBytes } from "node:crypto";
|
||||||
import { readFile } from "node:fs/promises";
|
import { readFile } from "node:fs/promises";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import type { Domain } from "@dokploy/server";
|
||||||
|
// import { IS_CLOUD } from "@/server/constants";
|
||||||
import { TRPCError } from "@trpc/server";
|
import { TRPCError } from "@trpc/server";
|
||||||
import { templates } from "../templates";
|
import { templates } from "../templates";
|
||||||
import type { TemplatesKeys } from "../types/templates-data.type";
|
import type { TemplatesKeys } from "../types/templates-data.type";
|
||||||
@@ -10,11 +12,7 @@ export interface Schema {
|
|||||||
projectName: string;
|
projectName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DomainSchema = {
|
export type DomainSchema = Pick<Domain, "host" | "port" | "serviceName">;
|
||||||
host: string;
|
|
||||||
port: number;
|
|
||||||
serviceName: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface Template {
|
export interface Template {
|
||||||
envs?: string[];
|
envs?: string[];
|
||||||
|
|||||||
@@ -81,6 +81,11 @@ const installRequirements = async (serverId: string, logPath: string) => {
|
|||||||
OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')
|
OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')
|
||||||
CURRENT_USER=$USER
|
CURRENT_USER=$USER
|
||||||
|
|
||||||
|
echo "Installing requirements for: OS: $OS_TYPE"
|
||||||
|
if [ $EUID != 0 ]; then
|
||||||
|
echo "Please run this script as root or with sudo ❌"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# Check if the OS is manjaro, if so, change it to arch
|
# Check if the OS is manjaro, if so, change it to arch
|
||||||
if [ "$OS_TYPE" = "manjaro" ] || [ "$OS_TYPE" = "manjaro-arm" ]; then
|
if [ "$OS_TYPE" = "manjaro" ] || [ "$OS_TYPE" = "manjaro-arm" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user