我已经设置好了,我们正在运行GitLab v6.0.1的默认安装(我们即将升级).这是一个"生产"设置,遵循本指南正好写到这封信:
https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md
现在,我们如何安全地更改工作安装的URL?
显然我们的网址很长,我们想出了一个新网址.我编辑了许多配置文件,"应用程序状态检查"报告一切正常.我重新启动了服务器,以确保一切正常.
我可以通过原始SSL访问Nginx.我可以浏览GitLab站点,创建一个存储库等.我可以分叉并提交就好了.
一切似乎都没问题; 但是,由于这不是我的原生环境,我想仔细检查我是否已经完成了重命名GitLab网站的所有工作.
我编辑的文件是:
/etc/hosts
127.0.0.1 localhost
10.0.0.10 wake.domain.com wake
10.0.0.10 git.domain.com git
/home/git/gitlab/config/gitlab.yml
production: &base
gitlab:
host: git.domain.com
/home/git/gitlab-shell/config.yml
gitlab_url: "https://git.domain.com"
^- yes, we are on SSL and that is working, even on a new URL
/etc/nginx/sites-available/gitlab
server {
server_name git.domain.com
Run Code Online (Sandbox Code Playgroud)
Jon*_*art 154
对于Omnibus安装,它有点不同.
Omnibus安装中的正确位置是:
/etc/gitlab/gitlab.rb
external_url 'http://gitlab.example.com'
Run Code Online (Sandbox Code Playgroud)
最后,您需要执行sudo gitlab-ctl reconfigure
,sudo gitlab-ctl restart
因此更改适用.
我在错误的地方做了改变,他们被吹走了.
在不正确的路径是:
/opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
/var/opt/gitlab/.gitconfig
/var/opt/gitlab/nginx/conf/gitlab-http.conf
Run Code Online (Sandbox Code Playgroud)
请注意以下警告:
# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run `sudo gitlab-ctl reconfigure`.
Run Code Online (Sandbox Code Playgroud)
Raz*_*zer 29
你做的一切都正确!
您还可以更改电子邮件配置,具体取决于电子邮件服务器是否也是同一服务器.电子邮件配置在gitlab.yml中,用于GitLab发送的邮件以及admin-email.
use*_*650 13
external_url
更新参数后不要忘记清除缓存/etc/gitlab/gitlab.rb
,否则您现有的项目克隆 URL 仍将显示您的旧主机名。
更改主机名的简单 3 步过程如下
external_url
参数/etc/gitlab/gitlab.rb
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
sudo gitlab-rake cache:clear
参考:
https://forum.gitlab.com/t/clone-url-wont-change/21692/6
实际上,这并不完全正确.我来到这个页面,试图回答这个问题我自己,因为我们是从转变生产GitLab服务器http://
来https://
和最如上所述的东西是工作,但是当你登录到https://server
,一切都看起来很好......除了当您浏览到一个项目或存储库,它显示SSH和HTTP指令...它显示"http",它显示的说明也说"http".
我发现了一些可以编辑的东西:
/home/git/gitlab/config/gitlab.yml
production: &base
gitlab:
host: git.domain.com
# Also edit these:
port: 443
https: true
...
Run Code Online (Sandbox Code Playgroud)
和
/etc/nginx/sites-available/gitlab
server {
server_name git.domain.com;
# Also edit these:
listen 443 ssl;
ssl_certificate /etc/ssl/certs/somecert.crt;
ssl_certificate_key /etc/ssl/private/somekey.key;
...
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
126236 次 |
最近记录: |