@@ -57,29 +57,29 @@ static_files = true
# en, fr, ja, pt_BR, zh_CN, zh_TW
lang = en
cache_dir = %(here)s/data
index_dir = %(here)s/data/index
app_instance_uuid = rc-develop
cut_off_limit = 256000
force_https = false
commit_parse_limit = 25
use_gravatar = true
## alternative_gravatar_url allows you to use your own avatar server application
## the following parts of the URL will be replaced
## %(email)s user email
## %(md5email)s md5 hash of the user email (like at gravatar.com)
## %(size)s size of the image that is expected from the server application
#alternative_gravatar_url = http://myavatarserver.com/getbyemail/%(email)s/%(size)s
#alternative_gravatar_url = http://myavatarserver.com/getbymd5/%(md5email)s?s=%(size)s
## {email} user email
## {md5email} md5 hash of the user email (like at gravatar.com)
## {size} size of the image that is expected from the server application
#alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
#alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
container_auth_enabled = false
proxypass_auth_enabled = false
default_encoding = utf8
## overwrite schema of clone url
## available vars:
## scheme - http/https
## user - current user
## pass - password
## netloc - network location
## path - usually repo_name
app_instance_uuid = rc-production
commit_parse_limit = 50
app_instance_uuid = ${app_instance_uuid}
@@ -704,27 +704,30 @@ def action_parser(user_log, feed=False):
#==============================================================================
from rhodecode.lib.auth import HasPermissionAny, HasPermissionAll, \
HasRepoPermissionAny, HasRepoPermissionAll
# GRAVATAR URL
def gravatar_url(email_address, size=30):
if(str2bool(config['app_conf'].get('use_gravatar')) and
config['app_conf'].get('alternative_gravatar_url')):
return config['app_conf'].get('alternative_gravatar_url') % {'email': email_address,
'md5email': hashlib.md5(email_address.lower()).hexdigest(),
'size': size}
tmpl = config['app_conf'].get('alternative_gravatar_url', '')
tmpl = tmpl.replace('{email}', email_address)\
.replace('{md5email}', hashlib.md5(email_address.lower()).hexdigest())\
.replace('{size}', str(size))
return tmpl
if (not str2bool(config['app_conf'].get('use_gravatar')) or
not email_address or email_address == 'anonymous@rhodecode.org'):
f = lambda a, l: min(l, key=lambda x: abs(x - a))
return url("/images/user%s.png" % f(size, [14, 16, 20, 24, 30]))
ssl_enabled = 'https' == request.environ.get('wsgi.url_scheme')
default = 'identicon'
baseurl_nossl = "http://www.gravatar.com/avatar/"
baseurl_ssl = "https://secure.gravatar.com/avatar/"
baseurl = baseurl_ssl if ssl_enabled else baseurl_nossl
if isinstance(email_address, unicode):
Status change: