Move csp and add some sources.

This commit is contained in:
Jiiks 2019-03-05 21:02:06 +02:00
parent 07d3629622
commit b68c1fbd04
3 changed files with 29 additions and 8 deletions

25
core/src/csp.json Normal file
View File

@ -0,0 +1,25 @@
{
"img-src": [
"https://cdn.betterttv.net",
"https://cdn.frankerfacez.com",
"https://i.imgur.com"
],
"style-src": [
"https://fonts.googleapis.com"
],
"script-src": [
"'sha256-fSHKdpQGCHaIqWP3SpJOuUHrLp49jy4dWHzZ/RBJ/p4='",
"'sha256-VFJcfKY5B3EBkFDgQnv3CozPwBlZcxwssfLVWlPFfZU='",
"'sha256-VzDmLZ4PxPkOS/KY7ITzLQsSWhfCnvUrNculcj8UNgE='",
"'sha256-l6K+77Z1cmldR9gIvaVWlboF/zr5MXCQHcsEHfnr5TU='"
],
"connect-src": [
"https://github.com",
"https://api.github.com",
"https://betterdiscord.net",
"https://api.betterdiscord.net",
"https://cdn.betterdiscord.net",
"https://api.supersecretbdapiandcdn.net",
"https://cdn.supersecretbdapiandcdn.net"
]
}

3
core/src/csp.txt Normal file
View File

@ -0,0 +1,3 @@
React Devtools: sha256-fSHKdpQGCHaIqWP3SpJOuUHrLp49jy4dWHzZ/RBJ/p4=
Vue Devtools: sha256-VFJcfKY5B3EBkFDgQnv3CozPwBlZcxwssfLVWlPFfZU=
Vue Detector: sha256-l6K+77Z1cmldR9gIvaVWlboF/zr5MXCQHcsEHfnr5TU=

View File

@ -54,14 +54,7 @@ const sparkplug = path.resolve(__dirname, 'sparkplug.js');
let configProxy; let configProxy;
const CSP = { const CSP = TESTS ? require('../src/csp.json') : require('./csp.json');
'img-src': ['https://cdn.betterttv.net', 'https://cdn.frankerfacez.com'],
'script-src': [
`'sha256-fSHKdpQGCHaIqWP3SpJOuUHrLp49jy4dWHzZ/RBJ/p4='`, // React Devtools
`'sha256-VFJcfKY5B3EBkFDgQnv3CozPwBlZcxwssfLVWlPFfZU='`, // Vue Devtools
`'sha256-VzDmLZ4PxPkOS/KY7ITzLQsSWhfCnvUrNculcj8UNgE=' 'sha256-l6K+77Z1cmldR9gIvaVWlboF/zr5MXCQHcsEHfnr5TU='` // Vue Detector
]
};
class Comms { class Comms {
constructor(bd) { constructor(bd) {