stage | group | info | type |
---|---|---|---|
Enablement |
Distribution |
To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments |
howto |
GitLab by default supports the Gravatar avatar service.
Libravatar is another service that delivers your avatar (profile picture) to other websites. The Libravatar API is heavily based on gravatar, so you can easily switch to the Libravatar avatar service or even your own Libravatar server.
In the gitlab.yml
gravatar section, set
the configuration options as follows:
gravatar:
enabled: true
# gravatar URLs: possible placeholders: %{hash} %{size} %{email} %{username}
plain_url: "http://cdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon"
gravatar:
enabled: true
# gravatar URLs: possible placeholders: %{hash} %{size} %{email} %{username}
ssl_url: "https://seccdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon"
If you are running your own Libravatar service, the URL is different in the configuration, but you must provide the same placeholders so GitLab can parse the URL correctly.
For example, you host a service on http://libravatar.example.com
and the
plain_url
you need to supply in gitlab.yml
is
http://libravatar.example.com/avatar/%{hash}?s=%{size}&d=identicon
In /etc/gitlab/gitlab.rb
:
gitlab_rails['gravatar_enabled'] = true
gitlab_rails['gravatar_plain_url'] = "http://cdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon"
gitlab_rails['gravatar_enabled'] = true
gitlab_rails['gravatar_ssl_url'] = "https://seccdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon"
Then run sudo gitlab-ctl reconfigure
for the changes to take effect.
Libravatar supports different sets of missing images for user email addresses that are not found on the Libravatar service.
To use a set other than identicon
, replace the &d=identicon
portion of the
URL with another supported set. For example, you can use the retro
set, in
which case the URL would look like: plain_url: "http://cdn.libravatar.org/avatar/%{hash}?s=%{size}&d=retro"
If your users are Office 365 users, the GetPersonaPhoto
service can be used.
Note that this service requires a login, so this use case is most useful in a
corporate installation where all users have access to Office 365.
gitlab_rails['gravatar_plain_url'] = 'http://outlook.office.com/owa/service.svc/s/GetPersonaPhoto?email=%{email}&size=HR120x120'
gitlab_rails['gravatar_ssl_url'] = 'https://outlook.office.com/owa/service.svc/s/GetPersonaPhoto?email=%{email}&size=HR120x120'