Skip to content

Commit 30cf83e

Browse files
committed
fix(admin): resolve CSP and API URL issues
- Add *.docs.plus to CSP connect-src for API calls - Remove /api from NEXT_PUBLIC_API_URL (endpoints include /api) - Exclude Next.js 15 missing manifests from PWA precache
1 parent 987b1cd commit 30cf83e

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

docker-compose.prod.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ services:
497497
args:
498498
NEXT_PUBLIC_SUPABASE_URL: ${NEXT_PUBLIC_SUPABASE_URL}
499499
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${NEXT_PUBLIC_SUPABASE_ANON_KEY}
500-
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-https://prodback.docs.plus/api}
500+
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-https://prodback.docs.plus}
501501
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-https://docs.plus}
502502
restart: always
503503
stop_grace_period: 30s
@@ -508,7 +508,7 @@ services:
508508
HOSTNAME: '0.0.0.0'
509509
NEXT_PUBLIC_SUPABASE_URL: ${NEXT_PUBLIC_SUPABASE_URL}
510510
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${NEXT_PUBLIC_SUPABASE_ANON_KEY}
511-
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-https://prodback.docs.plus/api}
511+
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-https://prodback.docs.plus}
512512
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-https://docs.plus}
513513
networks:
514514
- docsplus-network

packages/admin-dashboard/next.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const nextConfig = {
5252
"style-src 'self' 'unsafe-inline'",
5353
`img-src 'self' data: blob: https://*.supabase.co https://*.googleusercontent.com${isDev ? ' http://localhost:* http://127.0.0.1:*' : ''}`,
5454
"font-src 'self' data:",
55-
`connect-src 'self' https://*.supabase.co wss://*.supabase.co https://accounts.google.com${localDevHosts}`,
55+
`connect-src 'self' https://*.supabase.co wss://*.supabase.co https://accounts.google.com https://*.docs.plus${localDevHosts}`,
5656
`frame-src 'self' https://accounts.google.com${isDev ? ' http://localhost:*' : ''}`,
5757
"frame-ancestors 'none'",
5858
"form-action 'self'",

packages/admin-dashboard/src/constants/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
export const APP_URL = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3001'
77

88
// API URL for backend requests
9+
// API_URL is the base URL - endpoints include /api/admin/... paths
910
export const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'
1011

1112
// Default page size for tables

packages/webapp/next.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ const withPWA = require('next-pwa')({
99
disable: !isProduction,
1010
register: true,
1111
skipWaiting: false,
12-
runtimeCaching
13-
// disableDevLogs: true,
12+
runtimeCaching,
13+
// Exclude files that don't exist in Next.js 15+
14+
buildExcludes: [/dynamic-css-manifest\.json$/, /middleware-manifest\.json$/]
1415
})
1516

1617
module.exports = withPWA({

0 commit comments

Comments
 (0)