-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Please allow to disable gravatar.com service (user privacy) #5272
Comments
A workaround is to monkey-patch import ckan.lib.helpers as helpers
@helpers.core_helper
def gravatar(email_hash, size=100, default=None):
return helpers.literal('''<svg style="vertical-align:middle;" class="gravatar" width="{}" height="{}"><rect width="{}" height="{}" fill="#{}"/></svg>'''.format(
size, size, size, size, email_hash[:6]))
@helpers.core_helper
def linked_gravatar(email_hash, size=100, default=None):
return gravatar(email_hash, size, default)
# Monkey-patch to remove gravatar
helpers.gravatar = gravatar
helpers.linked_gravatar = gravatar |
Here is a nicer version using two circles: import ckan.lib.helpers as helpers
@helpers.core_helper
def gravatar(email_hash, size=100, default=None):
return helpers.literal('''
<svg style="vertical-align:middle;" class="gravatar" width="{size}" height="{size}">
<circle r="{r1}" cx="{center}" cy="{center}" fill="#{fill1}" stroke="gray" stroke-width="{stroke_width}"/>
<circle r="{r2}" cx="{center}" cy="{center}" fill="#{fill2}" stroke="gray" stroke-width="{stroke_width}"/>
</svg>'''.format(size=size, center=size/2, r1=size/3, r2=size/6,
fill1=email_hash[:6], fill2=email_hash[6:12],
stroke_width=size/100))
@helpers.core_helper
def linked_gravatar(email_hash, size=100, default=None):
return gravatar(email_hash, size, default)
# Monkey-patch to remove gravatar
helpers.gravatar = gravatar
helpers.linked_gravatar = gravatar Gravatar is a nice idea (upload your own image which will then be used whenever your email address matches), but in terms of user privacy, I think it's kind of outdated (no offense). I would even go as far as proposing to disable it by default... |
+1 to removal. gravatar (and md5summing email addresses) doesn't seem like a great idea anymore. |
In the same way the org/group ones work. Also image_display_url for the actual URL.
This will take into account first, the userr image_url first if set, and if no it will default to gravatar, unless it is disabled via configuration.
[#5272] User profile pictures uploads
I would like to disable the gravatar.com service in my CKAN instance. This is an issue because now I have to include gravatar.com in my site's privacy policies.
CKAN Version if known (or site URL)
2.8.3
Please describe the expected behaviour
It would be nice if I could disable gravatar via the CKAN .ini file, e.g.
Please describe the actual behaviour
I cannot disable this feature. I also cannot set a user-defined image.
The text was updated successfully, but these errors were encountered: