Repository Public
1/**2 * =============================================================================3 * SP BOUCHER | SOFTWARE & RESEARCH4 * ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project : ORIX App Universe8 * File : next.config.ts9 * Repository : https://git.spboucher.ai/orix-spboucher-ai10 * Project Website : https://www.orixlab.dev11 * Created : 2026-11-2112 * Last Modified : 2026-11-2113 *14 * Author : Simon-Pierre Boucher15 * Position : Professor of Finance16 * Institution : Université du Québec en Outaouais (UQO)17 * Organization : SP Boucher18 * Website : https://spboucher.ai19 * Git : https://git.spboucher.ai20 *21 * Preferred Contact: support@spboucher.ai22 * Development : dev@spboucher.ai23 * Support : support@spboucher.ai24 * Security/Admin : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142import type { NextConfig } from "next";4344// Static CSP: Next's inline bootstrap scripts need 'unsafe-inline' unless every page is rendered with a nonce.45// No third-party origin is allowed anywhere: no analytics, no fonts, no CDN.46const csp = [47 "default-src 'self'",48 `script-src 'self' 'unsafe-inline'${process.env.NODE_ENV === "production" ? "" : " 'unsafe-eval'"}`,49 "style-src 'self' 'unsafe-inline'",50 "img-src 'self' data: blob:",51 "font-src 'self'",52 "connect-src 'self'",53 "manifest-src 'self'",54 "frame-ancestors 'none'",55 "base-uri 'self'",56 "form-action 'self'",57 "object-src 'none'",58].join("; ");5960const common = [61 { key: "X-Content-Type-Options", value: "nosniff" },62 { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },63 { key: "X-Frame-Options", value: "DENY" },64 { key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=(), browsing-topics=()" },65 { key: "Strict-Transport-Security", value: "max-age=31536000; includeSubDomains" },66 { key: "Cross-Origin-Opener-Policy", value: "same-origin" },67];6869const config: NextConfig = {70 poweredByHeader: false,71 compress: false, // the gateway compresses72 images: {73 formats: ["image/avif", "image/webp"],74 localPatterns: [{ pathname: "/apps/**" }, { pathname: "/media/**" }, { pathname: "/brand/**" }],75 minimumCacheTTL: 86400,76 },77 async headers() {78 return [79 // Uploaded media and release artifacts answer with their own, stricter policy.80 { source: "/((?!media/|download/).*)", headers: [{ key: "Content-Security-Policy", value: csp }, ...common] },81 { source: "/(media|download)/:path*", headers: common },82 ];83 },84};85export default config;86