Update CSP, dependencies, and add choice label generator
Replaces nginx.conf CSP map with inline policy and updates the policy for development. Adds new dependencies including Mantine, Radix, Tabler, FontAwesome, and others. Removes the fetch-openapi.js script and introduces generate-choice-labels.cjs to auto-generate TypeScript choice label constants from Orval enums, updating the api:gen script to run this generator. Also updates orval and other dev dependencies, and makes minor formatting changes in orval.config.ts.
This commit is contained in:
@@ -14,11 +14,6 @@ http {
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
# Content Security Policy - organized for better readability
|
||||
map $request_uri $csp_policy {
|
||||
default "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src * data: blob:; connect-src 'self' http://127.0.0.1:8000 http://localhost:8000 ws: wss: https://api.paylibo.com; font-src 'self' data: https://fonts.gstatic.com";
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
@@ -32,7 +27,7 @@ http {
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
# Ensure CSP is present on SPA document responses too
|
||||
add_header Content-Security-Policy $csp_policy always;
|
||||
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https://api.paylibo.com; connect-src 'self' http://127.0.0.1:8000 http://localhost:8000 ws: wss: https://api.paylibo.com; font-src 'self' data:" always;
|
||||
}
|
||||
|
||||
# -------------------------
|
||||
@@ -64,7 +59,7 @@ http {
|
||||
client_max_body_size 50m;
|
||||
|
||||
# Ensure CSP is also present on proxied responses
|
||||
add_header Content-Security-Policy $csp_policy always;
|
||||
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https://api.paylibo.com; connect-src 'self' http://127.0.0.1:8000 http://localhost:8000 ws: wss: https://api.paylibo.com; font-src 'self' data:" always;
|
||||
}
|
||||
|
||||
# -------------------------
|
||||
@@ -74,10 +69,7 @@ http {
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
|
||||
# CSP Policy - Centrally defined above for better maintainability
|
||||
# To add new domains, update the $csp_policy map above
|
||||
# Development: More permissive for external resources
|
||||
# Production: Should be more restrictive and use nonces/hashes where possible
|
||||
add_header Content-Security-Policy $csp_policy always;
|
||||
# Minimal, valid CSP for development (apply on all responses)
|
||||
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https://api.paylibo.com; connect-src 'self' http://127.0.0.1:8000 http://localhost:8000 ws: wss: https://api.paylibo.com; font-src 'self' data:" always;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user