summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormattes <matthias.kadenbach@gmail.com>2014-09-05 03:57:28 +0200
committermattes <matthias.kadenbach@gmail.com>2014-12-31 18:37:31 -0800
commit56f211aa50246ff167894fcd050acad88d81f59e (patch)
tree71266a60f2f14dd80ec0ae4d07bd99ffc3da2159 /lib
parentac1584249c262e447a6360734597fa17fe077718 (diff)
downloadgitlab-ce-56f211aa50246ff167894fcd050acad88d81f59e.tar.gz
allow for private repositories
Diffstat (limited to 'lib')
-rw-r--r--lib/support/nginx/gitlab15
-rw-r--r--lib/support/nginx/gitlab-ssl15
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/support/nginx/gitlab b/lib/support/nginx/gitlab
index c8b769ace8e..ab6ca6e6260 100644
--- a/lib/support/nginx/gitlab
+++ b/lib/support/nginx/gitlab
@@ -56,6 +56,21 @@ server {
try_files $uri $uri/index.html $uri.html @gitlab;
}
+ ## If ``go get`` detected, return go-import meta tag.
+ ## This works for public and for private repositories.
+ ## See also http://golang.org/cmd/go/#hdr-Remote_import_paths
+ if ($http_user_agent ~* "Go") {
+ return 200 "
+ <!DOCTYPE html>
+ <html lang='en'>
+ <head>
+ <meta charset='utf-8'>
+ <meta content='$host$uri git $scheme://$host$uri.git' name='go-import'>
+ </head>
+ <body></body>
+ </html>";
+ }
+
## If a file, which is not found in the root folder is requested,
## then the proxy passes the request to the upsteam (gitlab unicorn).
location @gitlab {
diff --git a/lib/support/nginx/gitlab-ssl b/lib/support/nginx/gitlab-ssl
index 4e53d5e8b50..1903c9aa4fb 100644
--- a/lib/support/nginx/gitlab-ssl
+++ b/lib/support/nginx/gitlab-ssl
@@ -101,6 +101,21 @@ server {
try_files $uri $uri/index.html $uri.html @gitlab;
}
+ ## If ``go get`` detected, return go-import meta tag.
+ ## This works for public and for private repositories.
+ ## See also http://golang.org/cmd/go/#hdr-Remote_import_paths
+ if ($http_user_agent ~* "Go") {
+ return 200 "
+ <!DOCTYPE html>
+ <html lang='en'>
+ <head>
+ <meta charset='utf-8'>
+ <meta content='$host$uri git $scheme://$host$uri.git' name='go-import'>
+ </head>
+ <body></body>
+ </html>";
+ }
+
## If a file, which is not found in the root folder is requested,
## then the proxy passes the request to the upsteam (gitlab unicorn).
location @gitlab {