Skip to content

Commit 463fd00

Browse files
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>
1 parent fb1f483 commit 463fd00

File tree

17 files changed

+68
-39
lines changed

17 files changed

+68
-39
lines changed

Diff for: .changes/template-csp-change.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"cli.rs": patch
3+
---
4+
5+
Change the `csp` value on the template to include `wss:` and `tauri:` to the `default-src` attribute.

Diff for: core/tauri/test/fixture/src-tauri/tauri.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
],
1919
"security": {
20-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
20+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
2121
},
2222
"updater": {
2323
"active": false

Diff for: docs/api/config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ Instead of launching the app directly, we configure the bundled app to run a scr
358358
"fullscreen": false
359359
}],
360360
"security": {
361-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
361+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
362362
}
363363
}
364364
```

Diff for: docs/usage/development/integration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ App directory structure
107107
App
108108
tauri.rs - 1.0.0-beta.1
109109
build-type - bundle
110-
CSP - default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
110+
CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
111111
distDir - ../public
112112
devPath - ../public
113113
framework - Svelte

Diff for: examples/api/src-tauri/tauri.conf.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@
7878
}
7979
],
8080
"security": {
81-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
81+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
8282
},
8383
"systemTray": {
8484
"iconPath": "../../.icons/icon.png"
8585
}
8686
}
87-
}
87+
}

Diff for: examples/commands/src-tauri/tauri.conf.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"build": {
3-
"distDir": ["../index.html"],
4-
"devPath": ["../index.html"],
3+
"distDir": [
4+
"../index.html"
5+
],
6+
"devPath": [
7+
"../index.html"
8+
],
59
"beforeDevCommand": "",
610
"beforeBuildCommand": ""
711
},
@@ -47,10 +51,10 @@
4751
}
4852
],
4953
"security": {
50-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
54+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
5155
},
5256
"updater": {
5357
"active": false
5458
}
5559
}
56-
}
60+
}

Diff for: examples/helloworld/src-tauri/tauri.conf.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"build": {
3-
"distDir": ["../index.html"],
4-
"devPath": ["../index.html"],
3+
"distDir": [
4+
"../index.html"
5+
],
6+
"devPath": [
7+
"../index.html"
8+
],
59
"beforeDevCommand": "",
610
"beforeBuildCommand": ""
711
},
@@ -47,10 +51,10 @@
4751
}
4852
],
4953
"security": {
50-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
54+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
5155
},
5256
"updater": {
5357
"active": false
5458
}
5559
}
56-
}
60+
}

Diff for: examples/multiwindow/src-tauri/tauri.conf.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"build": {
3-
"distDir": ["../index.html"],
4-
"devPath": ["../index.html"],
3+
"distDir": [
4+
"../index.html"
5+
],
6+
"devPath": [
7+
"../index.html"
8+
],
59
"withGlobalTauri": true
610
},
711
"tauri": {
@@ -39,7 +43,7 @@
3943
}
4044
],
4145
"security": {
42-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
46+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
4347
},
4448
"updater": {
4549
"active": false

Diff for: examples/navigation/src-tauri/tauri.conf.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@
4848
}
4949
],
5050
"security": {
51-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
51+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
5252
},
5353
"updater": {
5454
"active": false
5555
}
5656
}
57-
}
57+
}

Diff for: examples/params/src-tauri/tauri.conf.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"build": {
3-
"distDir": ["../index.html"],
4-
"devPath": ["../index.html"],
3+
"distDir": [
4+
"../index.html"
5+
],
6+
"devPath": [
7+
"../index.html"
8+
],
59
"beforeDevCommand": "",
610
"beforeBuildCommand": ""
711
},
@@ -47,10 +51,10 @@
4751
}
4852
],
4953
"security": {
50-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
54+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
5155
},
5256
"updater": {
5357
"active": false
5458
}
5559
}
56-
}
60+
}

Diff for: examples/splashscreen/src-tauri/tauri.conf.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
}
4343
],
4444
"security": {
45-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
45+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
4646
},
4747
"updater": {
4848
"active": false
4949
}
5050
}
51-
}
51+
}

Diff for: examples/state/src-tauri/tauri.conf.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"build": {
3-
"distDir": ["../index.html"],
4-
"devPath": ["../index.html"],
3+
"distDir": [
4+
"../index.html"
5+
],
6+
"devPath": [
7+
"../index.html"
8+
],
59
"beforeDevCommand": "",
610
"beforeBuildCommand": ""
711
},
@@ -47,10 +51,10 @@
4751
}
4852
],
4953
"security": {
50-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
54+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
5155
},
5256
"updater": {
5357
"active": false
5458
}
5559
}
56-
}
60+
}

Diff for: examples/updater/src-tauri/tauri.conf.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"build": {
3-
"distDir": ["../index.html"],
4-
"devPath": ["../index.html"],
3+
"distDir": [
4+
"../index.html"
5+
],
6+
"devPath": [
7+
"../index.html"
8+
],
59
"beforeDevCommand": "",
610
"beforeBuildCommand": ""
711
},
@@ -47,7 +51,7 @@
4751
}
4852
],
4953
"security": {
50-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
54+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
5155
},
5256
"updater": {
5357
"active": true,
@@ -58,4 +62,4 @@
5862
]
5963
}
6064
}
61-
}
65+
}

Diff for: tooling/bench/tests/cpu_intensive/src-tauri/tauri.conf.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
}
4848
],
4949
"security": {
50-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
50+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
5151
},
5252
"updater": {
5353
"active": false
5454
}
5555
}
56-
}
56+
}

Diff for: tooling/bench/tests/files_transfer/src-tauri/tauri.conf.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
}
4848
],
4949
"security": {
50-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
50+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
5151
},
5252
"updater": {
5353
"active": false
5454
}
5555
}
56-
}
56+
}

Diff for: tooling/bench/tests/helloworld/src-tauri/tauri.conf.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
}
4848
],
4949
"security": {
50-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
50+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
5151
},
5252
"updater": {
5353
"active": false
5454
}
5555
}
56-
}
56+
}

Diff for: tooling/cli.rs/templates/src-tauri/tauri.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
}
6262
],
6363
"security": {
64-
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
64+
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
6565
}
6666
}
6767
}

0 commit comments

Comments
 (0)