nginxプロキシを備えたGitlab8は、zipをダウンロードできず、パブリックリポジトリをゲストとして複製できず、CIでもビルドできません。

gdurelle

3つの問題はすべて同じ問題に関連していると思うので、ここですべてを説明します。

Gitlab自体は機能しており、8.2.2から8.2.3に更新することもできました。プロジェクトの作成、コードのプッシュ、プル、適切なsshキーがあれば再クローン化などを行うことができます。

だが:

  1. コードをzipファイルとしてダウンロードできません。代わりにJSONを取得しました。

{"RepoPath": "/ var / opt / gitlab / git-data / repository / me / myrepo.git"、 "ArchivePrefix": ".. ..

  1. パブリックリポジトリのクローンを作成できません(空のリポジトリエラー)。

  2. CIは私のテストを構築できません:

警告:空のリポジトリのクローンを作成しました。開発として12345をチェックアウトしています...致命的:参照はツリーではありません:123456789mycommithash987654321

エラー:ビルドが失敗しました:終了ステータス1

注意:私はフランス語のエラーメッセージを翻訳しました。

問題は私のNginx構成にあると思いますが、どれが適切かわからないドキュメントがたくさんあります。主力製品のもの、gitlab.rbのgitlab_git_http_serverを変更する必要があるものなどです。

私の構成は次のとおりです。

  • Gitlab 8.2.3
  • Ubuntu Trusty(14.04)
  • Nginx 1.8

私のgitlabはSLLを使用してサブドメインでホストされているため、Nginxプロキシを追加しました

/etc/gitlab/gitlab.rb

external_url 'https://gitlab.mydomain.com'
nginx['listen_addresses'] = ['127.0.0.1', "[::1]"]
nginx['listen_port'] = 8080 
nginx['listen_https'] = false 

/ etc / nginx / site_enabled / gitlab

server {
  listen *:80 default_server;
  listen [::]:80 ipv6only=on default_server;
  server_name gitlab.mydomain.com;
  return 301 https://$server_name$request_uri;

  access_log  /var/log/nginx/gitlab_access.log;
  error_log   /var/log/nginx/gitlab_error.log;
}

server{
  # listen 443 ssl;
  listen 0.0.0.0:443 ssl default_server;
  listen [::]:443 ipv6only=on ssl default_server; 
  server_name gitlab.mydomain.com;
  server_tokens off;

  location /{
    proxy_pass http://localhost:8080;
    proxy_redirect off;
    proxy_set_header    Host                $http_host;
    proxy_set_header    X-Real-IP           $remote_addr;
    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
    proxy_set_header    X-Forwarded-Proto   $scheme;
  }

  location ~ ^/(assets)/ {
    root /opt/gitlab/embedded/service/gitlab-rails/public;
    gzip_static on; # to serve pre-gzipped version
    expires max;
    add_header Cache-Control public;
  }

  client_max_body_size 250m;

  # ...
  # A lot a of SSL stuff (HSTS, OCSP, dhparam, etc)
  # ...

  access_log  /var/log/nginx/gitlab_access.log;
  error_log   /var/log/nginx/gitlab_error.log;
  
  error_page 502 /502.html;

更新:

Gilabを8.3.0にアップグレードしました。

今すぐ502をGitします。

適用:https//gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/8.2-to-8.3.md

わかります。

更新2:

結局、指示を完了せず、すべてを停止し、すべてを2回再起動しました(GitlabとNginx)ついに問題を機能させることができました。

CI / Zip / PublicCloningでも同じ問題が発生します。

更新3:

8.2.3に更新するだけです apt-get update apt-get install gitlab-ce

502。

nginx gitlab-ctlrestartを再起動します

gitlab-rake gitlab:app:check

Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
Database is SQLite ... no
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: ... 

Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.1.7)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 1.7.10 ? ... yes (2.6.1)
Active users: 2

Checking GitLab ... Finished

誰かが私を適切なドキュメントや変更に導くことができれば、それは素晴らしいことです。

gdurelle

始まりですが、すべてではありません:

誤ってGitlabのnginxに8080ポートをリッスンさせました。すでにGitlabのUnicornで使用されているポートの場合。

これを8081に変更すると、CIの応答が向上しました。それでもgitユーザーの権利を解決する必要があります(またはより良いのはdockerを使用する)が、それはここで重要なことの直接的な問題ではありません...

更新:完全なソリューション-ACL

インストールプロセス中に作成されたgitおよびgitlab-runnerユーザーには十分な権限があるようです。

最初に:それぞれに実際のホームを作成します:/ home / gitlab-runner適切なsshauthorized_keysを使用した/ home / git、およびrbenv + ruby​​のインストール。

次にそしてvim /etc/passwd、完全な権限を持つ新しいホームのホームディレクトリを変更します。今、私のビルドはグリーンです!

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

Related 関連記事

ホットタグ

アーカイブ