-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- When Content Policy is enabled, allow one URL to have iframe that e…
…mbeds Wekan - Add option to turn off Content Policy - Allow always in Wekan markdown <img src="any-image-url-here"> Thanks to xet7 ! Closes #1676
- Loading branch information
Showing
6 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
import { BrowserPolicy } from 'meteor/browser-policy-common'; | ||
|
||
Meteor.startup(() => { | ||
|
||
if ( process.env.BROWSER_POLICY_ENABLED === 'true' ) { | ||
// Trusted URL that can embed Wekan in iFrame. | ||
const trusted = process.env.TRUSTED_URL; | ||
BrowserPolicy.framing.disallow(); | ||
BrowserPolicy.content.disallowInlineScripts(); | ||
BrowserPolicy.content.disallowEval(); | ||
BrowserPolicy.content.allowInlineStyles(); | ||
BrowserPolicy.content.allowFontDataUrl(); | ||
BrowserPolicy.framing.restrictToOrigin(trusted); | ||
BrowserPolicy.content.allowScriptOrigin(trusted); | ||
} | ||
else { | ||
// Disable browser policy and allow all framing and including. | ||
// Use only at internal LAN, not at Internet. | ||
BrowserPolicy.framing.allowAll(); | ||
BrowserPolicy.content.allowDataUrlForAll(); | ||
} | ||
|
||
// Allow all images from anywhere | ||
BrowserPolicy.content.allowImageOrigin('*'); | ||
|
||
// If Matomo URL is set, allow it. | ||
const matomoUrl = process.env.MATOMO_ADDRESS; | ||
if (matomoUrl){ | ||
BrowserPolicy.content.allowScriptOrigin(matomoUrl); | ||
BrowserPolicy.content.allowImageOrigin(matomoUrl); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters