Custom Local Avatars


(Jeff Atwood) #1

One of the most requested features in the last few months is easily custom avatars. Although Discourse has always supported standard Internet-wide Gravatars based on the account email address, there were some long-standing concerns: Some people simply don’t like Gravatar, for whatever reason, though as a WordPress company they are (at least in my opinion)


This topic is for comments on the original blog entry at: Custom Local Avatars


(Erlend Sogge Heggen) #2

This is an outrage!

(on second thought, I see your point…)


(Evaryont 🎆) #3

Have you thought about adding support for one of the new(ish) distributed avatar protocols? Such as Libravatar or Pavatar?


(Jeff Atwood) #4

Thanks for bringing those to my attention.

Pavatar looks pretty dead. The page has a date of 2006 for the “latest spec”, and the latest post on their support forum is from 2008! And I’ve never heard of it until now. This does not bode well.

As for Libravatar, it says:

How is Libravatar different from Gravatar though? The main difference is that while Libravatar.org is an online avatar hosting service just like Gravatar, the software that powers the former is also available for download under a free software license.

Why would you want to run your own instance? Our belief is that centralised approaches don’t put users in control. If you own your own domain name, you control how mail is delivered to your domain. You should also be able to control how avatars are served to other websites.

For example, if you own a business, you may want to integrate with existing systems (e.g. a staff directory) and delegate authentication to what you’re already using (LDAP?). Plus, you can choose what happens when email addresses are not found (display your company logo?).

So this is an additional layer of complexity. Rather than Discourse being the single point of truth for avatars, there’s another service you install alongside it which is…

I dunno, I think merely serving avatars is not that useful of a service to run, the difficulty of spinning it up is not worth what it provides to you versus Gravatar.


(Daniel Friesen) #5

Speaking of pavatar. Here’s the reason it was rejected from microformats.org’s registry of rel values.
[uf-discuss] rel=“pavatar”

I don’t completely agree with the rationale for rejection (hCard makes me want to vomit) but it does make you think that some other standards out there could be used to support turning personal urls into avatar sources besides depending on Gravatar.


(Dave Lane) #6

While you can, of course, host your own “libravatar” instance, you can also make use of the exemplar of Libravatar, https://libravatar.org, exactly as you would Gravatar. No need to host your own. That Libravatar service is just like Gravatar, except with more freedom attached…

In theory, you should be able to swap the libravatar.org URL for the gravatar.com URL in Discourse’s configuration. I’m new to Discourse, so I haven’t seen if it’s an admin-editable URL, or if it has to be done in the filesystem (I suspect the latter) - it’d be very cool if this was abstracted into the admin settings (along with switches for the explanatory links that currently lead users to Gravatar.com) interface. I’d prefer to use Libravatar over Gravatar.

By the way, if you create a Libravatar account, it will help you import your existing Gravatar.com email addresses and associated images, so it’s an easy transition.


(Dave Lane) #7

I should point out that the Mozilla developer who had a lot to do with Mozilla Persona, Francois Marier, is also the main developer behind Libravatar… so, given that association, it seems fitting to at least allow the option of Libravatar in Discourse :smile:


(Sam Saffron) #8

Keep in mind, our implementation of gravatar is very secure and private. Unlike the vast amount of implementations in the wild.

We cache all images on the server, users have to opt-in to update avatar from gravatar.

This means gravatar is not getting any information about browsing habits and other nasty analytics every 5 minutes.


(Dave Lane) #9

Given that Libravatar is both FOSS and a drop-in (API compatible) replacement for Gravatar, it seems like it offers some philosophical advantages and wouldn’t add substantially to the complexity of the codebase to allow implementations of Discourse to decide which service they prefer. I understand it might not be a priority for you guys at the moment - would you be open to a pull request if I can implement the support?


(Sam Saffron) #10

I am open to making core more extensible and then you can use a plugin for libravatar support. A PR for the extensibility points is the best approach here.


(Dave Lane) #11

Fair enough. Will look into how to do that. Thanks.


(Jeff Atwood) #12