mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-06 15:50:42 +00:00
Add allowedDevOrigins
This commit is contained in:
@@ -34,3 +34,4 @@ build.ts
|
|||||||
tsconfig.json
|
tsconfig.json
|
||||||
Dockerfile*
|
Dockerfile*
|
||||||
drizzle.config.ts
|
drizzle.config.ts
|
||||||
|
allowedDevOrigins.json
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -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
|
||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user