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

Serve the profile image for the plugin from the plugin itself #50

Merged
merged 4 commits into from Mar 11, 2019

Conversation

jwilander
Copy link
Member

This is the long term fix for #46 but unfortunately it requires some changes within the Mattermost server to work properly. The issue is that the Mattermost client and server use an image proxy for profile pictures that rejects URLs using the localhost or the site URL for security reasons.

@hmhealey is going to bring this up with the Mattermost security team to discuss ways around this so that plugins can serve images used by the Mattermost clients.

Long term fixes #46

@jwilander jwilander added the Do Not Merge Should not be merged until this label is removed label Feb 22, 2019
hanzei pushed a commit that referenced this pull request Feb 22, 2019
@hanzei
Copy link
Contributor

hanzei commented Feb 25, 2019

he issue is that the Mattermost client and server use an image proxy for profile pictures that rejects URLs using the localhost or the site URL for security reasons.

Could you elaborate a bit? If you use $SITEURL/plugins/github/assets/profile.png this should work fine. This is how Matterpoll solves this problem.

The only problem is that this approach doesn't work if $SITEURL is localhost. See https://community.mattermost.com/core/pl/jwbhjkqyi7ny3cu9jh6zkr4sde for a discussion about this.

@jwilander
Copy link
Member Author

Interesting, I was talking with @hmhealey and brought up doing that but he seemed to think that wouldn't work either. If it's working for Matterpoll then it should work here

@jwilander
Copy link
Member Author

I will try doing that

@hanzei
Copy link
Contributor

hanzei commented Feb 26, 2019

Please be aware of this bug: https://mattermost.atlassian.net/browse/MM-14314

You can find the Matterpoll code here.

@jwilander jwilander added 2: Dev Review Requires review by a core committer and removed Do Not Merge Should not be merged until this label is removed labels Mar 8, 2019
@jwilander
Copy link
Member Author

Updated to use the SiteURL instead of a relative URL and tested to confirm it works when the SiteURL is not localhost.

@cpanato
Copy link
Contributor

cpanato commented Mar 10, 2019

/check-cla

Copy link
Contributor

@hanzei hanzei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTGM. 👍 One not blocking commend.

server/configuration.go Outdated Show resolved Hide resolved
@jwilander jwilander added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Mar 11, 2019
@jwilander jwilander merged commit f22f01c into master Mar 11, 2019
@jwilander jwilander deleted the server-profile-image branch March 11, 2019 14:35
IndushaS pushed a commit to IndushaS/mattermost-plugin-github that referenced this pull request Feb 8, 2021
* add pull request template to add the release note section

* add github action to notify on new releases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin user profile image is missing
4 participants