Commit 8d70ac008dbb43752e2c1f69530c4453eb8e0e2d

Authored by Dmitriy Zaporozhets
2 parents 9de23248 f4e2865d

Merge branch 'master' into 6-0-dev

Conflicts:
	VERSION
	db/schema.rb
@@ -24,6 +24,7 @@ v 5.3.0 @@ -24,6 +24,7 @@ v 5.3.0
24 - init.d: Ensure socket is removed before starting service 24 - init.d: Ensure socket is removed before starting service
25 - Admin area: Style teams:index, group:show pages 25 - Admin area: Style teams:index, group:show pages
26 - Own page for failed forking 26 - Own page for failed forking
  27 + - Scrum view for milestone
27 28
28 v 5.2.0 29 v 5.2.0
29 - Turbolinks 30 - Turbolinks
app/controllers/admin/groups_controller.rb
@@ -8,10 +8,6 @@ class Admin::GroupsController < Admin::ApplicationController @@ -8,10 +8,6 @@ class Admin::GroupsController < Admin::ApplicationController
8 end 8 end
9 9
10 def show 10 def show
11 - @projects = Project.scoped  
12 - @projects = @projects.not_in_group(@group) if @group.projects.present?  
13 - @projects = @projects.all  
14 - @projects.reject!(&:empty_repo?)  
15 end 11 end
16 12
17 def new 13 def new
db/migrate/20130326142630_add_index_to_users_authentication_token.rb 0 → 100644
@@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
  1 +class AddIndexToUsersAuthenticationToken < ActiveRecord::Migration
  2 + def change
  3 + add_index :users, :authentication_token, unique: true
  4 + end
  5 +end
@@ -295,6 +295,7 @@ ActiveRecord::Schema.define(:version =&gt; 20130621195223) do @@ -295,6 +295,7 @@ ActiveRecord::Schema.define(:version =&gt; 20130621195223) do
295 end 295 end
296 296
297 add_index "users", ["admin"], :name => "index_users_on_admin" 297 add_index "users", ["admin"], :name => "index_users_on_admin"
  298 + add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true
298 add_index "users", ["email"], :name => "index_users_on_email", :unique => true 299 add_index "users", ["email"], :name => "index_users_on_email", :unique => true
299 add_index "users", ["name"], :name => "index_users_on_name" 300 add_index "users", ["name"], :name => "index_users_on_name"
300 add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true 301 add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
doc/install/databases.md
@@ -11,10 +11,17 @@ GitLab supports the following databases: @@ -11,10 +11,17 @@ GitLab supports the following databases:
11 # Install the database packages 11 # Install the database packages
12 sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev 12 sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
13 13
  14 + # Pick a database root password (can be anything), type it and press enter
  15 + # Retype the database root password and press enter
  16 +
14 # Login to MySQL 17 # Login to MySQL
15 mysql -u root -p 18 mysql -u root -p
16 19
17 - # Create a user for GitLab. (change $password to a real password) 20 + # Type the database root password
  21 +
  22 + # Create a user for GitLab
  23 + # do not type the 'mysql>', this is part of the prompt
  24 + # change $password in the command below to a real password you pick
18 mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password'; 25 mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
19 26
20 # Create the GitLab production database 27 # Create the GitLab production database
@@ -29,6 +36,16 @@ GitLab supports the following databases: @@ -29,6 +36,16 @@ GitLab supports the following databases:
29 # Try connecting to the new database with the new user 36 # Try connecting to the new database with the new user
30 sudo -u git -H mysql -u gitlab -p -D gitlabhq_production 37 sudo -u git -H mysql -u gitlab -p -D gitlabhq_production
31 38
  39 + # Type the password you replaced $password with earlier
  40 +
  41 + # You should now see a 'mysql>' prompt
  42 +
  43 + # Quit the database session
  44 + mysql> \q
  45 +
  46 + # You are done installing the database and can go back to the rest of the installation.
  47 +
  48 +
32 ## PostgreSQL 49 ## PostgreSQL
33 50
34 # Install the database packages 51 # Install the database packages
doc/install/installation.md
@@ -36,10 +36,10 @@ The GitLab installation consists of setting up the following components: @@ -36,10 +36,10 @@ The GitLab installation consists of setting up the following components:
36 `sudo` is not installed on Debian by default. Make sure your system is 36 `sudo` is not installed on Debian by default. Make sure your system is
37 up-to-date and install it. 37 up-to-date and install it.
38 38
39 - # run as root  
40 - apt-get update  
41 - apt-get upgrade  
42 - apt-get install sudo 39 + # run as root!
  40 + apt-get update -y
  41 + apt-get upgrade -y
  42 + apt-get install sudo -y
43 43
44 **Note:** 44 **Note:**
45 Vim is an editor that is used here whenever there are files that need to be 45 Vim is an editor that is used here whenever there are files that need to be
@@ -55,7 +55,7 @@ Install the required packages: @@ -55,7 +55,7 @@ Install the required packages:
55 Make sure you have the right version of Python installed. 55 Make sure you have the right version of Python installed.
56 56
57 # Install Python 57 # Install Python
58 - sudo apt-get install python 58 + sudo apt-get install -y python
59 59
60 # Make sure that Python is 2.5+ (3.x is not supported at the moment) 60 # Make sure that Python is 2.5+ (3.x is not supported at the moment)
61 python --version 61 python --version
@@ -73,15 +73,17 @@ Make sure you have the right version of Python installed. @@ -73,15 +73,17 @@ Make sure you have the right version of Python installed.
73 mail server. By default, Debian is shipped with exim4 whereas Ubuntu 73 mail server. By default, Debian is shipped with exim4 whereas Ubuntu
74 does not ship with one. The recommended mail server is postfix and you can install it with: 74 does not ship with one. The recommended mail server is postfix and you can install it with:
75 75
76 - sudo apt-get install postfix 76 + sudo apt-get install -y postfix
  77 +
  78 +Then select 'Internet Site' and press enter to confirm the hostname.
77 79
78 # 2. Ruby 80 # 2. Ruby
79 81
80 -Remove old 1.8 ruby if present 82 +Remove the old Ruby 1.8 if present
81 83
82 - sudo apt-get remove ruby1.8 84 + sudo apt-get remove -y ruby1.8
83 85
84 -Download and compile it: 86 +Download Ruby and compile it:
85 87
86 mkdir /tmp/ruby && cd /tmp/ruby 88 mkdir /tmp/ruby && cd /tmp/ruby
87 curl --progress http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | tar xz 89 curl --progress http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | tar xz
@@ -92,7 +94,7 @@ Download and compile it: @@ -92,7 +94,7 @@ Download and compile it:
92 94
93 Install the Bundler Gem: 95 Install the Bundler Gem:
94 96
95 - sudo gem install bundler 97 + sudo gem install bundler --no-ri --no-rdoc
96 98
97 99
98 # 3. System Users 100 # 3. System Users
@@ -106,28 +108,25 @@ Create a `git` user for Gitlab: @@ -106,28 +108,25 @@ Create a `git` user for Gitlab:
106 108
107 GitLab Shell is a ssh access and repository management software developed specially for GitLab. 109 GitLab Shell is a ssh access and repository management software developed specially for GitLab.
108 110
109 - # Login as git  
110 - sudo su git  
111 -  
112 # Go to home directory 111 # Go to home directory
113 cd /home/git 112 cd /home/git
114 113
115 # Clone gitlab shell 114 # Clone gitlab shell
116 - git clone https://github.com/gitlabhq/gitlab-shell.git 115 + sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git
117 116
118 cd gitlab-shell 117 cd gitlab-shell
119 118
120 # switch to right version 119 # switch to right version
121 - git checkout v1.4.0 120 + sudo -u git -H git checkout v1.4.0
122 121
123 - cp config.yml.example config.yml 122 + sudo -u git -H cp config.yml.example config.yml
124 123
125 # Edit config and replace gitlab_url 124 # Edit config and replace gitlab_url
126 # with something like 'http://domain.com/' 125 # with something like 'http://domain.com/'
127 - vim config.yml 126 + sudo -u git -H vim config.yml
128 127
129 # Do setup 128 # Do setup
130 - ./bin/install 129 + sudo -u git -H ./bin/install
131 130
132 131
133 # 5. Database 132 # 5. Database
@@ -149,11 +148,10 @@ To setup the MySQL/PostgreSQL database and dependencies please see [`doc/install @@ -149,11 +148,10 @@ To setup the MySQL/PostgreSQL database and dependencies please see [`doc/install
149 cd /home/git/gitlab 148 cd /home/git/gitlab
150 149
151 # Checkout to stable release 150 # Checkout to stable release
152 - sudo -u git -H git checkout 5-2-stable 151 + sudo -u git -H git checkout 5-3-stable
153 152
154 **Note:** 153 **Note:**
155 -You can change `5-2-stable` to `master` if you want the *bleeding edge* version, but  
156 -do so with caution! 154 +You can change `5-3-stable` to `master` if you want the *bleeding edge* version, but do so with caution!
157 155
158 ## Configure it 156 ## Configure it
159 157
@@ -205,10 +203,18 @@ Make sure to edit both `gitlab.yml` and `puma.rb` to match your setup. @@ -205,10 +203,18 @@ Make sure to edit both `gitlab.yml` and `puma.rb` to match your setup.
205 # Mysql 203 # Mysql
206 sudo -u git cp config/database.yml.mysql config/database.yml 204 sudo -u git cp config/database.yml.mysql config/database.yml
207 205
  206 + or
  207 +
208 # PostgreSQL 208 # PostgreSQL
209 sudo -u git cp config/database.yml.postgresql config/database.yml 209 sudo -u git cp config/database.yml.postgresql config/database.yml
210 210
211 -Make sure to update username/password in config/database.yml. 211 + # Make sure to update username/password in config/database.yml.
  212 + # You only need to adapt the production settings (first part).
  213 + # If you followed the database guide then please do as follows:
  214 + # Change 'root' to 'gitlab'
  215 + # Change 'secure password' with the value you have given to $password
  216 + # You can keep the double quotes around the password
  217 + sudo -u git -H vim config/database.yml
212 218
213 ## Install Gems 219 ## Install Gems
214 220
@@ -216,10 +222,10 @@ Make sure to update username/password in config/database.yml. @@ -216,10 +222,10 @@ Make sure to update username/password in config/database.yml.
216 222
217 sudo gem install charlock_holmes --version '0.6.9.4' 223 sudo gem install charlock_holmes --version '0.6.9.4'
218 224
219 - # For MySQL (note, the option says "without") 225 + # For MySQL (note, the option says "without ... postgres")
220 sudo -u git -H bundle install --deployment --without development test postgres 226 sudo -u git -H bundle install --deployment --without development test postgres
221 227
222 - # Or for PostgreSQL 228 + # Or for PostgreSQL (note, the option says "without ... mysql")
223 sudo -u git -H bundle install --deployment --without development test mysql 229 sudo -u git -H bundle install --deployment --without development test mysql
224 230
225 231
@@ -227,6 +233,10 @@ Make sure to update username/password in config/database.yml. @@ -227,6 +233,10 @@ Make sure to update username/password in config/database.yml.
227 233
228 sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production 234 sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
229 235
  236 + # Type 'yes' to create the database.
  237 +
  238 + # When done you see 'Administrator account created:'
  239 +
230 240
231 ## Install Init Script 241 ## Install Init Script
232 242
@@ -269,7 +279,7 @@ If you can&#39;t or don&#39;t want to use Nginx as your web server, have a look at the @@ -269,7 +279,7 @@ If you can&#39;t or don&#39;t want to use Nginx as your web server, have a look at the
269 [`Advanced Setup Tips`](./installation.md#advanced-setup-tips) section. 279 [`Advanced Setup Tips`](./installation.md#advanced-setup-tips) section.
270 280
271 ## Installation 281 ## Installation
272 - sudo apt-get install nginx 282 + sudo apt-get install -y nginx
273 283
274 ## Site Configuration 284 ## Site Configuration
275 285
@@ -280,10 +290,8 @@ Download an example site config: @@ -280,10 +290,8 @@ Download an example site config:
280 290
281 Make sure to edit the config file to match your setup: 291 Make sure to edit the config file to match your setup:
282 292
283 - # **YOUR_SERVER_FQDN** to the fully-qualified  
284 - # domain name of your host serving GitLab. Also, replace  
285 - # the 'listen' line with the following:  
286 - # listen 80 default_server; # e.g., listen 192.168.1.1:80; 293 + # Change YOUR_SERVER_FQDN to the fully-qualified
  294 + # domain name of your host serving GitLab.
287 sudo vim /etc/nginx/sites-available/gitlab 295 sudo vim /etc/nginx/sites-available/gitlab
288 296
289 ## Restart 297 ## Restart
@@ -344,10 +352,10 @@ GitLab uses [Omniauth](http://www.omniauth.org/) for authentication and already @@ -344,10 +352,10 @@ GitLab uses [Omniauth](http://www.omniauth.org/) for authentication and already
344 352
345 These steps are fairly general and you will need to figure out the exact details from the Omniauth provider's documentation. 353 These steps are fairly general and you will need to figure out the exact details from the Omniauth provider's documentation.
346 354
347 -* Add `gem "omniauth-your-auth-provider"` to the [Gemfile](https://github.com/gitlabhq/gitlabhq/blob/5-2-stable/Gemfile#L18) 355 +* Add `gem "omniauth-your-auth-provider"` to the [Gemfile](https://github.com/gitlabhq/gitlabhq/blob/5-3-stable/Gemfile#L18)
348 * Run `sudo -u git -H bundle install` to install the new gem(s) 356 * Run `sudo -u git -H bundle install` to install the new gem(s)
349 -* Add provider specific configuration options to your `config/gitlab.yml` (you can use the [auth providers section of the example config](https://github.com/gitlabhq/gitlabhq/blob/5-2-stable/config/gitlab.yml.example#L53) as a reference)  
350 -* Add icons for the new provider into the [vendor/assets/images/authbuttons](https://github.com/gitlabhq/gitlabhq/tree/5-2-stable/vendor/assets/images/authbuttons) directory (you can find some more popular ones over at https://github.com/intridea/authbuttons) 357 +* Add provider specific configuration options to your `config/gitlab.yml` (you can use the [auth providers section of the example config](https://github.com/gitlabhq/gitlabhq/blob/5-3-stable/config/gitlab.yml.example#L53) as a reference)
  358 +* Add icons for the new provider into the [vendor/assets/images/authbuttons](https://github.com/gitlabhq/gitlabhq/tree/5-3-stable/vendor/assets/images/authbuttons) directory (you can find some more popular ones over at https://github.com/intridea/authbuttons)
351 * Restart GitLab 359 * Restart GitLab
352 360
353 ### Examples 361 ### Examples
doc/update/5.2-to-5.3.md 0 → 100644
@@ -0,0 +1,80 @@ @@ -0,0 +1,80 @@
  1 +# From 5.2 to 5.3
  2 +
  3 +### 0. Backup
  4 +
  5 +It's useful to make a backup just in case things go south:
  6 +(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
  7 +
  8 +```bash
  9 +cd /home/git/gitlab
  10 +sudo -u git -H RAILS_ENV=production bundle exec rake gitlab:backup:create
  11 +```
  12 +
  13 +### 1. Stop server
  14 +
  15 + sudo service gitlab stop
  16 +
  17 +### 2. Get latest code
  18 +
  19 +```bash
  20 +cd /home/git/gitlab
  21 +sudo -u git -H git fetch
  22 +sudo -u git -H git checkout 5-3-stable
  23 +```
  24 +
  25 +### 3. Install libs, migrations, etc.
  26 +
  27 +```bash
  28 +cd /home/git/gitlab
  29 +
  30 +# MySQL
  31 +sudo -u git -H bundle install --without development test postgres --deployment
  32 +
  33 +#PostgreSQL
  34 +sudo -u git -H bundle install --without development test mysql --deployment
  35 +
  36 +sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
  37 +```
  38 +
  39 +### 4. Update config files
  40 +
  41 +* Make `/home/git/gitlab/config/gitlab.yml` same as https://github.com/gitlabhq/gitlabhq/blob/5-2-stable/config/gitlab.yml.example but with your settings.
  42 +* Make `/home/git/gitlab/config/puma.rb` same as https://github.com/gitlabhq/gitlabhq/blob/5-2-stable/config/puma.rb.example but with your settings.
  43 +
  44 +### 5. Update Init script
  45 +
  46 +```bash
  47 +sudo rm /etc/init.d/gitlab
  48 +sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5-3-stable/lib/support/init.d/gitlab
  49 +sudo chmod +x /etc/init.d/gitlab
  50 +```
  51 +
  52 +### 6. Start application
  53 +
  54 + sudo service gitlab start
  55 + sudo service nginx restart
  56 +
  57 +### 7. Check application status
  58 +
  59 +Check if GitLab and its environment are configured correctly:
  60 +
  61 + sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
  62 +
  63 +To make sure you didn't miss anything run a more thorough check with:
  64 +
  65 + sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
  66 +
  67 +If all items are green, then congratulations upgrade complete!
  68 +
  69 +## Things went south? Revert to previous version (5.2)
  70 +
  71 +### 1. Revert the code to the previous version
  72 +Follow the [`upgrade guide from 5.1 to 5.2`](5.1-to-5.2.md), except for the database migration
  73 +(The backup is already migrated to the previous version)
  74 +
  75 +### 2. Restore from the backup:
  76 +
  77 +```bash
  78 +cd /home/git/gitlab
  79 +sudo -u git -H RAILS_ENV=production bundle exec rake gitlab:backup:restore
  80 +```
lib/support/init.d/gitlab
@@ -51,7 +51,7 @@ start() { @@ -51,7 +51,7 @@ start() {
51 exit 1 51 exit 1
52 else 52 else
53 if [ `whoami` = root ]; then 53 if [ `whoami` = root ]; then
54 - execute "rm $SOCKET_PATH/gitlab.socket" 54 + execute "rm -f $SOCKET_PATH/gitlab.socket"
55 execute "RAILS_ENV=production bundle exec puma $DAEMON_OPTS" 55 execute "RAILS_ENV=production bundle exec puma $DAEMON_OPTS"
56 execute "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &" 56 execute "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
57 echo "$DESC started" 57 echo "$DESC started"
lib/support/nginx/gitlab
@@ -7,7 +7,7 @@ upstream gitlab { @@ -7,7 +7,7 @@ upstream gitlab {
7 } 7 }
8 8
9 server { 9 server {
10 - listen YOUR_SERVER_IP:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea 10 + listen *:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
11 server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com; 11 server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com;
12 server_tokens off; # don't show the version number, a security best practice 12 server_tokens off; # don't show the version number, a security best practice
13 root /home/git/gitlab/public; 13 root /home/git/gitlab/public;