Gitlab 配置自定义 clone 地址

前情提要

  • 我是通过 docker 安装的 gitlab_ce ,版本 14.4.2。因为机器还要跑其他服务,所以不能使用 80、22 等端口,需要映射到其他端口。
  • 通过 gitlab.rb 配置文件配置的 external_url 只能配置在 clone 标签下得 host,不能带有端口号。

Clone with HTTP

  1. 首先必须是 Admin 账号。
  2. 进入 Admin Area。
  3. 在 Settings 的 General 中选择 Visibility and access controls。
  4. 往下拉,有一个标题为 Custom Git clone URL for HTTP(S) 的输入框。
  1. 可以在输入框中输入带端口号的 url。

  2. 保存就 OK 了。

Clone with SSH

  1. 在 gitlab.rb 中配置(/etc/gitlab/gitlab.rb)

  2. 搜索 gitlab_ssh_host

    // 配置主机地址
    gitlab_rails['gitlab_ssh_host'] = '192.168.72.90'

  3. 搜索 ssh_port

    // 配置主机的 ssh 端口
    gitlab_rails['gitlab_shell_ssh_port'] = 40022

  4. 保存,重启 gitlab,就完成了。

相关推荐
( •̀∀•́ )92012 小时前
GitHub Actions SSH 部署密钥
运维·ssh·github
Tjohn919 小时前
阿里云服务器yum install后服务器卡死,无法ssh
服务器·阿里云·ssh
LF3_1 天前
配置ssh免密登录
运维·ssh
Neolnfra2 天前
Xshell SSH 连接故障排查
运维·服务器·网络·ssh·xshell·运程连接
野生yumeko2 天前
wsl使用git
git·ssh·wsl
初学者_xuan2 天前
Git&GitLab安装gitlab(rocky系统)
git·gitlab
sunflower_level22 天前
【ssh key】登陆云服务器,github的安全密码
服务器·ssh·github
凤凰战士芭比Q2 天前
DevOps理念、Git(Git常用命令)、Gitlab仓库
git·gitlab·devops
青木川崎2 天前
Mac使用idea连接svn报错svn: E230001: Server SSL certificate verification failed
svn·intellij-idea·ssl
UVM_ERROR2 天前
RDMA Scheduler + TX + Completion RTL 开发经验分享
笔记·vscode·ssh·github·芯片