From 72b35613bc260c5a4e788d0d0521e868e441cf4e Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Mon, 12 May 2025 14:50:51 -0400 Subject: [PATCH] fix csp configs --- .../artcraft/capabilities/default.json | 25 ++++++++++++- crates/desktop/artcraft/tauri.conf.json | 36 +++++++++++++++++-- frontend/apps/editor3d/tsconfig.json | 3 -- .../libs/components/promptbox/tsconfig.json | 3 ++ .../components/promptbox/tsconfig.lib.json | 3 ++ 5 files changed, 63 insertions(+), 7 deletions(-) diff --git a/crates/desktop/artcraft/capabilities/default.json b/crates/desktop/artcraft/capabilities/default.json index f40dadbe37..b4dbf5710a 100644 --- a/crates/desktop/artcraft/capabilities/default.json +++ b/crates/desktop/artcraft/capabilities/default.json @@ -27,5 +27,28 @@ ] }, "dialog:default" - ] + ], + "app": { + "csp": { + "default-src": [ + "'self'", + "'unsafe-inline'", + "'unsafe-eval'", + "https://*.storyteller.ai", + "https://*.fakeyou.com" + ], + "script-src": [ + "'self'", + "'unsafe-inline'", + "'unsafe-eval'", + "https://*.storyteller.ai", + "https://*.fakeyou.com" + ], + "connect-src": [ + "'self'", + "https://*.storyteller.ai", + "https://*.fakeyou.com" + ] + } + } } \ No newline at end of file diff --git a/crates/desktop/artcraft/tauri.conf.json b/crates/desktop/artcraft/tauri.conf.json index 700306c606..b048e69bdc 100644 --- a/crates/desktop/artcraft/tauri.conf.json +++ b/crates/desktop/artcraft/tauri.conf.json @@ -21,11 +21,41 @@ ], "security": { "csp": { - "default-src": "*", - "connect-src": "*", + "default-src": [ + "'self'", + "'unsafe-eval'", + "'unsafe-inline'", + "blob:", + "data:", + "https://*.fakeyou.com", + "https://*.storyteller.ai", + "ipc://localhost", + "tauri://localhost" + ], + "connect-src": [ + "'self'", + "'unsafe-eval'", + "'unsafe-inline'", + "blob:", + "data:", + "https://*.fakeyou.com", + "https://*.storyteller.ai", + "ipc://localhost", + "tauri://localhost" + ], "font-src": "*", "img-src": "* data: blob: 'unsafe-inline'", - "style-src": "*" + "style-src": [ + "'self'", + "'unsafe-eval'", + "'unsafe-inline'", + "blob:", + "data:", + "https://*.fakeyou.com", + "https://*.storyteller.ai", + "ipc://localhost", + "tauri://localhost" + ] } } }, diff --git a/frontend/apps/editor3d/tsconfig.json b/frontend/apps/editor3d/tsconfig.json index bb9d38b73c..30a8f52b5d 100644 --- a/frontend/apps/editor3d/tsconfig.json +++ b/frontend/apps/editor3d/tsconfig.json @@ -48,9 +48,6 @@ { "path": "../../libs/components/toaster" }, - { - "path": "../../libs/components/demo-modal" - }, { "path": "../../libs/components/login-modal" }, diff --git a/frontend/libs/components/promptbox/tsconfig.json b/frontend/libs/components/promptbox/tsconfig.json index 4ae3a8d5c2..271c32e9e5 100644 --- a/frontend/libs/components/promptbox/tsconfig.json +++ b/frontend/libs/components/promptbox/tsconfig.json @@ -2,6 +2,9 @@ "files": [], "include": [], "references": [ + { + "path": "../../tauri-api" + }, { "path": "../camera-settings-modal" }, diff --git a/frontend/libs/components/promptbox/tsconfig.lib.json b/frontend/libs/components/promptbox/tsconfig.lib.json index aa58099405..7dc89b03ea 100644 --- a/frontend/libs/components/promptbox/tsconfig.lib.json +++ b/frontend/libs/components/promptbox/tsconfig.lib.json @@ -43,6 +43,9 @@ "src/**/*.tsx" ], "references": [ + { + "path": "../../tauri-api/tsconfig.lib.json" + }, { "path": "../camera-settings-modal/tsconfig.lib.json" },