From c1ef5b4fbef06210083aaf8ad2d62fd11f396f55 Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 28 May 2026 21:23:55 -0700 Subject: [PATCH] Add allowedDevOrigins --- .dockerignore | 1 + .gitignore | 3 ++- next.config.ts | 18 +++++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index d4f63d635..4db9a0bb0 100644 --- a/.dockerignore +++ b/.dockerignore @@ -34,3 +34,4 @@ build.ts tsconfig.json Dockerfile* drizzle.config.ts +allowedDevOrigins.json \ No newline at end of file diff --git a/.gitignore b/.gitignore index b2221fde6..24736b8d7 100644 --- a/.gitignore +++ b/.gitignore @@ -54,4 +54,5 @@ hydrateSaas.ts CLAUDE.md drizzle.config.ts server/setup/migrations.ts -solo.yml \ No newline at end of file +solo.yml +allowedDevOrigins.json \ No newline at end of file diff --git a/next.config.ts b/next.config.ts index c14a2f974..51e739b44 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,13 +1,29 @@ import type { NextConfig } from "next"; import createNextIntlPlugin from "next-intl/plugin"; +import fs from "fs"; +import path from "path"; const withNextIntl = createNextIntlPlugin(); +// read allowedDevOrigins.json if it exists +let allowedDevOrigins: string[] = []; +const allowedDevOriginsPath = path.join( + process.cwd(), + "allowedDevOrigins.json" +); +if (fs.existsSync(allowedDevOriginsPath)) { + try { + const data = fs.readFileSync(allowedDevOriginsPath, "utf-8"); + allowedDevOrigins = JSON.parse(data); + console.log("Loaded allowed development origins:", allowedDevOrigins); + } catch {} +} const nextConfig: NextConfig = { reactStrictMode: false, reactCompiler: true, transpilePackages: ["@novnc/novnc"], - output: "standalone" + output: "standalone", + allowedDevOrigins }; export default withNextIntl(nextConfig);