Commit 8d70ac008dbb43752e2c1f69530c4453eb8e0e2d
Exists in
master
and in
4 other branches
Merge branch 'master' into 6-0-dev
Conflicts: VERSION db/schema.rb
Showing
9 changed files
with
147 additions
and
39 deletions
Show diff stats
CHANGELOG
app/controllers/admin/groups_controller.rb
... | ... | @@ -8,10 +8,6 @@ class Admin::GroupsController < Admin::ApplicationController |
8 | 8 | end |
9 | 9 | |
10 | 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 | 11 | end |
16 | 12 | |
17 | 13 | def new | ... | ... |
db/migrate/20130326142630_add_index_to_users_authentication_token.rb
0 → 100644
db/schema.rb
... | ... | @@ -295,6 +295,7 @@ ActiveRecord::Schema.define(:version => 20130621195223) do |
295 | 295 | end |
296 | 296 | |
297 | 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 | 299 | add_index "users", ["email"], :name => "index_users_on_email", :unique => true |
299 | 300 | add_index "users", ["name"], :name => "index_users_on_name" |
300 | 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 | 11 | # Install the database packages |
12 | 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 | 17 | # Login to MySQL |
15 | 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 | 25 | mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password'; |
19 | 26 | |
20 | 27 | # Create the GitLab production database |
... | ... | @@ -29,6 +36,16 @@ GitLab supports the following databases: |
29 | 36 | # Try connecting to the new database with the new user |
30 | 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 | 49 | ## PostgreSQL |
33 | 50 | |
34 | 51 | # Install the database packages | ... | ... |
doc/install/installation.md
... | ... | @@ -36,10 +36,10 @@ The GitLab installation consists of setting up the following components: |
36 | 36 | `sudo` is not installed on Debian by default. Make sure your system is |
37 | 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 | 44 | **Note:** |
45 | 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 | 55 | Make sure you have the right version of Python installed. |
56 | 56 | |
57 | 57 | # Install Python |
58 | - sudo apt-get install python | |
58 | + sudo apt-get install -y python | |
59 | 59 | |
60 | 60 | # Make sure that Python is 2.5+ (3.x is not supported at the moment) |
61 | 61 | python --version |
... | ... | @@ -73,15 +73,17 @@ Make sure you have the right version of Python installed. |
73 | 73 | mail server. By default, Debian is shipped with exim4 whereas Ubuntu |
74 | 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 | 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 | 88 | mkdir /tmp/ruby && cd /tmp/ruby |
87 | 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 | 94 | |
93 | 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 | 100 | # 3. System Users |
... | ... | @@ -106,28 +108,25 @@ Create a `git` user for Gitlab: |
106 | 108 | |
107 | 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 | 111 | # Go to home directory |
113 | 112 | cd /home/git |
114 | 113 | |
115 | 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 | 117 | cd gitlab-shell |
119 | 118 | |
120 | 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 | 124 | # Edit config and replace gitlab_url |
126 | 125 | # with something like 'http://domain.com/' |
127 | - vim config.yml | |
126 | + sudo -u git -H vim config.yml | |
128 | 127 | |
129 | 128 | # Do setup |
130 | - ./bin/install | |
129 | + sudo -u git -H ./bin/install | |
131 | 130 | |
132 | 131 | |
133 | 132 | # 5. Database |
... | ... | @@ -149,11 +148,10 @@ To setup the MySQL/PostgreSQL database and dependencies please see [`doc/install |
149 | 148 | cd /home/git/gitlab |
150 | 149 | |
151 | 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 | 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 | 156 | ## Configure it |
159 | 157 | |
... | ... | @@ -205,10 +203,18 @@ Make sure to edit both `gitlab.yml` and `puma.rb` to match your setup. |
205 | 203 | # Mysql |
206 | 204 | sudo -u git cp config/database.yml.mysql config/database.yml |
207 | 205 | |
206 | + or | |
207 | + | |
208 | 208 | # PostgreSQL |
209 | 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 | 219 | ## Install Gems |
214 | 220 | |
... | ... | @@ -216,10 +222,10 @@ Make sure to update username/password in config/database.yml. |
216 | 222 | |
217 | 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 | 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 | 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 | 233 | |
228 | 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 | 241 | ## Install Init Script |
232 | 242 | |
... | ... | @@ -269,7 +279,7 @@ If you can't or don't want to use Nginx as your web server, have a look at the |
269 | 279 | [`Advanced Setup Tips`](./installation.md#advanced-setup-tips) section. |
270 | 280 | |
271 | 281 | ## Installation |
272 | - sudo apt-get install nginx | |
282 | + sudo apt-get install -y nginx | |
273 | 283 | |
274 | 284 | ## Site Configuration |
275 | 285 | |
... | ... | @@ -280,10 +290,8 @@ Download an example site config: |
280 | 290 | |
281 | 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 | 295 | sudo vim /etc/nginx/sites-available/gitlab |
288 | 296 | |
289 | 297 | ## Restart |
... | ... | @@ -344,10 +352,10 @@ GitLab uses [Omniauth](http://www.omniauth.org/) for authentication and already |
344 | 352 | |
345 | 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 | 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 | 359 | * Restart GitLab |
352 | 360 | |
353 | 361 | ### Examples | ... | ... |
... | ... | @@ -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 | 51 | exit 1 |
52 | 52 | else |
53 | 53 | if [ `whoami` = root ]; then |
54 | - execute "rm $SOCKET_PATH/gitlab.socket" | |
54 | + execute "rm -f $SOCKET_PATH/gitlab.socket" | |
55 | 55 | execute "RAILS_ENV=production bundle exec puma $DAEMON_OPTS" |
56 | 56 | execute "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &" |
57 | 57 | echo "$DESC started" | ... | ... |
lib/support/nginx/gitlab
... | ... | @@ -7,7 +7,7 @@ upstream gitlab { |
7 | 7 | } |
8 | 8 | |
9 | 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 | 11 | server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com; |
12 | 12 | server_tokens off; # don't show the version number, a security best practice |
13 | 13 | root /home/git/gitlab/public; | ... | ... |