Show More
@@ -63,6 +63,13 b' cut_off_limit = 256000' | |||
|
63 | 63 | force_https = false |
|
64 | 64 | commit_parse_limit = 50 |
|
65 | 65 | use_gravatar = true |
|
66 | ## alternative_gravatar_url allows you to use your own avatar server application | |
|
67 | ## the following parts of the URL will be replaced | |
|
68 | ## %(email)s user email | |
|
69 | ## %(md5email)s md5 hash of the user email (like at gravatar.com) | |
|
70 | ## %(size)s size of the image that is expected from the server application | |
|
71 | #alternative_gravatar_url = http://myavatarserver.com/getbyemail/%(email)s/%(size)s | |
|
72 | #alternative_gravatar_url = http://myavatarserver.com/getbymd5/%(md5email)s?s=%(size)s | |
|
66 | 73 | container_auth_enabled = false |
|
67 | 74 | proxypass_auth_enabled = false |
|
68 | 75 | default_encoding = utf8 |
@@ -711,6 +711,11 b' HasRepoPermissionAny, HasRepoPermissionA' | |||
|
711 | 711 | #============================================================================== |
|
712 | 712 | |
|
713 | 713 | def gravatar_url(email_address, size=30): |
|
714 | if(str2bool(config['app_conf'].get('use_gravatar')) and | |
|
715 | config['app_conf'].get('alternative_gravatar_url')): | |
|
716 | return config['app_conf'].get('alternative_gravatar_url') % {'email': email_address, | |
|
717 | 'md5email': hashlib.md5(email_address.lower()).hexdigest(), | |
|
718 | 'size': size} | |
|
714 | 719 | if (not str2bool(config['app_conf'].get('use_gravatar')) or |
|
715 | 720 | not email_address or email_address == 'anonymous@rhodecode.org'): |
|
716 | 721 | f = lambda a, l: min(l, key=lambda x: abs(x - a)) |
General Comments 0
You need to be logged in to leave comments.
Login now