diff --git a/NOTICE b/NOTICE index 79f4f97a..cb6d45fd 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,9 @@ Dossier — Hinweise zu übernommenem und eingebundenem Fremdcode ([51]) +Material Symbols (Icon-Font, npm-Paket material-symbols, https://github.com/marella/material-symbols; Schrift von Google, + https://github.com/google/material-design-icons), Apache-2.0 + Lokal gebündelt (src/main.tsx), statt von fonts.googleapis.com geladen ([117]). + acadrust (https://github.com/hakanaktt/acadrust), MPL-2.0 Abhängigkeit von src-tauri/fileio (DXF/DWG lesen und schreiben), unverändert eingebunden. Der DWG-Code von acadrust ist aus ACadSharp portiert: diff --git a/TODO.md b/TODO.md index 148a38f0..c998af48 100644 --- a/TODO.md +++ b/TODO.md @@ -1048,7 +1048,7 @@ Prüfung des ganzen Programms (Rust-Kern, TS-Hülle, Build/Sicherheit), nur Code (Exporte/`saveBinaryFile` schreiben weiter direkt); in der Tauri-App nicht von Hand geprüft; Electron schreibt keine Dateien (Browser-Download), daher keine Änderung; keine Wiederherstellungs-UI für `.obp~`. · S - ✅ **[117] CSP setzen.** (3.11.) Eine Quelle `scripts/csp.cjs` (`script-src 'self' 'wasm-unsafe-eval'`, `worker-src 'self' blob:`, - `style-src` mit `'unsafe-inline'` für React-Inline-Styles + fonts.googleapis.com, `connect-src` = ipc + netFetch-Hosts + + `style-src` mit `'unsafe-inline'` für React-Inline-Styles (Icon-Font seit 3.11. lokal gebündelt: `material-symbols`, kein Google-Fonts-Host mehr), `connect-src` = ipc + netFetch-Hosts + localhost/127.0.0.1 + ws://127.0.0.1 für die KI-Brücke). Tauri: `tauri.conf.json` (`devCsp: null`, Test `src/net/csp.test.ts` gleicht mit `csp.cjs` und `ALLOWED_HOSTS` ab); Electron: Antwort-Header nur gepackt; Browser/e2e: Meta-Tag nur im Vite-Build (Dev-HMR unberührt). `e2e/csp.spec.ts` prüft Plan/Schnitt/Ansicht/3D auf CSP-Verletzungen. Rich-Text: Text war schon diff --git a/index.html b/index.html index c4cecd6d..c6df196e 100644 --- a/index.html +++ b/index.html @@ -3,14 +3,7 @@
- - - - + `https://${h}`); -// Icon-Font (index.html): Stylesheet von fonts.googleapis.com, Schrift von fonts.gstatic.com. -const GOOGLE_FONTS_CSS = "https://fonts.googleapis.com"; -const GOOGLE_FONTS_FILES = "https://fonts.gstatic.com"; const DIRECTIVES = { "default-src": ["'self'"], @@ -26,8 +23,8 @@ const DIRECTIVES = { // Import-Worker (DXF/IFC/Mesh/Punktwolke) und pdf.js-Worker: Modul-URLs aus dem eigenen Bundle. "worker-src": ["'self'", "blob:"], // React setzt viele Inline-`style`-Attribute -> 'unsafe-inline' (nur Stile, keine Skripte). - "style-src": ["'self'", "'unsafe-inline'", GOOGLE_FONTS_CSS], - "font-src": ["'self'", "data:", GOOGLE_FONTS_FILES], + "style-src": ["'self'", "'unsafe-inline'"], + "font-src": ["'self'", "data:"], "img-src": ["'self'", "data:", "blob:", ...https], "media-src": ["'self'", "blob:"], "connect-src": [ diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 55d26452..6a2493e2 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -21,7 +21,7 @@ } ], "security": { - "csp": "default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; img-src 'self' data: blob: https://ambientcg.com https://api.ambientcg.com https://geo.admin.ch https://api3.geo.admin.ch https://wms.geo.admin.ch https://data.geo.admin.ch https://overpass-api.de https://nominatim.openstreetmap.org; media-src 'self' blob:; connect-src 'self' ipc: http://ipc.localhost blob: data: https://ambientcg.com https://api.ambientcg.com https://geo.admin.ch https://api3.geo.admin.ch https://wms.geo.admin.ch https://data.geo.admin.ch https://overpass-api.de https://nominatim.openstreetmap.org http://localhost:* http://127.0.0.1:* ws://127.0.0.1:*; object-src 'none'; base-uri 'self'; form-action 'none'", + "csp": "default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; img-src 'self' data: blob: https://ambientcg.com https://api.ambientcg.com https://geo.admin.ch https://api3.geo.admin.ch https://wms.geo.admin.ch https://data.geo.admin.ch https://overpass-api.de https://nominatim.openstreetmap.org; media-src 'self' blob:; connect-src 'self' ipc: http://ipc.localhost blob: data: https://ambientcg.com https://api.ambientcg.com https://geo.admin.ch https://api3.geo.admin.ch https://wms.geo.admin.ch https://data.geo.admin.ch https://overpass-api.de https://nominatim.openstreetmap.org http://localhost:* http://127.0.0.1:* ws://127.0.0.1:*; object-src 'none'; base-uri 'self'; form-action 'none'", "devCsp": null } }, diff --git a/src/main.tsx b/src/main.tsx index e14a105b..e9ae27ff 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -11,6 +11,7 @@ import { initCore } from "./core"; import { getLanguage, setLanguage } from "./i18n"; import type { Language } from "./i18n"; import { applyThemeMode, getStoredThemeMode } from "./theme/themeMode"; +import "material-symbols/outlined.css"; import "./styles.css"; import "./text/fonts.css";