Commit cc575875b6c46d384601037645970667a12c8017

Authored by Ábner Oliveira
2 parents 44aa6b90 ae1a3148

Merge branch 'master' of https://github.com/gitlabhq/gitlabhq

CONTRIBUTING.md
... ... @@ -24,9 +24,12 @@ Issues and merge requests should be in English and contain appropriate language
24 24  
25 25 To get support for your particular problem please use the channels as detailed in the [getting help section of the readme](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/README.md#getting-help). Professional [support subscriptions](http://www.gitlab.com/subscription/) and [consulting services](http://www.gitlab.com/consultancy/) are available from [GitLab.com](http://www.gitlab.com/).
26 26  
27   -The [issue tracker](https://gitlab.com/gitlab-org/gitlab-ce/issues) is only for obvious bugs or misbehavior in the latest [stable or development release of GitLab](MAINTENANCE.md). When submitting an issue please conform to the issue submission guidelines listed below. Not all issues will be addressed and your issue is more likely to be addressed if you submit a merge request which partially or fully addresses the issue.
  27 +The [issue tracker](https://gitlab.com/gitlab-org/gitlab-ce/issues) is only for obvious bugs in the latest [stable or development release of GitLab](MAINTENANCE.md).
  28 +If something is missing but it is not a regression compared to older versions of GitLab please do not open an issue but a feature request.
  29 +When submitting an issue please conform to the issue submission guidelines listed below.
  30 +Not all issues will be addressed and your issue is more likely to be addressed if you submit a merge request which partially or fully addresses the issue.
28 31  
29   -Do not use the issue tracker for feature requests. We have a specific [feedback and suggestions forum](http://feedback.gitlab.com) for this purpose.
  32 +Do not use the issue tracker for feature requests. We have a specific [feature request forum](http://feedback.gitlab.com) for this purpose.
30 33  
31 34 Please send a merge request with a tested solution or a merge request with a failing test instead of opening an issue if you can. If you're unsure where to post, post to the [mailing list](https://groups.google.com/forum/#!forum/gitlabhq) or [Stack Overflow](http://stackoverflow.com/questions/tagged/gitlab) first. There are a lot of helpful GitLab users there who may be able to help you quickly. If your particular issue turns out to be a bug, it will find its way from there.
32 35  
... ... @@ -48,7 +51,7 @@ Please send a merge request with a tested solution or a merge request with a fai
48 51  
49 52 ## Merge requests
50 53  
51   -We welcome merge requests with fixes and improvements to GitLab code, tests, and/or documentation. The features we would really like a merge request for are listed with the [status 'accepting merge requests' on our feedback forum](http://feedback.gitlab.com/forums/176466-general/status/796455) but other improvements are also welcome. If you want to add a new feature that is not marked it is best to first create a feedback issue (if there isn't one already) and leave a comment asking for it to be marked accepting merge requests. Please include screenshots or wireframes if the feature will also change the UI.
  54 +We welcome merge requests with fixes and improvements to GitLab code, tests, and/or documentation. The features we would really like a merge request for are listed with the [status 'accepting merge requests' on our feature request forum](http://feedback.gitlab.com/forums/176466-general/status/796455) but other improvements are also welcome. If you want to add a new feature that is not marked it is best to first create a feedback issue (if there isn't one already) and leave a comment asking for it to be marked accepting merge requests. Please include screenshots or wireframes if the feature will also change the UI.
52 55  
53 56 ### Merge request guidelines
54 57  
... ... @@ -64,7 +67,7 @@ If you can, please submit a merge request with the fix or improvements including
64 67 1. The MR title should describes the change you want to make
65 68 1. The MR description should give a motive for your change and the method you used to achieve it
66 69 1. If the MR changes the UI it should include before and after screenshots
67   -1. Link relevant [issues](https://gitlab.com/gitlab-org/gitlab-ce/issues) and/or [feedback items](http://feedback.gitlab.com/) from the merge request description and leave a comment on them with a link back to the MR
  70 +1. Link relevant [issues](https://gitlab.com/gitlab-org/gitlab-ce/issues) and/or [feature requests](http://feedback.gitlab.com/) from the merge request description and leave a comment on them with a link back to the MR
68 71 1. Be prepared to answer questions and incorporate feedback even if requests for this arrive weeks or months after your MR submittion
69 72 1. If your MR touches code that executes shell commands, make sure it adheres to the [shell command guidelines]( doc/development/shell_commands.md).
70 73  
... ...
PROCESS.md
... ... @@ -24,8 +24,6 @@ Below we describe the contributing process to GitLab for two reasons. So that co
24 24 - Monitors for new merge requests (at least once a week)
25 25 - Manages their work queue by looking at issues and merge requests assigned to them
26 26 - Close fixed issues (via commit messages or manually)
27   -- Codes [new features](http://feedback.gitlab.com/forums/176466-general/filters/top)!
28   -- Response guidelines
29 27 - Be kind to people trying to contribute. Be aware that people can be a non-native or a native English speaker, they might not understand thing or they might be very sensitive to how your word things. Use emoji to express your feelings (heart, star, smile, etc.). Some good tips about giving feedback to merge requests is in the [Thoughtbot code review guide](https://github.com/thoughtbot/guides/tree/master/code-review).
30 28  
31 29 ## Priorities of the issue team
... ... @@ -73,7 +71,7 @@ Thanks for the issue report. Please reformat your issue to conform to the issue
73 71  
74 72 ### Feature requests
75 73  
76   -Thanks for your interest in GitLab. We don't use the issue tracker for feature requests. Please use http://feedback.gitlab.com/ for this purpose or create a merge request implementing this feature. Have a look at the \[contribution guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md) for more information.
  74 +Thanks for your interest in GitLab. We don't use the issue tracker for feature requests. Please use the [feature request forum](http://feedback.gitlab.com/) for this purpose or create a merge request implementing this feature. Have a look at the \[contribution guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md) for more information.
77 75  
78 76 ### Issue report for old version
79 77  
... ...
README.md
... ... @@ -71,7 +71,7 @@ Since 2011 GitLab is released on the 22nd of every month. Every new release incl
71 71  
72 72 It is recommended to follow a monthly upgrade schedule. Security releases come out when needed. For more information about the release process see the documentation for [monthly](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/release/monthly.md) and [security](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/release/security.md) releases.
73 73  
74   -* Features that will be in the next releases are listed on [the feedback and suggestions forum](http://feedback.gitlab.com/forums/176466-general) with the status [started](http://feedback.gitlab.com/forums/176466-general/status/796456) and [completed](http://feedback.gitlab.com/forums/176466-general/status/796457).
  74 +* Features that will be in the next releases are listed on the [feature request forum](http://feedback.gitlab.com/forums/176466-general) with the status [started](http://feedback.gitlab.com/forums/176466-general/status/796456) and [completed](http://feedback.gitlab.com/forums/176466-general/status/796457).
75 75  
76 76 ### Run in production mode
77 77  
... ... @@ -140,7 +140,7 @@ or start each component separately
140 140  
141 141 * [Mailing list](https://groups.google.com/forum/#!forum/gitlabhq) and [Stack Overflow](http://stackoverflow.com/questions/tagged/gitlab) are the best places to ask questions. For example you can use it if you have questions about: permission denied errors, invisible repos, can't clone/pull/push or with web hooks that don't fire. Please search for similar issues before posting your own, there's a good chance somebody else had the same issue you have now and has resolved it. There are a lot of helpful GitLab users there who may be able to help you quickly. If your particular issue turns out to be a bug, it will find its way from there to a fix.
142 142  
143   -* [Feedback and suggestions forum](http://feedback.gitlab.com) is the place to propose and discuss new features for GitLab.
  143 +* [Feature request forum](http://feedback.gitlab.com) is the place to propose and discuss new features for GitLab.
144 144  
145 145 * [Contributing guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md) describes how to submit merge requests and issues. Pull requests and issues not in line with the guidelines in this document will be closed.
146 146  
... ...
VERSION
1   -6.7.0.rc1
  1 +6.7.0
... ...
doc/install/installation.md
... ... @@ -128,7 +128,7 @@ GitLab Shell is an ssh access and repository management software developed speci
128 128 cd /home/git
129 129  
130 130 # Clone gitlab shell
131   - sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-shell.git -b v1.8.0
  131 + sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-shell.git -b v1.9.1
132 132  
133 133 cd gitlab-shell
134 134  
... ... @@ -173,7 +173,7 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
173 173 ## Clone the Source
174 174  
175 175 # Clone GitLab repository
176   - sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 6-6-stable gitlab
  176 + sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 6-7-stable gitlab
177 177  
178 178 # Go to gitlab dir
179 179 cd /home/git/gitlab
... ...
doc/update/6.6-to-6.7.md
... ... @@ -37,7 +37,7 @@ sudo -u git -H git checkout 6-7-stable-ee
37 37 ```bash
38 38 cd /home/git/gitlab-shell
39 39 sudo -u git -H git fetch
40   -sudo -u git -H git checkout v1.8.0
  40 +sudo -u git -H git checkout v1.9.1
41 41 ```
42 42  
43 43 ### 4. Install libs, migrations, etc.
... ...
lib/gitlab/backend/grack_auth.rb
... ... @@ -22,14 +22,16 @@ module Grack
22 22  
23 23 @env['SCRIPT_NAME'] = ""
24 24  
25   - auth!
  25 + if project
  26 + auth!
  27 + else
  28 + render_not_found
  29 + end
26 30 end
27 31  
28 32 private
29 33  
30 34 def auth!
31   - return render_not_found unless project
32   -
33 35 if @auth.provided?
34 36 return bad_request unless @auth.basic?
35 37  
... ... @@ -38,12 +40,8 @@ module Grack
38 40  
39 41 # Allow authentication for GitLab CI service
40 42 # if valid token passed
41   - if login == "gitlab-ci-token" && project.gitlab_ci?
42   - token = project.gitlab_ci_service.token
43   -
44   - if token.present? && token == password && service_name == 'git-upload-pack'
45   - return @app.call(env)
46   - end
  43 + if gitlab_ci_request?(login, password)
  44 + return @app.call(env)
47 45 end
48 46  
49 47 @user = authenticate_user(login, password)
... ... @@ -51,23 +49,26 @@ module Grack
51 49 if @user
52 50 Gitlab::ShellEnv.set_env(@user)
53 51 @env['REMOTE_USER'] = @auth.username
54   - else
55   - return unauthorized
56 52 end
57   -
58   - else
59   - return unauthorized unless project.public?
60 53 end
61 54  
62   - if authorized_git_request?
  55 + if authorized_request?
63 56 @app.call(env)
64 57 else
65 58 unauthorized
66 59 end
67 60 end
68 61  
69   - def authorized_git_request?
70   - authorize_request(service_name)
  62 + def gitlab_ci_request?(login, password)
  63 + if login == "gitlab-ci-token" && project.gitlab_ci?
  64 + token = project.gitlab_ci_service.token
  65 +
  66 + if token.present? && token == password && git_cmd == 'git-upload-pack'
  67 + return true
  68 + end
  69 + end
  70 +
  71 + false
71 72 end
72 73  
73 74 def authenticate_user(login, password)
... ... @@ -75,20 +76,31 @@ module Grack
75 76 auth.find(login, password)
76 77 end
77 78  
78   - def authorize_request(service)
79   - case service
  79 + def authorized_request?
  80 + case git_cmd
80 81 when *Gitlab::GitAccess::DOWNLOAD_COMMANDS
81   - # Serve only upload request.
82   - # Authorization on push will be serverd by update hook in repository
83   - Gitlab::GitAccess.new.download_allowed?(user, project)
  82 + if user
  83 + Gitlab::GitAccess.new.download_allowed?(user, project)
  84 + elsif project.public?
  85 + # Allow clone/fetch for public projects
  86 + true
  87 + else
  88 + false
  89 + end
84 90 when *Gitlab::GitAccess::PUSH_COMMANDS
85   - true
  91 + if user
  92 + # Skip user authorization on upload request.
  93 + # It will be serverd by update hook in repository
  94 + true
  95 + else
  96 + false
  97 + end
86 98 else
87 99 false
88 100 end
89 101 end
90 102  
91   - def service_name
  103 + def git_cmd
92 104 if @request.get?
93 105 @request.params['service']
94 106 elsif @request.post?
... ...
lib/gitlab/git_access.rb
... ... @@ -34,7 +34,7 @@ module Gitlab
34 34 end
35 35  
36 36 def download_allowed?(user, project)
37   - if user_allowed?(user)
  37 + if user && user_allowed?(user)
38 38 user.can?(:download_code, project)
39 39 else
40 40 false
... ... @@ -42,7 +42,7 @@ module Gitlab
42 42 end
43 43  
44 44 def push_allowed?(user, project, ref, oldrev, newrev)
45   - if user_allowed?(user)
  45 + if user && user_allowed?(user)
46 46 action = if project.protected_branch?(ref)
47 47 :push_code_to_protected_branches
48 48 else
... ...
lib/gitlab/upgrader.rb
  1 +require_relative "popen"
1 2 require_relative "version_info"
2 3  
3 4 module Gitlab
... ...
lib/tasks/gitlab/check.rake
... ... @@ -742,7 +742,7 @@ namespace :gitlab do
742 742 end
743 743  
744 744 def check_gitlab_shell
745   - required_version = Gitlab::VersionInfo.new(1, 9, 0)
  745 + required_version = Gitlab::VersionInfo.new(1, 9, 1)
746 746 current_version = Gitlab::VersionInfo.parse(gitlab_shell_version)
747 747  
748 748 print "GitLab Shell version >= #{required_version} ? ... "
... ...