美文网首页
Gitlab启用SSL

Gitlab启用SSL

作者: 87d6dc4b11a7 | 来源:发表于2024-01-03 15:21 被阅读0次
docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 8090:8090 --publish 2222:22 \
  --name gitlab \
  --restart always \
  -v /etc/localtime:/etc/localtime \
  -v /srv/gitlab/config:/etc/gitlab \
  -v /srv/gitlab/logs:/var/log/gitlab \
  -v /srv/gitlab/data:/var/opt/gitlab \
  --shm-size 512m \
  gitlab/gitlab-ce:16.4.1-ce.0

1、Make the following changes to /etc/gitlab/gitlab.rb:

# Update external_url from "http" to "https"
external_url "https://my-host.internal"

# Set Let's Encrypt to false
letsencrypt['enable'] = false

2、Create the following directories with the appropriate permissions for generating self-signed certificates:

sudo mkdir -p /etc/gitlab/ssl
sudo chmod 755 /etc/gitlab/ssl
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/gitlab/ssl/my-host.internal.key -out /etc/gitlab/ssl/my-host.internal.crt

3、Reconfigure your instance to apply the changes:

sudo gitlab-ctl reconfigure

相关文章

网友评论

      本文标题:Gitlab启用SSL

      本文链接:https://www.haomeiwen.com/subject/gxtvndtx.html