Merge branch 'canary' of https://github.com/kdurek/dokploy into feat/server-ip

This commit is contained in:
Krzysztof Durek
2024-11-17 22:08:00 +01:00
13 changed files with 37 additions and 27 deletions
+3 -3
View File
@@ -99,14 +99,14 @@ workflows:
only: only:
- main - main
- canary - canary
- pull/665 - fix/build-i18n
- build-arm64: - build-arm64:
filters: filters:
branches: branches:
only: only:
- main - main
- canary - canary
- pull/665 - fix/build-i18n
- combine-manifests: - combine-manifests:
requires: requires:
- build-amd64 - build-amd64
@@ -116,4 +116,4 @@ workflows:
only: only:
- main - main
- canary - canary
- pull/665 - fix/build-i18n
+1
View File
@@ -35,6 +35,7 @@ RUN apt-get update && apt-get install -y curl unzip apache2-utils && rm -rf /var
COPY --from=build /prod/dokploy/.next ./.next COPY --from=build /prod/dokploy/.next ./.next
COPY --from=build /prod/dokploy/dist ./dist COPY --from=build /prod/dokploy/dist ./dist
COPY --from=build /prod/dokploy/next.config.mjs ./next.config.mjs COPY --from=build /prod/dokploy/next.config.mjs ./next.config.mjs
COPY --from=build /prod/dokploy/next-i18next.config.cjs ./next-i18next.config.cjs
COPY --from=build /prod/dokploy/public ./public COPY --from=build /prod/dokploy/public ./public
COPY --from=build /prod/dokploy/package.json ./package.json COPY --from=build /prod/dokploy/package.json ./package.json
COPY --from=build /prod/dokploy/drizzle ./drizzle COPY --from=build /prod/dokploy/drizzle ./drizzle
+1
View File
@@ -44,6 +44,7 @@ RUN apt-get update && apt-get install -y curl unzip apache2-utils && rm -rf /var
COPY --from=build /prod/dokploy/.next ./.next COPY --from=build /prod/dokploy/.next ./.next
COPY --from=build /prod/dokploy/dist ./dist COPY --from=build /prod/dokploy/dist ./dist
COPY --from=build /prod/dokploy/next.config.mjs ./next.config.mjs COPY --from=build /prod/dokploy/next.config.mjs ./next.config.mjs
COPY --from=build /prod/dokploy/next-i18next.config.cjs ./next-i18next.config.cjs
COPY --from=build /prod/dokploy/public ./public COPY --from=build /prod/dokploy/public ./public
COPY --from=build /prod/dokploy/package.json ./package.json COPY --from=build /prod/dokploy/package.json ./package.json
COPY --from=build /prod/dokploy/drizzle ./drizzle COPY --from=build /prod/dokploy/drizzle ./drizzle
@@ -61,7 +61,7 @@ const redirectPresets = [
redirect: { redirect: {
regex: "^https?://(?:www.)?(.+)", regex: "^https?://(?:www.)?(.+)",
permanent: true, permanent: true,
replacement: "https://www.$${1}", replacement: "https://www.${1}",
}, },
}, },
{ {
@@ -70,7 +70,7 @@ const redirectPresets = [
redirect: { redirect: {
regex: "^https?://www.(.+)", regex: "^https?://www.(.+)",
permanent: true, permanent: true,
replacement: "https://$${1}", replacement: "https://${1}",
}, },
}, },
]; ];
+1 -1
View File
@@ -11,7 +11,7 @@
"build-next": "next build", "build-next": "next build",
"setup": "tsx -r dotenv/config setup.ts && sleep 5 && pnpm run migration:run", "setup": "tsx -r dotenv/config setup.ts && sleep 5 && pnpm run migration:run",
"reset-password": "node -r dotenv/config dist/reset-password.mjs", "reset-password": "node -r dotenv/config dist/reset-password.mjs",
"dev": "tsx -r dotenv/config ./server/server.ts --project tsconfig.server.json ", "dev": "TURBOPACK=1 tsx -r dotenv/config ./server/server.ts --project tsconfig.server.json ",
"studio": "drizzle-kit studio --config ./server/db/drizzle.config.ts", "studio": "drizzle-kit studio --config ./server/db/drizzle.config.ts",
"migration:generate": "drizzle-kit generate --config ./server/db/drizzle.config.ts", "migration:generate": "drizzle-kit generate --config ./server/db/drizzle.config.ts",
"migration:run": "tsx -r dotenv/config migration.ts", "migration:run": "tsx -r dotenv/config migration.ts",
@@ -2,13 +2,13 @@ import { AppearanceForm } from "@/components/dashboard/settings/appearance-form"
import { DashboardLayout } from "@/components/layouts/dashboard-layout"; import { DashboardLayout } from "@/components/layouts/dashboard-layout";
import { SettingsLayout } from "@/components/layouts/settings-layout"; import { SettingsLayout } from "@/components/layouts/settings-layout";
import { appRouter } from "@/server/api/root"; import { appRouter } from "@/server/api/root";
import { getLocale } from "@/utils/i18n"; import { getLocale, serverSideTranslations } from "@/utils/i18n";
import { validateRequest } from "@dokploy/server"; import { validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server"; import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next"; import type { GetServerSidePropsContext } from "next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import React, { type ReactElement } from "react"; import React, { type ReactElement } from "react";
import superjson from "superjson"; import superjson from "superjson";
import nextI18NextConfig from "../../../next-i18next.config.cjs";
const Page = () => { const Page = () => {
return ( return (
@@ -4,11 +4,10 @@ import { DashboardLayout } from "@/components/layouts/dashboard-layout";
import { SettingsLayout } from "@/components/layouts/settings-layout"; import { SettingsLayout } from "@/components/layouts/settings-layout";
import { appRouter } from "@/server/api/root"; import { appRouter } from "@/server/api/root";
import { api } from "@/utils/api"; import { api } from "@/utils/api";
import { getLocale } from "@/utils/i18n"; import { getLocale, serverSideTranslations } from "@/utils/i18n";
import { validateRequest } from "@dokploy/server"; import { validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server"; import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next"; import type { GetServerSidePropsContext } from "next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import React, { type ReactElement } from "react"; import React, { type ReactElement } from "react";
import superjson from "superjson"; import superjson from "superjson";
@@ -3,11 +3,10 @@ import { WebServer } from "@/components/dashboard/settings/web-server";
import { DashboardLayout } from "@/components/layouts/dashboard-layout"; import { DashboardLayout } from "@/components/layouts/dashboard-layout";
import { SettingsLayout } from "@/components/layouts/settings-layout"; import { SettingsLayout } from "@/components/layouts/settings-layout";
import { appRouter } from "@/server/api/root"; import { appRouter } from "@/server/api/root";
import { getLocale } from "@/utils/i18n"; import { getLocale, serverSideTranslations } from "@/utils/i18n";
import { IS_CLOUD, validateRequest } from "@dokploy/server"; import { IS_CLOUD, validateRequest } from "@dokploy/server";
import { createServerSideHelpers } from "@trpc/react-query/server"; import { createServerSideHelpers } from "@trpc/react-query/server";
import type { GetServerSidePropsContext } from "next"; import type { GetServerSidePropsContext } from "next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import React, { type ReactElement } from "react"; import React, { type ReactElement } from "react";
import superjson from "superjson"; import superjson from "superjson";
+1 -1
View File
@@ -24,7 +24,7 @@ import { setupTerminalWebSocketServer } from "./wss/terminal";
config({ path: ".env" }); config({ path: ".env" });
const PORT = Number.parseInt(process.env.PORT || "3000", 10); const PORT = Number.parseInt(process.env.PORT || "3000", 10);
const dev = process.env.NODE_ENV !== "production"; const dev = process.env.NODE_ENV !== "production";
const app = next({ dev }); const app = next({ dev, turbopack: dev });
const handle = app.getRequestHandler(); const handle = app.getRequestHandler();
void app.prepare().then(async () => { void app.prepare().then(async () => {
try { try {
+2 -1
View File
@@ -39,7 +39,8 @@
"**/*.js", "**/*.js",
".next/types/**/*.ts", ".next/types/**/*.ts",
"env.js", "env.js",
"next.config.mjs" "next.config.mjs",
"next-i18next.config.mjs"
], ],
"exclude": [ "exclude": [
"node_modules", "node_modules",
+9
View File
@@ -4,3 +4,12 @@ export function getLocale(cookies: NextApiRequestCookies) {
const locale = cookies.DOKPLOY_LOCALE ?? "en"; const locale = cookies.DOKPLOY_LOCALE ?? "en";
return locale; return locale;
} }
// libs/i18n.js
import { serverSideTranslations as originalServerSideTranslations } from "next-i18next/serverSideTranslations";
import nextI18NextConfig from "../next-i18next.config.cjs";
export const serverSideTranslations = (
locale: string,
namespaces = ["common"],
) => originalServerSideTranslations(locale, namespaces, nextI18NextConfig);
+13 -13
View File
@@ -249,7 +249,7 @@ importers:
version: 0.5.1([email protected](@types/[email protected])([email protected])([email protected]))([email protected]) version: 0.5.1([email protected](@types/[email protected])([email protected])([email protected]))([email protected])
i18next: i18next:
specifier: ^23.16.4 specifier: ^23.16.4
version: 23.16.4 version: 23.16.5
input-otp: input-otp:
specifier: ^1.2.4 specifier: ^1.2.4
version: 1.2.4([email protected]([email protected]))([email protected]) version: 1.2.4([email protected]([email protected]))([email protected])
@@ -276,7 +276,7 @@ importers:
version: 15.0.1([email protected]([email protected]))([email protected]) version: 15.0.1([email protected]([email protected]))([email protected])
next-i18next: next-i18next:
specifier: ^15.3.1 specifier: ^15.3.1
version: 15.3.1([email protected].4)([email protected]([email protected]([email protected]))([email protected]))([email protected].0([email protected].4)([email protected]([email protected]))([email protected]))([email protected]) version: 15.3.1([email protected].5)([email protected]([email protected]([email protected]))([email protected]))([email protected].1([email protected].5)([email protected]([email protected]))([email protected]))([email protected])
next-themes: next-themes:
specifier: ^0.2.1 specifier: ^0.2.1
version: 0.2.1([email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]) version: 0.2.1([email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])
@@ -306,7 +306,7 @@ importers:
version: 7.52.1([email protected]) version: 7.52.1([email protected])
react-i18next: react-i18next:
specifier: ^15.1.0 specifier: ^15.1.0
version: 15.1.0([email protected].4)([email protected]([email protected]))([email protected]) version: 15.1.1([email protected].5)([email protected]([email protected]))([email protected])
recharts: recharts:
specifier: ^2.12.7 specifier: ^2.12.7
version: 2.12.7([email protected]([email protected]))([email protected]) version: 2.12.7([email protected]([email protected]))([email protected])
@@ -4734,8 +4734,8 @@ packages:
[email protected]: [email protected]:
resolution: {integrity: sha512-LIwUlkqDZnUI8lnUxBnEj8K/FrHQTT/Sc+1rvDm9E8YvvY5YxzoEAASNx+W5M9DfD5s77lI5vSAFWeTp26B/3Q==} resolution: {integrity: sha512-LIwUlkqDZnUI8lnUxBnEj8K/FrHQTT/Sc+1rvDm9E8YvvY5YxzoEAASNx+W5M9DfD5s77lI5vSAFWeTp26B/3Q==}
[email protected].4: [email protected].5:
resolution: {integrity: sha512-9NIYBVy9cs4wIqzurf7nLXPyf3R78xYbxExVqHLK9od3038rjpyOEzW+XB130kZ1N4PZ9inTtJ471CRJ4Ituyg==} resolution: {integrity: sha512-KTlhE3EP9x6pPTAW7dy0WKIhoCpfOGhRQlO+jttQLgzVaoOjWwBWramu7Pp0i+8wDNduuzXfe3kkVbzrKyrbTA==}
[email protected]: [email protected]:
resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
@@ -5771,8 +5771,8 @@ packages:
peerDependencies: peerDependencies:
react: ^16.8.0 || ^17 || ^18 || ^19 react: ^16.8.0 || ^17 || ^18 || ^19
[email protected].0: [email protected].1:
resolution: {integrity: sha512-zj3nJynMnZsy2gPZiOTC7XctCY5eQGqT3tcKMmfJWC9FMvgd+960w/adq61j8iPzpwmsXejqID9qC3Mqu1Xu2Q==} resolution: {integrity: sha512-R/Vg9wIli2P3FfeI8o1eNJUJue5LWpFsQePCHdQDmX0Co3zkr6kdT8gAseb/yGeWbNz1Txc4bKDQuZYsC0kQfw==}
peerDependencies: peerDependencies:
i18next: '>= 23.2.3' i18next: '>= 23.2.3'
react: '>= 16.8.0' react: '>= 16.8.0'
@@ -10946,7 +10946,7 @@ snapshots:
[email protected]: {} [email protected]: {}
[email protected].4: [email protected].5:
dependencies: dependencies:
'@babel/runtime': 7.25.0 '@babel/runtime': 7.25.0
@@ -11450,17 +11450,17 @@ snapshots:
[email protected]: {} [email protected]: {}
[email protected]([email protected].4)([email protected]([email protected]([email protected]))([email protected]))([email protected].0([email protected].4)([email protected]([email protected]))([email protected]))([email protected]): [email protected]([email protected].5)([email protected]([email protected]([email protected]))([email protected]))([email protected].1([email protected].5)([email protected]([email protected]))([email protected]))([email protected]):
dependencies: dependencies:
'@babel/runtime': 7.25.0 '@babel/runtime': 7.25.0
'@types/hoist-non-react-statics': 3.3.5 '@types/hoist-non-react-statics': 3.3.5
core-js: 3.39.0 core-js: 3.39.0
hoist-non-react-statics: 3.3.2 hoist-non-react-statics: 3.3.2
i18next: 23.16.4 i18next: 23.16.5
i18next-fs-backend: 2.3.2 i18next-fs-backend: 2.3.2
next: 15.0.1([email protected]([email protected]))([email protected]) next: 15.0.1([email protected]([email protected]))([email protected])
react: 18.2.0 react: 18.2.0
react-i18next: 15.1.0([email protected].4)([email protected]([email protected]))([email protected]) react-i18next: 15.1.1([email protected].5)([email protected]([email protected]))([email protected])
[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]): [email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]):
dependencies: dependencies:
@@ -11951,11 +11951,11 @@ snapshots:
dependencies: dependencies:
react: 18.2.0 react: 18.2.0
[email protected].0([email protected].4)([email protected]([email protected]))([email protected]): [email protected].1([email protected].5)([email protected]([email protected]))([email protected]):
dependencies: dependencies:
'@babel/runtime': 7.25.0 '@babel/runtime': 7.25.0
html-parse-stringify: 3.0.1 html-parse-stringify: 3.0.1
i18next: 23.16.4 i18next: 23.16.5
react: 18.2.0 react: 18.2.0
optionalDependencies: optionalDependencies:
react-dom: 18.2.0([email protected]) react-dom: 18.2.0([email protected])