SPB Git

Repository Public MIT

next.config.ts 1.7 KB 34 lines typescript

1import type { NextConfig } from "next";2import { config as loadEnv } from "dotenv";3import { fileURLToPath } from "node:url";45// One .env at the repository root serves the web app, the admin console and the migrator.6loadEnv({ path: fileURLToPath(new URL("../../.env", import.meta.url)), quiet: true });78// Content-Security-Policy is set per request in src/proxy.ts (it carries a nonce).9const securityHeaders = [10  { key: "X-Content-Type-Options", value: "nosniff" },11  { key: "X-Frame-Options", value: "DENY" },12  { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },13  { key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=(), browsing-topics=()" },14  { key: "Strict-Transport-Security", value: "max-age=63072000; includeSubDomains" },15  { key: "Cross-Origin-Opener-Policy", value: "same-origin" },16];1718const nextConfig: NextConfig = {19  poweredByHeader: false,20  reactStrictMode: true,21  transpilePackages: ["@skills/registry-core", "@skills/db", "@skills/sdk", "@skills/registry-mcp"],22  serverExternalPackages: ["postgres", "@node-rs/argon2"],23  experimental: { serverActions: { bodySizeLimit: "1mb" } },24  async headers() {25    return [26      { source: "/(.*)", headers: securityHeaders },27      { source: "/dashboard/:path*", headers: [{ key: "X-Robots-Tag", value: "noindex, nofollow" }, { key: "Cache-Control", value: "no-store" }] },28      { source: "/login", headers: [{ key: "X-Robots-Tag", value: "noindex, nofollow" }, { key: "Cache-Control", value: "no-store" }] },29      { source: "/cli/:path*", headers: [{ key: "Cache-Control", value: "public, max-age=300" }, { key: "Content-Type", value: "text/javascript; charset=utf-8" }] },30    ];31  },32};33export default nextConfig;34
Files main
Menu

Theme