From 1a415b96c90b428a903a6516de1cc94cbe04ec11 Mon Sep 17 00:00:00 2001
From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com>
Date: Sat, 22 Feb 2025 18:03:12 -0600
Subject: [PATCH] refactor: remove unused auth service and clean up server-side
code
---
apps/api/src/index.ts | 2 +-
apps/api/src/utils.ts | 2 +-
.../__test__/compose/config/config.test.ts | 2 +-
.../compose/network/network-root.test.ts | 23 --
.../compose/secrets/secret-root.test.ts | 2 +-
.../__test__/compose/volume/volume.test.ts | 6 +-
.../server/update-server-config.test.ts | 2 -
apps/dokploy/components/auth/login-2fa.tsx | 1 -
.../cluster/show-cluster-settings.tsx | 1 -
.../advanced/general/add-command.tsx | 1 -
.../application/advanced/ports/show-port.tsx | 1 -
.../advanced/redirects/show-redirects.tsx | 1 -
.../advanced/security/show-security.tsx | 1 -
.../application/advanced/show-resources.tsx | 2 +-
.../advanced/traefik/show-traefik-config.tsx | 1 -
.../advanced/volumes/show-volumes.tsx | 1 -
.../advanced/volumes/update-volume.tsx | 2 +-
.../application/deployments/refresh-token.tsx | 1 -
.../environment/show-enviroment.tsx | 2 +-
.../application/environment/show.tsx | 2 +-
.../application/general/generic/show.tsx | 2 +-
.../dashboard/application/general/show.tsx | 1 -
.../show-preview-builds.tsx | 1 -
.../show-preview-deployments.tsx | 1 -
.../application/update-application.tsx | 2 +-
.../compose/advanced/add-command.tsx | 1 -
.../deployments/refresh-token-compose.tsx | 1 -
.../compose/general/generic/show.tsx | 2 +-
.../compose/general/randomize-compose.tsx | 2 +-
.../dashboard/compose/general/show.tsx | 1 -
.../dashboard/compose/logs/show.tsx | 2 +-
.../database/backups/show-backups.tsx | 1 -
.../database/backups/update-backup.tsx | 2 +-
.../docker/logs/since-logs-filter.tsx | 1 -
.../dashboard/docker/logs/terminal-line.tsx | 1 -
.../dashboard/docker/show/colums.tsx | 1 -
.../dashboard/docker/show/show-containers.tsx | 28 +--
.../file-system/show-traefik-system.tsx | 3 +-
.../show-external-mariadb-credentials.tsx | 2 +-
.../mariadb/general/show-general-mariadb.tsx | 2 +-
.../show-internal-mariadb-credentials.tsx | 1 -
.../dashboard/mariadb/update-mariadb.tsx | 2 +-
.../show-external-mongo-credentials.tsx | 2 +-
.../mongo/general/show-general-mongo.tsx | 2 +-
.../show-internal-mongo-credentials.tsx | 1 -
.../show-free-compose-monitoring.tsx | 1 -
.../show-free-container-monitoring.tsx | 10 +-
.../paid/servers/show-paid-monitoring.tsx | 1 -
.../show-external-mysql-credentials.tsx | 2 +-
.../mysql/general/show-general-mysql.tsx | 2 +-
.../show-internal-mysql-credentials.tsx | 1 -
.../dashboard/mysql/update-mysql.tsx | 2 +-
.../organization/handle-organization.tsx | 2 +-
.../postgres/advanced/show-custom-command.tsx | 2 +-
.../show-external-postgres-credentials.tsx | 2 +-
.../general/show-general-postgres.tsx | 2 +-
.../show-internal-postgres-credentials.tsx | 1 -
.../dashboard/postgres/update-postgres.tsx | 2 +-
.../dashboard/project/add-database.tsx | 1 -
.../dashboard/project/add-template.tsx | 1 -
.../dashboard/projects/handle-project.tsx | 1 -
.../show-external-redis-credentials.tsx | 2 +-
.../redis/general/show-general-redis.tsx | 2 +-
.../show-internal-redis-credentials.tsx | 1 -
.../dashboard/redis/update-redis.tsx | 2 +-
.../components/dashboard/requests/columns.tsx | 1 -
.../dashboard/requests/show-requests.tsx | 1 -
.../components/dashboard/search-command.tsx | 2 -
.../settings/billing/show-billing.tsx | 2 +-
.../settings/billing/show-welcome-dokploy.tsx | 1 -
.../settings/cluster/nodes/show-nodes.tsx | 1 -
.../git/bitbucket/add-bitbucket-provider.tsx | 6 +-
.../git/bitbucket/edit-bitbucket-provider.tsx | 2 +-
.../git/gitlab/edit-gitlab-provider.tsx | 2 +-
.../dashboard/settings/profile/enable-2fa.tsx | 1 -
.../settings/profile/profile-form.tsx | 2 -
.../servers/actions/show-dokploy-actions.tsx | 1 -
.../servers/actions/show-storage-actions.tsx | 1 -
.../servers/actions/show-traefik-actions.tsx | 14 +-
.../settings/servers/gpu-support.tsx | 1 -
.../settings/servers/setup-monitoring.tsx | 2 -
.../servers/show-docker-containers-modal.tsx | 8 +-
.../servers/show-swarm-overview-modal.tsx | 9 +-
.../dashboard/settings/users/show-users.tsx | 83 ++++---
.../dashboard/settings/web-domain.tsx | 2 +-
.../dashboard/settings/web-server.tsx | 2 -
.../web-server/local-server-config.tsx | 1 -
.../settings/web-server/show-modal-logs.tsx | 1 -
.../settings/web-server/update-server.tsx | 2 -
.../dashboard/swarm/applications/columns.tsx | 1 -
.../swarm/applications/show-applications.tsx | 1 -
.../components/icons/data-tools-icons.tsx | 1 -
apps/dokploy/components/layouts/side.tsx | 30 +--
apps/dokploy/components/layouts/user-nav.tsx | 2 -
.../components/shared/dialog-action.tsx | 1 -
.../dokploy/components/shared/drawer-logs.tsx | 9 +-
apps/dokploy/components/shared/logo.tsx | 2 -
apps/dokploy/components/ui/modeToggle.tsx | 1 -
apps/dokploy/migrate.ts | 1 -
apps/dokploy/pages/api/deploy/github.ts | 2 -
.../pages/api/providers/github/setup.ts | 9 +-
apps/dokploy/pages/api/stripe/webhook.ts | 2 +-
apps/dokploy/pages/dashboard/docker.tsx | 2 +-
apps/dokploy/pages/dashboard/monitoring.tsx | 4 -
.../services/application/[applicationId].tsx | 5 +-
.../services/compose/[composeId].tsx | 3 +-
.../services/mariadb/[mariadbId].tsx | 6 +-
.../[projectId]/services/mongo/[mongoId].tsx | 6 +-
.../[projectId]/services/mysql/[mysqlId].tsx | 6 +-
.../services/postgres/[postgresId].tsx | 6 +-
.../[projectId]/services/redis/[redisId].tsx | 4 +-
apps/dokploy/pages/dashboard/projects.tsx | 1 -
apps/dokploy/pages/dashboard/requests.tsx | 1 -
.../pages/dashboard/settings/billing.tsx | 2 +-
.../pages/dashboard/settings/certificates.tsx | 2 +-
.../pages/dashboard/settings/cluster.tsx | 2 +-
.../pages/dashboard/settings/destinations.tsx | 2 +-
.../dashboard/settings/git-providers.tsx | 2 +-
.../pages/dashboard/settings/index.tsx | 3 +-
.../dashboard/settings/notifications.tsx | 2 +-
.../pages/dashboard/settings/profile.tsx | 2 +-
.../pages/dashboard/settings/registry.tsx | 2 +-
.../pages/dashboard/settings/server.tsx | 5 +-
.../pages/dashboard/settings/servers.tsx | 2 +-
.../pages/dashboard/settings/ssh-keys.tsx | 2 +-
.../pages/dashboard/settings/users.tsx | 2 +-
apps/dokploy/pages/dashboard/traefik.tsx | 2 +-
apps/dokploy/pages/index.tsx | 14 +-
apps/dokploy/pages/invitation.tsx | 9 +-
apps/dokploy/pages/register.tsx | 8 +-
apps/dokploy/pages/send-reset-password.tsx | 7 +-
apps/dokploy/server/api/routers/admin.ts | 234 +-----------------
.../dokploy/server/api/routers/application.ts | 25 +-
apps/dokploy/server/api/routers/auth.ts | 39 ---
apps/dokploy/server/api/routers/backup.ts | 33 +--
apps/dokploy/server/api/routers/cluster.ts | 4 +-
apps/dokploy/server/api/routers/compose.ts | 32 ++-
.../server/api/routers/git-provider.ts | 6 +-
apps/dokploy/server/api/routers/mariadb.ts | 24 +-
apps/dokploy/server/api/routers/mongo.ts | 23 +-
apps/dokploy/server/api/routers/mysql.ts | 23 +-
.../server/api/routers/notification.ts | 6 +-
.../server/api/routers/organization.ts | 10 +-
apps/dokploy/server/api/routers/port.ts | 8 +-
apps/dokploy/server/api/routers/postgres.ts | 31 ++-
apps/dokploy/server/api/routers/project.ts | 11 +-
apps/dokploy/server/api/routers/redis.ts | 23 +-
apps/dokploy/server/api/routers/registry.ts | 2 +-
apps/dokploy/server/api/routers/server.ts | 4 +-
apps/dokploy/server/api/routers/settings.ts | 22 +-
apps/dokploy/server/api/routers/ssh-key.ts | 1 -
apps/dokploy/server/api/routers/stripe.ts | 50 ++--
apps/dokploy/server/api/routers/user.ts | 10 +-
apps/dokploy/server/db/seed.ts | 1 -
apps/dokploy/server/utils/backup.ts | 1 -
apps/dokploy/templates/excalidraw/index.ts | 1 -
apps/dokploy/templates/ghost/index.ts | 1 -
apps/dokploy/templates/penpot/index.ts | 2 -
apps/dokploy/templates/photoprism/index.ts | 1 -
apps/dokploy/templates/triggerdotdev/index.ts | 1 -
apps/dokploy/templates/unsend/index.ts | 1 -
biome.json | 5 +-
packages/server/auth-schema.ts | 8 +-
packages/server/src/db/schema/user.ts | 2 +-
.../server/src/emails/emails/build-failed.tsx | 1 -
.../src/emails/emails/build-success.tsx | 1 -
.../src/emails/emails/database-backup.tsx | 1 -
.../src/emails/emails/docker-cleanup.tsx | 2 -
.../src/emails/emails/dokploy-restart.tsx | 1 -
.../src/emails/emails/notion-magic-link.tsx | 1 -
.../emails/emails/plaid-verify-identity.tsx | 1 -
.../src/emails/emails/stripe-welcome.tsx | 1 -
.../src/emails/emails/vercel-invite-user.tsx | 1 -
packages/server/src/index.ts | 2 -
packages/server/src/lib/auth.ts | 1 -
packages/server/src/services/admin.ts | 3 -
packages/server/src/services/application.ts | 5 +-
packages/server/src/services/auth.ts | 212 ----------------
packages/server/src/services/backup.ts | 2 -
packages/server/src/services/compose.ts | 3 +-
packages/server/src/services/deployment.ts | 10 +-
packages/server/src/services/domain.ts | 2 +-
packages/server/src/services/gitlab.ts | 2 -
packages/server/src/services/mariadb.ts | 2 +-
packages/server/src/services/mongo.ts | 2 +-
packages/server/src/services/mount.ts | 4 +-
packages/server/src/services/postgres.ts | 2 +-
.../server/src/services/preview-deployment.ts | 16 +-
packages/server/src/services/redirect.ts | 6 +-
packages/server/src/services/redis.ts | 2 +-
packages/server/src/services/registry.ts | 4 +-
packages/server/src/services/security.ts | 8 +-
packages/server/src/services/server.ts | 2 +-
packages/server/src/services/settings.ts | 1 -
packages/server/src/services/user.ts | 30 +--
packages/server/src/setup/monitoring-setup.ts | 2 +-
.../server/src/utils/access-log/handler.ts | 1 -
packages/server/src/utils/backups/mysql.ts | 1 -
packages/server/src/utils/builders/compose.ts | 1 -
.../utils/notifications/database-backup.ts | 1 -
.../server/src/utils/traefik/middleware.ts | 2 +-
201 files changed, 434 insertions(+), 1035 deletions(-)
delete mode 100644 packages/server/src/services/auth.ts
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 4b405e9c..0db56599 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -28,7 +28,7 @@ app.use(async (c, next) => {
app.post("/deploy", zValidator("json", deployJobSchema), (c) => {
const data = c.req.valid("json");
- const res = queue.add(data, { groupName: data.serverId });
+ queue.add(data, { groupName: data.serverId });
return c.json(
{
message: "Deployment Added",
diff --git a/apps/api/src/utils.ts b/apps/api/src/utils.ts
index d919f29e..3f3c9698 100644
--- a/apps/api/src/utils.ts
+++ b/apps/api/src/utils.ts
@@ -64,7 +64,7 @@ export const deploy = async (job: DeployJob) => {
}
}
}
- } catch (error) {
+ } catch (_) {
if (job.applicationType === "application") {
await updateApplicationStatus(job.applicationId, "error");
} else if (job.applicationType === "compose") {
diff --git a/apps/dokploy/__test__/compose/config/config.test.ts b/apps/dokploy/__test__/compose/config/config.test.ts
index 3f98525a..aed3350f 100644
--- a/apps/dokploy/__test__/compose/config/config.test.ts
+++ b/apps/dokploy/__test__/compose/config/config.test.ts
@@ -1,5 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
-import { addSuffixToAllConfigs, addSuffixToConfigsRoot } from "@dokploy/server";
+import { addSuffixToAllConfigs } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";
diff --git a/apps/dokploy/__test__/compose/network/network-root.test.ts b/apps/dokploy/__test__/compose/network/network-root.test.ts
index 7e06a9f0..980502ff 100644
--- a/apps/dokploy/__test__/compose/network/network-root.test.ts
+++ b/apps/dokploy/__test__/compose/network/network-root.test.ts
@@ -293,29 +293,6 @@ networks:
dokploy-network:
`;
-const expectedComposeFile7 = `
-version: "3.8"
-
-services:
- web:
- image: nginx:latest
- networks:
- - dokploy-network
-
-networks:
- dokploy-network:
- driver: bridge
- driver_opts:
- com.docker.network.driver.mtu: 1200
-
- backend:
- driver: bridge
- attachable: true
-
- external_network:
- external: true
- name: dokploy-network
-`;
test("It shoudn't add suffix to dokploy-network", () => {
const composeData = load(composeFile7) as ComposeSpecification;
diff --git a/apps/dokploy/__test__/compose/secrets/secret-root.test.ts b/apps/dokploy/__test__/compose/secrets/secret-root.test.ts
index 2bd91b58..1b1898c5 100644
--- a/apps/dokploy/__test__/compose/secrets/secret-root.test.ts
+++ b/apps/dokploy/__test__/compose/secrets/secret-root.test.ts
@@ -1,7 +1,7 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToSecretsRoot } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
-import { dump, load } from "js-yaml";
+import { load } from "js-yaml";
import { expect, test } from "vitest";
test("Generate random hash with 8 characters", () => {
diff --git a/apps/dokploy/__test__/compose/volume/volume.test.ts b/apps/dokploy/__test__/compose/volume/volume.test.ts
index d4623aeb..6c434476 100644
--- a/apps/dokploy/__test__/compose/volume/volume.test.ts
+++ b/apps/dokploy/__test__/compose/volume/volume.test.ts
@@ -1,8 +1,4 @@
-import { generateRandomHash } from "@dokploy/server";
-import {
- addSuffixToAllVolumes,
- addSuffixToVolumesInServices,
-} from "@dokploy/server";
+import { addSuffixToAllVolumes } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";
diff --git a/apps/dokploy/__test__/traefik/server/update-server-config.test.ts b/apps/dokploy/__test__/traefik/server/update-server-config.test.ts
index 49d71bc4..7e4a3c82 100644
--- a/apps/dokploy/__test__/traefik/server/update-server-config.test.ts
+++ b/apps/dokploy/__test__/traefik/server/update-server-config.test.ts
@@ -126,8 +126,6 @@ test("Should not touch config without host", () => {
});
test("Should remove websecure if https rollback to http", () => {
- const originalConfig: FileConfig = loadOrCreateConfig("dokploy");
-
updateServerTraefik(
{ ...baseAdmin, certificateType: "letsencrypt" },
"example.com",
diff --git a/apps/dokploy/components/auth/login-2fa.tsx b/apps/dokploy/components/auth/login-2fa.tsx
index 6a11268e..634f2814 100644
--- a/apps/dokploy/components/auth/login-2fa.tsx
+++ b/apps/dokploy/components/auth/login-2fa.tsx
@@ -13,7 +13,6 @@ import { CardTitle } from "@/components/ui/card";
import {
InputOTP,
InputOTPGroup,
- InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp";
import { api } from "@/utils/api";
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 cf7314cf..1eadf8ba 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
@@ -29,7 +29,6 @@ import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { Server } from "lucide-react";
import Link from "next/link";
-import React from "react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/application/advanced/general/add-command.tsx b/apps/dokploy/components/dashboard/application/advanced/general/add-command.tsx
index 4cd839a1..50e36ad7 100644
--- a/apps/dokploy/components/dashboard/application/advanced/general/add-command.tsx
+++ b/apps/dokploy/components/dashboard/application/advanced/general/add-command.tsx
@@ -17,7 +17,6 @@ import {
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import React from "react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/application/advanced/ports/show-port.tsx b/apps/dokploy/components/dashboard/application/advanced/ports/show-port.tsx
index a2c6ddcf..4cd29a36 100644
--- a/apps/dokploy/components/dashboard/application/advanced/ports/show-port.tsx
+++ b/apps/dokploy/components/dashboard/application/advanced/ports/show-port.tsx
@@ -10,7 +10,6 @@ import {
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { Rss, Trash2 } from "lucide-react";
-import React from "react";
import { toast } from "sonner";
import { HandlePorts } from "./handle-ports";
interface Props {
diff --git a/apps/dokploy/components/dashboard/application/advanced/redirects/show-redirects.tsx b/apps/dokploy/components/dashboard/application/advanced/redirects/show-redirects.tsx
index 4ee59791..5c2c5943 100644
--- a/apps/dokploy/components/dashboard/application/advanced/redirects/show-redirects.tsx
+++ b/apps/dokploy/components/dashboard/application/advanced/redirects/show-redirects.tsx
@@ -9,7 +9,6 @@ import {
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { Split, Trash2 } from "lucide-react";
-import React from "react";
import { toast } from "sonner";
import { HandleRedirect } from "./handle-redirect";
diff --git a/apps/dokploy/components/dashboard/application/advanced/security/show-security.tsx b/apps/dokploy/components/dashboard/application/advanced/security/show-security.tsx
index 33022c09..92439f51 100644
--- a/apps/dokploy/components/dashboard/application/advanced/security/show-security.tsx
+++ b/apps/dokploy/components/dashboard/application/advanced/security/show-security.tsx
@@ -9,7 +9,6 @@ import {
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { LockKeyhole, Trash2 } from "lucide-react";
-import React from "react";
import { toast } from "sonner";
import { HandleSecurity } from "./handle-security";
diff --git a/apps/dokploy/components/dashboard/application/advanced/show-resources.tsx b/apps/dokploy/components/dashboard/application/advanced/show-resources.tsx
index 227bca55..3d26716f 100644
--- a/apps/dokploy/components/dashboard/application/advanced/show-resources.tsx
+++ b/apps/dokploy/components/dashboard/application/advanced/show-resources.tsx
@@ -25,7 +25,7 @@ import {
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { InfoIcon } from "lucide-react";
-import React, { useEffect } from "react";
+import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
diff --git a/apps/dokploy/components/dashboard/application/advanced/traefik/show-traefik-config.tsx b/apps/dokploy/components/dashboard/application/advanced/traefik/show-traefik-config.tsx
index fb6fc0c1..58601fb4 100644
--- a/apps/dokploy/components/dashboard/application/advanced/traefik/show-traefik-config.tsx
+++ b/apps/dokploy/components/dashboard/application/advanced/traefik/show-traefik-config.tsx
@@ -8,7 +8,6 @@ import {
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { File, Loader2 } from "lucide-react";
-import React from "react";
import { UpdateTraefikConfig } from "./update-traefik-config";
interface Props {
applicationId: string;
diff --git a/apps/dokploy/components/dashboard/application/advanced/volumes/show-volumes.tsx b/apps/dokploy/components/dashboard/application/advanced/volumes/show-volumes.tsx
index e0f842ce..2a2d2c03 100644
--- a/apps/dokploy/components/dashboard/application/advanced/volumes/show-volumes.tsx
+++ b/apps/dokploy/components/dashboard/application/advanced/volumes/show-volumes.tsx
@@ -10,7 +10,6 @@ import {
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { Package, Trash2 } from "lucide-react";
-import React from "react";
import { toast } from "sonner";
import type { ServiceType } from "../show-resources";
import { AddVolumes } from "./add-volumes";
diff --git a/apps/dokploy/components/dashboard/application/advanced/volumes/update-volume.tsx b/apps/dokploy/components/dashboard/application/advanced/volumes/update-volume.tsx
index d8481d65..687d0f60 100644
--- a/apps/dokploy/components/dashboard/application/advanced/volumes/update-volume.tsx
+++ b/apps/dokploy/components/dashboard/application/advanced/volumes/update-volume.tsx
@@ -21,7 +21,7 @@ import {
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import { PenBoxIcon, Pencil } from "lucide-react";
+import { PenBoxIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/application/deployments/refresh-token.tsx b/apps/dokploy/components/dashboard/application/deployments/refresh-token.tsx
index c268e6d5..b80450f9 100644
--- a/apps/dokploy/components/dashboard/application/deployments/refresh-token.tsx
+++ b/apps/dokploy/components/dashboard/application/deployments/refresh-token.tsx
@@ -11,7 +11,6 @@ import {
} from "@/components/ui/alert-dialog";
import { api } from "@/utils/api";
import { RefreshCcw } from "lucide-react";
-import React from "react";
import { toast } from "sonner";
interface Props {
diff --git a/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx b/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx
index b65a1816..ba20db31 100644
--- a/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx
+++ b/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx
@@ -18,7 +18,7 @@ import { Toggle } from "@/components/ui/toggle";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { EyeIcon, EyeOffIcon } from "lucide-react";
-import React, { type CSSProperties, useEffect, useState } from "react";
+import { type CSSProperties, useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
diff --git a/apps/dokploy/components/dashboard/application/environment/show.tsx b/apps/dokploy/components/dashboard/application/environment/show.tsx
index 7200f2a7..d97c39e2 100644
--- a/apps/dokploy/components/dashboard/application/environment/show.tsx
+++ b/apps/dokploy/components/dashboard/application/environment/show.tsx
@@ -1,5 +1,5 @@
import { Button } from "@/components/ui/button";
-import { Card, CardContent } from "@/components/ui/card";
+import { Card } from "@/components/ui/card";
import { Form } from "@/components/ui/form";
import { Secrets } from "@/components/ui/secrets";
import { api } from "@/utils/api";
diff --git a/apps/dokploy/components/dashboard/application/general/generic/show.tsx b/apps/dokploy/components/dashboard/application/general/generic/show.tsx
index 73f5e8f8..b00a3495 100644
--- a/apps/dokploy/components/dashboard/application/general/generic/show.tsx
+++ b/apps/dokploy/components/dashboard/application/general/generic/show.tsx
@@ -11,7 +11,7 @@ import {
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { api } from "@/utils/api";
-import { GitBranch, LockIcon, UploadCloud } from "lucide-react";
+import { GitBranch, UploadCloud } from "lucide-react";
import Link from "next/link";
import { useState } from "react";
import { SaveBitbucketProvider } from "./save-bitbucket-provider";
diff --git a/apps/dokploy/components/dashboard/application/general/show.tsx b/apps/dokploy/components/dashboard/application/general/show.tsx
index 83e4b6f0..0ea331e9 100644
--- a/apps/dokploy/components/dashboard/application/general/show.tsx
+++ b/apps/dokploy/components/dashboard/application/general/show.tsx
@@ -7,7 +7,6 @@ import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { Ban, CheckCircle2, Hammer, RefreshCcw, Terminal } from "lucide-react";
import { useRouter } from "next/router";
-import React from "react";
import { toast } from "sonner";
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
interface Props {
diff --git a/apps/dokploy/components/dashboard/application/preview-deployments/show-preview-builds.tsx b/apps/dokploy/components/dashboard/application/preview-deployments/show-preview-builds.tsx
index 55b31f3f..90800f75 100644
--- a/apps/dokploy/components/dashboard/application/preview-deployments/show-preview-builds.tsx
+++ b/apps/dokploy/components/dashboard/application/preview-deployments/show-preview-builds.tsx
@@ -5,7 +5,6 @@ import {
Dialog,
DialogContent,
DialogDescription,
- DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
diff --git a/apps/dokploy/components/dashboard/application/preview-deployments/show-preview-deployments.tsx b/apps/dokploy/components/dashboard/application/preview-deployments/show-preview-deployments.tsx
index 371276bd..ec3680f1 100644
--- a/apps/dokploy/components/dashboard/application/preview-deployments/show-preview-deployments.tsx
+++ b/apps/dokploy/components/dashboard/application/preview-deployments/show-preview-deployments.tsx
@@ -22,7 +22,6 @@ import {
RocketIcon,
Trash2,
} from "lucide-react";
-import React from "react";
import { toast } from "sonner";
import { ShowModalLogs } from "../../settings/web-server/show-modal-logs";
import { AddPreviewDomain } from "./add-preview-domain";
diff --git a/apps/dokploy/components/dashboard/application/update-application.tsx b/apps/dokploy/components/dashboard/application/update-application.tsx
index a49fc538..90b63f08 100644
--- a/apps/dokploy/components/dashboard/application/update-application.tsx
+++ b/apps/dokploy/components/dashboard/application/update-application.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 { AlertTriangle, PenBoxIcon, SquarePen } from "lucide-react";
+import { PenBoxIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/compose/advanced/add-command.tsx b/apps/dokploy/components/dashboard/compose/advanced/add-command.tsx
index 1bbd3820..c5a34b3c 100644
--- a/apps/dokploy/components/dashboard/compose/advanced/add-command.tsx
+++ b/apps/dokploy/components/dashboard/compose/advanced/add-command.tsx
@@ -19,7 +19,6 @@ import {
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import React from "react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/compose/deployments/refresh-token-compose.tsx b/apps/dokploy/components/dashboard/compose/deployments/refresh-token-compose.tsx
index 95fafaab..b062b099 100644
--- a/apps/dokploy/components/dashboard/compose/deployments/refresh-token-compose.tsx
+++ b/apps/dokploy/components/dashboard/compose/deployments/refresh-token-compose.tsx
@@ -11,7 +11,6 @@ import {
} from "@/components/ui/alert-dialog";
import { api } from "@/utils/api";
import { RefreshCcw } from "lucide-react";
-import React from "react";
import { toast } from "sonner";
interface Props {
diff --git a/apps/dokploy/components/dashboard/compose/general/generic/show.tsx b/apps/dokploy/components/dashboard/compose/general/generic/show.tsx
index 1681039c..347c134e 100644
--- a/apps/dokploy/components/dashboard/compose/general/generic/show.tsx
+++ b/apps/dokploy/components/dashboard/compose/general/generic/show.tsx
@@ -7,7 +7,7 @@ import {
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { api } from "@/utils/api";
-import { CodeIcon, GitBranch, LockIcon } from "lucide-react";
+import { CodeIcon, GitBranch } from "lucide-react";
import Link from "next/link";
import { useState } from "react";
import { ComposeFileEditor } from "../compose-file-editor";
diff --git a/apps/dokploy/components/dashboard/compose/general/randomize-compose.tsx b/apps/dokploy/components/dashboard/compose/general/randomize-compose.tsx
index b1a00985..4462ef0e 100644
--- a/apps/dokploy/components/dashboard/compose/general/randomize-compose.tsx
+++ b/apps/dokploy/components/dashboard/compose/general/randomize-compose.tsx
@@ -19,7 +19,7 @@ import { Input } from "@/components/ui/input";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import { AlertTriangle, Dices } from "lucide-react";
+import { AlertTriangle } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/compose/general/show.tsx b/apps/dokploy/components/dashboard/compose/general/show.tsx
index d002b409..71752525 100644
--- a/apps/dokploy/components/dashboard/compose/general/show.tsx
+++ b/apps/dokploy/components/dashboard/compose/general/show.tsx
@@ -7,7 +7,6 @@ import {
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
-import React from "react";
import { ComposeActions } from "./actions";
import { ShowProviderFormCompose } from "./generic/show";
interface Props {
diff --git a/apps/dokploy/components/dashboard/compose/logs/show.tsx b/apps/dokploy/components/dashboard/compose/logs/show.tsx
index 4530e0dd..57119054 100644
--- a/apps/dokploy/components/dashboard/compose/logs/show.tsx
+++ b/apps/dokploy/components/dashboard/compose/logs/show.tsx
@@ -18,7 +18,7 @@ import {
SelectValue,
} from "@/components/ui/select";
import { api } from "@/utils/api";
-import { Loader, Loader2 } from "lucide-react";
+import { Loader2 } from "lucide-react";
import dynamic from "next/dynamic";
import { useEffect, useState } from "react";
export const DockerLogs = dynamic(
diff --git a/apps/dokploy/components/dashboard/database/backups/show-backups.tsx b/apps/dokploy/components/dashboard/database/backups/show-backups.tsx
index 21fe28d4..6619ceae 100644
--- a/apps/dokploy/components/dashboard/database/backups/show-backups.tsx
+++ b/apps/dokploy/components/dashboard/database/backups/show-backups.tsx
@@ -16,7 +16,6 @@ import {
import { api } from "@/utils/api";
import { DatabaseBackup, Play, Trash2 } from "lucide-react";
import Link from "next/link";
-import React from "react";
import { toast } from "sonner";
import type { ServiceType } from "../../application/advanced/show-resources";
import { AddBackup } from "./add-backup";
diff --git a/apps/dokploy/components/dashboard/database/backups/update-backup.tsx b/apps/dokploy/components/dashboard/database/backups/update-backup.tsx
index 0083bb1d..99f7692a 100644
--- a/apps/dokploy/components/dashboard/database/backups/update-backup.tsx
+++ b/apps/dokploy/components/dashboard/database/backups/update-backup.tsx
@@ -35,7 +35,7 @@ import { Switch } from "@/components/ui/switch";
import { cn } from "@/lib/utils";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import { CheckIcon, ChevronsUpDown, PenBoxIcon, Pencil } from "lucide-react";
+import { CheckIcon, ChevronsUpDown, PenBoxIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/docker/logs/since-logs-filter.tsx b/apps/dokploy/components/dashboard/docker/logs/since-logs-filter.tsx
index b7caafe7..44f2cdfc 100644
--- a/apps/dokploy/components/dashboard/docker/logs/since-logs-filter.tsx
+++ b/apps/dokploy/components/dashboard/docker/logs/since-logs-filter.tsx
@@ -15,7 +15,6 @@ import { Separator } from "@/components/ui/separator";
import { Switch } from "@/components/ui/switch";
import { cn } from "@/lib/utils";
import { CheckIcon } from "lucide-react";
-import React from "react";
export type TimeFilter = "all" | "1h" | "6h" | "24h" | "168h" | "720h";
diff --git a/apps/dokploy/components/dashboard/docker/logs/terminal-line.tsx b/apps/dokploy/components/dashboard/docker/logs/terminal-line.tsx
index c25acc67..ee674e0f 100644
--- a/apps/dokploy/components/dashboard/docker/logs/terminal-line.tsx
+++ b/apps/dokploy/components/dashboard/docker/logs/terminal-line.tsx
@@ -9,7 +9,6 @@ import {
import { cn } from "@/lib/utils";
import { FancyAnsi } from "fancy-ansi";
import { escapeRegExp } from "lodash";
-import React from "react";
import { type LogLine, getLogType } from "./utils";
interface LogLineProps {
diff --git a/apps/dokploy/components/dashboard/docker/show/colums.tsx b/apps/dokploy/components/dashboard/docker/show/colums.tsx
index 3feae176..1cf0200f 100644
--- a/apps/dokploy/components/dashboard/docker/show/colums.tsx
+++ b/apps/dokploy/components/dashboard/docker/show/colums.tsx
@@ -1,6 +1,5 @@
import type { ColumnDef } from "@tanstack/react-table";
import { ArrowUpDown, MoreHorizontal } from "lucide-react";
-import * as React from "react";
import { Button } from "@/components/ui/button";
import {
diff --git a/apps/dokploy/components/dashboard/docker/show/show-containers.tsx b/apps/dokploy/components/dashboard/docker/show/show-containers.tsx
index c66c9b9b..024b0061 100644
--- a/apps/dokploy/components/dashboard/docker/show/show-containers.tsx
+++ b/apps/dokploy/components/dashboard/docker/show/show-containers.tsx
@@ -1,18 +1,3 @@
-import {
- type ColumnFiltersState,
- type SortingState,
- type VisibilityState,
- flexRender,
- getCoreRowModel,
- getFilteredRowModel,
- getPaginationRowModel,
- getSortedRowModel,
- useReactTable,
-} from "@tanstack/react-table";
-import { ChevronDown, Container } from "lucide-react";
-import * as React from "react";
-
-import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Card,
@@ -37,6 +22,19 @@ import {
TableRow,
} from "@/components/ui/table";
import { type RouterOutputs, api } from "@/utils/api";
+import {
+ type ColumnFiltersState,
+ type SortingState,
+ type VisibilityState,
+ flexRender,
+ getCoreRowModel,
+ getFilteredRowModel,
+ getPaginationRowModel,
+ getSortedRowModel,
+ useReactTable,
+} from "@tanstack/react-table";
+import { ChevronDown, Container } from "lucide-react";
+import * as React from "react";
import { columns } from "./colums";
export type Container = NonNullable<
RouterOutputs["docker"]["getContainers"]
diff --git a/apps/dokploy/components/dashboard/file-system/show-traefik-system.tsx b/apps/dokploy/components/dashboard/file-system/show-traefik-system.tsx
index ed2ed197..c9272f29 100644
--- a/apps/dokploy/components/dashboard/file-system/show-traefik-system.tsx
+++ b/apps/dokploy/components/dashboard/file-system/show-traefik-system.tsx
@@ -7,9 +7,8 @@ import {
CardTitle,
} from "@/components/ui/card";
import { Tree } from "@/components/ui/file-tree";
-import { cn } from "@/lib/utils";
import { api } from "@/utils/api";
-import { FileIcon, Folder, Link, Loader2, Workflow } from "lucide-react";
+import { FileIcon, Folder, Loader2, Workflow } from "lucide-react";
import React from "react";
import { ShowTraefikFile } from "./show-traefik-file";
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 f2044917..4a5c43a2 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
@@ -19,7 +19,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
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 98773685..ad6b1164 100644
--- a/apps/dokploy/components/dashboard/mariadb/general/show-general-mariadb.tsx
+++ b/apps/dokploy/components/dashboard/mariadb/general/show-general-mariadb.tsx
@@ -4,7 +4,7 @@ import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { api } from "@/utils/api";
import { Ban, CheckCircle2, RefreshCcw, Terminal } from "lucide-react";
-import React, { useState } from "react";
+import { useState } from "react";
import { toast } from "sonner";
import { type LogLine, parseLogs } from "../../docker/logs/utils";
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
diff --git a/apps/dokploy/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx b/apps/dokploy/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx
index b409ac4d..17026926 100644
--- a/apps/dokploy/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx
+++ b/apps/dokploy/components/dashboard/mariadb/general/show-internal-mariadb-credentials.tsx
@@ -3,7 +3,6 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
-import React from "react";
interface Props {
mariadbId: string;
diff --git a/apps/dokploy/components/dashboard/mariadb/update-mariadb.tsx b/apps/dokploy/components/dashboard/mariadb/update-mariadb.tsx
index 4c9be090..48d94489 100644
--- a/apps/dokploy/components/dashboard/mariadb/update-mariadb.tsx
+++ b/apps/dokploy/components/dashboard/mariadb/update-mariadb.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 { AlertTriangle, PenBoxIcon, SquarePen } from "lucide-react";
+import { PenBoxIcon } from "lucide-react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
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 6dd2e919..9fe6e713 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
@@ -19,7 +19,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
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 df01e36d..a20d4637 100644
--- a/apps/dokploy/components/dashboard/mongo/general/show-general-mongo.tsx
+++ b/apps/dokploy/components/dashboard/mongo/general/show-general-mongo.tsx
@@ -4,7 +4,7 @@ import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { api } from "@/utils/api";
import { Ban, CheckCircle2, RefreshCcw, Terminal } from "lucide-react";
-import React, { useState } from "react";
+import { useState } from "react";
import { toast } from "sonner";
import { type LogLine, parseLogs } from "../../docker/logs/utils";
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
diff --git a/apps/dokploy/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx b/apps/dokploy/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx
index 6636688d..e66ea8c3 100644
--- a/apps/dokploy/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx
+++ b/apps/dokploy/components/dashboard/mongo/general/show-internal-mongo-credentials.tsx
@@ -3,7 +3,6 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
-import React from "react";
interface Props {
mongoId: string;
diff --git a/apps/dokploy/components/dashboard/monitoring/free/container/show-free-compose-monitoring.tsx b/apps/dokploy/components/dashboard/monitoring/free/container/show-free-compose-monitoring.tsx
index 99be6d9d..2bf6c900 100644
--- a/apps/dokploy/components/dashboard/monitoring/free/container/show-free-compose-monitoring.tsx
+++ b/apps/dokploy/components/dashboard/monitoring/free/container/show-free-compose-monitoring.tsx
@@ -1,6 +1,5 @@
import { Button } from "@/components/ui/button";
import {
- Card,
CardContent,
CardDescription,
CardHeader,
diff --git a/apps/dokploy/components/dashboard/monitoring/free/container/show-free-container-monitoring.tsx b/apps/dokploy/components/dashboard/monitoring/free/container/show-free-container-monitoring.tsx
index 64a46bdb..278e0936 100644
--- a/apps/dokploy/components/dashboard/monitoring/free/container/show-free-container-monitoring.tsx
+++ b/apps/dokploy/components/dashboard/monitoring/free/container/show-free-container-monitoring.tsx
@@ -1,13 +1,7 @@
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card";
+import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Progress } from "@/components/ui/progress";
import { api } from "@/utils/api";
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { DockerBlockChart } from "./docker-block-chart";
import { DockerCpuChart } from "./docker-cpu-chart";
import { DockerDiskChart } from "./docker-disk-chart";
diff --git a/apps/dokploy/components/dashboard/monitoring/paid/servers/show-paid-monitoring.tsx b/apps/dokploy/components/dashboard/monitoring/paid/servers/show-paid-monitoring.tsx
index 87c03057..e299cfb3 100644
--- a/apps/dokploy/components/dashboard/monitoring/paid/servers/show-paid-monitoring.tsx
+++ b/apps/dokploy/components/dashboard/monitoring/paid/servers/show-paid-monitoring.tsx
@@ -7,7 +7,6 @@ import {
} from "@/components/ui/select";
import { api } from "@/utils/api";
import { Clock, Cpu, HardDrive, Loader2, MemoryStick } from "lucide-react";
-import type React from "react";
import { useEffect, useState } from "react";
import { CPUChart } from "./cpu-chart";
import { DiskChart } from "./disk-chart";
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 dc1ca3a7..7a0527b1 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
@@ -19,7 +19,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
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 56a191ce..13f46cae 100644
--- a/apps/dokploy/components/dashboard/mysql/general/show-general-mysql.tsx
+++ b/apps/dokploy/components/dashboard/mysql/general/show-general-mysql.tsx
@@ -4,7 +4,7 @@ import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { api } from "@/utils/api";
import { Ban, CheckCircle2, RefreshCcw, Terminal } from "lucide-react";
-import React, { useState } from "react";
+import { useState } from "react";
import { toast } from "sonner";
import { type LogLine, parseLogs } from "../../docker/logs/utils";
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
diff --git a/apps/dokploy/components/dashboard/mysql/general/show-internal-mysql-credentials.tsx b/apps/dokploy/components/dashboard/mysql/general/show-internal-mysql-credentials.tsx
index 2c09efb8..3f187237 100644
--- a/apps/dokploy/components/dashboard/mysql/general/show-internal-mysql-credentials.tsx
+++ b/apps/dokploy/components/dashboard/mysql/general/show-internal-mysql-credentials.tsx
@@ -3,7 +3,6 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
-import React from "react";
interface Props {
mysqlId: string;
diff --git a/apps/dokploy/components/dashboard/mysql/update-mysql.tsx b/apps/dokploy/components/dashboard/mysql/update-mysql.tsx
index 645575cd..efe1eb11 100644
--- a/apps/dokploy/components/dashboard/mysql/update-mysql.tsx
+++ b/apps/dokploy/components/dashboard/mysql/update-mysql.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 { AlertTriangle, PenBoxIcon, SquarePen } from "lucide-react";
+import { PenBoxIcon } from "lucide-react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/organization/handle-organization.tsx b/apps/dokploy/components/dashboard/organization/handle-organization.tsx
index 24bb5c0e..905a244c 100644
--- a/apps/dokploy/components/dashboard/organization/handle-organization.tsx
+++ b/apps/dokploy/components/dashboard/organization/handle-organization.tsx
@@ -12,7 +12,7 @@ import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
-import { PenBoxIcon, Plus, SquarePen } from "lucide-react";
+import { PenBoxIcon, Plus } from "lucide-react";
import { useEffect, useState } from "react";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/postgres/advanced/show-custom-command.tsx b/apps/dokploy/components/dashboard/postgres/advanced/show-custom-command.tsx
index 6e912db9..2bae245e 100644
--- a/apps/dokploy/components/dashboard/postgres/advanced/show-custom-command.tsx
+++ b/apps/dokploy/components/dashboard/postgres/advanced/show-custom-command.tsx
@@ -11,7 +11,7 @@ import {
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import React, { useEffect } from "react";
+import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
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 e8fff7dc..dbd57d0b 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
@@ -19,7 +19,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
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 43c3f432..89d27523 100644
--- a/apps/dokploy/components/dashboard/postgres/general/show-general-postgres.tsx
+++ b/apps/dokploy/components/dashboard/postgres/general/show-general-postgres.tsx
@@ -4,7 +4,7 @@ import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { api } from "@/utils/api";
import { Ban, CheckCircle2, RefreshCcw, Terminal } from "lucide-react";
-import React, { useState } from "react";
+import { useState } from "react";
import { toast } from "sonner";
import { type LogLine, parseLogs } from "../../docker/logs/utils";
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
diff --git a/apps/dokploy/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx b/apps/dokploy/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx
index e0122610..545150f8 100644
--- a/apps/dokploy/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx
+++ b/apps/dokploy/components/dashboard/postgres/general/show-internal-postgres-credentials.tsx
@@ -3,7 +3,6 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
-import React from "react";
interface Props {
postgresId: string;
diff --git a/apps/dokploy/components/dashboard/postgres/update-postgres.tsx b/apps/dokploy/components/dashboard/postgres/update-postgres.tsx
index 54ad5bce..7be6908f 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 { AlertTriangle, PenBoxIcon, SquarePen } from "lucide-react";
+import { PenBoxIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/project/add-database.tsx b/apps/dokploy/components/dashboard/project/add-database.tsx
index 1ca0d6a5..cd75ba46 100644
--- a/apps/dokploy/components/dashboard/project/add-database.tsx
+++ b/apps/dokploy/components/dashboard/project/add-database.tsx
@@ -18,7 +18,6 @@ import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import {
Form,
FormControl,
- FormDescription,
FormField,
FormItem,
FormLabel,
diff --git a/apps/dokploy/components/dashboard/project/add-template.tsx b/apps/dokploy/components/dashboard/project/add-template.tsx
index cc6962aa..3965f817 100644
--- a/apps/dokploy/components/dashboard/project/add-template.tsx
+++ b/apps/dokploy/components/dashboard/project/add-template.tsx
@@ -57,7 +57,6 @@ import {
BookText,
CheckIcon,
ChevronsUpDown,
- Code,
Github,
Globe,
HelpCircle,
diff --git a/apps/dokploy/components/dashboard/projects/handle-project.tsx b/apps/dokploy/components/dashboard/projects/handle-project.tsx
index 492c03c9..f5d62dfc 100644
--- a/apps/dokploy/components/dashboard/projects/handle-project.tsx
+++ b/apps/dokploy/components/dashboard/projects/handle-project.tsx
@@ -21,7 +21,6 @@ import {
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
-import { authClient } from "@/lib/auth-client";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PlusIcon, SquarePen } from "lucide-react";
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 40ae0574..25b5f2ba 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
@@ -19,7 +19,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
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 ec4aeb6c..e309ef49 100644
--- a/apps/dokploy/components/dashboard/redis/general/show-general-redis.tsx
+++ b/apps/dokploy/components/dashboard/redis/general/show-general-redis.tsx
@@ -4,7 +4,7 @@ import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { api } from "@/utils/api";
import { Ban, CheckCircle2, RefreshCcw, Terminal } from "lucide-react";
-import React, { useState } from "react";
+import { useState } from "react";
import { toast } from "sonner";
import { type LogLine, parseLogs } from "../../docker/logs/utils";
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
diff --git a/apps/dokploy/components/dashboard/redis/general/show-internal-redis-credentials.tsx b/apps/dokploy/components/dashboard/redis/general/show-internal-redis-credentials.tsx
index 09200674..47ad0df0 100644
--- a/apps/dokploy/components/dashboard/redis/general/show-internal-redis-credentials.tsx
+++ b/apps/dokploy/components/dashboard/redis/general/show-internal-redis-credentials.tsx
@@ -3,7 +3,6 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
-import React from "react";
interface Props {
redisId: string;
diff --git a/apps/dokploy/components/dashboard/redis/update-redis.tsx b/apps/dokploy/components/dashboard/redis/update-redis.tsx
index c3557bee..193aec3b 100644
--- a/apps/dokploy/components/dashboard/redis/update-redis.tsx
+++ b/apps/dokploy/components/dashboard/redis/update-redis.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 { AlertTriangle, PenBoxIcon, SquarePen } from "lucide-react";
+import { PenBoxIcon } from "lucide-react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/requests/columns.tsx b/apps/dokploy/components/dashboard/requests/columns.tsx
index 529d64a4..c1814190 100644
--- a/apps/dokploy/components/dashboard/requests/columns.tsx
+++ b/apps/dokploy/components/dashboard/requests/columns.tsx
@@ -3,7 +3,6 @@ import { Button } from "@/components/ui/button";
import type { ColumnDef } from "@tanstack/react-table";
import { format } from "date-fns";
import { ArrowUpDown } from "lucide-react";
-import * as React from "react";
import type { LogEntry } from "./show-requests";
export const getStatusColor = (status: number) => {
diff --git a/apps/dokploy/components/dashboard/requests/show-requests.tsx b/apps/dokploy/components/dashboard/requests/show-requests.tsx
index 05ba6e51..c3d92dd6 100644
--- a/apps/dokploy/components/dashboard/requests/show-requests.tsx
+++ b/apps/dokploy/components/dashboard/requests/show-requests.tsx
@@ -11,7 +11,6 @@ import {
import { type RouterOutputs, api } from "@/utils/api";
import { ArrowDownUp } from "lucide-react";
import Link from "next/link";
-import * as React from "react";
import { toast } from "sonner";
import { RequestDistributionChart } from "./request-distribution-chart";
import { RequestsTable } from "./requests-table";
diff --git a/apps/dokploy/components/dashboard/search-command.tsx b/apps/dokploy/components/dashboard/search-command.tsx
index 7ea53d72..5726dc99 100644
--- a/apps/dokploy/components/dashboard/search-command.tsx
+++ b/apps/dokploy/components/dashboard/search-command.tsx
@@ -7,9 +7,7 @@ import {
PostgresqlIcon,
RedisIcon,
} from "@/components/icons/data-tools-icons";
-import { Badge } from "@/components/ui/badge";
import {
- Command,
CommandDialog,
CommandEmpty,
CommandGroup,
diff --git a/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx b/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx
index c76ec33e..029eaa90 100644
--- a/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx
+++ b/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx
@@ -23,7 +23,7 @@ import {
PlusIcon,
} from "lucide-react";
import Link from "next/link";
-import React, { useState } from "react";
+import { useState } from "react";
const stripePromise = loadStripe(
process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!,
diff --git a/apps/dokploy/components/dashboard/settings/billing/show-welcome-dokploy.tsx b/apps/dokploy/components/dashboard/settings/billing/show-welcome-dokploy.tsx
index 201aed44..64362b25 100644
--- a/apps/dokploy/components/dashboard/settings/billing/show-welcome-dokploy.tsx
+++ b/apps/dokploy/components/dashboard/settings/billing/show-welcome-dokploy.tsx
@@ -6,7 +6,6 @@ import {
DialogTitle,
} from "@/components/ui/dialog";
import { api } from "@/utils/api";
-import type React from "react";
import { useEffect, useState } from "react";
export const ShowWelcomeDokploy = () => {
diff --git a/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes.tsx b/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes.tsx
index b55396bf..ba3eefa5 100644
--- a/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes.tsx
+++ b/apps/dokploy/components/dashboard/settings/cluster/nodes/show-nodes.tsx
@@ -33,7 +33,6 @@ import {
} from "@/components/ui/tooltip";
import { api } from "@/utils/api";
import { Boxes, HelpCircle, LockIcon, MoreHorizontal } from "lucide-react";
-import React from "react";
import { toast } from "sonner";
import { AddNode } from "./add-node";
import { ShowNodeData } from "./show-node-data";
diff --git a/apps/dokploy/components/dashboard/settings/git/bitbucket/add-bitbucket-provider.tsx b/apps/dokploy/components/dashboard/settings/git/bitbucket/add-bitbucket-provider.tsx
index 9cb605a6..2c0f3046 100644
--- a/apps/dokploy/components/dashboard/settings/git/bitbucket/add-bitbucket-provider.tsx
+++ b/apps/dokploy/components/dashboard/settings/git/bitbucket/add-bitbucket-provider.tsx
@@ -1,8 +1,4 @@
-import {
- BitbucketIcon,
- GithubIcon,
- GitlabIcon,
-} from "@/components/icons/data-tools-icons";
+import { BitbucketIcon } from "@/components/icons/data-tools-icons";
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
diff --git a/apps/dokploy/components/dashboard/settings/git/bitbucket/edit-bitbucket-provider.tsx b/apps/dokploy/components/dashboard/settings/git/bitbucket/edit-bitbucket-provider.tsx
index 25c5e5da..e5a7f752 100644
--- a/apps/dokploy/components/dashboard/settings/git/bitbucket/edit-bitbucket-provider.tsx
+++ b/apps/dokploy/components/dashboard/settings/git/bitbucket/edit-bitbucket-provider.tsx
@@ -20,7 +20,7 @@ import {
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import { Edit, PenBoxIcon } from "lucide-react";
+import { PenBoxIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/settings/git/gitlab/edit-gitlab-provider.tsx b/apps/dokploy/components/dashboard/settings/git/gitlab/edit-gitlab-provider.tsx
index fb688b89..6c5d488e 100644
--- a/apps/dokploy/components/dashboard/settings/git/gitlab/edit-gitlab-provider.tsx
+++ b/apps/dokploy/components/dashboard/settings/git/gitlab/edit-gitlab-provider.tsx
@@ -20,7 +20,7 @@ import {
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import { Edit, PenBoxIcon } from "lucide-react";
+import { PenBoxIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/settings/profile/enable-2fa.tsx b/apps/dokploy/components/dashboard/settings/profile/enable-2fa.tsx
index b1da3ec1..918df435 100644
--- a/apps/dokploy/components/dashboard/settings/profile/enable-2fa.tsx
+++ b/apps/dokploy/components/dashboard/settings/profile/enable-2fa.tsx
@@ -3,7 +3,6 @@ import {
Dialog,
DialogContent,
DialogDescription,
- DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
diff --git a/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx b/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx
index ca1bf3c2..f4299709 100644
--- a/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx
+++ b/apps/dokploy/components/dashboard/settings/profile/profile-form.tsx
@@ -1,5 +1,4 @@
import { AlertBlock } from "@/components/shared/alert-block";
-import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
import {
Card,
@@ -18,7 +17,6 @@ import {
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
-import { authClient } from "@/lib/auth-client";
import { generateSHA256Hash } from "@/lib/utils";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
diff --git a/apps/dokploy/components/dashboard/settings/servers/actions/show-dokploy-actions.tsx b/apps/dokploy/components/dashboard/settings/servers/actions/show-dokploy-actions.tsx
index 3a1af206..f57dad3c 100644
--- a/apps/dokploy/components/dashboard/settings/servers/actions/show-dokploy-actions.tsx
+++ b/apps/dokploy/components/dashboard/settings/servers/actions/show-dokploy-actions.tsx
@@ -1,5 +1,4 @@
import { Button } from "@/components/ui/button";
-import React from "react";
import { UpdateServerIp } from "@/components/dashboard/settings/web-server/update-server-ip";
import {
diff --git a/apps/dokploy/components/dashboard/settings/servers/actions/show-storage-actions.tsx b/apps/dokploy/components/dashboard/settings/servers/actions/show-storage-actions.tsx
index c45c0c8b..cb60effd 100644
--- a/apps/dokploy/components/dashboard/settings/servers/actions/show-storage-actions.tsx
+++ b/apps/dokploy/components/dashboard/settings/servers/actions/show-storage-actions.tsx
@@ -1,5 +1,4 @@
import { Button } from "@/components/ui/button";
-import React from "react";
import {
DropdownMenu,
diff --git a/apps/dokploy/components/dashboard/settings/servers/actions/show-traefik-actions.tsx b/apps/dokploy/components/dashboard/settings/servers/actions/show-traefik-actions.tsx
index 17a6ae75..0968931d 100644
--- a/apps/dokploy/components/dashboard/settings/servers/actions/show-traefik-actions.tsx
+++ b/apps/dokploy/components/dashboard/settings/servers/actions/show-traefik-actions.tsx
@@ -1,14 +1,4 @@
import { Button } from "@/components/ui/button";
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card";
-import { Label } from "@/components/ui/label";
-import { Switch } from "@/components/ui/switch";
-import React from "react";
import {
DropdownMenu,
@@ -20,10 +10,8 @@ import {
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { api } from "@/utils/api";
-import { toast } from "sonner";
-
-import { cn } from "@/lib/utils";
import { useTranslation } from "next-i18next";
+import { toast } from "sonner";
import { EditTraefikEnv } from "../../web-server/edit-traefik-env";
import { ManageTraefikPorts } from "../../web-server/manage-traefik-ports";
import { ShowModalLogs } from "../../web-server/show-modal-logs";
diff --git a/apps/dokploy/components/dashboard/settings/servers/gpu-support.tsx b/apps/dokploy/components/dashboard/settings/servers/gpu-support.tsx
index 3cda7e80..ec60fed6 100644
--- a/apps/dokploy/components/dashboard/settings/servers/gpu-support.tsx
+++ b/apps/dokploy/components/dashboard/settings/servers/gpu-support.tsx
@@ -9,7 +9,6 @@ import {
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
-import { TRPCClientError } from "@trpc/client";
import { CheckCircle2, Cpu, Loader2, RefreshCw, XCircle } from "lucide-react";
import { useEffect, useState } from "react";
import { toast } from "sonner";
diff --git a/apps/dokploy/components/dashboard/settings/servers/setup-monitoring.tsx b/apps/dokploy/components/dashboard/settings/servers/setup-monitoring.tsx
index db9545a6..23173047 100644
--- a/apps/dokploy/components/dashboard/settings/servers/setup-monitoring.tsx
+++ b/apps/dokploy/components/dashboard/settings/servers/setup-monitoring.tsx
@@ -2,7 +2,6 @@ import { AlertBlock } from "@/components/shared/alert-block";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
- Card,
CardContent,
CardDescription,
CardHeader,
@@ -30,7 +29,6 @@ import {
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
-import { ScrollArea } from "@/components/ui/scroll-area";
import { extractServices } from "@/pages/dashboard/project/[projectId]";
import { api } from "@/utils/api";
import { useUrl } from "@/utils/hooks/use-url";
diff --git a/apps/dokploy/components/dashboard/settings/servers/show-docker-containers-modal.tsx b/apps/dokploy/components/dashboard/settings/servers/show-docker-containers-modal.tsx
index 1cdab23b..ad82085c 100644
--- a/apps/dokploy/components/dashboard/settings/servers/show-docker-containers-modal.tsx
+++ b/apps/dokploy/components/dashboard/settings/servers/show-docker-containers-modal.tsx
@@ -1,10 +1,4 @@
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogTrigger,
-} from "@/components/ui/dialog";
+import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import { useState } from "react";
import { ShowContainers } from "../../docker/show/show-containers";
diff --git a/apps/dokploy/components/dashboard/settings/servers/show-swarm-overview-modal.tsx b/apps/dokploy/components/dashboard/settings/servers/show-swarm-overview-modal.tsx
index a47005d0..b8631184 100644
--- a/apps/dokploy/components/dashboard/settings/servers/show-swarm-overview-modal.tsx
+++ b/apps/dokploy/components/dashboard/settings/servers/show-swarm-overview-modal.tsx
@@ -1,12 +1,5 @@
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogTrigger,
-} from "@/components/ui/dialog";
+import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
-import { ContainerIcon } from "lucide-react";
import { useState } from "react";
import SwarmMonitorCard from "../../swarm/monitoring-card";
diff --git a/apps/dokploy/components/dashboard/settings/users/show-users.tsx b/apps/dokploy/components/dashboard/settings/users/show-users.tsx
index 0ccb23e7..ff56698e 100644
--- a/apps/dokploy/components/dashboard/settings/users/show-users.tsx
+++ b/apps/dokploy/components/dashboard/settings/users/show-users.tsx
@@ -26,7 +26,6 @@ import {
} from "@/components/ui/table";
import { authClient } from "@/lib/auth-client";
import { api } from "@/utils/api";
-import copy from "copy-to-clipboard";
import { format } from "date-fns";
import { MoreHorizontal, Users } from "lucide-react";
import { Loader2 } from "lucide-react";
@@ -134,12 +133,45 @@ export const ShowUsers = () => {
)}
{member.role !== "owner" && (
- {
- if (isCloud) {
+ <>
+ {!isCloud && (
+ {
+ await mutateAsync({
+ userId: member.user.id,
+ })
+ .then(() => {
+ toast.success(
+ "User deleted successfully",
+ );
+ refetch();
+ })
+ .catch(() => {
+ toast.error(
+ "Error deleting destination",
+ );
+ });
+ }}
+ >
+
+ e.preventDefault()
+ }
+ >
+ Delete User
+
+
+ )}
+
+ {
const { error } =
await authClient.organization.removeMember(
{
@@ -149,39 +181,24 @@ export const ShowUsers = () => {
if (!error) {
toast.success(
- "User deleted successfully",
+ "User unlinked successfully",
);
refetch();
} else {
toast.error(
- "Error deleting user",
+ "Error unlinking user",
);
}
- } else {
- await mutateAsync({
- userId: member.user.id,
- })
- .then(() => {
- toast.success(
- "User deleted successfully",
- );
- refetch();
- })
- .catch(() => {
- toast.error(
- "Error deleting destination",
- );
- });
- }
- }}
- >
- e.preventDefault()}
+ }}
>
- Delete User
-
-
+ e.preventDefault()}
+ >
+ Unlink User
+
+
+ >
)}
diff --git a/apps/dokploy/components/dashboard/settings/web-domain.tsx b/apps/dokploy/components/dashboard/settings/web-domain.tsx
index 13750e2a..3b3f70ba 100644
--- a/apps/dokploy/components/dashboard/settings/web-domain.tsx
+++ b/apps/dokploy/components/dashboard/settings/web-domain.tsx
@@ -24,7 +24,7 @@ import {
} from "@/components/ui/select";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
-import { GlobeIcon, ServerIcon, User } from "lucide-react";
+import { GlobeIcon } from "lucide-react";
import { useTranslation } from "next-i18next";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
diff --git a/apps/dokploy/components/dashboard/settings/web-server.tsx b/apps/dokploy/components/dashboard/settings/web-server.tsx
index 0cc4772f..326cb0ea 100644
--- a/apps/dokploy/components/dashboard/settings/web-server.tsx
+++ b/apps/dokploy/components/dashboard/settings/web-server.tsx
@@ -5,11 +5,9 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
-import { cn } from "@/lib/utils";
import { api } from "@/utils/api";
import { ServerIcon } from "lucide-react";
import { useTranslation } from "next-i18next";
-import React from "react";
import { ShowDokployActions } from "./servers/actions/show-dokploy-actions";
import { ShowStorageActions } from "./servers/actions/show-storage-actions";
import { ShowTraefikActions } from "./servers/actions/show-traefik-actions";
diff --git a/apps/dokploy/components/dashboard/settings/web-server/local-server-config.tsx b/apps/dokploy/components/dashboard/settings/web-server/local-server-config.tsx
index f68046db..e30408e6 100644
--- a/apps/dokploy/components/dashboard/settings/web-server/local-server-config.tsx
+++ b/apps/dokploy/components/dashboard/settings/web-server/local-server-config.tsx
@@ -18,7 +18,6 @@ import { cn } from "@/lib/utils";
import { zodResolver } from "@hookform/resolvers/zod";
import { Settings } from "lucide-react";
import { useTranslation } from "next-i18next";
-import React from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";
diff --git a/apps/dokploy/components/dashboard/settings/web-server/show-modal-logs.tsx b/apps/dokploy/components/dashboard/settings/web-server/show-modal-logs.tsx
index 12e7b670..bedecf51 100644
--- a/apps/dokploy/components/dashboard/settings/web-server/show-modal-logs.tsx
+++ b/apps/dokploy/components/dashboard/settings/web-server/show-modal-logs.tsx
@@ -6,7 +6,6 @@ import {
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
-import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import { Label } from "@/components/ui/label";
import {
Select,
diff --git a/apps/dokploy/components/dashboard/settings/web-server/update-server.tsx b/apps/dokploy/components/dashboard/settings/web-server/update-server.tsx
index 816687f5..2cfc459b 100644
--- a/apps/dokploy/components/dashboard/settings/web-server/update-server.tsx
+++ b/apps/dokploy/components/dashboard/settings/web-server/update-server.tsx
@@ -1,4 +1,3 @@
-import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Dialog,
@@ -14,7 +13,6 @@ import {
Info,
RefreshCcw,
Server,
- ServerCrash,
Sparkles,
Stars,
} from "lucide-react";
diff --git a/apps/dokploy/components/dashboard/swarm/applications/columns.tsx b/apps/dokploy/components/dashboard/swarm/applications/columns.tsx
index 69ccc41d..ab058e85 100644
--- a/apps/dokploy/components/dashboard/swarm/applications/columns.tsx
+++ b/apps/dokploy/components/dashboard/swarm/applications/columns.tsx
@@ -1,6 +1,5 @@
import type { ColumnDef } from "@tanstack/react-table";
import { ArrowUpDown, MoreHorizontal } from "lucide-react";
-import * as React from "react";
import { Button } from "@/components/ui/button";
import {
diff --git a/apps/dokploy/components/dashboard/swarm/applications/show-applications.tsx b/apps/dokploy/components/dashboard/swarm/applications/show-applications.tsx
index 41d7b113..681afd75 100644
--- a/apps/dokploy/components/dashboard/swarm/applications/show-applications.tsx
+++ b/apps/dokploy/components/dashboard/swarm/applications/show-applications.tsx
@@ -9,7 +9,6 @@ import {
} from "@/components/ui/dialog";
import { api } from "@/utils/api";
import { Layers, Loader2 } from "lucide-react";
-import React from "react";
import { type ApplicationList, columns } from "./columns";
import { DataTable } from "./data-table";
diff --git a/apps/dokploy/components/icons/data-tools-icons.tsx b/apps/dokploy/components/icons/data-tools-icons.tsx
index 93da14a0..e2c0922a 100644
--- a/apps/dokploy/components/icons/data-tools-icons.tsx
+++ b/apps/dokploy/components/icons/data-tools-icons.tsx
@@ -1,5 +1,4 @@
import { cn } from "@/lib/utils";
-import React from "react";
// https://worldvectorlogo.com/downloaded/redis Ref
diff --git a/apps/dokploy/components/layouts/side.tsx b/apps/dokploy/components/layouts/side.tsx
index e0931b08..939d1084 100644
--- a/apps/dokploy/components/layouts/side.tsx
+++ b/apps/dokploy/components/layouts/side.tsx
@@ -1,15 +1,14 @@
"use client";
import {
Activity,
- AudioWaveform,
BarChartHorizontalBigIcon,
Bell,
BlocksIcon,
BookIcon,
Boxes,
ChevronRight,
+ ChevronsUpDown,
CircleHelp,
- Command,
CreditCard,
Database,
Folder,
@@ -27,8 +26,6 @@ import {
Trash2,
User,
Users,
- ChevronsUpDown,
- Plus,
} from "lucide-react";
import { usePathname } from "next/navigation";
import type * as React from "react";
@@ -47,6 +44,14 @@ import {
CollapsibleContent,
CollapsibleTrigger,
} from "@/components/ui/collapsible";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
import { Separator } from "@/components/ui/separator";
import {
SIDEBAR_COOKIE_NAME,
@@ -68,29 +73,20 @@ import {
SidebarTrigger,
useSidebar,
} from "@/components/ui/sidebar";
+import { authClient } from "@/lib/auth-client";
import { cn } from "@/lib/utils";
import type { AppRouter } from "@/server/api/root";
import { api } from "@/utils/api";
import type { inferRouterOutputs } from "@trpc/server";
import Link from "next/link";
import { useRouter } from "next/router";
-import { Logo } from "../shared/logo";
-import { UpdateServerButton } from "./update-server";
-import { UserNav } from "./user-nav";
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuSeparator,
- DropdownMenuShortcut,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu";
-import { authClient } from "@/lib/auth-client";
import { toast } from "sonner";
import { AddOrganization } from "../dashboard/organization/handle-organization";
import { DialogAction } from "../shared/dialog-action";
+import { Logo } from "../shared/logo";
import { Button } from "../ui/button";
+import { UpdateServerButton } from "./update-server";
+import { UserNav } from "./user-nav";
// The types of the queries we are going to use
type AuthQueryOutput = inferRouterOutputs["auth"]["get"];
diff --git a/apps/dokploy/components/layouts/user-nav.tsx b/apps/dokploy/components/layouts/user-nav.tsx
index 30579f30..196f6d77 100644
--- a/apps/dokploy/components/layouts/user-nav.tsx
+++ b/apps/dokploy/components/layouts/user-nav.tsx
@@ -20,9 +20,7 @@ import { Languages } from "@/lib/languages";
import { api } from "@/utils/api";
import useLocale from "@/utils/hooks/use-locale";
import { ChevronsUpDown } from "lucide-react";
-import { useTranslation } from "next-i18next";
import { useRouter } from "next/router";
-import { useEffect, useRef, useState } from "react";
import { ModeToggle } from "../ui/modeToggle";
import { SidebarMenuButton } from "../ui/sidebar";
diff --git a/apps/dokploy/components/shared/dialog-action.tsx b/apps/dokploy/components/shared/dialog-action.tsx
index 3724242d..444440a2 100644
--- a/apps/dokploy/components/shared/dialog-action.tsx
+++ b/apps/dokploy/components/shared/dialog-action.tsx
@@ -9,7 +9,6 @@ import {
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
-import { Button } from "../ui/button";
interface Props {
title?: string | React.ReactNode;
diff --git a/apps/dokploy/components/shared/drawer-logs.tsx b/apps/dokploy/components/shared/drawer-logs.tsx
index f5a56cd6..5e4ab554 100644
--- a/apps/dokploy/components/shared/drawer-logs.tsx
+++ b/apps/dokploy/components/shared/drawer-logs.tsx
@@ -1,6 +1,3 @@
-import { DialogAction } from "@/components/shared/dialog-action";
-import { Button } from "@/components/ui/button";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import {
Sheet,
SheetContent,
@@ -8,10 +5,8 @@ import {
SheetHeader,
SheetTitle,
} from "@/components/ui/sheet";
-import { api } from "@/utils/api";
-import { Ban, CheckCircle2, Loader2, RefreshCcw, Terminal } from "lucide-react";
-import React, { useState, useEffect, useRef } from "react";
-import { toast } from "sonner";
+import { Loader2 } from "lucide-react";
+import { useEffect, useRef, useState } from "react";
import { TerminalLine } from "../dashboard/docker/logs/terminal-line";
import type { LogLine } from "../dashboard/docker/logs/utils";
diff --git a/apps/dokploy/components/shared/logo.tsx b/apps/dokploy/components/shared/logo.tsx
index 5d192cfd..086ef3b0 100644
--- a/apps/dokploy/components/shared/logo.tsx
+++ b/apps/dokploy/components/shared/logo.tsx
@@ -1,5 +1,3 @@
-import React from "react";
-
interface Props {
className?: string;
}
diff --git a/apps/dokploy/components/ui/modeToggle.tsx b/apps/dokploy/components/ui/modeToggle.tsx
index 7965a339..9b6ba27b 100644
--- a/apps/dokploy/components/ui/modeToggle.tsx
+++ b/apps/dokploy/components/ui/modeToggle.tsx
@@ -3,7 +3,6 @@
import { Button } from "@/components/ui/button";
import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes";
-import * as React from "react";
export function ModeToggle() {
const { theme, setTheme } = useTheme();
diff --git a/apps/dokploy/migrate.ts b/apps/dokploy/migrate.ts
index 38f48784..febd1c0e 100644
--- a/apps/dokploy/migrate.ts
+++ b/apps/dokploy/migrate.ts
@@ -1,5 +1,4 @@
import { drizzle } from "drizzle-orm/postgres-js";
-import { migrate } from "drizzle-orm/postgres-js/migrator";
import { nanoid } from "nanoid";
import postgres from "postgres";
import * as schema from "./server/db/schema";
diff --git a/apps/dokploy/pages/api/deploy/github.ts b/apps/dokploy/pages/api/deploy/github.ts
index 761c3866..5e64d8b2 100644
--- a/apps/dokploy/pages/api/deploy/github.ts
+++ b/apps/dokploy/pages/api/deploy/github.ts
@@ -3,9 +3,7 @@ import { applications, compose, github } from "@/server/db/schema";
import type { DeploymentJob } from "@/server/queues/queue-types";
import { myQueue } from "@/server/queues/queueSetup";
import { deploy } from "@/server/utils/deploy";
-import { generateRandomDomain } from "@/templates/utils";
import {
- type Domain,
IS_CLOUD,
createPreviewDeployment,
findPreviewDeploymentByApplicationId,
diff --git a/apps/dokploy/pages/api/providers/github/setup.ts b/apps/dokploy/pages/api/providers/github/setup.ts
index 9a03ed3d..ac5e7a6b 100644
--- a/apps/dokploy/pages/api/providers/github/setup.ts
+++ b/apps/dokploy/pages/api/providers/github/setup.ts
@@ -1,13 +1,6 @@
import { db } from "@/server/db";
import { github } from "@/server/db/schema";
-import {
- auth,
- createGithub,
- findAdminByAuthId,
- findAuthById,
- findUserByAuthId,
- findUserById,
-} from "@dokploy/server";
+import { createGithub } from "@dokploy/server";
import { eq } from "drizzle-orm";
import type { NextApiRequest, NextApiResponse } from "next";
import { Octokit } from "octokit";
diff --git a/apps/dokploy/pages/api/stripe/webhook.ts b/apps/dokploy/pages/api/stripe/webhook.ts
index d9cbedc8..6200a79e 100644
--- a/apps/dokploy/pages/api/stripe/webhook.ts
+++ b/apps/dokploy/pages/api/stripe/webhook.ts
@@ -1,7 +1,7 @@
import { buffer } from "node:stream/consumers";
import { db } from "@/server/db";
import { server, users_temp } from "@/server/db/schema";
-import { findAdminById, findUserById } from "@dokploy/server";
+import { findUserById } from "@dokploy/server";
import { asc, eq } from "drizzle-orm";
import type { NextApiRequest, NextApiResponse } from "next";
import Stripe from "stripe";
diff --git a/apps/dokploy/pages/dashboard/docker.tsx b/apps/dokploy/pages/dashboard/docker.tsx
index 5685dcfc..a9d80353 100644
--- a/apps/dokploy/pages/dashboard/docker.tsx
+++ b/apps/dokploy/pages/dashboard/docker.tsx
@@ -5,7 +5,7 @@ import { IS_CLOUD } from "@dokploy/server/constants";
import { validateRequest } from "@dokploy/server/lib/auth";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Dashboard = () => {
diff --git a/apps/dokploy/pages/dashboard/monitoring.tsx b/apps/dokploy/pages/dashboard/monitoring.tsx
index c5c617a7..4d8b072f 100644
--- a/apps/dokploy/pages/dashboard/monitoring.tsx
+++ b/apps/dokploy/pages/dashboard/monitoring.tsx
@@ -1,17 +1,13 @@
import { ContainerFreeMonitoring } from "@/components/dashboard/monitoring/free/container/show-free-container-monitoring";
import { ShowPaidMonitoring } from "@/components/dashboard/monitoring/paid/servers/show-paid-monitoring";
import { DashboardLayout } from "@/components/layouts/dashboard-layout";
-import { AlertBlock } from "@/components/shared/alert-block";
import { Card } from "@/components/ui/card";
-import { Label } from "@/components/ui/label";
-import { Switch } from "@/components/ui/switch";
import { useLocalStorage } from "@/hooks/useLocalStorage";
import { api } from "@/utils/api";
import { IS_CLOUD } from "@dokploy/server/constants";
import { validateRequest } from "@dokploy/server/lib/auth";
import { Loader2 } from "lucide-react";
import type { GetServerSidePropsContext } from "next";
-import type React from "react";
import type { ReactElement } from "react";
const BASE_URL = "http://localhost:3001/metrics";
diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx
index 7eebf708..59dba68c 100644
--- a/apps/dokploy/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx
+++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx
@@ -28,7 +28,6 @@ import {
CardTitle,
} from "@/components/ui/card";
import { Label } from "@/components/ui/label";
-import { Switch } from "@/components/ui/switch";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {
Tooltip,
@@ -42,7 +41,7 @@ import { api } from "@/utils/api";
import { validateRequest } from "@dokploy/server/lib/auth";
import { createServerSideHelpers } from "@trpc/react-query/server";
import copy from "copy-to-clipboard";
-import { GlobeIcon, HelpCircle, ServerOff, Trash2 } from "lucide-react";
+import { GlobeIcon, HelpCircle, ServerOff } from "lucide-react";
import type {
GetServerSidePropsContext,
InferGetServerSidePropsType,
@@ -50,7 +49,7 @@ import type {
import Head from "next/head";
import Link from "next/link";
import { useRouter } from "next/router";
-import React, { useState, useEffect, type ReactElement } from "react";
+import { type ReactElement, useEffect, useState } from "react";
import { toast } from "sonner";
import superjson from "superjson";
diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx
index 46c9864b..c1331e23 100644
--- a/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx
+++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx
@@ -22,7 +22,6 @@ import {
CardTitle,
} from "@/components/ui/card";
import { Label } from "@/components/ui/label";
-import { Switch } from "@/components/ui/switch";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {
Tooltip,
@@ -45,7 +44,7 @@ import type {
import Head from "next/head";
import Link from "next/link";
import { useRouter } from "next/router";
-import React, { useState, useEffect, type ReactElement } from "react";
+import { type ReactElement, useEffect, useState } from "react";
import { toast } from "sonner";
import superjson from "superjson";
diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/mariadb/[mariadbId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/mariadb/[mariadbId].tsx
index 6aa7677a..033b88a9 100644
--- a/apps/dokploy/pages/dashboard/project/[projectId]/services/mariadb/[mariadbId].tsx
+++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/mariadb/[mariadbId].tsx
@@ -24,7 +24,6 @@ import {
CardTitle,
} from "@/components/ui/card";
import { Label } from "@/components/ui/label";
-import { Switch } from "@/components/ui/switch";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {
Tooltip,
@@ -37,7 +36,7 @@ import { appRouter } from "@/server/api/root";
import { api } from "@/utils/api";
import { validateRequest } from "@dokploy/server/lib/auth";
import { createServerSideHelpers } from "@trpc/react-query/server";
-import { HelpCircle, ServerOff, Trash2 } from "lucide-react";
+import { HelpCircle, ServerOff } from "lucide-react";
import type {
GetServerSidePropsContext,
InferGetServerSidePropsType,
@@ -45,8 +44,7 @@ import type {
import Head from "next/head";
import Link from "next/link";
import { useRouter } from "next/router";
-import React, { useState, type ReactElement } from "react";
-import { toast } from "sonner";
+import { type ReactElement, useState } from "react";
import superjson from "superjson";
type TabState = "projects" | "monitoring" | "settings" | "backups" | "advanced";
diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/mongo/[mongoId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/mongo/[mongoId].tsx
index 2e3aae31..dea8cd57 100644
--- a/apps/dokploy/pages/dashboard/project/[projectId]/services/mongo/[mongoId].tsx
+++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/mongo/[mongoId].tsx
@@ -24,7 +24,6 @@ import {
CardTitle,
} from "@/components/ui/card";
import { Label } from "@/components/ui/label";
-import { Switch } from "@/components/ui/switch";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {
Tooltip,
@@ -37,7 +36,7 @@ import { appRouter } from "@/server/api/root";
import { api } from "@/utils/api";
import { validateRequest } from "@dokploy/server/lib/auth";
import { createServerSideHelpers } from "@trpc/react-query/server";
-import { HelpCircle, ServerOff, Trash2 } from "lucide-react";
+import { HelpCircle, ServerOff } from "lucide-react";
import type {
GetServerSidePropsContext,
InferGetServerSidePropsType,
@@ -45,8 +44,7 @@ import type {
import Head from "next/head";
import Link from "next/link";
import { useRouter } from "next/router";
-import React, { useState, type ReactElement } from "react";
-import { toast } from "sonner";
+import { type ReactElement, useState } from "react";
import superjson from "superjson";
type TabState = "projects" | "monitoring" | "settings" | "backups" | "advanced";
diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/mysql/[mysqlId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/mysql/[mysqlId].tsx
index 3e75603d..cc4eb4aa 100644
--- a/apps/dokploy/pages/dashboard/project/[projectId]/services/mysql/[mysqlId].tsx
+++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/mysql/[mysqlId].tsx
@@ -24,7 +24,6 @@ import {
CardTitle,
} from "@/components/ui/card";
import { Label } from "@/components/ui/label";
-import { Switch } from "@/components/ui/switch";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {
Tooltip,
@@ -37,7 +36,7 @@ import { appRouter } from "@/server/api/root";
import { api } from "@/utils/api";
import { validateRequest } from "@dokploy/server/lib/auth";
import { createServerSideHelpers } from "@trpc/react-query/server";
-import { HelpCircle, ServerOff, Trash2 } from "lucide-react";
+import { HelpCircle, ServerOff } from "lucide-react";
import type {
GetServerSidePropsContext,
InferGetServerSidePropsType,
@@ -45,8 +44,7 @@ import type {
import Head from "next/head";
import Link from "next/link";
import { useRouter } from "next/router";
-import React, { useState, type ReactElement } from "react";
-import { toast } from "sonner";
+import { type ReactElement, useState } from "react";
import superjson from "superjson";
type TabState = "projects" | "monitoring" | "settings" | "backups" | "advanced";
diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/postgres/[postgresId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/postgres/[postgresId].tsx
index dd0c312d..d0f1dc10 100644
--- a/apps/dokploy/pages/dashboard/project/[projectId]/services/postgres/[postgresId].tsx
+++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/postgres/[postgresId].tsx
@@ -24,7 +24,6 @@ import {
CardTitle,
} from "@/components/ui/card";
import { Label } from "@/components/ui/label";
-import { Switch } from "@/components/ui/switch";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {
Tooltip,
@@ -37,7 +36,7 @@ import { appRouter } from "@/server/api/root";
import { api } from "@/utils/api";
import { validateRequest } from "@dokploy/server/lib/auth";
import { createServerSideHelpers } from "@trpc/react-query/server";
-import { HelpCircle, ServerOff, Trash2 } from "lucide-react";
+import { HelpCircle, ServerOff } from "lucide-react";
import type {
GetServerSidePropsContext,
InferGetServerSidePropsType,
@@ -45,8 +44,7 @@ import type {
import Head from "next/head";
import Link from "next/link";
import { useRouter } from "next/router";
-import React, { useState, type ReactElement } from "react";
-import { toast } from "sonner";
+import { type ReactElement, useState } from "react";
import superjson from "superjson";
type TabState = "projects" | "monitoring" | "settings" | "backups" | "advanced";
diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/redis/[redisId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/redis/[redisId].tsx
index c7e5643a..2b053df4 100644
--- a/apps/dokploy/pages/dashboard/project/[projectId]/services/redis/[redisId].tsx
+++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/redis/[redisId].tsx
@@ -23,7 +23,6 @@ import {
CardTitle,
} from "@/components/ui/card";
import { Label } from "@/components/ui/label";
-import { Switch } from "@/components/ui/switch";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {
Tooltip,
@@ -44,8 +43,7 @@ import type {
import Head from "next/head";
import Link from "next/link";
import { useRouter } from "next/router";
-import React, { useState, type ReactElement } from "react";
-import { toast } from "sonner";
+import { type ReactElement, useState } from "react";
import superjson from "superjson";
type TabState = "projects" | "monitoring" | "settings" | "advanced";
diff --git a/apps/dokploy/pages/dashboard/projects.tsx b/apps/dokploy/pages/dashboard/projects.tsx
index abeee669..49427c25 100644
--- a/apps/dokploy/pages/dashboard/projects.tsx
+++ b/apps/dokploy/pages/dashboard/projects.tsx
@@ -6,7 +6,6 @@ import { validateRequest } from "@dokploy/server/lib/auth";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
import dynamic from "next/dynamic";
-import type React from "react";
import type { ReactElement } from "react";
import superjson from "superjson";
diff --git a/apps/dokploy/pages/dashboard/requests.tsx b/apps/dokploy/pages/dashboard/requests.tsx
index 580b936a..cb454587 100644
--- a/apps/dokploy/pages/dashboard/requests.tsx
+++ b/apps/dokploy/pages/dashboard/requests.tsx
@@ -4,7 +4,6 @@ import { IS_CLOUD } from "@dokploy/server/constants";
import { validateRequest } from "@dokploy/server/lib/auth";
import type { GetServerSidePropsContext } from "next";
import type { ReactElement } from "react";
-import * as React from "react";
export default function Requests() {
return ;
diff --git a/apps/dokploy/pages/dashboard/settings/billing.tsx b/apps/dokploy/pages/dashboard/settings/billing.tsx
index 3acce0b0..ee1ecdbe 100644
--- a/apps/dokploy/pages/dashboard/settings/billing.tsx
+++ b/apps/dokploy/pages/dashboard/settings/billing.tsx
@@ -6,7 +6,7 @@ import { IS_CLOUD } from "@dokploy/server/constants";
import { validateRequest } from "@dokploy/server/lib/auth";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
diff --git a/apps/dokploy/pages/dashboard/settings/certificates.tsx b/apps/dokploy/pages/dashboard/settings/certificates.tsx
index d045208e..96bec90b 100644
--- a/apps/dokploy/pages/dashboard/settings/certificates.tsx
+++ b/apps/dokploy/pages/dashboard/settings/certificates.tsx
@@ -5,7 +5,7 @@ import { appRouter } from "@/server/api/root";
import { validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
return (
diff --git a/apps/dokploy/pages/dashboard/settings/cluster.tsx b/apps/dokploy/pages/dashboard/settings/cluster.tsx
index 8d70f869..77ece29b 100644
--- a/apps/dokploy/pages/dashboard/settings/cluster.tsx
+++ b/apps/dokploy/pages/dashboard/settings/cluster.tsx
@@ -5,7 +5,7 @@ import { appRouter } from "@/server/api/root";
import { IS_CLOUD, validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
diff --git a/apps/dokploy/pages/dashboard/settings/destinations.tsx b/apps/dokploy/pages/dashboard/settings/destinations.tsx
index d9d17d53..8605a7c1 100644
--- a/apps/dokploy/pages/dashboard/settings/destinations.tsx
+++ b/apps/dokploy/pages/dashboard/settings/destinations.tsx
@@ -5,7 +5,7 @@ import { appRouter } from "@/server/api/root";
import { validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
diff --git a/apps/dokploy/pages/dashboard/settings/git-providers.tsx b/apps/dokploy/pages/dashboard/settings/git-providers.tsx
index 7bacde24..4187a0ef 100644
--- a/apps/dokploy/pages/dashboard/settings/git-providers.tsx
+++ b/apps/dokploy/pages/dashboard/settings/git-providers.tsx
@@ -5,7 +5,7 @@ import { appRouter } from "@/server/api/root";
import { validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
diff --git a/apps/dokploy/pages/dashboard/settings/index.tsx b/apps/dokploy/pages/dashboard/settings/index.tsx
index 2bfce2f2..713e5113 100644
--- a/apps/dokploy/pages/dashboard/settings/index.tsx
+++ b/apps/dokploy/pages/dashboard/settings/index.tsx
@@ -17,7 +17,6 @@ import {
FormField,
FormItem,
FormLabel,
- FormMessage,
} from "@/components/ui/form";
import { Switch } from "@/components/ui/switch";
import { appRouter } from "@/server/api/root";
@@ -27,7 +26,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { createServerSideHelpers } from "@trpc/react-query/server";
import { Settings } from "lucide-react";
import type { GetServerSidePropsContext } from "next";
-import React, { useEffect, type ReactElement } from "react";
+import { type ReactElement, useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import superjson from "superjson";
diff --git a/apps/dokploy/pages/dashboard/settings/notifications.tsx b/apps/dokploy/pages/dashboard/settings/notifications.tsx
index d0e0c65f..76566fdf 100644
--- a/apps/dokploy/pages/dashboard/settings/notifications.tsx
+++ b/apps/dokploy/pages/dashboard/settings/notifications.tsx
@@ -5,7 +5,7 @@ import { appRouter } from "@/server/api/root";
import { validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
diff --git a/apps/dokploy/pages/dashboard/settings/profile.tsx b/apps/dokploy/pages/dashboard/settings/profile.tsx
index 79a3366d..446e6c87 100644
--- a/apps/dokploy/pages/dashboard/settings/profile.tsx
+++ b/apps/dokploy/pages/dashboard/settings/profile.tsx
@@ -9,7 +9,7 @@ import { getLocale, serverSideTranslations } from "@/utils/i18n";
import { validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
diff --git a/apps/dokploy/pages/dashboard/settings/registry.tsx b/apps/dokploy/pages/dashboard/settings/registry.tsx
index 0a01e255..678e0da4 100644
--- a/apps/dokploy/pages/dashboard/settings/registry.tsx
+++ b/apps/dokploy/pages/dashboard/settings/registry.tsx
@@ -5,7 +5,7 @@ import { appRouter } from "@/server/api/root";
import { validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
diff --git a/apps/dokploy/pages/dashboard/settings/server.tsx b/apps/dokploy/pages/dashboard/settings/server.tsx
index dbd04957..4f88c794 100644
--- a/apps/dokploy/pages/dashboard/settings/server.tsx
+++ b/apps/dokploy/pages/dashboard/settings/server.tsx
@@ -1,4 +1,3 @@
-import { SetupMonitoring } from "@/components/dashboard/settings/servers/setup-monitoring";
import { WebDomain } from "@/components/dashboard/settings/web-domain";
import { WebServer } from "@/components/dashboard/settings/web-server";
import { DashboardLayout } from "@/components/layouts/dashboard-layout";
@@ -6,10 +5,8 @@ import { appRouter } from "@/server/api/root";
import { getLocale, serverSideTranslations } from "@/utils/i18n";
import { IS_CLOUD, validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server";
-import { LayoutDashboardIcon } from "lucide-react";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
-import { toast } from "sonner";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
diff --git a/apps/dokploy/pages/dashboard/settings/servers.tsx b/apps/dokploy/pages/dashboard/settings/servers.tsx
index 85ca5bb3..08d4ab69 100644
--- a/apps/dokploy/pages/dashboard/settings/servers.tsx
+++ b/apps/dokploy/pages/dashboard/settings/servers.tsx
@@ -6,7 +6,7 @@ import { getLocale, serverSideTranslations } from "@/utils/i18n";
import { validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
diff --git a/apps/dokploy/pages/dashboard/settings/ssh-keys.tsx b/apps/dokploy/pages/dashboard/settings/ssh-keys.tsx
index 8c5082e3..738c647d 100644
--- a/apps/dokploy/pages/dashboard/settings/ssh-keys.tsx
+++ b/apps/dokploy/pages/dashboard/settings/ssh-keys.tsx
@@ -5,7 +5,7 @@ import { appRouter } from "@/server/api/root";
import { validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
diff --git a/apps/dokploy/pages/dashboard/settings/users.tsx b/apps/dokploy/pages/dashboard/settings/users.tsx
index e9fb6560..ac535521 100644
--- a/apps/dokploy/pages/dashboard/settings/users.tsx
+++ b/apps/dokploy/pages/dashboard/settings/users.tsx
@@ -6,7 +6,7 @@ import { appRouter } from "@/server/api/root";
import { validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Page = () => {
diff --git a/apps/dokploy/pages/dashboard/traefik.tsx b/apps/dokploy/pages/dashboard/traefik.tsx
index 3153e80d..90359ccd 100644
--- a/apps/dokploy/pages/dashboard/traefik.tsx
+++ b/apps/dokploy/pages/dashboard/traefik.tsx
@@ -5,7 +5,7 @@ import { IS_CLOUD } from "@dokploy/server/constants";
import { validateRequest } from "@dokploy/server/lib/auth";
import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next";
-import React, { type ReactElement } from "react";
+import type { ReactElement } from "react";
import superjson from "superjson";
const Dashboard = () => {
diff --git a/apps/dokploy/pages/index.tsx b/apps/dokploy/pages/index.tsx
index 795d7a86..c910e78e 100644
--- a/apps/dokploy/pages/index.tsx
+++ b/apps/dokploy/pages/index.tsx
@@ -1,8 +1,7 @@
-import { Login2FA } from "@/components/auth/login-2fa";
import { OnboardingLayout } from "@/components/layouts/onboarding-layout";
import { AlertBlock } from "@/components/shared/alert-block";
import { Logo } from "@/components/shared/logo";
-import { Button, buttonVariants } from "@/components/ui/button";
+import { Button } from "@/components/ui/button";
import { CardContent, CardDescription } from "@/components/ui/card";
import {
Dialog,
@@ -10,12 +9,10 @@ import {
DialogDescription,
DialogHeader,
DialogTitle,
- DialogTrigger,
} from "@/components/ui/dialog";
import {
Form,
FormControl,
- FormDescription,
FormField,
FormItem,
FormLabel,
@@ -29,19 +26,14 @@ import {
} from "@/components/ui/input-otp";
import { Label } from "@/components/ui/label";
import { authClient } from "@/lib/auth-client";
-import { cn } from "@/lib/utils";
-import { api } from "@/utils/api";
-import { IS_CLOUD, auth, isAdminPresent } from "@dokploy/server";
+import { IS_CLOUD, isAdminPresent } from "@dokploy/server";
import { validateRequest } from "@dokploy/server/lib/auth";
import { zodResolver } from "@hookform/resolvers/zod";
-import base32 from "hi-base32";
import { REGEXP_ONLY_DIGITS } from "input-otp";
-import { AlertTriangle } from "lucide-react";
import type { GetServerSidePropsContext } from "next";
import Link from "next/link";
import { useRouter } from "next/router";
-import { TOTP } from "otpauth";
-import { type ReactElement, useEffect, useState } from "react";
+import { type ReactElement, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
diff --git a/apps/dokploy/pages/invitation.tsx b/apps/dokploy/pages/invitation.tsx
index c11cc822..91ca1d0d 100644
--- a/apps/dokploy/pages/invitation.tsx
+++ b/apps/dokploy/pages/invitation.tsx
@@ -2,12 +2,7 @@ import { OnboardingLayout } from "@/components/layouts/onboarding-layout";
import { AlertBlock } from "@/components/shared/alert-block";
import { Logo } from "@/components/shared/logo";
import { Button } from "@/components/ui/button";
-import {
- Card,
- CardContent,
- CardDescription,
- CardTitle,
-} from "@/components/ui/card";
+import { CardContent, CardDescription, CardTitle } from "@/components/ui/card";
import {
Form,
FormControl,
@@ -21,7 +16,7 @@ import { authClient } from "@/lib/auth-client";
import { api } from "@/utils/api";
import { IS_CLOUD, getUserByToken } from "@dokploy/server";
import { zodResolver } from "@hookform/resolvers/zod";
-import { AlertCircle, AlertTriangle } from "lucide-react";
+import { AlertTriangle } from "lucide-react";
import type { GetServerSidePropsContext } from "next";
import Link from "next/link";
import { useRouter } from "next/router";
diff --git a/apps/dokploy/pages/register.tsx b/apps/dokploy/pages/register.tsx
index e8fd15cf..701d8f5b 100644
--- a/apps/dokploy/pages/register.tsx
+++ b/apps/dokploy/pages/register.tsx
@@ -2,12 +2,7 @@ import { OnboardingLayout } from "@/components/layouts/onboarding-layout";
import { AlertBlock } from "@/components/shared/alert-block";
import { Logo } from "@/components/shared/logo";
import { Button } from "@/components/ui/button";
-import {
- Card,
- CardContent,
- CardDescription,
- CardTitle,
-} from "@/components/ui/card";
+import { CardContent, CardDescription, CardTitle } from "@/components/ui/card";
import {
Form,
FormControl,
@@ -27,7 +22,6 @@ import Link from "next/link";
import { useRouter } from "next/router";
import { type ReactElement, useEffect } from "react";
import { useForm } from "react-hook-form";
-import { toast } from "sonner";
import { z } from "zod";
const registerSchema = z
diff --git a/apps/dokploy/pages/send-reset-password.tsx b/apps/dokploy/pages/send-reset-password.tsx
index c4cd851c..ce73fbb8 100644
--- a/apps/dokploy/pages/send-reset-password.tsx
+++ b/apps/dokploy/pages/send-reset-password.tsx
@@ -3,12 +3,7 @@ import { OnboardingLayout } from "@/components/layouts/onboarding-layout";
import { AlertBlock } from "@/components/shared/alert-block";
import { Logo } from "@/components/shared/logo";
import { Button } from "@/components/ui/button";
-import {
- Card,
- CardContent,
- CardDescription,
- CardTitle,
-} from "@/components/ui/card";
+import { CardContent, CardDescription, CardTitle } from "@/components/ui/card";
import {
Form,
FormControl,
diff --git a/apps/dokploy/server/api/routers/admin.ts b/apps/dokploy/server/api/routers/admin.ts
index 293b7dfe..47bd9cd9 100644
--- a/apps/dokploy/server/api/routers/admin.ts
+++ b/apps/dokploy/server/api/routers/admin.ts
@@ -1,119 +1,14 @@
-import {
- apiAssignPermissions,
- apiCreateUserInvitation,
- apiFindOneToken,
- apiRemoveUser,
- apiUpdateWebServerMonitoring,
-} from "@/server/db/schema";
+import { apiUpdateWebServerMonitoring } from "@/server/db/schema";
import {
IS_CLOUD,
- createInvitation,
- findOrganizationById,
findUserById,
- getUserByToken,
- removeUserById,
setupWebMonitoring,
updateUser,
} from "@dokploy/server";
import { TRPCError } from "@trpc/server";
-import { z } from "zod";
-import {
- adminProcedure,
- createTRPCRouter,
- protectedProcedure,
- publicProcedure,
-} from "../trpc";
+import { adminProcedure, createTRPCRouter } from "../trpc";
export const adminRouter = createTRPCRouter({
- one: adminProcedure.query(async ({ ctx }) => {
- const { sshPrivateKey, ...rest } = await findUserById(ctx.user.id);
- return {
- haveSSH: !!sshPrivateKey,
- ...rest,
- };
- }),
- update: adminProcedure
- .input(
- z.object({
- enableDockerCleanup: z.boolean(),
- }),
- )
- .mutation(async ({ input, ctx }) => {
- if (ctx.user.rol === "member") {
- throw new TRPCError({
- code: "UNAUTHORIZED",
- message: "You are not allowed to update this admin",
- });
- }
- const user = await findUserById(ctx.user.ownerId);
- return updateUser(user.id, {});
- }),
- createUserInvitation: adminProcedure
- .input(apiCreateUserInvitation)
- .mutation(async ({ input, ctx }) => {
- try {
- await createInvitation(input, ctx.user.id);
- } catch (error) {
- throw new TRPCError({
- code: "BAD_REQUEST",
- message:
- "Error creating this user\ncheck if the email is not registered",
- cause: error,
- });
- }
- }),
- removeUser: adminProcedure
- .input(apiRemoveUser)
- .mutation(async ({ input, ctx }) => {
- try {
- const user = await findUserById(input.id);
-
- if (user.id !== ctx.user.ownerId) {
- throw new TRPCError({
- code: "UNAUTHORIZED",
- message: "You are not allowed to delete this user",
- });
- }
-
- return await removeUserById(input.id);
- } catch (error) {
- throw new TRPCError({
- code: "BAD_REQUEST",
- message: "Error deleting this user",
- cause: error,
- });
- }
- }),
- getUserByToken: publicProcedure
- .input(apiFindOneToken)
- .query(async ({ input }) => {
- return await getUserByToken(input.token);
- }),
- assignPermissions: adminProcedure
- .input(apiAssignPermissions)
- .mutation(async ({ input, ctx }) => {
- try {
- const user = await findUserById(input.id);
-
- const organization = await findOrganizationById(
- ctx.session?.activeOrganizationId || "",
- );
-
- if (organization?.ownerId !== ctx.user.ownerId) {
- throw new TRPCError({
- code: "UNAUTHORIZED",
- message: "You are not allowed to assign permissions",
- });
- }
-
- await updateUser(user.id, {
- ...input,
- });
- } catch (error) {
- throw error;
- }
- }),
-
setupMonitoring: adminProcedure
.input(apiUpdateWebServerMonitoring)
.mutation(async ({ input, ctx }) => {
@@ -163,129 +58,4 @@ export const adminRouter = createTRPCRouter({
throw error;
}
}),
- getMetricsToken: protectedProcedure.query(async ({ ctx }) => {
- const user = await findUserById(ctx.user.ownerId);
- return {
- serverIp: user.serverIp,
- enabledFeatures: user.enablePaidFeatures,
- metricsConfig: user?.metricsConfig,
- };
- }),
-
- getServerMetrics: protectedProcedure
- .input(
- z.object({
- url: z.string(),
- token: z.string(),
- dataPoints: z.string(),
- }),
- )
- .query(async ({ ctx, input }) => {
- try {
- const url = new URL(input.url);
- url.searchParams.append("limit", input.dataPoints);
- const response = await fetch(url.toString(), {
- headers: {
- Authorization: `Bearer ${input.token}`,
- },
- });
- if (!response.ok) {
- throw new Error(
- `Error ${response.status}: ${response.statusText}. Ensure the container is running and this service is included in the monitoring configuration.`,
- );
- }
-
- const data = await response.json();
- if (!Array.isArray(data) || data.length === 0) {
- throw new Error(
- [
- "No monitoring data available. This could be because:",
- "",
- "1. You don't have setup the monitoring service, you can do in web server section.",
- "2. If you already have setup the monitoring service, wait a few minutes and refresh the page.",
- ].join("\n"),
- );
- }
- return data as {
- cpu: string;
- cpuModel: string;
- cpuCores: number;
- cpuPhysicalCores: number;
- cpuSpeed: number;
- os: string;
- distro: string;
- kernel: string;
- arch: string;
- memUsed: string;
- memUsedGB: string;
- memTotal: string;
- uptime: number;
- diskUsed: string;
- totalDisk: string;
- networkIn: string;
- networkOut: string;
- timestamp: string;
- }[];
- } catch (error) {
- throw error;
- }
- }),
- getContainerMetrics: protectedProcedure
- .input(
- z.object({
- url: z.string(),
- token: z.string(),
- appName: z.string(),
- dataPoints: z.string(),
- }),
- )
- .query(async ({ ctx, input }) => {
- try {
- if (!input.appName) {
- throw new Error(
- [
- "No Application Selected:",
- "",
- "Make Sure to select an application to monitor.",
- ].join("\n"),
- );
- }
- const url = new URL(`${input.url}/metrics/containers`);
- url.searchParams.append("limit", input.dataPoints);
- url.searchParams.append("appName", input.appName);
- const response = await fetch(url.toString(), {
- headers: {
- Authorization: `Bearer ${input.token}`,
- },
- });
- if (!response.ok) {
- throw new Error(
- `Error ${response.status}: ${response.statusText}. Please verify that the application "${input.appName}" is running and this service is included in the monitoring configuration.`,
- );
- }
-
- const data = await response.json();
- if (!Array.isArray(data) || data.length === 0) {
- throw new Error(
- [
- `No monitoring data available for "${input.appName}". This could be because:`,
- "",
- "1. The container was recently started - wait a few minutes for data to be collected",
- "2. The container is not running - verify its status",
- "3. The service is not included in your monitoring configuration",
- ].join("\n"),
- );
- }
- return data as {
- containerId: string;
- containerName: string;
- containerImage: string;
- containerLabels: string;
- containerCommand: string;
- containerCreated: string;
- }[];
- } catch (error) {
- throw error;
- }
- }),
});
diff --git a/apps/dokploy/server/api/routers/application.ts b/apps/dokploy/server/api/routers/application.ts
index 269ac77b..e1629b4c 100644
--- a/apps/dokploy/server/api/routers/application.ts
+++ b/apps/dokploy/server/api/routers/application.ts
@@ -61,7 +61,12 @@ export const applicationRouter = createTRPCRouter({
.mutation(async ({ input, ctx }) => {
try {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.projectId, "create");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.projectId,
+ ctx.session.activeOrganizationId,
+ "create",
+ );
}
if (IS_CLOUD && !input.serverId) {
@@ -103,7 +108,12 @@ export const applicationRouter = createTRPCRouter({
.input(apiFindOneApplication)
.query(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.applicationId, "access");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.applicationId,
+ ctx.session.activeOrganizationId,
+ "access",
+ );
}
const application = await findApplicationById(input.applicationId);
if (
@@ -149,7 +159,12 @@ export const applicationRouter = createTRPCRouter({
.input(apiFindOneApplication)
.mutation(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.applicationId, "delete");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.applicationId,
+ ctx.session.activeOrganizationId,
+ "delete",
+ );
}
const application = await findApplicationById(input.applicationId);
@@ -186,7 +201,7 @@ export const applicationRouter = createTRPCRouter({
for (const operation of cleanupOperations) {
try {
await operation();
- } catch (error) {}
+ } catch (_) {}
}
return result[0];
@@ -642,7 +657,7 @@ export const applicationRouter = createTRPCRouter({
}),
readAppMonitoring: protectedProcedure
.input(apiFindMonitoringStats)
- .query(async ({ input, ctx }) => {
+ .query(async ({ input }) => {
if (IS_CLOUD) {
throw new TRPCError({
code: "UNAUTHORIZED",
diff --git a/apps/dokploy/server/api/routers/auth.ts b/apps/dokploy/server/api/routers/auth.ts
index 4cfbe71a..da3121b2 100644
--- a/apps/dokploy/server/api/routers/auth.ts
+++ b/apps/dokploy/server/api/routers/auth.ts
@@ -12,14 +12,11 @@ import {
import { WEBSITE_URL } from "@/server/utils/stripe";
import {
IS_CLOUD,
- findAuthById,
findUserById,
- generate2FASecret,
getUserByToken,
sendDiscordNotification,
sendEmailNotification,
validateRequest,
- verify2FA,
} from "@dokploy/server";
import { TRPCError } from "@trpc/server";
import * as bcrypt from "bcrypt";
@@ -273,42 +270,6 @@ export const authRouter = createTRPCRouter({
const user = await findUserById(input.userId);
return user;
}),
-
- generate2FASecret: protectedProcedure.query(async ({ ctx }) => {
- return await generate2FASecret(ctx.user.id);
- }),
- verify2FASetup: protectedProcedure.mutation(async ({ ctx, input }) => {
- // const auth = await findAuthById(ctx.user.authId);
- // await verify2FA(auth, input.secret, input.pin);
- // await updateAuthById(auth.id, {
- // is2FAEnabled: true,
- // secret: input.secret,
- // });
- // return auth;
- }),
-
- verifyLogin2FA: publicProcedure.mutation(async ({ ctx, input }) => {
- // const auth = await findAuthById(input.id);
-
- // await verify2FA(auth, auth.secret || "", input.pin);
-
- // const session = await lucia.createSession(auth.id, {});
-
- // ctx.res.appendHeader(
- // "Set-Cookie",
- // lucia.createSessionCookie(session.id).serialize(),
- // );
-
- return true;
- }),
- disable2FA: protectedProcedure.mutation(async ({ ctx }) => {
- // const auth = await findAuthById(ctx.user.authId);
- // await updateAuthById(auth.id, {
- // is2FAEnabled: false,
- // secret: null,
- // });
- // return auth;
- }),
sendResetPasswordEmail: publicProcedure
.input(
z.object({
diff --git a/apps/dokploy/server/api/routers/backup.ts b/apps/dokploy/server/api/routers/backup.ts
index 0b8d7ab1..8a7a5f22 100644
--- a/apps/dokploy/server/api/routers/backup.ts
+++ b/apps/dokploy/server/api/routers/backup.ts
@@ -30,7 +30,7 @@ import { TRPCError } from "@trpc/server";
export const backupRouter = createTRPCRouter({
create: protectedProcedure
.input(apiCreateBackup)
- .mutation(async ({ input, ctx }) => {
+ .mutation(async ({ input }) => {
try {
const newBackup = await createBackup(input);
@@ -74,16 +74,14 @@ export const backupRouter = createTRPCRouter({
});
}
}),
- one: protectedProcedure
- .input(apiFindOneBackup)
- .query(async ({ input, ctx }) => {
- const backup = await findBackupById(input.backupId);
+ one: protectedProcedure.input(apiFindOneBackup).query(async ({ input }) => {
+ const backup = await findBackupById(input.backupId);
- return backup;
- }),
+ return backup;
+ }),
update: protectedProcedure
.input(apiUpdateBackup)
- .mutation(async ({ input, ctx }) => {
+ .mutation(async ({ input }) => {
try {
await updateBackupById(input.backupId, input);
const backup = await findBackupById(input.backupId);
@@ -111,15 +109,17 @@ export const backupRouter = createTRPCRouter({
}
}
} catch (error) {
+ const message =
+ error instanceof Error ? error.message : "Error updating this Backup";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error updating this Backup",
+ message,
});
}
}),
remove: protectedProcedure
.input(apiRemoveBackup)
- .mutation(async ({ input, ctx }) => {
+ .mutation(async ({ input }) => {
try {
const value = await removeBackupById(input.backupId);
if (IS_CLOUD && value) {
@@ -133,10 +133,11 @@ export const backupRouter = createTRPCRouter({
}
return value;
} catch (error) {
+ const message =
+ error instanceof Error ? error.message : "Error deleting this Backup";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error deleting this Backup",
- cause: error,
+ message,
});
}
}),
@@ -149,11 +150,13 @@ export const backupRouter = createTRPCRouter({
await runPostgresBackup(postgres, backup);
return true;
} catch (error) {
- console.log(error);
+ const message =
+ error instanceof Error
+ ? error.message
+ : "Error running manual Postgres backup ";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error running manual Postgres backup ",
- cause: error,
+ message,
});
}
}),
diff --git a/apps/dokploy/server/api/routers/cluster.ts b/apps/dokploy/server/api/routers/cluster.ts
index 7ded632c..0d840757 100644
--- a/apps/dokploy/server/api/routers/cluster.ts
+++ b/apps/dokploy/server/api/routers/cluster.ts
@@ -40,7 +40,7 @@ export const clusterRouter = createTRPCRouter({
});
}
}),
- addWorker: protectedProcedure.query(async ({ input }) => {
+ addWorker: protectedProcedure.query(async () => {
if (IS_CLOUD) {
return {
command: "",
@@ -57,7 +57,7 @@ export const clusterRouter = createTRPCRouter({
version: docker_version.Version,
};
}),
- addManager: protectedProcedure.query(async ({ input }) => {
+ addManager: protectedProcedure.query(async () => {
if (IS_CLOUD) {
return {
command: "",
diff --git a/apps/dokploy/server/api/routers/compose.ts b/apps/dokploy/server/api/routers/compose.ts
index 258a03d4..bae926d0 100644
--- a/apps/dokploy/server/api/routers/compose.ts
+++ b/apps/dokploy/server/api/routers/compose.ts
@@ -61,7 +61,12 @@ export const composeRouter = createTRPCRouter({
.mutation(async ({ ctx, input }) => {
try {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.projectId, "create");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.projectId,
+ ctx.session.activeOrganizationId,
+ "create",
+ );
}
if (IS_CLOUD && !input.serverId) {
@@ -97,7 +102,12 @@ export const composeRouter = createTRPCRouter({
.input(apiFindCompose)
.query(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.composeId, "access");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.composeId,
+ ctx.session.activeOrganizationId,
+ "access",
+ );
}
const compose = await findComposeById(input.composeId);
@@ -126,7 +136,12 @@ export const composeRouter = createTRPCRouter({
.input(apiDeleteCompose)
.mutation(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.composeId, "delete");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.composeId,
+ ctx.session.activeOrganizationId,
+ "delete",
+ );
}
const composeResult = await findComposeById(input.composeId);
@@ -155,7 +170,7 @@ export const composeRouter = createTRPCRouter({
for (const operation of cleanupOperations) {
try {
await operation();
- } catch (error) {}
+ } catch (_) {}
}
return result[0];
@@ -385,7 +400,12 @@ export const composeRouter = createTRPCRouter({
.input(apiCreateComposeByTemplate)
.mutation(async ({ ctx, input }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.projectId, "create");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.projectId,
+ ctx.session.activeOrganizationId,
+ "create",
+ );
}
if (IS_CLOUD && !input.serverId) {
@@ -476,7 +496,7 @@ export const composeRouter = createTRPCRouter({
return templatesData;
}),
- getTags: protectedProcedure.query(async ({ input }) => {
+ getTags: protectedProcedure.query(async () => {
const allTags = templates.flatMap((template) => template.tags);
const uniqueTags = _.uniq(allTags);
return uniqueTags;
diff --git a/apps/dokploy/server/api/routers/git-provider.ts b/apps/dokploy/server/api/routers/git-provider.ts
index 39194ed3..ed37869d 100644
--- a/apps/dokploy/server/api/routers/git-provider.ts
+++ b/apps/dokploy/server/api/routers/git-provider.ts
@@ -31,9 +31,13 @@ export const gitProviderRouter = createTRPCRouter({
}
return await removeGitProvider(input.gitProviderId);
} catch (error) {
+ const message =
+ error instanceof Error
+ ? error.message
+ : "Error deleting this Git provider";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error deleting this Git provider",
+ message,
});
}
}),
diff --git a/apps/dokploy/server/api/routers/mariadb.ts b/apps/dokploy/server/api/routers/mariadb.ts
index 5735620e..be0ffd39 100644
--- a/apps/dokploy/server/api/routers/mariadb.ts
+++ b/apps/dokploy/server/api/routers/mariadb.ts
@@ -20,7 +20,6 @@ import {
findBackupsByDbId,
findMariadbById,
findProjectById,
- findServerById,
removeMariadbById,
removeService,
startService,
@@ -38,7 +37,12 @@ export const mariadbRouter = createTRPCRouter({
.mutation(async ({ input, ctx }) => {
try {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.projectId, "create");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.projectId,
+ ctx.session.activeOrganizationId,
+ "create",
+ );
}
if (IS_CLOUD && !input.serverId) {
@@ -84,7 +88,12 @@ export const mariadbRouter = createTRPCRouter({
.input(apiFindOneMariaDB)
.query(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.mariadbId, "access");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.mariadbId,
+ ctx.session.activeOrganizationId,
+ "access",
+ );
}
const mariadb = await findMariadbById(input.mariadbId);
if (mariadb.project.organizationId !== ctx.session.activeOrganizationId) {
@@ -206,7 +215,12 @@ export const mariadbRouter = createTRPCRouter({
.input(apiFindOneMariaDB)
.mutation(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.mariadbId, "delete");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.mariadbId,
+ ctx.session.activeOrganizationId,
+ "delete",
+ );
}
const mongo = await findMariadbById(input.mariadbId);
@@ -227,7 +241,7 @@ export const mariadbRouter = createTRPCRouter({
for (const operation of cleanupOperations) {
try {
await operation();
- } catch (error) {}
+ } catch (_) {}
}
return mongo;
diff --git a/apps/dokploy/server/api/routers/mongo.ts b/apps/dokploy/server/api/routers/mongo.ts
index 7f8716a5..1c3ba6bb 100644
--- a/apps/dokploy/server/api/routers/mongo.ts
+++ b/apps/dokploy/server/api/routers/mongo.ts
@@ -37,7 +37,12 @@ export const mongoRouter = createTRPCRouter({
.mutation(async ({ input, ctx }) => {
try {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.projectId, "create");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.projectId,
+ ctx.session.activeOrganizationId,
+ "create",
+ );
}
if (IS_CLOUD && !input.serverId) {
@@ -87,7 +92,12 @@ export const mongoRouter = createTRPCRouter({
.input(apiFindOneMongo)
.query(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.mongoId, "access");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.mongoId,
+ ctx.session.activeOrganizationId,
+ "access",
+ );
}
const mongo = await findMongoById(input.mongoId);
@@ -247,7 +257,12 @@ export const mongoRouter = createTRPCRouter({
.input(apiFindOneMongo)
.mutation(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.mongoId, "delete");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.mongoId,
+ ctx.session.activeOrganizationId,
+ "delete",
+ );
}
const mongo = await findMongoById(input.mongoId);
@@ -269,7 +284,7 @@ export const mongoRouter = createTRPCRouter({
for (const operation of cleanupOperations) {
try {
await operation();
- } catch (error) {}
+ } catch (_) {}
}
return mongo;
diff --git a/apps/dokploy/server/api/routers/mysql.ts b/apps/dokploy/server/api/routers/mysql.ts
index 96ea4846..594403f2 100644
--- a/apps/dokploy/server/api/routers/mysql.ts
+++ b/apps/dokploy/server/api/routers/mysql.ts
@@ -39,7 +39,12 @@ export const mysqlRouter = createTRPCRouter({
.mutation(async ({ input, ctx }) => {
try {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.projectId, "create");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.projectId,
+ ctx.session.activeOrganizationId,
+ "create",
+ );
}
if (IS_CLOUD && !input.serverId) {
@@ -90,7 +95,12 @@ export const mysqlRouter = createTRPCRouter({
.input(apiFindOneMySql)
.query(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.mysqlId, "access");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.mysqlId,
+ ctx.session.activeOrganizationId,
+ "access",
+ );
}
const mysql = await findMySqlById(input.mysqlId);
if (mysql.project.organizationId !== ctx.session.activeOrganizationId) {
@@ -245,7 +255,12 @@ export const mysqlRouter = createTRPCRouter({
.input(apiFindOneMySql)
.mutation(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.mysqlId, "delete");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.mysqlId,
+ ctx.session.activeOrganizationId,
+ "delete",
+ );
}
const mongo = await findMySqlById(input.mysqlId);
if (mongo.project.organizationId !== ctx.session.activeOrganizationId) {
@@ -265,7 +280,7 @@ export const mysqlRouter = createTRPCRouter({
for (const operation of cleanupOperations) {
try {
await operation();
- } catch (error) {}
+ } catch (_) {}
}
return mongo;
diff --git a/apps/dokploy/server/api/routers/notification.ts b/apps/dokploy/server/api/routers/notification.ts
index 6a893d36..48ef50b9 100644
--- a/apps/dokploy/server/api/routers/notification.ts
+++ b/apps/dokploy/server/api/routers/notification.ts
@@ -297,9 +297,13 @@ export const notificationRouter = createTRPCRouter({
}
return await removeNotificationById(input.notificationId);
} catch (error) {
+ const message =
+ error instanceof Error
+ ? error.message
+ : "Error deleting this notification";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error deleting this notification",
+ message,
});
}
}),
diff --git a/apps/dokploy/server/api/routers/organization.ts b/apps/dokploy/server/api/routers/organization.ts
index ad77b85c..b98fc26c 100644
--- a/apps/dokploy/server/api/routers/organization.ts
+++ b/apps/dokploy/server/api/routers/organization.ts
@@ -71,7 +71,7 @@ export const organizationRouter = createTRPCRouter({
organizationId: z.string(),
}),
)
- .query(async ({ ctx, input }) => {
+ .query(async ({ input }) => {
return await db.query.organization.findFirst({
where: eq(organization.id, input.organizationId),
});
@@ -140,12 +140,4 @@ export const organizationRouter = createTRPCRouter({
orderBy: [desc(invitation.status), desc(invitation.expiresAt)],
});
}),
- acceptInvitation: adminProcedure
- .input(z.object({ invitationId: z.string() }))
- .mutation(async ({ ctx, input }) => {
- // const result = await auth.api.acceptInvitation({
- // invitationId: input.invitationId,
- // });
- // return result;
- }),
});
diff --git a/apps/dokploy/server/api/routers/port.ts b/apps/dokploy/server/api/routers/port.ts
index bfbc9863..923fea57 100644
--- a/apps/dokploy/server/api/routers/port.ts
+++ b/apps/dokploy/server/api/routers/port.ts
@@ -44,9 +44,11 @@ export const portRouter = createTRPCRouter({
try {
return removePortById(input.portId);
} catch (error) {
+ const message =
+ error instanceof Error ? error.message : "Error input: Deleting port";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error input: Deleting port",
+ message,
});
}
}),
@@ -56,9 +58,11 @@ export const portRouter = createTRPCRouter({
try {
return updatePortById(input.portId, input);
} catch (error) {
+ const message =
+ error instanceof Error ? error.message : "Error updating the port";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error updating the port",
+ message,
});
}
}),
diff --git a/apps/dokploy/server/api/routers/postgres.ts b/apps/dokploy/server/api/routers/postgres.ts
index aa3a0459..cf3221b4 100644
--- a/apps/dokploy/server/api/routers/postgres.ts
+++ b/apps/dokploy/server/api/routers/postgres.ts
@@ -1,9 +1,4 @@
-import { EventEmitter } from "node:events";
-import {
- createTRPCRouter,
- protectedProcedure,
- publicProcedure,
-} from "@/server/api/trpc";
+import { createTRPCRouter, protectedProcedure } from "@/server/api/trpc";
import {
apiChangePostgresStatus,
apiCreatePostgres,
@@ -35,9 +30,6 @@ import {
} from "@dokploy/server";
import { TRPCError } from "@trpc/server";
import { observable } from "@trpc/server/observable";
-import { z } from "zod";
-
-const ee = new EventEmitter();
export const postgresRouter = createTRPCRouter({
create: protectedProcedure
@@ -45,7 +37,12 @@ export const postgresRouter = createTRPCRouter({
.mutation(async ({ input, ctx }) => {
try {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.projectId, "create");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.projectId,
+ ctx.session.activeOrganizationId,
+ "create",
+ );
}
if (IS_CLOUD && !input.serverId) {
@@ -95,7 +92,12 @@ export const postgresRouter = createTRPCRouter({
.input(apiFindOnePostgres)
.query(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.postgresId, "access");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.postgresId,
+ ctx.session.activeOrganizationId,
+ "access",
+ );
}
const postgres = await findPostgresById(input.postgresId);
@@ -238,7 +240,12 @@ export const postgresRouter = createTRPCRouter({
.input(apiFindOnePostgres)
.mutation(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.postgresId, "delete");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.postgresId,
+ ctx.session.activeOrganizationId,
+ "delete",
+ );
}
const postgres = await findPostgresById(input.postgresId);
diff --git a/apps/dokploy/server/api/routers/project.ts b/apps/dokploy/server/api/routers/project.ts
index 68b068bc..438a3f07 100644
--- a/apps/dokploy/server/api/routers/project.ts
+++ b/apps/dokploy/server/api/routers/project.ts
@@ -8,7 +8,6 @@ import {
applications,
compose,
mariadb,
- member,
mongo,
mysql,
postgres,
@@ -16,22 +15,20 @@ import {
redis,
} from "@/server/db/schema";
-import { TRPCError } from "@trpc/server";
-import { and, desc, eq, sql } from "drizzle-orm";
-import type { AnyPgColumn } from "drizzle-orm/pg-core";
-
import {
IS_CLOUD,
addNewProject,
checkProjectAccess,
createProject,
deleteProject,
+ findMemberById,
findProjectById,
- findUserByAuthId,
findUserById,
updateProjectById,
- findMemberById,
} from "@dokploy/server";
+import { TRPCError } from "@trpc/server";
+import { and, desc, eq, sql } from "drizzle-orm";
+import type { AnyPgColumn } from "drizzle-orm/pg-core";
export const projectRouter = createTRPCRouter({
create: protectedProcedure
.input(apiCreateProject)
diff --git a/apps/dokploy/server/api/routers/redis.ts b/apps/dokploy/server/api/routers/redis.ts
index 6d5a84d5..a80660bf 100644
--- a/apps/dokploy/server/api/routers/redis.ts
+++ b/apps/dokploy/server/api/routers/redis.ts
@@ -37,7 +37,12 @@ export const redisRouter = createTRPCRouter({
.mutation(async ({ input, ctx }) => {
try {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.projectId, "create");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.projectId,
+ ctx.session.activeOrganizationId,
+ "create",
+ );
}
if (IS_CLOUD && !input.serverId) {
@@ -80,7 +85,12 @@ export const redisRouter = createTRPCRouter({
.input(apiFindOneRedis)
.query(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.redisId, "access");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.redisId,
+ ctx.session.activeOrganizationId,
+ "access",
+ );
}
const redis = await findRedisById(input.redisId);
@@ -237,7 +247,12 @@ export const redisRouter = createTRPCRouter({
.input(apiFindOneRedis)
.mutation(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- await checkServiceAccess(ctx.user.id, input.redisId, "delete");
+ await checkServiceAccess(
+ ctx.user.id,
+ input.redisId,
+ ctx.session.activeOrganizationId,
+ "delete",
+ );
}
const redis = await findRedisById(input.redisId);
@@ -256,7 +271,7 @@ export const redisRouter = createTRPCRouter({
for (const operation of cleanupOperations) {
try {
await operation();
- } catch (error) {}
+ } catch (_) {}
}
return redis;
diff --git a/apps/dokploy/server/api/routers/registry.ts b/apps/dokploy/server/api/routers/registry.ts
index 62c8a9b6..a9a6be89 100644
--- a/apps/dokploy/server/api/routers/registry.ts
+++ b/apps/dokploy/server/api/routers/registry.ts
@@ -1,3 +1,4 @@
+import { db } from "@/server/db";
import {
apiCreateRegistry,
apiFindOneRegistry,
@@ -18,7 +19,6 @@ import {
import { TRPCError } from "@trpc/server";
import { eq } from "drizzle-orm";
import { adminProcedure, createTRPCRouter, protectedProcedure } from "../trpc";
-import { db } from "@/server/db";
export const registryRouter = createTRPCRouter({
create: adminProcedure
.input(apiCreateRegistry)
diff --git a/apps/dokploy/server/api/routers/server.ts b/apps/dokploy/server/api/routers/server.ts
index 1d7fd40e..3215226e 100644
--- a/apps/dokploy/server/api/routers/server.ts
+++ b/apps/dokploy/server/api/routers/server.ts
@@ -79,7 +79,7 @@ export const serverRouter = createTRPCRouter({
}),
getDefaultCommand: protectedProcedure
.input(apiFindOneServer)
- .query(async ({ input, ctx }) => {
+ .query(async () => {
return defaultCommand();
}),
all: protectedProcedure.query(async ({ ctx }) => {
@@ -358,7 +358,7 @@ export const serverRouter = createTRPCRouter({
throw error;
}
}),
- publicIp: protectedProcedure.query(async ({ ctx }) => {
+ publicIp: protectedProcedure.query(async () => {
if (IS_CLOUD) {
return "";
}
diff --git a/apps/dokploy/server/api/routers/settings.ts b/apps/dokploy/server/api/routers/settings.ts
index ee69da22..d2455fdb 100644
--- a/apps/dokploy/server/api/routers/settings.ts
+++ b/apps/dokploy/server/api/routers/settings.ts
@@ -377,7 +377,10 @@ export const settingsRouter = createTRPCRouter({
.query(async ({ ctx, input }) => {
try {
if (ctx.user.rol === "member") {
- const canAccess = await canAccessToTraefikFiles(ctx.user.id);
+ const canAccess = await canAccessToTraefikFiles(
+ ctx.user.id,
+ ctx.session.activeOrganizationId,
+ );
if (!canAccess) {
throw new TRPCError({ code: "UNAUTHORIZED" });
@@ -395,7 +398,10 @@ export const settingsRouter = createTRPCRouter({
.input(apiModifyTraefikConfig)
.mutation(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- const canAccess = await canAccessToTraefikFiles(ctx.user.id);
+ const canAccess = await canAccessToTraefikFiles(
+ ctx.user.id,
+ ctx.session.activeOrganizationId,
+ );
if (!canAccess) {
throw new TRPCError({ code: "UNAUTHORIZED" });
@@ -413,7 +419,10 @@ export const settingsRouter = createTRPCRouter({
.input(apiReadTraefikConfig)
.query(async ({ input, ctx }) => {
if (ctx.user.rol === "member") {
- const canAccess = await canAccessToTraefikFiles(ctx.user.id);
+ const canAccess = await canAccessToTraefikFiles(
+ ctx.user.id,
+ ctx.session.activeOrganizationId,
+ );
if (!canAccess) {
throw new TRPCError({ code: "UNAUTHORIZED" });
@@ -708,7 +717,12 @@ export const settingsRouter = createTRPCRouter({
try {
return await checkGPUStatus(input.serverId || "");
} catch (error) {
- throw new Error("Failed to check GPU status");
+ const message =
+ error instanceof Error ? error.message : "Failed to check GPU status";
+ throw new TRPCError({
+ code: "BAD_REQUEST",
+ message,
+ });
}
}),
updateTraefikPorts: adminProcedure
diff --git a/apps/dokploy/server/api/routers/ssh-key.ts b/apps/dokploy/server/api/routers/ssh-key.ts
index d55a2379..fe321de4 100644
--- a/apps/dokploy/server/api/routers/ssh-key.ts
+++ b/apps/dokploy/server/api/routers/ssh-key.ts
@@ -9,7 +9,6 @@ import {
sshKeys,
} from "@/server/db/schema";
import {
- IS_CLOUD,
createSshKey,
findSSHKeyById,
generateSSHKey,
diff --git a/apps/dokploy/server/api/routers/stripe.ts b/apps/dokploy/server/api/routers/stripe.ts
index 540820f2..0e0e07a4 100644
--- a/apps/dokploy/server/api/routers/stripe.ts
+++ b/apps/dokploy/server/api/routers/stripe.ts
@@ -87,36 +87,34 @@ export const stripeRouter = createTRPCRouter({
return { sessionId: session.id };
}),
- createCustomerPortalSession: adminProcedure.mutation(
- async ({ ctx, input }) => {
- const user = await findUserById(ctx.user.ownerId);
+ createCustomerPortalSession: adminProcedure.mutation(async ({ ctx }) => {
+ const user = await findUserById(ctx.user.ownerId);
- if (!user.stripeCustomerId) {
- throw new TRPCError({
- code: "BAD_REQUEST",
- message: "Stripe Customer ID not found",
- });
- }
- const stripeCustomerId = user.stripeCustomerId;
+ if (!user.stripeCustomerId) {
+ throw new TRPCError({
+ code: "BAD_REQUEST",
+ message: "Stripe Customer ID not found",
+ });
+ }
+ const stripeCustomerId = user.stripeCustomerId;
- const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
- apiVersion: "2024-09-30.acacia",
+ const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
+ apiVersion: "2024-09-30.acacia",
+ });
+
+ try {
+ const session = await stripe.billingPortal.sessions.create({
+ customer: stripeCustomerId,
+ return_url: `${WEBSITE_URL}/dashboard/settings/billing`,
});
- try {
- const session = await stripe.billingPortal.sessions.create({
- customer: stripeCustomerId,
- return_url: `${WEBSITE_URL}/dashboard/settings/billing`,
- });
-
- return { url: session.url };
- } catch (error) {
- return {
- url: "",
- };
- }
- },
- ),
+ return { url: session.url };
+ } catch (_) {
+ return {
+ url: "",
+ };
+ }
+ }),
canCreateMoreServers: adminProcedure.query(async ({ ctx }) => {
const user = await findUserById(ctx.user.ownerId);
diff --git a/apps/dokploy/server/api/routers/user.ts b/apps/dokploy/server/api/routers/user.ts
index 5c4eb56d..43cffd9e 100644
--- a/apps/dokploy/server/api/routers/user.ts
+++ b/apps/dokploy/server/api/routers/user.ts
@@ -1,17 +1,13 @@
-import { apiFindOneUser, apiFindOneUserByAuth } from "@/server/db/schema";
import {
IS_CLOUD,
findOrganizationById,
- findUserByAuthId,
findUserById,
getUserByToken,
removeUserById,
updateUser,
- verify2FA,
} from "@dokploy/server";
import { db } from "@dokploy/server/db";
import {
- account,
apiAssignPermissions,
apiFindOneToken,
apiUpdateUser,
@@ -19,7 +15,7 @@ import {
member,
} from "@dokploy/server/db/schema";
import { TRPCError } from "@trpc/server";
-import { and, asc, desc, eq, gt } from "drizzle-orm";
+import { and, asc, eq, gt } from "drizzle-orm";
import { z } from "zod";
import {
adminProcedure,
@@ -93,7 +89,7 @@ export const userRouter = createTRPCRouter({
userId: z.string(),
}),
)
- .mutation(async ({ input, ctx }) => {
+ .mutation(async ({ input }) => {
if (IS_CLOUD) {
return true;
}
@@ -103,8 +99,6 @@ export const userRouter = createTRPCRouter({
.input(apiAssignPermissions)
.mutation(async ({ input, ctx }) => {
try {
- const user = await findUserById(input.id);
-
const organization = await findOrganizationById(
ctx.session?.activeOrganizationId || "",
);
diff --git a/apps/dokploy/server/db/seed.ts b/apps/dokploy/server/db/seed.ts
index b7935079..3216a44b 100644
--- a/apps/dokploy/server/db/seed.ts
+++ b/apps/dokploy/server/db/seed.ts
@@ -1,7 +1,6 @@
import bc from "bcrypt";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
-import { users } from "./schema";
const connectionString = process.env.DATABASE_URL!;
diff --git a/apps/dokploy/server/utils/backup.ts b/apps/dokploy/server/utils/backup.ts
index 2f141971..4fc9db93 100644
--- a/apps/dokploy/server/utils/backup.ts
+++ b/apps/dokploy/server/utils/backup.ts
@@ -2,7 +2,6 @@ import {
type BackupScheduleList,
IS_CLOUD,
removeScheduleBackup,
- scheduleBackup,
} from "@dokploy/server/index";
type QueueJob =
diff --git a/apps/dokploy/templates/excalidraw/index.ts b/apps/dokploy/templates/excalidraw/index.ts
index 13a43c44..7f73f395 100644
--- a/apps/dokploy/templates/excalidraw/index.ts
+++ b/apps/dokploy/templates/excalidraw/index.ts
@@ -2,7 +2,6 @@ import {
type DomainSchema,
type Schema,
type Template,
- generateHash,
generateRandomDomain,
} from "../utils";
diff --git a/apps/dokploy/templates/ghost/index.ts b/apps/dokploy/templates/ghost/index.ts
index 1a88c362..052b7c6b 100644
--- a/apps/dokploy/templates/ghost/index.ts
+++ b/apps/dokploy/templates/ghost/index.ts
@@ -2,7 +2,6 @@ import {
type DomainSchema,
type Schema,
type Template,
- generateHash,
generateRandomDomain,
} from "../utils";
diff --git a/apps/dokploy/templates/penpot/index.ts b/apps/dokploy/templates/penpot/index.ts
index f657c698..a3e90e8a 100644
--- a/apps/dokploy/templates/penpot/index.ts
+++ b/apps/dokploy/templates/penpot/index.ts
@@ -2,8 +2,6 @@ import {
type DomainSchema,
type Schema,
type Template,
- generateBase64,
- generatePassword,
generateRandomDomain,
} from "../utils";
diff --git a/apps/dokploy/templates/photoprism/index.ts b/apps/dokploy/templates/photoprism/index.ts
index d20ac29c..4a103a62 100644
--- a/apps/dokploy/templates/photoprism/index.ts
+++ b/apps/dokploy/templates/photoprism/index.ts
@@ -2,7 +2,6 @@ import {
type DomainSchema,
type Schema,
type Template,
- generateHash,
generatePassword,
generateRandomDomain,
} from "../utils";
diff --git a/apps/dokploy/templates/triggerdotdev/index.ts b/apps/dokploy/templates/triggerdotdev/index.ts
index 7b894acb..c11c708b 100644
--- a/apps/dokploy/templates/triggerdotdev/index.ts
+++ b/apps/dokploy/templates/triggerdotdev/index.ts
@@ -1,4 +1,3 @@
-import { Secrets } from "@/components/ui/secrets";
import {
type DomainSchema,
type Schema,
diff --git a/apps/dokploy/templates/unsend/index.ts b/apps/dokploy/templates/unsend/index.ts
index 1c4c9c71..dcc80f66 100644
--- a/apps/dokploy/templates/unsend/index.ts
+++ b/apps/dokploy/templates/unsend/index.ts
@@ -3,7 +3,6 @@ import {
type Schema,
type Template,
generateBase64,
- generateHash,
generateRandomDomain,
} from "../utils";
diff --git a/biome.json b/biome.json
index f5a6c232..cf677ec4 100644
--- a/biome.json
+++ b/biome.json
@@ -24,7 +24,10 @@
},
"correctness": {
"useExhaustiveDependencies": "off",
- "noUnsafeOptionalChaining": "off"
+ "noUnsafeOptionalChaining": "off",
+ "noUnusedImports": "error",
+ "noUnusedFunctionParameters": "error",
+ "noUnusedVariables": "error"
},
"style": {
"noNonNullAssertion": "off"
diff --git a/packages/server/auth-schema.ts b/packages/server/auth-schema.ts
index de0f4bbb..a7be9b05 100644
--- a/packages/server/auth-schema.ts
+++ b/packages/server/auth-schema.ts
@@ -1,10 +1,4 @@
-import {
- pgTable,
- text,
- integer,
- timestamp,
- boolean,
-} from "drizzle-orm/pg-core";
+import { boolean, pgTable, text, timestamp } from "drizzle-orm/pg-core";
export const users_temp = pgTable("users_temp", {
id: text("id").primaryKey(),
diff --git a/packages/server/src/db/schema/user.ts b/packages/server/src/db/schema/user.ts
index 67a24741..2f3761fe 100644
--- a/packages/server/src/db/schema/user.ts
+++ b/packages/server/src/db/schema/user.ts
@@ -1,4 +1,4 @@
-import { relations, sql } from "drizzle-orm";
+import { relations } from "drizzle-orm";
import {
boolean,
integer,
diff --git a/packages/server/src/emails/emails/build-failed.tsx b/packages/server/src/emails/emails/build-failed.tsx
index b3d99919..79e7b718 100644
--- a/packages/server/src/emails/emails/build-failed.tsx
+++ b/packages/server/src/emails/emails/build-failed.tsx
@@ -12,7 +12,6 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import * as React from "react";
export type TemplateProps = {
projectName: string;
diff --git a/packages/server/src/emails/emails/build-success.tsx b/packages/server/src/emails/emails/build-success.tsx
index eadf7c44..d9e500ab 100644
--- a/packages/server/src/emails/emails/build-success.tsx
+++ b/packages/server/src/emails/emails/build-success.tsx
@@ -12,7 +12,6 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import * as React from "react";
export type TemplateProps = {
projectName: string;
diff --git a/packages/server/src/emails/emails/database-backup.tsx b/packages/server/src/emails/emails/database-backup.tsx
index 2bdf944c..754d4d98 100644
--- a/packages/server/src/emails/emails/database-backup.tsx
+++ b/packages/server/src/emails/emails/database-backup.tsx
@@ -10,7 +10,6 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import * as React from "react";
export type TemplateProps = {
projectName: string;
diff --git a/packages/server/src/emails/emails/docker-cleanup.tsx b/packages/server/src/emails/emails/docker-cleanup.tsx
index 05d93ed7..985406ae 100644
--- a/packages/server/src/emails/emails/docker-cleanup.tsx
+++ b/packages/server/src/emails/emails/docker-cleanup.tsx
@@ -1,6 +1,5 @@
import {
Body,
- Button,
Container,
Head,
Heading,
@@ -11,7 +10,6 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import * as React from "react";
export type TemplateProps = {
message: string;
diff --git a/packages/server/src/emails/emails/dokploy-restart.tsx b/packages/server/src/emails/emails/dokploy-restart.tsx
index 1ad3d600..db4edd69 100644
--- a/packages/server/src/emails/emails/dokploy-restart.tsx
+++ b/packages/server/src/emails/emails/dokploy-restart.tsx
@@ -10,7 +10,6 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import * as React from "react";
export type TemplateProps = {
date: string;
diff --git a/packages/server/src/emails/emails/notion-magic-link.tsx b/packages/server/src/emails/emails/notion-magic-link.tsx
index b2286c34..f4071ce0 100644
--- a/packages/server/src/emails/emails/notion-magic-link.tsx
+++ b/packages/server/src/emails/emails/notion-magic-link.tsx
@@ -9,7 +9,6 @@ import {
Preview,
Text,
} from "@react-email/components";
-import * as React from "react";
interface NotionMagicLinkEmailProps {
loginCode?: string;
diff --git a/packages/server/src/emails/emails/plaid-verify-identity.tsx b/packages/server/src/emails/emails/plaid-verify-identity.tsx
index 650ab486..88cf893d 100644
--- a/packages/server/src/emails/emails/plaid-verify-identity.tsx
+++ b/packages/server/src/emails/emails/plaid-verify-identity.tsx
@@ -9,7 +9,6 @@ import {
Section,
Text,
} from "@react-email/components";
-import * as React from "react";
interface PlaidVerifyIdentityEmailProps {
validationCode?: string;
diff --git a/packages/server/src/emails/emails/stripe-welcome.tsx b/packages/server/src/emails/emails/stripe-welcome.tsx
index 9377853b..dbf02ea0 100644
--- a/packages/server/src/emails/emails/stripe-welcome.tsx
+++ b/packages/server/src/emails/emails/stripe-welcome.tsx
@@ -11,7 +11,6 @@ import {
Section,
Text,
} from "@react-email/components";
-import * as React from "react";
const baseUrl = process.env.VERCEL_URL!;
diff --git a/packages/server/src/emails/emails/vercel-invite-user.tsx b/packages/server/src/emails/emails/vercel-invite-user.tsx
index 53b31987..79f50cd7 100644
--- a/packages/server/src/emails/emails/vercel-invite-user.tsx
+++ b/packages/server/src/emails/emails/vercel-invite-user.tsx
@@ -15,7 +15,6 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import * as React from "react";
interface VercelInviteUserEmailProps {
username?: string;
diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts
index 554b4c12..f74b8d9d 100644
--- a/packages/server/src/index.ts
+++ b/packages/server/src/index.ts
@@ -1,5 +1,4 @@
export * from "./auth/random-password";
-// export * from "./db";
export * from "./services/admin";
export * from "./services/user";
export * from "./services/project";
@@ -28,7 +27,6 @@ export * from "./services/ssh-key";
export * from "./services/git-provider";
export * from "./services/bitbucket";
export * from "./services/github";
-export * from "./services/auth";
export * from "./services/gitlab";
export * from "./services/server";
export * from "./services/application";
diff --git a/packages/server/src/lib/auth.ts b/packages/server/src/lib/auth.ts
index 368b43c9..a8d75637 100644
--- a/packages/server/src/lib/auth.ts
+++ b/packages/server/src/lib/auth.ts
@@ -10,7 +10,6 @@ import {
import { and, desc, eq } from "drizzle-orm";
import { db } from "../db";
import * as schema from "../db/schema";
-import { ac } from "./permissions";
export const auth = betterAuth({
database: drizzleAdapter(db, {
diff --git a/packages/server/src/services/admin.ts b/packages/server/src/services/admin.ts
index 07c537de..1e2b569f 100644
--- a/packages/server/src/services/admin.ts
+++ b/packages/server/src/services/admin.ts
@@ -1,7 +1,5 @@
-import { randomBytes } from "node:crypto";
import { db } from "@dokploy/server/db";
import {
- account,
type apiCreateUserInvitation,
invitation,
member,
@@ -9,7 +7,6 @@ import {
users_temp,
} from "@dokploy/server/db/schema";
import { TRPCError } from "@trpc/server";
-import * as bcrypt from "bcrypt";
import { eq } from "drizzle-orm";
import { IS_CLOUD } from "../constants";
diff --git a/packages/server/src/services/application.ts b/packages/server/src/services/application.ts
index ddc3a450..425a6adb 100644
--- a/packages/server/src/services/application.ts
+++ b/packages/server/src/services/application.ts
@@ -4,7 +4,6 @@ import {
type apiCreateApplication,
applications,
buildAppName,
- cleanAppName,
} from "@dokploy/server/db/schema";
import { getAdvancedStats } from "@dokploy/server/monitoring/utils";
import {
@@ -28,7 +27,6 @@ import {
getCustomGitCloneCommand,
} from "@dokploy/server/utils/providers/git";
import {
- authGithub,
cloneGithubRepository,
getGithubCloneCommand,
} from "@dokploy/server/utils/providers/github";
@@ -40,7 +38,7 @@ import { createTraefikConfig } from "@dokploy/server/utils/traefik/application";
import { TRPCError } from "@trpc/server";
import { eq } from "drizzle-orm";
import { encodeBase64 } from "../utils/docker/utils";
-import { findAdminById, findUserById, getDokployUrl } from "./admin";
+import { getDokployUrl } from "./admin";
import {
createDeployment,
createDeploymentPreview,
@@ -58,7 +56,6 @@ import {
updatePreviewDeployment,
} from "./preview-deployment";
import { validUniqueServerAppName } from "./project";
-import { cleanupFullDocker } from "./settings";
export type Application = typeof applications.$inferSelect;
export const createApplication = async (
diff --git a/packages/server/src/services/auth.ts b/packages/server/src/services/auth.ts
deleted file mode 100644
index 5a7484eb..00000000
--- a/packages/server/src/services/auth.ts
+++ /dev/null
@@ -1,212 +0,0 @@
-import { randomBytes } from "node:crypto";
-import { createOTP } from "@better-auth/utils/otp";
-import { db } from "@dokploy/server/db";
-import { users_temp } from "@dokploy/server/db/schema";
-import { getPublicIpWithFallback } from "@dokploy/server/wss/utils";
-import { TRPCError } from "@trpc/server";
-import * as bcrypt from "bcrypt";
-import { eq } from "drizzle-orm";
-import encode from "hi-base32";
-import { TOTP } from "otpauth";
-import QRCode from "qrcode";
-import { IS_CLOUD } from "../constants";
-import { findUserById } from "./admin";
-import type { User } from "./user";
-
-export const findAuthById = async (authId: string) => {
- const result = await db.query.users_temp.findFirst({
- where: eq(users_temp.id, authId),
- columns: {
- createdAt: false,
- updatedAt: false,
- },
- });
- if (!result) {
- throw new TRPCError({
- code: "NOT_FOUND",
- message: "Auth not found",
- });
- }
- return result;
-};
-
-const generateBase32Secret = () => {
- // Generamos 32 bytes (256 bits) para asegurar que tengamos suficiente longitud
- const buffer = randomBytes(32);
- // Convertimos directamente a hex para Better Auth
- const hex = buffer.toString("hex");
- // También necesitamos la versión base32 para el QR code
- const base32 = encode.encode(buffer).replace(/=/g, "").substring(0, 32);
- return {
- hex,
- base32,
- };
-};
-
-export const generate2FASecret = () => {
- const secret = "46JMUCG4NJ3CIU6LQAIVFWUW";
-
- const totp = new TOTP({
- issuer: "Dokploy",
- label: "siumauricio@hotmail.com",
- algorithm: "SHA1",
- digits: 6,
- secret: secret,
- });
-
- // Convertir los bytes del secreto a hex
- const secretBytes = totp.secret.bytes;
- const hexSecret = Buffer.from(secretBytes).toString("hex");
-
- console.log("Secret bytes:", secretBytes);
- console.log("Hex secret:", hexSecret);
-
- return {
- secret,
- hexSecret,
- totp,
- };
-};
-
-export const verify2FA = async (auth: User, secret: string, pin: string) => {
- const totp = new TOTP({
- issuer: "Dokploy",
- label: `${auth?.email}`,
- algorithm: "SHA1",
- digits: 6,
- secret: secret,
- period: 30,
- });
-
- const delta = totp.validate({ token: pin });
-
- if (delta === null) {
- throw new TRPCError({
- code: "BAD_REQUEST",
- message: "Invalid 2FA code",
- });
- }
- return auth;
-};
-
-const convertBase32ToHex = (base32Secret: string) => {
- try {
- // Asegurarnos de que la longitud sea múltiplo de 8 agregando padding
- let paddedSecret = base32Secret;
- while (paddedSecret.length % 8 !== 0) {
- paddedSecret += "=";
- }
-
- const bytes = encode.decode.asBytes(paddedSecret.toUpperCase());
- let hex = Buffer.from(bytes).toString("hex");
-
- // Asegurarnos de que el hex tenga al menos 32 caracteres (16 bytes)
- while (hex.length < 32) {
- hex += "0";
- }
-
- return hex;
- } catch (error) {
- console.error("Error converting base32 to hex:", error);
- return base32Secret;
- }
-};
-
-// Para probar
-// const testSecret = "46JMUCG4NJ3CIU6LQAIVFWUW";
-// console.log("Original:", testSecret);
-// console.log("Converted:", convertBase32ToHex(testSecret));
-// console.log(
-// "Length in bytes:",
-// Buffer.from(convertBase32ToHex(testSecret), "hex").length,
-// );
-// console.log(generate2FASecret().secret.secret);
-
-// // Para probar
-// const testResult = generate2FASecret();
-// console.log("\nResultados:");
-// console.log("Original base32:", testResult.secret);
-// console.log("Hex convertido:", testResult.hexSecret);
-// console.log(
-// "Longitud en bytes:",
-// Buffer.from(testResult.hexSecret, "hex").length,
-// );
-export const symmetricDecrypt = async ({ key, data }) => {
- const keyAsBytes = await createHash("SHA-256").digest(key);
- const dataAsBytes = hexToBytes(data);
- const chacha = managedNonce(xchacha20poly1305)(new Uint8Array(keyAsBytes));
- return new TextDecoder().decode(chacha.decrypt(dataAsBytes));
-};
-// export const migrateExistingSecret = async (
-// existingBase32Secret: string,
-// encryptionKey: string,
-// ) => {
-// try {
-// // 1. Primero asegurarnos que el secreto base32 tenga el padding correcto
-// let paddedSecret = existingBase32Secret;
-// while (paddedSecret.length % 8 !== 0) {
-// paddedSecret += "=";
-// }
-
-// // 2. Decodificar el base32 a bytes usando hi-base32
-// const bytes = encode.decode.asBytes(paddedSecret.toUpperCase());
-
-// // 3. Convertir los bytes a hex
-// const hexSecret = Buffer.from(bytes).toString("hex");
-
-// // 4. Encriptar el secreto hex usando Better Auth
-// const encryptedSecret = await symmetricEncrypt({
-// key: encryptionKey,
-// data: hexSecret,
-// });
-
-// // 5. Crear TOTP con el secreto original para validación
-// const originalTotp = new TOTP({
-// issuer: "Dokploy",
-// label: "migration-test",
-// algorithm: "SHA1",
-// digits: 6,
-// secret: existingBase32Secret,
-// });
-
-// // 6. Generar un código de prueba con el secreto original
-// const testCode = originalTotp.generate();
-
-// // 7. Validar que el código funcione con el secreto original
-// const isValid = originalTotp.validate({ token: testCode }) !== null;
-
-// return {
-// originalSecret: existingBase32Secret,
-// hexSecret,
-// encryptedSecret, // Este es el valor que debes guardar en la base de datos
-// isValid,
-// testCode,
-// secretLength: hexSecret.length,
-// };
-// } catch (error: unknown) {
-// const errorMessage =
-// error instanceof Error ? error.message : "Unknown error";
-// console.error("Error durante la migración:", errorMessage);
-// throw new Error(`Error al migrar el secreto: ${errorMessage}`);
-// }
-// };
-
-// // // Ejemplo de uso con el secreto de prueba
-// // const testMigration = await migrateExistingSecret(
-// // "46JMUCG4NJ3CIU6LQAIVFWUW",
-// // process.env.BETTER_AUTH_SECRET || "your-encryption-key",
-// // );
-// // console.log("\nPrueba de migración:");
-// // console.log("Secreto original (base32):", testMigration.originalSecret);
-// // console.log("Secreto convertido (hex):", testMigration.hexSecret);
-// // console.log("Secreto encriptado:", testMigration.encryptedSecret);
-// // console.log("Longitud del secreto hex:", testMigration.secretLength);
-// // console.log("¿Conversión válida?:", testMigration.isValid);
-// // console.log("Código de prueba:", testMigration.testCode);
-// const secret = "46JMUCG4NJ3CIU6LQAIVFWUW";
-// const isValid = createOTP(secret, {
-// digits: 6,
-// period: 30,
-// }).verify("123456");
-
-// console.log(isValid.then((isValid) => console.log(isValid)));
diff --git a/packages/server/src/services/backup.ts b/packages/server/src/services/backup.ts
index ef3d0446..32705786 100644
--- a/packages/server/src/services/backup.ts
+++ b/packages/server/src/services/backup.ts
@@ -2,8 +2,6 @@ import { db } from "@dokploy/server/db";
import { type apiCreateBackup, backups } from "@dokploy/server/db/schema";
import { TRPCError } from "@trpc/server";
import { eq } from "drizzle-orm";
-import { IS_CLOUD } from "../constants";
-import { removeScheduleBackup, scheduleBackup } from "../utils/backups/utils";
export type Backup = typeof backups.$inferSelect;
diff --git a/packages/server/src/services/compose.ts b/packages/server/src/services/compose.ts
index 70bc411c..a3ebc26c 100644
--- a/packages/server/src/services/compose.ts
+++ b/packages/server/src/services/compose.ts
@@ -44,10 +44,9 @@ import {
import { TRPCError } from "@trpc/server";
import { eq } from "drizzle-orm";
import { encodeBase64 } from "../utils/docker/utils";
-import { findAdminById, findUserById, getDokployUrl } from "./admin";
+import { getDokployUrl } from "./admin";
import { createDeploymentCompose, updateDeploymentStatus } from "./deployment";
import { validUniqueServerAppName } from "./project";
-import { cleanupFullDocker } from "./settings";
export type Compose = typeof compose.$inferSelect;
diff --git a/packages/server/src/services/deployment.ts b/packages/server/src/services/deployment.ts
index 096bdf19..86d6c88e 100644
--- a/packages/server/src/services/deployment.ts
+++ b/packages/server/src/services/deployment.ts
@@ -12,7 +12,7 @@ import {
import { removeDirectoryIfExistsContent } from "@dokploy/server/utils/filesystem/directory";
import { TRPCError } from "@trpc/server";
import { format } from "date-fns";
-import { and, desc, eq, isNull } from "drizzle-orm";
+import { desc, eq } from "drizzle-orm";
import {
type Application,
findApplicationById,
@@ -278,9 +278,11 @@ export const removeDeployment = async (deploymentId: string) => {
.returning();
return deployment[0];
} catch (error) {
+ const message =
+ error instanceof Error ? error.message : "Error creating the deployment";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error deleting this deployment",
+ message,
});
}
};
@@ -535,9 +537,11 @@ export const createServerDeployment = async (
}
return deploymentCreate[0];
} catch (error) {
+ const message =
+ error instanceof Error ? error.message : "Error creating the deployment";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error creating the deployment",
+ message,
});
}
};
diff --git a/packages/server/src/services/domain.ts b/packages/server/src/services/domain.ts
index 99dcde55..fe068fc2 100644
--- a/packages/server/src/services/domain.ts
+++ b/packages/server/src/services/domain.ts
@@ -4,7 +4,7 @@ import { manageDomain } from "@dokploy/server/utils/traefik/domain";
import { TRPCError } from "@trpc/server";
import { eq } from "drizzle-orm";
import { type apiCreateDomain, domains } from "../db/schema";
-import { findAdmin, findAdminById, findUserById } from "./admin";
+import { findUserById } from "./admin";
import { findApplicationById } from "./application";
import { findServerById } from "./server";
diff --git a/packages/server/src/services/gitlab.ts b/packages/server/src/services/gitlab.ts
index 0822aaab..fdca2775 100644
--- a/packages/server/src/services/gitlab.ts
+++ b/packages/server/src/services/gitlab.ts
@@ -1,9 +1,7 @@
import { db } from "@dokploy/server/db";
import {
type apiCreateGitlab,
- type bitbucket,
gitProvider,
- type github,
gitlab,
} from "@dokploy/server/db/schema";
import { TRPCError } from "@trpc/server";
diff --git a/packages/server/src/services/mariadb.ts b/packages/server/src/services/mariadb.ts
index 8257b587..00be29d6 100644
--- a/packages/server/src/services/mariadb.ts
+++ b/packages/server/src/services/mariadb.ts
@@ -4,7 +4,7 @@ import {
backups,
mariadb,
} from "@dokploy/server/db/schema";
-import { buildAppName, cleanAppName } from "@dokploy/server/db/schema";
+import { buildAppName } from "@dokploy/server/db/schema";
import { generatePassword } from "@dokploy/server/templates/utils";
import { buildMariadb } from "@dokploy/server/utils/databases/mariadb";
import { pullImage } from "@dokploy/server/utils/docker/utils";
diff --git a/packages/server/src/services/mongo.ts b/packages/server/src/services/mongo.ts
index 031a6013..0ac4cc63 100644
--- a/packages/server/src/services/mongo.ts
+++ b/packages/server/src/services/mongo.ts
@@ -1,6 +1,6 @@
import { db } from "@dokploy/server/db";
import { type apiCreateMongo, backups, mongo } from "@dokploy/server/db/schema";
-import { buildAppName, cleanAppName } from "@dokploy/server/db/schema";
+import { buildAppName } from "@dokploy/server/db/schema";
import { generatePassword } from "@dokploy/server/templates/utils";
import { buildMongo } from "@dokploy/server/utils/databases/mongo";
import { pullImage } from "@dokploy/server/utils/docker/utils";
diff --git a/packages/server/src/services/mount.ts b/packages/server/src/services/mount.ts
index 38e82d1a..55557ea0 100644
--- a/packages/server/src/services/mount.ts
+++ b/packages/server/src/services/mount.ts
@@ -123,8 +123,8 @@ export const updateMount = async (
mountId: string,
mountData: Partial,
) => {
- return await db.transaction(async (transaction) => {
- const mount = await db
+ return await db.transaction(async (tx) => {
+ const mount = await tx
.update(mounts)
.set({
...mountData,
diff --git a/packages/server/src/services/postgres.ts b/packages/server/src/services/postgres.ts
index 682d3f78..75b81c50 100644
--- a/packages/server/src/services/postgres.ts
+++ b/packages/server/src/services/postgres.ts
@@ -4,7 +4,7 @@ import {
backups,
postgres,
} from "@dokploy/server/db/schema";
-import { buildAppName, cleanAppName } from "@dokploy/server/db/schema";
+import { buildAppName } from "@dokploy/server/db/schema";
import { generatePassword } from "@dokploy/server/templates/utils";
import { buildPostgres } from "@dokploy/server/utils/databases/postgres";
import { pullImage } from "@dokploy/server/utils/docker/utils";
diff --git a/packages/server/src/services/preview-deployment.ts b/packages/server/src/services/preview-deployment.ts
index d5a2149a..77562177 100644
--- a/packages/server/src/services/preview-deployment.ts
+++ b/packages/server/src/services/preview-deployment.ts
@@ -7,19 +7,15 @@ import {
} from "@dokploy/server/db/schema";
import { TRPCError } from "@trpc/server";
import { and, desc, eq } from "drizzle-orm";
-import { slugify } from "../setup/server-setup";
-import { generatePassword, generateRandomDomain } from "../templates/utils";
+import { generatePassword } from "../templates/utils";
import { removeService } from "../utils/docker/utils";
import { removeDirectoryCode } from "../utils/filesystem/directory";
import { authGithub } from "../utils/providers/github";
import { removeTraefikConfig } from "../utils/traefik/application";
import { manageDomain } from "../utils/traefik/domain";
-import { findAdminById, findUserById } from "./admin";
+import { findUserById } from "./admin";
import { findApplicationById } from "./application";
-import {
- removeDeployments,
- removeDeploymentsByPreviewDeploymentId,
-} from "./deployment";
+import { removeDeploymentsByPreviewDeploymentId } from "./deployment";
import { createDomain } from "./domain";
import { type Github, getIssueComment } from "./github";
@@ -111,9 +107,13 @@ export const removePreviewDeployment = async (previewDeploymentId: string) => {
}
return deployment[0];
} catch (error) {
+ const message =
+ error instanceof Error
+ ? error.message
+ : "Error deleting this preview deployment";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error deleting this preview deployment",
+ message,
});
}
};
diff --git a/packages/server/src/services/redirect.ts b/packages/server/src/services/redirect.ts
index f16dbe42..1896105f 100644
--- a/packages/server/src/services/redirect.ts
+++ b/packages/server/src/services/redirect.ts
@@ -6,7 +6,7 @@ import {
updateRedirectMiddleware,
} from "@dokploy/server/utils/traefik/redirect";
import { TRPCError } from "@trpc/server";
-import { desc, eq } from "drizzle-orm";
+import { eq } from "drizzle-orm";
import type { z } from "zod";
import { findApplicationById } from "./application";
export type Redirect = typeof redirects.$inferSelect;
@@ -114,9 +114,11 @@ export const updateRedirectById = async (
return redirect;
} catch (error) {
+ const message =
+ error instanceof Error ? error.message : "Error updating this redirect";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error updating this redirect",
+ message,
});
}
};
diff --git a/packages/server/src/services/redis.ts b/packages/server/src/services/redis.ts
index e0dbbe02..9f4a1f9e 100644
--- a/packages/server/src/services/redis.ts
+++ b/packages/server/src/services/redis.ts
@@ -1,6 +1,6 @@
import { db } from "@dokploy/server/db";
import { type apiCreateRedis, redis } from "@dokploy/server/db/schema";
-import { buildAppName, cleanAppName } from "@dokploy/server/db/schema";
+import { buildAppName } from "@dokploy/server/db/schema";
import { generatePassword } from "@dokploy/server/templates/utils";
import { buildRedis } from "@dokploy/server/utils/databases/redis";
import { pullImage } from "@dokploy/server/utils/docker/utils";
diff --git a/packages/server/src/services/registry.ts b/packages/server/src/services/registry.ts
index 853f4cf7..6468cd97 100644
--- a/packages/server/src/services/registry.ts
+++ b/packages/server/src/services/registry.ts
@@ -112,9 +112,11 @@ export const updateRegistry = async (
return response;
} catch (error) {
+ const message =
+ error instanceof Error ? error.message : "Error updating this registry";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error updating this registry",
+ message,
});
}
};
diff --git a/packages/server/src/services/security.ts b/packages/server/src/services/security.ts
index 5efca19f..d6947b88 100644
--- a/packages/server/src/services/security.ts
+++ b/packages/server/src/services/security.ts
@@ -76,9 +76,11 @@ export const deleteSecurityById = async (securityId: string) => {
await removeSecurityMiddleware(application, result);
return result;
} catch (error) {
+ const message =
+ error instanceof Error ? error.message : "Error removing this security";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error removing this security",
+ message,
});
}
};
@@ -98,9 +100,11 @@ export const updateSecurityById = async (
return response[0];
} catch (error) {
+ const message =
+ error instanceof Error ? error.message : "Error updating this security";
throw new TRPCError({
code: "BAD_REQUEST",
- message: "Error updating this security",
+ message,
});
}
};
diff --git a/packages/server/src/services/server.ts b/packages/server/src/services/server.ts
index afe851ef..a4d5c5d8 100644
--- a/packages/server/src/services/server.ts
+++ b/packages/server/src/services/server.ts
@@ -5,7 +5,7 @@ import {
server,
} from "@dokploy/server/db/schema";
import { TRPCError } from "@trpc/server";
-import { desc, eq } from "drizzle-orm";
+import { eq } from "drizzle-orm";
export type Server = typeof server.$inferSelect;
diff --git a/packages/server/src/services/settings.ts b/packages/server/src/services/settings.ts
index 01ac43a1..75613be0 100644
--- a/packages/server/src/services/settings.ts
+++ b/packages/server/src/services/settings.ts
@@ -169,7 +169,6 @@ echo "$json_output"
const result = JSON.parse(stdout);
return result;
}
- const items = readdirSync(dirPath, { withFileTypes: true });
const stack = [dirPath];
const result: TreeDataItem[] = [];
diff --git a/packages/server/src/services/user.ts b/packages/server/src/services/user.ts
index 9e924e9f..f36d8ef6 100644
--- a/packages/server/src/services/user.ts
+++ b/packages/server/src/services/user.ts
@@ -1,38 +1,10 @@
import { db } from "@dokploy/server/db";
-import { type users_temp, member } from "@dokploy/server/db/schema";
+import { member, type users_temp } from "@dokploy/server/db/schema";
import { TRPCError } from "@trpc/server";
import { and, eq } from "drizzle-orm";
-import { findUserById } from "./admin";
export type User = typeof users_temp.$inferSelect;
-// export const findUserById = async (userId: string) => {
-// // const userR = await db.query.user.findFirst({
-// // where: eq(user.userId, userId),
-// // });
-// // if (!userR) {
-// // throw new TRPCError({
-// // code: "NOT_FOUND",
-// // message: "User not found",
-// // });
-// // }
-// // return user;
-// };
-
-export const findUserByAuthId = async (authId: string) => {
- // const userR = await db.query.user.findFirst({
- // where: eq(user.id, authId),
- // with: {},
- // });
- // if (!userR) {
- // throw new TRPCError({
- // code: "NOT_FOUND",
- // message: "User not found",
- // });
- // }
- // return userR;
-};
-
export const addNewProject = async (
userId: string,
projectId: string,
diff --git a/packages/server/src/setup/monitoring-setup.ts b/packages/server/src/setup/monitoring-setup.ts
index ea6c768b..afadb6c1 100644
--- a/packages/server/src/setup/monitoring-setup.ts
+++ b/packages/server/src/setup/monitoring-setup.ts
@@ -1,7 +1,7 @@
import { findServerById } from "@dokploy/server/services/server";
import type { ContainerCreateOptions } from "dockerode";
import { IS_CLOUD } from "../constants";
-import { findAdminById, findUserById } from "../services/admin";
+import { findUserById } from "../services/admin";
import { getDokployImageTag } from "../services/settings";
import { pullImage, pullRemoteImage } from "../utils/docker/utils";
import { execAsync, execAsyncRemote } from "../utils/process/execAsync";
diff --git a/packages/server/src/utils/access-log/handler.ts b/packages/server/src/utils/access-log/handler.ts
index 30b18ea4..5cff7f83 100644
--- a/packages/server/src/utils/access-log/handler.ts
+++ b/packages/server/src/utils/access-log/handler.ts
@@ -1,6 +1,5 @@
import { IS_CLOUD, paths } from "@dokploy/server/constants";
import { type RotatingFileStream, createStream } from "rotating-file-stream";
-import { db } from "../../db";
import { execAsync } from "../process/execAsync";
class LogRotationManager {
diff --git a/packages/server/src/utils/backups/mysql.ts b/packages/server/src/utils/backups/mysql.ts
index 009a02cf..1272fc3e 100644
--- a/packages/server/src/utils/backups/mysql.ts
+++ b/packages/server/src/utils/backups/mysql.ts
@@ -1,4 +1,3 @@
-import { unlink } from "node:fs/promises";
import path from "node:path";
import type { BackupSchedule } from "@dokploy/server/services/backup";
import type { MySql } from "@dokploy/server/services/mysql";
diff --git a/packages/server/src/utils/builders/compose.ts b/packages/server/src/utils/builders/compose.ts
index 838cf74e..cbf951c7 100644
--- a/packages/server/src/utils/builders/compose.ts
+++ b/packages/server/src/utils/builders/compose.ts
@@ -2,7 +2,6 @@ import {
createWriteStream,
existsSync,
mkdirSync,
- readFileSync,
writeFileSync,
} from "node:fs";
import { dirname, join } from "node:path";
diff --git a/packages/server/src/utils/notifications/database-backup.ts b/packages/server/src/utils/notifications/database-backup.ts
index 08cff4b5..37a4a1ff 100644
--- a/packages/server/src/utils/notifications/database-backup.ts
+++ b/packages/server/src/utils/notifications/database-backup.ts
@@ -1,4 +1,3 @@
-import { error } from "node:console";
import { db } from "@dokploy/server/db";
import { notifications } from "@dokploy/server/db/schema";
import DatabaseBackupEmail from "@dokploy/server/emails/emails/database-backup";
diff --git a/packages/server/src/utils/traefik/middleware.ts b/packages/server/src/utils/traefik/middleware.ts
index 60345f66..934d637e 100644
--- a/packages/server/src/utils/traefik/middleware.ts
+++ b/packages/server/src/utils/traefik/middleware.ts
@@ -95,7 +95,7 @@ export const loadRemoteMiddlewares = async (serverId: string) => {
}
const config = load(stdout) as FileConfig;
return config;
- } catch (error) {
+ } catch (_) {
throw new Error(`File not found: ${configPath}`);
}
};