From 37270eab029169733a0e760512a105e7b7ee76bd Mon Sep 17 00:00:00 2001 From: evandrodevbr Date: Tue, 4 Aug 2026 03:32:15 -0300 Subject: [PATCH] security: define minimal frontend CSP Replace the disabled Tauri CSP with explicit local IPC and API connectivity while retaining only required asset and inline-style allowances. --- src-tauri/tauri.conf.json | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index af95823..08c3778 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Transcript", - "version": "0.1.0", + "version": "0.3.1", "identifier": "com.transcript.desktop", "build": { "beforeDevCommand": "npm run dev", @@ -14,23 +14,38 @@ { "title": "Transcript", "label": "main", - "width": 600, - "height": 560, + "width": 380, + "height": 460, "minWidth": 360, - "minHeight": 420, - "resizable": true, + "minHeight": 72, + "maxWidth": 820, + "maxHeight": 460, + "resizable": false, + "maximizable": false, + "minimizable": true, + "closable": true, "alwaysOnTop": true, - "visible": true + "visible": true, + "decorations": false, + "transparent": true, + "backgroundColor": "#00000000", + "shadow": false, + "dragDropEnabled": false, + "center": true } ], "security": { - "csp": null + "csp": "default-src 'self' ipc: http://ipc.localhost; connect-src 'self' ipc: http://ipc.localhost http://127.0.0.1:8000; img-src 'self' asset: https://asset.localhost data:; style-src 'self' 'unsafe-inline'; script-src 'self'" } }, "bundle": { "active": true, - "targets": "all", - "icon": ["icons/icon.ico"], - "externalBin": ["binaries/sherpa-onnx-offline"] + "resources": ["resources/whisper/"], + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.ico" + ] } }