mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Loosen CSP in Obsidian to load images, sync and allow Obsidian domain
This commit is contained in:
parent
327045be43
commit
08c3aa496d
1 changed files with 3 additions and 3 deletions
|
@ -82,12 +82,12 @@ export class KhojChatView extends KhojPaneView {
|
|||
super.onOpen();
|
||||
|
||||
// Construct Content Security Policy
|
||||
let defaultDomains = `'self' ${this.setting.khojUrl} https://app.khoj.dev https://assets.khoj.dev`;
|
||||
let defaultDomains = `'self' ${this.setting.khojUrl} https://*.obsidian.md https://app.khoj.dev https://assets.khoj.dev`;
|
||||
const defaultSrc = `default-src ${defaultDomains};`;
|
||||
const scriptSrc = `script-src ${defaultDomains} 'unsafe-inline';`;
|
||||
const connectSrc = `connect-src ${this.setting.khojUrl} https://ipapi.co/json;`;
|
||||
const connectSrc = `connect-src ${this.setting.khojUrl} wss://*.obsidian.md/ https://ipapi.co/json;`;
|
||||
const styleSrc = `style-src ${defaultDomains} 'unsafe-inline';`;
|
||||
const imgSrc = `img-src ${defaultDomains} data: https://*.khoj.dev https://*.googleusercontent.com;`;
|
||||
const imgSrc = `img-src * app: data:;`;
|
||||
const childSrc = `child-src 'none';`;
|
||||
const objectSrc = `object-src 'none';`;
|
||||
const csp = `${defaultSrc} ${scriptSrc} ${connectSrc} ${styleSrc} ${imgSrc} ${childSrc} ${objectSrc}`;
|
||||
|
|
Loading…
Reference in a new issue