如果external_url设置,Gitlab docker不工作 [英] Gitlab docker not working if external_url is set

查看:4621
本文介绍了如果external_url设置,Gitlab docker不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力一段时间,遇到一个我仍然无法解决的问题。帮助将不胜感激!
我做了什么:
1)使用我的服务器上的Ubuntu 16.04.1 LTS虚拟机上的docker映像(8.9.6-ce.0)安装Gitlab-CE,后跟 http://docs.gitlab.com/omnibus/docker/README.html
2)在同一个局域网中为一台机器设置一些项目>>所有工作ok
3)添加一个新的映射到我的防火墙,以映射gitlab-machine-ip:80> example.org:8138,以便我可以使用http

I've been struggling for a while with a problem that I'm still unable to solve. Help would be much appreciated! What I did: 1) Install Gitlab-CE using the docker image (8.9.6-ce.0) on an Ubuntu 16.04.1 LTS virtual machine in my server following http://docs.gitlab.com/omnibus/docker/README.html 2) Setup a user locally and push some projects for a machine in the same LAN >> all working ok 3) Add a new mapping to my firewall to map gitlab-machine-ip:80 > example.org:8138 so that I can access gitlab with http

访问gitlab我现在可以访问 http://example.org:8138 并使用它
现在的问题:克隆项目的URL显示错误,因为他们错过了:8138端口(他们得到example.org部分从--host设置传递到docker容器)。
如果我手动将自定义端口添加到URL中,则克隆工作正常

I'm now able to access the web interface at http://example.org:8138 and use it NOW THE PROBLEM: the URLs for cloning projects show up incorrectly since they miss the :8138 port (they get the example.org part from the --host setting passed to the docker container). Cloning works ok if I manually add my custom ports to the URLs

我想解决这个问题,所以尝试在gitlab.rb设置中的external_url设置它到:
external_url' http://example.org:8138 '
并重新启动(也尝试手动调用gitlab-ctl配置)

I wanted to solve this so gave a try to the external_url setting in gitlab.rb setting it to: external_url 'http://example.org:8138' and restarted (also tried calling gitlab-ctl configure manually)

状态是我无法访问WEB界面, http://example.org:8138 在浏览器中获取ERR_CONNECTION_REFUSED
如果我只是注释掉external_url设置,所有内容都恢复工作(除了URL中缺少的端口显然)

STATUS IS THAT I CANNOT ACCESS THE WEB INTERFACE ANYMORE AT http://example.org:8138 getting a ERR_CONNECTION_REFUSED in my browser If I just comment out the external_url setting everything is back working (apart from the missing port in URLs obviously)

我已经阅读了一大堆问题报告,但没有一个帮助解决问题:
https://gitlab.com/gitlab-org/omnibus-gitlab/issues/244 >>(我是不使用外部NGINX)
也尝试更新到8.11 af我读了这个: https://gitlab.com/gitlab-org/gitlab -ce / issues / 20131 ,但它没有帮助

I've read a bunch of issues report but none of them helped in solving the issue: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/244 >> (I'm NOT using an external NGINX) also tried updating to 8.11 after I read about this: https://gitlab.com/gitlab-org/gitlab-ce/issues/20131 but it did not help

不知道这里发生了什么。
gitlab-rake gitlab的输出:env:info和gitlab-rake gitlab:check following

Don't really know what's going on here. Output of gitlab-rake gitlab:env:info and gitlab-rake gitlab:check follows

System information
System: 
Current User:   git
Using RVM:  no
Ruby Version:   2.3.1p112
Gem Version:    2.6.6
Bundler Version:2.3.0
Rake Version:   10.5.0
Sidekiq Version:4.1.4

GitLab information
Version:    8.11.3
Revision:   6cd4edb
Directory:  /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL:    http://example.org:8138
HTTP Clone URL: http://example.org:8138/some-group/some-project.git
SSH Clone URL:  git@example.org:some-group/some-project.git
Using LDAP: no
Using Omniauth: no

GitLab Shell
Version:    3.4.0
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks:  /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git:    /opt/gitlab/embedded/bin/git







Checking GitLab Shell ...

GitLab Shell version >= 3.4.0 ? ... OK (3.4.0)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ... 
telemed / banca ... ok
telemed / calcolatrice ... ok
telemed / chat ... ok
telemed / collections ... ok
telemed / interfacce ... ok
telemed / partite ... ok
telemed / polimorfismo ... ok
telemed / ristoranti ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ... 
telemed / banca ... yes
telemed / calcolatrice ... yes
telemed / chat ... yes
telemed / collections ... yes
telemed / interfacce ... yes
telemed / partite ... yes
telemed / polimorfismo ... yes
telemed / ristoranti ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.1)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 4

Checking GitLab ... Finished


推荐答案

Ok可以自己弄清楚这个问题。
当您更改gitlab.rb中的external_url参数时,可以使用副作用(如果您问我,文档中不太清楚),那么nginx现在将在您放入 http://example.org 8138

Ok was able to figure out the problem on my own. Apparetly when you change the external_url parameter in gitlab.rb there's the side effect (not very clearly explained in the documentation if you ask me!) that nginx will now run on the port you put in the http://example.org:8138

自我通过我的防火墙将端口80映射到我的外部URL上,然后gitlab网站不再可达。我建议在文档中明确指出,更改external_url(如果包含端口号)将导致nginx和网站在不同于标准80的端口上运行http!

Since I instead mapped port 80 on my external URL through my firewall then the gitlab website was not reachable anymore. I would suggest to clearly state in the documentation that changing external_url (if a port number is included) would cause nginx and the website to run http on a different port than the standard 80!!!!

希望这有助于其他一些类似我的问题的人:轻微的:

Hope this helps some other people having a problem similar to mine :slight_smile:

这篇关于如果external_url设置,Gitlab docker不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆