From 8b74ebafa5e2510c57da5fe9b67e2d7b8056f92c Mon Sep 17 00:00:00 2001 From: Nurfog Date: Sat, 28 Mar 2026 08:55:35 -0300 Subject: [PATCH] fix: Update permissions and API routing for CMS integration --- .qwen/settings.json | 7 +- .qwen/settings.json.orig | 14 ---- docker-compose.yml | 2 +- nginx/studio-api-location.conf | 5 +- web/studio/next.config.mjs | 118 +++++++++++++++++++++++++++++++++ 5 files changed, 129 insertions(+), 17 deletions(-) delete mode 100644 .qwen/settings.json.orig diff --git a/.qwen/settings.json b/.qwen/settings.json index be3bc4e..6622031 100644 --- a/.qwen/settings.json +++ b/.qwen/settings.json @@ -11,7 +11,12 @@ "Bash(mkdir *)", "Bash(ssh *)", "Bash(git fetch *)", - "Bash(git add *)" + "Bash(git add *)", + "Bash(git commit *)", + "Bash(git push *)", + "Bash(scp *)", + "Bash(curl *)", + "Bash(sudo *)" ] }, "$version": 3 diff --git a/.qwen/settings.json.orig b/.qwen/settings.json.orig deleted file mode 100644 index 71a9513..0000000 --- a/.qwen/settings.json.orig +++ /dev/null @@ -1,14 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(rm *)", - "Bash(sed *)", - "Bash(ls *)", - "Bash(true)", - "Bash(cargo check *)", - "Bash(cargo build *)", - "Bash(chmod *)", - "Bash(mkdir *)" - ] - } -} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 9b78aed..7d89776 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: - vhost:/etc/nginx/vhost.d - html:/usr/share/nginx/html - ./nginx/proxy.conf:/etc/nginx/conf.d/proxy.conf:ro - - ./nginx/studio-api-location.conf:/etc/nginx/vhost.d/studio.norteamericano.com_location:ro + - ./nginx/studio.norteamericano.com:/etc/nginx/vhost.d/studio.norteamericano.com:ro restart: always networks: - openccb-network diff --git a/nginx/studio-api-location.conf b/nginx/studio-api-location.conf index 43d75bd..216bb2f 100644 --- a/nginx/studio-api-location.conf +++ b/nginx/studio-api-location.conf @@ -1,6 +1,9 @@ # CMS API routes - redirect to CMS service (port 3001) +# This file is included at the server level for studio.norteamericano.com + +# Handle CMS API routes before the main location block location ~ ^/(auth|courses|modules|lessons|assets|organization|branding|users|admin|question-bank|test-templates|knowledge-base|api|webhooks|grading|libraries|rubrics|learning-sequences|audit-logs|analytics|cohorts|announcements|submissions|peer-reviews|instructors|token-usage|sam|embeddings|health) { - proxy_pass http://openccb-studio:3001; + proxy_pass http://172.18.0.6:3001; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/web/studio/next.config.mjs b/web/studio/next.config.mjs index 2813912..e7d61e6 100644 --- a/web/studio/next.config.mjs +++ b/web/studio/next.config.mjs @@ -17,6 +17,11 @@ const nextConfig = { port: '3001', pathname: '/assets/**', }, + { + protocol: 'https', + hostname: 'studio.norteamericano.com', + pathname: '/assets/**', + }, ], }, async rewrites() { @@ -25,6 +30,119 @@ const nextConfig = { source: '/assets/:path*', destination: 'http://localhost:3001/assets/:path*', }, + // Proxy API routes to CMS service + { + source: '/auth/:path*', + destination: 'http://localhost:3001/auth/:path*', + }, + { + source: '/courses/:path*', + destination: 'http://localhost:3001/courses/:path*', + }, + { + source: '/modules/:path*', + destination: 'http://localhost:3001/modules/:path*', + }, + { + source: '/lessons/:path*', + destination: 'http://localhost:3001/lessons/:path*', + }, + { + source: '/organization/:path*', + destination: 'http://localhost:3001/organization/:path*', + }, + { + source: '/branding/:path*', + destination: 'http://localhost:3001/branding/:path*', + }, + { + source: '/users/:path*', + destination: 'http://localhost:3001/users/:path*', + }, + { + source: '/admin/:path*', + destination: 'http://localhost:3001/admin/:path*', + }, + { + source: '/question-bank/:path*', + destination: 'http://localhost:3001/question-bank/:path*', + }, + { + source: '/test-templates/:path*', + destination: 'http://localhost:3001/test-templates/:path*', + }, + { + source: '/knowledge-base/:path*', + destination: 'http://localhost:3001/knowledge-base/:path*', + }, + { + source: '/api/:path*', + destination: 'http://localhost:3001/api/:path*', + }, + { + source: '/webhooks/:path*', + destination: 'http://localhost:3001/webhooks/:path*', + }, + { + source: '/grading/:path*', + destination: 'http://localhost:3001/grading/:path*', + }, + { + source: '/libraries/:path*', + destination: 'http://localhost:3001/libraries/:path*', + }, + { + source: '/rubrics/:path*', + destination: 'http://localhost:3001/rubrics/:path*', + }, + { + source: '/learning-sequences/:path*', + destination: 'http://localhost:3001/learning-sequences/:path*', + }, + { + source: '/audit-logs/:path*', + destination: 'http://localhost:3001/audit-logs/:path*', + }, + { + source: '/analytics/:path*', + destination: 'http://localhost:3001/analytics/:path*', + }, + { + source: '/cohorts/:path*', + destination: 'http://localhost:3001/cohorts/:path*', + }, + { + source: '/announcements/:path*', + destination: 'http://localhost:3001/announcements/:path*', + }, + { + source: '/submissions/:path*', + destination: 'http://localhost:3001/submissions/:path*', + }, + { + source: '/peer-reviews/:path*', + destination: 'http://localhost:3001/peer-reviews/:path*', + }, + { + source: '/instructors/:path*', + destination: 'http://localhost:3001/instructors/:path*', + }, + { + source: '/token-usage/:path*', + destination: 'http://localhost:3001/token-usage/:path*', + }, + { + source: '/sam/:path*', + destination: 'http://localhost:3001/sam/:path*', + }, + { + source: '/embeddings/:path*', + destination: 'http://localhost:3001/embeddings/:path*', + }, + { + source: '/health', + destination: 'http://localhost:3001/health', + }, ]; }, };