Commit af5ea92cc4c0eb9577bb4de2ffc5a873a37fec49

Authored by Marin Jankovski
2 parents aea3712e 38ae34a3

Merge branch 'master' into login_page

Conflicts:
	CHANGELOG
@@ -11,6 +11,7 @@ v 6.8.0 @@ -11,6 +11,7 @@ v 6.8.0
11 - Fix popen bug in `rake gitlab:satellites:create` 11 - Fix popen bug in `rake gitlab:satellites:create`
12 - Disable connection reaping for MySQL 12 - Disable connection reaping for MySQL
13 - Allow oauth signup without email for twitter and github 13 - Allow oauth signup without email for twitter and github
  14 + - Fix faulty namespace names that caused 500 on user creation
14 - Option to disable standard login 15 - Option to disable standard login
15 16
16 v 6.7.3 17 v 6.7.3
1 -web: bundle exec unicorn_rails -p $PORT -E development -c config/unicorn_development.rb 1 +web: bundle exec unicorn_rails -p ${PORT} -E ${RAILS_ENV} -c ${UNICORN_CONFIG:="config/unicorn.rb"}
2 worker: bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,common,default,gitlab_shell 2 worker: bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,common,default,gitlab_shell
app/controllers/projects/merge_requests_controller.rb
@@ -216,7 +216,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController @@ -216,7 +216,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
216 end 216 end
217 217
218 def allowed_to_merge? 218 def allowed_to_merge?
219 - allowed_to_push_code?(project) 219 + allowed_to_push_code?(project, @merge_request.target_branch)
220 end 220 end
221 221
222 def invalid_mr 222 def invalid_mr
@@ -225,17 +225,17 @@ class Projects::MergeRequestsController < Projects::ApplicationController @@ -225,17 +225,17 @@ class Projects::MergeRequestsController < Projects::ApplicationController
225 end 225 end
226 226
227 def allowed_to_remove_source_branch? 227 def allowed_to_remove_source_branch?
228 - allowed_to_push_code?(@merge_request.source_project) && 228 + allowed_to_push_code?(@merge_request.source_project, @merge_request.source_branch) &&
229 !@merge_request.disallow_source_branch_removal? 229 !@merge_request.disallow_source_branch_removal?
230 end 230 end
231 231
232 - def allowed_to_push_code?(project)  
233 - action = if project.protected_branch?(@merge_request.target_branch) 232 + def allowed_to_push_code?(project, branch)
  233 + action = if project.protected_branch?(branch)
234 :push_code_to_protected_branches 234 :push_code_to_protected_branches
235 else 235 else
236 :push_code 236 :push_code
237 end 237 end
238 238
239 - can?(current_user, action, @project) 239 + can?(current_user, action, project)
240 end 240 end
241 end 241 end
app/models/merge_request.rb
@@ -210,7 +210,7 @@ class MergeRequest < ActiveRecord::Base @@ -210,7 +210,7 @@ class MergeRequest < ActiveRecord::Base
210 end 210 end
211 211
212 def disallow_source_branch_removal? 212 def disallow_source_branch_removal?
213 - (source_project.root_ref? source_branch) || for_fork? 213 + source_project.root_ref?(source_branch) || source_project.protected_branches.include?(source_branch)
214 end 214 end
215 215
216 def project 216 def project
app/views/devise/sessions/_oauth_providers.html.haml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 - if providers.present? 2 - if providers.present?
3 %hr 3 %hr
4 %div{:'data-no-turbolink' => 'data-no-turbolink'} 4 %div{:'data-no-turbolink' => 'data-no-turbolink'}
5 - %span Sign in with*:   5 + %span Sign in with:  
6 - providers.each do |provider| 6 - providers.each do |provider|
7 %span 7 %span
8 - if default_providers.include?(provider) 8 - if default_providers.include?(provider)
app/views/projects/notes/_discussion.html.haml
1 - note = discussion_notes.first 1 - note = discussion_notes.first
2 -.discussion.js-details-container.js-toggler-container.open{ class: note.discussion_id } 2 +.discussion.js-toggle-container{ class: note.discussion_id }
3 .discussion-header 3 .discussion-header
4 .discussion-actions 4 .discussion-actions
5 - = link_to "javascript:;", class: "js-details-target turn-on js-toggler-target" do  
6 - %i.icon-eye-close  
7 - Hide discussion  
8 - = link_to "javascript:;", class: "js-details-target turn-off js-toggler-target" do  
9 - %i.icon-eye-open  
10 - Show discussion 5 + = link_to "#", class: "js-toggle-button" do
  6 + %i.icon-chevron-up
  7 + Show/hide discussion
11 = image_tag avatar_icon(note.author_email), class: "avatar s32" 8 = image_tag avatar_icon(note.author_email), class: "avatar s32"
12 %div 9 %div
13 = link_to_member(@project, note.author, avatar: false) 10 = link_to_member(@project, note.author, avatar: false)
@@ -33,7 +30,7 @@ @@ -33,7 +30,7 @@
33 = link_to_member(@project, last_note.author, avatar: false) 30 = link_to_member(@project, last_note.author, avatar: false)
34 %span.discussion-last-update 31 %span.discussion-last-update
35 #{time_ago_with_tooltip(last_note.updated_at, 'bottom', 'discussion_updated_ago')} 32 #{time_ago_with_tooltip(last_note.updated_at, 'bottom', 'discussion_updated_ago')}
36 - .discussion-body 33 + .discussion-body.js-toggle-content
37 - if note.for_diff_line? 34 - if note.for_diff_line?
38 - if note.active? 35 - if note.active?
39 = render "projects/notes/discussion_diff", discussion_notes: discussion_notes, note: note 36 = render "projects/notes/discussion_diff", discussion_notes: discussion_notes, note: note
@@ -47,11 +44,3 @@ @@ -47,11 +44,3 @@
47 .notes{ rel: discussion_notes.first.discussion_id } 44 .notes{ rel: discussion_notes.first.discussion_id }
48 = render discussion_notes 45 = render discussion_notes
49 = render "projects/notes/discussion_reply_button", note: discussion_notes.first 46 = render "projects/notes/discussion_reply_button", note: discussion_notes.first
50 -  
51 - -# will be shown when the other one is hidden  
52 - .discussion-hidden.content.hide  
53 - .note  
54 - %em Hidden discussion.  
55 - = link_to "javascript:;", class: "js-details-target js-toggler-target" do  
56 - %i.icon-eye-open  
57 - Show  
db/migrate/20140407135544_fix_namespaces.rb 0 → 100644
@@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
  1 +class FixNamespaces < ActiveRecord::Migration
  2 + def up
  3 + Namespace.where('name <> path and type is null').each do |namespace|
  4 + namespace.update_attribute(:name, namespace.path)
  5 + end
  6 + end
  7 +
  8 + def down
  9 + end
  10 +end
0 \ No newline at end of file 11 \ No newline at end of file
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 # 11 #
12 # It's strongly recommended that you check this file into your version control system. 12 # It's strongly recommended that you check this file into your version control system.
13 13
14 -ActiveRecord::Schema.define(version: 20140313092127) do 14 +ActiveRecord::Schema.define(version: 20140407135544) do
15 15
16 # These are extensions that must be enabled in order to support this database 16 # These are extensions that must be enabled in order to support this database
17 enable_extension "plpgsql" 17 enable_extension "plpgsql"
lib/support/nginx/gitlab
@@ -42,6 +42,10 @@ server { @@ -42,6 +42,10 @@ server {
42 # if a file, which is not found in the root folder is requested, 42 # if a file, which is not found in the root folder is requested,
43 # then the proxy pass the request to the upsteam (gitlab unicorn) 43 # then the proxy pass the request to the upsteam (gitlab unicorn)
44 location @gitlab { 44 location @gitlab {
  45 + # If you use https make sure you disable gzip compression
  46 + # to be safe against BREACH attack
  47 + # gzip off;
  48 +
45 proxy_read_timeout 300; # Some requests take more than 30 seconds. 49 proxy_read_timeout 300; # Some requests take more than 30 seconds.
46 proxy_connect_timeout 300; # Some requests take more than 30 seconds. 50 proxy_connect_timeout 300; # Some requests take more than 30 seconds.
47 proxy_redirect off; 51 proxy_redirect off;
@@ -63,5 +67,4 @@ server { @@ -63,5 +67,4 @@ server {
63 } 67 }
64 68
65 error_page 502 /502.html; 69 error_page 502 /502.html;
66 -}  
67 - 70 +}
68 \ No newline at end of file 71 \ No newline at end of file