The Wayback Machine - https://web.archive.org/web/20210908043309/https://github.com/mattermost/mattermost-server/issues/18288
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable unsafe-eval and unsafe-inline when EnableDeveloper is true #18288

Open
mattermod opened this issue Aug 27, 2021 · 0 comments · May be fixed by #18289
Open

Enable unsafe-eval and unsafe-inline when EnableDeveloper is true #18288

mattermod opened this issue Aug 27, 2021 · 0 comments · May be fixed by #18289

Comments

@mattermod
Copy link
Contributor

@mattermod mattermod commented Aug 27, 2021

Today we allow the unsafe-eval and unsafe-inline CSP directives only when the server was compiled as a developer build:

// Add unsafe-eval to the content security policy for faster source maps in development mode
devCSP := ""
if model.BuildNumber == "dev" {
devCSP += " 'unsafe-eval'"
}
// Add unsafe-inline to unlock extensions like React & Redux DevTools in Firefox
// see https://github.com/reduxjs/redux-devtools/issues/380
if model.BuildNumber == "dev" {
devCSP += " 'unsafe-inline'"
}

Let’s key this off the ServiceSetings.EnableDeveloper mode instead. I'm in a situation where I'd love to be able to debug a plugin on a non-dev-built server (specifically, https://subpath.test.mattermost.com/) but can't deploy a debug build given these constraints. (And can't realistically deploy a custom server build.)

Issue created from a message in Mattermost.


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-38177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment