fix(csp): add wss and tauri to conf template (#1974)

* fix(csp): add wss and tauri to conf template

* add change file, update examples/docs

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
nothingismagick 2021-06-15 18:37:24 +02:00 committed by GitHub
parent fb1f483a33
commit 463fd00d06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 68 additions and 39 deletions

View File

@ -0,0 +1,5 @@
---
"cli.rs": patch
---
Change the `csp` value on the template to include `wss:` and `tauri:` to the `default-src` attribute.

View File

@ -17,7 +17,7 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}, },
"updater": { "updater": {
"active": false "active": false

View File

@ -358,7 +358,7 @@ Instead of launching the app directly, we configure the bundled app to run a scr
"fullscreen": false "fullscreen": false
}], }],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
} }
} }
``` ```

View File

@ -107,7 +107,7 @@ App directory structure
App App
tauri.rs - 1.0.0-beta.1 tauri.rs - 1.0.0-beta.1
build-type - bundle build-type - bundle
CSP - default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self' CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
distDir - ../public distDir - ../public
devPath - ../public devPath - ../public
framework - Svelte framework - Svelte

View File

@ -78,10 +78,10 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
}, },
"systemTray": { "systemTray": {
"iconPath": "../../.icons/icon.png" "iconPath": "../../.icons/icon.png"
} }
} }
} }

View File

@ -1,7 +1,11 @@
{ {
"build": { "build": {
"distDir": ["../index.html"], "distDir": [
"devPath": ["../index.html"], "../index.html"
],
"devPath": [
"../index.html"
],
"beforeDevCommand": "", "beforeDevCommand": "",
"beforeBuildCommand": "" "beforeBuildCommand": ""
}, },
@ -47,10 +51,10 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}, },
"updater": { "updater": {
"active": false "active": false
} }
} }
} }

View File

@ -1,7 +1,11 @@
{ {
"build": { "build": {
"distDir": ["../index.html"], "distDir": [
"devPath": ["../index.html"], "../index.html"
],
"devPath": [
"../index.html"
],
"beforeDevCommand": "", "beforeDevCommand": "",
"beforeBuildCommand": "" "beforeBuildCommand": ""
}, },
@ -47,10 +51,10 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}, },
"updater": { "updater": {
"active": false "active": false
} }
} }
} }

View File

@ -1,7 +1,11 @@
{ {
"build": { "build": {
"distDir": ["../index.html"], "distDir": [
"devPath": ["../index.html"], "../index.html"
],
"devPath": [
"../index.html"
],
"withGlobalTauri": true "withGlobalTauri": true
}, },
"tauri": { "tauri": {
@ -39,7 +43,7 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}, },
"updater": { "updater": {
"active": false "active": false

View File

@ -48,10 +48,10 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}, },
"updater": { "updater": {
"active": false "active": false
} }
} }
} }

View File

@ -1,7 +1,11 @@
{ {
"build": { "build": {
"distDir": ["../index.html"], "distDir": [
"devPath": ["../index.html"], "../index.html"
],
"devPath": [
"../index.html"
],
"beforeDevCommand": "", "beforeDevCommand": "",
"beforeBuildCommand": "" "beforeBuildCommand": ""
}, },
@ -47,10 +51,10 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}, },
"updater": { "updater": {
"active": false "active": false
} }
} }
} }

View File

@ -42,10 +42,10 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
}, },
"updater": { "updater": {
"active": false "active": false
} }
} }
} }

View File

@ -1,7 +1,11 @@
{ {
"build": { "build": {
"distDir": ["../index.html"], "distDir": [
"devPath": ["../index.html"], "../index.html"
],
"devPath": [
"../index.html"
],
"beforeDevCommand": "", "beforeDevCommand": "",
"beforeBuildCommand": "" "beforeBuildCommand": ""
}, },
@ -47,10 +51,10 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}, },
"updater": { "updater": {
"active": false "active": false
} }
} }
} }

View File

@ -1,7 +1,11 @@
{ {
"build": { "build": {
"distDir": ["../index.html"], "distDir": [
"devPath": ["../index.html"], "../index.html"
],
"devPath": [
"../index.html"
],
"beforeDevCommand": "", "beforeDevCommand": "",
"beforeBuildCommand": "" "beforeBuildCommand": ""
}, },
@ -47,7 +51,7 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}, },
"updater": { "updater": {
"active": true, "active": true,
@ -58,4 +62,4 @@
] ]
} }
} }
} }

View File

@ -47,10 +47,10 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}, },
"updater": { "updater": {
"active": false "active": false
} }
} }
} }

View File

@ -47,10 +47,10 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}, },
"updater": { "updater": {
"active": false "active": false
} }
} }
} }

View File

@ -47,10 +47,10 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
}, },
"updater": { "updater": {
"active": false "active": false
} }
} }
} }

View File

@ -61,7 +61,7 @@
} }
], ],
"security": { "security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
} }
} }
} }