diff options
author | Kevin Lyda <kevin@ie.suberic.net> | 2014-01-05 13:53:08 +0000 |
---|---|---|
committer | Kevin Lyda <kevin@ie.suberic.net> | 2014-01-05 13:53:08 +0000 |
commit | 284546b2e00639bfa5e965f6a846cf308752d58e (patch) | |
tree | 7a9f96e99fa67b718527a768a0c545c63f5ccf2b /doc | |
parent | dcaedb4a5e3dae774e0211935977cf4514e2a928 (diff) | |
parent | d28ee0df124d79e9d0968c3325ae010b55d4a7b6 (diff) | |
download | gitlab-ce-284546b2e00639bfa5e965f6a846cf308752d58e.tar.gz |
Merge branch 'master' into logo-white-compress
Conflicts:
app/assets/images/logo-black.png
app/assets/images/logo-white.png
Diffstat (limited to 'doc')
27 files changed, 903 insertions, 110 deletions
diff --git a/doc/api/projects.md b/doc/api/projects.md index 3ae9af59fc3..53acc4a025e 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -2,7 +2,7 @@ ### List projects -Get a list of projects owned by the authenticated user. +Get a list of projects accessible by the authenticated user. ``` GET /projects @@ -15,6 +15,7 @@ GET /projects "description": null, "default_branch": "master", "public": false, + "visibility_level": 0, "ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-client.git", "web_url": "http://example.com/diaspora/diaspora-client", @@ -49,6 +50,7 @@ GET /projects "description": null, "default_branch": "master", "public": false, + "visibility_level": 0, "ssh_url_to_repo": "git@example.com:brightbox/puppet.git", "http_url_to_repo": "http://example.com/brightbox/puppet.git", "web_url": "http://example.com/brightbox/puppet", @@ -82,6 +84,22 @@ GET /projects ``` +#### List owned projects + +Get a list of projects owned by the authenticated user. + +``` +GET /projects/owned +``` + +#### List ALL projects + +Get a list of all GitLab projects (admin only). + +``` +GET /projects/all +``` + ### Get single project Get a specific project, identified by project ID or NAMESPACE/PROJECT_NAME , which is owned by the authentication user. @@ -101,6 +119,7 @@ Parameters: "description": null, "default_branch": "master", "public": false, + "visibility_level": 0, "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", "web_url": "http://example.com/diaspora/diaspora-project-site", @@ -213,13 +232,13 @@ Parameters: + `name` (required) - new project name + `description` (optional) - short project description -+ `default_branch` (optional) - 'master' by default + `issues_enabled` (optional) + `wall_enabled` (optional) + `merge_requests_enabled` (optional) + `wiki_enabled` (optional) + `snippets_enabled` (optional) -+ `public` (optional) ++ `public` (optional) - if `true` same as setting visibility_level = 20 ++ `visibility_level` (optional) ### Create project for user @@ -241,7 +260,8 @@ Parameters: + `merge_requests_enabled` (optional) + `wiki_enabled` (optional) + `snippets_enabled` (optional) -+ `public` (optional) ++ `public` (optional) - if `true` same as setting visibility_level = 20 ++ `visibility_level` (optional) ## Remove project @@ -382,6 +402,10 @@ Parameters: { "id": 1, "url": "http://example.com/hook", + "project_id": 3, + "push_events": "true", + "issues_events": "true", + "merge_requests_events": "true", "created_at": "2012-10-12T17:04:47Z" } ``` @@ -399,6 +423,9 @@ Parameters: + `id` (required) - The ID or NAME of a project + `url` (required) - The hook URL ++ `push_events` - Trigger hook on push events ++ `issues_events` - Trigger hook on issues events ++ `merge_requests_events` - Trigger hook on merge_requests events ### Edit project hook @@ -414,6 +441,9 @@ Parameters: + `id` (required) - The ID or NAME of a project + `hook_id` (required) - The ID of a project hook + `url` (required) - The hook URL ++ `push_events` - Trigger hook on push events ++ `issues_events` - Trigger hook on issues events ++ `merge_requests_events` - Trigger hook on merge_requests events ### Delete project hook @@ -458,7 +488,7 @@ Parameters: "id":"3f94fc7c85061973edc9906ae170cc269b07ca55" }], "tree": "c68537c6534a02cc2b176ca1549f4ffa190b58ee", - "message":"give caolan his credit where it's due (up top)", + "message":"give caolan credit where it's due (up top)", "author": { "name":"Jeremy Ashkenas", "email":"jashkenas@example.com" diff --git a/doc/api/repositories.md b/doc/api/repositories.md index 2769c22d6aa..6b3a43b869e 100644 --- a/doc/api/repositories.md +++ b/doc/api/repositories.md @@ -343,9 +343,9 @@ Parameters: ``` -## Raw blob content +## Raw file content -Get the raw file contents for a file. +Get the raw file contents for a file by commit sha and path. ``` GET /projects/:id/repository/blobs/:sha @@ -358,6 +358,20 @@ Parameters: + `filepath` (required) - The path the file +## Raw blob content + +Get the raw file contents for a blob by blob sha. + +``` +GET /projects/:id/repository/raw_blobs/:sha +``` + +Parameters: + ++ `id` (required) - The ID of a project ++ `sha` (required) - The blob sha + + ## Get file archive Get a an archive of the repository @@ -368,4 +382,43 @@ GET /projects/:id/repository/archive Parameters: + `id` (required) - The ID of a project -+ `sha` (optional) - The commit sha to download defaults to the tip of the default branch
\ No newline at end of file ++ `sha` (optional) - The commit sha to download defaults to the tip of the default branch + + +## Create new file in repository + +``` +POST /projects/:id/repository/files +``` + +Parameters: + ++ `file_path` (optional) - Full path to new file. Ex. lib/class.rb ++ `branch_name` (required) - The name of branch ++ `content` (required) - File content ++ `commit_message` (required) - Commit message + +## Update existing file in repository + +``` +PUT /projects/:id/repository/files +``` + +Parameters: + ++ `file_path` (required) - Full path to file. Ex. lib/class.rb ++ `branch_name` (required) - The name of branch ++ `content` (required) - New file content ++ `commit_message` (required) - Commit message + +## Delete existing file in repository + +``` +DELETE /projects/:id/repository/files +``` + +Parameters: + ++ `file_path` (required) - Full path to file. Ex. lib/class.rb ++ `branch_name` (required) - The name of branch ++ `commit_message` (required) - Commit message diff --git a/doc/development/architecture.md b/doc/development/architecture.md new file mode 100644 index 00000000000..db22f0bda85 --- /dev/null +++ b/doc/development/architecture.md @@ -0,0 +1,23 @@ +# GitLab project architecture + +GitLab project consists of two parts: GitLab and GitLab shell. + +## GitLab + +Web application with background jobs workers. +Provides you with UI and most of functionality. +For some operations like repo creation - uses GitLab shell. + +Uses: + * Ruby as main language for application code and most libraries. + * [Rails](http://rubyonrails.org/) web framework as main framework for application. + * Mysql or postgres as main databases. Used for persistent data storage(users, project, issues etc). + * Redis database. Used for cache and exchange data between some components. + * Python2 because of [pygments](http://pygments.org/) as code syntax highlighter. + +## GitLab shell + +Command line ruby application. Used by GitLab through shell commands. +It provides interface to all kind of manipulations with repositories and ssh keys. +Full list of commands you can find in README of GitLab shell repo. +Works on pure ruby and do not require any additional software. diff --git a/doc/install/databases.md b/doc/install/databases.md index be7bc0aad2e..6016e97ede5 100644 --- a/doc/install/databases.md +++ b/doc/install/databases.md @@ -25,19 +25,19 @@ GitLab supports the following databases: # 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'; + mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password'; # Create the GitLab production database mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; # Grant the GitLab user necessary permissions on the table. - mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost'; + mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'git'@'localhost'; # Quit the database session mysql> \q # Try connecting to the new database with the new user - sudo -u git -H mysql -u gitlab -p -D gitlabhq_production + sudo -u git -H mysql -u git -p -D gitlabhq_production # Type the password you replaced $password with earlier diff --git a/doc/install/installation.md b/doc/install/installation.md index a63b7d725bb..6961e461482 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -1,6 +1,6 @@ # Select Version to Install Make sure you view this installation guide from the branch (version) of GitLab you would like to install. In most cases -this should be the highest numbered stable branch (example shown below). +this should be the highest numbered stable branch (example shown below).  @@ -14,7 +14,7 @@ This is the official installation guide to set up a production server. To set up The following steps have been known to work. Please **use caution when you deviate** from this guide. Make sure you don't violate any assumptions GitLab makes about its environment. For example many people run into permission problems because they changed the location of directories or run services as the wrong user. -If you find a bug/error in this guide please **submit a pull request** following the [contributing guide](../../CONTRIBUTING.md). +If you find a bug/error in this guide please **submit a merge request** following the [contributing guide](../../CONTRIBUTING.md). - - - @@ -105,7 +105,7 @@ Is the system packaged Git too old? Remove it and compile from source. 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 -y postfix + sudo apt-get install -y postfix Then select 'Internet Site' and press enter to confirm the hostname. @@ -118,8 +118,8 @@ Remove the old Ruby 1.8 if present Download Ruby and compile it: mkdir /tmp/ruby && cd /tmp/ruby - curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | tar xz - cd ruby-2.0.0-p247 + curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz | tar xz + cd ruby-2.0.0-p353 ./configure --disable-install-rdoc make sudo make install @@ -144,13 +144,10 @@ GitLab Shell is an ssh access and repository management software developed speci cd /home/git # Clone gitlab shell - sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git + sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-shell.git -b v1.8.0 cd gitlab-shell - # switch to right version - sudo -u git -H git checkout v1.7.1 - sudo -u git -H cp config.yml.example config.yml # Edit config and replace gitlab_url @@ -174,16 +171,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://github.com/gitlabhq/gitlabhq.git gitlab + sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 6-4-stable gitlab # Go to gitlab dir cd /home/git/gitlab - # Checkout to stable release - sudo -u git -H git checkout 6-2-stable - **Note:** -You can change `6-2-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server! +You can change `6-4-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server! ## Configure it @@ -227,10 +221,6 @@ You can change `6-2-stable` to `master` if you want the *bleeding edge* version, # Copy the example Rack attack config sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb - # Enable rack attack middleware - # Find and uncomment the line 'config.middleware.use Rack::Attack' - sudo -u git -H editor config/application.rb - # Configure Git global settings for git user, useful when editing via web # Edit user.email according to what is set in gitlab.yml sudo -u git -H git config --global user.name "GitLab" @@ -257,7 +247,7 @@ Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup. # PostgreSQL sudo -u git cp config/database.yml.postgresql config/database.yml - + # Make config/database.yml readable to git only sudo -u git -H chmod o-rwx config/database.yml @@ -265,8 +255,6 @@ Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup. cd /home/git/gitlab - sudo gem install charlock_holmes --version '0.6.9.4' - # For MySQL (note, the option says "without ... postgres") sudo -u git -H bundle install --deployment --without development test postgres aws @@ -288,7 +276,12 @@ Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup. Download the init script (will be /etc/init.d/gitlab): sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - sudo chmod +x /etc/init.d/gitlab + +And if you are installing with a non-default folder or user copy and edit the defaults file: + + sudo cp lib/support/init.d/gitlab.default.example /etc/default/gitlab + +If you installed gitlab in another directory or as a user other than the default you should change these settings in /etc/default/gitlab. Do not edit /etc/init.d/gitlab as it will be changed on upgrade. Make GitLab start on boot: @@ -310,21 +303,17 @@ Check if GitLab and its environment are configured correctly: # or sudo /etc/init.d/gitlab restart -## Double-check Application Status - -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 +## Compile assets -If all items are green, then congratulations on successfully installing GitLab! -However there are still a few steps left. + sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production # 7. Nginx **Note:** Nginx is the officially supported web server for GitLab. If you cannot or do not want to use Nginx as your web server, have a look at the -[GitLab recipes](https://github.com/gitlabhq/gitlab-recipes). +[GitLab recipes](https://gitlab.com/gitlab-org/gitlab-recipes/). ## Installation sudo apt-get install -y nginx @@ -349,7 +338,17 @@ Make sure to edit the config file to match your setup: # Done! -Visit YOUR_SERVER for your first GitLab login. +## Double-check Application Status + +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 on successfully installing GitLab! + +## Initial Login + +Visit YOUR_SERVER in your web browser for your first GitLab login. The setup has created an admin account for you. You can use it to log in: admin@local.host @@ -376,7 +375,7 @@ a different host, you can configure its connection string via the # example production: redis://redis.example.tld:6379 -If you want to connect the Redis server via socket, then use the "unix:" URL scheme +If you want to connect the Redis server via socket, then use the "unix:" URL scheme and the path to the Redis socket file in the `config/resque.yml` file. # example @@ -409,10 +408,10 @@ These steps are fairly general and you will need to figure out the exact details * Stop GitLab `sudo service gitlab stop` -* 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/master/config/gitlab.yml.example) as a reference) +* Add provider specific configuration options to your `config/gitlab.yml` (you can use the [auth providers section of the example config](https://gitlab.com/gitlab-org/gitlab-ce/blob/masterconfig/gitlab.yml.example) as a reference) -* Add the gem to your [Gemfile](https://github.com/gitlabhq/gitlabhq/blob/master/Gemfile) - `gem "omniauth-your-auth-provider"` +* Add the gem to your [Gemfile](https://gitlab.com/gitlab-org/gitlab-ce/blob/masterGemfile) + `gem "omniauth-your-auth-provider"` * If you're using MySQL, install the new Omniauth provider gem by running the following command: `sudo -u git -H bundle install --without development test postgres --path vendor/bundle --no-deployment` @@ -428,5 +427,5 @@ These steps are fairly general and you will need to figure out the exact details ### Examples If you have successfully set up a provider that is not shipped with GitLab itself, please let us know. -You can help others by reporting successful configurations and probably share a few insights or provide warnings for common errors or pitfalls by sharing your experience [in the public Wiki](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Working-Custom-Omniauth-Provider-Configurations). +You can help others by reporting successful configurations and probably share a few insights or provide warnings for common errors or pitfalls by sharing your experience [in the public Wiki](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Custom-omniauth-provider-configurations). While we can't officially support every possible auth mechanism out there, we'd like to at least help those with special needs. diff --git a/doc/install/requirements.md b/doc/install/requirements.md index 30a95646741..e9c95ba2ef9 100644 --- a/doc/install/requirements.md +++ b/doc/install/requirements.md @@ -1,40 +1,45 @@ # Operating Systems -## Linux - GitLab is developed for the Linux operating system. -GitLab officially supports (recent versions of) these Linux distributions: +## GitLab officially supports - Ubuntu Linux - Debian/GNU Linux -It should also work on (though they are not officially supported): +## GitLab.com offers paid support for -- Arch +- Red Hat Enterprise Linux (RHEL) - CentOS +- Oracle Linux + +## Not officially supported + +- Arch Linux - Fedora - Gentoo -- RedHat -## Other Unix Systems +On the above distributions it is pretty easy to install GitLab yourself. + +## Unsupported Unix Systems -There is nothing that prevents GitLab from running on other Unix operating -systems. This means you may get it to work on systems running FreeBSD or OS X. -**If you want to try, please proceed with caution!** +There is nothing that prevents GitLab from running on other Unix operating systems. +This means you may get it to work on systems running FreeBSD or OS X. +If you want to do this, please be aware it could be a lot of work. +Please consider using a virtual machine to run GitLab. -## Windows +## Other operating systems such as Windows -GitLab does **not** run on Windows and we have no plans of supporting it in the -near future. Please consider using a virtual machine to run GitLab. +GitLab does **not** run on Windows and we have no plans of supporting it in the near future. +Please consider using a virtual machine to run GitLab. -# Rubies +# Ruby versions -GitLab requires Ruby (MRI) 1.9.3 and several Gems with native components. -While it is generally possible to use other Rubies (like -[JRuby](http://jruby.org/) or [Rubinius](http://rubini.us/)) it might require -some work on your part. +GitLab requires Ruby (MRI) 1.9.3 or 2.0+. +While it is generally possible to use other Rubies +(like [JRuby](http://jruby.org/) or [Rubinius](http://rubini.us/)) +it might require some work since GitLab uses several Gems that have native extensions. # Hardware requirements diff --git a/doc/legal/corporate_contributor_license_agreement.md b/doc/legal/corporate_contributor_license_agreement.md new file mode 100644 index 00000000000..bbc274f3b0c --- /dev/null +++ b/doc/legal/corporate_contributor_license_agreement.md @@ -0,0 +1,25 @@ +You accept and agree to the following terms and conditions for Your present and future Contributions submitted to GitLab.com. Except for the license granted herein to GitLab.com and recipients of software distributed by GitLab.com, You reserve all right, title, and interest in and to Your Contributions. + +1. Definitions. + + "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with GitLab.com. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + "Contribution" shall mean the code, documentation or other original works of authorship expressly identified in Schedule B, as well as any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to GitLab.com for inclusion in, or documentation of, any of the products owned or managed by GitLab.com (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to GitLab.com or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, GitLab.com for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." + +2. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to GitLab.com and to recipients of software distributed by GitLab.com a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. + +3. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to GitLab.com and to recipients of software distributed by GitLab.com a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. + +4. You represent that You are legally entitled to grant the above license. You represent further that each employee of the Corporation designated on Schedule A below (or in a subsequent written modification to that Schedule) is authorized to submit Contributions on behalf of the Corporation. + +5. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). + +6. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. + +7. Should You wish to submit work that is not Your original creation, You may submit it to GitLab.com separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]". + +8. It is your responsibility to notify GitLab.com when any change is required to the list of designated employees authorized to submit Contributions on behalf of the Corporation, or to the Corporation's Point of Contact with GitLab.com. + +--------------------------------------- + +This text is licensed under the [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/) and the original source is the Google Open Source Programs Office. diff --git a/doc/legal/individual_contributor_license_agreement.md b/doc/legal/individual_contributor_license_agreement.md new file mode 100644 index 00000000000..eaf5812ca4c --- /dev/null +++ b/doc/legal/individual_contributor_license_agreement.md @@ -0,0 +1,25 @@ +You accept and agree to the following terms and conditions for Your present and future Contributions submitted to GitLab.com. Except for the license granted herein to GitLab.com and recipients of software distributed by GitLab.com, You reserve all right, title, and interest in and to Your Contributions. + +1. Definitions. + + "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with GitLab.com. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + "Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to GitLab.com for inclusion in, or documentation of, any of the products owned or managed by GitLab.com (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to GitLab.com or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, GitLab.com for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." + +2. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to GitLab.com and to recipients of software distributed by GitLab.com a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. + +3. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to GitLab.com and to recipients of software distributed by GitLab.com a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. + +4. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to GitLab.com, or that your employer has executed a separate Corporate CLA with GitLab.com. + +5. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions. + +6. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. + +7. Should You wish to submit work that is not Your original creation, You may submit it to GitLab.com separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [[]named here]". + +8. You agree to notify GitLab.com of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. + +--------------------------------------- + +This text is licensed under the [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/) and the original source is the Google Open Source Programs Office. diff --git a/doc/markdown/markdown.md b/doc/markdown/markdown.md index a84222f9fc2..6b5308afc4f 100644 --- a/doc/markdown/markdown.md +++ b/doc/markdown/markdown.md @@ -187,7 +187,7 @@ GFM will recognize the following: * !123 : for merge requests * $123 : for snippets * 1234567 : for commits -* [file](path/to/file) : for file references +* \[file\](path/to/file) : for file references <a name="standard"/> diff --git a/doc/make_release.md b/doc/release/monthly.md index 7f19a17da6d..1175942cfff 100644 --- a/doc/make_release.md +++ b/doc/release/monthly.md @@ -1,4 +1,4 @@ -# Things to do when creating new release +# Things to do when creating new monthly minor or major release NOTE: This is a guide for GitLab developers. If you are trying to install GitLab see the latest stable [installation guide](install/installation.md) and if you are trying to upgrade, see the [upgrade guides](update). ## Install guide up to date? @@ -27,16 +27,16 @@ NOTE: This is a guide for GitLab developers. If you are trying to install GitLab Check if any of these changed since last release (~22nd of last month depending on when last release branch was created): -* https://github.com/gitlabhq/gitlabhq/commits/master/lib/support/nginx/gitlab -* https://github.com/gitlabhq/gitlab-shell/commits/master/config.yml.example -* https://github.com/gitlabhq/gitlabhq/commits/master/config/gitlab.yml.example -* https://github.com/gitlabhq/gitlabhq/commits/master/config/unicorn.rb.example -* https://github.com/gitlabhq/gitlabhq/commits/master/config/database.yml.mysql -* https://github.com/gitlabhq/gitlabhq/commits/master/config/database.yml.postgresql +* https://gitlab.com/gitlab-org/gitlab-ce/commits/master/lib/support/nginx/gitlab +* https://gitlab.com/gitlab-org/gitlab-shell/commits/master/config.yml.example +* https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/gitlab.yml.example +* https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/unicorn.rb.example +* https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/database.yml.mysql +* https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/database.yml.postgresql #### 8. Need to update init script? -Check if changed since last release (~22nd of last month depending on when last release branch was created): https://github.com/gitlabhq/gitlabhq/commits/master/lib/support/init.d/gitlab +Check if changed since last release (~22nd of last month depending on when last release branch was created): https://gitlab.com/gitlab-org/gitlab-ce/commits/master/lib/support/init.d/gitlab #### 9. Start application @@ -58,14 +58,21 @@ Check if changed since last release (~22nd of last month depending on when last After making the release branch new commits are cherry-picked from master. When the release gets closer we get more selective what is cherry-picked. -- 5 days before release: feature freeze -- 3 days before release: UI freeze -- 1 day before release: code freeze +* 5 days before release: feature freeze (stop merging new features) +* 4 days before release: UI freeze (stop merging changes to the user interface) +* 3 days before release: code freeze (stop merging non-essential code improvements) +* 2 days before release: release candidate 1 (tag and tweet about x.x.rc1) +* 1 day before release: release candidate 2 (optional, only if rc1 had problems) + +# Write a blog post + +* Mention what GitLab is on the second line: GitLab is open source software to collaborate on code. +* Select and thank the the Most Valuable Person (MVP) of this release. +* Note if there are security fixes: This release fixes an important security issue and we advise everyone to upgrade as soon as possible. ## Last actions -1. Write a blog post (mention what GitLab is on the first line, select a MVP) 1. Update VERSION and CHANGELOG 1. Create a git tag vX.X.X 1. Publish the blog post -1. Tweet about the release +1. Tweet about the release
\ No newline at end of file diff --git a/doc/release/security.md b/doc/release/security.md new file mode 100644 index 00000000000..a77cbae3eaa --- /dev/null +++ b/doc/release/security.md @@ -0,0 +1,76 @@ +# Things to do when doing an out-of-bound security release +NOTE: This is a guide for GitLab developers. If you are trying to install GitLab see the latest stable [installation guide](install/installation.md) and if you are trying to upgrade, see the [upgrade guides](update). + +## When to do a security release + +Do a security release when there is a critical issue that needs to be adresses before the next monthly release. Otherwise include it in the monthly release and note there was a security fix in the release announcement. + +## Security vulnerability disclosure + +Please report suspected security vulnerabilities in private to support@gitlab.com, also see the [disclosure section on the GitLab.com website](http://www.gitlab.com/disclosure/). Please do NOT create publicly viewable issues for suspected security vulnerabilities. + +## Release Procedure + +1. Verify that the issue can be repoduced +1. Acknowledge the issue to the researcher that disclosed it +1. Fix the issue on a feature branch, do this on the private GitLab development server and update the VERSION and CHANGELOG in this branch +1. Consider creating and testing workarounds +1. Create feature branches for the blog posts on GitLab.org and GitLab.com and link them from the code branch +1. Merge the code feature branch into master +1. Cherry-pick the code into the latest stable branch +1. Create a git tag vX.X.X for CE and another patch release for EE +1. Push the code and the tags to all the CE and EE repositories +1. Apply the patch to GitLab Cloud and the private GitLab development server +1. Merge and publish the blog posts +1. Send tweets about the release from @gitlabhq and @git_lab +1. Send out an email to the subscribers mailing list on MailChimp +1. Send out an email to [the community google mailing list](https://groups.google.com/forum/#!forum/gitlabhq) +1. Send out an email to [the GitLab newsletter list](http://gitlab.us5.list-manage.com/subscribe?u=498dccd07cf3e9482bee33ba4&id=98a9a4992c) +1. Post a signed copy of our complete announcement to [oss-security](http://www.openwall.com/lists/oss-security/) and request a CVE number +1. Add the security researcher to the [Security Researcher Acknowledgments list](http://www.gitlab.com/vulnerability-acknowledgements/) +1. Thank the security researcher in an email for their cooperation +1. Update the blogpost and the CHANGELOG when we receive the CVE number + +The timing of the code merge into master should be coordinated in advance. +After the merge we strive to publish the announcements within 60 minutes. + +## Blog post template + +XXX Security Advisory for GitLab + +A recently discovered critical vulnerability in GitLab allows [unauthenticated API access|remote code execution|unauthorized access to repositories|XXX|PICKSOMETHING]. All users should update GitLab and gitlab-shell immediately. +We [have|haven't|XXX|PICKSOMETHING|] heard of this vulnerability being actively exploited. + +### Version affected + +GitLab Community Edition XXX and lower +GitLab Enterprise Edition XXX and lower + +### Fixed versions + +GitLab Community Edition XXX and up +GitLab Enterprise Edition XXX and up + +### Impact + +On GitLab installations which use MySQL as their database backend it is possible for an attacker to assume the identity of any existing GitLab user in certain API calls. This attack can be performed by [unauthenticated|authenticated|XXX|PICKSOMETHING] users. + +### Workarounds + +If you are unable to upgrade you should apply the following patch and restart GitLab. + +XXX + +### Credit + +We want to thank XXX of XXX for the reponsible disclosure of this vulnerability. + +## Email template + +We just announced a security advisory for GitLab at XXX + +Please contact us at support@gitlab.com if you have any questions. + +## Tweet template + +We just announced a security advisory for GitLab at XXX diff --git a/doc/update/4.2-to-5.0.md b/doc/update/4.2-to-5.0.md index 90f59e1fd1a..5bf8c367734 100644 --- a/doc/update/4.2-to-5.0.md +++ b/doc/update/4.2-to-5.0.md @@ -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 diff --git a/doc/update/5.0-to-5.1.md b/doc/update/5.0-to-5.1.md index 45fc3436ebe..24d96e43bad 100644 --- a/doc/update/5.0-to-5.1.md +++ b/doc/update/5.0-to-5.1.md @@ -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` diff --git a/doc/update/5.1-to-5.2.md b/doc/update/5.1-to-5.2.md index 27f992ecfe6..e4eaee91b8e 100644 --- a/doc/update/5.1-to-5.2.md +++ b/doc/update/5.1-to-5.2.md @@ -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: @@ -48,8 +51,8 @@ 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-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. +* Make `/home/git/gitlab/config/gitlab.yml` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/5-2-stable/config/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/puma.rb` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/5-2-stable/config/puma.rb.example but with your settings. ### 6. Update Init script diff --git a/doc/update/5.1-to-5.4.md b/doc/update/5.1-to-5.4.md new file mode 100644 index 00000000000..39cacd381a3 --- /dev/null +++ b/doc/update/5.1-to-5.4.md @@ -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.9 # Addresses multiple critical security vulnerabilities +``` + +### 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://gitlab.com/gitlab-org/gitlab-ce/blob/5-4-stable/config/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/puma.rb` same as https://gitlab.com/gitlab-org/gitlab-ce/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 +``` diff --git a/doc/update/5.1-to-6.0.md b/doc/update/5.1-to-6.0.md index 6105d4b53bc..fa0f9ce54b6 100644 --- a/doc/update/5.1-to-6.0.md +++ b/doc/update/5.1-to-6.0.md @@ -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 @@ -44,7 +47,7 @@ sudo -u git -H git checkout 6-0-stable ```bash cd /home/git/gitlab-shell sudo -u git -H git fetch -sudo -u git -H git checkout v1.7.0 +sudo -u git -H git checkout v1.7.9 ``` ### 4. Install additional packages @@ -84,8 +87,8 @@ sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production Note: We switched from Puma in GitLab 5.x to unicorn in GitLab 6.0. -* Make `/home/git/gitlab/config/gitlab.yml` the same as https://github.com/gitlabhq/gitlabhq/blob/master/config/gitlab.yml.example but with your settings. -* Make `/home/git/gitlab/config/unicorn.rb` the same as https://github.com/gitlabhq/gitlabhq/blob/master/config/unicorn.rb.example but with your settings. +* Make `/home/git/gitlab/config/gitlab.yml` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/masterconfig/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/unicorn.rb` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/masterconfig/unicorn.rb.example but with your settings. ### 7. Update Init script diff --git a/doc/update/5.2-to-5.3.md b/doc/update/5.2-to-5.3.md index a8bb530902c..7f89f6bf887 100644 --- a/doc/update/5.2-to-5.3.md +++ b/doc/update/5.2-to-5.3.md @@ -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: @@ -40,8 +43,8 @@ sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production ### 4. Update config files -* Make `/home/git/gitlab/config/gitlab.yml` same as https://github.com/gitlabhq/gitlabhq/blob/5-3-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-3-stable/config/puma.rb.example but with your settings. +* Make `/home/git/gitlab/config/gitlab.yml` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/5-3-stable/config/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/puma.rb` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/5-3-stable/config/puma.rb.example but with your settings. ### 5. Update Init script diff --git a/doc/update/5.3-to-5.4.md b/doc/update/5.3-to-5.4.md index 315bf03a6de..7a24c11c223 100644 --- a/doc/update/5.3-to-5.4.md +++ b/doc/update/5.3-to-5.4.md @@ -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.9 # Addresses multiple critical security vulnerabilities ``` ### 4. Install libs, migrations, etc. @@ -48,8 +51,8 @@ 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. +* Make `/home/git/gitlab/config/gitlab.yml` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/5-4-stable/config/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/puma.rb` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/5-4-stable/config/puma.rb.example but with your settings. ### 6. Update Init script diff --git a/doc/update/5.4-to-6.0.md b/doc/update/5.4-to-6.0.md index 3072a1da716..bcba3ee4d05 100644 --- a/doc/update/5.4-to-6.0.md +++ b/doc/update/5.4-to-6.0.md @@ -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 @@ -44,7 +47,7 @@ sudo -u git -H git checkout 6-0-stable ```bash cd /home/git/gitlab-shell sudo -u git -H git fetch -sudo -u git -H git checkout v1.7.0 +sudo -u git -H git checkout v1.7.9 ``` ### 4. Install additional packages @@ -84,8 +87,8 @@ sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production Note: We switched from Puma in GitLab 5.4 to unicorn in GitLab 6.0. -* Make `/home/git/gitlab/config/gitlab.yml` the same as https://github.com/gitlabhq/gitlabhq/blob/master/config/gitlab.yml.example but with your settings. -* Make `/home/git/gitlab/config/unicorn.rb` the same as https://github.com/gitlabhq/gitlabhq/blob/master/config/unicorn.rb.example but with your settings. +* Make `/home/git/gitlab/config/gitlab.yml` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/masterconfig/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/unicorn.rb` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/masterconfig/unicorn.rb.example but with your settings. ### 7. Update Init script diff --git a/doc/update/6.0-to-6.1.md b/doc/update/6.0-to-6.1.md index c3851a10df0..53bb69ddff8 100644 --- a/doc/update/6.0-to-6.1.md +++ b/doc/update/6.0-to-6.1.md @@ -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. @@ -36,7 +39,7 @@ sudo -u git -H git checkout 6-1-stable ```bash cd /home/git/gitlab-shell sudo -u git -H git fetch -sudo -u git -H git checkout v1.7.1 +sudo -u git -H git checkout v1.7.9 ``` ### 4. Install libs, migrations, etc. @@ -60,8 +63,8 @@ sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production ### 5. Update config files -* Make `/home/git/gitlab/config/gitlab.yml` same as https://github.com/gitlabhq/gitlabhq/blob/6-1-stable/config/gitlab.yml.example but with your settings. -* Make `/home/git/gitlab/config/unicorn.rb` same as https://github.com/gitlabhq/gitlabhq/blob/6-1-stable/config/unicorn.rb.example but with your settings. +* Make `/home/git/gitlab/config/gitlab.yml` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-1-stable/config/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/unicorn.rb` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-1-stable/config/unicorn.rb.example but with your settings. ### 6. Update Init script diff --git a/doc/update/6.0-to-6.4.md b/doc/update/6.0-to-6.4.md new file mode 100644 index 00000000000..c1c5abed6d6 --- /dev/null +++ b/doc/update/6.0-to-6.4.md @@ -0,0 +1,128 @@ +# From 6.0 to 6.4 + +# 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. + +### Deprecations + +#### Global issue numbers + +As of 6.1 issue numbers are project specific. This means all issues are renumbered and get a new number in their url. If you use an old issue number url and the issue number does not exist yet you are redirected to the new one. This conversion does not trigger if the old number already exists for this project, this is unlikely but will happen with old issues and large projects. + +### 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 6-4-stable +``` + + +### 3. Install additional packages + +```bash +# Add support for lograte for better log file handling +sudo apt-get install logrotate +``` + +### 4. Update gitlab-shell + +```bash +cd /home/git/gitlab-shell +sudo -u git -H git fetch +sudo -u git -H git checkout v1.8.0 # Addresses multiple critical security vulnerabilities +``` + +### 5. 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 migrate_iids RAILS_ENV=production +sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production +sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production +sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production +``` + +### 6. Update config files + +TIP: to see what changed in gitlab.yml.example in this release use next command: + +``` +git diff 6-0-stable:config/gitlab.yml.example 6-4-stable:config/gitlab.yml.example +``` + +* Make `/home/git/gitlab/config/gitlab.yml` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-4-stable/config/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/unicorn.rb` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-4-stable/config/unicorn.rb.example but with your settings. +* Copy rack attack middleware config + +```bash +sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb +``` +* Uncomment `config.middleware.use Rack::Attack` in `/home/git/gitlab/config/application.rb` +* Set up logrotate + +```bash +sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab +``` + +### 7. Update Init script + +```bash +sudo rm /etc/init.d/gitlab +sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/6-4-stable/lib/support/init.d/gitlab +sudo chmod +x /etc/init.d/gitlab +``` + +### 8. Start application + + sudo service gitlab start + sudo service nginx restart + +### 9. Check application status + +Check if GitLab and its environment are configured correctly: + + cd /home/git/gitlab + 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 (6.0) + +### 1. Revert the code to the previous version +Follow the [`upgrade guide from 5.4 to 6.0`](5.4-to-6.0.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 +``` diff --git a/doc/update/6.1-to-6.2.md b/doc/update/6.1-to-6.2.md index 6f0514a8610..a3849faf065 100644 --- a/doc/update/6.1-to-6.2.md +++ b/doc/update/6.1-to-6.2.md @@ -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.9 # Addresses multiple critical security vulnerabilities ``` -### 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: @@ -57,8 +68,8 @@ TIP: to see what changed in gitlab.yml.example in this release use next command: git diff 6-1-stable:config/gitlab.yml.example 6-2-stable:config/gitlab.yml.example ``` -* Make `/home/git/gitlab/config/gitlab.yml` same as https://github.com/gitlabhq/gitlabhq/blob/6-2-stable/config/gitlab.yml.example but with your settings. -* Make `/home/git/gitlab/config/unicorn.rb` same as https://github.com/gitlabhq/gitlabhq/blob/6-2-stable/config/unicorn.rb.example but with your settings. +* Make `/home/git/gitlab/config/gitlab.yml` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-2-stable/config/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/unicorn.rb` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-2-stable/config/unicorn.rb.example but with your settings. * Copy rack attack middleware config ```bash @@ -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/doc/update/6.2-to-6.3.md b/doc/update/6.2-to-6.3.md new file mode 100644 index 00000000000..5b02b4cb4dd --- /dev/null +++ b/doc/update/6.2-to-6.3.md @@ -0,0 +1,108 @@ +# From 6.2 to 6.3 + +## Requires version: 6.1 or 6.2 + +### 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 6-3-stable +``` + +### 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.7.9 # Addresses multiple critical security vulnerabilities +``` + +The Gitlab-shell config changed recently, so check for config file changes and make `/home/git/gitlab-shell/config.yml` the same as https://github.com/gitlabhq/gitlab-shell/blob/master/config.yml.example + +### 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 + + +# 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 +``` + +### 5. Update config files + +TIP: to see what changed in gitlab.yml.example in this release use next command: + +``` +git diff 6-2-stable:config/gitlab.yml.example 6-3-stable:config/gitlab.yml.example +``` + +* Make `/home/git/gitlab/config/gitlab.yml` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-3-stable/config/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/unicorn.rb` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-3-stable/config/unicorn.rb.example but with your settings. + +```bash +# Copy rack attack middleware config +cd /home/git/gitlab +sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb +``` + +### 6. Update Init script + +```bash +sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab +sudo chmod +x /etc/init.d/gitlab +``` + +### 7. Start application + + sudo service gitlab start + sudo service nginx restart + +### 8. 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 (6.2) + +### 1. Revert the code to the previous version +Follow the [`upgrade guide from 6.1 to 6.2`](6.1-to-6.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 bundle exec rake gitlab:backup:restore RAILS_ENV=production +``` diff --git a/doc/update/6.3-to-6.4.md b/doc/update/6.3-to-6.4.md new file mode 100644 index 00000000000..69d184722cb --- /dev/null +++ b/doc/update/6.3-to-6.4.md @@ -0,0 +1,80 @@ +# From 6.3 to 6.4 + +### 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 +sudo -u git -H git checkout 6-4-stable +``` + +### 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 +sudo -u git -H bundle install --without development test postgres --deployment + +# PostgreSQL +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 + +### 8. 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 (6.3) + +### 1. Revert the code to the previous version +Follow the [`upgrade guide from 6.2 to 6.3`](6.2-to-6.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 +``` diff --git a/doc/update/patch_versions.md b/doc/update/patch_versions.md index 797fc81c92b..b284ff48365 100644 --- a/doc/update/patch_versions.md +++ b/doc/update/patch_versions.md @@ -1,4 +1,4 @@ -# Universal update guide for patch versions. Ex. from From 6.2.0 to 6.2.1 +# Universal update guide for patch versions. For example from 6.2.0 to 6.2.1, also see the [semantic versioning specification](http://semver.org/). ### 0. Backup @@ -14,14 +14,26 @@ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo service gitlab stop -### 2. Get latest code for your current stable branch +### 2. Get latest code for the stable branch ```bash cd /home/git/gitlab -sudo -u git -H git pull origin 6-2-stable +sudo -u git -H git pull origin STABLE_BRANCH ``` -### 3. Install libs, migrations, etc. +Replace STABLE_BRANCH with the minor version you want to upgrade to, for example `6-3-stable`. + +### 3. Update gitlab-shell if it is not the latest version + +```bash +cd /home/git/gitlab-shell +sudo -u git -H git fetch +sudo -u git -H git checkout LATEST_TAG +``` + +Replace LATEST_TAG with the latest GitLab Shell tag you want to upgrade to, for example `v1.7.9`. + +### 4. Install libs, migrations, etc. ```bash cd /home/git/gitlab @@ -38,12 +50,12 @@ sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production ``` -### 4. Start application +### 5. Start application sudo service gitlab start sudo service nginx restart -### 5. Check application status +### 6. Check application status Check if GitLab and its environment are configured correctly: diff --git a/doc/update/ruby.md b/doc/update/ruby.md new file mode 100644 index 00000000000..3fc068c0ae2 --- /dev/null +++ b/doc/update/ruby.md @@ -0,0 +1,54 @@ +# Updating Ruby from source + +This guide explains how to update Ruby in case you installed it from source according to the instructions in https://gitlab.com/gitlab-org/gitlab-ce/blob/masterdoc/install/installation.md#2-ruby . + +### 1. Look for Ruby versions +This guide will only update `/usr/local/bin/ruby`. You can see which Ruby binaries are installed on your system by running: + +```bash +ls -l $(which -a ruby) +``` + +### 2. Stop GitLab + +```bash +sudo service gitlab stop +``` + +### 3. Install or update dependencies +Here we are assuming you are using Debian/Ubuntu. + +```bash +sudo apt-get install build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl +``` + +### 4. Download, compile and install Ruby +Find the latest stable version of Ruby 1.9 or 2.0 at https://www.ruby-lang.org/en/downloads/ . We recommend at least 2.0.0-p353, which is patched against [CVE-2013-4164](https://www.ruby-lang.org/en/news/2013/11/22/heap-overflow-in-floating-point-parsing-cve-2013-4164/). + +```bash +cd /tmp +curl --progress http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz | tar xz +cd ruby-2.0.0-p353 +./configure --disable-install-rdoc +make +sudo make install # overwrite the existing Ruby in /usr/local/bin +sudo gem install bundler +``` + +### 5. Reinstall GitLab gem bundle +Just to be sure we will reinstall the gems used by GitLab. Note that the `bundle install` command [depends on your choice of database](https://gitlab.com/gitlab-org/gitlab-ce/blob/masterdoc/install/installation.md#install-gems). + +```bash +cd /home/git/gitlab +sudo -u git -H rm -rf vendor/bundle # remove existing Gem bundle +sudo -u git -H bundle install --deployment --without development test postgres aws # Assuming MySQL +``` + +### 6. Start GitLab +We are now ready to restart GitLab. + +```bash +sudo service gitlab start +``` + +### Done diff --git a/doc/update/upgrader.md b/doc/update/upgrader.md new file mode 100644 index 00000000000..1f51005a8e9 --- /dev/null +++ b/doc/update/upgrader.md @@ -0,0 +1,30 @@ +# GitLab Upgrader + +GitLab Upgrader - ruby script that allows you easily upgrade GitLab to latest minor version. +Ex. it can update your application from 6.4 to latest GitLab 6 version (like 6.5.1). +You still need to create backup and manually restart GitLab but all other operations can be done by upgrade tool. + +__GitLab Upgrader is available only for version 6.4.2 or higher__ + +### 0. Backup + + 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. Run gitlab upgrade tool + + cd /home/git/gitlab + sudo -u git -H ruby script/upgrade.rb + + # it also supports -y option to avouid user input + # sudo -u git -H ruby script/upgrade.rb -y + + +### 3. Start application + + sudo service gitlab start + sudo service nginx restart |