From 6ceb22f014c54f69b5534f8aad848c2a5bbac07d Mon Sep 17 00:00:00 2001 From: haex Date: Sun, 2 Nov 2025 14:28:06 +0100 Subject: [PATCH] Bundle Iconify icons locally and enhance CSP for Tauri protocols - Add lucide and hugeicons to serverBundle collections for local bundling - Add https://tauri.localhost and asset: protocol to CSP directives - Prevents CSP errors and eliminates dependency on Iconify API --- nuxt.config.ts | 2 +- src-tauri/tauri.conf.json | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index d874adc..2b3373d 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -68,7 +68,7 @@ export default defineNuxtConfig({ includeCustomCollections: true, }, serverBundle: { - collections: ['mdi', 'line-md', 'solar', 'gg', 'emojione'], + collections: ['mdi', 'line-md', 'solar', 'gg', 'emojione', 'lucide', 'hugeicons'], }, customCollections: [ diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index aca5877..d4da637 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -20,10 +20,12 @@ ], "security": { "csp": { - "default-src": ["'self'", "http://tauri.localhost", "haex-extension:"], + "default-src": ["'self'", "http://tauri.localhost", "https://tauri.localhost", "asset:", "haex-extension:"], "script-src": [ "'self'", "http://tauri.localhost", + "https://tauri.localhost", + "asset:", "haex-extension:", "'wasm-unsafe-eval'", "'unsafe-inline'" @@ -31,6 +33,8 @@ "style-src": [ "'self'", "http://tauri.localhost", + "https://tauri.localhost", + "asset:", "haex-extension:", "'unsafe-inline'" ], @@ -45,13 +49,15 @@ "img-src": [ "'self'", "http://tauri.localhost", + "https://tauri.localhost", + "asset:", "haex-extension:", "data:", "blob:" ], - "font-src": ["'self'", "http://tauri.localhost", "haex-extension:"], + "font-src": ["'self'", "http://tauri.localhost", "https://tauri.localhost", "asset:", "haex-extension:"], "object-src": ["'none'"], - "media-src": ["'self'", "http://tauri.localhost", "haex-extension:"], + "media-src": ["'self'", "http://tauri.localhost", "https://tauri.localhost", "asset:", "haex-extension:"], "frame-src": ["haex-extension:"], "frame-ancestors": ["'none'"], "base-uri": ["'self'"]