首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >故障排除-设置专用GitLab服务器并连接Gitlab运行程序

故障排除-设置专用GitLab服务器并连接Gitlab运行程序
EN

Stack Overflow用户
提问于 2022-02-09 17:33:48
回答 1查看 222关注 0票数 2

我有一个Gitlab实例运行在专用私有服务器上的docker中(只能从我们的vpc中访问)。我们想要开始使用Gitlab运行程序来进行CI,所以我设计了另一台服务器来托管我们的运行程序。

现在Gitlab-Runner已经配置好了,我尝试用Gitlab服务器的私有IP和注册令牌注册一个运行程序。

代码语言:javascript
复制
Enter the GitLab instance URL (for example, https://gitlab.com/):
$GITLAB_PRIVATE_IP
Enter the registration token:
$TOKEN
Enter a description for the runner:
[BEG-GITLAB-RUNNER]: default
Enter tags for the runner (comma-separated):
default
ERROR: Registering runner... failed                 runner=m616FJy- status=couldn't execute POST against https://$GITLAB_PRIVATE_IP/api/v4/runners: Post "https://$GITLAB_PRIVATE_IP/api/v4/runners": x509: certificate has expired or is not yet valid: current time 2022-02-06T20:00:35Z is after 2021-12-24T04:54:28Z

看来我们的证书已经过期,需要核实:

代码语言:javascript
复制
echo | openssl s_client -showcerts -connect $GITLAB_PRIVATE_IP:443 2>&1 | openssl x509 -noout -dates
notBefore=Nov 24 04:54:28 2021 GMT
notAfter=Dec 24 04:54:28 2021 GMT

Gitlab附带了“让我们加密”,因此我决定在gitlab rails中启用“让我们加密”和“证书自动生效”,但是当我尝试重新配置时,会得到错误消息:

代码语言:javascript
复制
There was an error running gitlab-ctl reconfigure:

letsencrypt_certificate[$GITLAB_PRIVATE_IP] (letsencrypt::http_authorization line 6) had an error: Acme::Client::Error::RejectedIdentifier: acme_certificate[staging] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/resources/certificate.rb line 41) had an error: Acme::Client::Error::RejectedIdentifier: Error creating new order :: Cannot issue for "$GITLAB_PRIVATE_IP": The ACME server can not issue a certificate for an IP address

因此,我似乎不能使用gitlab打包的“让我们加密”选项来启用证书的更新。

如何在没有域的私有linux服务器上创建/更新ssl证书?

如果您已经在私有服务器上设置了Gitlab +运行程序,那么您的rails配置是什么样子的?

是否有一种方法可以在专用服务器上启用DNS,仅用于颁发证书的证书颁发机构?

EN

回答 1

Stack Overflow用户

发布于 2022-05-24 06:29:27

我建议使用自我签署的证书,我已经测试过这个和它的工作良好,但需要一些工作。我将尝试总结一些所需的步骤:

代码语言:javascript
复制
1- generate Self-signed certificate with the domain you choose and make sure to keep it in /etc/gitlab-runner/certs/
2- you need to add the domain and certs path in /etc/gitlab/gitlab.rb
3- reconfigure giltab
4- when connecting the runner make sure to manually copy and activate certs to the runner server .
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71054170

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档