summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--app/controllers/admin/groups_controller.rb4
-rw-r--r--db/migrate/20130326142630_add_index_to_users_authentication_token.rb5
-rw-r--r--db/schema.rb1
-rw-r--r--doc/install/databases.md19
-rw-r--r--doc/install/installation.md72
-rw-r--r--doc/update/5.2-to-5.3.md80
-rw-r--r--lib/support/init.d/gitlab2
-rw-r--r--lib/support/nginx/gitlab2
9 files changed, 147 insertions, 39 deletions
diff --git a/CHANGELOG b/CHANGELOG
index f26466f9da8..7d1ada97c57 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -24,6 +24,7 @@ v 5.3.0
- init.d: Ensure socket is removed before starting service
- Admin area: Style teams:index, group:show pages
- Own page for failed forking
+ - Scrum view for milestone
v 5.2.0
- Turbolinks
diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb
index 44ec6079e5b..824eaca348f 100644
--- a/app/controllers/admin/groups_controller.rb
+++ b/app/controllers/admin/groups_controller.rb
@@ -8,10 +8,6 @@ class Admin::GroupsController < Admin::ApplicationController
end
def show
- @projects = Project.scoped
- @projects = @projects.not_in_group(@group) if @group.projects.present?
- @projects = @projects.all
- @projects.reject!(&:empty_repo?)
end
def new
diff --git a/db/migrate/20130326142630_add_index_to_users_authentication_token.rb b/db/migrate/20130326142630_add_index_to_users_authentication_token.rb
new file mode 100644
index 00000000000..d42ef113738
--- /dev/null
+++ b/db/migrate/20130326142630_add_index_to_users_authentication_token.rb
@@ -0,0 +1,5 @@
+class AddIndexToUsersAuthenticationToken < ActiveRecord::Migration
+ def change
+ add_index :users, :authentication_token, unique: true
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 500828a97e2..ef9dcfcdcc0 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -295,6 +295,7 @@ ActiveRecord::Schema.define(:version => 20130621195223) do
end
add_index "users", ["admin"], :name => "index_users_on_admin"
+ add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
add_index "users", ["name"], :name => "index_users_on_name"
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
diff --git a/doc/install/databases.md b/doc/install/databases.md
index 2d94aa9b4a3..5ec1d0c6524 100644
--- a/doc/install/databases.md
+++ b/doc/install/databases.md
@@ -11,10 +11,17 @@ GitLab supports the following databases:
# Install the database packages
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
+ # Pick a database root password (can be anything), type it and press enter
+ # Retype the database root password and press enter
+
# Login to MySQL
mysql -u root -p
- # Create a user for GitLab. (change $password to a real password)
+ # Type the database root password
+
+ # Create a user for GitLab
+ # do not type the 'mysql>', this is part of the prompt
+ # change $password in the command below to a real password you pick
mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
# Create the GitLab production database
@@ -29,6 +36,16 @@ GitLab supports the following databases:
# Try connecting to the new database with the new user
sudo -u git -H mysql -u gitlab -p -D gitlabhq_production
+ # Type the password you replaced $password with earlier
+
+ # You should now see a 'mysql>' prompt
+
+ # Quit the database session
+ mysql> \q
+
+ # You are done installing the database and can go back to the rest of the installation.
+
+
## PostgreSQL
# Install the database packages
diff --git a/doc/install/installation.md b/doc/install/installation.md
index 3b459ad77b5..a16c5acf1b1 100644
--- a/doc/install/installation.md
+++ b/doc/install/installation.md
@@ -36,10 +36,10 @@ The GitLab installation consists of setting up the following components:
`sudo` is not installed on Debian by default. Make sure your system is
up-to-date and install it.
- # run as root
- apt-get update
- apt-get upgrade
- apt-get install sudo
+ # run as root!
+ apt-get update -y
+ apt-get upgrade -y
+ apt-get install sudo -y
**Note:**
Vim is an editor that is used here whenever there are files that need to be
@@ -55,7 +55,7 @@ Install the required packages:
Make sure you have the right version of Python installed.
# Install Python
- sudo apt-get install python
+ sudo apt-get install -y python
# Make sure that Python is 2.5+ (3.x is not supported at the moment)
python --version
@@ -73,15 +73,17 @@ Make sure you have the right version of Python installed.
mail server. By default, Debian is shipped with exim4 whereas Ubuntu
does not ship with one. The recommended mail server is postfix and you can install it with:
- sudo apt-get install postfix
+ sudo apt-get install -y postfix
+
+Then select 'Internet Site' and press enter to confirm the hostname.
# 2. Ruby
-Remove old 1.8 ruby if present
+Remove the old Ruby 1.8 if present
- sudo apt-get remove ruby1.8
+ sudo apt-get remove -y ruby1.8
-Download and compile it:
+Download Ruby and compile it:
mkdir /tmp/ruby && cd /tmp/ruby
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:
Install the Bundler Gem:
- sudo gem install bundler
+ sudo gem install bundler --no-ri --no-rdoc
# 3. System Users
@@ -106,28 +108,25 @@ Create a `git` user for Gitlab:
GitLab Shell is a ssh access and repository management software developed specially for GitLab.
- # Login as git
- sudo su git
-
# Go to home directory
cd /home/git
# Clone gitlab shell
- git clone https://github.com/gitlabhq/gitlab-shell.git
+ sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git
cd gitlab-shell
# switch to right version
- git checkout v1.4.0
+ sudo -u git -H git checkout v1.4.0
- cp config.yml.example config.yml
+ sudo -u git -H cp config.yml.example config.yml
# Edit config and replace gitlab_url
# with something like 'http://domain.com/'
- vim config.yml
+ sudo -u git -H vim config.yml
# Do setup
- ./bin/install
+ sudo -u git -H ./bin/install
# 5. Database
@@ -149,11 +148,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-2-stable
+ sudo -u git -H git checkout 5-3-stable
**Note:**
-You can change `5-2-stable` to `master` if you want the *bleeding edge* version, but
-do so with caution!
+You can change `5-3-stable` to `master` if you want the *bleeding edge* version, but do so with caution!
## Configure it
@@ -205,10 +203,18 @@ Make sure to edit both `gitlab.yml` and `puma.rb` to match your setup.
# Mysql
sudo -u git cp config/database.yml.mysql config/database.yml
+ or
+
# PostgreSQL
sudo -u git cp config/database.yml.postgresql config/database.yml
-Make sure to update username/password in config/database.yml.
+ # Make sure to update username/password in config/database.yml.
+ # You only need to adapt the production settings (first part).
+ # If you followed the database guide then please do as follows:
+ # Change 'root' to 'gitlab'
+ # Change 'secure password' with the value you have given to $password
+ # You can keep the double quotes around the password
+ sudo -u git -H vim config/database.yml
## Install Gems
@@ -216,10 +222,10 @@ Make sure to update username/password in config/database.yml.
sudo gem install charlock_holmes --version '0.6.9.4'
- # For MySQL (note, the option says "without")
+ # For MySQL (note, the option says "without ... postgres")
sudo -u git -H bundle install --deployment --without development test postgres
- # Or for PostgreSQL
+ # Or for PostgreSQL (note, the option says "without ... mysql")
sudo -u git -H bundle install --deployment --without development test mysql
@@ -227,6 +233,10 @@ Make sure to update username/password in config/database.yml.
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
+ # Type 'yes' to create the database.
+
+ # When done you see 'Administrator account created:'
+
## Install Init Script
@@ -269,7 +279,7 @@ If you can't or don't want to use Nginx as your web server, have a look at the
[`Advanced Setup Tips`](./installation.md#advanced-setup-tips) section.
## Installation
- sudo apt-get install nginx
+ sudo apt-get install -y nginx
## Site Configuration
@@ -280,10 +290,8 @@ Download an example site config:
Make sure to edit the config file to match your setup:
- # **YOUR_SERVER_FQDN** to the fully-qualified
- # domain name of your host serving GitLab. Also, replace
- # the 'listen' line with the following:
- # listen 80 default_server; # e.g., listen 192.168.1.1:80;
+ # Change YOUR_SERVER_FQDN to the fully-qualified
+ # domain name of your host serving GitLab.
sudo vim /etc/nginx/sites-available/gitlab
## Restart
@@ -344,10 +352,10 @@ GitLab uses [Omniauth](http://www.omniauth.org/) for authentication and already
These steps are fairly general and you will need to figure out the exact details from the Omniauth provider's documentation.
-* Add `gem "omniauth-your-auth-provider"` to the [Gemfile](https://github.com/gitlabhq/gitlabhq/blob/5-2-stable/Gemfile#L18)
+* Add `gem "omniauth-your-auth-provider"` to the [Gemfile](https://github.com/gitlabhq/gitlabhq/blob/5-3-stable/Gemfile#L18)
* Run `sudo -u git -H bundle install` to install the new gem(s)
-* 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)
-* 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)
+* 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)
+* 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)
* Restart GitLab
### Examples
diff --git a/doc/update/5.2-to-5.3.md b/doc/update/5.2-to-5.3.md
new file mode 100644
index 00000000000..ff95e1c05c4
--- /dev/null
+++ b/doc/update/5.2-to-5.3.md
@@ -0,0 +1,80 @@
+# From 5.2 to 5.3
+
+### 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 RAILS_ENV=production bundle exec rake gitlab:backup:create
+```
+
+### 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-3-stable
+```
+
+### 3. 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
+```
+
+### 4. Update config files
+
+* 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.
+* 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.
+
+### 5. Update Init script
+
+```bash
+sudo rm /etc/init.d/gitlab
+sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5-3-stable/lib/support/init.d/gitlab
+sudo chmod +x /etc/init.d/gitlab
+```
+
+### 6. Start application
+
+ sudo service gitlab start
+ sudo service nginx restart
+
+### 7. 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.2)
+
+### 1. Revert the code to the previous version
+Follow the [`upgrade guide from 5.1 to 5.2`](5.1-to-5.2.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 RAILS_ENV=production bundle exec rake gitlab:backup:restore
+```
diff --git a/lib/support/init.d/gitlab b/lib/support/init.d/gitlab
index f4ca07b3676..bb0151d9335 100644
--- a/lib/support/init.d/gitlab
+++ b/lib/support/init.d/gitlab
@@ -51,7 +51,7 @@ start() {
exit 1
else
if [ `whoami` = root ]; then
- execute "rm $SOCKET_PATH/gitlab.socket"
+ execute "rm -f $SOCKET_PATH/gitlab.socket"
execute "RAILS_ENV=production bundle exec puma $DAEMON_OPTS"
execute "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
echo "$DESC started"
diff --git a/lib/support/nginx/gitlab b/lib/support/nginx/gitlab
index be7a378b3aa..3e929c52990 100644
--- a/lib/support/nginx/gitlab
+++ b/lib/support/nginx/gitlab
@@ -7,7 +7,7 @@ upstream gitlab {
}
server {
- listen YOUR_SERVER_IP:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
+ listen *:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com;
server_tokens off; # don't show the version number, a security best practice
root /home/git/gitlab/public;