diff --git a/Dockerfile.cloud b/Dockerfile.cloud index aa98558f..f0d36a37 100644 --- a/Dockerfile.cloud +++ b/Dockerfile.cloud @@ -48,10 +48,7 @@ RUN curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && rm # Install Nixpacks and tsx # | VERBOSE=1 VERSION=1.21.0 bash -RUN curl -sSL https://nixpacks.com/install.sh -o install.sh \ - && chmod +x install.sh \ - && ./install.sh \ - && pnpm install -g tsx +RUN pnpm install -g tsx # Install buildpacks COPY --from=buildpacksio/pack:0.35.0 /usr/local/bin/pack /usr/local/bin/pack diff --git a/apps/dokploy/server/api/routers/cluster.ts b/apps/dokploy/server/api/routers/cluster.ts index 159fd9c2..8f832943 100644 --- a/apps/dokploy/server/api/routers/cluster.ts +++ b/apps/dokploy/server/api/routers/cluster.ts @@ -2,10 +2,18 @@ import { getPublicIpWithFallback } from "@/server/wss/terminal"; import { TRPCError } from "@trpc/server"; import { z } from "zod"; import { createTRPCRouter, protectedProcedure } from "../trpc"; -import { execAsync, docker, type DockerNode } from "@dokploy/builders"; +import { + execAsync, + docker, + type DockerNode, + IS_CLOUD, +} from "@dokploy/builders"; export const clusterRouter = createTRPCRouter({ getNodes: protectedProcedure.query(async () => { + if (IS_CLOUD) { + return []; + } const workers: DockerNode[] = await docker.listNodes(); return workers; @@ -17,6 +25,12 @@ export const clusterRouter = createTRPCRouter({ }), ) .mutation(async ({ input }) => { + if (IS_CLOUD) { + throw new TRPCError({ + code: "UNAUTHORIZED", + message: "Functionality not available in cloud version", + }); + } try { await execAsync( `docker node update --availability drain ${input.nodeId}`, @@ -32,6 +46,12 @@ export const clusterRouter = createTRPCRouter({ } }), addWorker: protectedProcedure.query(async ({ input }) => { + if (IS_CLOUD) { + return { + command: "", + version: "", + }; + } const result = await docker.swarmInspect(); const docker_version = await docker.version(); @@ -43,6 +63,12 @@ export const clusterRouter = createTRPCRouter({ }; }), addManager: protectedProcedure.query(async ({ input }) => { + if (IS_CLOUD) { + return { + command: "", + version: "", + }; + } const result = await docker.swarmInspect(); const docker_version = await docker.version(); return {