Compare commits

...

5 Commits

Author SHA1 Message Date
Steven Hall 224269c271 See if assetPrefix is the problem 2024-05-14 17:47:33 +01:00
Steven Hall b083894407 Test non-wildcard 2024-05-14 17:28:11 +01:00
Steven Hall 285841f8ea Fix regex 2024-05-14 17:20:58 +01:00
Steven Hall 1af6488220 Test without sentry 2024-05-14 17:15:44 +01:00
Steven Hall 87490a2bd1 Fixing SSRF for Next Image (again) 2024-05-14 17:08:21 +01:00
+66 -63
View File
@@ -1,68 +1,71 @@
const { withSentryConfig } = require('@sentry/nextjs');
module.exports = withSentryConfig(
{
env: {
BUILD_VERSION: (process.env.GITHUB_SHA ?? '').slice(0, 7),
SENTRY_DSN: process.env.SENTRY_DSN ?? '',
SENTRY_ENVIRONMENT: process.env.SENTRY_ENVIRONMENT ?? 'development',
GITBOOK_ASSETS_PREFIX: process.env.GITBOOK_ASSETS_PREFIX,
},
webpack(config) {
config.resolve.fallback = {
...config.resolve.fallback,
// Required for `swagger2openapi` to work:
fs: false,
path: false,
http: false,
};
return config;
},
async headers() {
return [
// Cache all static assets for 1 year
{
source: '/~gitbook/static/:path*',
headers: [
{
key: 'Cache-Control',
value: 'public, max-age=31536000, immutable',
},
],
},
];
},
assetPrefix: process.env.GITBOOK_ASSETS_PREFIX,
poweredByHeader: false,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '*.gitbook.io',
}
]
}
module.exports = {
env: {
BUILD_VERSION: (process.env.GITHUB_SHA ?? '').slice(0, 7),
SENTRY_DSN: process.env.SENTRY_DSN ?? '',
SENTRY_ENVIRONMENT: process.env.SENTRY_ENVIRONMENT ?? 'development',
GITBOOK_ASSETS_PREFIX: process.env.GITBOOK_ASSETS_PREFIX,
},
{
silent: true,
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
webpack(config) {
config.resolve.fallback = {
...config.resolve.fallback,
// Required for `swagger2openapi` to work:
fs: false,
path: false,
http: false,
};
return config;
},
{
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
transpileClientSDK: false,
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: '/~gitbook/monitoring',
// Don't hide source maps from generated client bundles
hideSourceMaps: false,
disableLogger: true,
automaticVercelMonitors: false,
async headers() {
return [
// Cache all static assets for 1 year
{
source: '/~gitbook/static/:path*',
headers: [
{
key: 'Cache-Control',
value: 'public, max-age=31536000, immutable',
},
],
},
];
},
);
// assetPrefix: process.env.GITBOOK_ASSETS_PREFIX,
poweredByHeader: false,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'files.gitbook.io',
port: '',
},
]
}
};
// module.exports = withSentryConfig(
// nextConfig,
// {
// silent: true,
// org: process.env.SENTRY_ORG,
// project: process.env.SENTRY_PROJECT,
// },
// {
// // Upload a larger set of source maps for prettier stack traces (increases build time)
// widenClientFileUpload: true,
// transpileClientSDK: false,
// // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
// tunnelRoute: '/~gitbook/monitoring',
// // Don't hide source maps from generated client bundles
// hideSourceMaps: false,
// disableLogger: true,
// automaticVercelMonitors: false,
// },
// );