Commit 0e45bf54 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch '6-6-stable' of dev.gitlab.org:gitlab/gitlabhq

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	VERSION
	doc/install/installation.md
parents 2bace31e 490f99d4
6.6.0.beta1-ee
6.6.0-ee
......@@ -153,6 +153,7 @@
img{
border: 1px solid #FFF;
background: url('trans_bg.gif');
max-width: 100%;
}
&.deleted {
border: 1px solid $deleted;
......
......@@ -27,7 +27,7 @@ class Namespace < ActiveRecord::Base
format: { with: Gitlab::Regex.name_regex,
message: "only letters, digits, spaces & '_' '-' '.' allowed." }
validates :description, length: { within: 0..255 }
validates :path, uniqueness: true, presence: true, length: { within: 1..255 },
validates :path, uniqueness: { case_sensitive: false }, presence: true, length: { within: 1..255 },
exclusion: { in: Gitlab::Blacklist.path },
format: { with: Gitlab::Regex.path_regex,
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
......
......@@ -109,7 +109,7 @@ class User < ActiveRecord::Base
validates :bio, length: { maximum: 255 }, allow_blank: true
validates :extern_uid, allow_blank: true, uniqueness: {scope: :provider}
validates :projects_limit, presence: true, numericality: {greater_than_or_equal_to: 0}
validates :username, presence: true, uniqueness: true,
validates :username, presence: true, uniqueness: { case_sensitive: false },
exclusion: { in: Gitlab::Blacklist.path },
format: { with: Gitlab::Regex.username_regex,
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
......
......@@ -3,6 +3,7 @@ module Notes
def execute
note = project.notes.new(params[:note])
note.author = current_user
note.system = false
note.save
note
end
......
# Setup Database
GitLab supports the following databases:
* MySQL (preferred)
* PostgreSQL
## Note
We do not recommend using MySQL due to various issues. For example, case [(in)sensitivity](https://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html) and [problems](http://bugs.mysql.com/bug.php?id=65830) that [suggested](http://bugs.mysql.com/bug.php?id=50909) [fixes](http://bugs.mysql.com/bug.php?id=65830) [have](http://bugs.mysql.com/bug.php?id=63164).
## MySQL
......@@ -47,25 +43,3 @@ GitLab supports the following databases:
mysql> \q
# You are done installing the database and can go back to the rest of the installation.
## PostgreSQL
# Install the database packages
sudo apt-get install -y postgresql-9.1 postgresql-client libpq-dev
# Login to PostgreSQL
sudo -u postgres psql -d template1
# Create a user for GitLab.
template1=# CREATE USER git;
# Create the GitLab production database & grant all privileges on database
template1=# CREATE DATABASE gitlabhq_production OWNER git;
# Quit the database session
template1=# \q
# Try connecting to the new database with the new user
sudo -u git -H psql -d gitlabhq_production
......@@ -144,7 +144,25 @@ GitLab Shell is an ssh access and repository management software developed speci
# 5. Database
To setup the MySQL/PostgreSQL database and dependencies please see [doc/install/databases.md](./databases.md).
We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](doc/install/database_mysql.md).
# Install the database packages
sudo apt-get install -y postgresql-9.1 postgresql-client libpq-dev
# Login to PostgreSQL
sudo -u postgres psql -d template1
# Create a user for GitLab.
template1=# CREATE USER git;
# Create the GitLab production database & grant all privileges on database
template1=# CREATE DATABASE gitlabhq_production OWNER git;
# Quit the database session
template1=# \q
# Try connecting to the new database with the new user
sudo -u git -H psql -d gitlabhq_production
# 6. GitLab
......@@ -155,13 +173,13 @@ To setup the MySQL/PostgreSQL database and dependencies please see [doc/install/
## Clone the Source
# Clone GitLab repository
sudo -u git -H git clone https://gitlab.com/subscribers/gitlab-ee.git -b 6-5-stable-ee gitlab
sudo -u git -H git clone https://gitlab.com/subscribers/gitlab-ee.git -b 6-6-stable-ee gitlab
# Go to gitlab dir
cd /home/git/gitlab
**Note:**
You can change `6-5-stable-ee` to `master` if you want the *bleeding edge* version, but never install master on a production server!
You can change `6-6-stable-ee` to `master` if you want the *bleeding edge* version, but never install master on a production server!
## Configure it
......@@ -216,8 +234,8 @@ Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup.
## Configure GitLab DB settings
# Mysql
sudo -u git cp config/database.yml.mysql config/database.yml
# PostgreSQL
sudo -u git cp config/database.yml.postgresql config/database.yml
# Make sure to update username/password in config/database.yml.
# You only need to adapt the production settings (first part).
......@@ -227,10 +245,8 @@ Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup.
sudo -u git -H editor config/database.yml
or
# PostgreSQL
sudo -u git cp config/database.yml.postgresql config/database.yml
# Mysql
sudo -u git cp config/database.yml.mysql config/database.yml
# Make config/database.yml readable to git only
sudo -u git -H chmod o-rwx config/database.yml
......@@ -239,12 +255,12 @@ Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup.
cd /home/git/gitlab
# For MySQL (note, the option says "without ... postgres")
sudo -u git -H bundle install --deployment --without development test postgres aws
# Or for PostgreSQL (note, the option says "without ... mysql")
# For PostgreSQL (note, the option says "without ... mysql")
sudo -u git -H bundle install --deployment --without development test mysql aws
# Or if you use MySQL (note, the option says "without ... postgres")
sudo -u git -H bundle install --deployment --without development test postgres aws
## Initialize Database and Activate Advanced Features
......
# From 6.5 to 6.6
### 0. Backup
```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 --all
```
For Gitlab Community Edition:
```bash
sudo -u git -H git checkout 6-6-stable
```
OR
For GitLab Enterprise Edition:
```bash
sudo -u git -H git checkout 6-6-stable-ee
```
### 3. Update gitlab-shell (and its config)
```bash
cd /home/git/gitlab-shell
sudo -u git -H git fetch
sudo -u git -H git checkout v1.8.0
```
### 4. Install libs, migrations, etc.
```bash
cd /home/git/gitlab
# MySQL installations (note: the line below states '--without ... postgres')
sudo -u git -H bundle install --without development test postgres --deployment
# PostgreSQL installations (note: the line below states '--without ... mysql')
sudo -u git -H bundle install --without development test mysql --deployment
# Run database migrations
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
# Clean up assets and cache
sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
# Update init.d script
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
```
### 5. Start application
sudo service gitlab start
sudo service nginx restart
### 6. 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 is complete!
## Things went south? Revert to previous version (6.5)
### 1. Revert the code to the previous version
Follow the [`upgrade guide from 6.4 to 6.5`](6.4-to-6.5.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
```
If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment