-
+
+
+
+
+
+
+
+
+
+
+ Set current public IP
+
+
+
+
diff --git a/apps/dokploy/server/api/routers/server.ts b/apps/dokploy/server/api/routers/server.ts
index 6caaa9c8b..97746131c 100644
--- a/apps/dokploy/server/api/routers/server.ts
+++ b/apps/dokploy/server/api/routers/server.ts
@@ -22,6 +22,7 @@ import {
findAdminById,
findServerById,
findServersByAdminId,
+ getPublicIpWithFallback,
haveActiveServices,
removeDeploymentsByServerId,
serverSetup,
@@ -181,4 +182,8 @@ export const serverRouter = createTRPCRouter({
throw error;
}
}),
+ publicIp: protectedProcedure.query(async ({ ctx }) => {
+ const ip = await getPublicIpWithFallback();
+ return ip;
+ }),
});
From f138b0917fc18a3645bd2065daaa81826a6ec490 Mon Sep 17 00:00:00 2001
From: Krzysztof Durek <21038648+kdurek@users.noreply.github.com>
Date: Sun, 17 Nov 2024 22:05:52 +0100
Subject: [PATCH 5/6] feat: add Polish language support to appearance settings
and locale configuration
---
apps/dokploy/components/dashboard/settings/appearance-form.tsx | 3 ++-
apps/dokploy/next-i18next.config.js | 2 +-
apps/dokploy/pages/_app.tsx | 2 +-
apps/dokploy/utils/hooks/use-locale.ts | 2 +-
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/apps/dokploy/components/dashboard/settings/appearance-form.tsx b/apps/dokploy/components/dashboard/settings/appearance-form.tsx
index a10b0d051..9bafbedab 100644
--- a/apps/dokploy/components/dashboard/settings/appearance-form.tsx
+++ b/apps/dokploy/components/dashboard/settings/appearance-form.tsx
@@ -37,7 +37,7 @@ const appearanceFormSchema = z.object({
theme: z.enum(["light", "dark", "system"], {
required_error: "Please select a theme.",
}),
- language: z.enum(["en", "zh-Hans"], {
+ language: z.enum(["en", "pl", "zh-Hans"], {
required_error: "Please select a language.",
}),
});
@@ -174,6 +174,7 @@ export function AppearanceForm() {
{[
{ label: "English", value: "en" },
+ { label: "Polski", value: "pl" },
{ label: "简体中文", value: "zh-Hans" },
].map((preset) => (
diff --git a/apps/dokploy/next-i18next.config.js b/apps/dokploy/next-i18next.config.js
index 5c20bbea8..bac301cb4 100644
--- a/apps/dokploy/next-i18next.config.js
+++ b/apps/dokploy/next-i18next.config.js
@@ -2,7 +2,7 @@
module.exports = {
i18n: {
defaultLocale: "en",
- locales: ["en", "zh-Hans"],
+ locales: ["en", "pl", "zh-Hans"],
localeDetection: false,
},
fallbackLng: "en",
diff --git a/apps/dokploy/pages/_app.tsx b/apps/dokploy/pages/_app.tsx
index b5fcb1319..18cb3e7e6 100644
--- a/apps/dokploy/pages/_app.tsx
+++ b/apps/dokploy/pages/_app.tsx
@@ -71,7 +71,7 @@ export default api.withTRPC(
{
i18n: {
defaultLocale: "en",
- locales: ["en", "zh-Hans"],
+ locales: ["en", "pl", "zh-Hans"],
localeDetection: false,
},
fallbackLng: "en",
diff --git a/apps/dokploy/utils/hooks/use-locale.ts b/apps/dokploy/utils/hooks/use-locale.ts
index f00e0df84..3c64f6438 100644
--- a/apps/dokploy/utils/hooks/use-locale.ts
+++ b/apps/dokploy/utils/hooks/use-locale.ts
@@ -1,6 +1,6 @@
import Cookies from "js-cookie";
-const SUPPORTED_LOCALES = ["en", "zh-Hans"] as const;
+const SUPPORTED_LOCALES = ["en", "pl", "zh-Hans"] as const;
type Locale = (typeof SUPPORTED_LOCALES)[number];
From 2307346ae35361e26f4adc51696e68781ece7426 Mon Sep 17 00:00:00 2001
From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com>
Date: Sun, 17 Nov 2024 18:23:27 -0600
Subject: [PATCH 6/6] refactor: add validation to prevent run on cloud
---
apps/dokploy/server/api/routers/admin.ts | 6 ++++++
apps/dokploy/server/api/routers/server.ts | 3 +++
2 files changed, 9 insertions(+)
diff --git a/apps/dokploy/server/api/routers/admin.ts b/apps/dokploy/server/api/routers/admin.ts
index d910f2230..6029c7136 100644
--- a/apps/dokploy/server/api/routers/admin.ts
+++ b/apps/dokploy/server/api/routers/admin.ts
@@ -31,6 +31,12 @@ export const adminRouter = createTRPCRouter({
update: adminProcedure
.input(apiUpdateAdmin)
.mutation(async ({ input, ctx }) => {
+ if (ctx.user.rol === "user") {
+ throw new TRPCError({
+ code: "UNAUTHORIZED",
+ message: "You are not allowed to update this admin",
+ });
+ }
const { authId } = await findAdminById(ctx.user.adminId);
return updateAdmin(authId, input);
}),
diff --git a/apps/dokploy/server/api/routers/server.ts b/apps/dokploy/server/api/routers/server.ts
index 97746131c..0d4ef87f3 100644
--- a/apps/dokploy/server/api/routers/server.ts
+++ b/apps/dokploy/server/api/routers/server.ts
@@ -183,6 +183,9 @@ export const serverRouter = createTRPCRouter({
}
}),
publicIp: protectedProcedure.query(async ({ ctx }) => {
+ if (IS_CLOUD) {
+ return "";
+ }
const ip = await getPublicIpWithFallback();
return ip;
}),