OSDN Git Service

Merge branch 'gitlab_shell_in_patch_doc' of /home/git/repositories/gitlab/gitlabhq
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 4 Nov 2013 19:30:26 +0000 (19:30 +0000)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 4 Nov 2013 19:30:26 +0000 (19:30 +0000)
20 files changed:
app/assets/stylesheets/gitlab_bootstrap/mixins.scss
app/assets/stylesheets/sections/commits.scss
app/assets/stylesheets/selects.scss
app/helpers/projects_helper.rb
app/views/projects/edit.html.haml
doc/install/requirements.md
doc/update/4.2-to-5.0.md
doc/update/5.0-to-5.1.md
doc/update/5.1-to-5.2.md
doc/update/5.1-to-5.4.md [new file with mode: 0644]
doc/update/5.1-to-6.0.md
doc/update/5.2-to-5.3.md
doc/update/5.3-to-5.4.md
doc/update/5.4-to-6.0.md
doc/update/6.0-to-6.1.md
doc/update/6.0-to-6.2.md
doc/update/6.1-to-6.2.md
features/project/edit_issuetracker.feature [new file with mode: 0644]
features/steps/project/project_issue_tracker.rb [new file with mode: 0644]
spec/helpers/projects_helper_spec.rb

index 8b975a1..edb0869 100644 (file)
@@ -25,6 +25,7 @@
   background-image: -webkit-gradient(linear, 0 0, 0 100%, from($from), to($to));
   background-image: -webkit-linear-gradient($from, $to);
   background-image: -moz-linear-gradient($from, $to);
+  background-image: -ms-linear-gradient($from, $to);
   background-image: -o-linear-gradient($from, $to);
 }
 
@@ -45,6 +46,7 @@
   background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #f5f5f5), to(#e1e1e1));
   background-image: -webkit-linear-gradient(#f5f5f5 6.6%, #e1e1e1);
   background-image: -moz-linear-gradient(#f5f5f5 6.6%, #e1e1e1);
+  background-image: -ms-linear-gradient(#f5f5f5 6.6%, #e1e1e1);
   background-image: -o-linear-gradient(#f5f5f5 6.6%, #e1e1e1);
 }
 
@@ -53,6 +55,7 @@
   background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf));
   background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf);
   background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf);
+  background-image: -ms-linear-gradient(#eee 6.6%, #dfdfdf);
   background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf);
 }
 
@@ -60,6 +63,7 @@
   background: #eee;
   background-image: -webkit-linear-gradient(#e9e9e9, #d7d7d7);
   background-image: -moz-linear-gradient(#e9e9e9, #d7d7d7);
+  background-image: -ms-linear-gradient(#e9e9e9, #d7d7d7);
   background-image: -o-linear-gradient(#e9e9e9, #d7d7d7);
 }
 
index 45a83cb..787d81a 100644 (file)
@@ -24,6 +24,7 @@
     background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf));
     background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf);
     background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf);
+    background-image: -ms-linear-gradient(#eee 6.6%, #dfdfdf);
     background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf);
 
     a{
     background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf));
     background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf);
     background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf);
+    background-image: -ms-linear-gradient(#eee 6.6%, #dfdfdf);
     background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf);
 
     ul, li{
index 09ae57b..fd77efe 100644 (file)
   background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, whitesmoke), to(#e1e1e1));
   background-image: -webkit-linear-gradient(whitesmoke 6.6%, #e1e1e1);
   background-image: -moz-linear-gradient(whitesmoke 6.6%, #e1e1e1);
+  background-image: -ms-linear-gradient(whitesmoke 6.6%, #e1e1e1);
   background-image: -o-linear-gradient(whitesmoke 6.6%, #e1e1e1);
 }
 
index 864f6c9..d70d187 100644 (file)
@@ -45,7 +45,10 @@ module ProjectsHelper
         link_to(simple_sanitize(project.group.name), group_path(project.group)) + " / " + project.name
       end
     else
-      project.name
+      owner = project.namespace.owner
+      content_tag :span do
+        link_to(simple_sanitize(owner.name), user_path(owner)) + " / " + project.name
+      end
     end
   end
 
@@ -80,7 +83,7 @@ module ProjectsHelper
     @project.milestones.active.order("due_date, title ASC").all
   end
 
-  def project_issues_trackers
+  def project_issues_trackers(current_tracker = nil)
     values = Project.issues_tracker.values.map do |tracker_key|
       if tracker_key.to_sym == :gitlab
         ['GitLab', tracker_key]
@@ -89,7 +92,7 @@ module ProjectsHelper
       end
     end
 
-    options_for_select(values)
+    options_for_select(values, current_tracker)
   end
 
   private
index d13ae93..6ecb24f 100644 (file)
@@ -67,7 +67,7 @@
             - if Project.issues_tracker.values.count > 1
               .control-group
                 = f.label :issues_tracker, "Issues tracker", class: 'control-label'
-                .controls= f.select(:issues_tracker, project_issues_trackers, {}, { disabled: !@project.issues_enabled })
+                .controls= f.select(:issues_tracker, project_issues_trackers(@project.issues_tracker), {}, { disabled: !@project.issues_enabled })
 
               .control-group
                 = f.label :issues_tracker_id, "Project name or id in issues tracker", class: 'control-label'
index 30a9564..a9dd348 100644 (file)
@@ -15,7 +15,7 @@ It should also work on (though they are not officially supported):
 - CentOS
 - Fedora
 - Gentoo
-- RedHat
+- RHEL
 
 ## Other Unix Systems
 
index 90f59e1..5bf8c36 100644 (file)
@@ -1,5 +1,8 @@
 # From 4.2 to 5.0
 
+## Warning
+GitLab 5.0 is affected by critical security vulnerability CVE-2013-4490. Please update to GitLab 5.4 immediately.
+
 ## Important changes
 
 * We don't use `gitlab` user any more. Everything will be moved to `git` user
index 45fc343..24d96e4 100644 (file)
@@ -1,5 +1,8 @@
 # From 5.0 to 5.1
 
+## Warning
+GitLab 5.1 is affected by critical security vulnerability CVE-2013-4490. Please [update to GitLab 5.4 immediately](5.1-to-5.4.md).
+
 ## Release notes:
 
 * `unicorn` replaced with `puma`
index 27f992e..a25df58 100644 (file)
@@ -1,5 +1,8 @@
 # From 5.1 to 5.2
 
+## Warning
+GitLab 5.2 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. Please [update to GitLab 5.4 directly](5.1-to-5.4.md).
+
 ### 0. Backup
 
 It's useful to make a backup just in case things go south:
diff --git a/doc/update/5.1-to-5.4.md b/doc/update/5.1-to-5.4.md
new file mode 100644 (file)
index 0000000..e61303a
--- /dev/null
@@ -0,0 +1,103 @@
+# From 5.1 to 5.4
+Also works starting from 5.2.
+
+## Notice
+Security vulnerabilities CVE-2013-4490 and CVE-2013-4489 have been patched in the latest version of GitLab 5.4.
+
+### 0. Backup
+
+It's useful to make a backup just in case things go south:
+(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
+
+```bash
+cd /home/git/gitlab
+sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
+```
+
+### 1. Stop server
+
+    sudo service gitlab stop
+
+### 2. Get latest code
+
+```bash
+cd /home/git/gitlab
+sudo -u git -H git fetch
+sudo -u git -H git checkout 5-4-stable # Latest version of 5-4-stable addresses CVE-2013-4489
+```
+
+### 3. Update gitlab-shell
+
+```bash
+cd /home/git/gitlab-shell
+sudo -u git -H git fetch
+sudo -u git -H git checkout v1.7.4 # Addresses CVE-2013-4490
+```
+
+### 4. Install libs, migrations, etc.
+
+```bash
+cd /home/git/gitlab
+
+# MySQL
+sudo -u git -H bundle install --without development test postgres --deployment
+
+#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 assets:precompile RAILS_ENV=production
+```
+
+### 5. Update config files
+
+* Make `/home/git/gitlab/config/gitlab.yml` same as https://github.com/gitlabhq/gitlabhq/blob/5-4-stable/config/gitlab.yml.example but with your settings.
+* Make `/home/git/gitlab/config/puma.rb` same as https://github.com/gitlabhq/gitlabhq/blob/5-4-stable/config/puma.rb.example but with your settings.
+
+### 6. Update Init script
+
+```bash
+sudo rm /etc/init.d/gitlab
+sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
+sudo chmod +x /etc/init.d/gitlab
+```
+
+### 7. Create uploads directory
+
+```bash
+cd /home/git/gitlab
+sudo -u git -H mkdir public/uploads
+sudo chmod -R u+rwX  public/uploads
+```
+
+
+### 8. Start application
+
+    sudo service gitlab start
+    sudo service nginx restart
+
+### 9. Check application status
+
+Check if GitLab and its environment are configured correctly:
+
+    sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
+
+To make sure you didn't miss anything run a more thorough check with:
+
+    sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
+
+If all items are green, then congratulations upgrade complete!
+
+## Things went south? Revert to previous version (5.3)
+
+### 1. Revert the code to the previous version
+Follow the [`upgrade guide from 5.2 to 5.3`](5.2-to-5.3.md), except for the database migration 
+(The backup is already migrated to the previous version)
+
+### 2. Restore from the backup:
+
+```bash
+cd /home/git/gitlab
+sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
+```
index 6105d4b..3907af1 100644 (file)
@@ -1,5 +1,8 @@
 # From 5.1 to 6.0
 
+## Warning
+GitLab 6.0 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. Please [update to GitLab 6.2 immediately](6.0-to-6.2.md).
+
 ### Deprecations
 
 #### Global projects
index a8bb530..67517b2 100644 (file)
@@ -1,5 +1,8 @@
 # From 5.2 to 5.3
 
+## Warning
+GitLab 5.3 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. Please [update to GitLab 5.4 directly](5.1-to-5.4.md).
+
 ### 0. Backup
 
 It's useful to make a backup just in case things go south:
index 315bf03..9e60f3b 100644 (file)
@@ -1,5 +1,8 @@
 # From 5.3 to 5.4
 
+## Notice
+Security vulnerabilities CVE-2013-4490 and CVE-2013-4489 have been patched in the latest version of GitLab 5.4.
+
 ### 0. Backup
 
 It's useful to make a backup just in case things go south:
@@ -19,7 +22,7 @@ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
 ```bash
 cd /home/git/gitlab
 sudo -u git -H git fetch
-sudo -u git -H git checkout 5-4-stable
+sudo -u git -H git checkout 5-4-stable # Latest version of 5-4-stable addresses CVE-2013-4489
 ```
 
 ### 3. Update gitlab-shell
@@ -27,7 +30,7 @@ sudo -u git -H git checkout 5-4-stable
 ```bash
 cd /home/git/gitlab-shell
 sudo -u git -H git fetch
-sudo -u git -H git checkout v1.5.0
+sudo -u git -H git checkout v1.7.4 # Addresses CVE-2013-4490
 ```
 
 ### 4. Install libs, migrations, etc.
index 3072a1d..1137f37 100644 (file)
@@ -1,5 +1,8 @@
 # From 5.4 to 6.0
 
+## Warning
+GitLab 6.0 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. Please [update to GitLab 6.2 immediately](6.0-to-6.2.md).
+
 ### Deprecations
 
 #### Global projects
index 67770bd..43ec211 100644 (file)
@@ -1,5 +1,8 @@
 # From 6.0 to 6.1
 
+## Warning
+GitLab 6.1 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. Please [update to GitLab 6.2 directly](6.0-to-6.2.md).
+
 # In 6.1 we remove a lot of deprecated code.
 # You should update to 6.0 before installing 6.1 so all the necessary conversions are run.
 
index 656bcaf..00a27fc 100644 (file)
@@ -1,5 +1,8 @@
 # From 6.0 to 6.2
 
+## Notice
+Security vulnerabilities CVE-2013-4490 and CVE-2013-4489 have been patched in the latest version of GitLab 6.2.
+
 # In 6.1 we remove a lot of deprecated code.
 # You should update to 6.0 before installing 6.1 or higher so all the necessary conversions are run.
 
@@ -28,7 +31,7 @@ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
 ```bash
 cd /home/git/gitlab
 sudo -u git -H git fetch
-sudo -u git -H git checkout 6-2-stable
+sudo -u git -H git checkout 6-2-stable # Latest version of 6-2-stable addresses CVE-2013-4489
 ```
 
 
@@ -44,7 +47,7 @@ sudo apt-get install logrotate
 ```bash
 cd /home/git/gitlab-shell
 sudo -u git -H git fetch
-sudo -u git -H git checkout v1.7.4
+sudo -u git -H git checkout v1.7.4 # Addresses CVE-2013-4490
 ```
 
 ### 5. Install libs, migrations, etc.
index 6f0514a..2b5ad2a 100644 (file)
@@ -1,5 +1,8 @@
 # From 6.1 to 6.2
 
+## Notice
+Security vulnerabilities CVE-2013-4490 and CVE-2013-4489 have been patched in the latest version of GitLab 6.2.
+
 # You should update to 6.1 before installing 6.2 so all the necessary conversions are run.
 
 ### 0. Backup
@@ -21,17 +24,25 @@ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
 ```bash
 cd /home/git/gitlab
 sudo -u git -H git fetch
-sudo -u git -H git checkout 6-2-stable
+sudo -u git -H git checkout 6-2-stable # Latest version of 6-2-stable addresses CVE-2013-4489
+```
+
+### 3. Update gitlab-shell
+
+```bash
+cd /home/git/gitlab-shell
+sudo -u git -H git fetch
+sudo -u git -H git checkout v1.7.4 # Addresses CVE-2013-4490
 ```
 
-### 3. Install additional packages
+### 4. Install additional packages
 
 ```bash
 # Add support for lograte for better log file handling
 sudo apt-get install logrotate
 ```
 
-### 4. Install libs, migrations, etc.
+### 5. Install libs, migrations, etc.
 
 ```bash
 cd /home/git/gitlab
@@ -49,7 +60,7 @@ sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
 sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
 ```
 
-### 5. Update config files
+### 6. Update config files
 
 TIP: to see what changed in gitlab.yml.example in this release use next command: 
 
@@ -71,7 +82,7 @@ sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers
 sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
 ```
 
-### 6. Update Init script
+### 7. Update Init script
 
 ```bash
 sudo rm /etc/init.d/gitlab
@@ -79,12 +90,12 @@ sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/6
 sudo chmod +x /etc/init.d/gitlab
 ```
 
-### 7. Start application
+### 8. Start application
 
     sudo service gitlab start
     sudo service nginx restart
 
-### 8. Check application status
+### 9. Check application status
 
 Check if GitLab and its environment are configured correctly:
 
diff --git a/features/project/edit_issuetracker.feature b/features/project/edit_issuetracker.feature
new file mode 100644 (file)
index 0000000..b5477d3
--- /dev/null
@@ -0,0 +1,18 @@
+Feature: Project Issue Tracker
+  Background:
+    Given I sign in as a user
+    And I own project "Shop"
+    And project "Shop" has issues enabled
+    And I visit project "Shop" page
+
+  Scenario: I set the issue tracker to "GitLab"
+    When I visit edit project "Shop" page
+    And change the issue tracker to "GitLab"
+    And I save project
+    Then I the project should have "GitLab" as issue tracker
+
+  Scenario: I set the issue tracker to "Redmine"
+    When I visit edit project "Shop" page
+    And change the issue tracker to "Redmine"
+    And I save project
+    Then I the project should have "Redmine" as issue tracker
\ No newline at end of file
diff --git a/features/steps/project/project_issue_tracker.rb b/features/steps/project/project_issue_tracker.rb
new file mode 100644 (file)
index 0000000..a05d7a0
--- /dev/null
@@ -0,0 +1,31 @@
+class ProjectIssueTracker < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedPaths
+
+  step 'project "Shop" has issues enabled' do
+    @project = Project.find_by_name "Shop"
+    @project ||= create(:project_with_code, name: "Shop", namespace: @user.namespace)
+    @project.issues_enabled = true
+  end
+
+  step 'change the issue tracker to "GitLab"' do
+    select 'GitLab', from: 'project_issues_tracker'
+  end
+
+  step 'I the project should have "GitLab" as issue tracker' do
+    find_field('project_issues_tracker').value.should == 'gitlab'
+  end
+
+  step 'change the issue tracker to "Redmine"' do
+    select 'Redmine', from: 'project_issues_tracker'
+  end
+
+  step 'I the project should have "Redmine" as issue tracker' do
+    find_field('project_issues_tracker').value.should == 'redmine'
+  end
+
+  And 'I save project' do
+    click_button 'Save changes'
+  end
+end
index 62f88dd..8156bcd 100644 (file)
@@ -7,5 +7,17 @@ describe ProjectsHelper do
           "<option value=\"redmine\">Redmine</option>\n" \
           "<option value=\"gitlab\">GitLab</option>"
     end
+
+    it "returns the correct issues trackers available with current tracker 'gitlab' selected" do
+      project_issues_trackers('gitlab').should ==
+          "<option value=\"redmine\">Redmine</option>\n" \
+          "<option value=\"gitlab\" selected=\"selected\">GitLab</option>"
+    end
+
+    it "returns the correct issues trackers available with current tracker 'redmine' selected" do
+      project_issues_trackers('redmine').should ==
+          "<option value=\"redmine\" selected=\"selected\">Redmine</option>\n" \
+          "<option value=\"gitlab\">GitLab</option>"
+    end
   end
 end