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

[Feature] User avatars from external source #7743

Closed
mjovanovic0 opened this issue Aug 15, 2017 · 4 comments

Comments

@mjovanovic0
Copy link
Contributor

commented Aug 15, 2017

We have internal service for employee images and in that service we have API for fetching user image.

We would like to be able to set user avatar as URL to that service so that avatar is not downloaded into Rocket.Chat configured storage.

Example:
For user test service URL would be https://acme.com/api/v1/test and service call returns PNG/JPEG image (depending on what type of image user uploads).

Rocket.Chat for user avatar provides /avatar/{username} which loads user avatar from configured storage.
Provide a way to either change /avatar/{username} to https://acme.com/api/v1/{username} or maybe easier approach would be performing HTTP.302 - Redirect to https://acme.com/api/v1/{username} from /avatar/{username} when accessed.

@localguru

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2017

Good idea. One thing to keep in mind with external content: If the remote service doesn't offer https you will get SSL warnings in your browser's status bar, same as with non ssl link previews, see #7490

@mjovanovic0

This comment has been minimized.

Copy link
Contributor Author

commented Oct 26, 2017

@phlbrz

This comment has been minimized.

Copy link

commented Apr 30, 2018

Hello all,
I know it is an old feature not approved yet, but I think it's a great idea. Thank's to @mjovanovic0 .

Like sync.js store avatar, it could be the same to avoid performance issues when loading the image. e.g.:

fileStore.insert(file, rs, () => {

Could I use an url that is not an API and use username from template var? e.g: http(s)://acme.com/${username}.jpg ?
@RocketChat @RocketChat/core @sampaiodiego @ggazzo @geekgonecrazy

@mjovanovic0

This comment has been minimized.

Copy link
Contributor Author

commented Apr 30, 2018

@phlbrz As long as the URL returns image binary as payload and correct Content-Type header I don't see a reason why you should not use http(s)://acme.com/${username}.jpg.

Also regarding storing avatar locally, I would like for that to be an option that admin can choose, as for our use case this is not applicable because users can change their image at any time in image service and we want that image to propagate to every external service that use image (Rocket.Chat, GitLab, other internal apps).

Currently we achieve this by implementing custom logic on image service to call Rocket.Chat REST API /api/v1/users.setAvatar but we would like to remove this custom develop solution.

@engelgabriel engelgabriel added this to the 0.75.0 milestone Jan 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.