• GitLab无法显示头像的解决方法


    GitLab无法显示头像的解决方法

    1.原因

    在本地安装完GitLab服务后,会发现用户的头像部分显示不了。

    原因是因为GitLab默认使用了Gravatar的头像,而Gravatar目前是被墙的,所以访问不了。

    2.解决方案

    更换其URL为国内的某个镜像URL。

    3.解决方法

    3.0.前提

    我是使用docker部署gitlab的,启动命令如下:

    docker rm -f gitlab
    docker run --detach \
      --hostname "gitlab.xxx.com" \
      --publish 80:80 \
      --name gitlab \
      --restart always \
      --volume /usr/local/gitlab/volume/config:/etc/gitlab \
      --volume /usr/local/gitlab/volume/logs:/var/log/gitlab \
      --volume /usr/local/gitlab/volume/data:/var/opt/gitlab \
      gitlab/gitlab-ce:13.12.15-ce.0
    

    3.1.修改配置文件

    3.1.1.配置文件路径

    /usr/local/gitlab/volume/config/gitlab.rb
    

    注意

    配置文件并不是/usr/local/gitlab/volume/data/gitlab-rails/etc/gitlab.yml
    
    因为/usr/local/gitlab/volume/data/gitlab-rails/etc/gitlab.yml文件内容有以下说明:
    # This file is managed by gitlab-ctl. Manual changes will be
    # erased! To change the contents below, edit /etc/gitlab/gitlab.rb
    # and run `sudo gitlab-ctl reconfigure`.
    

    3.1.2.修改配置文件

    ### Gravatar Settings
    # gitlab_rails['gravatar_plain_url'] = 'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
    gitlab_rails['gravatar_plain_url'] = 'http://sdn.geekzu.org/avatar/%{hash}?s=%{size}&d=identicon' #添加这一行
    # gitlab_rails['gravatar_ssl_url'] = 'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
    gitlab_rails['gravatar_ssl_url'] = 'https://sdn.geekzu.org/avatar/%{hash}?s=%{size}&d=identicon' #添加这一行
    

    3.2.重启gitlab

    docker restart gitlab
    

    4.参考

    https://blog.csdn.net/redsoft_mymuch/article/details/115654869

  • 相关阅读:
    js自定义事件
    js回调函数
    git和github使用
    23种设计模式(10):命令模式
    HBase查询引擎——Phoenix的使用
    八、shell的管道
    七、Linux的shell的重定向
    五、Linux的常用命令 和 使用方式 1
    十二、TestNG分组测试2
    十一、TestNG依赖测试
  • 原文地址:https://www.cnblogs.com/ningkyolei/p/16091004.html
Copyright © 2020-2023  润新知