Skip to content
Snippets Groups Projects
Select Git revision
20 results

libravatar.md

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    libravatar.md 2.32 KiB

    Use Libravatar service with GitLab

    GitLab by default supports Gravatar avatar service. Libravatar is a service which delivers your avatar (profile picture) to other websites and their API is heavily based on gravatar.

    This means that it is not complicated to switch to Libravatar avatar service or even self hosted Libravatar server.

    Configuration

    In gitlab.yml gravatar section set the configuration options as follows:

    For HTTP

      gravatar:
        enabled: true
        # gravatar URLs: possible placeholders: %{hash} %{size} %{email}
        plain_url: "http://cdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon"

    For HTTPS

      gravatar:
        enabled: true
        # gravatar URLs: possible placeholders: %{hash} %{size} %{email}
        ssl_url: "https://seccdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon"

    Self-hosted

    If you are running your own libravatar service the URL will be different in the configuration but the important part is to provide the same placeholders so GitLab can parse the URL correctly.

    For example, you host a service on http://libravatar.example.com the plain_url you need to supply in gitlab.yml is

    http://libravatar.example.com/avatar/%{hash}?s=%{size}&d=identicon

    Omnibus-gitlab example

    In /etc/gitlab/gitlab.rb:

    For http

    gitlab_rails['gravatar_enabled'] = true
    gitlab_rails['gravatar_plain_url'] = "http://cdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon"

    For https

    gitlab_rails['gravatar_enabled'] = true
    gitlab_rails['gravatar_ssl_url'] = "https://seccdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon"

    Run sudo gitlab-ctl reconfigure for changes to take effect.