Files
petfeed/next.config.ts
T
admin 2ec5b107ea chore(deploy): quiet down Sentry build logging after root-causing the sourcemap failure
Confirmed via extensive isolated reproduction (docker run, plain BuildKit
RUN step, and Node child_process.spawn -- all three succeed) that TLS and
the sentry-cli invocation itself are fine; GlitchTip's releases API
rejects the authenticated request with "CSRF check Failed" (403) even
with clean token auth and no cookies. That's a server-side GlitchTip
issue (separate Docker stack), not something fixable from this repo.
Keeping ca-certificates/SSL_CERT_FILE since they're correct regardless.
2026-08-14 07:44:31 +02:00

56 lines
2.0 KiB
TypeScript

import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";
import { withSentryConfig } from "@sentry/nextjs";
const withNextIntl = createNextIntlPlugin("./src/i18n/request.ts");
function getSupabaseHostname(): string {
const url = process.env.NEXT_PUBLIC_SUPABASE_URL;
if (url) {
try { return new URL(url).hostname; } catch { /* fall through */ }
}
return "*.supabase.co";
}
const nextConfig: NextConfig = {
output: "standalone",
allowedDevOrigins: ["192.168.1.92"],
images: {
remotePatterns: [
{ protocol: "https", hostname: getSupabaseHostname() },
],
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "X-Frame-Options", value: "DENY" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{ key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },
// HSTS intentionally NOT set here — Cloudflare (in front of the origin) already
// sends a stronger one (max-age=63072000; preload). Setting both resulted in two
// Strict-Transport-Security headers on every response; browsers only honor the
// first, so the app's weaker one was pure noise. If Cloudflare is ever removed
// from the path, re-add this header at the edge/proxy layer, not here.
],
},
];
},
};
export default withSentryConfig(withNextIntl(nextConfig), {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
// Sourcemap upload currently fails against GlitchTip with a CSRF 403 on
// the releases API (confirmed server-side issue, not a build config
// problem — see commit history around 2026-08-14). Keeping silent so this
// known, non-fatal failure doesn't spam every build log; re-enable
// debug:true if investigating further.
silent: true,
sourcemaps: { disable: !process.env.SENTRY_AUTH_TOKEN },
disableLogger: true,
});