Add allowedDevOrigins

This commit is contained in:
Owen
2026-05-28 21:23:55 -07:00
parent 8e14bdec95
commit c1ef5b4fbe
3 changed files with 20 additions and 2 deletions

View File

@@ -34,3 +34,4 @@ build.ts
tsconfig.json tsconfig.json
Dockerfile* Dockerfile*
drizzle.config.ts drizzle.config.ts
allowedDevOrigins.json

1
.gitignore vendored
View File

@@ -55,3 +55,4 @@ CLAUDE.md
drizzle.config.ts drizzle.config.ts
server/setup/migrations.ts server/setup/migrations.ts
solo.yml solo.yml
allowedDevOrigins.json

View File

@@ -1,13 +1,29 @@
import type { NextConfig } from "next"; import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin"; import createNextIntlPlugin from "next-intl/plugin";
import fs from "fs";
import path from "path";
const withNextIntl = createNextIntlPlugin(); 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 = { const nextConfig: NextConfig = {
reactStrictMode: false, reactStrictMode: false,
reactCompiler: true, reactCompiler: true,
transpilePackages: ["@novnc/novnc"], transpilePackages: ["@novnc/novnc"],
output: "standalone" output: "standalone",
allowedDevOrigins
}; };
export default withNextIntl(nextConfig); export default withNextIntl(nextConfig);