Add allowedDevOrigins

This commit is contained in:
Owen 2026-05-28 21:23:55 -07:00
parent 8e14bdec95
commit c1ef5b4fbe
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
3 changed files with 20 additions and 2 deletions

View file

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

3
.gitignore vendored
View file

@ -54,4 +54,5 @@ hydrateSaas.ts
CLAUDE.md
drizzle.config.ts
server/setup/migrations.ts
solo.yml
solo.yml
allowedDevOrigins.json

View file

@ -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);