Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# requires full url
NEXT_PUBLIC_BACKEND_APP_URL = 'http://0.0.0.0:8000/api/...'

# client app public URL
NEXT_PUBLIC_CLIENT_DOMAIN =
# client app public URL (used in og:image and og:url metadata)
NEXT_PUBLIC_CLIENT_DOMAIN =
43 changes: 25 additions & 18 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
/** @type {import('next').NextConfig} */
const GRAFANA_DASHBOARD_URL =
'https://chainstack.grafana.net/public-dashboards/65c0fcb02f994faf845d4ec095771bd0?orgId=1';

const cspDirectives = [
"default-src 'self'",
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.segment.com https://www.googletagmanager.com https://www.google-analytics.com",
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com",
"font-src 'self' https://fonts.gstatic.com data:",
"img-src 'self' data: https:",
"frame-src https://chainstack.grafana.net",
"connect-src 'self' https://api.segment.io https://*.segment.io https://www.google-analytics.com",
"frame-ancestors 'none'",
"base-uri 'self'",
"form-action 'self'",
].join('; ');

const nextConfig = {
async headers() {
return [
{
source: '/api/:path*',
source: '/(.*)',
headers: [
{ key: 'Access-Control-Allow-Credentials', value: 'true' },
{ key: 'Access-Control-Allow-Origin', value: '*' },
{
key: 'Access-Control-Allow-Methods',
value: 'GET,DELETE,PATCH,POST,PUT',
},
{
key: 'Access-Control-Allow-Headers',
value:
'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version',
},
{ key: 'Content-Security-Policy', value: cspDirectives },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Referrer-Policy', value: 'no-referrer-when-downgrade' },
{ key: 'Strict-Transport-Security', value: 'max-age=63072000; includeSubDomains; preload' },
],
},
];
},
async redirects() {
return [
{
source: '/dashboard',
destination: 'https://chainstack.grafana.net/public-dashboards/65c0fcb02f994faf845d4ec095771bd0?orgId=1',
permanent: true
}
{ source: '/compare-single', destination: '/', permanent: true },
{ source: '/compare-double', destination: '/', permanent: true },
{ source: '/dashboard', destination: GRAFANA_DASHBOARD_URL, permanent: true },
];
},
reactStrictMode: false,
Expand All @@ -39,4 +46,4 @@ const withMDX = require('@next/mdx')({
},
});

module.exports = withMDX(nextConfig);
module.exports = withMDX(nextConfig);
Loading