diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml
index eb8c519460780d8f88b5491587e0f7b71c7d9642..29ba9c1e99cde20713bd1dc63a3ff96ef0669305 100644
--- a/app/views/devise/sessions/_new_ldap.html.haml
+++ b/app/views/devise/sessions/_new_ldap.html.haml
@@ -1,29 +1,29 @@
-= form_tag(user_omniauth_callback_path(:ldap), :class => "login-box", :id => 'new_ldap_user' ) do
-  = image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo"
-  = text_field_tag :username, nil, {:class => "text top", :placeholder => "LDAP Login", :autofocus => "autofocus"}
-  = password_field_tag :password, nil, {:class => "text bottom", :placeholder => "Password"}
+= form_tag(user_omniauth_callback_path(:ldap), class: "login-box", id: 'new_ldap_user' ) do
+  = image_tag "login-logo.png", width: "304", height: "66", class: "login-logo", alt: "Login Logo"
+  = text_field_tag :username, nil, {class: "text top", placeholder: "LDAP Login", autofocus: "autofocus"}
+  = password_field_tag :password, nil, {class: "text bottom", placeholder: "Password"}
   %br/
-  = submit_tag "LDAP Sign in", :class => "btn-primary btn"
+  = submit_tag "LDAP Sign in", class: "btn-primary btn"
   - if devise_mapping.omniauthable?
     - (resource_class.omniauth_providers - [:ldap]).each do |provider|
       %hr/
-      = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), :class => "btn btn-primary"
+      = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), class: "btn btn-primary"
       %br/
   %hr/
-  %a#other_form_toggle{:href => "#", :onclick => "javascript:$('#new_user').toggle();"} Other Sign in
+  %a#other_form_toggle{href: "#", onclick: "javascript:$('#new_user').toggle();"} Other Sign in
   :javascript
     $(function() {
       $('#new_user').toggle();
     });
-= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f|
-  = f.text_field :email, :class => "text top", :placeholder => "Email"
-  = f.password_field :password, :class => "text bottom", :placeholder => "Password"
+= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: "login-box" }) do |f|
+  = f.text_field :login, class: "text top", placeholder: "Username or Email", autofocus: "autofocus"
+  = f.password_field :password, class: "text bottom", placeholder: "Password"
   - if devise_mapping.rememberable?
     .clearfix.inputs-list
-      %label.checkbox.remember_me{:for => "user_remember_me"}
+      %label.checkbox.remember_me{for: "user_remember_me"}
         = f.check_box :remember_me
         %span Remember me
   %br/
-  = f.submit "Sign in", :class => "btn-primary btn"
+  = f.submit "Sign in", class: "btn-primary btn"
   .pull-right
-    = render :partial => "devise/shared/links"
+    = render partial: "devise/shared/links"
diff --git a/config/routes.rb b/config/routes.rb
index 18475e032774eb56f9323b08b9c1d19d46cf23c6..4838d97a4ea495c475dd59b0661e9878308b0a54 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -133,7 +133,7 @@ Gitlab::Application.routes.draw do
   #
   # Groups Area
   #
-  resources :groups, constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}  do
+  resources :groups, constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}, except: [:index] do
     member do
       get :issues
       get :merge_requests
@@ -146,7 +146,7 @@ Gitlab::Application.routes.draw do
   #
   # Teams Area
   #
-  resources :teams, constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/} do
+  resources :teams, constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}, except: [:index] do
     member do
       get :issues
       get :merge_requests
diff --git a/doc/install/installation.md b/doc/install/installation.md
index d1d3833e3d2c7717b07c82707ae91c0b0d2f4cf3..c81a3af5c3a8be9183176b3f9ef57d200fba6256 100644
--- a/doc/install/installation.md
+++ b/doc/install/installation.md
@@ -132,10 +132,10 @@ To setup the MySQL/PostgreSQL database and dependencies please see [`doc/install
     cd /home/git/gitlab
 
     # Checkout to stable release
-    sudo -u git -H git checkout 5-0-stable
+    sudo -u git -H git checkout 5-1-stable
 
 **Note:**
-You can change `5-0-stable` to `master` if you want the *bleeding edge* version, but
+You can change `5-1-stable` to `master` if you want the *bleeding edge* version, but
 do so with caution!
 
 ## Configure it
@@ -158,12 +158,14 @@ do so with caution!
     # Create directory for satellites
     sudo -u git -H mkdir /home/git/gitlab-satellites
 
-    # Create directory for pids and make sure GitLab can write to it
+    # Create directories for sockets/pids and make sure GitLab can write to them
     sudo -u git -H mkdir tmp/pids/
+    sudo -u git -H mkdir tmp/sockets/
     sudo chmod -R u+rwX  tmp/pids/
+    sudo chmod -R u+rwX  tmp/sockets/
 
-    # Copy the example Unicorn config
-    sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
+    # Copy the example of Puma config
+    sudo -u git -H cp config/puma.rb.example config/puma.rb
 
 **Important Note:**
 Make sure to edit both files to match your setup.
@@ -200,7 +202,7 @@ Make sure to update username/password in config/database.yml.
 
 Download the init script (will be /etc/init.d/gitlab):
 
-    sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab
+    sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/5-1-stable/init.d/gitlab
     sudo chmod +x /etc/init.d/gitlab
 
 Make GitLab start on boot:
@@ -241,7 +243,7 @@ If you can't or don't want to use Nginx as your web server, have a look at the
 
 Download an example site config:
 
-    sudo curl --output /etc/nginx/sites-available/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/master/nginx/gitlab
+    sudo curl --output /etc/nginx/sites-available/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/5-1-stable/nginx/gitlab
     sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
 
 Make sure to edit the config file to match your setup:
diff --git a/doc/update/5.0-to-5.1.md b/doc/update/5.0-to-5.1.md
index 438bc25672c86495da8930fecdb00ae2343a1392..b827d8689263f737a92e9fba1b2f474ea396452b 100644
--- a/doc/update/5.0-to-5.1.md
+++ b/doc/update/5.0-to-5.1.md
@@ -3,32 +3,48 @@
 * `unicorn` replaced with `puma`
 * merge request cached diff will be truncated
 
-### 1. stop server
+### 1. Stop server
 
     sudo service gitlab stop
 
-### 2. get latest code
-
-```
+### 2. Get latest code
 
+```bash
+cd /home/git/gitlab
 sudo -u git -H git fetch
 sudo -u git -H git checkout 5-1-stable
-
 ```
 
-### 3. Install libs, migrations etc
+### 3. Update gitlab-shell
 
+```bash
+cd /home/git/gitlab-shell
+sudo -u git -H git fetch
+sudo -u git -H git checkout v1.3.0
 ```
-sudo -u git -H cp config/puma.rb.example config/puma.rb
 
+### 4. Install libs, migrations etc
 
+```bash
+cd /home/git/gitlab
+sudo rm tmp/sockets/gitlab.socket
+sudo -u git -H cp config/puma.rb.example config/puma.rb
+```
+If you are using MySQL:
+```
 sudo -u git -H bundle install --without development test postgres --deployment
+```
+If you are using PostgreSQL:
+```
+sudo -u git -H bundle install --without development test mysql --deployment
+```
+
+```
 sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
 sudo -u git -H bundle exec rake migrate_merge_requests RAILS_ENV=production
-
 ```
 
-### 4. Update init.d script with a new one
+### 5. Update init.d script with a new one
 
 ```bash
 # init.d
@@ -37,6 +53,16 @@ sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-rec
 sudo chmod +x /etc/init.d/gitlab
 ```
 
-### 5. Start application
+### 6. MySQL grant privileges
+
+Only if you are using MySQL:
+
+```bash
+mysql -u root -p
+mysql> GRANT LOCK TABLES ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
+mysql> \q
+```
+
+### 7. Start application
 
     sudo service gitlab start
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake
index 94599ae880b82823abd78176131150da5357aaf5..a57c3494ec8202a9f1b13564c78681ae41461da0 100644
--- a/lib/tasks/gitlab/check.rake
+++ b/lib/tasks/gitlab/check.rake
@@ -143,7 +143,7 @@ namespace :gitlab do
         return
       end
 
-      recipe_content = `curl https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab 2>/dev/null`
+      recipe_content = `curl https://raw.github.com/gitlabhq/gitlab-recipes/5-1-stable/init.d/gitlab 2>/dev/null`
       script_content = File.read(script_path)
 
       if recipe_content == script_content