diff --git a/apps/dokploy/__test__/drop/drop.test.test.ts b/apps/dokploy/__test__/drop/drop.test.test.ts index f5b68c1d..74c80365 100644 --- a/apps/dokploy/__test__/drop/drop.test.test.ts +++ b/apps/dokploy/__test__/drop/drop.test.test.ts @@ -27,6 +27,7 @@ if (typeof window === "undefined") { const baseApp: ApplicationNested = { applicationId: "", herokuVersion: "", + cleanCache: false, watchPaths: [], applicationStatus: "done", appName: "", diff --git a/apps/dokploy/__test__/traefik/traefik.test.ts b/apps/dokploy/__test__/traefik/traefik.test.ts index a64103ff..74b0e265 100644 --- a/apps/dokploy/__test__/traefik/traefik.test.ts +++ b/apps/dokploy/__test__/traefik/traefik.test.ts @@ -7,6 +7,7 @@ import { expect, test } from "vitest"; const baseApp: ApplicationNested = { applicationId: "", herokuVersion: "", + cleanCache: false, applicationStatus: "done", appName: "", autoDeploy: true, diff --git a/apps/dokploy/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx b/apps/dokploy/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx index 1eadf8ba..57f851c9 100644 --- a/apps/dokploy/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx +++ b/apps/dokploy/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx @@ -40,7 +40,7 @@ interface Props { } const AddRedirectchema = z.object({ - replicas: z.number(), + replicas: z.number().min(1, "Replicas must be at least 1"), registryId: z.string(), }); @@ -130,9 +130,11 @@ export const ShowClusterSettings = ({ applicationId }: Props) => { placeholder="1" {...field} onChange={(e) => { - field.onChange(Number(e.target.value)); + const value = e.target.value; + field.onChange(value === "" ? 0 : Number(value)); }} type="number" + value={field.value || ""} /> diff --git a/apps/dokploy/components/dashboard/application/domains/add-domain.tsx b/apps/dokploy/components/dashboard/application/domains/add-domain.tsx index f91218ce..8da85a87 100644 --- a/apps/dokploy/components/dashboard/application/domains/add-domain.tsx +++ b/apps/dokploy/components/dashboard/application/domains/add-domain.tsx @@ -41,6 +41,7 @@ import { toast } from "sonner"; import { domain } from "@/server/db/validations/domain"; import { zodResolver } from "@hookform/resolvers/zod"; import { Dices } from "lucide-react"; +import Link from "next/link"; import type z from "zod"; type Domain = z.infer; @@ -83,6 +84,13 @@ export const AddDomain = ({ const { mutateAsync: generateDomain, isLoading: isLoadingGenerate } = api.domain.generateDomain.useMutation(); + const { data: canGenerateTraefikMeDomains } = + api.domain.canGenerateTraefikMeDomains.useQuery({ + serverId: application?.serverId || "", + }); + + console.log("canGenerateTraefikMeDomains", canGenerateTraefikMeDomains); + const form = useForm({ resolver: zodResolver(domain), defaultValues: { @@ -186,6 +194,21 @@ export const AddDomain = ({ name="host" render={({ field }) => ( + {!canGenerateTraefikMeDomains && + field.value.includes("traefik.me") && ( + + You need to set an IP address in your{" "} + + {application?.serverId + ? "Remote Servers -> Server -> Edit Server -> Update IP Address" + : "Web Server -> Server -> Update Server IP"} + {" "} + to make your traefik.me domain work. + + )} Host
diff --git a/apps/dokploy/components/dashboard/application/general/show.tsx b/apps/dokploy/components/dashboard/application/general/show.tsx index 41961c15..c917d7ab 100644 --- a/apps/dokploy/components/dashboard/application/general/show.tsx +++ b/apps/dokploy/components/dashboard/application/general/show.tsx @@ -16,8 +16,8 @@ import { Ban, CheckCircle2, Hammer, - HelpCircle, RefreshCcw, + Rocket, Terminal, } from "lucide-react"; import { useRouter } from "next/router"; @@ -55,7 +55,7 @@ export const ShowGeneralApplication = ({ applicationId }: Props) => { Deploy Settings - + { {
Autodeploy { await update({ @@ -264,14 +287,14 @@ export const ShowGeneralApplication = ({ applicationId }: Props) => { toast.error("Error updating Auto Deploy"); }); }} - className="flex flex-row gap-2 items-center" + className="flex flex-row gap-2 items-center data-[state=checked]:bg-primary" />
Clean Cache { await update({ @@ -286,7 +309,7 @@ export const ShowGeneralApplication = ({ applicationId }: Props) => { toast.error("Error updating Clean Cache"); }); }} - className="flex flex-row gap-2 items-center" + className="flex flex-row gap-2 items-center data-[state=checked]:bg-primary" />
diff --git a/apps/dokploy/components/dashboard/compose/domains/add-domain.tsx b/apps/dokploy/components/dashboard/compose/domains/add-domain.tsx index 9b412c83..6089c99f 100644 --- a/apps/dokploy/components/dashboard/compose/domains/add-domain.tsx +++ b/apps/dokploy/components/dashboard/compose/domains/add-domain.tsx @@ -41,6 +41,7 @@ import { import { domainCompose } from "@/server/db/validations/domain"; import { zodResolver } from "@hookform/resolvers/zod"; import { DatabaseZap, Dices, RefreshCw } from "lucide-react"; +import Link from "next/link"; import type z from "zod"; type Domain = z.infer; @@ -102,6 +103,11 @@ export const AddDomainCompose = ({ ? api.domain.update.useMutation() : api.domain.create.useMutation(); + const { data: canGenerateTraefikMeDomains } = + api.domain.canGenerateTraefikMeDomains.useQuery({ + serverId: compose?.serverId || "", + }); + const form = useForm({ resolver: zodResolver(domainCompose), defaultValues: { @@ -313,6 +319,21 @@ export const AddDomainCompose = ({ name="host" render={({ field }) => ( + {!canGenerateTraefikMeDomains && + field.value.includes("traefik.me") && ( + + You need to set an IP address in your{" "} + + {compose?.serverId + ? "Remote Servers -> Server -> Edit Server -> Update IP Address" + : "Web Server -> Server -> Update Server IP"} + {" "} + to make your traefik.me domain work. + + )} Host
diff --git a/apps/dokploy/components/dashboard/compose/general/actions.tsx b/apps/dokploy/components/dashboard/compose/general/actions.tsx index de5aa50d..aacf458f 100644 --- a/apps/dokploy/components/dashboard/compose/general/actions.tsx +++ b/apps/dokploy/components/dashboard/compose/general/actions.tsx @@ -8,11 +8,11 @@ import { TooltipTrigger, } from "@/components/ui/tooltip"; import { api } from "@/utils/api"; -import * as TooltipPrimitive from "@radix-ui/react-tooltip"; -import { Ban, CheckCircle2, Hammer, HelpCircle, Terminal } from "lucide-react"; +import { Ban, CheckCircle2, RefreshCcw, Rocket, Terminal } from "lucide-react"; import { useRouter } from "next/router"; import { toast } from "sonner"; import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal"; +import * as TooltipPrimitive from "@radix-ui/react-tooltip"; interface Props { composeId: string; @@ -34,7 +34,7 @@ export const ComposeActions = ({ composeId }: Props) => { api.compose.stop.useMutation(); return (
- + { { await redeploy({ composeId: composeId, }) .then(() => { - toast.success("Compose rebuilt successfully"); + toast.success("Compose reloaded successfully"); refetch(); }) .catch(() => { - toast.error("Error rebuilding compose"); + toast.error("Error reloading compose"); }); }} >
Autodeploy { await update({ @@ -214,7 +222,7 @@ export const ComposeActions = ({ composeId }: Props) => { toast.error("Error updating Auto Deploy"); }); }} - className="flex flex-row gap-2 items-center" + className="flex flex-row gap-2 items-center data-[state=checked]:bg-primary" />
diff --git a/apps/dokploy/components/dashboard/database/backups/restore-backup.tsx b/apps/dokploy/components/dashboard/database/backups/restore-backup.tsx new file mode 100644 index 00000000..b585d5ee --- /dev/null +++ b/apps/dokploy/components/dashboard/database/backups/restore-backup.tsx @@ -0,0 +1,375 @@ +import { DrawerLogs } from "@/components/shared/drawer-logs"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { + Command, + CommandEmpty, + CommandGroup, + CommandInput, + CommandItem, +} from "@/components/ui/command"; +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 { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; +import { ScrollArea } from "@/components/ui/scroll-area"; +import { cn } from "@/lib/utils"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import copy from "copy-to-clipboard"; +import { debounce } from "lodash"; +import { CheckIcon, ChevronsUpDown, Copy, RotateCcw } from "lucide-react"; +import { useState } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; +import type { ServiceType } from "../../application/advanced/show-resources"; +import { type LogLine, parseLogs } from "../../docker/logs/utils"; + +interface Props { + databaseId: string; + databaseType: Exclude; + serverId: string | null; +} + +const RestoreBackupSchema = z.object({ + destinationId: z + .string({ + required_error: "Please select a destination", + }) + .min(1, { + message: "Destination is required", + }), + backupFile: z + .string({ + required_error: "Please select a backup file", + }) + .min(1, { + message: "Backup file is required", + }), + databaseName: z + .string({ + required_error: "Please enter a database name", + }) + .min(1, { + message: "Database name is required", + }), +}); + +type RestoreBackup = z.infer; + +export const RestoreBackup = ({ + databaseId, + databaseType, + serverId, +}: Props) => { + const [isOpen, setIsOpen] = useState(false); + const [search, setSearch] = useState(""); + + const { data: destinations = [] } = api.destination.all.useQuery(); + + const form = useForm({ + defaultValues: { + destinationId: "", + backupFile: "", + databaseName: "", + }, + resolver: zodResolver(RestoreBackupSchema), + }); + + const destionationId = form.watch("destinationId"); + + const debouncedSetSearch = debounce((value: string) => { + setSearch(value); + }, 300); + + const { data: files = [], isLoading } = api.backup.listBackupFiles.useQuery( + { + destinationId: destionationId, + search, + serverId: serverId ?? "", + }, + { + enabled: isOpen && !!destionationId, + }, + ); + + const [isDrawerOpen, setIsDrawerOpen] = useState(false); + const [filteredLogs, setFilteredLogs] = useState([]); + const [isDeploying, setIsDeploying] = useState(false); + + // const { mutateAsync: restore, isLoading: isRestoring } = + // api.backup.restoreBackup.useMutation(); + + api.backup.restoreBackupWithLogs.useSubscription( + { + databaseId, + databaseType, + databaseName: form.watch("databaseName"), + backupFile: form.watch("backupFile"), + destinationId: form.watch("destinationId"), + }, + { + enabled: isDeploying, + onData(log) { + if (!isDrawerOpen) { + setIsDrawerOpen(true); + } + + if (log === "Restore completed successfully!") { + setIsDeploying(false); + } + const parsedLogs = parseLogs(log); + setFilteredLogs((prev) => [...prev, ...parsedLogs]); + }, + onError(error) { + console.error("Restore logs error:", error); + setIsDeploying(false); + }, + }, + ); + + const onSubmit = async (_data: RestoreBackup) => { + setIsDeploying(true); + }; + + return ( + + + + + + + + + Restore Backup + + + Select a destination and search for backup files + + + +
+ + ( + + Destination + + + + + + + + + + No destinations found. + + + {destinations.map((destination) => ( + { + form.setValue( + "destinationId", + destination.destinationId, + ); + }} + > + {destination.name} + + + ))} + + + + + + + + )} + /> + + ( + + + Search Backup Files + {field.value && ( + + {field.value} + { + e.stopPropagation(); + e.preventDefault(); + copy(field.value); + toast.success("Backup file copied to clipboard"); + }} + /> + + )} + + + + + + + + + + + {isLoading ? ( +
+ Loading backup files... +
+ ) : files.length === 0 && search ? ( +
+ No backup files found for "{search}" +
+ ) : files.length === 0 ? ( +
+ No backup files available +
+ ) : ( + + + {files.map((file) => ( + { + form.setValue("backupFile", file); + }} + > +
+ {file} +
+ +
+ ))} +
+
+ )} +
+
+
+ +
+ )} + /> + ( + + Database Name + + + + + + )} + /> + + + + + + + { + setIsDrawerOpen(false); + setFilteredLogs([]); + setIsDeploying(false); + // refetch(); + }} + filteredLogs={filteredLogs} + /> +
+
+ ); +}; diff --git a/apps/dokploy/components/dashboard/database/backups/show-backups.tsx b/apps/dokploy/components/dashboard/database/backups/show-backups.tsx index f9835e69..3de79c2f 100644 --- a/apps/dokploy/components/dashboard/database/backups/show-backups.tsx +++ b/apps/dokploy/components/dashboard/database/backups/show-backups.tsx @@ -20,6 +20,7 @@ import { useState } from "react"; import { toast } from "sonner"; import type { ServiceType } from "../../application/advanced/show-resources"; import { AddBackup } from "./add-backup"; +import { RestoreBackup } from "./restore-backup"; import { UpdateBackup } from "./update-backup"; interface Props { @@ -71,7 +72,14 @@ export const ShowBackups = ({ id, type }: Props) => {
{postgres && postgres?.backups?.length > 0 && ( - +
+ + +
)} @@ -98,11 +106,18 @@ export const ShowBackups = ({ id, type }: Props) => { No backups configured - +
+ + +
) : (
@@ -183,6 +198,7 @@ export const ShowBackups = ({ id, type }: Props) => { Run Manual Backup + = ({ const wsUrl = `${protocol}//${ window.location.host }/docker-container-logs?${params.toString()}`; - console.log("Connecting to WebSocket:", wsUrl); const ws = new WebSocket(wsUrl); const resetNoDataTimeout = () => { @@ -136,7 +135,6 @@ export const DockerLogsId: React.FC = ({ ws.close(); return; } - console.log("WebSocket connected"); resetNoDataTimeout(); }; diff --git a/apps/dokploy/components/dashboard/mariadb/general/show-external-mariadb-credentials.tsx b/apps/dokploy/components/dashboard/mariadb/general/show-external-mariadb-credentials.tsx index f61d6f89..c00af42b 100644 --- a/apps/dokploy/components/dashboard/mariadb/general/show-external-mariadb-credentials.tsx +++ b/apps/dokploy/components/dashboard/mariadb/general/show-external-mariadb-credentials.tsx @@ -111,7 +111,10 @@ export const ShowExternalMariadbCredentials = ({ mariadbId }: Props) => { {!getIp && ( You need to set an IP address in your{" "} - + {data?.serverId ? "Remote Servers -> Server -> Edit Server -> Update IP Address" : "Web Server -> Server -> Update Server IP"} diff --git a/apps/dokploy/components/dashboard/mariadb/general/show-general-mariadb.tsx b/apps/dokploy/components/dashboard/mariadb/general/show-general-mariadb.tsx index 5c3bf842..2f8bab77 100644 --- a/apps/dokploy/components/dashboard/mariadb/general/show-general-mariadb.tsx +++ b/apps/dokploy/components/dashboard/mariadb/general/show-general-mariadb.tsx @@ -10,13 +10,7 @@ import { } from "@/components/ui/tooltip"; import { api } from "@/utils/api"; import * as TooltipPrimitive from "@radix-ui/react-tooltip"; -import { - Ban, - CheckCircle2, - HelpCircle, - RefreshCcw, - Terminal, -} from "lucide-react"; +import { Ban, CheckCircle2, RefreshCcw, Rocket, Terminal } from "lucide-react"; import { useState } from "react"; import { toast } from "sonner"; import { type LogLine, parseLogs } from "../../docker/logs/utils"; @@ -92,12 +86,14 @@ export const ShowGeneralMariadb = ({ mariadbId }: Props) => { + + { - {data?.applicationStatus === "idle" ? ( + + {data?.applicationStatus === "idle" ? ( + { - ) : ( + + ) : ( + { - )} - + + )} - diff --git a/apps/dokploy/components/dashboard/mongo/general/show-external-mongo-credentials.tsx b/apps/dokploy/components/dashboard/mongo/general/show-external-mongo-credentials.tsx index 02a50441..75772bfd 100644 --- a/apps/dokploy/components/dashboard/mongo/general/show-external-mongo-credentials.tsx +++ b/apps/dokploy/components/dashboard/mongo/general/show-external-mongo-credentials.tsx @@ -111,7 +111,10 @@ export const ShowExternalMongoCredentials = ({ mongoId }: Props) => { {!getIp && ( You need to set an IP address in your{" "} - + {data?.serverId ? "Remote Servers -> Server -> Edit Server -> Update IP Address" : "Web Server -> Server -> Update Server IP"} diff --git a/apps/dokploy/components/dashboard/mongo/general/show-general-mongo.tsx b/apps/dokploy/components/dashboard/mongo/general/show-general-mongo.tsx index c2e07326..fdc28adc 100644 --- a/apps/dokploy/components/dashboard/mongo/general/show-general-mongo.tsx +++ b/apps/dokploy/components/dashboard/mongo/general/show-general-mongo.tsx @@ -10,13 +10,7 @@ import { } from "@/components/ui/tooltip"; import { api } from "@/utils/api"; import * as TooltipPrimitive from "@radix-ui/react-tooltip"; -import { - Ban, - CheckCircle2, - HelpCircle, - RefreshCcw, - Terminal, -} from "lucide-react"; +import { Ban, CheckCircle2, RefreshCcw, Rocket, Terminal } from "lucide-react"; import { useState } from "react"; import { toast } from "sonner"; import { type LogLine, parseLogs } from "../../docker/logs/utils"; @@ -91,12 +85,14 @@ export const ShowGeneralMongo = ({ mongoId }: Props) => { diff --git a/apps/dokploy/components/dashboard/mysql/general/show-external-mysql-credentials.tsx b/apps/dokploy/components/dashboard/mysql/general/show-external-mysql-credentials.tsx index ede1460f..73f99b7d 100644 --- a/apps/dokploy/components/dashboard/mysql/general/show-external-mysql-credentials.tsx +++ b/apps/dokploy/components/dashboard/mysql/general/show-external-mysql-credentials.tsx @@ -111,7 +111,10 @@ export const ShowExternalMysqlCredentials = ({ mysqlId }: Props) => { {!getIp && ( You need to set an IP address in your{" "} - + {data?.serverId ? "Remote Servers -> Server -> Edit Server -> Update IP Address" : "Web Server -> Server -> Update Server IP"} diff --git a/apps/dokploy/components/dashboard/mysql/general/show-general-mysql.tsx b/apps/dokploy/components/dashboard/mysql/general/show-general-mysql.tsx index 703ec6e3..590127fa 100644 --- a/apps/dokploy/components/dashboard/mysql/general/show-general-mysql.tsx +++ b/apps/dokploy/components/dashboard/mysql/general/show-general-mysql.tsx @@ -10,13 +10,7 @@ import { } from "@/components/ui/tooltip"; import { api } from "@/utils/api"; import * as TooltipPrimitive from "@radix-ui/react-tooltip"; -import { - Ban, - CheckCircle2, - HelpCircle, - RefreshCcw, - Terminal, -} from "lucide-react"; +import { Ban, CheckCircle2, RefreshCcw, Rocket, Terminal } from "lucide-react"; import { useState } from "react"; import { toast } from "sonner"; import { type LogLine, parseLogs } from "../../docker/logs/utils"; @@ -77,7 +71,7 @@ export const ShowGeneralMysql = ({ mysqlId }: Props) => { { @@ -89,12 +83,14 @@ export const ShowGeneralMysql = ({ mysqlId }: Props) => { { @@ -114,24 +110,25 @@ export const ShowGeneralMysql = ({ mysqlId }: Props) => { appName: data?.appName || "", }) .then(() => { - toast.success("Mysql reloaded successfully"); + toast.success("MySQL reloaded successfully"); refetch(); }) .catch(() => { - toast.error("Error reloading Mysql"); + toast.error("Error reloading MySQL"); }); }} > diff --git a/apps/dokploy/components/dashboard/postgres/general/show-external-postgres-credentials.tsx b/apps/dokploy/components/dashboard/postgres/general/show-external-postgres-credentials.tsx index 4d8e7c3c..444fa0ce 100644 --- a/apps/dokploy/components/dashboard/postgres/general/show-external-postgres-credentials.tsx +++ b/apps/dokploy/components/dashboard/postgres/general/show-external-postgres-credentials.tsx @@ -113,7 +113,10 @@ export const ShowExternalPostgresCredentials = ({ postgresId }: Props) => { {!getIp && ( You need to set an IP address in your{" "} - + {data?.serverId ? "Remote Servers -> Server -> Edit Server -> Update IP Address" : "Web Server -> Server -> Update Server IP"} diff --git a/apps/dokploy/components/dashboard/postgres/general/show-general-postgres.tsx b/apps/dokploy/components/dashboard/postgres/general/show-general-postgres.tsx index 0c448553..fec51b5a 100644 --- a/apps/dokploy/components/dashboard/postgres/general/show-general-postgres.tsx +++ b/apps/dokploy/components/dashboard/postgres/general/show-general-postgres.tsx @@ -10,13 +10,7 @@ import { } from "@/components/ui/tooltip"; import { api } from "@/utils/api"; import * as TooltipPrimitive from "@radix-ui/react-tooltip"; -import { - Ban, - CheckCircle2, - HelpCircle, - RefreshCcw, - Terminal, -} from "lucide-react"; +import { Ban, CheckCircle2, RefreshCcw, Rocket, Terminal } from "lucide-react"; import { useState } from "react"; import { toast } from "sonner"; import { type LogLine, parseLogs } from "../../docker/logs/utils"; @@ -78,9 +72,9 @@ export const ShowGeneralPostgres = ({ postgresId }: Props) => { Deploy Settings - + { @@ -92,12 +86,14 @@ export const ShowGeneralPostgres = ({ postgresId }: Props) => { { @@ -117,24 +113,25 @@ export const ShowGeneralPostgres = ({ postgresId }: Props) => { appName: data?.appName || "", }) .then(() => { - toast.success("Postgres reloaded successfully"); + toast.success("PostgreSQL reloaded successfully"); refetch(); }) .catch(() => { - toast.error("Error reloading Postgres"); + toast.error("Error reloading PostgreSQL"); }); }} > diff --git a/apps/dokploy/components/dashboard/postgres/update-postgres.tsx b/apps/dokploy/components/dashboard/postgres/update-postgres.tsx index 2b8804a5..f70cd8c9 100644 --- a/apps/dokploy/components/dashboard/postgres/update-postgres.tsx +++ b/apps/dokploy/components/dashboard/postgres/update-postgres.tsx @@ -21,7 +21,7 @@ import { Input } from "@/components/ui/input"; import { Textarea } from "@/components/ui/textarea"; import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; -import { PenBoxIcon } from "lucide-react"; +import { PenBox } from "lucide-react"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; @@ -94,9 +94,9 @@ export const UpdatePostgres = ({ postgresId }: Props) => { @@ -151,6 +151,7 @@ export const UpdatePostgres = ({ postgresId }: Props) => { isLoading={isLoading} form="hook-form-update-postgres" type="submit" + className="flex items-center gap-1.5 focus-visible:ring-2 focus-visible:ring-offset-2" > Update diff --git a/apps/dokploy/components/dashboard/project/ai/step-one.tsx b/apps/dokploy/components/dashboard/project/ai/step-one.tsx index da7068b6..e2a6795f 100644 --- a/apps/dokploy/components/dashboard/project/ai/step-one.tsx +++ b/apps/dokploy/components/dashboard/project/ai/step-one.tsx @@ -22,7 +22,7 @@ const examples = [ "Sendgrid service opensource analogue", ]; -export const StepOne = ({ nextStep, setTemplateInfo, templateInfo }: any) => { +export const StepOne = ({ setTemplateInfo, templateInfo }: any) => { // Get servers from the API const { data: servers } = api.server.withSSHKey.useQuery(); diff --git a/apps/dokploy/components/dashboard/redis/general/show-external-redis-credentials.tsx b/apps/dokploy/components/dashboard/redis/general/show-external-redis-credentials.tsx index f74129f0..46cb0953 100644 --- a/apps/dokploy/components/dashboard/redis/general/show-external-redis-credentials.tsx +++ b/apps/dokploy/components/dashboard/redis/general/show-external-redis-credentials.tsx @@ -105,7 +105,10 @@ export const ShowExternalRedisCredentials = ({ redisId }: Props) => { {!getIp && ( You need to set an IP address in your{" "} - + {data?.serverId ? "Remote Servers -> Server -> Edit Server -> Update IP Address" : "Web Server -> Server -> Update Server IP"} diff --git a/apps/dokploy/components/dashboard/redis/general/show-general-redis.tsx b/apps/dokploy/components/dashboard/redis/general/show-general-redis.tsx index 59226e51..59a123bd 100644 --- a/apps/dokploy/components/dashboard/redis/general/show-general-redis.tsx +++ b/apps/dokploy/components/dashboard/redis/general/show-general-redis.tsx @@ -10,13 +10,7 @@ import { } from "@/components/ui/tooltip"; import { api } from "@/utils/api"; import * as TooltipPrimitive from "@radix-ui/react-tooltip"; -import { - Ban, - CheckCircle2, - HelpCircle, - RefreshCcw, - Terminal, -} from "lucide-react"; +import { Ban, CheckCircle2, RefreshCcw, Rocket, Terminal } from "lucide-react"; import { useState } from "react"; import { toast } from "sonner"; import { type LogLine, parseLogs } from "../../docker/logs/utils"; @@ -91,12 +85,14 @@ export const ShowGeneralRedis = ({ redisId }: Props) => { diff --git a/apps/dokploy/components/dashboard/settings/cluster/nodes/add-node.tsx b/apps/dokploy/components/dashboard/settings/cluster/nodes/add-node.tsx index eaa9851f..a59681ba 100644 --- a/apps/dokploy/components/dashboard/settings/cluster/nodes/add-node.tsx +++ b/apps/dokploy/components/dashboard/settings/cluster/nodes/add-node.tsx @@ -56,10 +56,10 @@ export const AddNode = ({ serverId }: Props) => { Worker Manager - + - + diff --git a/apps/dokploy/components/dashboard/settings/cluster/nodes/manager/add-manager.tsx b/apps/dokploy/components/dashboard/settings/cluster/nodes/manager/add-manager.tsx index 055c3f1c..bb2064d4 100644 --- a/apps/dokploy/components/dashboard/settings/cluster/nodes/manager/add-manager.tsx +++ b/apps/dokploy/components/dashboard/settings/cluster/nodes/manager/add-manager.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { CardContent } from "@/components/ui/card"; import { DialogDescription, @@ -6,7 +7,7 @@ import { } from "@/components/ui/dialog"; import { api } from "@/utils/api"; import copy from "copy-to-clipboard"; -import { CopyIcon } from "lucide-react"; +import { CopyIcon, Loader2 } from "lucide-react"; import { toast } from "sonner"; interface Props { @@ -14,56 +15,66 @@ interface Props { } export const AddManager = ({ serverId }: Props) => { - const { data } = api.cluster.addManager.useQuery({ serverId }); + const { data, isLoading, error, isError } = api.cluster.addManager.useQuery({ + serverId, + }); return ( <> -
- - - Add a new manager - Add a new manager - -
- 1. Go to your new server and run the following command - - curl https://get.docker.com | sh -s -- --version {data?.version} - - -
+ + + Add a new manager + Add a new manager + + {isError && {error?.message}} + {isLoading ? ( + + ) : ( + <> +
+ + 1. Go to your new server and run the following command + + + curl https://get.docker.com | sh -s -- --version {data?.version} + + +
-
- - 2. Run the following command to add the node(manager) to your - cluster - - - {data?.command} - - -
-
-
+
+ + 2. Run the following command to add the node(manager) to your + cluster + + + + {data?.command} + + +
+ + )} + ); }; diff --git a/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes-modal.tsx b/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes-modal.tsx index 32339e66..82e6e1f9 100644 --- a/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes-modal.tsx +++ b/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes-modal.tsx @@ -17,7 +17,7 @@ export const ShowNodesModal = ({ serverId }: Props) => { className="w-full cursor-pointer " onSelect={(e) => e.preventDefault()} > - Show Nodes + Show Swarm Nodes diff --git a/apps/dokploy/components/dashboard/settings/cluster/nodes/workers/add-worker.tsx b/apps/dokploy/components/dashboard/settings/cluster/nodes/workers/add-worker.tsx index 05f9838e..2623081b 100644 --- a/apps/dokploy/components/dashboard/settings/cluster/nodes/workers/add-worker.tsx +++ b/apps/dokploy/components/dashboard/settings/cluster/nodes/workers/add-worker.tsx @@ -1,3 +1,4 @@ +import { AlertBlock } from "@/components/shared/alert-block"; import { CardContent } from "@/components/ui/card"; import { DialogDescription, @@ -6,7 +7,7 @@ import { } from "@/components/ui/dialog"; import { api } from "@/utils/api"; import copy from "copy-to-clipboard"; -import { CopyIcon } from "lucide-react"; +import { CopyIcon, Loader2 } from "lucide-react"; import { toast } from "sonner"; interface Props { @@ -14,54 +15,62 @@ interface Props { } export const AddWorker = ({ serverId }: Props) => { - const { data } = api.cluster.addWorker.useQuery({ serverId }); + const { data, isLoading, error, isError } = api.cluster.addWorker.useQuery({ + serverId, + }); return ( -
- - - Add a new worker - Add a new worker - -
- 1. Go to your new server and run the following command - - curl https://get.docker.com | sh -s -- --version {data?.version} - - -
+ + + Add a new worker + Add a new worker + + {isError && {error?.message}} + {isLoading ? ( + + ) : ( + <> +
+ 1. Go to your new server and run the following command + + curl https://get.docker.com | sh -s -- --version {data?.version} + + +
-
- - 2. Run the following command to add the node(worker) to your cluster - +
+ + 2. Run the following command to add the node(worker) to your + cluster + - - {data?.command} - - -
- -
+ + {data?.command} + + +
+ + )} + ); }; diff --git a/apps/dokploy/components/dashboard/settings/git/gitea/add-gitea-provider.tsx b/apps/dokploy/components/dashboard/settings/git/gitea/add-gitea-provider.tsx index caa8f277..459afb7d 100644 --- a/apps/dokploy/components/dashboard/settings/git/gitea/add-gitea-provider.tsx +++ b/apps/dokploy/components/dashboard/settings/git/gitea/add-gitea-provider.tsx @@ -139,7 +139,10 @@ export const AddGiteaProvider = () => { -
  • Navigate to Applications
  • +
  • + Navigate to Applications {"->"} Create new OAuth2 + Application +
  • Create a new application with the following details:
      @@ -148,10 +151,6 @@ export const AddGiteaProvider = () => { Redirect URI:{" "} {webhookUrl}{" "} -
    • - Select Permissions - organization: read, user: read, - repository: read/write -
  • diff --git a/apps/dokploy/components/dashboard/settings/git/show-git-providers.tsx b/apps/dokploy/components/dashboard/settings/git/show-git-providers.tsx index c63efa93..d3011102 100644 --- a/apps/dokploy/components/dashboard/settings/git/show-git-providers.tsx +++ b/apps/dokploy/components/dashboard/settings/git/show-git-providers.tsx @@ -124,10 +124,10 @@ export const ShowGitProviders = () => { gitProvider.gitlab?.accessToken && gitProvider.gitlab?.refreshToken; - const haveGiteaRequirements = - isGitea && - gitProvider.gitea?.accessToken && - gitProvider.gitea?.refreshToken; + // const haveGiteaRequirements = + // isGitea && + // gitProvider.gitea?.accessToken && + // gitProvider.gitea?.refreshToken; return (
    {
    )} + {isGithub && haveGithubRequirements && ( { {...field} onChange={(e) => { const value = e.target.value; - if (value) { + if (value === "") { + field.onChange(undefined); + } else { const port = Number.parseInt(value); if (port > 0 && port < 65536) { field.onChange(port); } } }} + value={field.value || ""} type="number" /> diff --git a/apps/dokploy/components/dashboard/settings/web-server/manage-traefik-ports.tsx b/apps/dokploy/components/dashboard/settings/web-server/manage-traefik-ports.tsx index 92ef9f12..d20b7c91 100644 --- a/apps/dokploy/components/dashboard/settings/web-server/manage-traefik-ports.tsx +++ b/apps/dokploy/components/dashboard/settings/web-server/manage-traefik-ports.tsx @@ -159,9 +159,11 @@ export const ManageTraefikPorts = ({ children, serverId }: Props) => { - field.onChange(Number(e.target.value)) - } + onChange={(e) => { + const value = e.target.value; + field.onChange(value === "" ? undefined : Number(value)); + }} + value={field.value || ""} className="w-full dark:bg-black" placeholder="e.g. 8080" /> @@ -185,9 +187,11 @@ export const ManageTraefikPorts = ({ children, serverId }: Props) => { - field.onChange(Number(e.target.value)) - } + onChange={(e) => { + const value = e.target.value; + field.onChange(value === "" ? undefined : Number(value)); + }} + value={field.value || ""} className="w-full dark:bg-black" placeholder="e.g. 80" /> diff --git a/apps/dokploy/drizzle/0071_flimsy_plazm.sql b/apps/dokploy/drizzle/0071_flimsy_plazm.sql deleted file mode 100644 index f3609f64..00000000 --- a/apps/dokploy/drizzle/0071_flimsy_plazm.sql +++ /dev/null @@ -1,16 +0,0 @@ -ALTER TYPE "public"."gitProviderType" ADD VALUE 'gitea';--> statement-breakpoint -CREATE TABLE "gitea" ( - "giteaId" text PRIMARY KEY NOT NULL, - "giteaUrl" text DEFAULT 'https://gitea.com' NOT NULL, - "application_id" text, - "redirect_uri" text, - "secret" text, - "access_token" text, - "refresh_token" text, - "organization_name" text, - "expires_at" integer, - "gitProviderId" text NOT NULL, - "gitea_username" text -); ---> statement-breakpoint -ALTER TABLE "gitea" ADD CONSTRAINT "gitea_gitProviderId_git_provider_gitProviderId_fk" FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") ON DELETE cascade ON UPDATE no action; \ No newline at end of file diff --git a/apps/dokploy/drizzle/0072_low_redwing.sql b/apps/dokploy/drizzle/0072_low_redwing.sql deleted file mode 100644 index b17afb22..00000000 --- a/apps/dokploy/drizzle/0072_low_redwing.sql +++ /dev/null @@ -1,9 +0,0 @@ -ALTER TYPE "public"."sourceType" ADD VALUE 'gitea' BEFORE 'drop';--> statement-breakpoint -ALTER TABLE "application" ADD COLUMN "giteaProjectId" integer;--> statement-breakpoint -ALTER TABLE "application" ADD COLUMN "giteaRepository" text;--> statement-breakpoint -ALTER TABLE "application" ADD COLUMN "giteaOwner" text;--> statement-breakpoint -ALTER TABLE "application" ADD COLUMN "giteaBranch" text;--> statement-breakpoint -ALTER TABLE "application" ADD COLUMN "giteaBuildPath" text DEFAULT '/';--> statement-breakpoint -ALTER TABLE "application" ADD COLUMN "giteaPathNamespace" text;--> statement-breakpoint -ALTER TABLE "application" ADD COLUMN "giteaId" text;--> statement-breakpoint -ALTER TABLE "application" ADD CONSTRAINT "application_giteaId_gitea_giteaId_fk" FOREIGN KEY ("giteaId") REFERENCES "public"."gitea"("giteaId") ON DELETE set null ON UPDATE no action; \ No newline at end of file diff --git a/apps/dokploy/drizzle/0073_dark_tigra.sql b/apps/dokploy/drizzle/0073_dark_tigra.sql deleted file mode 100644 index 8ac8efa8..00000000 --- a/apps/dokploy/drizzle/0073_dark_tigra.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE "gitea" ADD COLUMN "client_id" text;--> statement-breakpoint -ALTER TABLE "gitea" ADD COLUMN "client_secret" text;--> statement-breakpoint -ALTER TABLE "gitea" DROP COLUMN "application_id";--> statement-breakpoint -ALTER TABLE "gitea" DROP COLUMN "secret";--> statement-breakpoint -ALTER TABLE "gitea" DROP COLUMN "refresh_token";--> statement-breakpoint -ALTER TABLE "gitea" DROP COLUMN "organization_name"; \ No newline at end of file diff --git a/apps/dokploy/drizzle/0074_military_miss_america.sql b/apps/dokploy/drizzle/0074_military_miss_america.sql deleted file mode 100644 index 34a623f8..00000000 --- a/apps/dokploy/drizzle/0074_military_miss_america.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE "gitea" ADD COLUMN "refresh_token" text;--> statement-breakpoint -ALTER TABLE "gitea" ADD COLUMN "organization_name" text;--> statement-breakpoint -ALTER TABLE "gitea" ADD COLUMN "scopes" text;--> statement-breakpoint -ALTER TABLE "gitea" ADD COLUMN "last_authenticated_at" integer; \ No newline at end of file diff --git a/apps/dokploy/drizzle/0075_wild_xorn.sql b/apps/dokploy/drizzle/0075_wild_xorn.sql deleted file mode 100644 index 076cad75..00000000 --- a/apps/dokploy/drizzle/0075_wild_xorn.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TYPE "public"."sourceTypeCompose" ADD VALUE 'gitea' BEFORE 'raw';--> statement-breakpoint -ALTER TABLE "compose" ADD COLUMN "giteaRepository" text;--> statement-breakpoint -ALTER TABLE "compose" ADD COLUMN "giteaOwner" text;--> statement-breakpoint -ALTER TABLE "compose" ADD COLUMN "giteaBranch" text;--> statement-breakpoint -ALTER TABLE "compose" ADD COLUMN "giteaId" text;--> statement-breakpoint -ALTER TABLE "compose" ADD CONSTRAINT "compose_giteaId_gitea_giteaId_fk" FOREIGN KEY ("giteaId") REFERENCES "public"."gitea"("giteaId") ON DELETE set null ON UPDATE no action; \ No newline at end of file diff --git a/apps/dokploy/drizzle/0076_tough_iron_patriot.sql b/apps/dokploy/drizzle/0076_tough_iron_patriot.sql deleted file mode 100644 index aec64e48..00000000 --- a/apps/dokploy/drizzle/0076_tough_iron_patriot.sql +++ /dev/null @@ -1,157 +0,0 @@ -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM pg_enum WHERE enumlabel = 'gitea' AND - enumtypid = (SELECT oid FROM pg_type WHERE typname = 'sourceType')) THEN - ALTER TYPE "public"."sourceType" ADD VALUE 'gitea' BEFORE 'drop'; - END IF; -END -$$; - -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM pg_enum WHERE enumlabel = 'gitea' AND - enumtypid = (SELECT oid FROM pg_type WHERE typname = 'sourceTypeCompose')) THEN - ALTER TYPE "public"."sourceTypeCompose" ADD VALUE 'gitea' BEFORE 'raw'; - END IF; -END -$$; - -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM pg_enum WHERE enumlabel = 'gitea' AND - enumtypid = (SELECT oid FROM pg_type WHERE typname = 'gitProviderType')) THEN - ALTER TYPE "public"."gitProviderType" ADD VALUE 'gitea'; - END IF; -END -$$; -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'gitea') THEN - CREATE TABLE "gitea" ( - "giteaId" text PRIMARY KEY NOT NULL, - "giteaUrl" text DEFAULT 'https://gitea.com' NOT NULL, - "redirect_uri" text, - "client_id" text, - "client_secret" text, - "gitProviderId" text NOT NULL, - "gitea_username" text, - "access_token" text, - "refresh_token" text, - "expires_at" integer, - "scopes" text DEFAULT 'repo,repo:status,read:user,read:org', - "last_authenticated_at" integer - ); - END IF; -END -$$; ---> statement-breakpoint -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'application' AND column_name = 'giteaProjectId') THEN - ALTER TABLE "application" ADD COLUMN "giteaProjectId" integer; - END IF; -END $$; - -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'application' AND column_name = 'giteaRepository') THEN - ALTER TABLE "application" ADD COLUMN "giteaRepository" text; - END IF; -END $$; - -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'application' AND column_name = 'giteaOwner') THEN - ALTER TABLE "application" ADD COLUMN "giteaOwner" text; - END IF; -END $$; - -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'application' AND column_name = 'giteaBranch') THEN - ALTER TABLE "application" ADD COLUMN "giteaBranch" text; - END IF; -END $$; - -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'application' AND column_name = 'giteaBuildPath') THEN - ALTER TABLE "application" ADD COLUMN "giteaBuildPath" text DEFAULT '/'; - END IF; -END $$; - -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'application' AND column_name = 'giteaPathNamespace') THEN - ALTER TABLE "application" ADD COLUMN "giteaPathNamespace" text; - END IF; -END $$; - -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'application' AND column_name = 'giteaId') THEN - ALTER TABLE "application" ADD COLUMN "giteaId" text; - END IF; -END $$; -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'compose' AND column_name = 'giteaRepository') THEN - ALTER TABLE "compose" ADD COLUMN "giteaRepository" text; - END IF; -END $$; - -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'compose' AND column_name = 'giteaOwner') THEN - ALTER TABLE "compose" ADD COLUMN "giteaOwner" text; - END IF; -END $$; - -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'compose' AND column_name = 'giteaBranch') THEN - ALTER TABLE "compose" ADD COLUMN "giteaBranch" text; - END IF; -END $$; - -DO $$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'compose' AND column_name = 'giteaId') THEN - ALTER TABLE "compose" ADD COLUMN "giteaId" text; - END IF; -END $$; -DO $$ -BEGIN - IF NOT EXISTS ( - SELECT 1 FROM information_schema.table_constraints - WHERE constraint_name = 'gitea_gitProviderId_git_provider_gitProviderId_fk' - ) THEN - ALTER TABLE "gitea" ADD CONSTRAINT "gitea_gitProviderId_git_provider_gitProviderId_fk" - FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") - ON DELETE cascade ON UPDATE no action; - END IF; -END $$; - -DO $$ -BEGIN - IF NOT EXISTS ( - SELECT 1 FROM information_schema.table_constraints - WHERE constraint_name = 'application_giteaId_gitea_giteaId_fk' - ) THEN - ALTER TABLE "application" ADD CONSTRAINT "application_giteaId_gitea_giteaId_fk" - FOREIGN KEY ("giteaId") REFERENCES "public"."gitea"("giteaId") - ON DELETE set null ON UPDATE no action; - END IF; -END $$; - -DO $$ -BEGIN - IF NOT EXISTS ( - SELECT 1 FROM information_schema.table_constraints - WHERE constraint_name = 'compose_giteaId_gitea_giteaId_fk' - ) THEN - ALTER TABLE "compose" ADD CONSTRAINT "compose_giteaId_gitea_giteaId_fk" - FOREIGN KEY ("giteaId") REFERENCES "public"."gitea"("giteaId") - ON DELETE set null ON UPDATE no action; - END IF; -END $$; \ No newline at end of file diff --git a/apps/dokploy/drizzle/0079_bizarre_wendell_rand.sql b/apps/dokploy/drizzle/0079_bizarre_wendell_rand.sql new file mode 100644 index 00000000..933a65e3 --- /dev/null +++ b/apps/dokploy/drizzle/0079_bizarre_wendell_rand.sql @@ -0,0 +1,32 @@ +ALTER TYPE "public"."sourceType" ADD VALUE 'gitea' BEFORE 'drop';--> statement-breakpoint +ALTER TYPE "public"."sourceTypeCompose" ADD VALUE 'gitea' BEFORE 'raw';--> statement-breakpoint +ALTER TYPE "public"."gitProviderType" ADD VALUE 'gitea';--> statement-breakpoint +CREATE TABLE "gitea" ( + "giteaId" text PRIMARY KEY NOT NULL, + "giteaUrl" text DEFAULT 'https://gitea.com' NOT NULL, + "redirect_uri" text, + "client_id" text, + "client_secret" text, + "gitProviderId" text NOT NULL, + "gitea_username" text, + "access_token" text, + "refresh_token" text, + "expires_at" integer, + "scopes" text DEFAULT 'repo,repo:status,read:user,read:org', + "last_authenticated_at" integer +); +--> statement-breakpoint +ALTER TABLE "application" ADD COLUMN "giteaProjectId" integer;--> statement-breakpoint +ALTER TABLE "application" ADD COLUMN "giteaRepository" text;--> statement-breakpoint +ALTER TABLE "application" ADD COLUMN "giteaOwner" text;--> statement-breakpoint +ALTER TABLE "application" ADD COLUMN "giteaBranch" text;--> statement-breakpoint +ALTER TABLE "application" ADD COLUMN "giteaBuildPath" text DEFAULT '/';--> statement-breakpoint +ALTER TABLE "application" ADD COLUMN "giteaPathNamespace" text;--> statement-breakpoint +ALTER TABLE "application" ADD COLUMN "giteaId" text;--> statement-breakpoint +ALTER TABLE "compose" ADD COLUMN "giteaRepository" text;--> statement-breakpoint +ALTER TABLE "compose" ADD COLUMN "giteaOwner" text;--> statement-breakpoint +ALTER TABLE "compose" ADD COLUMN "giteaBranch" text;--> statement-breakpoint +ALTER TABLE "compose" ADD COLUMN "giteaId" text;--> statement-breakpoint +ALTER TABLE "gitea" ADD CONSTRAINT "gitea_gitProviderId_git_provider_gitProviderId_fk" FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "application" ADD CONSTRAINT "application_giteaId_gitea_giteaId_fk" FOREIGN KEY ("giteaId") REFERENCES "public"."gitea"("giteaId") ON DELETE set null ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "compose" ADD CONSTRAINT "compose_giteaId_gitea_giteaId_fk" FOREIGN KEY ("giteaId") REFERENCES "public"."gitea"("giteaId") ON DELETE set null ON UPDATE no action; \ No newline at end of file diff --git a/apps/dokploy/drizzle/meta/0071_snapshot.json b/apps/dokploy/drizzle/meta/0071_snapshot.json index 1f5e3066..deb61325 100644 --- a/apps/dokploy/drizzle/meta/0071_snapshot.json +++ b/apps/dokploy/drizzle/meta/0071_snapshot.json @@ -1,5 +1,5 @@ { - "id": "436368c7-e9a2-4df0-8c8f-863a69c9432d", + "id": "44cb886c-d31a-4b3d-b70e-da306c74dcf5", "prevId": "53fc370e-731b-4bfe-874f-9ce725650082", "version": "7", "dialect": "postgresql", @@ -868,6 +868,12 @@ "notNull": true, "default": false }, + "logCleanupCron": { + "name": "logCleanupCron", + "type": "text", + "primaryKey": false, + "notNull": false + }, "enablePaidFeatures": { "name": "enablePaidFeatures", "type": "boolean", @@ -3914,100 +3920,6 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "public.gitea": { - "name": "gitea", - "schema": "", - "columns": { - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "giteaUrl": { - "name": "giteaUrl", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'https://gitea.com'" - }, - "application_id": { - "name": "application_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "redirect_uri": { - "name": "redirect_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "secret": { - "name": "secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "organization_name": { - "name": "organization_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "gitProviderId": { - "name": "gitProviderId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "gitea_username": { - "name": "gitea_username", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "gitea_gitProviderId_git_provider_gitProviderId_fk": { - "name": "gitea_gitProviderId_git_provider_gitProviderId_fk", - "tableFrom": "gitea", - "tableTo": "git_provider", - "columnsFrom": [ - "gitProviderId" - ], - "columnsTo": [ - "gitProviderId" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, "public.server": { "name": "server", "schema": "", @@ -5195,8 +5107,7 @@ "values": [ "github", "gitlab", - "bitbucket", - "gitea" + "bitbucket" ] }, "public.serverStatus": { diff --git a/apps/dokploy/drizzle/meta/0072_snapshot.json b/apps/dokploy/drizzle/meta/0072_snapshot.json index 87f8788b..17864232 100644 --- a/apps/dokploy/drizzle/meta/0072_snapshot.json +++ b/apps/dokploy/drizzle/meta/0072_snapshot.json @@ -1,6 +1,6 @@ { - "id": "4360a233-2c88-4d6c-834f-eef562e079e3", - "prevId": "436368c7-e9a2-4df0-8c8f-863a69c9432d", + "id": "ad43c733-01c3-4841-b600-252421350fb9", + "prevId": "44cb886c-d31a-4b3d-b70e-da306c74dcf5", "version": "7", "dialect": "postgresql", "tables": { @@ -235,43 +235,6 @@ "primaryKey": false, "notNull": false }, - "giteaProjectId": { - "name": "giteaProjectId", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "giteaRepository": { - "name": "giteaRepository", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaOwner": { - "name": "giteaOwner", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBranch": { - "name": "giteaBranch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBuildPath": { - "name": "giteaBuildPath", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'/'" - }, - "giteaPathNamespace": { - "name": "giteaPathNamespace", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketRepository": { "name": "bitbucketRepository", "type": "text", @@ -483,12 +446,6 @@ "primaryKey": false, "notNull": false }, - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketId": { "name": "bitbucketId", "type": "text", @@ -569,19 +526,6 @@ "onDelete": "set null", "onUpdate": "no action" }, - "application_giteaId_gitea_giteaId_fk": { - "name": "application_giteaId_gitea_giteaId_fk", - "tableFrom": "application", - "tableTo": "gitea", - "columnsFrom": [ - "giteaId" - ], - "columnsTo": [ - "giteaId" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, "application_bitbucketId_bitbucket_bitbucketId_fk": { "name": "application_bitbucketId_bitbucket_bitbucketId_fk", "tableFrom": "application", @@ -917,13 +861,6 @@ "notNull": true, "default": false }, - "enableLogRotation": { - "name": "enableLogRotation", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, "logCleanupCron": { "name": "logCleanupCron", "type": "text", @@ -1153,6 +1090,12 @@ "primaryKey": false, "notNull": true, "default": "'none'" + }, + "customCertResolver": { + "name": "customCertResolver", + "type": "text", + "primaryKey": false, + "notNull": false } }, "indexes": {}, @@ -3976,100 +3919,6 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "public.gitea": { - "name": "gitea", - "schema": "", - "columns": { - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "giteaUrl": { - "name": "giteaUrl", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'https://gitea.com'" - }, - "application_id": { - "name": "application_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "redirect_uri": { - "name": "redirect_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "secret": { - "name": "secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "organization_name": { - "name": "organization_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "gitProviderId": { - "name": "gitProviderId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "gitea_username": { - "name": "gitea_username", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "gitea_gitProviderId_git_provider_gitProviderId_fk": { - "name": "gitea_gitProviderId_git_provider_gitProviderId_fk", - "tableFrom": "gitea", - "tableTo": "git_provider", - "columnsFrom": [ - "gitProviderId" - ], - "columnsTo": [ - "gitProviderId" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, "public.server": { "name": "server", "schema": "", @@ -5134,7 +4983,6 @@ "github", "gitlab", "bitbucket", - "gitea", "drop" ] }, @@ -5259,8 +5107,7 @@ "values": [ "github", "gitlab", - "bitbucket", - "gitea" + "bitbucket" ] }, "public.serverStatus": { diff --git a/apps/dokploy/drizzle/meta/0073_snapshot.json b/apps/dokploy/drizzle/meta/0073_snapshot.json index dfc3d530..f0f70164 100644 --- a/apps/dokploy/drizzle/meta/0073_snapshot.json +++ b/apps/dokploy/drizzle/meta/0073_snapshot.json @@ -1,6 +1,6 @@ { - "id": "8946105c-e69c-49c7-8334-784ee2419a92", - "prevId": "4360a233-2c88-4d6c-834f-eef562e079e3", + "id": "5808aed9-4223-4ac4-ae22-6c0dae500d75", + "prevId": "ad43c733-01c3-4841-b600-252421350fb9", "version": "7", "dialect": "postgresql", "tables": { @@ -241,43 +241,6 @@ "primaryKey": false, "notNull": false }, - "giteaProjectId": { - "name": "giteaProjectId", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "giteaRepository": { - "name": "giteaRepository", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaOwner": { - "name": "giteaOwner", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBranch": { - "name": "giteaBranch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBuildPath": { - "name": "giteaBuildPath", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'/'" - }, - "giteaPathNamespace": { - "name": "giteaPathNamespace", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketRepository": { "name": "bitbucketRepository", "type": "text", @@ -489,12 +452,6 @@ "primaryKey": false, "notNull": false }, - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketId": { "name": "bitbucketId", "type": "text", @@ -575,19 +532,6 @@ "onDelete": "set null", "onUpdate": "no action" }, - "application_giteaId_gitea_giteaId_fk": { - "name": "application_giteaId_gitea_giteaId_fk", - "tableFrom": "application", - "tableTo": "gitea", - "columnsFrom": [ - "giteaId" - ], - "columnsTo": [ - "giteaId" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, "application_bitbucketId_bitbucket_bitbucketId_fk": { "name": "application_bitbucketId_bitbucket_bitbucketId_fk", "tableFrom": "application", @@ -923,13 +867,6 @@ "notNull": true, "default": false }, - "enableLogRotation": { - "name": "enableLogRotation", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, "logCleanupCron": { "name": "logCleanupCron", "type": "text", @@ -3988,88 +3925,6 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "public.gitea": { - "name": "gitea", - "schema": "", - "columns": { - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "giteaUrl": { - "name": "giteaUrl", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'https://gitea.com'" - }, - "redirect_uri": { - "name": "redirect_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "client_id": { - "name": "client_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "client_secret": { - "name": "client_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "gitProviderId": { - "name": "gitProviderId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "gitea_username": { - "name": "gitea_username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "gitea_gitProviderId_git_provider_gitProviderId_fk": { - "name": "gitea_gitProviderId_git_provider_gitProviderId_fk", - "tableFrom": "gitea", - "tableTo": "git_provider", - "columnsFrom": [ - "gitProviderId" - ], - "columnsTo": [ - "gitProviderId" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, "public.server": { "name": "server", "schema": "", @@ -5134,7 +4989,6 @@ "github", "gitlab", "bitbucket", - "gitea", "drop" ] }, @@ -5259,8 +5113,7 @@ "values": [ "github", "gitlab", - "bitbucket", - "gitea" + "bitbucket" ] }, "public.serverStatus": { diff --git a/apps/dokploy/drizzle/meta/0074_snapshot.json b/apps/dokploy/drizzle/meta/0074_snapshot.json index d5f7cf9f..1232f64f 100644 --- a/apps/dokploy/drizzle/meta/0074_snapshot.json +++ b/apps/dokploy/drizzle/meta/0074_snapshot.json @@ -1,6 +1,6 @@ { - "id": "85133e87-6886-493f-89d6-c83162f76d50", - "prevId": "8946105c-e69c-49c7-8334-784ee2419a92", + "id": "3584a243-55f6-418b-aece-985d878b30d7", + "prevId": "5808aed9-4223-4ac4-ae22-6c0dae500d75", "version": "7", "dialect": "postgresql", "tables": { @@ -241,43 +241,6 @@ "primaryKey": false, "notNull": false }, - "giteaProjectId": { - "name": "giteaProjectId", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "giteaRepository": { - "name": "giteaRepository", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaOwner": { - "name": "giteaOwner", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBranch": { - "name": "giteaBranch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBuildPath": { - "name": "giteaBuildPath", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'/'" - }, - "giteaPathNamespace": { - "name": "giteaPathNamespace", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketRepository": { "name": "bitbucketRepository", "type": "text", @@ -489,12 +452,6 @@ "primaryKey": false, "notNull": false }, - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketId": { "name": "bitbucketId", "type": "text", @@ -575,19 +532,6 @@ "onDelete": "set null", "onUpdate": "no action" }, - "application_giteaId_gitea_giteaId_fk": { - "name": "application_giteaId_gitea_giteaId_fk", - "tableFrom": "application", - "tableTo": "gitea", - "columnsFrom": [ - "giteaId" - ], - "columnsTo": [ - "giteaId" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, "application_bitbucketId_bitbucket_bitbucketId_fk": { "name": "application_bitbucketId_bitbucket_bitbucketId_fk", "tableFrom": "application", @@ -923,13 +867,6 @@ "notNull": true, "default": false }, - "enableLogRotation": { - "name": "enableLogRotation", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, "logCleanupCron": { "name": "logCleanupCron", "type": "text", @@ -3988,112 +3925,6 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "public.gitea": { - "name": "gitea", - "schema": "", - "columns": { - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "giteaUrl": { - "name": "giteaUrl", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'https://gitea.com'" - }, - "redirect_uri": { - "name": "redirect_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "client_id": { - "name": "client_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "client_secret": { - "name": "client_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "gitProviderId": { - "name": "gitProviderId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "gitea_username": { - "name": "gitea_username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "organization_name": { - "name": "organization_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scopes": { - "name": "scopes", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_authenticated_at": { - "name": "last_authenticated_at", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "gitea_gitProviderId_git_provider_gitProviderId_fk": { - "name": "gitea_gitProviderId_git_provider_gitProviderId_fk", - "tableFrom": "gitea", - "tableTo": "git_provider", - "columnsFrom": [ - "gitProviderId" - ], - "columnsTo": [ - "gitProviderId" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, "public.server": { "name": "server", "schema": "", @@ -5158,7 +4989,6 @@ "github", "gitlab", "bitbucket", - "gitea", "drop" ] }, @@ -5283,8 +5113,7 @@ "values": [ "github", "gitlab", - "bitbucket", - "gitea" + "bitbucket" ] }, "public.serverStatus": { diff --git a/apps/dokploy/drizzle/meta/0075_snapshot.json b/apps/dokploy/drizzle/meta/0075_snapshot.json index f6c49eea..bf55f0bb 100644 --- a/apps/dokploy/drizzle/meta/0075_snapshot.json +++ b/apps/dokploy/drizzle/meta/0075_snapshot.json @@ -1,6 +1,6 @@ { - "id": "00d7b47b-5341-4dda-b121-4a87cec39d95", - "prevId": "85133e87-6886-493f-89d6-c83162f76d50", + "id": "dd51ff04-a160-4d0d-b72f-4916493b740f", + "prevId": "3584a243-55f6-418b-aece-985d878b30d7", "version": "7", "dialect": "postgresql", "tables": { @@ -247,43 +247,6 @@ "primaryKey": false, "notNull": false }, - "giteaProjectId": { - "name": "giteaProjectId", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "giteaRepository": { - "name": "giteaRepository", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaOwner": { - "name": "giteaOwner", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBranch": { - "name": "giteaBranch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBuildPath": { - "name": "giteaBuildPath", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'/'" - }, - "giteaPathNamespace": { - "name": "giteaPathNamespace", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketRepository": { "name": "bitbucketRepository", "type": "text", @@ -495,12 +458,6 @@ "primaryKey": false, "notNull": false }, - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketId": { "name": "bitbucketId", "type": "text", @@ -581,19 +538,6 @@ "onDelete": "set null", "onUpdate": "no action" }, - "application_giteaId_gitea_giteaId_fk": { - "name": "application_giteaId_gitea_giteaId_fk", - "tableFrom": "application", - "tableTo": "gitea", - "columnsFrom": [ - "giteaId" - ], - "columnsTo": [ - "giteaId" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, "application_bitbucketId_bitbucket_bitbucketId_fk": { "name": "application_bitbucketId_bitbucket_bitbucketId_fk", "tableFrom": "application", @@ -929,13 +873,6 @@ "notNull": true, "default": false }, - "enableLogRotation": { - "name": "enableLogRotation", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, "logCleanupCron": { "name": "logCleanupCron", "type": "text", @@ -2971,24 +2908,6 @@ "primaryKey": false, "notNull": false }, - "giteaRepository": { - "name": "giteaRepository", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaOwner": { - "name": "giteaOwner", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBranch": { - "name": "giteaBranch", - "type": "text", - "primaryKey": false, - "notNull": false - }, "customGitUrl": { "name": "customGitUrl", "type": "text", @@ -3080,12 +2999,6 @@ "primaryKey": false, "notNull": false }, - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": false, - "notNull": false - }, "serverId": { "name": "serverId", "type": "text", @@ -3160,19 +3073,6 @@ "onDelete": "set null", "onUpdate": "no action" }, - "compose_giteaId_gitea_giteaId_fk": { - "name": "compose_giteaId_gitea_giteaId_fk", - "tableFrom": "compose", - "tableTo": "gitea", - "columnsFrom": [ - "giteaId" - ], - "columnsTo": [ - "giteaId" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, "compose_serverId_server_serverId_fk": { "name": "compose_serverId_server_serverId_fk", "tableFrom": "compose", @@ -4031,112 +3931,6 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "public.gitea": { - "name": "gitea", - "schema": "", - "columns": { - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "giteaUrl": { - "name": "giteaUrl", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'https://gitea.com'" - }, - "redirect_uri": { - "name": "redirect_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "client_id": { - "name": "client_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "client_secret": { - "name": "client_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "gitProviderId": { - "name": "gitProviderId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "gitea_username": { - "name": "gitea_username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "organization_name": { - "name": "organization_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scopes": { - "name": "scopes", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_authenticated_at": { - "name": "last_authenticated_at", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "gitea_gitProviderId_git_provider_gitProviderId_fk": { - "name": "gitea_gitProviderId_git_provider_gitProviderId_fk", - "tableFrom": "gitea", - "tableTo": "git_provider", - "columnsFrom": [ - "gitProviderId" - ], - "columnsTo": [ - "gitProviderId" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, "public.server": { "name": "server", "schema": "", @@ -5201,7 +4995,6 @@ "github", "gitlab", "bitbucket", - "gitea", "drop" ] }, @@ -5298,7 +5091,6 @@ "github", "gitlab", "bitbucket", - "gitea", "raw" ] }, @@ -5327,8 +5119,7 @@ "values": [ "github", "gitlab", - "bitbucket", - "gitea" + "bitbucket" ] }, "public.serverStatus": { diff --git a/apps/dokploy/drizzle/meta/0076_snapshot.json b/apps/dokploy/drizzle/meta/0076_snapshot.json index 92289ab8..56817ca7 100644 --- a/apps/dokploy/drizzle/meta/0076_snapshot.json +++ b/apps/dokploy/drizzle/meta/0076_snapshot.json @@ -1,6 +1,6 @@ { - "id": "7c8508ba-01eb-487e-88cf-0abe10916904", - "prevId": "f74127dc-3cda-4091-988f-97b60eb22427", + "id": "27ba0f3d-859f-4233-a179-8aee11ad9179", + "prevId": "dd51ff04-a160-4d0d-b72f-4916493b740f", "version": "7", "dialect": "postgresql", "tables": { @@ -179,13 +179,6 @@ "notNull": true, "default": "'github'" }, - "cleanCache": { - "name": "cleanCache", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, "repository": { "name": "repository", "type": "text", @@ -254,43 +247,6 @@ "primaryKey": false, "notNull": false }, - "giteaProjectId": { - "name": "giteaProjectId", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "giteaRepository": { - "name": "giteaRepository", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaOwner": { - "name": "giteaOwner", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBranch": { - "name": "giteaBranch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBuildPath": { - "name": "giteaBuildPath", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'/'" - }, - "giteaPathNamespace": { - "name": "giteaPathNamespace", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketRepository": { "name": "bitbucketRepository", "type": "text", @@ -502,12 +458,6 @@ "primaryKey": false, "notNull": false }, - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketId": { "name": "bitbucketId", "type": "text", @@ -588,19 +538,6 @@ "onDelete": "set null", "onUpdate": "no action" }, - "application_giteaId_gitea_giteaId_fk": { - "name": "application_giteaId_gitea_giteaId_fk", - "tableFrom": "application", - "tableTo": "gitea", - "columnsFrom": [ - "giteaId" - ], - "columnsTo": [ - "giteaId" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, "application_bitbucketId_bitbucket_bitbucketId_fk": { "name": "application_bitbucketId_bitbucket_bitbucketId_fk", "tableFrom": "application", @@ -1766,12 +1703,6 @@ "primaryKey": false, "notNull": true }, - "keepLatestCount": { - "name": "keepLatestCount", - "type": "integer", - "primaryKey": false, - "notNull": false - }, "databaseType": { "name": "databaseType", "type": "databaseType", @@ -2977,24 +2908,6 @@ "primaryKey": false, "notNull": false }, - "giteaRepository": { - "name": "giteaRepository", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaOwner": { - "name": "giteaOwner", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBranch": { - "name": "giteaBranch", - "type": "text", - "primaryKey": false, - "notNull": false - }, "customGitUrl": { "name": "customGitUrl", "type": "text", @@ -3092,12 +3005,6 @@ "primaryKey": false, "notNull": false }, - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": false, - "notNull": false - }, "serverId": { "name": "serverId", "type": "text", @@ -3172,19 +3079,6 @@ "onDelete": "set null", "onUpdate": "no action" }, - "compose_giteaId_gitea_giteaId_fk": { - "name": "compose_giteaId_gitea_giteaId_fk", - "tableFrom": "compose", - "tableTo": "gitea", - "columnsFrom": [ - "giteaId" - ], - "columnsTo": [ - "giteaId" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, "compose_serverId_server_serverId_fk": { "name": "compose_serverId_server_serverId_fk", "tableFrom": "compose", @@ -4043,107 +3937,6 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "public.gitea": { - "name": "gitea", - "schema": "", - "columns": { - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "giteaUrl": { - "name": "giteaUrl", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'https://gitea.com'" - }, - "redirect_uri": { - "name": "redirect_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "client_id": { - "name": "client_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "client_secret": { - "name": "client_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "gitProviderId": { - "name": "gitProviderId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "gitea_username": { - "name": "gitea_username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "scopes": { - "name": "scopes", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'repo,repo:status,read:user,read:org'" - }, - "last_authenticated_at": { - "name": "last_authenticated_at", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "gitea_gitProviderId_git_provider_gitProviderId_fk": { - "name": "gitea_gitProviderId_git_provider_gitProviderId_fk", - "tableFrom": "gitea", - "tableTo": "git_provider", - "columnsFrom": [ - "gitProviderId" - ], - "columnsTo": [ - "gitProviderId" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, "public.server": { "name": "server", "schema": "", @@ -5208,7 +5001,6 @@ "github", "gitlab", "bitbucket", - "gitea", "drop" ] }, @@ -5305,7 +5097,6 @@ "github", "gitlab", "bitbucket", - "gitea", "raw" ] }, @@ -5334,8 +5125,7 @@ "values": [ "github", "gitlab", - "bitbucket", - "gitea" + "bitbucket" ] }, "public.serverStatus": { diff --git a/apps/dokploy/drizzle/meta/0077_snapshot.json b/apps/dokploy/drizzle/meta/0077_snapshot.json index 5bb31889..d59a7b4d 100644 --- a/apps/dokploy/drizzle/meta/0077_snapshot.json +++ b/apps/dokploy/drizzle/meta/0077_snapshot.json @@ -1,6 +1,6 @@ { - "id": "c8f3ee9b-66c6-4a23-a151-78e04363bdf9", - "prevId": "f74127dc-3cda-4091-988f-97b60eb22427", + "id": "d4d95ab9-16bd-4583-949e-d6ae0a0bb7a0", + "prevId": "27ba0f3d-859f-4233-a179-8aee11ad9179", "version": "7", "dialect": "postgresql", "tables": { @@ -179,13 +179,6 @@ "notNull": true, "default": "'github'" }, - "cleanCache": { - "name": "cleanCache", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, "repository": { "name": "repository", "type": "text", @@ -254,43 +247,6 @@ "primaryKey": false, "notNull": false }, - "giteaProjectId": { - "name": "giteaProjectId", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "giteaRepository": { - "name": "giteaRepository", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaOwner": { - "name": "giteaOwner", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBranch": { - "name": "giteaBranch", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBuildPath": { - "name": "giteaBuildPath", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'/'" - }, - "giteaPathNamespace": { - "name": "giteaPathNamespace", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketRepository": { "name": "bitbucketRepository", "type": "text", @@ -502,12 +458,6 @@ "primaryKey": false, "notNull": false }, - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": false, - "notNull": false - }, "bitbucketId": { "name": "bitbucketId", "type": "text", @@ -588,19 +538,6 @@ "onDelete": "set null", "onUpdate": "no action" }, - "application_giteaId_gitea_giteaId_fk": { - "name": "application_giteaId_gitea_giteaId_fk", - "tableFrom": "application", - "tableTo": "gitea", - "columnsFrom": [ - "giteaId" - ], - "columnsTo": [ - "giteaId" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, "application_bitbucketId_bitbucket_bitbucketId_fk": { "name": "application_bitbucketId_bitbucket_bitbucketId_fk", "tableFrom": "application", @@ -2977,24 +2914,6 @@ "primaryKey": false, "notNull": false }, - "giteaRepository": { - "name": "giteaRepository", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaOwner": { - "name": "giteaOwner", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "giteaBranch": { - "name": "giteaBranch", - "type": "text", - "primaryKey": false, - "notNull": false - }, "customGitUrl": { "name": "customGitUrl", "type": "text", @@ -3092,12 +3011,6 @@ "primaryKey": false, "notNull": false }, - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": false, - "notNull": false - }, "serverId": { "name": "serverId", "type": "text", @@ -3172,19 +3085,6 @@ "onDelete": "set null", "onUpdate": "no action" }, - "compose_giteaId_gitea_giteaId_fk": { - "name": "compose_giteaId_gitea_giteaId_fk", - "tableFrom": "compose", - "tableTo": "gitea", - "columnsFrom": [ - "giteaId" - ], - "columnsTo": [ - "giteaId" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, "compose_serverId_server_serverId_fk": { "name": "compose_serverId_server_serverId_fk", "tableFrom": "compose", @@ -4043,107 +3943,6 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "public.gitea": { - "name": "gitea", - "schema": "", - "columns": { - "giteaId": { - "name": "giteaId", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "giteaUrl": { - "name": "giteaUrl", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'https://gitea.com'" - }, - "redirect_uri": { - "name": "redirect_uri", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "client_id": { - "name": "client_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "client_secret": { - "name": "client_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "gitProviderId": { - "name": "gitProviderId", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "gitea_username": { - "name": "gitea_username", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "scopes": { - "name": "scopes", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'repo,repo:status,read:user,read:org'" - }, - "last_authenticated_at": { - "name": "last_authenticated_at", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "gitea_gitProviderId_git_provider_gitProviderId_fk": { - "name": "gitea_gitProviderId_git_provider_gitProviderId_fk", - "tableFrom": "gitea", - "tableTo": "git_provider", - "columnsFrom": [ - "gitProviderId" - ], - "columnsTo": [ - "gitProviderId" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, "public.server": { "name": "server", "schema": "", @@ -5208,7 +5007,6 @@ "github", "gitlab", "bitbucket", - "gitea", "drop" ] }, @@ -5305,7 +5103,6 @@ "github", "gitlab", "bitbucket", - "gitea", "raw" ] }, @@ -5334,8 +5131,7 @@ "values": [ "github", "gitlab", - "bitbucket", - "gitea" + "bitbucket" ] }, "public.serverStatus": { diff --git a/apps/dokploy/drizzle/meta/0079_snapshot.json b/apps/dokploy/drizzle/meta/0079_snapshot.json new file mode 100644 index 00000000..fe64df56 --- /dev/null +++ b/apps/dokploy/drizzle/meta/0079_snapshot.json @@ -0,0 +1,5360 @@ +{ + "id": "2237c838-128a-4e4e-8d17-12bf6cef3262", + "prevId": "f74127dc-3cda-4091-988f-97b60eb22427", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.application": { + "name": "application", + "schema": "", + "columns": { + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "previewEnv": { + "name": "previewEnv", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "watchPaths": { + "name": "watchPaths", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "previewBuildArgs": { + "name": "previewBuildArgs", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "previewWildcard": { + "name": "previewWildcard", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "previewPort": { + "name": "previewPort", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 3000 + }, + "previewHttps": { + "name": "previewHttps", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "previewPath": { + "name": "previewPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "previewCustomCertResolver": { + "name": "previewCustomCertResolver", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "previewLimit": { + "name": "previewLimit", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 3 + }, + "isPreviewDeploymentsActive": { + "name": "isPreviewDeploymentsActive", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "buildArgs": { + "name": "buildArgs", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "subtitle": { + "name": "subtitle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refreshToken": { + "name": "refreshToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sourceType": { + "name": "sourceType", + "type": "sourceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'github'" + }, + "cleanCache": { + "name": "cleanCache", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "repository": { + "name": "repository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner": { + "name": "owner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "buildPath": { + "name": "buildPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "autoDeploy": { + "name": "autoDeploy", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "gitlabProjectId": { + "name": "gitlabProjectId", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "gitlabRepository": { + "name": "gitlabRepository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gitlabOwner": { + "name": "gitlabOwner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gitlabBranch": { + "name": "gitlabBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gitlabBuildPath": { + "name": "gitlabBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "gitlabPathNamespace": { + "name": "gitlabPathNamespace", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "giteaProjectId": { + "name": "giteaProjectId", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "giteaRepository": { + "name": "giteaRepository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "giteaOwner": { + "name": "giteaOwner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "giteaBranch": { + "name": "giteaBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "giteaBuildPath": { + "name": "giteaBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "giteaPathNamespace": { + "name": "giteaPathNamespace", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bitbucketRepository": { + "name": "bitbucketRepository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bitbucketOwner": { + "name": "bitbucketOwner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bitbucketBranch": { + "name": "bitbucketBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bitbucketBuildPath": { + "name": "bitbucketBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "registryUrl": { + "name": "registryUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitUrl": { + "name": "customGitUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBranch": { + "name": "customGitBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBuildPath": { + "name": "customGitBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitSSHKeyId": { + "name": "customGitSSHKeyId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerfile": { + "name": "dockerfile", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerContextPath": { + "name": "dockerContextPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerBuildStage": { + "name": "dockerBuildStage", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dropBuildPath": { + "name": "dropBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "healthCheckSwarm": { + "name": "healthCheckSwarm", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "restartPolicySwarm": { + "name": "restartPolicySwarm", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "placementSwarm": { + "name": "placementSwarm", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "updateConfigSwarm": { + "name": "updateConfigSwarm", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "rollbackConfigSwarm": { + "name": "rollbackConfigSwarm", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "modeSwarm": { + "name": "modeSwarm", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "labelsSwarm": { + "name": "labelsSwarm", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "networkSwarm": { + "name": "networkSwarm", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "replicas": { + "name": "replicas", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "buildType": { + "name": "buildType", + "type": "buildType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'nixpacks'" + }, + "herokuVersion": { + "name": "herokuVersion", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'24'" + }, + "publishDirectory": { + "name": "publishDirectory", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "githubId": { + "name": "githubId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gitlabId": { + "name": "gitlabId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "giteaId": { + "name": "giteaId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bitbucketId": { + "name": "bitbucketId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serverId": { + "name": "serverId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "application_customGitSSHKeyId_ssh-key_sshKeyId_fk": { + "name": "application_customGitSSHKeyId_ssh-key_sshKeyId_fk", + "tableFrom": "application", + "tableTo": "ssh-key", + "columnsFrom": [ + "customGitSSHKeyId" + ], + "columnsTo": [ + "sshKeyId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "application_registryId_registry_registryId_fk": { + "name": "application_registryId_registry_registryId_fk", + "tableFrom": "application", + "tableTo": "registry", + "columnsFrom": [ + "registryId" + ], + "columnsTo": [ + "registryId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "application_projectId_project_projectId_fk": { + "name": "application_projectId_project_projectId_fk", + "tableFrom": "application", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "application_githubId_github_githubId_fk": { + "name": "application_githubId_github_githubId_fk", + "tableFrom": "application", + "tableTo": "github", + "columnsFrom": [ + "githubId" + ], + "columnsTo": [ + "githubId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "application_gitlabId_gitlab_gitlabId_fk": { + "name": "application_gitlabId_gitlab_gitlabId_fk", + "tableFrom": "application", + "tableTo": "gitlab", + "columnsFrom": [ + "gitlabId" + ], + "columnsTo": [ + "gitlabId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "application_giteaId_gitea_giteaId_fk": { + "name": "application_giteaId_gitea_giteaId_fk", + "tableFrom": "application", + "tableTo": "gitea", + "columnsFrom": [ + "giteaId" + ], + "columnsTo": [ + "giteaId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "application_bitbucketId_bitbucket_bitbucketId_fk": { + "name": "application_bitbucketId_bitbucket_bitbucketId_fk", + "tableFrom": "application", + "tableTo": "bitbucket", + "columnsFrom": [ + "bitbucketId" + ], + "columnsTo": [ + "bitbucketId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "application_serverId_server_serverId_fk": { + "name": "application_serverId_server_serverId_fk", + "tableFrom": "application", + "tableTo": "server", + "columnsFrom": [ + "serverId" + ], + "columnsTo": [ + "serverId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "application_appName_unique": { + "name": "application_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.postgres": { + "name": "postgres", + "schema": "", + "columns": { + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverId": { + "name": "serverId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "postgres_projectId_project_projectId_fk": { + "name": "postgres_projectId_project_projectId_fk", + "tableFrom": "postgres", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "postgres_serverId_server_serverId_fk": { + "name": "postgres_serverId_server_serverId_fk", + "tableFrom": "postgres", + "tableTo": "server", + "columnsFrom": [ + "serverId" + ], + "columnsTo": [ + "serverId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "postgres_appName_unique": { + "name": "postgres_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_temp": { + "name": "user_temp", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "isRegistered": { + "name": "isRegistered", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "expirationDate": { + "name": "expirationDate", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "two_factor_enabled": { + "name": "two_factor_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email_verified": { + "name": "email_verified", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "banned": { + "name": "banned", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "ban_reason": { + "name": "ban_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ban_expires": { + "name": "ban_expires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "serverIp": { + "name": "serverIp", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "letsEncryptEmail": { + "name": "letsEncryptEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sshPrivateKey": { + "name": "sshPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enableDockerCleanup": { + "name": "enableDockerCleanup", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "logCleanupCron": { + "name": "logCleanupCron", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enablePaidFeatures": { + "name": "enablePaidFeatures", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "metricsConfig": { + "name": "metricsConfig", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{\"server\":{\"type\":\"Dokploy\",\"refreshRate\":60,\"port\":4500,\"token\":\"\",\"retentionDays\":2,\"cronJob\":\"\",\"urlCallback\":\"\",\"thresholds\":{\"cpu\":0,\"memory\":0}},\"containers\":{\"refreshRate\":60,\"services\":{\"include\":[],\"exclude\":[]}}}'::jsonb" + }, + "cleanupCacheApplications": { + "name": "cleanupCacheApplications", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "cleanupCacheOnPreviews": { + "name": "cleanupCacheOnPreviews", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "cleanupCacheOnCompose": { + "name": "cleanupCacheOnCompose", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "stripeCustomerId": { + "name": "stripeCustomerId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stripeSubscriptionId": { + "name": "stripeSubscriptionId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serversQuantity": { + "name": "serversQuantity", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_temp_email_unique": { + "name": "user_temp_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project": { + "name": "project", + "schema": "", + "columns": { + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organizationId": { + "name": "organizationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": {}, + "foreignKeys": { + "project_organizationId_organization_id_fk": { + "name": "project_organizationId_organization_id_fk", + "tableFrom": "project", + "tableTo": "organization", + "columnsFrom": [ + "organizationId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.domain": { + "name": "domain", + "schema": "", + "columns": { + "domainId": { + "name": "domainId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "https": { + "name": "https", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "port": { + "name": "port", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 3000 + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "serviceName": { + "name": "serviceName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "domainType": { + "name": "domainType", + "type": "domainType", + "typeSchema": "public", + "primaryKey": false, + "notNull": false, + "default": "'application'" + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "composeId": { + "name": "composeId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customCertResolver": { + "name": "customCertResolver", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "previewDeploymentId": { + "name": "previewDeploymentId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + } + }, + "indexes": {}, + "foreignKeys": { + "domain_composeId_compose_composeId_fk": { + "name": "domain_composeId_compose_composeId_fk", + "tableFrom": "domain", + "tableTo": "compose", + "columnsFrom": [ + "composeId" + ], + "columnsTo": [ + "composeId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "domain_applicationId_application_applicationId_fk": { + "name": "domain_applicationId_application_applicationId_fk", + "tableFrom": "domain", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "domain_previewDeploymentId_preview_deployments_previewDeploymentId_fk": { + "name": "domain_previewDeploymentId_preview_deployments_previewDeploymentId_fk", + "tableFrom": "domain", + "tableTo": "preview_deployments", + "columnsFrom": [ + "previewDeploymentId" + ], + "columnsTo": [ + "previewDeploymentId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mariadb": { + "name": "mariadb", + "schema": "", + "columns": { + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverId": { + "name": "serverId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "mariadb_projectId_project_projectId_fk": { + "name": "mariadb_projectId_project_projectId_fk", + "tableFrom": "mariadb", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mariadb_serverId_server_serverId_fk": { + "name": "mariadb_serverId_server_serverId_fk", + "tableFrom": "mariadb", + "tableTo": "server", + "columnsFrom": [ + "serverId" + ], + "columnsTo": [ + "serverId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mariadb_appName_unique": { + "name": "mariadb_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mongo": { + "name": "mongo", + "schema": "", + "columns": { + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverId": { + "name": "serverId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "replicaSets": { + "name": "replicaSets", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "mongo_projectId_project_projectId_fk": { + "name": "mongo_projectId_project_projectId_fk", + "tableFrom": "mongo", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mongo_serverId_server_serverId_fk": { + "name": "mongo_serverId_server_serverId_fk", + "tableFrom": "mongo", + "tableTo": "server", + "columnsFrom": [ + "serverId" + ], + "columnsTo": [ + "serverId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mongo_appName_unique": { + "name": "mongo_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mysql": { + "name": "mysql", + "schema": "", + "columns": { + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverId": { + "name": "serverId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "mysql_projectId_project_projectId_fk": { + "name": "mysql_projectId_project_projectId_fk", + "tableFrom": "mysql", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mysql_serverId_server_serverId_fk": { + "name": "mysql_serverId_server_serverId_fk", + "tableFrom": "mysql", + "tableTo": "server", + "columnsFrom": [ + "serverId" + ], + "columnsTo": [ + "serverId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mysql_appName_unique": { + "name": "mysql_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.backup": { + "name": "backup", + "schema": "", + "columns": { + "backupId": { + "name": "backupId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "schedule": { + "name": "schedule", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "database": { + "name": "database", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "keepLatestCount": { + "name": "keepLatestCount", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "databaseType": { + "name": "databaseType", + "type": "databaseType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "backup_destinationId_destination_destinationId_fk": { + "name": "backup_destinationId_destination_destinationId_fk", + "tableFrom": "backup", + "tableTo": "destination", + "columnsFrom": [ + "destinationId" + ], + "columnsTo": [ + "destinationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_postgresId_postgres_postgresId_fk": { + "name": "backup_postgresId_postgres_postgresId_fk", + "tableFrom": "backup", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mariadbId_mariadb_mariadbId_fk": { + "name": "backup_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "backup", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mysqlId_mysql_mysqlId_fk": { + "name": "backup_mysqlId_mysql_mysqlId_fk", + "tableFrom": "backup", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mongoId_mongo_mongoId_fk": { + "name": "backup_mongoId_mongo_mongoId_fk", + "tableFrom": "backup", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.destination": { + "name": "destination", + "schema": "", + "columns": { + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "accessKey": { + "name": "accessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secretAccessKey": { + "name": "secretAccessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bucket": { + "name": "bucket", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "region": { + "name": "region", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organizationId": { + "name": "organizationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "destination_organizationId_organization_id_fk": { + "name": "destination_organizationId_organization_id_fk", + "tableFrom": "destination", + "tableTo": "organization", + "columnsFrom": [ + "organizationId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.deployment": { + "name": "deployment", + "schema": "", + "columns": { + "deploymentId": { + "name": "deploymentId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "deploymentStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": false, + "default": "'running'" + }, + "logPath": { + "name": "logPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "composeId": { + "name": "composeId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serverId": { + "name": "serverId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "isPreviewDeployment": { + "name": "isPreviewDeployment", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "previewDeploymentId": { + "name": "previewDeploymentId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "errorMessage": { + "name": "errorMessage", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "deployment_applicationId_application_applicationId_fk": { + "name": "deployment_applicationId_application_applicationId_fk", + "tableFrom": "deployment", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "deployment_composeId_compose_composeId_fk": { + "name": "deployment_composeId_compose_composeId_fk", + "tableFrom": "deployment", + "tableTo": "compose", + "columnsFrom": [ + "composeId" + ], + "columnsTo": [ + "composeId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "deployment_serverId_server_serverId_fk": { + "name": "deployment_serverId_server_serverId_fk", + "tableFrom": "deployment", + "tableTo": "server", + "columnsFrom": [ + "serverId" + ], + "columnsTo": [ + "serverId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "deployment_previewDeploymentId_preview_deployments_previewDeploymentId_fk": { + "name": "deployment_previewDeploymentId_preview_deployments_previewDeploymentId_fk", + "tableFrom": "deployment", + "tableTo": "preview_deployments", + "columnsFrom": [ + "previewDeploymentId" + ], + "columnsTo": [ + "previewDeploymentId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mount": { + "name": "mount", + "schema": "", + "columns": { + "mountId": { + "name": "mountId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "mountType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "hostPath": { + "name": "hostPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "volumeName": { + "name": "volumeName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "filePath": { + "name": "filePath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serviceType": { + "name": "serviceType", + "type": "serviceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'application'" + }, + "mountPath": { + "name": "mountPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "composeId": { + "name": "composeId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "mount_applicationId_application_applicationId_fk": { + "name": "mount_applicationId_application_applicationId_fk", + "tableFrom": "mount", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_postgresId_postgres_postgresId_fk": { + "name": "mount_postgresId_postgres_postgresId_fk", + "tableFrom": "mount", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mariadbId_mariadb_mariadbId_fk": { + "name": "mount_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "mount", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mongoId_mongo_mongoId_fk": { + "name": "mount_mongoId_mongo_mongoId_fk", + "tableFrom": "mount", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mysqlId_mysql_mysqlId_fk": { + "name": "mount_mysqlId_mysql_mysqlId_fk", + "tableFrom": "mount", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_redisId_redis_redisId_fk": { + "name": "mount_redisId_redis_redisId_fk", + "tableFrom": "mount", + "tableTo": "redis", + "columnsFrom": [ + "redisId" + ], + "columnsTo": [ + "redisId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_composeId_compose_composeId_fk": { + "name": "mount_composeId_compose_composeId_fk", + "tableFrom": "mount", + "tableTo": "compose", + "columnsFrom": [ + "composeId" + ], + "columnsTo": [ + "composeId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.certificate": { + "name": "certificate", + "schema": "", + "columns": { + "certificateId": { + "name": "certificateId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateData": { + "name": "certificateData", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privateKey": { + "name": "privateKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificatePath": { + "name": "certificatePath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "autoRenew": { + "name": "autoRenew", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "organizationId": { + "name": "organizationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverId": { + "name": "serverId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "certificate_organizationId_organization_id_fk": { + "name": "certificate_organizationId_organization_id_fk", + "tableFrom": "certificate", + "tableTo": "organization", + "columnsFrom": [ + "organizationId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "certificate_serverId_server_serverId_fk": { + "name": "certificate_serverId_server_serverId_fk", + "tableFrom": "certificate", + "tableTo": "server", + "columnsFrom": [ + "serverId" + ], + "columnsTo": [ + "serverId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "certificate_certificatePath_unique": { + "name": "certificate_certificatePath_unique", + "nullsNotDistinct": false, + "columns": [ + "certificatePath" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.session_temp": { + "name": "session_temp", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "impersonated_by": { + "name": "impersonated_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active_organization_id": { + "name": "active_organization_id", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "session_temp_user_id_user_temp_id_fk": { + "name": "session_temp_user_id_user_temp_id_fk", + "tableFrom": "session_temp", + "tableTo": "user_temp", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "session_temp_token_unique": { + "name": "session_temp_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.redirect": { + "name": "redirect", + "schema": "", + "columns": { + "redirectId": { + "name": "redirectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "regex": { + "name": "regex", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "replacement": { + "name": "replacement", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "permanent": { + "name": "permanent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redirect_applicationId_application_applicationId_fk": { + "name": "redirect_applicationId_application_applicationId_fk", + "tableFrom": "redirect", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.security": { + "name": "security", + "schema": "", + "columns": { + "securityId": { + "name": "securityId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "security_applicationId_application_applicationId_fk": { + "name": "security_applicationId_application_applicationId_fk", + "tableFrom": "security", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "security_username_applicationId_unique": { + "name": "security_username_applicationId_unique", + "nullsNotDistinct": false, + "columns": [ + "username", + "applicationId" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.port": { + "name": "port", + "schema": "", + "columns": { + "portId": { + "name": "portId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "publishedPort": { + "name": "publishedPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "targetPort": { + "name": "targetPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "protocol": { + "name": "protocol", + "type": "protocolType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "port_applicationId_application_applicationId_fk": { + "name": "port_applicationId_application_applicationId_fk", + "tableFrom": "port", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.redis": { + "name": "redis", + "schema": "", + "columns": { + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverId": { + "name": "serverId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "redis_projectId_project_projectId_fk": { + "name": "redis_projectId_project_projectId_fk", + "tableFrom": "redis", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "redis_serverId_server_serverId_fk": { + "name": "redis_serverId_server_serverId_fk", + "tableFrom": "redis", + "tableTo": "server", + "columnsFrom": [ + "serverId" + ], + "columnsTo": [ + "serverId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "redis_appName_unique": { + "name": "redis_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.compose": { + "name": "compose", + "schema": "", + "columns": { + "composeId": { + "name": "composeId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "composeFile": { + "name": "composeFile", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "refreshToken": { + "name": "refreshToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sourceType": { + "name": "sourceType", + "type": "sourceTypeCompose", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'github'" + }, + "composeType": { + "name": "composeType", + "type": "composeType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'docker-compose'" + }, + "repository": { + "name": "repository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner": { + "name": "owner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "autoDeploy": { + "name": "autoDeploy", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "gitlabProjectId": { + "name": "gitlabProjectId", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "gitlabRepository": { + "name": "gitlabRepository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gitlabOwner": { + "name": "gitlabOwner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gitlabBranch": { + "name": "gitlabBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gitlabPathNamespace": { + "name": "gitlabPathNamespace", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bitbucketRepository": { + "name": "bitbucketRepository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bitbucketOwner": { + "name": "bitbucketOwner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bitbucketBranch": { + "name": "bitbucketBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "giteaRepository": { + "name": "giteaRepository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "giteaOwner": { + "name": "giteaOwner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "giteaBranch": { + "name": "giteaBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitUrl": { + "name": "customGitUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBranch": { + "name": "customGitBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitSSHKeyId": { + "name": "customGitSSHKeyId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "composePath": { + "name": "composePath", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'./docker-compose.yml'" + }, + "suffix": { + "name": "suffix", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "randomize": { + "name": "randomize", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "isolatedDeployment": { + "name": "isolatedDeployment", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "composeStatus": { + "name": "composeStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "watchPaths": { + "name": "watchPaths", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "githubId": { + "name": "githubId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gitlabId": { + "name": "gitlabId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bitbucketId": { + "name": "bitbucketId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "giteaId": { + "name": "giteaId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serverId": { + "name": "serverId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "compose_customGitSSHKeyId_ssh-key_sshKeyId_fk": { + "name": "compose_customGitSSHKeyId_ssh-key_sshKeyId_fk", + "tableFrom": "compose", + "tableTo": "ssh-key", + "columnsFrom": [ + "customGitSSHKeyId" + ], + "columnsTo": [ + "sshKeyId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "compose_projectId_project_projectId_fk": { + "name": "compose_projectId_project_projectId_fk", + "tableFrom": "compose", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "compose_githubId_github_githubId_fk": { + "name": "compose_githubId_github_githubId_fk", + "tableFrom": "compose", + "tableTo": "github", + "columnsFrom": [ + "githubId" + ], + "columnsTo": [ + "githubId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "compose_gitlabId_gitlab_gitlabId_fk": { + "name": "compose_gitlabId_gitlab_gitlabId_fk", + "tableFrom": "compose", + "tableTo": "gitlab", + "columnsFrom": [ + "gitlabId" + ], + "columnsTo": [ + "gitlabId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "compose_bitbucketId_bitbucket_bitbucketId_fk": { + "name": "compose_bitbucketId_bitbucket_bitbucketId_fk", + "tableFrom": "compose", + "tableTo": "bitbucket", + "columnsFrom": [ + "bitbucketId" + ], + "columnsTo": [ + "bitbucketId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "compose_giteaId_gitea_giteaId_fk": { + "name": "compose_giteaId_gitea_giteaId_fk", + "tableFrom": "compose", + "tableTo": "gitea", + "columnsFrom": [ + "giteaId" + ], + "columnsTo": [ + "giteaId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "compose_serverId_server_serverId_fk": { + "name": "compose_serverId_server_serverId_fk", + "tableFrom": "compose", + "tableTo": "server", + "columnsFrom": [ + "serverId" + ], + "columnsTo": [ + "serverId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.registry": { + "name": "registry", + "schema": "", + "columns": { + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "registryName": { + "name": "registryName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "imagePrefix": { + "name": "imagePrefix", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryUrl": { + "name": "registryUrl", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "selfHosted": { + "name": "selfHosted", + "type": "RegistryType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'cloud'" + }, + "organizationId": { + "name": "organizationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "registry_organizationId_organization_id_fk": { + "name": "registry_organizationId_organization_id_fk", + "tableFrom": "registry", + "tableTo": "organization", + "columnsFrom": [ + "organizationId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.discord": { + "name": "discord", + "schema": "", + "columns": { + "discordId": { + "name": "discordId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "webhookUrl": { + "name": "webhookUrl", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "decoration": { + "name": "decoration", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.email": { + "name": "email", + "schema": "", + "columns": { + "emailId": { + "name": "emailId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "smtpServer": { + "name": "smtpServer", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "smtpPort": { + "name": "smtpPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fromAddress": { + "name": "fromAddress", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "toAddress": { + "name": "toAddress", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.gotify": { + "name": "gotify", + "schema": "", + "columns": { + "gotifyId": { + "name": "gotifyId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "serverUrl": { + "name": "serverUrl", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appToken": { + "name": "appToken", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "priority": { + "name": "priority", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 5 + }, + "decoration": { + "name": "decoration", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.notification": { + "name": "notification", + "schema": "", + "columns": { + "notificationId": { + "name": "notificationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appDeploy": { + "name": "appDeploy", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "appBuildError": { + "name": "appBuildError", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "databaseBackup": { + "name": "databaseBackup", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "dokployRestart": { + "name": "dokployRestart", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "dockerCleanup": { + "name": "dockerCleanup", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "serverThreshold": { + "name": "serverThreshold", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "notificationType": { + "name": "notificationType", + "type": "notificationType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slackId": { + "name": "slackId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "telegramId": { + "name": "telegramId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "discordId": { + "name": "discordId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "emailId": { + "name": "emailId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gotifyId": { + "name": "gotifyId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "organizationId": { + "name": "organizationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "notification_slackId_slack_slackId_fk": { + "name": "notification_slackId_slack_slackId_fk", + "tableFrom": "notification", + "tableTo": "slack", + "columnsFrom": [ + "slackId" + ], + "columnsTo": [ + "slackId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notification_telegramId_telegram_telegramId_fk": { + "name": "notification_telegramId_telegram_telegramId_fk", + "tableFrom": "notification", + "tableTo": "telegram", + "columnsFrom": [ + "telegramId" + ], + "columnsTo": [ + "telegramId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notification_discordId_discord_discordId_fk": { + "name": "notification_discordId_discord_discordId_fk", + "tableFrom": "notification", + "tableTo": "discord", + "columnsFrom": [ + "discordId" + ], + "columnsTo": [ + "discordId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notification_emailId_email_emailId_fk": { + "name": "notification_emailId_email_emailId_fk", + "tableFrom": "notification", + "tableTo": "email", + "columnsFrom": [ + "emailId" + ], + "columnsTo": [ + "emailId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notification_gotifyId_gotify_gotifyId_fk": { + "name": "notification_gotifyId_gotify_gotifyId_fk", + "tableFrom": "notification", + "tableTo": "gotify", + "columnsFrom": [ + "gotifyId" + ], + "columnsTo": [ + "gotifyId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notification_organizationId_organization_id_fk": { + "name": "notification_organizationId_organization_id_fk", + "tableFrom": "notification", + "tableTo": "organization", + "columnsFrom": [ + "organizationId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.slack": { + "name": "slack", + "schema": "", + "columns": { + "slackId": { + "name": "slackId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "webhookUrl": { + "name": "webhookUrl", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "channel": { + "name": "channel", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.telegram": { + "name": "telegram", + "schema": "", + "columns": { + "telegramId": { + "name": "telegramId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "botToken": { + "name": "botToken", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chatId": { + "name": "chatId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "messageThreadId": { + "name": "messageThreadId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ssh-key": { + "name": "ssh-key", + "schema": "", + "columns": { + "sshKeyId": { + "name": "sshKeyId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "privateKey": { + "name": "privateKey", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "publicKey": { + "name": "publicKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lastUsedAt": { + "name": "lastUsedAt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "organizationId": { + "name": "organizationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "ssh-key_organizationId_organization_id_fk": { + "name": "ssh-key_organizationId_organization_id_fk", + "tableFrom": "ssh-key", + "tableTo": "organization", + "columnsFrom": [ + "organizationId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.git_provider": { + "name": "git_provider", + "schema": "", + "columns": { + "gitProviderId": { + "name": "gitProviderId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "providerType": { + "name": "providerType", + "type": "gitProviderType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'github'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organizationId": { + "name": "organizationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "git_provider_organizationId_organization_id_fk": { + "name": "git_provider_organizationId_organization_id_fk", + "tableFrom": "git_provider", + "tableTo": "organization", + "columnsFrom": [ + "organizationId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.bitbucket": { + "name": "bitbucket", + "schema": "", + "columns": { + "bitbucketId": { + "name": "bitbucketId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "bitbucketUsername": { + "name": "bitbucketUsername", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "appPassword": { + "name": "appPassword", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bitbucketWorkspaceName": { + "name": "bitbucketWorkspaceName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gitProviderId": { + "name": "gitProviderId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "bitbucket_gitProviderId_git_provider_gitProviderId_fk": { + "name": "bitbucket_gitProviderId_git_provider_gitProviderId_fk", + "tableFrom": "bitbucket", + "tableTo": "git_provider", + "columnsFrom": [ + "gitProviderId" + ], + "columnsTo": [ + "gitProviderId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.github": { + "name": "github", + "schema": "", + "columns": { + "githubId": { + "name": "githubId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "githubAppName": { + "name": "githubAppName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubAppId": { + "name": "githubAppId", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "githubClientId": { + "name": "githubClientId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientSecret": { + "name": "githubClientSecret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubInstallationId": { + "name": "githubInstallationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubPrivateKey": { + "name": "githubPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubWebhookSecret": { + "name": "githubWebhookSecret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gitProviderId": { + "name": "gitProviderId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "github_gitProviderId_git_provider_gitProviderId_fk": { + "name": "github_gitProviderId_git_provider_gitProviderId_fk", + "tableFrom": "github", + "tableTo": "git_provider", + "columnsFrom": [ + "gitProviderId" + ], + "columnsTo": [ + "gitProviderId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.gitlab": { + "name": "gitlab", + "schema": "", + "columns": { + "gitlabId": { + "name": "gitlabId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "gitlabUrl": { + "name": "gitlabUrl", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'https://gitlab.com'" + }, + "application_id": { + "name": "application_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "redirect_uri": { + "name": "redirect_uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "group_name": { + "name": "group_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "gitProviderId": { + "name": "gitProviderId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "gitlab_gitProviderId_git_provider_gitProviderId_fk": { + "name": "gitlab_gitProviderId_git_provider_gitProviderId_fk", + "tableFrom": "gitlab", + "tableTo": "git_provider", + "columnsFrom": [ + "gitProviderId" + ], + "columnsTo": [ + "gitProviderId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.gitea": { + "name": "gitea", + "schema": "", + "columns": { + "giteaId": { + "name": "giteaId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "giteaUrl": { + "name": "giteaUrl", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'https://gitea.com'" + }, + "redirect_uri": { + "name": "redirect_uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "client_id": { + "name": "client_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "client_secret": { + "name": "client_secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gitProviderId": { + "name": "gitProviderId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "gitea_username": { + "name": "gitea_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "scopes": { + "name": "scopes", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'repo,repo:status,read:user,read:org'" + }, + "last_authenticated_at": { + "name": "last_authenticated_at", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "gitea_gitProviderId_git_provider_gitProviderId_fk": { + "name": "gitea_gitProviderId_git_provider_gitProviderId_fk", + "tableFrom": "gitea", + "tableTo": "git_provider", + "columnsFrom": [ + "gitProviderId" + ], + "columnsTo": [ + "gitProviderId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.server": { + "name": "server", + "schema": "", + "columns": { + "serverId": { + "name": "serverId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "port": { + "name": "port", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'root'" + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enableDockerCleanup": { + "name": "enableDockerCleanup", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organizationId": { + "name": "organizationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverStatus": { + "name": "serverStatus", + "type": "serverStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "sshKeyId": { + "name": "sshKeyId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metricsConfig": { + "name": "metricsConfig", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{\"server\":{\"type\":\"Remote\",\"refreshRate\":60,\"port\":4500,\"token\":\"\",\"urlCallback\":\"\",\"cronJob\":\"\",\"retentionDays\":2,\"thresholds\":{\"cpu\":0,\"memory\":0}},\"containers\":{\"refreshRate\":60,\"services\":{\"include\":[],\"exclude\":[]}}}'::jsonb" + } + }, + "indexes": {}, + "foreignKeys": { + "server_organizationId_organization_id_fk": { + "name": "server_organizationId_organization_id_fk", + "tableFrom": "server", + "tableTo": "organization", + "columnsFrom": [ + "organizationId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "server_sshKeyId_ssh-key_sshKeyId_fk": { + "name": "server_sshKeyId_ssh-key_sshKeyId_fk", + "tableFrom": "server", + "tableTo": "ssh-key", + "columnsFrom": [ + "sshKeyId" + ], + "columnsTo": [ + "sshKeyId" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.preview_deployments": { + "name": "preview_deployments", + "schema": "", + "columns": { + "previewDeploymentId": { + "name": "previewDeploymentId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "pullRequestId": { + "name": "pullRequestId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "pullRequestNumber": { + "name": "pullRequestNumber", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "pullRequestURL": { + "name": "pullRequestURL", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "pullRequestTitle": { + "name": "pullRequestTitle", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "pullRequestCommentId": { + "name": "pullRequestCommentId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "previewStatus": { + "name": "previewStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "domainId": { + "name": "domainId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expiresAt": { + "name": "expiresAt", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "preview_deployments_applicationId_application_applicationId_fk": { + "name": "preview_deployments_applicationId_application_applicationId_fk", + "tableFrom": "preview_deployments", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "preview_deployments_domainId_domain_domainId_fk": { + "name": "preview_deployments_domainId_domain_domainId_fk", + "tableFrom": "preview_deployments", + "tableTo": "domain", + "columnsFrom": [ + "domainId" + ], + "columnsTo": [ + "domainId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "preview_deployments_appName_unique": { + "name": "preview_deployments_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ai": { + "name": "ai", + "schema": "", + "columns": { + "aiId": { + "name": "aiId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "apiUrl": { + "name": "apiUrl", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "apiKey": { + "name": "apiKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "isEnabled": { + "name": "isEnabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "organizationId": { + "name": "organizationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "ai_organizationId_organization_id_fk": { + "name": "ai_organizationId_organization_id_fk", + "tableFrom": "ai", + "tableTo": "organization", + "columnsFrom": [ + "organizationId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.account": { + "name": "account", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "account_id": { + "name": "account_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id_token": { + "name": "id_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token_expires_at": { + "name": "access_token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "refresh_token_expires_at": { + "name": "refresh_token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is2FAEnabled": { + "name": "is2FAEnabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "resetPasswordToken": { + "name": "resetPasswordToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "resetPasswordExpiresAt": { + "name": "resetPasswordExpiresAt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "confirmationToken": { + "name": "confirmationToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "confirmationExpiresAt": { + "name": "confirmationExpiresAt", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "account_user_id_user_temp_id_fk": { + "name": "account_user_id_user_temp_id_fk", + "tableFrom": "account", + "tableTo": "user_temp", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.apikey": { + "name": "apikey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "start": { + "name": "start", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refill_interval": { + "name": "refill_interval", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "refill_amount": { + "name": "refill_amount", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_refill_at": { + "name": "last_refill_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "rate_limit_enabled": { + "name": "rate_limit_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "rate_limit_time_window": { + "name": "rate_limit_time_window", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rate_limit_max": { + "name": "rate_limit_max", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "request_count": { + "name": "request_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "remaining": { + "name": "remaining", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_request": { + "name": "last_request", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "permissions": { + "name": "permissions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "apikey_user_id_user_temp_id_fk": { + "name": "apikey_user_id_user_temp_id_fk", + "tableFrom": "apikey", + "tableTo": "user_temp", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.invitation": { + "name": "invitation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "inviter_id": { + "name": "inviter_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "invitation_organization_id_organization_id_fk": { + "name": "invitation_organization_id_organization_id_fk", + "tableFrom": "invitation", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "invitation_inviter_id_user_temp_id_fk": { + "name": "invitation_inviter_id_user_temp_id_fk", + "tableFrom": "invitation", + "tableTo": "user_temp", + "columnsFrom": [ + "inviter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.member": { + "name": "member", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "canCreateProjects": { + "name": "canCreateProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToSSHKeys": { + "name": "canAccessToSSHKeys", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canCreateServices": { + "name": "canCreateServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteProjects": { + "name": "canDeleteProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteServices": { + "name": "canDeleteServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToDocker": { + "name": "canAccessToDocker", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToAPI": { + "name": "canAccessToAPI", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToGitProviders": { + "name": "canAccessToGitProviders", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToTraefikFiles": { + "name": "canAccessToTraefikFiles", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "accesedProjects": { + "name": "accesedProjects", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "accesedServices": { + "name": "accesedServices", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + } + }, + "indexes": {}, + "foreignKeys": { + "member_organization_id_organization_id_fk": { + "name": "member_organization_id_organization_id_fk", + "tableFrom": "member", + "tableTo": "organization", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "member_user_id_user_temp_id_fk": { + "name": "member_user_id_user_temp_id_fk", + "tableFrom": "member", + "tableTo": "user_temp", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.organization": { + "name": "organization", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "logo": { + "name": "logo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner_id": { + "name": "owner_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "organization_owner_id_user_temp_id_fk": { + "name": "organization_owner_id_user_temp_id_fk", + "tableFrom": "organization", + "tableTo": "user_temp", + "columnsFrom": [ + "owner_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "organization_slug_unique": { + "name": "organization_slug_unique", + "nullsNotDistinct": false, + "columns": [ + "slug" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.two_factor": { + "name": "two_factor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "backup_codes": { + "name": "backup_codes", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "two_factor_user_id_user_temp_id_fk": { + "name": "two_factor_user_id_user_temp_id_fk", + "tableFrom": "two_factor", + "tableTo": "user_temp", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.verification": { + "name": "verification", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.buildType": { + "name": "buildType", + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks", + "static", + "railpack" + ] + }, + "public.sourceType": { + "name": "sourceType", + "schema": "public", + "values": [ + "docker", + "git", + "github", + "gitlab", + "bitbucket", + "gitea", + "drop" + ] + }, + "public.domainType": { + "name": "domainType", + "schema": "public", + "values": [ + "compose", + "application", + "preview" + ] + }, + "public.databaseType": { + "name": "databaseType", + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] + }, + "public.deploymentStatus": { + "name": "deploymentStatus", + "schema": "public", + "values": [ + "running", + "done", + "error" + ] + }, + "public.mountType": { + "name": "mountType", + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] + }, + "public.serviceType": { + "name": "serviceType", + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis", + "compose" + ] + }, + "public.protocolType": { + "name": "protocolType", + "schema": "public", + "values": [ + "tcp", + "udp" + ] + }, + "public.applicationStatus": { + "name": "applicationStatus", + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] + }, + "public.certificateType": { + "name": "certificateType", + "schema": "public", + "values": [ + "letsencrypt", + "none", + "custom" + ] + }, + "public.composeType": { + "name": "composeType", + "schema": "public", + "values": [ + "docker-compose", + "stack" + ] + }, + "public.sourceTypeCompose": { + "name": "sourceTypeCompose", + "schema": "public", + "values": [ + "git", + "github", + "gitlab", + "bitbucket", + "gitea", + "raw" + ] + }, + "public.RegistryType": { + "name": "RegistryType", + "schema": "public", + "values": [ + "selfHosted", + "cloud" + ] + }, + "public.notificationType": { + "name": "notificationType", + "schema": "public", + "values": [ + "slack", + "telegram", + "discord", + "email", + "gotify" + ] + }, + "public.gitProviderType": { + "name": "gitProviderType", + "schema": "public", + "values": [ + "github", + "gitlab", + "bitbucket", + "gitea" + ] + }, + "public.serverStatus": { + "name": "serverStatus", + "schema": "public", + "values": [ + "active", + "inactive" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/apps/dokploy/drizzle/meta/_journal.json b/apps/dokploy/drizzle/meta/_journal.json index 3baae60b..26e2b3be 100644 --- a/apps/dokploy/drizzle/meta/_journal.json +++ b/apps/dokploy/drizzle/meta/_journal.json @@ -502,64 +502,64 @@ { "idx": 71, "version": "7", - "when": 1741559743256, - "tag": "0071_flimsy_plazm", + "when": 1741460060541, + "tag": "0071_flaky_black_queen", "breakpoints": true }, { "idx": 72, "version": "7", - "when": 1741593124105, - "tag": "0072_low_redwing", + "when": 1741487009559, + "tag": "0072_green_susan_delgado", "breakpoints": true }, { "idx": 73, "version": "7", - "when": 1741645208694, - "tag": "0073_dark_tigra", + "when": 1741489681190, + "tag": "0073_hot_domino", "breakpoints": true }, { "idx": 74, "version": "7", - "when": 1741673569715, - "tag": "0074_military_miss_america", + "when": 1741490064139, + "tag": "0074_black_quasar", "breakpoints": true }, { "idx": 75, "version": "7", - "when": 1742018928109, - "tag": "0075_wild_xorn", + "when": 1741491527516, + "tag": "0075_young_typhoid_mary", "breakpoints": true }, { "idx": 76, "version": "7", - "when": 1742237840762, - "tag": "0076_tough_iron_patriot", + "when": 1741493754270, + "tag": "0076_young_sharon_ventura", "breakpoints": true }, { "idx": 77, "version": "7", - "when": 1742241730000, - "tag": "0076_young_sharon_ventura", + "when": 1741510086231, + "tag": "0077_chemical_dreadnoughts", "breakpoints": true }, { "idx": 78, "version": "7", - "when": 1742241730001, - "tag": "0077_chemical_dreadnoughts", + "when": 1742112194375, + "tag": "0078_uneven_omega_sentinel", "breakpoints": true }, { "idx": 79, "version": "7", - "when": 17422417300002, - "tag": "0078_uneven_omega_sentinel", + "when": 1742281690186, + "tag": "0079_bizarre_wendell_rand", "breakpoints": true } ] diff --git a/apps/dokploy/package.json b/apps/dokploy/package.json index 44201c11..7faaaf3f 100644 --- a/apps/dokploy/package.json +++ b/apps/dokploy/package.json @@ -1,6 +1,6 @@ { "name": "dokploy", - "version": "v0.20.4", + "version": "v0.20.7", "private": true, "license": "Apache-2.0", "type": "module", diff --git a/apps/dokploy/pages/api/deploy/github.ts b/apps/dokploy/pages/api/deploy/github.ts index 77ce8bda..b32f959e 100644 --- a/apps/dokploy/pages/api/deploy/github.ts +++ b/apps/dokploy/pages/api/deploy/github.ts @@ -93,6 +93,7 @@ export default async function handler( try { const branchName = githubBody?.ref?.replace("refs/heads/", ""); const repository = githubBody?.repository?.name; + const deploymentTitle = extractCommitMessage(req.headers, req.body); const deploymentHash = extractHash(req.headers, req.body); const owner = githubBody?.repository?.owner?.name; @@ -107,6 +108,7 @@ export default async function handler( eq(applications.branch, branchName), eq(applications.repository, repository), eq(applications.owner, owner), + eq(applications.githubId, githubResult.githubId), ), }); @@ -151,6 +153,7 @@ export default async function handler( eq(compose.branch, branchName), eq(compose.repository, repository), eq(compose.owner, owner), + eq(compose.githubId, githubResult.githubId), ), }); @@ -240,6 +243,7 @@ export default async function handler( eq(applications.branch, branch), eq(applications.isPreviewDeploymentsActive, true), eq(applications.owner, owner), + eq(applications.githubId, githubResult.githubId), ), with: { previewDeployments: true, diff --git a/apps/dokploy/server/api/routers/backup.ts b/apps/dokploy/server/api/routers/backup.ts index 8a7a5f22..72060bcb 100644 --- a/apps/dokploy/server/api/routers/backup.ts +++ b/apps/dokploy/server/api/routers/backup.ts @@ -11,9 +11,13 @@ import { createBackup, findBackupById, findMariadbByBackupId, + findMariadbById, findMongoByBackupId, + findMongoById, findMySqlByBackupId, + findMySqlById, findPostgresByBackupId, + findPostgresById, findServerById, removeBackupById, removeScheduleBackup, @@ -25,7 +29,21 @@ import { updateBackupById, } from "@dokploy/server"; +import { findDestinationById } from "@dokploy/server/services/destination"; +import { getS3Credentials } from "@dokploy/server/utils/backups/utils"; +import { + execAsync, + execAsyncRemote, +} from "@dokploy/server/utils/process/execAsync"; +import { + restoreMariadbBackup, + restoreMongoBackup, + restoreMySqlBackup, + restorePostgresBackup, +} from "@dokploy/server/utils/restore"; import { TRPCError } from "@trpc/server"; +import { observable } from "@trpc/server/observable"; +import { z } from "zod"; export const backupRouter = createTRPCRouter({ create: protectedProcedure @@ -209,27 +227,146 @@ export const backupRouter = createTRPCRouter({ }); } }), + listBackupFiles: protectedProcedure + .input( + z.object({ + destinationId: z.string(), + search: z.string(), + serverId: z.string().optional(), + }), + ) + .query(async ({ input }) => { + try { + const destination = await findDestinationById(input.destinationId); + const rcloneFlags = getS3Credentials(destination); + const bucketPath = `:s3:${destination.bucket}`; + + const lastSlashIndex = input.search.lastIndexOf("/"); + const baseDir = + lastSlashIndex !== -1 + ? input.search.slice(0, lastSlashIndex + 1) + : ""; + const searchTerm = + lastSlashIndex !== -1 + ? input.search.slice(lastSlashIndex + 1) + : input.search; + + const searchPath = baseDir ? `${bucketPath}/${baseDir}` : bucketPath; + const listCommand = `rclone lsf ${rcloneFlags.join(" ")} "${searchPath}" | head -n 100`; + + let stdout = ""; + + if (input.serverId) { + const result = await execAsyncRemote(listCommand, input.serverId); + stdout = result.stdout; + } else { + const result = await execAsync(listCommand); + stdout = result.stdout; + } + + const files = stdout.split("\n").filter(Boolean); + + const results = baseDir + ? files.map((file) => `${baseDir}${file}`) + : files; + + if (searchTerm) { + return results.filter((file) => + file.toLowerCase().includes(searchTerm.toLowerCase()), + ); + } + + return results; + } catch (error) { + throw new TRPCError({ + code: "BAD_REQUEST", + message: + error instanceof Error + ? error.message + : "Error listing backup files", + cause: error, + }); + } + }), + + restoreBackupWithLogs: protectedProcedure + .meta({ + openapi: { + enabled: false, + path: "/restore-backup-with-logs", + method: "POST", + override: true, + }, + }) + .input( + z.object({ + databaseId: z.string(), + databaseType: z.enum(["postgres", "mysql", "mariadb", "mongo"]), + databaseName: z.string().min(1), + backupFile: z.string().min(1), + destinationId: z.string().min(1), + }), + ) + .subscription(async ({ input }) => { + const destination = await findDestinationById(input.destinationId); + if (input.databaseType === "postgres") { + const postgres = await findPostgresById(input.databaseId); + + return observable((emit) => { + restorePostgresBackup( + postgres, + destination, + input.databaseName, + input.backupFile, + (log) => { + emit.next(log); + }, + ); + }); + } + if (input.databaseType === "mysql") { + const mysql = await findMySqlById(input.databaseId); + return observable((emit) => { + restoreMySqlBackup( + mysql, + destination, + input.databaseName, + input.backupFile, + (log) => { + emit.next(log); + }, + ); + }); + } + if (input.databaseType === "mariadb") { + const mariadb = await findMariadbById(input.databaseId); + return observable((emit) => { + restoreMariadbBackup( + mariadb, + destination, + input.databaseName, + input.backupFile, + (log) => { + emit.next(log); + }, + ); + }); + } + if (input.databaseType === "mongo") { + const mongo = await findMongoById(input.databaseId); + return observable((emit) => { + restoreMongoBackup( + mongo, + destination, + input.databaseName, + input.backupFile, + (log) => { + emit.next(log); + }, + ); + }); + } + + return true; + }), }); - -// export const getAdminId = async (backupId: string) => { -// const backup = await findBackupById(backupId); - -// if (backup.databaseType === "postgres" && backup.postgresId) { -// const postgres = await findPostgresById(backup.postgresId); -// return postgres.project.adminId; -// } -// if (backup.databaseType === "mariadb" && backup.mariadbId) { -// const mariadb = await findMariadbById(backup.mariadbId); -// return mariadb.project.adminId; -// } -// if (backup.databaseType === "mysql" && backup.mysqlId) { -// const mysql = await findMySqlById(backup.mysqlId); -// return mysql.project.adminId; -// } -// if (backup.databaseType === "mongo" && backup.mongoId) { -// const mongo = await findMongoById(backup.mongoId); -// return mongo.project.adminId; -// } - -// return null; -// }; diff --git a/apps/dokploy/server/api/routers/domain.ts b/apps/dokploy/server/api/routers/domain.ts index aac2a016..9e81bee1 100644 --- a/apps/dokploy/server/api/routers/domain.ts +++ b/apps/dokploy/server/api/routers/domain.ts @@ -13,7 +13,9 @@ import { findDomainById, findDomainsByApplicationId, findDomainsByComposeId, + findOrganizationById, findPreviewDeploymentById, + findServerById, generateTraefikMeDomain, manageDomain, removeDomain, @@ -94,6 +96,19 @@ export const domainRouter = createTRPCRouter({ input.serverId, ); }), + canGenerateTraefikMeDomains: protectedProcedure + .input(z.object({ serverId: z.string() })) + .query(async ({ input, ctx }) => { + const organization = await findOrganizationById( + ctx.session.activeOrganizationId, + ); + + if (input.serverId) { + const server = await findServerById(input.serverId); + return server.ipAddress; + } + return organization?.owner.serverIp; + }), update: protectedProcedure .input(apiUpdateDomain) diff --git a/packages/server/src/lib/auth.ts b/packages/server/src/lib/auth.ts index 212a9513..7ff53117 100644 --- a/packages/server/src/lib/auth.ts +++ b/packages/server/src/lib/auth.ts @@ -2,12 +2,16 @@ import type { IncomingMessage } from "node:http"; import * as bcrypt from "bcrypt"; import { betterAuth } from "better-auth"; import { drizzleAdapter } from "better-auth/adapters/drizzle"; +import { APIError } from "better-auth/api"; import { apiKey, organization, twoFactor } from "better-auth/plugins"; import { and, desc, eq } from "drizzle-orm"; import { IS_CLOUD } from "../constants"; import { db } from "../db"; import * as schema from "../db/schema"; +import { getUserByToken } from "../services/admin"; +import { updateUser } from "../services/user"; import { sendEmail } from "../verification/send-verification-email"; +import { getPublicIpWithFallback } from "../wss/utils"; const { handler, api } = betterAuth({ database: drizzleAdapter(db, { @@ -88,11 +92,40 @@ const { handler, api } = betterAuth({ databaseHooks: { user: { create: { + before: async (_user, context) => { + if (!IS_CLOUD) { + const xDokployToken = + context?.request?.headers?.get("x-dokploy-token"); + if (xDokployToken) { + const user = await getUserByToken(xDokployToken); + if (!user) { + throw new APIError("BAD_REQUEST", { + message: "User not found", + }); + } + } else { + const isAdminPresent = await db.query.member.findFirst({ + where: eq(schema.member.role, "owner"), + }); + if (isAdminPresent) { + throw new APIError("BAD_REQUEST", { + message: "Admin is already created", + }); + } + } + } + }, after: async (user) => { const isAdminPresent = await db.query.member.findFirst({ where: eq(schema.member.role, "owner"), }); + if (!IS_CLOUD) { + await updateUser(user.id, { + serverIp: await getPublicIpWithFallback(), + }); + } + if (IS_CLOUD || !isAdminPresent) { await db.transaction(async (tx) => { const organization = await tx diff --git a/packages/server/src/setup/server-setup.ts b/packages/server/src/setup/server-setup.ts index 66f62e3d..6fefabe9 100644 --- a/packages/server/src/setup/server-setup.ts +++ b/packages/server/src/setup/server-setup.ts @@ -361,7 +361,7 @@ const installUtilities = () => ` alpine) sed -i '/^#.*\/community/s/^#//' /etc/apk/repositories apk update >/dev/null - apk add curl wget git jq openssl >/dev/null + apk add curl wget git jq openssl sudo unzip tar >/dev/null ;; ubuntu | debian | raspbian) DEBIAN_FRONTEND=noninteractive apt-get update -y >/dev/null diff --git a/packages/server/src/setup/traefik-setup.ts b/packages/server/src/setup/traefik-setup.ts index 4c8a3274..3039d43f 100644 --- a/packages/server/src/setup/traefik-setup.ts +++ b/packages/server/src/setup/traefik-setup.ts @@ -101,11 +101,11 @@ export const initializeTraefik = async ({ console.log("Waiting for service cleanup..."); await new Promise((resolve) => setTimeout(resolve, 5000)); attempts++; - } catch (e) { + } catch (_e) { break; } } - } catch (err) { + } catch (_err) { console.log("No existing service to remove"); } @@ -120,7 +120,7 @@ export const initializeTraefik = async ({ await container.remove({ force: true }); await new Promise((resolve) => setTimeout(resolve, 5000)); - } catch (error) { + } catch (_err) { console.log("No existing container to remove"); } diff --git a/packages/server/src/utils/restore/index.ts b/packages/server/src/utils/restore/index.ts new file mode 100644 index 00000000..e8adbbe1 --- /dev/null +++ b/packages/server/src/utils/restore/index.ts @@ -0,0 +1,4 @@ +export { restorePostgresBackup } from "./postgres"; +export { restoreMySqlBackup } from "./mysql"; +export { restoreMariadbBackup } from "./mariadb"; +export { restoreMongoBackup } from "./mongo"; diff --git a/packages/server/src/utils/restore/mariadb.ts b/packages/server/src/utils/restore/mariadb.ts new file mode 100644 index 00000000..00080a2c --- /dev/null +++ b/packages/server/src/utils/restore/mariadb.ts @@ -0,0 +1,56 @@ +import type { Destination } from "@dokploy/server/services/destination"; +import type { Mariadb } from "@dokploy/server/services/mariadb"; +import { getS3Credentials } from "../backups/utils"; +import { + getRemoteServiceContainer, + getServiceContainer, +} from "../docker/utils"; +import { execAsync, execAsyncRemote } from "../process/execAsync"; + +export const restoreMariadbBackup = async ( + mariadb: Mariadb, + destination: Destination, + database: string, + backupFile: string, + emit: (log: string) => void, +) => { + try { + const { appName, databasePassword, databaseUser, serverId } = mariadb; + + const rcloneFlags = getS3Credentials(destination); + const bucketPath = `:s3:${destination.bucket}`; + const backupPath = `${bucketPath}/${backupFile}`; + + const { Id: containerName } = serverId + ? await getRemoteServiceContainer(serverId, appName) + : await getServiceContainer(appName); + + const restoreCommand = ` + rclone cat ${rcloneFlags.join(" ")} "${backupPath}" | gunzip | docker exec -i ${containerName} mariadb -u ${databaseUser} -p${databasePassword} ${database} + `; + + emit("Starting restore..."); + + emit(`Executing command: ${restoreCommand}`); + + if (serverId) { + await execAsyncRemote(serverId, restoreCommand); + } else { + await execAsync(restoreCommand); + } + + emit("Restore completed successfully!"); + } catch (error) { + console.error(error); + emit( + `Error: ${ + error instanceof Error + ? error.message + : "Error restoring mariadb backup" + }`, + ); + throw new Error( + error instanceof Error ? error.message : "Error restoring mariadb backup", + ); + } +}; diff --git a/packages/server/src/utils/restore/mongo.ts b/packages/server/src/utils/restore/mongo.ts new file mode 100644 index 00000000..27471808 --- /dev/null +++ b/packages/server/src/utils/restore/mongo.ts @@ -0,0 +1,64 @@ +import type { Destination } from "@dokploy/server/services/destination"; +import type { Mongo } from "@dokploy/server/services/mongo"; +import { getS3Credentials } from "../backups/utils"; +import { + getRemoteServiceContainer, + getServiceContainer, +} from "../docker/utils"; +import { execAsync, execAsyncRemote } from "../process/execAsync"; + +export const restoreMongoBackup = async ( + mongo: Mongo, + destination: Destination, + database: string, + backupFile: string, + emit: (log: string) => void, +) => { + try { + const { appName, databasePassword, databaseUser, serverId } = mongo; + + const rcloneFlags = getS3Credentials(destination); + const bucketPath = `:s3:${destination.bucket}`; + const backupPath = `${bucketPath}/${backupFile}`; + + const { Id: containerName } = serverId + ? await getRemoteServiceContainer(serverId, appName) + : await getServiceContainer(appName); + + // For MongoDB, we need to first download the backup file since mongorestore expects a directory + const tempDir = "/tmp/dokploy-restore"; + const fileName = backupFile.split("/").pop() || "backup.dump.gz"; + const decompressedName = fileName.replace(".gz", ""); + + const downloadCommand = `\ +rm -rf ${tempDir} && \ +mkdir -p ${tempDir} && \ +rclone copy ${rcloneFlags.join(" ")} "${backupPath}" ${tempDir} && \ +cd ${tempDir} && \ +gunzip -f "${fileName}" && \ +docker exec -i ${containerName} mongorestore --username ${databaseUser} --password ${databasePassword} --authenticationDatabase admin --db ${database} --archive < "${decompressedName}" && \ +rm -rf ${tempDir}`; + + emit("Starting restore..."); + + emit(`Executing command: ${downloadCommand}`); + + if (serverId) { + await execAsyncRemote(serverId, downloadCommand); + } else { + await execAsync(downloadCommand); + } + + emit("Restore completed successfully!"); + } catch (error) { + console.error(error); + emit( + `Error: ${ + error instanceof Error ? error.message : "Error restoring mongo backup" + }`, + ); + throw new Error( + error instanceof Error ? error.message : "Error restoring mongo backup", + ); + } +}; diff --git a/packages/server/src/utils/restore/mysql.ts b/packages/server/src/utils/restore/mysql.ts new file mode 100644 index 00000000..8478ac96 --- /dev/null +++ b/packages/server/src/utils/restore/mysql.ts @@ -0,0 +1,54 @@ +import type { Destination } from "@dokploy/server/services/destination"; +import type { MySql } from "@dokploy/server/services/mysql"; +import { getS3Credentials } from "../backups/utils"; +import { + getRemoteServiceContainer, + getServiceContainer, +} from "../docker/utils"; +import { execAsync, execAsyncRemote } from "../process/execAsync"; + +export const restoreMySqlBackup = async ( + mysql: MySql, + destination: Destination, + database: string, + backupFile: string, + emit: (log: string) => void, +) => { + try { + const { appName, databaseRootPassword, serverId } = mysql; + + const rcloneFlags = getS3Credentials(destination); + const bucketPath = `:s3:${destination.bucket}`; + const backupPath = `${bucketPath}/${backupFile}`; + + const { Id: containerName } = serverId + ? await getRemoteServiceContainer(serverId, appName) + : await getServiceContainer(appName); + + const restoreCommand = ` + rclone cat ${rcloneFlags.join(" ")} "${backupPath}" | gunzip | docker exec -i ${containerName} mysql -u root -p${databaseRootPassword} ${database} + `; + + emit("Starting restore..."); + + emit(`Executing command: ${restoreCommand}`); + + if (serverId) { + await execAsyncRemote(serverId, restoreCommand); + } else { + await execAsync(restoreCommand); + } + + emit("Restore completed successfully!"); + } catch (error) { + console.error(error); + emit( + `Error: ${ + error instanceof Error ? error.message : "Error restoring mysql backup" + }`, + ); + throw new Error( + error instanceof Error ? error.message : "Error restoring mysql backup", + ); + } +}; diff --git a/packages/server/src/utils/restore/postgres.ts b/packages/server/src/utils/restore/postgres.ts new file mode 100644 index 00000000..5ab7c74e --- /dev/null +++ b/packages/server/src/utils/restore/postgres.ts @@ -0,0 +1,60 @@ +import type { Destination } from "@dokploy/server/services/destination"; +import type { Postgres } from "@dokploy/server/services/postgres"; +import { getS3Credentials } from "../backups/utils"; +import { + getRemoteServiceContainer, + getServiceContainer, +} from "../docker/utils"; +import { execAsync, execAsyncRemote } from "../process/execAsync"; + +export const restorePostgresBackup = async ( + postgres: Postgres, + destination: Destination, + database: string, + backupFile: string, + emit: (log: string) => void, +) => { + try { + const { appName, databaseUser, serverId } = postgres; + + const rcloneFlags = getS3Credentials(destination); + const bucketPath = `:s3:${destination.bucket}`; + + const backupPath = `${bucketPath}/${backupFile}`; + + const { Id: containerName } = serverId + ? await getRemoteServiceContainer(serverId, appName) + : await getServiceContainer(appName); + + emit("Starting restore..."); + emit(`Backup path: ${backupPath}`); + + const command = `\ +rclone cat ${rcloneFlags.join(" ")} "${backupPath}" | gunzip | docker exec -i ${containerName} pg_restore -U ${databaseUser} -d ${database} --clean --if-exists`; + + emit(`Executing command: ${command}`); + + if (serverId) { + const { stdout, stderr } = await execAsyncRemote(serverId, command); + emit(stdout); + emit(stderr); + } else { + const { stdout, stderr } = await execAsync(command); + console.log("stdout", stdout); + console.log("stderr", stderr); + emit(stdout); + emit(stderr); + } + + emit("Restore completed successfully!"); + } catch (error) { + emit( + `Error: ${ + error instanceof Error + ? error.message + : "Error restoring postgres backup" + }`, + ); + throw error; + } +};