安装部署

https://docs.gitlab.com/omnibus/manual_install.html

  • 配置ssh免密之后发现还是需要输入密码

    网上的说法是:rpm安装过程当中会创建git用户,但是这个用户处在锁定状态,用下面这个命令解锁

    1
    2
    3
    4
    5
    6
    7
    8
    # 解锁
    sudo passwd -u -f git
    # 查看所有账号
    cat /etc/passwd
    # 查看xxx账户状态,是否被锁定
    passwd -S xxx
    # 锁定xxx账号
    usermod -L xxx
  • GitLab钩子

    https://docs.gitlab.com/ee/administration/custom_hooks.html

    1
    2
    /var/opt/gitlab/git-data/repositories/
    /opt/gitlab/embedded/service/gitlab-shell/hooks
  • 汉化

    https://gitlab.com/xhang/gitlab/-/wikis/home

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    # 获取当前版本,版本可能不一致
    gitlab_version=$(sudo cat /opt/gitlab/embedded/service/gitlab-rails/VERSION)
    # 克隆汉化版本库
    git clone https://gitlab.com/xhang/gitlab.git
    # 如果已经克隆过,则进行更新
    git fetch
    # 导出gitlab_version版本的汉化补丁
    git diff v${gitlab_version} v${gitlab_version}-zh > ../${gitlab_version}-zh.diff
    # 停止 gitlab
    sudo gitlab-ctl stop
    # 如果patch命令不存在 yum install -y patch
    sudo patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < ${gitlab_version}-zh.diff
    # 停止gitlab
    sudo gitlab-ctl stop
    sudo gitlab-ctl start
    sudo gitlab-ctl reconfigure