Commit 9e924c70 authored by Sytse Sijbrandij's avatar Sytse Sijbrandij

Merge pull request #7067 from cirosantilli/doc-md-style

Update docs to match new markdown style guide 2
parents de1a7aa7 fd348de7
...@@ -24,16 +24,11 @@ Issues and merge requests should be in English and contain appropriate language ...@@ -24,16 +24,11 @@ Issues and merge requests should be in English and contain appropriate language
To get support for your particular problem please use the channels as detailed in the [getting help section of the readme](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/README.md#getting-help). Professional [support subscriptions](http://www.gitlab.com/subscription/) and [consulting services](http://www.gitlab.com/consultancy/) are available from [GitLab.com](http://www.gitlab.com/). To get support for your particular problem please use the channels as detailed in the [getting help section of the readme](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/README.md#getting-help). Professional [support subscriptions](http://www.gitlab.com/subscription/) and [consulting services](http://www.gitlab.com/consultancy/) are available from [GitLab.com](http://www.gitlab.com/).
The [issue tracker](https://gitlab.com/gitlab-org/gitlab-ce/issues) is only for obvious errors in the latest [stable or development release of GitLab](MAINTENANCE.md). The [issue tracker](https://gitlab.com/gitlab-org/gitlab-ce/issues) is only for obvious errors in the latest [stable or development release of GitLab](MAINTENANCE.md). If something is wrong but it is not a regression compared to older versions of GitLab please do not open an issue but a feature request. When submitting an issue please conform to the issue submission guidelines listed below. Not all issues will be addressed and your issue is more likely to be addressed if you submit a merge request which partially or fully addresses the issue.
If something is wrong but it is not a regression compared to older versions of GitLab please do not open an issue but a feature request.
When submitting an issue please conform to the issue submission guidelines listed below.
Not all issues will be addressed and your issue is more likely to be addressed if you submit a merge request which partially or fully addresses the issue.
Issues can be filed either at [gitlab.com](https://gitlab.com/gitlab-org/gitlab-ce/issues) or [github.com](https://github.com/gitlabhq/gitlabhq/issues). Issues can be filed either at [gitlab.com](https://gitlab.com/gitlab-org/gitlab-ce/issues) or [github.com](https://github.com/gitlabhq/gitlabhq/issues).
Do not use the issue tracker for feature requests. Do not use the issue tracker for feature requests. We have a specific [feature request forum](http://feedback.gitlab.com) for this purpose. Please keep feature requests as small and simple as possible, complex ones might be edited to make them small and simple.
We have a specific [feature request forum](http://feedback.gitlab.com) for this purpose.
Please keep feature requests as small and simple as possible, complex ones might be edited to make them small and simple.
Please send a merge request with a tested solution or a merge request with a failing test instead of opening an issue if you can. If you're unsure where to post, post to the [mailing list](https://groups.google.com/forum/#!forum/gitlabhq) or [Stack Overflow](http://stackoverflow.com/questions/tagged/gitlab) first. There are a lot of helpful GitLab users there who may be able to help you quickly. If your particular issue turns out to be a bug, it will find its way from there. Please send a merge request with a tested solution or a merge request with a failing test instead of opening an issue if you can. If you're unsure where to post, post to the [mailing list](https://groups.google.com/forum/#!forum/gitlabhq) or [Stack Overflow](http://stackoverflow.com/questions/tagged/gitlab) first. There are a lot of helpful GitLab users there who may be able to help you quickly. If your particular issue turns out to be a bug, it will find its way from there.
...@@ -42,16 +37,16 @@ Please send a merge request with a tested solution or a merge request with a fai ...@@ -42,16 +37,16 @@ Please send a merge request with a tested solution or a merge request with a fai
**[Search the issues](https://gitlab.com/gitlab-org/gitlab-ce/issues)** for similar entries before submitting your own, there's a good chance somebody else had the same issue. Show your support with `:+1:` and/or join the discussion. Please submit issues in the following format (as the first post): **[Search the issues](https://gitlab.com/gitlab-org/gitlab-ce/issues)** for similar entries before submitting your own, there's a good chance somebody else had the same issue. Show your support with `:+1:` and/or join the discussion. Please submit issues in the following format (as the first post):
1. **Summary:** Summarize your issue in one sentence (what goes wrong, what did you expect to happen) 1. **Summary:** Summarize your issue in one sentence (what goes wrong, what did you expect to happen)
2. **Steps to reproduce:** How can we reproduce the issue, preferably on the [GitLab development virtual machine with vagrant](https://gitlab.com/gitlab-org/cookbook-gitlab/blob/master/doc/development.md) (start your issue with: `vagrant destroy && vagrant up && vagrant ssh`) 1. **Steps to reproduce:** How can we reproduce the issue, preferably on the [GitLab development virtual machine with vagrant](https://gitlab.com/gitlab-org/cookbook-gitlab/blob/master/doc/development.md) (start your issue with: `vagrant destroy && vagrant up && vagrant ssh`)
3. **Expected behavior:** Describe your issue in detail 1. **Expected behavior:** Describe your issue in detail
4. **Observed behavior** 1. **Observed behavior**
5. **Relevant logs and/or screenshots:** Please use code blocks (\`\`\`) to format console output, logs, and code as it's very hard to read otherwise. 1. **Relevant logs and/or screenshots:** Please use code blocks (\`\`\`) to format console output, logs, and code as it's very hard to read otherwise.
6. **Output of checks** 1. **Output of checks**
* Results of GitLab [Application Check](doc/install/installation.md#check-application-status) (`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production`); we will only investigate if the tests are passing * Results of GitLab [Application Check](doc/install/installation.md#check-application-status) (`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production`); we will only investigate if the tests are passing
* Version of GitLab you are running; we will only investigate issues in the latest stable and development releases as per the [maintenance policy](MAINTENANCE.md) * Version of GitLab you are running; we will only investigate issues in the latest stable and development releases as per the [maintenance policy](MAINTENANCE.md)
* Add the last commit sha1 of the GitLab version you used to replicate the issue (obtainable from the help page) * Add the last commit sha1 of the GitLab version you used to replicate the issue (obtainable from the help page)
* Describe your setup (use relevant parts from `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`) * Describe your setup (use relevant parts from `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
7. **Possible fixes**: If you can, link to the line of code that might be responsible for the problem 1. **Possible fixes**: If you can, link to the line of code that might be responsible for the problem
## Merge requests ## Merge requests
...@@ -87,10 +82,10 @@ For examples of feedback on merge requests please look at already [closed merge ...@@ -87,10 +82,10 @@ For examples of feedback on merge requests please look at already [closed merge
**Please format your merge request description as follows:** **Please format your merge request description as follows:**
1. What does this MR do? 1. What does this MR do?
2. Are there points in the code the reviewer needs to double check? 1. Are there points in the code the reviewer needs to double check?
3. Why was this MR needed? 1. Why was this MR needed?
4. What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/)? 1. What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/)?
5. Screenshots (If appropiate) 1. Screenshots (If appropiate)
## Contribution acceptance criteria ## Contribution acceptance criteria
...@@ -106,6 +101,7 @@ For examples of feedback on merge requests please look at already [closed merge ...@@ -106,6 +101,7 @@ For examples of feedback on merge requests please look at already [closed merge
1. It conforms to the following style guides 1. It conforms to the following style guides
## Style guides ## Style guides
1. [Ruby](https://github.com/bbatsov/ruby-style-guide) 1. [Ruby](https://github.com/bbatsov/ruby-style-guide)
1. [Rails](https://github.com/bbatsov/rails-style-guide) 1. [Rails](https://github.com/bbatsov/rails-style-guide)
1. [Formatting](https://github.com/thoughtbot/guides/tree/master/style#formatting) 1. [Formatting](https://github.com/thoughtbot/guides/tree/master/style#formatting)
......
# GitLab Maintenance Policy # GitLab Maintenance Policy
GitLab is a fast moving and evolving project. We currently don't have the GitLab is a fast moving and evolving project. We currently don't have the resources to support many releases concurrently. We support exactly one stable release at any given time.
resources to support many releases concurrently. We support exactly one stable
release at any given time.
GitLab follows the [Semantic Versioning](http://semver.org/) for its releases: GitLab follows the [Semantic Versioning](http://semver.org/) for its releases: `(Major).(Minor).(Patch)`.
`(Major).(Minor).(Patch)`.
* **Major version**: Whenever there is something significant or any backwards - **Major version**: Whenever there is something significant or any backwards incompatible changes are introduced to the public API.
incompatible changes are introduced to the public API. - **Minor version**: When new, backwards compatible functionality is introduced to the public API or a minor feature is introduced, or when a set of smaller features is rolled out.
* **Minor version**: When new, backwards compatible functionality is introduced - **Patch number**: When backwards compatible bug fixes are introduced that fix incorrect behavior.
to the public API or a minor feature is introduced, or when a set of smaller
features is rolled out.
* **Patch number**: When backwards compatible bug fixes are introduced that fix
incorrect behavior.
The current stable release will receive security patches and bug fixes The current stable release will receive security patches and bug fixes (eg. `5.0` -> `5.0.1`). Feature releases will mark the next supported stable release where the minor version is increased numerically by increments of one (eg. `5.0 -> 5.1`).
(eg. `5.0` -> `5.0.1`). Feature releases will mark the next supported stable
release where the minor version is increased numerically by increments of one
(eg. `5.0 -> 5.1`).
We encourage everyone to run the latest stable release to ensure that you can easily upgrade to the most secure and feature rich GitLab experience. In order to make sure you can easily run the most recent stable release, we are working hard to keep the update process simple and reliable. We encourage everyone to run the latest stable release to ensure that you can easily upgrade to the most secure and feature rich GitLab experience. In order to make sure you can easily run the most recent stable release, we are working hard to keep the update process simple and reliable.
......
...@@ -24,9 +24,9 @@ Below we describe the contributing process to GitLab for two reasons. So that co ...@@ -24,9 +24,9 @@ Below we describe the contributing process to GitLab for two reasons. So that co
## Priorities of the issue team ## Priorities of the issue team
1. Mentioning people (critical) 1. Mentioning people (critical)
2. Workflow labels (normal) 1. Workflow labels (normal)
3. Functional labels (minor) 1. Functional labels (minor)
4. Assigning issues (avoid if possible) 1. Assigning issues (avoid if possible)
## Mentioning people ## Mentioning people
...@@ -36,11 +36,11 @@ The most important thing is making sure valid issues receive feedback from the d ...@@ -36,11 +36,11 @@ The most important thing is making sure valid issues receive feedback from the d
Workflow labels are purposely not very detailed since that would be hard to keep updated as you would need to reevaluate them after every comment. We optionally use functional labels on demand when want to group related issues to get an overview (for example all issues related to RVM, to tackle them in one go) and to add details to the issue. Workflow labels are purposely not very detailed since that would be hard to keep updated as you would need to reevaluate them after every comment. We optionally use functional labels on demand when want to group related issues to get an overview (for example all issues related to RVM, to tackle them in one go) and to add details to the issue.
- _Awaiting feedback_: Feedback pending from the reporter - *Awaiting feedback*: Feedback pending from the reporter
- _Awaiting confirmation of fix_: The issue should already be solved in **master** (generally you can avoid this workflow item and just close the issue right away) - *Awaiting confirmation of fix*: The issue should already be solved in **master** (generally you can avoid this workflow item and just close the issue right away)
- _Attached MR_: There is a MR attached and the discussion should happen there - *Attached MR*: There is a MR attached and the discussion should happen there
- We need to let issues stay in sync with the MR's. We can do this with a "Closing #XXXX" or "Fixes #XXXX" comment in the MR. We can't close the issue when there is a merge request because sometimes a MR is not good and we just close the MR, then the issue must stay. - We need to let issues stay in sync with the MR's. We can do this with a "Closing #XXXX" or "Fixes #XXXX" comment in the MR. We can't close the issue when there is a merge request because sometimes a MR is not good and we just close the MR, then the issue must stay.
- _Awaiting developer action/feedback_: Issue needs to be fixed or clarified by a developer - *Awaiting developer action/feedback*: Issue needs to be fixed or clarified by a developer
## Functional labels ## Functional labels
...@@ -51,6 +51,7 @@ These labels describe what development specialities are involved such as: Postgr ...@@ -51,6 +51,7 @@ These labels describe what development specialities are involved such as: Postgr
If an issue is complex and needs the attention of a specific person, assignment is a good option but assigning issues might discourage other people from contributing to that issue. We need all the contributions we can get so this should never be discouraged. Also, an assigned person might not have time for a few weeks, so others should feel free to takeover. If an issue is complex and needs the attention of a specific person, assignment is a good option but assigning issues might discourage other people from contributing to that issue. We need all the contributions we can get so this should never be discouraged. Also, an assigned person might not have time for a few weeks, so others should feel free to takeover.
## Label colors ## Label colors
- Light orange `#fef2c0`: workflow labels for issue team members (awaiting feedback, awaiting confirmation of fix) - Light orange `#fef2c0`: workflow labels for issue team members (awaiting feedback, awaiting confirmation of fix)
- Bright orange `#eb6420`: workflow labels for core team members (attached MR, awaiting developer action/feedback) - Bright orange `#eb6420`: workflow labels for core team members (attached MR, awaiting developer action/feedback)
- Light blue `#82C5FF`: functional labels - Light blue `#82C5FF`: functional labels
...@@ -102,8 +103,4 @@ This merge request has been closed because a request for more information has no ...@@ -102,8 +103,4 @@ This merge request has been closed because a request for more information has no
### Accepting merge requests ### Accepting merge requests
Is there a request on [the feature request forum](http://feedback.gitlab.com/forums/176466-general) that is similar to this? Is there a request on [the feature request forum](http://feedback.gitlab.com/forums/176466-general) that is similar to this? If so, can you make a comment with a link to it? Please be aware that new functionality that is not marked [accepting merge/pull requests](http://feedback.gitlab.com/forums/176466-general/status/796455) on the forum might not make it into GitLab. You might be asked to make changes and even after implementing them your feature might still be declined. If you want to reduce the chance of this happening please have a discussion in the forum first.
If so, can you make a comment with a link to it?
Please be aware that new functionality that is not marked [accepting merge/pull requests](http://feedback.gitlab.com/forums/176466-general/status/796455) on the forum might not make it into GitLab.
You might be asked to make changes and even after implementing them your feature might still be declined.
If you want to reduce the chance of this happening please have a discussion in the forum first.
## GitLab: self hosted Git management software # GitLab
## Self hosted Git management software
![logo](https://gitlab.com/gitlab-org/gitlab-ce/raw/master/public/gitlab_logo.png) ![logo](https://gitlab.com/gitlab-org/gitlab-ce/raw/master/public/gitlab_logo.png)
![animated-screenshots](https://gist.github.com/fnkr/2f9badd56bfe0ed04ee7/raw/4f48806fbae97f556c2f78d8c2d299c04500cb0d/compiled.gif) ![animated-screenshots](https://gist.github.com/fnkr/2f9badd56bfe0ed04ee7/raw/4f48806fbae97f556c2f78d8c2d299c04500cb0d/compiled.gif)
### Gitlab is open source software to collaborate on code ## Open source software to collaborate on code
* Manage git repositories with fine grained access controls that keep your code secure - Manage Git repositories with fine grained access controls that keep your code secure
* Perform code reviews and enhance collaboration with merge requests - Perform code reviews and enhance collaboration with merge requests
* Each project can also have an issue tracker and a wiki - Each project can also have an issue tracker and a wiki
* Used by more than 100,000 organizations, GitLab is the most popular solution to manage git repositories on-premises - Used by more than 100,000 organizations, GitLab is the most popular solution to manage Git repositories on-premises
* Completely free and open source (MIT Expat license) - Completely free and open source (MIT Expat license)
* Powered by Ruby on Rails - Powered by Ruby on Rails
### Canonical source ## Canonical source
* The source of GitLab Community Edition is [hosted on GitLab.com](https://gitlab.com/gitlab-org/gitlab-ce/) and there are mirrors to make [contributing](CONTRIBUTING.md) as easy as possible. - The source of GitLab Community Edition is [hosted on GitLab.com](https://gitlab.com/gitlab-org/gitlab-ce/) and there are mirrors to make [contributing](CONTRIBUTING.md) as easy as possible.
### Code status ## Code status
* [![build status](https://ci.gitlab.org/projects/1/status.png?ref=master)](https://ci.gitlab.org/projects/1?ref=master) on ci.gitlab.org (master branch) - [![build status](https://ci.gitlab.org/projects/1/status.png?ref=master)](https://ci.gitlab.org/projects/1?ref=master) on ci.gitlab.org (master branch)
* [![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.png)](https://codeclimate.com/github/gitlabhq/gitlabhq) - [![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.png)](https://codeclimate.com/github/gitlabhq/gitlabhq)
* [![Coverage Status](https://coveralls.io/repos/gitlabhq/gitlabhq/badge.png?branch=master)](https://coveralls.io/r/gitlabhq/gitlabhq) - [![Coverage Status](https://coveralls.io/repos/gitlabhq/gitlabhq/badge.png?branch=master)](https://coveralls.io/r/gitlabhq/gitlabhq)
* [![PullReview stats](https://www.pullreview.com/gitlab/gitlab-org/gitlab-ce/badges/master.svg?)](https://www.pullreview.com/gitlab.gitlab.com/gitlab-org/gitlab-ce/reviews/master) - [![PullReview stats](https://www.pullreview.com/gitlab/gitlab-org/gitlab-ce/badges/master.svg?)](https://www.pullreview.com/gitlab.gitlab.com/gitlab-org/gitlab-ce/reviews/master)
### Resources ### Resources
* [www.gitlab.com](https://www.gitlab.com/) includes information about [subscriptions](https://www.gitlab.com/subscription/), [consultancy](https://www.gitlab.com/consultancy/), the [community](https://www.gitlab.com/community/) and the [hosted GitLab.com](https://www.gitlab.com/gitlab-com/). - [www.gitlab.com](https://www.gitlab.com/) includes information about [subscriptions](https://www.gitlab.com/subscription/), [consultancy](https://www.gitlab.com/consultancy/), the [community](https://www.gitlab.com/community/) and the [hosted GitLab.com](https://www.gitlab.com/gitlab-com/).
* [GitLab Enterprise Edition](https://www.gitlab.com/gitlab-ee/) offers additional features aimed at larger organizations. - [GitLab Enterprise Edition](https://www.gitlab.com/gitlab-ee/) offers additional features aimed at larger organizations.
* [GitLab CI](https://www.gitlab.com/gitlab-ci/) is a continuous integration (CI) server that is easy to integrate with GitLab. - [GitLab CI](https://www.gitlab.com/gitlab-ci/) is a continuous integration (CI) server that is easy to integrate with GitLab.
* Unofficial third-party [iPhone app](http://gitlabcontrol.com/), [Android app](https://play.google.com/store/apps/details?id=com.bd.gitlab&hl=en), [command line client](https://github.com/drewblessing/gitlab-cli), [Ruby API wrapper](https://github.com/NARKOZ/gitlab) and [Chrome app](https://chrome.google.com/webstore/detail/chrome-gitlab-notifier/eageapgbnjicdjjihgclpclilenjbobi) for GitLab. - Unofficial third-party [iPhone app](http://gitlabcontrol.com/), [Android app](https://play.google.com/store/apps/details?id=com.bd.gitlab&hl=en), [command line client](https://github.com/drewblessing/gitlab-cli), [Ruby API wrapper](https://github.com/NARKOZ/gitlab) and [Chrome app](https://chrome.google.com/webstore/detail/chrome-gitlab-notifier/eageapgbnjicdjjihgclpclilenjbobi) for GitLab.
### Requirements ## Requirements
* Ubuntu/Debian/CentOS/RHEL** - Ubuntu/Debian/CentOS/RHEL**
* ruby 2.0+ - ruby 2.0+
* git 1.7.10+ - git 1.7.10+
* redis 2.0+ - redis 2.0+
* MySQL or PostgreSQL - MySQL or PostgreSQL
** More details are in the [requirements doc](doc/install/requirements.md) ** More details are in the [requirements doc](doc/install/requirements.md).
### Installation ## Installation
Please see [the installation page on the GitLab website](https://www.gitlab.com/installation/). Please see [the installation page on the GitLab website](https://www.gitlab.com/installation/).
...@@ -59,22 +61,21 @@ Since 2011 a minor or major version of GitLab is released on the 22nd of every m ...@@ -59,22 +61,21 @@ Since 2011 a minor or major version of GitLab is released on the 22nd of every m
For updating the the Omnibus installation please see the [update documentation](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/update.md). For manual installations there is an [upgrader script](doc/update/upgrader.md) and there are [upgrade guides](doc/update). For updating the the Omnibus installation please see the [update documentation](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/update.md). For manual installations there is an [upgrader script](doc/update/upgrader.md) and there are [upgrade guides](doc/update).
### Run in production mode ## Run in production mode
The Installation guide contains instructions on how to download an init script and run it automatically on boot. You can also start the init script manually: The Installation guide contains instructions on how to download an init script and run it automatically on boot. You can also start the init script manually:
sudo service gitlab start sudo service gitlab start
or by directly calling the script or by directly calling the script:
sudo /etc/init.d/gitlab start sudo /etc/init.d/gitlab start
Please login with root / 5iveL!fe Please login with `root` / `5iveL!fe`.
### Install a development environment ### Install a development environment
We recommend setting up your development environment with [the cookbook](https://gitlab.com/gitlab-org/cookbook-gitlab/blob/master/README.md#installation). We recommend setting up your development environment with [the cookbook](https://gitlab.com/gitlab-org/cookbook-gitlab/blob/master/README.md#installation). If you do not use the cookbook you might need to copy the example development unicorn configuration file
If you do not use the cookbook you might need to copy the example development unicorn configuration file
cp config/unicorn.rb.example.development config/unicorn.rb cp config/unicorn.rb.example.development config/unicorn.rb
...@@ -84,36 +85,35 @@ Start it with [Foreman](https://github.com/ddollar/foreman) ...@@ -84,36 +85,35 @@ Start it with [Foreman](https://github.com/ddollar/foreman)
bundle exec foreman start -p 3000 bundle exec foreman start -p 3000
or start each component separately or start each component separately:
bundle exec rails s bundle exec rails s
bin/background_jobs start bin/background_jobs start
And surf to [localhost:3000](http://localhost:3000/) and login with root / 5iveL!fe And surf to [localhost:3000](http://localhost:3000/) and login with `root` / `5iveL!fe`.
### Run the tests ## Run the tests
* Run all tests - Run all tests:
bundle exec rake test bundle exec rake test
* [RSpec](http://rspec.info/) unit and functional tests - [RSpec](http://rspec.info/) unit and functional tests.
All RSpec tests: bundle exec rake spec
Single RSpec file: bundle exec rspec spec/controllers/commit_controller_spec.rb All RSpec tests: `bundle exec rake spec`
* [Spinach](https://github.com/codegram/spinach) integration tests Single RSpec file: `bundle exec rspec spec/controllers/commit_controller_spec.rb`
All Spinach tests: bundle exec rake spinach - [Spinach](https://github.com/codegram/spinach) integration tests.
Single Spinach test: bundle exec spinach features/project/issues/milestones.feature All Spinach tests: `bundle exec rake spinach`
Single Spinach test: `bundle exec spinach features/project/issues/milestones.feature`
### Documentation ## Documentation
All documentation can be found on [doc.gitlab.com/ce/](http://doc.gitlab.com/ce/). All documentation can be found on [doc.gitlab.com/ce/](http://doc.gitlab.com/ce/).
### Getting help ## Getting help
Please see [Getting help for GitLab](https://www.gitlab.com/getting-help/) on our website for the many options to get help. Please see [Getting help for GitLab](https://www.gitlab.com/getting-help/) on our website for the many options to get help.
**User documentation** # Documentation
+ [API](api/README.md) Explore how you can access GitLab via a simple and powerful API. ## User documentation
+ [Markdown](markdown/markdown.md) Learn what you can do with GitLab's advanced formatting system.
+ [Permissions](permissions/permissions.md) Learn what each role in a project (guest/reporter/developer/master/owner) can do.
+ [Public access](public_access/public_access.md) Learn how you can allow public and internal access to a project.
+ [SSH](ssh/README.md) Setup your ssh keys and deploy keys for secure access to your projects.
+ [Web hooks](web_hooks/web_hooks.md) Let GitLab notify you when new code has been pushed to your project.
+ [Workflow](workflow/README.md) Learn how to use Git and GitLab together.
**Administrator documentation** - [API](api/README.md) Explore how you can access GitLab via a simple and powerful API.
- [Markdown](markdown/markdown.md) Learn what you can do with GitLab's advanced formatting system.
- [Permissions](permissions/permissions.md) Learn what each role in a project (guest/reporter/developer/master/owner) can do.
- [Public access](public_access/public_access.md) Learn how you can allow public and internal access to a project.
- [SSH](ssh/README.md) Setup your ssh keys and deploy keys for secure access to your projects.
- [Web hooks](web_hooks/web_hooks.md) Let GitLab notify you when new code has been pushed to your project.
- [Workflow](workflow/README.md) Learn how to use Git and GitLab together.
+ [Install](install/README.md) Requirements, directory structures and manual installation. ## Administrator documentation
+ [Integration](integration/README.md) How to integrate with systems such as JIRA, Redmine, LDAP and Twitter.
+ [Raketasks](raketasks/README.md) Explore what GitLab has in store for you to make administration easier.
+ [System hooks](system_hooks/system_hooks.md) Let GitLab notify you when certain management tasks need to be carried out.
+ [Security](security/README.md) Learn what you can do to further secure your GitLab instance.
+ [Update](update/README.md) Update guides to upgrade your installation.
**Contributor documentation** - [Install](install/README.md) Requirements, directory structures and manual installation.
- [Integration](integration/README.md) How to integrate with systems such as JIRA, Redmine, LDAP and Twitter.
- [Raketasks](raketasks/README.md) Explore what GitLab has in store for you to make administration easier.
- [System hooks](system_hooks/system_hooks.md) Let GitLab notify you when certain management tasks need to be carried out.
- [Security](security/README.md) Learn what you can do to further secure your GitLab instance.
- [Update](update/README.md) Update guides to upgrade your installation.
+ [Development](development/README.md) Explains the architecture and the guidelines for shell commands. ## Contributor documentation
+ [Legal](legal/README.md) Contributor license agreements.
+ [Release](release/README.md) How to make the monthly and security releases. - [Development](development/README.md) Explains the architecture and the guidelines for shell commands.
- [Legal](legal/README.md) Contributor license agreements.
- [Release](release/README.md) How to make the monthly and security releases.
...@@ -2,31 +2,31 @@ ...@@ -2,31 +2,31 @@
## Resources ## Resources
+ [Users](users.md) - [Users](users.md)
+ [Session](session.md) - [Session](session.md)
+ [Projects](projects.md) - [Projects](projects.md)
+ [Project Snippets](project_snippets.md) - [Project Snippets](project_snippets.md)
+ [Repositories](repositories.md) - [Repositories](repositories.md)
+ [Repository Files](repository_files.md) - [Repository Files](repository_files.md)
+ [Commits](commits.md) - [Commits](commits.md)
+ [Branches](branches.md) - [Branches](branches.md)
+ [Merge Requests](merge_requests.md) - [Merge Requests](merge_requests.md)
+ [Issues](issues.md) - [Issues](issues.md)
+ [Milestones](milestones.md) - [Milestones](milestones.md)
+ [Notes](notes.md) (comments) - [Notes](notes.md) (comments)
+ [Deploy Keys](deploy_keys.md) - [Deploy Keys](deploy_keys.md)
+ [System Hooks](system_hooks.md) - [System Hooks](system_hooks.md)
+ [Groups](groups.md) - [Groups](groups.md)
## Clients ## Clients
+ [php-gitlab-api](https://github.com/m4tthumphrey/php-gitlab-api) - PHP - [php-gitlab-api](https://github.com/m4tthumphrey/php-gitlab-api) - PHP
+ [Laravel API Wrapper for GitLab CE](https://github.com/adamgoose/gitlab) - PHP / [Laravel](http://laravel.com) - [Laravel API Wrapper for GitLab CE](https://github.com/adamgoose/gitlab) - PHP / [Laravel](http://laravel.com)
+ [Ruby Wrapper](https://github.com/NARKOZ/gitlab) - Ruby - [Ruby Wrapper](https://github.com/NARKOZ/gitlab) - Ruby
+ [python-gitlab](https://github.com/Itxaka/python-gitlab) - Python - [python-gitlab](https://github.com/Itxaka/python-gitlab) - Python
+ [java-gitlab-api](https://github.com/timols/java-gitlab-api) - Java - [java-gitlab-api](https://github.com/timols/java-gitlab-api) - Java
+ [node-gitlab](https://github.com/moul/node-gitlab) - Node.js - [node-gitlab](https://github.com/moul/node-gitlab) - Node.js
+ [NGitLab](https://github.com/Scooletz/NGitLab) - .NET - [NGitLab](https://github.com/Scooletz/NGitLab) - .NET
## Introduction ## Introduction
...@@ -54,41 +54,35 @@ Example for a valid API request using curl and authentication via header: ...@@ -54,41 +54,35 @@ Example for a valid API request using curl and authentication via header:
curl --header "PRIVATE-TOKEN: QVy1PB7sTxfy4pqfZM1U" "http://example.com/api/v3/projects" curl --header "PRIVATE-TOKEN: QVy1PB7sTxfy4pqfZM1U" "http://example.com/api/v3/projects"
``` ```
The API uses JSON to serialize data. You don't need to specify `.json` at the end of API URL. The API uses JSON to serialize data. You don't need to specify `.json` at the end of API URL.
## Status codes ## Status codes
The API is designed to return different status codes according to context and action. In this way The API is designed to return different status codes according to context and action. In this way if a request results in an error the caller is able to get insight into what went wrong, e.g. status code `400 Bad Request` is returned if a required attribute is missing from the request. The following list gives an overview of how the API functions generally behave.
if a request results in an error the caller is able to get insight into what went wrong, e.g.
status code `400 Bad Request` is returned if a required attribute is missing from the request.
The following list gives an overview of how the API functions generally behave.
API request types: API request types:
* `GET` requests access one or more resources and return the result as JSON - `GET` requests access one or more resources and return the result as JSON
* `POST` requests return `201 Created` if the resource is successfully created and return the newly created resource as JSON - `POST` requests return `201 Created` if the resource is successfully created and return the newly created resource as JSON
* `GET`, `PUT` and `DELETE` return `200 Ok` if the resource is accessed, modified or deleted successfully, the (modified) result is returned as JSON - `GET`, `PUT` and `DELETE` return `200 Ok` if the resource is accessed, modified or deleted successfully, the (modified) result is returned as JSON
* `DELETE` requests are designed to be idempotent, meaning a request a resource still returns `200 Ok` even it was deleted before or is not available. The reasoning behind it is the user is not really interested if the resource existed before or not. - `DELETE` requests are designed to be idempotent, meaning a request a resource still returns `200 Ok` even it was deleted before or is not available. The reasoning behind it is the user is not really interested if the resource existed before or not.
The following list shows the possible return codes for API requests. The following list shows the possible return codes for API requests.
Return values: Return values:
* `200 Ok` - The `GET`, `PUT` or `DELETE` request was successful, the resource(s) itself is returned as JSON - `200 Ok` - The `GET`, `PUT` or `DELETE` request was successful, the resource(s) itself is returned as JSON
* `201 Created` - The `POST` request was successful and the resource is returned as JSON - `201 Created` - The `POST` request was successful and the resource is returned as JSON
* `400 Bad Request` - A required attribute of the API request is missing, e.g. the title of an issue is not given - `400 Bad Request` - A required attribute of the API request is missing, e.g. the title of an issue is not given
* `401 Unauthorized` - The user is not authenticated, a valid user token is necessary, see above - `401 Unauthorized` - The user is not authenticated, a valid user token is necessary, see above
* `403 Forbidden` - The request is not allowed, e.g. the user is not allowed to delete a project - `403 Forbidden` - The request is not allowed, e.g. the user is not allowed to delete a project
* `404 Not Found` - A resource could not be accessed, e.g. an ID for a resource could not be found - `404 Not Found` - A resource could not be accessed, e.g. an ID for a resource could not be found
* `405 Method Not Allowed` - The request is not supported - `405 Method Not Allowed` - The request is not supported
* `409 Conflict` - A conflicting resource already exists, e.g. creating a project with a name that already exists - `409 Conflict` - A conflicting resource already exists, e.g. creating a project with a name that already exists
* `500 Server Error` - While handling the request something went wrong on the server side - `500 Server Error` - While handling the request something went wrong on the server side
## Sudo ## Sudo
All API requests support performing an api call as if you were another user, if your private token is for an administration account. You need to pass `sudo` parameter by url or header with an id or username of the user you want to perform the operation as. If passed as header, the header name must be "SUDO" (capitals). All API requests support performing an api call as if you were another user, if your private token is for an administration account. You need to pass `sudo` parameter by url or header with an id or username of the user you want to perform the operation as. If passed as header, the header name must be "SUDO" (capitals).
If a non administrative `private_token` is provided then an error message will be returned with status code 403: If a non administrative `private_token` is provided then an error message will be returned with status code 403:
...@@ -112,16 +106,17 @@ Example of a valid API with sudo request: ...@@ -112,16 +106,17 @@ Example of a valid API with sudo request:
``` ```
GET http://example.com/api/v3/projects?private_token=QVy1PB7sTxfy4pqfZM1U&sudo=username GET http://example.com/api/v3/projects?private_token=QVy1PB7sTxfy4pqfZM1U&sudo=username
``` ```
``` ```
GET http://example.com/api/v3/projects?private_token=QVy1PB7sTxfy4pqfZM1U&sudo=23 GET http://example.com/api/v3/projects?private_token=QVy1PB7sTxfy4pqfZM1U&sudo=23
``` ```
Example for a valid API request with sudo using curl and authentication via header: Example for a valid API request with sudo using curl and authentication via header:
``` ```
curl --header "PRIVATE-TOKEN: QVy1PB7sTxfy4pqfZM1U" --header "SUDO: username" "http://example.com/api/v3/projects" curl --header "PRIVATE-TOKEN: QVy1PB7sTxfy4pqfZM1U" --header "SUDO: username" "http://example.com/api/v3/projects"
``` ```
``` ```
curl --header "PRIVATE-TOKEN: QVy1PB7sTxfy4pqfZM1U" --header "SUDO: 23" "http://example.com/api/v3/projects" curl --header "PRIVATE-TOKEN: QVy1PB7sTxfy4pqfZM1U" --header "SUDO: 23" "http://example.com/api/v3/projects"
``` ```
...@@ -130,24 +125,21 @@ curl --header "PRIVATE-TOKEN: QVy1PB7sTxfy4pqfZM1U" --header "SUDO: 23" "http:// ...@@ -130,24 +125,21 @@ curl --header "PRIVATE-TOKEN: QVy1PB7sTxfy4pqfZM1U" --header "SUDO: 23" "http://
When listing resources you can pass the following parameters: When listing resources you can pass the following parameters:
+ `page` (default: `1`) - page number - `page` (default: `1`) - page number
+ `per_page` (default: `20`, max: `100`) - number of items to list per page - `per_page` (default: `20`, max: `100`) - number of items to list per page
[Link headers](http://www.w3.org/wiki/LinkHeader) are send back with each response. [Link headers](http://www.w3.org/wiki/LinkHeader) are send back with each response. These have `rel` prev/next/first/last and contain the relevant URL. Please use these instead of generating your own urls.
These have `rel` prev/next/first/last and contain the relevant url.
Please use these instead of generating your own urls.
## id vs iid ## id vs iid
When you work with API you may notice two similar fields in api entites: id and iid. When you work with API you may notice two similar fields in api entites: id and iid. The main difference between them is scope. Example:
The main difference between them is scope. Example:
Issue:
Issue
id: 46 id: 46
iid: 5 iid: 5
* id - is uniq across all Issues table. It used for any api calls. - id - is uniq across all Issues table. It used for any api calls.
* iid - is uniq only in scope of single project. When you browse issues or merge requests with Web UI - you see iid. - iid - is uniq only in scope of single project. When you browse issues or merge requests with Web UI - you see iid.
So if you want to get issue with api you use `http://host/api/v3/.../issues/:id.json` So if you want to get issue with api you use `http://host/api/v3/.../issues/:id.json`. But when you want to create a link to web page - use `http:://host/project/issues/:iid.json`
But when you want to create a link to web page - use `http:://host/project/issues/:iid.json`
...@@ -10,7 +10,7 @@ GET /projects/:id/repository/branches ...@@ -10,7 +10,7 @@ GET /projects/:id/repository/branches
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
```json ```json
[ [
...@@ -52,8 +52,8 @@ GET /projects/:id/repository/branches/:branch ...@@ -52,8 +52,8 @@ GET /projects/:id/repository/branches/:branch
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `branch` (required) - The name of the branch - `branch` (required) - The name of the branch
```json ```json
{ {
...@@ -82,7 +82,6 @@ Parameters: ...@@ -82,7 +82,6 @@ Parameters:
} }
``` ```
## Protect repository branch ## Protect repository branch
Protects a single project repository branch. This is an idempotent function, protecting an already Protects a single project repository branch. This is an idempotent function, protecting an already
...@@ -94,8 +93,8 @@ PUT /projects/:id/repository/branches/:branch/protect ...@@ -94,8 +93,8 @@ PUT /projects/:id/repository/branches/:branch/protect
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `branch` (required) - The name of the branch - `branch` (required) - The name of the branch
```json ```json
{ {
...@@ -124,7 +123,6 @@ Parameters: ...@@ -124,7 +123,6 @@ Parameters:
} }
``` ```
## Unprotect repository branch ## Unprotect repository branch
Unprotects a single project repository branch. This is an idempotent function, unprotecting an already Unprotects a single project repository branch. This is an idempotent function, unprotecting an already
...@@ -136,8 +134,8 @@ PUT /projects/:id/repository/branches/:branch/unprotect ...@@ -136,8 +134,8 @@ PUT /projects/:id/repository/branches/:branch/unprotect
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `branch` (required) - The name of the branch - `branch` (required) - The name of the branch
```json ```json
{ {
...@@ -168,16 +166,15 @@ Parameters: ...@@ -168,16 +166,15 @@ Parameters:
## Create repository branch ## Create repository branch
``` ```
POST /projects/:id/repository/branches POST /projects/:id/repository/branches
``` ```
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `branch_name` (required) - The name of the branch - `branch_name` (required) - The name of the branch
+ `ref` (required) - Create branch from commit sha or existing branch - `ref` (required) - Create branch from commit sha or existing branch
```json ```json
{ {
......
...@@ -10,8 +10,8 @@ GET /projects/:id/repository/commits ...@@ -10,8 +10,8 @@ GET /projects/:id/repository/commits
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `ref_name` (optional) - The name of a repository branch or tag or if not given the default branch - `ref_name` (optional) - The name of a repository branch or tag or if not given the default branch
```json ```json
[ [
...@@ -44,8 +44,8 @@ GET /projects/:id/repository/commits/:sha ...@@ -44,8 +44,8 @@ GET /projects/:id/repository/commits/:sha
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `sha` (required) - The commit hash or name of a repository branch or tag - `sha` (required) - The commit hash or name of a repository branch or tag
```json ```json
{ {
...@@ -63,7 +63,6 @@ Parameters: ...@@ -63,7 +63,6 @@ Parameters:
} }
``` ```
## Get the diff of a commit ## Get the diff of a commit
Get the diff of a commit in a project. Get the diff of a commit in a project.
...@@ -74,8 +73,8 @@ GET /projects/:id/repository/commits/:sha/diff ...@@ -74,8 +73,8 @@ GET /projects/:id/repository/commits/:sha/diff
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `sha` (required) - The name of a repository branch or tag or if not given the default branch - `sha` (required) - The name of a repository branch or tag or if not given the default branch
```json ```json
[ [
...@@ -91,5 +90,3 @@ Parameters: ...@@ -91,5 +90,3 @@ Parameters:
} }
] ]
``` ```
# Deploy Keys # Deploy Keys
### List deploy keys ## List deploy keys
Get a list of a project's deploy keys. Get a list of a project's deploy keys.
...@@ -10,7 +10,7 @@ GET /projects/:id/keys ...@@ -10,7 +10,7 @@ GET /projects/:id/keys
Parameters: Parameters:
+ `id` (required) - The ID of the project - `id` (required) - The ID of the project
```json ```json
[ [
...@@ -29,8 +29,7 @@ Parameters: ...@@ -29,8 +29,7 @@ Parameters:
] ]
``` ```
## Single deploy key
### Single deploy key
Get a single key. Get a single key.
...@@ -40,8 +39,8 @@ GET /projects/:id/keys/:key_id ...@@ -40,8 +39,8 @@ GET /projects/:id/keys/:key_id
Parameters: Parameters:
+ `id` (required) - The ID of the project - `id` (required) - The ID of the project
+ `key_id` (required) - The ID of the deploy key - `key_id` (required) - The ID of the deploy key
```json ```json
{ {
...@@ -52,8 +51,7 @@ Parameters: ...@@ -52,8 +51,7 @@ Parameters:
} }
``` ```
## Add deploy key
### Add deploy key
Creates a new deploy key for a project. Creates a new deploy key for a project.
If deploy key already exists in another project - it will be joined to project but only if original one was is accessible by same user If deploy key already exists in another project - it will be joined to project but only if original one was is accessible by same user
...@@ -64,12 +62,11 @@ POST /projects/:id/keys ...@@ -64,12 +62,11 @@ POST /projects/:id/keys
Parameters: Parameters:
+ `id` (required) - The ID of the project - `id` (required) - The ID of the project
+ `title` (required) - New deploy key's title - `title` (required) - New deploy key's title
+ `key` (required) - New deploy key - `key` (required) - New deploy key
## Delete deploy key
### Delete deploy key
Delete a deploy key from a project Delete a deploy key from a project
...@@ -79,6 +76,5 @@ DELETE /projects/:id/keys/:key_id ...@@ -79,6 +76,5 @@ DELETE /projects/:id/keys/:key_id
Parameters: Parameters:
+ `id` (required) - The ID of the project - `id` (required) - The ID of the project
+ `key_id` (required) - The ID of the deploy key - `key_id` (required) - The ID of the deploy key
...@@ -73,7 +73,6 @@ GET /issues ...@@ -73,7 +73,6 @@ GET /issues
] ]
``` ```
## List project issues ## List project issues
Get a list of project issues. This function accepts pagination parameters `page` and `per_page` Get a list of project issues. This function accepts pagination parameters `page` and `per_page`
...@@ -85,8 +84,7 @@ GET /projects/:id/issues ...@@ -85,8 +84,7 @@ GET /projects/:id/issues
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
## Single issue ## Single issue
...@@ -98,8 +96,8 @@ GET /projects/:id/issues/:issue_id ...@@ -98,8 +96,8 @@ GET /projects/:id/issues/:issue_id
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `issue_id` (required) - The ID of a project issue - `issue_id` (required) - The ID of a project issue
```json ```json
{ {
...@@ -142,7 +140,6 @@ Parameters: ...@@ -142,7 +140,6 @@ Parameters:
} }
``` ```
## New issue ## New issue
Creates a new project issue. Creates a new project issue.
...@@ -153,13 +150,12 @@ POST /projects/:id/issues ...@@ -153,13 +150,12 @@ POST /projects/:id/issues
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `title` (required) - The title of an issue - `title` (required) - The title of an issue
+ `description` (optional) - The description of an issue - `description` (optional) - The description of an issue
+ `assignee_id` (optional) - The ID of a user to assign issue - `assignee_id` (optional) - The ID of a user to assign issue
+ `milestone_id` (optional) - The ID of a milestone to assign issue - `milestone_id` (optional) - The ID of a milestone to assign issue
+ `labels` (optional) - Comma-separated label names for an issue - `labels` (optional) - Comma-separated label names for an issue
## Edit issue ## Edit issue
...@@ -171,21 +167,18 @@ PUT /projects/:id/issues/:issue_id ...@@ -171,21 +167,18 @@ PUT /projects/:id/issues/:issue_id
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `issue_id` (required) - The ID of a project's issue - `issue_id` (required) - The ID of a project's issue
+ `title` (optional) - The title of an issue - `title` (optional) - The title of an issue
+ `description` (optional) - The description of an issue - `description` (optional) - The description of an issue
+ `assignee_id` (optional) - The ID of a user to assign issue - `assignee_id` (optional) - The ID of a user to assign issue
+ `milestone_id` (optional) - The ID of a milestone to assign issue - `milestone_id` (optional) - The ID of a milestone to assign issue
+ `labels` (optional) - Comma-separated label names for an issue - `labels` (optional) - Comma-separated label names for an issue
+ `state_event` (optional) - The state event of an issue ('close' to close issue and 'reopen' to reopen it) - `state_event` (optional) - The state event of an issue ('close' to close issue and 'reopen' to reopen it)
## Delete existing issue (**Deprecated**) ## Delete existing issue (**Deprecated**)
The function is deprecated and returns a `405 Method Not Allowed` The function is deprecated and returns a `405 Method Not Allowed` error if called. An issue gets now closed and is done by calling `PUT /projects/:id/issues/:issue_id` with parameter `closed` set to 1.
error if called. An issue gets now closed and is done by calling `PUT /projects/:id/issues/:issue_id` with
parameter `closed` set to 1.
``` ```
DELETE /projects/:id/issues/:issue_id DELETE /projects/:id/issues/:issue_id
...@@ -193,8 +186,8 @@ DELETE /projects/:id/issues/:issue_id ...@@ -193,8 +186,8 @@ DELETE /projects/:id/issues/:issue_id
Parameters: Parameters:
+ `id` (required) - The project ID - `id` (required) - The project ID
+ `issue_id` (required) - The ID of the issue - `issue_id` (required) - The ID of the issue
## Comments on issues ## Comments on issues
......
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
## List merge requests ## List merge requests
Get all merge requests for this project. Get all merge requests for this project. The `state` parameter can be used to get only merge requests with a given state (`opened`, `closed`, or `merged`) or all of them (`all`). The pagination parameters `page` and `per_page` can be used to restrict the list of merge requests.
The `state` parameter can be used to get only merge requests with a
given state (`opened`, `closed`, or `merged`) or all of them (`all`).
The pagination parameters `page` and `per_page` can be used to restrict the
list of merge requests.
``` ```
GET /projects/:id/merge_requests GET /projects/:id/merge_requests
...@@ -16,8 +12,8 @@ GET /projects/:id/merge_requests?state=all ...@@ -16,8 +12,8 @@ GET /projects/:id/merge_requests?state=all
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `state` (optional) - Return `all` requests or just those that are `merged`, `opened` or `closed` - `state` (optional) - Return `all` requests or just those that are `merged`, `opened` or `closed`
```json ```json
[ [
...@@ -51,7 +47,6 @@ Parameters: ...@@ -51,7 +47,6 @@ Parameters:
] ]
``` ```
## Get single MR ## Get single MR
Shows information about a single merge request. Shows information about a single merge request.
...@@ -62,8 +57,8 @@ GET /projects/:id/merge_request/:merge_request_id ...@@ -62,8 +57,8 @@ GET /projects/:id/merge_request/:merge_request_id
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `merge_request_id` (required) - The ID of MR - `merge_request_id` (required) - The ID of MR
```json ```json
{ {
...@@ -95,7 +90,6 @@ Parameters: ...@@ -95,7 +90,6 @@ Parameters:
} }
``` ```
## Create MR ## Create MR
Creates a new merge request. Creates a new merge request.
...@@ -106,12 +100,12 @@ POST /projects/:id/merge_requests ...@@ -106,12 +100,12 @@ POST /projects/:id/merge_requests
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `source_branch` (required) - The source branch - `source_branch` (required) - The source branch
+ `target_branch` (required) - The target branch - `target_branch` (required) - The target branch
+ `assignee_id` (optional) - Assignee user ID - `assignee_id` (optional) - Assignee user ID
+ `title` (required) - Title of MR - `title` (required) - Title of MR
+ `target_project_id` (optional) - The target project (numeric id) - `target_project_id` (optional) - The target project (numeric id)
```json ```json
{ {
...@@ -142,7 +136,6 @@ Parameters: ...@@ -142,7 +136,6 @@ Parameters:
} }
``` ```
## Update MR ## Update MR
Updates an existing merge request. You can change branches, title, or even close the MR. Updates an existing merge request. You can change branches, title, or even close the MR.
...@@ -153,13 +146,13 @@ PUT /projects/:id/merge_request/:merge_request_id ...@@ -153,13 +146,13 @@ PUT /projects/:id/merge_request/:merge_request_id
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `merge_request_id` (required) - ID of MR - `merge_request_id` (required) - ID of MR
+ `source_branch` - The source branch - `source_branch` - The source branch
+ `target_branch` - The target branch - `target_branch` - The target branch
+ `assignee_id` - Assignee user ID - `assignee_id` - Assignee user ID
+ `title` - Title of MR - `title` - Title of MR
+ `state_event` - New state (close|reopen|merge) - `state_event` - New state (close|reopen|merge)
```json ```json
{ {
...@@ -190,13 +183,16 @@ Parameters: ...@@ -190,13 +183,16 @@ Parameters:
} }
``` ```
## Accept MR ## Accept MR
Merge changes submitted with MR usign this API. Merge changes submitted with MR usign this API.
If merge success you get 200 OK. If merge success you get 200 OK.
If it has some conflicts and can not be merged - you get 405 and error message 'Branch cannot be merged' If it has some conflicts and can not be merged - you get 405 and error message 'Branch cannot be merged'
If merge request is already merged or closed - you get 405 and error message 'Method Not Allowed' If merge request is already merged or closed - you get 405 and error message 'Method Not Allowed'
If you dont have permissions to accept this merge request - you get 401 If you dont have permissions to accept this merge request - you get 401
``` ```
...@@ -205,9 +201,9 @@ PUT /projects/:id/merge_request/:merge_request_id/merge ...@@ -205,9 +201,9 @@ PUT /projects/:id/merge_request/:merge_request_id/merge
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `merge_request_id` (required) - ID of MR - `merge_request_id` (required) - ID of MR
+ `merge_commit_message` (optional) - Custom merge commit message - `merge_commit_message` (optional) - Custom merge commit message
```json ```json
{ {
...@@ -238,7 +234,6 @@ Parameters: ...@@ -238,7 +234,6 @@ Parameters:
} }
``` ```
## Post comment to MR ## Post comment to MR
Adds a comment to a merge request. Adds a comment to a merge request.
...@@ -249,10 +244,9 @@ POST /projects/:id/merge_request/:merge_request_id/comments ...@@ -249,10 +244,9 @@ POST /projects/:id/merge_request/:merge_request_id/comments
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `merge_request_id` (required) - ID of merge request - `merge_request_id` (required) - ID of merge request
+ `note` (required) - Text of comment - `note` (required) - Text of comment
```json ```json
{ {
...@@ -268,7 +262,6 @@ Parameters: ...@@ -268,7 +262,6 @@ Parameters:
} }
``` ```
## Get the comments on a MR ## Get the comments on a MR
Gets all the comments associated with a merge request. Gets all the comments associated with a merge request.
...@@ -279,8 +272,8 @@ GET /projects/:id/merge_request/:merge_request_id/comments ...@@ -279,8 +272,8 @@ GET /projects/:id/merge_request/:merge_request_id/comments
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `merge_request_id` (required) - ID of merge request - `merge_request_id` (required) - ID of merge request
```json ```json
[ [
......
...@@ -26,8 +26,7 @@ GET /projects/:id/milestones ...@@ -26,8 +26,7 @@ GET /projects/:id/milestones
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
## Get single milestone ## Get single milestone
...@@ -39,9 +38,8 @@ GET /projects/:id/milestones/:milestone_id ...@@ -39,9 +38,8 @@ GET /projects/:id/milestones/:milestone_id
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `milestone_id` (required) - The ID of a project milestone - `milestone_id` (required) - The ID of a project milestone
## Create new milestone ## Create new milestone
...@@ -53,11 +51,10 @@ POST /projects/:id/milestones ...@@ -53,11 +51,10 @@ POST /projects/:id/milestones
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `title` (required) - The title of an milestone - `title` (required) - The title of an milestone
+ `description` (optional) - The description of the milestone - `description` (optional) - The description of the milestone
+ `due_date` (optional) - The due date of the milestone - `due_date` (optional) - The due date of the milestone
## Edit milestone ## Edit milestone
...@@ -69,10 +66,9 @@ PUT /projects/:id/milestones/:milestone_id ...@@ -69,10 +66,9 @@ PUT /projects/:id/milestones/:milestone_id
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `milestone_id` (required) - The ID of a project milestone - `milestone_id` (required) - The ID of a project milestone
+ `title` (optional) - The title of a milestone - `title` (optional) - The title of a milestone
+ `description` (optional) - The description of a milestone - `description` (optional) - The description of a milestone
+ `due_date` (optional) - The due date of the milestone - `due_date` (optional) - The due date of the milestone
+ `state_event` (optional) - The state event of the milestone (close|activate) - `state_event` (optional) - The state event of the milestone (close|activate)
...@@ -10,8 +10,7 @@ GET /projects/:id/snippets ...@@ -10,8 +10,7 @@ GET /projects/:id/snippets
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
## Single snippet ## Single snippet
...@@ -23,8 +22,8 @@ GET /projects/:id/snippets/:snippet_id ...@@ -23,8 +22,8 @@ GET /projects/:id/snippets/:snippet_id
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `snippet_id` (required) - The ID of a project's snippet - `snippet_id` (required) - The ID of a project's snippet
```json ```json
{ {
...@@ -45,7 +44,6 @@ Parameters: ...@@ -45,7 +44,6 @@ Parameters:
} }
``` ```
## Create new snippet ## Create new snippet
Creates a new project snippet. The user must have permission to create new snippets. Creates a new project snippet. The user must have permission to create new snippets.
...@@ -56,11 +54,10 @@ POST /projects/:id/snippets ...@@ -56,11 +54,10 @@ POST /projects/:id/snippets
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `title` (required) - The title of a snippet - `title` (required) - The title of a snippet
+ `file_name` (required) - The name of a snippet file - `file_name` (required) - The name of a snippet file
+ `code` (required) - The content of a snippet - `code` (required) - The content of a snippet
## Update snippet ## Update snippet
...@@ -72,12 +69,11 @@ PUT /projects/:id/snippets/:snippet_id ...@@ -72,12 +69,11 @@ PUT /projects/:id/snippets/:snippet_id
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `snippet_id` (required) - The ID of a project's snippet - `snippet_id` (required) - The ID of a project's snippet
+ `title` (optional) - The title of a snippet - `title` (optional) - The title of a snippet
+ `file_name` (optional) - The name of a snippet file - `file_name` (optional) - The name of a snippet file
+ `code` (optional) - The content of a snippet - `code` (optional) - The content of a snippet
## Delete snippet ## Delete snippet
...@@ -90,9 +86,8 @@ DELETE /projects/:id/snippets/:snippet_id ...@@ -90,9 +86,8 @@ DELETE /projects/:id/snippets/:snippet_id
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `snippet_id` (required) - The ID of a project's snippet - `snippet_id` (required) - The ID of a project's snippet
## Snippet content ## Snippet content
...@@ -104,5 +99,5 @@ GET /projects/:id/snippets/:snippet_id/raw ...@@ -104,5 +99,5 @@ GET /projects/:id/snippets/:snippet_id/raw
Parameters: Parameters:
+ `id` (required) - The ID of a project - `id` (required) - The ID of a project
+ `snippet_id` (required) - The ID of a project's snippet - `snippet_id` (required) - The ID of a project's snippet
...@@ -4,12 +4,11 @@ ...@@ -4,12 +4,11 @@
## Create, read, update and delete repository files using this API ## Create, read, update and delete repository files using this API
- - - ---
## Get file from repository ## Get file from repository
Allows you to receive information about file in repository like name, size, content. Allows you to receive information about file in repository like name, size, content. Note that file content is Base64 encoded.
Note that file content is Base64 encoded.
``` ```
GET /projects/:id/repository/files GET /projects/:id/repository/files
...@@ -32,8 +31,8 @@ Example response: ...@@ -32,8 +31,8 @@ Example response:
Parameters: Parameters:
+ `file_path` (required) - Full path to new file. Ex. lib/class.rb - `file_path` (required) - Full path to new file. Ex. lib/class.rb
+ `ref` (required) - The name of branch, tag or commit - `ref` (required) - The name of branch, tag or commit
## Create new file in repository ## Create new file in repository
...@@ -52,11 +51,11 @@ Example response: ...@@ -52,11 +51,11 @@ Example response:
Parameters: Parameters:
+ `file_path` (required) - Full path to new file. Ex. lib/class.rb - `file_path` (required) - Full path to new file. Ex. lib/class.rb
+ `branch_name` (required) - The name of branch - `branch_name` (required) - The name of branch
+ `encoding` (optional) - 'text' or 'base64'. Text is default. - `encoding` (optional) - 'text' or 'base64'. Text is default.
+ `content` (required) - File content - `content` (required) - File content
+ `commit_message` (required) - Commit message - `commit_message` (required) - Commit message
## Update existing file in repository ## Update existing file in repository
...@@ -75,11 +74,11 @@ Example response: ...@@ -75,11 +74,11 @@ Example response:
Parameters: Parameters:
+ `file_path` (required) - Full path to file. Ex. lib/class.rb - `file_path` (required) - Full path to file. Ex. lib/class.rb
+ `branch_name` (required) - The name of branch - `branch_name` (required) - The name of branch
+ `encoding` (optional) - 'text' or 'base64'. Text is default. - `encoding` (optional) - 'text' or 'base64'. Text is default.
+ `content` (required) - New file content - `content` (required) - New file content
+ `commit_message` (required) - Commit message - `commit_message` (required) - Commit message
## Delete existing file in repository ## Delete existing file in repository
...@@ -98,7 +97,6 @@ Example response: ...@@ -98,7 +97,6 @@ Example response:
Parameters: Parameters:
+ `file_path` (required) - Full path to file. Ex. lib/class.rb - `file_path` (required) - Full path to file. Ex. lib/class.rb
+ `branch_name` (required) - The name of branch - `branch_name` (required) - The name of branch
+ `commit_message` (required) - Commit message - `commit_message` (required) - Commit message
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
All methods require admin authorization. All methods require admin authorization.
The url endpoint of the system hooks can be configured in [the admin area under hooks](/admin/hooks). The URL endpoint of the system hooks can be configured in [the admin area under hooks](/admin/hooks).
## List system hooks ## List system hooks
...@@ -14,7 +14,7 @@ GET /hooks ...@@ -14,7 +14,7 @@ GET /hooks
Parameters: Parameters:
+ **none** - **none**
```json ```json
[ [
...@@ -34,8 +34,7 @@ POST /hooks ...@@ -34,8 +34,7 @@ POST /hooks
Parameters: Parameters:
+ `url` (required) - The hook URL - `url` (required) - The hook URL
## Test system hook ## Test system hook
...@@ -45,7 +44,7 @@ GET /hooks/:id ...@@ -45,7 +44,7 @@ GET /hooks/:id
Parameters: Parameters:
+ `id` (required) - The ID of hook - `id` (required) - The ID of hook
```json ```json
{ {
...@@ -60,8 +59,7 @@ Parameters: ...@@ -60,8 +59,7 @@ Parameters:
## Delete system hook ## Delete system hook
Deletes a system hook. This is an idempotent API function and returns `200 Ok` even if the hook Deletes a system hook. This is an idempotent API function and returns `200 Ok` even if the hook is not available. If the hook is deleted it is also returned as JSON.
is not available. If the hook is deleted it is also returned as JSON.
``` ```
DELETE /hooks/:id DELETE /hooks/:id
...@@ -69,4 +67,4 @@ DELETE /hooks/:id ...@@ -69,4 +67,4 @@ DELETE /hooks/:id
Parameters: Parameters:
+ `id` (required) - The ID of hook - `id` (required) - The ID of hook
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
## List users ## List users
Get a list of users. Get a list of users.
This function takes pagination parameters `page` and `per_page` to restrict the list of users. This function takes pagination parameters `page` and `per_page` to restrict the list of users.
``` ```
...@@ -53,8 +54,7 @@ GET /users ...@@ -53,8 +54,7 @@ GET /users
] ]
``` ```
You can search for a users by email or username with: You can search for a users by email or username with: `/users?search=John`
`/users?search=John`
Also see `def search query` in `app/models/user.rb`. Also see `def search query` in `app/models/user.rb`.
...@@ -68,7 +68,7 @@ GET /users/:id ...@@ -68,7 +68,7 @@ GET /users/:id
Parameters: Parameters:
+ `id` (required) - The ID of a user - `id` (required) - The ID of a user
```json ```json
{ {
...@@ -93,7 +93,6 @@ Parameters: ...@@ -93,7 +93,6 @@ Parameters:
} }
``` ```
## User creation ## User creation
Creates a new user. Note only administrators can create new users. Creates a new user. Note only administrators can create new users.
...@@ -104,21 +103,20 @@ POST /users ...@@ -104,21 +103,20 @@ POST /users
Parameters: Parameters:
+ `email` (required) - Email - `email` (required) - Email
+ `password` (required) - Password - `password` (required) - Password
+ `username` (required) - Username - `username` (required) - Username
+ `name` (required) - Name - `name` (required) - Name
+ `skype` (optional) - Skype ID - `skype` (optional) - Skype ID
+ `linkedin` (optional) - Linkedin - `linkedin` (optional) - Linkedin
+ `twitter` (optional) - Twitter account - `twitter` (optional) - Twitter account
+ `website_url` (optional) - Website url - `website_url` (optional) - Website url
+ `projects_limit` (optional) - Number of projects user can create - `projects_limit` (optional) - Number of projects user can create
+ `extern_uid` (optional) - External UID - `extern_uid` (optional) - External UID
+ `provider` (optional) - External provider name - `provider` (optional) - External provider name
+ `bio` (optional) - User's bio - `bio` (optional) - User's bio
+ `admin` (optional) - User is admin - true or false (default) - `admin` (optional) - User is admin - true or false (default)
+ `can_create_group` (optional) - User can create groups - true or false - `can_create_group` (optional) - User can create groups - true or false
## User modification ## User modification
...@@ -130,30 +128,26 @@ PUT /users/:id ...@@ -130,30 +128,26 @@ PUT /users/:id
Parameters: Parameters:
+ `email` - Email - `email` - Email
+ `username` - Username - `username` - Username
+ `name` - Name - `name` - Name
+ `password` - Password - `password` - Password
+ `skype` - Skype ID - `skype` - Skype ID
+ `linkedin` - Linkedin - `linkedin` - Linkedin
+ `twitter` - Twitter account - `twitter` - Twitter account
+ `website_url` - Website url - `website_url` - Website url
+ `projects_limit` - Limit projects each user can create - `projects_limit` - Limit projects each user can create
+ `extern_uid` - External UID - `extern_uid` - External UID
+ `provider` - External provider name - `provider` - External provider name
+ `bio` - User's bio - `bio` - User's bio
+ `admin` (optional) - User is admin - true or false (default) - `admin` (optional) - User is admin - true or false (default)
+ `can_create_group` (optional) - User can create groups - true or false - `can_create_group` (optional) - User can create groups - true or false
Note, at the moment this method does only return a 404 error, even in cases where a 409 (Conflict) would Note, at the moment this method does only return a 404 error, even in cases where a 409 (Conflict) would be more appropriate, e.g. when renaming the email address to some existing one.
be more appropriate, e.g. when renaming the email address to some existing one.
## User deletion ## User deletion
Deletes a user. Available only for administrators. This is an idempotent function, calling this function Deletes a user. Available only for administrators. This is an idempotent function, calling this function for a non-existent user id still returns a status code `200 Ok`. The JSON response differs if the user was actually deleted or not. In the former the user is returned and in the latter not.
for a non-existent user id still returns a status code `200 Ok`. The JSON response differs if the user
was actually deleted or not. In the former the user is returned and in the latter not.
``` ```
DELETE /users/:id DELETE /users/:id
...@@ -161,8 +155,7 @@ DELETE /users/:id ...@@ -161,8 +155,7 @@ DELETE /users/:id
Parameters: Parameters:
+ `id` (required) - The ID of the user - `id` (required) - The ID of the user
## Current user ## Current user
...@@ -194,7 +187,6 @@ GET /user ...@@ -194,7 +187,6 @@ GET /user
} }
``` ```
## List SSH keys ## List SSH keys
Get a list of currently authenticated user's SSH keys. Get a list of currently authenticated user's SSH keys.
...@@ -220,7 +212,7 @@ GET /user/keys ...@@ -220,7 +212,7 @@ GET /user/keys
Parameters: Parameters:
+ **none** - **none**
## List SSH keys for user ## List SSH keys for user
...@@ -232,8 +224,7 @@ GET /users/:uid/keys ...@@ -232,8 +224,7 @@ GET /users/:uid/keys
Parameters: Parameters:
+ `uid` (required) - id of specified user - `uid` (required) - id of specified user
## Single SSH key ## Single SSH key
...@@ -245,7 +236,7 @@ GET /user/keys/:id ...@@ -245,7 +236,7 @@ GET /user/keys/:id
Parameters: Parameters:
+ `id` (required) - The ID of an SSH key - `id` (required) - The ID of an SSH key
```json ```json
{ {
...@@ -255,7 +246,6 @@ Parameters: ...@@ -255,7 +246,6 @@ Parameters:
} }
``` ```
## Add SSH key ## Add SSH key
Creates a new key owned by the currently authenticated user. Creates a new key owned by the currently authenticated user.
...@@ -266,9 +256,8 @@ POST /user/keys ...@@ -266,9 +256,8 @@ POST /user/keys
Parameters: Parameters:
+ `title` (required) - new SSH Key's title - `title` (required) - new SSH Key's title
+ `key` (required) - new SSH key - `key` (required) - new SSH key
## Add SSH key for user ## Add SSH key for user
...@@ -280,17 +269,15 @@ POST /users/:id/keys ...@@ -280,17 +269,15 @@ POST /users/:id/keys
Parameters: Parameters:
+ `id` (required) - id of specified user - `id` (required) - id of specified user
+ `title` (required) - new SSH Key's title - `title` (required) - new SSH Key's title
+ `key` (required) - new SSH key - `key` (required) - new SSH key
Will return created key with status `201 Created` on success, or `404 Not Will return created key with status `201 Created` on success, or `404 Not found` on fail.
found` on fail.
## Delete SSH key ## Delete SSH key for current user
Deletes key owned by currently authenticated user. This is an idempotent function and calling it on a key that is already Deletes key owned by currently authenticated user. This is an idempotent function and calling it on a key that is already deleted or not available results in `200 Ok`.
deleted or not available results in `200 Ok`.
``` ```
DELETE /user/keys/:id DELETE /user/keys/:id
...@@ -298,9 +285,9 @@ DELETE /user/keys/:id ...@@ -298,9 +285,9 @@ DELETE /user/keys/:id
Parameters: Parameters:
+ `id` (required) - SSH key ID - `id` (required) - SSH key ID
## Delete SSH key ## Delete SSH key for given user
Deletes key owned by a specified user. Available only for admin. Deletes key owned by a specified user. Available only for admin.
...@@ -310,8 +297,7 @@ DELETE /users/:uid/keys/:id ...@@ -310,8 +297,7 @@ DELETE /users/:uid/keys/:id
Parameters: Parameters:
+ `uid` (required) - id of specified user - `uid` (required) - id of specified user
+ `id` (required) - SSH key ID - `id` (required) - SSH key ID
Will return `200 Ok` on success, or `404 Not found` if either user or key cannot be found. Will return `200 Ok` on success, or `404 Not found` if either user or key cannot be found.
## Development # Development
+ [Architecture](architecture.md) of GitLab - [Architecture](architecture.md) of GitLab
+ [Shell commands](shell_commands.md) in the GitLab codebase - [Shell commands](shell_commands.md) in the GitLab codebase
+ [Rake tasks](rake_tasks.md) for development - [Rake tasks](rake_tasks.md) for development
This diff is collapsed.
...@@ -8,9 +8,7 @@ ...@@ -8,9 +8,7 @@
## Use File and FileUtils instead of shell commands ## Use File and FileUtils instead of shell commands
Sometimes we invoke basic Unix commands via the shell when there is also a Ruby API for doing it. Sometimes we invoke basic Unix commands via the shell when there is also a Ruby API for doing it. Use the Ruby API if it exists. <http://www.ruby-doc.org/stdlib-2.0.0/libdoc/fileutils/rdoc/FileUtils.html#module-FileUtils-label-Module+Functions>
Use the Ruby API if it exists.
http://www.ruby-doc.org/stdlib-2.0.0/libdoc/fileutils/rdoc/FileUtils.html#module-FileUtils-label-Module+Functions
```ruby ```ruby
# Wrong # Wrong
...@@ -30,12 +28,7 @@ This coding style could have prevented CVE-2013-4490. ...@@ -30,12 +28,7 @@ This coding style could have prevented CVE-2013-4490.
## Bypass the shell by splitting commands into separate tokens ## Bypass the shell by splitting commands into separate tokens
When we pass shell commands as a single string to Ruby, Ruby will let `/bin/sh` evaluate the entire string. When we pass shell commands as a single string to Ruby, Ruby will let `/bin/sh` evaluate the entire string. Essentially, we are asking the shell to evaluate a one-line script. This creates a risk for shell injection attacks. It is better to split the shell command into tokens ourselves. Sometimes we use the scripting capabilities of the shell to change the working directory or set environment variables. All of this can also be achieved securely straight from Ruby
Essentially, we are asking the shell to evaluate a one-line script.
This creates a risk for shell injection attacks.
It is better to split the shell command into tokens ourselves.
Sometimes we use the scripting capabilities of the shell to change the working directory or set environment variables.
All of this can also be achieved securely straight from Ruby
```ruby ```ruby
# Wrong # Wrong
...@@ -55,8 +48,7 @@ This coding style could have prevented CVE-2013-4546. ...@@ -55,8 +48,7 @@ This coding style could have prevented CVE-2013-4546.
## Separate options from arguments with -- ## Separate options from arguments with --
Make the difference between options and arguments clear to the argument parsers of system commands with `--`. Make the difference between options and arguments clear to the argument parsers of system commands with `--`. This is supported by many but not all Unix commands.
This is supported by many but not all Unix commands.
To understand what `--` does, consider the problem below. To understand what `--` does, consider the problem below.
...@@ -68,9 +60,7 @@ cat: illegal option -- l ...@@ -68,9 +60,7 @@ cat: illegal option -- l
usage: cat [-benstuv] [file ...] usage: cat [-benstuv] [file ...]
``` ```
In the example above, the argument parser of `cat` assumes that `-l` is an option. In the example above, the argument parser of `cat` assumes that `-l` is an option. The solution in the example above is to make it clear to `cat` that `-l` is really an argument, not an option. Many Unix command line tools follow the convention of separating options from arguments with `--`.
The solution in the example above is to make it clear to `cat` that `-l` is really an argument, not an option.
Many Unix command line tools follow the convention of separating options from arguments with `--`.
``` ```
# Example (continued) # Example (continued)
...@@ -91,9 +81,7 @@ This coding style could have prevented CVE-2013-4582. ...@@ -91,9 +81,7 @@ This coding style could have prevented CVE-2013-4582.
## Do not use the backticks ## Do not use the backticks
Capturing the output of shell commands with backticks reads nicely, but you are forced to pass the command as one string to the shell. Capturing the output of shell commands with backticks reads nicely, but you are forced to pass the command as one string to the shell. We explained above that this is unsafe. In the main GitLab codebase, the solution is to use `Gitlab::Popen.popen` instead.
We explained above that this is unsafe.
In the main GitLab codebase, the solution is to use `Gitlab::Popen.popen` instead.
```ruby ```ruby
# Wrong # Wrong
......
+ [Installation](installation.md) # Installation
+ [Requirements](requirements.md)
+ [Structure](structure.md) - [Installation](installation.md)
+ [Database MySQL](database_mysql.md) - [Requirements](requirements.md)
- [Structure](structure.md)
- [Database MySQL](database_mysql.md)
This diff is collapsed.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
GitLab is developed for the Linux operating system. For the installations options and instructions please see [the installation section of the readme](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/README.md#installation). GitLab is developed for the Linux operating system. For the installations options and instructions please see [the installation section of the readme](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/README.md#installation).
## Supported Linux distributions ### Supported Linux distributions
- Ubuntu - Ubuntu
- Debian - Debian
...@@ -13,37 +13,42 @@ GitLab is developed for the Linux operating system. For the installations option ...@@ -13,37 +13,42 @@ GitLab is developed for the Linux operating system. For the installations option
- Scientific Linux - Scientific Linux
- Oracle Linux - Oracle Linux
## Unsupported Linux distributions ### Unsupported Linux distributions
- Arch Linux - Arch Linux
- Fedora - Fedora
- Gentoo - Gentoo
But on the above unsupported distributions is stll possible to install GitLab yourself with the [manual installation guide](https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md). But on the above unsupported distributions is still possible to install GitLab yourself with the [manual installation guide](https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md).
## Unsupported Unix operating systems ### Unsupported Unix operating systems
There is nothing that prevents GitLab from running on other Unix operating 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. 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. 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. Please consider using a virtual machine to run GitLab.
## Other operating systems such as 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. 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.
Please consider using a virtual machine to run GitLab.
# Ruby versions ## Ruby versions
GitLab requires Ruby (MRI) 2.0+. GitLab requires Ruby (MRI) 2.0+.
>>>>>>> Update docs to markdown style guide.
You will have to use the standard MRI implementation of Ruby. You will have to use the standard MRI implementation of Ruby.
We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/)) but GitLab needs several Gems that have native extensions.
We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/)) but GitLab needs several Gems that have native extensions.
# Hardware requirements ## Hardware requirements
## CPU ### CPU
- 1 core works supports up to 100 users but the application will not be responsive - 1 core works supports up to 100 users but the application will not be responsive
- **2 cores** is the **recommended** number of cores and supports up to 500 users - **2 cores** is the **recommended** number of cores and supports up to 500 users
...@@ -53,7 +58,7 @@ We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/)) but GitLab ...@@ -53,7 +58,7 @@ We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/)) but GitLab
- 32 cores supports up to 20,000 users - 32 cores supports up to 20,000 users
- 64 cores supports up to 40,000 users - 64 cores supports up to 40,000 users
## Memory ### Memory
- 512MB is the absolute minimum, you need 256MB of swap, you can configure only one slow unicorn worker, only ssh access will work, we do not recommend this - 512MB is the absolute minimum, you need 256MB of swap, you can configure only one slow unicorn worker, only ssh access will work, we do not recommend this
- 1GB supports up to 100 users (with individual repositories under 250MB, otherwise git memory usage necessitates using swap space) - 1GB supports up to 100 users (with individual repositories under 250MB, otherwise git memory usage necessitates using swap space)
...@@ -64,11 +69,9 @@ We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/)) but GitLab ...@@ -64,11 +69,9 @@ We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/)) but GitLab
- 32GB supports up to 20,000 users - 32GB supports up to 20,000 users
- 64GB supports up to 40,000 users - 64GB supports up to 40,000 users
## Storage ### Storage
The necessary hard drive space largely depends on the size of the repos you want The necessary hard drive space largely depends on the size of the repos you want to store in GitLab. But as a *rule of thumb* you should have at least twice as much free space as your all repos combined take up. You need twice the storage because [GitLab satellites](structure.md) contain an extra copy of each repo.
to store in GitLab. But as a *rule of thumb* you should have at least twice as much
free space as your all repos combined take up. You need twice the storage because [GitLab satellites](structure.md) contain an extra copy of each repo.
If you want to be flexible about growing your hard drive space in the future consider mounting it using LVM so you can add more hard drives when you need them. If you want to be flexible about growing your hard drive space in the future consider mounting it using LVM so you can add more hard drives when you need them.
...@@ -80,7 +83,7 @@ If you have enough RAM memory and a recent CPU the speed of GitLab is mainly lim ...@@ -80,7 +83,7 @@ If you have enough RAM memory and a recent CPU the speed of GitLab is mainly lim
If you want to run the database separately, the **recommended** database size is **1 MB per user** If you want to run the database separately, the **recommended** database size is **1 MB per user**
# Supported webbrowsers ## Supported webbrowsers
- Chrome (Latest stable version) - Chrome (Latest stable version)
- Firefox (Latest released version) - Firefox (Latest released version)
......
# GitLab Integration # GitLab Integration
GitLab integrates with multiple third-party services to allow external issue trackers and external authentication. GitLab integrates with multiple third-party services to allow external issue trackers and external authentication.
See the documentation below for details on how to configure these services. See the documentation below for details on how to configure these services.
+ [External issue tracker](external-issue-tracker.md) Redmine, JIRA, etc. - [External issue tracker](external-issue-tracker.md) Redmine, JIRA, etc.
+ [LDAP](ldap.md) Set up sign in via LDAP - [LDAP](ldap.md) Set up sign in via LDAP
+ [OmniAuth](omniauth.md) Sign in via Twitter, GitHub, and Google via OAuth. - [OmniAuth](omniauth.md) Sign in via Twitter, GitHub, and Google via OAuth.
+ [Slack](slack.md) Integrate with the Slack chat service - [Slack](slack.md) Integrate with the Slack chat service
Jenkins support is [available in GitLab EE](http://doc.gitlab.com/ee/integration/jenkins.html). Jenkins support is [available in GitLab EE](http://doc.gitlab.com/ee/integration/jenkins.html).
# External issue tracker
GitLab has a great issue tracker but you can also use an external issue tracker such as JIRA or Redmine. This is something that you can turn on per GitLab project. If for example you configure JIRA it provides the following functionality: GitLab has a great issue tracker but you can also use an external issue tracker such as JIRA or Redmine. This is something that you can turn on per GitLab project. If for example you configure JIRA it provides the following functionality:
- the 'Issues' link on the GitLab project pages takes you to the appropriate JIRA issue index; - the 'Issues' link on the GitLab project pages takes you to the appropriate JIRA issue index;
......
...@@ -3,17 +3,23 @@ ...@@ -3,17 +3,23 @@
To enable the GitHub OmniAuth provider you must register your application with GitHub. GitHub will generate a client ID and secret key for you to use. To enable the GitHub OmniAuth provider you must register your application with GitHub. GitHub will generate a client ID and secret key for you to use.
1. Sign in to GitHub. 1. Sign in to GitHub.
2. Navigate to your individual user settings or an organization's settings, depending on how you want the application registered. It does not matter if the application is registered as an individual or an organization - that is entirely up to you.
3. Select "Applications" in the left menu. 1. Navigate to your individual user settings or an organization's settings, depending on how you want the application registered. It does not matter if the application is registered as an individual or an organization - that is entirely up to you.
4. Select "Register new application".
5. Provide the required details. 1. Select "Applications" in the left menu.
* Application name: This can be anything. Consider something like "\<Organization\>'s GitLab" or "\<Your Name\>'s GitLab" or something else descriptive.
* Homepage URL: The URL to your GitLab installation. 'https://gitlab.company.com' 1. Select "Register new application".
* Application description: Fill this in if you wish.
* Authorization callback URL: 'https://gitlab.company.com/users/auth/github/callback' 1. Provide the required details.
6. Select "Register application". - Application name: This can be anything. Consider something like "\<Organization\>'s GitLab" or "\<Your Name\>'s GitLab" or something else descriptive.
7. You should now see a Client ID and Client Secret near the top right of the page (see screenshot). Keep this page open as you continue configuration. ![GitHub app](github_app.png) - Homepage URL: The URL to your GitLab installation. 'https://gitlab.company.com'
8. On your GitLab server, open the configuration file. - Application description: Fill this in if you wish.
- Authorization callback URL: 'https://gitlab.company.com/users/auth/github/callback'
1. Select "Register application".
1. You should now see a Client ID and Client Secret near the top right of the page (see screenshot). Keep this page open as you continue configuration. ![GitHub app](github_app.png)
1. On your GitLab server, open the configuration file.
```sh ```sh
cd /home/git/gitlab cd /home/git/gitlab
...@@ -21,8 +27,9 @@ To enable the GitHub OmniAuth provider you must register your application with G ...@@ -21,8 +27,9 @@ To enable the GitHub OmniAuth provider you must register your application with G
sudo -u git -H editor config/gitlab.yml sudo -u git -H editor config/gitlab.yml
``` ```
9. Find the section dealing with OmniAuth. See [Initial OmniAuth Configuration](README.md#initial-omniauth-configuration) for more details. 1. Find the section dealing with OmniAuth. See [Initial OmniAuth Configuration](README.md#initial-omniauth-configuration) for more details.
10. Under `providers:` uncomment (or add) lines that look like the following:
1. Under `providers:` uncomment (or add) lines that look like the following:
``` ```
- { name: 'github', app_id: 'YOUR APP ID', - { name: 'github', app_id: 'YOUR APP ID',
...@@ -30,9 +37,12 @@ To enable the GitHub OmniAuth provider you must register your application with G ...@@ -30,9 +37,12 @@ To enable the GitHub OmniAuth provider you must register your application with G
args: { scope: 'user:email' } } args: { scope: 'user:email' } }
``` ```
11. Change 'YOUR APP ID' to the client ID from the GitHub application page from step 7. 1. Change 'YOUR APP ID' to the client ID from the GitHub application page from step 7.
12. Change 'YOUR APP SECRET' to the client secret from the GitHub application page from step 7.
13. Save the configuration file. 1. Change 'YOUR APP SECRET' to the client secret from the GitHub application page from step 7.
14. Restart GitLab for the changes to take effect.
1. Save the configuration file.
1. Restart GitLab for the changes to take effect.
On the sign in page there should now be a GitHub icon below the regular sign in form. Click the icon to begin the authentication process. GitHub will ask the user to sign in and authorize the GitLab application. If everything goes well the user will be returned to GitLab and will be signed in. On the sign in page there should now be a GitHub icon below the regular sign in form. Click the icon to begin the authentication process. GitHub will ask the user to sign in and authorize the GitLab application. If everything goes well the user will be returned to GitLab and will be signed in.
...@@ -3,27 +3,37 @@ ...@@ -3,27 +3,37 @@
To enable the Google OAuth2 OmniAuth provider you must register your application with Google. Google will generate a client ID and secret key for you to use. To enable the Google OAuth2 OmniAuth provider you must register your application with Google. Google will generate a client ID and secret key for you to use.
1. Sign in to the [Google Developers Console](https://console.developers.google.com/) with the Google account you want to use to register GitLab. 1. Sign in to the [Google Developers Console](https://console.developers.google.com/) with the Google account you want to use to register GitLab.
2. Select "Create Project".
3. Provide the project information 1. Select "Create Project".
* Project name: 'GitLab' works just fine here.
* Project ID: Must be unique to all Google Developer registered applications. Google provides a randomly generated Project ID by default. You can use the randomly generated ID or choose a new one. 1. Provide the project information
4. Refresh the page. You should now see your new project in the list. Click on the project. - Project name: 'GitLab' works just fine here.
5. Select "APIs & auth" in the left menu. - Project ID: Must be unique to all Google Developer registered applications. Google provides a randomly generated Project ID by default. You can use the randomly generated ID or choose a new one.
6. Select "Credentials" in the submenu. 1. Refresh the page. You should now see your new project in the list. Click on the project.
7. Select "Create New Client ID".
8. Fill in the required information 1. Select "APIs & auth" in the left menu.
* Application type: "Web Application"
* Authorized JavaScript origins: This isn't really used by GitLab but go ahead and put 'https://gitlab.example.com' here. 1. Select "Credentials" in the submenu.
* Authorized redirect URI: 'https://gitlab.example.com/users/auth/google_oauth2/callback'
9. Under the heading "Client ID for web application" you should see a Client ID and Client secret (see screenshot). Keep this page open as you continue configuration. ![Google app](google_app.png) 1. Select "Create New Client ID".
10. On your GitLab server, open the configuration file.
1. Fill in the required information
- Application type: "Web Application"
- Authorized JavaScript origins: This isn't really used by GitLab but go ahead and put 'https://gitlab.example.com' here.
- Authorized redirect URI: 'https://gitlab.example.com/users/auth/google_oauth2/callback'
1. Under the heading "Client ID for web application" you should see a Client ID and Client secret (see screenshot). Keep this page open as you continue configuration. ![Google app](google_app.png)
1. On your GitLab server, open the configuration file.
```sh ```sh
cd /home/git/gitlab cd /home/git/gitlab
sudo -u git -H editor config/gitlab.yml sudo -u git -H editor config/gitlab.yml
``` ```
11. Find the section dealing with OmniAuth. See [Initial OmniAuth Configuration](README.md#initial-omniauth-configuration) for more details.
12. Under `providers:` uncomment (or add) lines that look like the following: 1. Find the section dealing with OmniAuth. See [Initial OmniAuth Configuration](README.md#initial-omniauth-configuration) for more details.
1. Under `providers:` uncomment (or add) lines that look like the following:
``` ```
- { name: 'google_oauth2', app_id: 'YOUR APP ID', - { name: 'google_oauth2', app_id: 'YOUR APP ID',
...@@ -31,10 +41,13 @@ To enable the Google OAuth2 OmniAuth provider you must register your application ...@@ -31,10 +41,13 @@ To enable the Google OAuth2 OmniAuth provider you must register your application
args: { access_type: 'offline', approval_prompt: '' } } args: { access_type: 'offline', approval_prompt: '' } }
``` ```
13. Change 'YOUR APP ID' to the client ID from the GitHub application page from step 7. 1. Change 'YOUR APP ID' to the client ID from the GitHub application page from step 7.
14. Change 'YOUR APP SECRET' to the client secret from the GitHub application page from step 7.
15. Save the configuration file. 1. Change 'YOUR APP SECRET' to the client secret from the GitHub application page from step 7.
16. Restart GitLab for the changes to take effect.
1. Save the configuration file.
1. Restart GitLab for the changes to take effect.
On the sign in page there should now be a Google icon below the regular sign in form. Click the icon to begin the authentication process. Google will ask the user to sign in and authorize the GitLab application. If everything goes well the user will be returned to GitLab and will be signed in. On the sign in page there should now be a Google icon below the regular sign in form. Click the icon to begin the authentication process. Google will ask the user to sign in and authorize the GitLab application. If everything goes well the user will be returned to GitLab and will be signed in.
...@@ -45,5 +58,5 @@ This further configuration is not required for Google authentication to function ...@@ -45,5 +58,5 @@ This further configuration is not required for Google authentication to function
At this point, when users first try to authenticate to your GitLab installation with Google they will see a generic application name on the prompt screen. The prompt informs the user that "Project Default Service Account" would like to access their account. "Project Default Service Account" isn't very recognizable and may confuse or cause users to be concerned. This is easily changeable. At this point, when users first try to authenticate to your GitLab installation with Google they will see a generic application name on the prompt screen. The prompt informs the user that "Project Default Service Account" would like to access their account. "Project Default Service Account" isn't very recognizable and may confuse or cause users to be concerned. This is easily changeable.
1. Select 'Consent screen' in the left menu. (See steps 1, 4 and 5 above for instructions on how to get here if you closed your window). 1. Select 'Consent screen' in the left menu. (See steps 1, 4 and 5 above for instructions on how to get here if you closed your window).
2. Scroll down until you find "Product Name". Change the product name to something more descriptive. 1. Scroll down until you find "Product Name". Change the product name to something more descriptive.
3. Add any additional information as you wish - homepage, logo, privacy policy, etc. None of this is required, but it may help your users. 1. Add any additional information as you wish - homepage, logo, privacy policy, etc. None of this is required, but it may help your users.
# GitLab LDAP integration # GitLab LDAP integration
GitLab can be configured to allow your users to sign with their LDAP credentials to integrate with e.g. Active Directory. GitLab can be configured to allow your users to sign with their LDAP credentials to integrate with e.g. Active Directory.
The first time a user signs in with LDAP credentials, GitLab will create a new GitLab user associated with the LDAP Distinguished Name (DN) of the LDAP user. The first time a user signs in with LDAP credentials, GitLab will create a new GitLab user associated with the LDAP Distinguished Name (DN) of the LDAP user.
GitLab user attributes such as nickname and email will be copied from the LDAP user entry. GitLab user attributes such as nickname and email will be copied from the LDAP user entry.
## Enabling LDAP sign-in for existing GitLab users ## Enabling LDAP sign-in for existing GitLab users
When a user signs in to GitLab with LDAP for the first time, and their LDAP email address is the primary email address of an existing GitLab user, then the LDAP DN will be associated with the existing user. When a user signs in to GitLab with LDAP for the first time, and their LDAP email address is the primary email address of an existing GitLab user, then the LDAP DN will be associated with the existing user.
If the LDAP email attribute is not found in GitLab's database, a new user is created. If the LDAP email attribute is not found in GitLab's database, a new user is created.
In other words, if an existing GitLab user wants to enable LDAP sign-in for themselves, they should check that their GitLab email address matches their LDAP email address, and then sign into GitLab via their LDAP credentials. In other words, if an existing GitLab user wants to enable LDAP sign-in for themselves, they should check that their GitLab email address matches their LDAP email address, and then sign into GitLab via their LDAP credentials.
GitLab recognizes the following LDAP attributes as email addresses: `mail`, `email` and `userPrincipalName`. GitLab recognizes the following LDAP attributes as email addresses: `mail`, `email` and `userPrincipalName`.
If multiple LDAP email attributes are present, e.g. `mail: foo@bar.com` and `email: foo@example.com`, then the first attribute found wins -- in this case `foo@bar.com`. If multiple LDAP email attributes are present, e.g. `mail: foo@bar.com` and `email: foo@example.com`, then the first attribute found wins -- in this case `foo@bar.com`.
# OmniAuth # OmniAuth
GitLab leverages OmniAuth to allow users to sign in using Twitter, GitHub, and other popular services. Configuring GitLab leverages OmniAuth to allow users to sign in using Twitter, GitHub, and other popular services. Configuring
OmniAuth does not prevent standard GitLab authentication or LDAP (if configured) from continuing to work. Users can
choose to sign in using any of the configured mechanisms.
+ [Initial OmniAuth Configuration](#initial-omniauth-configuration) OmniAuth does not prevent standard GitLab authentication or LDAP (if configured) from continuing to work. Users can choose to sign in using any of the configured mechanisms.
+ [Supported Providers](#supported-providers)
+ [Enable OmniAuth for an Existing User](#enable-omniauth-for-an-existing-user)
### Initial OmniAuth Configuration - [Initial OmniAuth Configuration](#initial-omniauth-configuration)
- [Supported Providers](#supported-providers)
- [Enable OmniAuth for an Existing User](#enable-omniauth-for-an-existing-user)
## Initial OmniAuth Configuration
Before configuring individual OmniAuth providers there are a few global settings that need to be verified. Before configuring individual OmniAuth providers there are a few global settings that need to be verified.
1. Open the configuration file<br /> 1. Open the configuration file.
```sh ```sh
cd /home/git/gitlab cd /home/git/gitlab
...@@ -20,7 +20,7 @@ Before configuring individual OmniAuth providers there are a few global settings ...@@ -20,7 +20,7 @@ Before configuring individual OmniAuth providers there are a few global settings
sudo -u git -H editor config/gitlab.yml sudo -u git -H editor config/gitlab.yml
``` ```
2. Find the section dealing with OmniAuth. The section will look similar to the following.<br /> 1. Find the section dealing with OmniAuth. The section will look similar to the following.
``` ```
## OmniAuth settings ## OmniAuth settings
...@@ -52,32 +52,33 @@ Before configuring individual OmniAuth providers there are a few global settings ...@@ -52,32 +52,33 @@ Before configuring individual OmniAuth providers there are a few global settings
# args: { scope: 'user:email' } } # args: { scope: 'user:email' } }
``` ```
3. Change `enabled` to `true`. 1. Change `enabled` to `true`.
4. Consider the next two configuration options: `allow_single_sign_on` and `block_auto_created_users`.
* `allow_single_sign_on` defaults to `false`. If `false` users must be created manually or they will not be able to 1. Consider the next two configuration options: `allow_single_sign_on` and `block_auto_created_users`.
- `allow_single_sign_on` defaults to `false`. If `false` users must be created manually or they will not be able to
sign in via OmniAuth. sign in via OmniAuth.
* `block_auto_created_users` defaults to `true`. If `true` auto created users will be blocked by default and will - `block_auto_created_users` defaults to `true`. If `true` auto created users will be blocked by default and will
have to be unblocked by an administrator before they are able to sign in. have to be unblocked by an administrator before they are able to sign in.
* **Note:** If you set `allow_single_sign_on` to `true` and `block_auto_created_users` to `false` please be aware - **Note:** If you set `allow_single_sign_on` to `true` and `block_auto_created_users` to `false` please be aware
that any user on the Internet will be able to successfully sign in to your GitLab without administrative approval. that any user on the Internet will be able to successfully sign in to your GitLab without administrative approval.
5. Choose one or more of the Supported Providers below to continue configuration.
### Supported Providers 1. Choose one or more of the Supported Providers below to continue configuration.
## Supported Providers
+ [GitHub](github.md) - [GitHub](github.md)
+ [Google](google.md) - [Google](google.md)
+ [Twitter](twitter.md) - [Twitter](twitter.md)
### Enable OmniAuth for an Existing User ## Enable OmniAuth for an Existing User
Existing users can enable OmniAuth for specific providers after the account is created. For example, if the user Existing users can enable OmniAuth for specific providers after the account is created. For example, if the user originally signed in with LDAP an OmniAuth provider such as Twitter can be enabled. Follow the steps below to enable an OmniAuth provider for an existing user.
originally signed in with LDAP an OmniAuth provider such as Twitter can be enabled. Follow the steps below to enable an
OmniAuth provider for an existing user.
1. Sign in normally - whether standard sign in, LDAP, or another OmniAuth provider. 1. Sign in normally - whether standard sign in, LDAP, or another OmniAuth provider.
2. Go to profile settings (the silhouette icon in the top right corner). 1. Go to profile settings (the silhouette icon in the top right corner).
3. Select the "Account" tab. 1. Select the "Account" tab.
4. Under "Social Accounts" select the desired OmniAuth provider, such as Twitter. 1. Under "Social Accounts" select the desired OmniAuth provider, such as Twitter.
5. The user will be redirected to the provider. Once the user authorized GitLab they will be redirected back to GitLab. 1. The user will be redirected to the provider. Once the user authorized GitLab they will be redirected back to GitLab.
The chosen OmniAuth provider is now active and can be used to sign in to GitLab from then on. The chosen OmniAuth provider is now active and can be used to sign in to GitLab from then on.
# Slack integration # Slack integration
### On Slack ## On Slack
To enable Slack integration you must create an Incoming WebHooks integration on Slack; To enable Slack integration you must create an Incoming WebHooks integration on Slack;
1. Sign in to [Slack](https://slack.com) (https://YOURSUBDOMAIN.slack.com/services) 1. Sign in to [Slack](https://slack.com) (https://YOURSUBDOMAIN.slack.com/services)
2. Click on the Integrations menu at the top of the page. 1. Click on the Integrations menu at the top of the page.
3. Add a new Integration. 1. Add a new Integration.
4. Pick Incoming WebHooks 1. Pick Incoming WebHooks
5. Choose the channel name you want to send notifications to, in the Settings section 1. Choose the channel name you want to send notifications to, in the Settings section
6. Add Integrations. 1. Add Integrations.
* Optional step; You can change bot's name and avatar by clicking "change the name of your bot", and "change the icon" after that you have to click "Save settings". - Optional step; You can change bot's name and avatar by clicking "change the name of your bot", and "change the icon" after that you have to click "Save settings".
Now, Slack is ready to get external hooks. Before you leave this page don't forget to get the Token that you'll need on GitLab. You can find it by clicking Expand button, located in the "Instructions for creating Incoming WebHooks" section. It's a random alpha-numeric text 24 characters long. Now, Slack is ready to get external hooks. Before you leave this page don't forget to get the Token that you'll need on GitLab. You can find it by clicking Expand button, located in the "Instructions for creating Incoming WebHooks" section. It's a random alpha-numeric text 24 characters long.
### On GitLab ## On GitLab
After Slack is ready we need to setup GitLab. Here are the steps to achieve this. After Slack is ready we need to setup GitLab. Here are the steps to achieve this.
1. Sign in to GitLab 1. Sign in to GitLab
2. Pick the repository you want.
3. Navigate to Settings -> Services -> Slack 1. Pick the repository you want.
4. Fill in your Slack details
* Mark as active it 1. Navigate to Settings -> Services -> Slack
* Type your subdomain's prefix (If your subdomain is https://somedomain.slack.com you only have to type the somedomain)
* Type in the token you got from Slack 1. Fill in your Slack details
* Type in the channel name you want to use (eg. #announcements)
- Mark as active it
- Type your subdomain's prefix (If your subdomain is https://somedomain.slack.com you only have to type the somedomain)
- Type in the token you got from Slack
- Type in the channel name you want to use (eg. #announcements)
Have fun :) Have fun :)
_P.S. You can set "branch,pushed,Compare changes" as highlight words on your Slack profile settings, so that you can be aware of new commits when somebody pushes them._ *P.S. You can set "branch,pushed,Compare changes" as highlight words on your Slack profile settings, so that you can be aware of new commits when somebody pushes them.*
# Twitter OAuth2 OmniAuth Provider # Twitter OAuth2 OmniAuth Provider
To enable the Twitter OmniAuth provider you must register your application with Twitter. Twitter will generate a client To enable the Twitter OmniAuth provider you must register your application with Twitter. Twitter will generate a client ID and secret key for you to use.
ID and secret key for you to use.
1. Sign in to [Twitter Developers](https://dev.twitter.com/) area. 1. Sign in to [Twitter Developers](https://dev.twitter.com/) area.
2. Hover over the avatar in the top right corner and select "My applications."
3. Select "Create new app" 1. Hover over the avatar in the top right corner and select "My applications."
4. Fill in the application details.
* Name: This can be anything. Consider something like "\<Organization\>'s GitLab" or "\<Your Name\>'s GitLab" or 1. Select "Create new app"
1. Fill in the application details.
- Name: This can be anything. Consider something like "\<Organization\>'s GitLab" or "\<Your Name\>'s GitLab" or
something else descriptive. something else descriptive.
* Description: Create a description. - Description: Create a description.
* Website: The URL to your GitLab installation. 'https://gitlab.example.com' - Website: The URL to your GitLab installation. 'https://gitlab.example.com'
* Callback URL: 'https://gitlab.example.com/users/auth/github/callback' - Callback URL: 'https://gitlab.example.com/users/auth/github/callback'
* Agree to the "Rules of the Road." - Agree to the "Rules of the Road."
![Twitter App Details](twitter_app_details.png) ![Twitter App Details](twitter_app_details.png)
6. Select "Create your Twitter application." 1. Select "Create your Twitter application."
7. Select the "Settings" tab.
8. Underneath the Callback URL check the box next to "Allow this application to be used to Sign in the Twitter." 1. Select the "Settings" tab.
9. Select "Update settings" at the bottom to save changes.
10. Select the "API Keys" tab. 1. Underneath the Callback URL check the box next to "Allow this application to be used to Sign in the Twitter."
11. You should now see an API key and API secret (see screenshot). Keep this page open as you continue configuration.
![Twitter app](twitter_app_api_keys.png) 1. Select "Update settings" at the bottom to save changes.
12. On your GitLab server, open the configuration file.
1. Select the "API Keys" tab.
1. You should now see an API key and API secret (see screenshot). Keep this page open as you continue configuration.
![Twitter app](twitter_app_api_keys.png)
1. On your GitLab server, open the configuration file.
```sh ```sh
cd /home/git/gitlab cd /home/git/gitlab
...@@ -29,19 +39,22 @@ ID and secret key for you to use. ...@@ -29,19 +39,22 @@ ID and secret key for you to use.
sudo -u git -H editor config/gitlab.yml sudo -u git -H editor config/gitlab.yml
``` ```
13. Find the section dealing with OmniAuth. See [Initial OmniAuth Configuration](README.md#initial-omniauth-configuration) 1. Find the section dealing with OmniAuth. See [Initial OmniAuth Configuration](README.md#initial-omniauth-configuration)
for more details. for more details.
14. Under `providers:` uncomment (or add) lines that look like the following:
1. Under `providers:` uncomment (or add) lines that look like the following:
``` ```
- { name: 'twitter', app_id: 'YOUR APP ID', - { name: 'twitter', app_id: 'YOUR APP ID',
app_secret: 'YOUR APP SECRET' } app_secret: 'YOUR APP SECRET' }
``` ```
15. Change 'YOUR APP ID' to the API key from Twitter page in step 11. 1. Change 'YOUR APP ID' to the API key from Twitter page in step 11.
16. Change 'YOUR APP SECRET' to the API secret from the Twitter page in step 11.
17. Save the configuration file. 1. Change 'YOUR APP SECRET' to the API secret from the Twitter page in step 11.
18. Restart GitLab for the changes to take effect.
1. Save the configuration file.
1. Restart GitLab for the changes to take effect.
On the sign in page there should now be a Twitter icon below the regular sign in form. Click the icon to begin the On the sign in page there should now be a Twitter icon below the regular sign in form. Click the icon to begin the authentication process. Twitter will ask the user to sign in and authorize the GitLab application. If everything goes well the user will be returned to GitLab and will be signed in.
authentication process. Twitter will ask the user to sign in and authorize the GitLab application. If everything goes well the user will be returned to GitLab and will be signed in.
+ [Corporate contributor license agreement](corporate_contributor_license_agreement.md) # Legal
+ [Individual contributor license agreement](individual_contributor_license_agreement.md)
- [Corporate contributor license agreement](corporate_contributor_license_agreement.md)
- [Individual contributor license agreement](individual_contributor_license_agreement.md)
...@@ -22,6 +22,4 @@ You accept and agree to the following terms and conditions for Your present and ...@@ -22,6 +22,4 @@ You accept and agree to the following terms and conditions for Your present and
8. It is your responsibility to notify GitLab B.V. 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 B.V.. 8. It is your responsibility to notify GitLab B.V. 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 B.V..
---------------------------------------
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. 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.
...@@ -22,6 +22,4 @@ You accept and agree to the following terms and conditions for Your present and ...@@ -22,6 +22,4 @@ You accept and agree to the following terms and conditions for Your present and
8. You agree to notify GitLab B.V. of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. 8. You agree to notify GitLab B.V. 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. 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.
# Markdown # Markdown
---------------------------------------------- ## Table of Contents
Table of Contents
=================
----------------------------------------------
**[GitLab Flavored Markdown](#gitlab-flavored-markdown-gfm)** **[GitLab Flavored Markdown](#gitlab-flavored-markdown-gfm)**
...@@ -21,7 +16,6 @@ Table of Contents ...@@ -21,7 +16,6 @@ Table of Contents
[Special GitLab references](#special-gitlab-references) [Special GitLab references](#special-gitlab-references)
**[Standard Markdown](#standard-markdown)** **[Standard Markdown](#standard-markdown)**
[Headers](#headers) [Headers](#headers)
...@@ -46,29 +40,24 @@ Table of Contents ...@@ -46,29 +40,24 @@ Table of Contents
**[References](#references)** **[References](#references)**
---------------------------------------------- ## GitLab Flavored Markdown (GFM)
GitLab Flavored Markdown (GFM) For GitLab we developed something we call "GitLab Flavored Markdown" (GFM). It extends the standard Markdown in a few significant ways to add some useful functionality.
==============================
For GitLab we developed something we call "GitLab Flavored Markdown" (GFM).
It extends the standard Markdown in a few significant ways to add some useful functionality.
You can use GFM in You can use GFM in
* commit messages - commit messages
* comments - comments
* wall posts - wall posts
* issues - issues
* merge requests - merge requests
* milestones - milestones
* wiki pages - wiki pages
You can also use other rich text files in GitLab. You can also use other rich text files in GitLab. You might have to install a depency to do so. Please see the [github-markup gem readme](https://github.com/gitlabhq/markup#markups) for more information.
You might have to install a depency to do so.
Please see the [github-markup gem readme](https://github.com/gitlabhq/markup#markups) for more information. ## Newlines
Newlines
--------
GFM honors the markdown specification in how [paragraphs and line breaks are handled](http://daringfireball.net/projects/markdown/syntax#p). GFM honors the markdown specification in how [paragraphs and line breaks are handled](http://daringfireball.net/projects/markdown/syntax#p).
A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines.: A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines.:
...@@ -83,8 +72,8 @@ Violets are blue ...@@ -83,8 +72,8 @@ Violets are blue
Sugar is sweet Sugar is sweet
Multiple underscores in words ## Multiple underscores in words
-----------------------------
It is not reasonable to italicize just _part_ of a word, especially when you're dealing with code and names that often appear with multiple underscores. Therefore, GFM ignores multiple underscores in words. It is not reasonable to italicize just _part_ of a word, especially when you're dealing with code and names that often appear with multiple underscores. Therefore, GFM ignores multiple underscores in words.
perform_complicated_task perform_complicated_task
...@@ -93,10 +82,9 @@ It is not reasonable to italicize just _part_ of a word, especially when you're ...@@ -93,10 +82,9 @@ It is not reasonable to italicize just _part_ of a word, especially when you're
perform_complicated_task perform_complicated_task
do_this_and_do_that_and_another_thing do_this_and_do_that_and_another_thing
URL autolinking ## URL autolinking
---------------
GFM will autolink standard URLs you copy and paste into your text. GFM will autolink standard URLs you copy and paste into your text. So if you want to link to a URL (instead of a textural link), you can simply put the URL in verbatim and it will be turned into a link to that URL.
So if you want to link to a URL (instead of a textural link), you can simply put the URL in verbatim and it will be turned into a link to that URL.
http://www.google.com http://www.google.com
...@@ -164,8 +152,7 @@ s = "There is no highlighting for this." ...@@ -164,8 +152,7 @@ s = "There is no highlighting for this."
But let's throw in a <b>tag</b>. But let's throw in a <b>tag</b>.
``` ```
Emoji ## Emoji
-----
Sometimes you want to be :cool: and add some :sparkles: to your :speech_balloon:. Well we have a :gift: for you: Sometimes you want to be :cool: and add some :sparkles: to your :speech_balloon:. Well we have a :gift: for you:
...@@ -187,26 +174,25 @@ If you are :new: to this, don't be :fearful:. You can easily join the emoji :cir ...@@ -187,26 +174,25 @@ If you are :new: to this, don't be :fearful:. You can easily join the emoji :cir
Consult the [Emoji Cheat Sheet](http://www.emoji-cheat-sheet.com/) for a list of all supported emoji codes. :thumbsup: Consult the [Emoji Cheat Sheet](http://www.emoji-cheat-sheet.com/) for a list of all supported emoji codes. :thumbsup:
Special GitLab References ## Special GitLab References
-----
GFM recognized special references. GFM recognized special references.
You can easily reference e.g. a team member, an issue, or a commit within a project. You can easily reference e.g. a team member, an issue, or a commit within a project.
GFM will turn that reference into a link so you can navigate between them easily. GFM will turn that reference into a link so you can navigate between them easily.
GFM will recognize the following: GFM will recognize the following:
* @foo : for team members - @foo : for team members
* #123 : for issues - #123 : for issues
* !123 : for merge requests - !123 : for merge requests
* $123 : for snippets - $123 : for snippets
* 1234567 : for commits - 1234567 : for commits
* \[file\](path/to/file) : for file references - \[file\](path/to/file) : for file references
----------------------------------
# Standard Markdown # Standard Markdown
----------------------------------
## Headers ## Headers
```no-highlight ```no-highlight
...@@ -249,12 +235,12 @@ On hover a link to those IDs becomes visible to make it easier to copy the link ...@@ -249,12 +235,12 @@ On hover a link to those IDs becomes visible to make it easier to copy the link
The IDs are generated from the content of the header according to the following rules: The IDs are generated from the content of the header according to the following rules:
1) remove the heading hashes `#` and process the rest of the line as it would be processed if it were not a header 1. remove the heading hashes `#` and process the rest of the line as it would be processed if it were not a header
2) from the result, remove all HTML tags, but keep their inner content 2. from the result, remove all HTML tags, but keep their inner content
3) convert all characters to lowercase 3. convert all characters to lowercase
4) convert all characters except `[a-z0-9_-]` into hyphens `-` 4. convert all characters except `[a-z0-9_-]` into hyphens `-`
5) transform multiple adjacent hyphens into a single hyphen 5. transform multiple adjacent hyphens into a single hyphen
6) remove trailing and heading hyphens 6. remove trailing and heading hyphens
For example: For example:
...@@ -377,8 +363,7 @@ Some text to show that the reference links can follow later. ...@@ -377,8 +363,7 @@ Some text to show that the reference links can follow later.
**Note** **Note**
Relative links do not allow referencing project files in a wiki page or wiki page in a project file. Relative links do not allow referencing project files in a wiki page or wiki page in a project file. The reason for this is that, in GitLab, wiki is always a separate git repository. For example:
The reason for this is that, in GitLab, wiki is always a separate git repository. For example:
`[I'm a reference-style link][style]` `[I'm a reference-style link][style]`
...@@ -399,9 +384,11 @@ will point the link to `wikis/style` when the link is inside of a wiki markdown ...@@ -399,9 +384,11 @@ will point the link to `wikis/style` when the link is inside of a wiki markdown
Here's our logo: Here's our logo:
Inline-style: Inline-style:
![alt text](/assets/logo-white.png) ![alt text](/assets/logo-white.png)
Reference-style: Reference-style:
![alt text][logo] ![alt text][logo]
[logo]: /assets/logo-white.png [logo]: /assets/logo-white.png
...@@ -518,10 +505,8 @@ Code above produces next output: ...@@ -518,10 +505,8 @@ Code above produces next output:
| cell 1 | cell 2 | | cell 1 | cell 2 |
| cell 3 | cell 4 | | cell 3 | cell 4 |
------------
## References ## References
* This document leveraged heavily from the [Markdown-Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). - This document leveraged heavily from the [Markdown-Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
* The [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) at Daring Fireball is an excellent resource for a detailed explanation of standard markdown. - The [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) at Daring Fireball is an excellent resource for a detailed explanation of standard markdown.
* [Dillinger.io](http://dillinger.io) is a handy tool for testing standard markdown. - [Dillinger.io](http://dillinger.io) is a handy tool for testing standard markdown.
# Permissions # Permissions
Users have different abilities depending on the access level they have in a particular group or project. Users have different abilities depending on the access level they have in a particular group or project.
If a user is both in a project group and in the project itself, the highest permission level is used. If a user is both in a project group and in the project itself, the highest permission level is used.
If a user is a GitLab administrator they receive all permissions. If a user is a GitLab administrator they receive all permissions.
--- ## Project
#### Project:
| Action | Guest | Reporter | Developer | Master | Owner |
|---------------------------------------|---------|------------|-------------|----------|--------|
| Action| Guest | Reporter | Developer | Master | Owner| | Create new issue | ✓ | ✓ | ✓ | ✓ | ✓ |
|-------|-------|----------|-----------|--------|------| | Leave comments | ✓ | ✓ | ✓ | ✓ | ✓ |
|Create new issue|✓|✓|✓|✓|✓| | Write on project wall | ✓ | ✓ | ✓ | ✓ | ✓ |
|Leave comments|✓|✓|✓|✓|✓| | Pull project code | | ✓ | ✓ | ✓ | ✓ |
|Write on project wall|✓|✓|✓|✓|✓| | Download project | | ✓ | ✓ | ✓ | ✓ |
|Pull project code| |✓|✓|✓|✓| | Create code snippets | | ✓ | ✓ | ✓ | ✓ |
|Download project| |✓|✓|✓|✓| | Create new merge request | | | ✓ | ✓ | ✓ |
|Create code snippets| |✓|✓|✓|✓| | Create new branches | | | ✓ | ✓ | ✓ |
|Create new merge request| ||✓|✓|✓| | Push to non-protected branches | | | ✓ | ✓ | ✓ |
|Create new branches| ||✓|✓|✓| | Remove non-protected branches | | | ✓ | ✓ | ✓ |
|Push to non-protected branches| ||✓|✓|✓| | Add tags | | | ✓ | ✓ | ✓ |
|Remove non-protected branches| ||✓|✓|✓| | Write a wiki | | | ✓ | ✓ | ✓ |
|Add tags| ||✓|✓|✓| | Manage issue tracker | | | ✓ | ✓ | ✓ |
|Write a wiki| ||✓|✓|✓| | Add new team members | | | | ✓ | ✓ |
|Manage issue tracker| ||✓|✓|✓| | Push to protected branches | | | | ✓ | ✓ |
|Add new team members| |||✓|✓| | Enable/Disable branch protection | | | | ✓ | ✓ |
|Push to protected branches| |||✓|✓| | Rewrite/remove git tags | | | | ✓ | ✓ |
|Enable/Disable branch protection| |||✓|✓| | Edit project | | | | ✓ | ✓ |
|Rewrite/remove git tags| |||✓|✓| | Add Deploy Keys to project | | | | ✓ | ✓ |
|Edit project| |||✓|✓| | Configure Project Hooks | | | | ✓ | ✓ |
|Add Deploy Keys to project| |||✓|✓| | Switch visibility level | | | | | ✓ |
|Configure Project Hooks| |||✓|✓| | Transfer project to another namespace | | | | | ✓ |
|Switch visibility level| ||||✓| | Remove project | | | | | ✓ |
|Transfer project to another namespace| ||||✓|
|Remove project| ||||✓| ## Group
#### Group | Action | Guest | Reporter | Developer | Master | Owner |
|-------------------------|-------|----------|-----------|--------|-------|
|Action|Guest|Reporter|Developer|Master|Owner| | Browse group | ✓ | ✓ | ✓ | ✓ | ✓ |
|------|-----|--------|---------|------|-----| | Edit group | | | | | ✓ |
|Browse group|✓|✓|✓|✓|✓| | Create project in group | | | | ✓ | ✓ |
|Edit group|||||✓| | Manage group members | | | | | ✓ |
|Create project in group||||✓|✓| | Remove group | | | | | ✓ |
|Manage group members|||||✓|
|Remove group|||||✓|
Any user can remove himself from a group, unless he is the last Owner of the group. Any user can remove himself from a group, unless he is the last Owner of the group.
# Public access # Public access
Gitlab allows you to open selected projects to be accessed **publicly** or **internally**. Gitlab allows you to open selected projects to be accessed **publicly** or **internally**.
Projects with either of these visibility levels will be listen in the [public access directory](/public). Projects with either of these visibility levels will be listen in the [public access directory](/public).
Internal projects will only be available to authenticated users. Internal projects will only be available to authenticated users.
#### Public projects ## Public projects
Public projects can be cloned **without any** authentication. Public projects can be cloned **without any** authentication.
It will also be listed on the [public access directory](/public). It will also be listed on the [public access directory](/public).
**Any logged in user** will have [Guest](/help/permissions) permissions on the repository. **Any logged in user** will have [Guest](/help/permissions) permissions on the repository.
#### Internal projects ## Internal projects
Internal projects can be cloned by any logged in user. Internal projects can be cloned by any logged in user.
It will also be listed on the [public access directory](/public) for logged in users. It will also be listed on the [public access directory](/public) for logged in users.
Any logged in user will have [Guest](/help/permissions) permissions on the repository. Any logged in user will have [Guest](/help/permissions) permissions on the repository.
#### How to change project visibility ## How to change project visibility
1. Go to your project dashboard 1. Go to your project dashboard
2. Click on the "Edit" tab 1. Click on the "Edit" tab
3. Change "Visibility Level" 1. Change "Visibility Level"
## Visibility of users
#### Visibility of users
The public page of users, located at `/u/username` is visible if either: The public page of users, located at `/u/username` is visible if either:
* You are logged in. - You are logged in.
* You are logged out, and the target user is authorized to (is Guest, Reporter, etc.) at least one public project. - You are logged out, and the target user is authorized to (is Guest, Reporter, etc.) at least one public project.
Otherwise, you will be redirected to the sign in page. Otherwise, you will be redirected to the sign in page.
When visiting the public page of an user, you will only see listed projects which you can view yourself. When visiting the public page of an user, you will only see listed projects which you can view yourself.
#### Restricting the use of public or internal projects ## Restricting the use of public or internal projects
In [gitlab.yml](https://gitlab.com/gitlab-org/gitlab-ce/blob/dbd88d453b8e6c78a423fa7e692004b1db6ea069/config/gitlab.yml.example#L64) you can disable public projects or public and internal projects for the entire GitLab installation to prevent people making code public by accident.
In [gitlab.yml](https://gitlab.com/gitlab-org/gitlab-ce/blob/dbd88d453b8e6c78a423fa7e692004b1db6ea069/config/gitlab.yml.example#L64) you can disable public projects or public and internal projects for the entire GitLab installation to prevent people making code public by accident.
+ [Backup restore](backup_restore.md) - [Backup restore](backup_restore.md)
+ [Cleanup](cleanup.md) - [Cleanup](cleanup.md)
+ [Maintenance](maintenance.md) and self-checks - [Maintenance](maintenance.md) and self-checks
+ [User management](user_management.md) - [User management](user_management.md)
+ [Web hooks](web_hooks.md) - [Web hooks](web_hooks.md)
+ [Import](import.md) of git repositories in bulk - [Import](import.md) of git repositories in bulk
# Backup restore # Backup restore
### Create a backup of the GitLab system ## Create a backup of the GitLab system
Creates a backup archive of the database and all repositories. This archive will be saved in backup_path (see `config/gitlab.yml`). Creates a backup archive of the database and all repositories. This archive will be saved in backup_path (see `config/gitlab.yml`).
The filename will be `[TIMESTAMP]_gitlab_backup.tar`. This timestamp can be used to restore an specific backup. The filename will be `[TIMESTAMP]_gitlab_backup.tar`. This timestamp can be used to restore an specific backup.
``` ```
...@@ -38,7 +39,7 @@ Deleting tmp directories...[DONE] ...@@ -38,7 +39,7 @@ Deleting tmp directories...[DONE]
Deleting old backups... [SKIPPING] Deleting old backups... [SKIPPING]
``` ```
### Restore a previously created backup ## Restore a previously created backup
``` ```
bundle exec rake gitlab:backup:restore RAILS_ENV=production bundle exec rake gitlab:backup:restore RAILS_ENV=production
...@@ -81,7 +82,7 @@ Restoring repositories: ...@@ -81,7 +82,7 @@ Restoring repositories:
Deleting tmp directories...[DONE] Deleting tmp directories...[DONE]
``` ```
### Configure cron to make daily backups ## Configure cron to make daily backups
``` ```
cd /home/git/gitlab cd /home/git/gitlab
......
# Cleanup # Cleanup
### Remove garbage from filesystem. Important! Data loss! ## Remove garbage from filesystem. Important! Data loss!
Remove namespaces(dirs) from `/home/git/repositories` if they don't exist in GitLab database. Remove namespaces(dirs) from `/home/git/repositories` if they don't exist in GitLab database.
...@@ -13,4 +13,3 @@ Remove repositories (global only for now) from `/home/git/repositories` if they ...@@ -13,4 +13,3 @@ Remove repositories (global only for now) from `/home/git/repositories` if they
``` ```
bundle exec rake gitlab:cleanup:repos RAILS_ENV=production bundle exec rake gitlab:cleanup:repos RAILS_ENV=production
``` ```
# Features
## Enable usernames and namespaces for user projects
This command will enable the namespaces feature introduced in v4.0. It will move every project in its namespace folder.
Note:
- Because the **repository location will change**, you will need to **update all your git url's** to point to the new location.
- Username can be changed at [Profile / Account](/profile/account)
**Example:**
Old path: `git@example.org:myrepo.git`
New path: `git@example.org:username/myrepo.git` or `git@example.org:groupname/myrepo.git`
```
bundle exec rake gitlab:enable_namespaces RAILS_ENV=production
```
## Rebuild project satellites
This command will build missing satellites for projects. After this you will be able to **merge a merge request** via GitLab and use the **online editor**.
```
bundle exec rake gitlab:satellites:create RAILS_ENV=production
```
Example output:
```
Creating satellite for abcd.git
[git clone output]
Creating satellite for abcd2.git
[git clone output]
done
```
# Maintenance # Maintenance
### Gather information about GitLab and the system it runs on ## Gather information about GitLab and the system it runs on
This command gathers information about your GitLab installation and the System This command gathers information about your GitLab installation and the System it runs on. These may be useful when asking for help or reporting issues.
it runs on. These may be useful when asking for help or reporting issues.
``` ```
bundle exec rake gitlab:env:info RAILS_ENV=production bundle exec rake gitlab:env:info RAILS_ENV=production
...@@ -39,15 +38,14 @@ Hooks: /home/git/gitlab-shell/hooks/ ...@@ -39,15 +38,14 @@ Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git Git: /usr/bin/git
``` ```
## Check GitLab configuration
### Check GitLab configuration
Runs the following rake tasks: Runs the following rake tasks:
* gitlab:env:check - `gitlab:env:check`
* gitlab:gitlab_shell:check - `gitlab:gitlab_shell:check`
* gitlab:sidekiq:check - `gitlab:sidekiq:check`
* gitlab:app:check - `gitlab:app:check`
It will check that each component was setup according to the installation guide and suggest fixes for issues found. It will check that each component was setup according to the installation guide and suggest fixes for issues found.
...@@ -103,10 +101,10 @@ Redis version >= 2.0.0? ... yes ...@@ -103,10 +101,10 @@ Redis version >= 2.0.0? ... yes
Checking GitLab ... Finished Checking GitLab ... Finished
``` ```
## (Re-)Create satellite repos
### (Re-)Create satellite repos
This will create satellite repos for all your projects. This will create satellite repos for all your projects.
If necessary, remove the `tmp/repo_satellites` directory and rerun the command below. If necessary, remove the `tmp/repo_satellites` directory and rerun the command below.
``` ```
......
# User management # User management
### Add user as a developer to all projects ## Add user as a developer to all projects
```bash ```bash
bundle exec rake gitlab:import:user_to_projects[username@domain.tld] bundle exec rake gitlab:import:user_to_projects[username@domain.tld]
``` ```
## Add all users to all projects
### Add all users to all projects
Notes: Notes:
* admin users are added as masters - admin users are added as masters
```bash ```bash
bundle exec rake gitlab:import:all_users_to_all_projects bundle exec rake gitlab:import:all_users_to_all_projects
``` ```
### Add user as a developer to all groups ## Add user as a developer to all groups
``` ```bash
bundle exec rake gitlab:import:user_to_groups[username@domain.tld] bundle exec rake gitlab:import:user_to_groups[username@domain.tld]
``` ```
### Add all users to all groups ## Add all users to all groups
Notes: Notes:
* admin users are added as owners so they can add additional users to the group - admin users are added as owners so they can add additional users to the group
``` ```bash
bundle exec rake gitlab:import:all_users_to_all_groups bundle exec rake gitlab:import:all_users_to_all_groups
``` ```
# Web hooks # Web hooks
### Add a web hook for **ALL** projects: ## Add a web hook for **ALL** projects:
RAILS_ENV=production bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" RAILS_ENV=production bundle exec rake gitlab:web_hook:add URL="http://example.com/hook"
## Add a web hook for projects in a given **NAMESPACE**:
### Add a web hook for projects in a given **NAMESPACE**:
RAILS_ENV=production bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=acme RAILS_ENV=production bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=acme
## Remove a web hook from **ALL** projects using:
### Remove a web hook from **ALL** projects using:
RAILS_ENV=production bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" RAILS_ENV=production bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook"
## Remove a web hook from projects in a given **NAMESPACE**:
### Remove a web hook from projects in a given **NAMESPACE**:
RAILS_ENV=production bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=acme RAILS_ENV=production bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=acme
## List **ALL** web hooks:
### List **ALL** web hooks:
RAILS_ENV=production bundle exec rake gitlab:web_hook:list RAILS_ENV=production bundle exec rake gitlab:web_hook:list
## List the web hooks from projects in a given **NAMESPACE**:
### List the web hooks from projects in a given **NAMESPACE**:
RAILS_ENV=production bundle exec rake gitlab:web_hook:list NAMESPACE=/ RAILS_ENV=production bundle exec rake gitlab:web_hook:list NAMESPACE=/
> Note: `/` is the global namespace. > Note: `/` is the global namespace.
GitLab has the following updates: GitLab has the following updates:
+ [Monthly release](monthly.md), every month on the 22nd. - [Monthly release](monthly.md), every month on the 22nd.
+ [Patch release](patch.md), if there are serious regressions. - [Patch release](patch.md), if there are serious regressions.
+ [Security](security.md), for security problems. - [Security](security.md), for security problems.
+ [Master](master.md), update process for the master branch. - [Master](master.md), update process for the master branch.
...@@ -25,16 +25,18 @@ Consider naming the issue "Release x.x.x.rc1" to make it easier for later search ...@@ -25,16 +25,18 @@ Consider naming the issue "Release x.x.x.rc1" to make it easier for later search
### **2. Update the installation guide** ### **2. Update the installation guide**
1. Check if it references the correct branch `x-x-stable` (doesn't exist yet, but that is okay) 1. Check if it references the correct branch `x-x-stable` (doesn't exist yet, but that is okay)
2. Check the [GitLab Shell version](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/tasks/gitlab/check.rake#L782) 1. Check the [GitLab Shell version](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/tasks/gitlab/check.rake#L782)
3. Check the [Git version](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/tasks/gitlab/check.rake#L794) 1. Check the [Git version](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/tasks/gitlab/check.rake#L794)
4. There might be other changes. Ask around. 1. There might be other changes. Ask around.
### **3. Create an update guide** ### **3. Create an update guide**
It's best to copy paste the previous guide and make changes where necessary. The typical steps are listed below with any points you should specifically look at. It's best to copy paste the previous guide and make changes where necessary. The typical steps are listed below with any points you should specifically look at.
#### 0. Any major changes? #### 0. Any major changes?
List any major changes here, so the user is aware of them before starting to upgrade. For instance: List any major changes here, so the user is aware of them before starting to upgrade. For instance:
- Database updates - Database updates
- Web server changes - Web server changes
- File structure changes - File structure changes
...@@ -59,42 +61,43 @@ List any major changes here, so the user is aware of them before starting to upg ...@@ -59,42 +61,43 @@ List any major changes here, so the user is aware of them before starting to upg
Check if any of these changed since last release: Check if any of these changed since last release:
* https://gitlab.com/gitlab-org/gitlab-ce/commits/master/lib/support/nginx/gitlab - <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-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/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/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.mysql>
* https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/database.yml.postgresql - <https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/database.yml.postgresql>
#### 8. Need to update init script? #### 8. Need to update init script?
Check if the init.d/gitlab script changed since last release: https://gitlab.com/gitlab-org/gitlab-ce/commits/master/lib/support/init.d/gitlab Check if the `init.d/gitlab` script changed since last release: <https://gitlab.com/gitlab-org/gitlab-ce/commits/master/lib/support/init.d/gitlab>
#### 9. Start application #### 9. Start application
#### 10. Check application status #### 10. Check application status
### **4. Code quality indicatiors** ### **4. Code quality indicators**
Make sure the code quality indicators are green / good. Make sure the code quality indicators are green / good.
* [![build status](http://ci.gitlab.org/projects/1/status.png?ref=master)](http://ci.gitlab.org/projects/1?ref=master) on ci.gitlab.org (master branch) - [![build status](http://ci.gitlab.org/projects/1/status.png?ref=master)](http://ci.gitlab.org/projects/1?ref=master) on ci.gitlab.org (master branch)
* [![build status](https://secure.travis-ci.org/gitlabhq/gitlabhq.png)](https://travis-ci.org/gitlabhq/gitlabhq) on travis-ci.org (master branch) - [![build status](https://secure.travis-ci.org/gitlabhq/gitlabhq.png)](https://travis-ci.org/gitlabhq/gitlabhq) on travis-ci.org (master branch)
* [![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.png)](https://codeclimate.com/github/gitlabhq/gitlabhq) - [![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.png)](https://codeclimate.com/github/gitlabhq/gitlabhq)
* [![Dependency Status](https://gemnasium.com/gitlabhq/gitlabhq.png)](https://gemnasium.com/gitlabhq/gitlabhq) this button can be yellow (small updates are available) but must not be red (a security fix or an important update is available) - [![Dependency Status](https://gemnasium.com/gitlabhq/gitlabhq.png)](https://gemnasium.com/gitlabhq/gitlabhq) this button can be yellow (small updates are available) but must not be red (a security fix or an important update is available)
* [![Coverage Status](https://coveralls.io/repos/gitlabhq/gitlabhq/badge.png?branch=master)](https://coveralls.io/r/gitlabhq/gitlabhq) - [![Coverage Status](https://coveralls.io/repos/gitlabhq/gitlabhq/badge.png?branch=master)](https://coveralls.io/r/gitlabhq/gitlabhq)
### **5. Set VERSION** ### **5. Set VERSION**
Change version in VERSION to x.x.0.rc1 Change version in VERSION to `x.x.0.rc1`.
### **6. Tag** ### **6. Tag**
Create an annotated tag that points to the version change commit. Create an annotated tag that points to the version change commit:
``` ```
git tag -a vx.x.0.rc1 -m 'Version x.x.0.rc1' git tag -a vx.x.0.rc1 -m 'Version x.x.0.rc1'
``` ```
...@@ -105,6 +108,7 @@ Tweet about the RC release: ...@@ -105,6 +108,7 @@ Tweet about the RC release:
> GitLab x.x.x.rc1 is out. This is a release candidate intended for testing only. Please let us know if you find regressions. > GitLab x.x.x.rc1 is out. This is a release candidate intended for testing only. Please let us know if you find regressions.
n
### **8. Update GitLab.com** ### **8. Update GitLab.com**
Merge the RC1 code into GitLab.com. Once the build is green, deploy in the morning. Merge the RC1 code into GitLab.com. Once the build is green, deploy in the morning.
...@@ -115,28 +119,27 @@ It is important to do this as soon as possible, so we can catch any errors befor ...@@ -115,28 +119,27 @@ It is important to do this as soon as possible, so we can catch any errors befor
### **1. Prepare the blog post** ### **1. Prepare the blog post**
* Check the changelog of CE and EE for important changes. Based on [release blog template](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/doc/release_blog_template.md) fill in the important information. - Check the changelog of CE and EE for important changes. Based on [release blog template](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/doc/release_blog_template.md) fill in the important information.
* Create a WIP MR for the blog post and cc the team so everyone can give feedback. - Create a WIP MR for the blog post and cc the team so everyone can give feedback.
* Ask Dmitriy to add screenshots to the WIP MR. - Ask Dmitriy to add screenshots to the WIP MR.
* Decide with team who will be the MVP user. - Decide with team who will be the MVP user.
* Add a note if there are security fixes: This release fixes an important security issue and we advise everyone to upgrade as soon as possible. - Add a note if there are security fixes: This release fixes an important security issue and we advise everyone to upgrade as soon as possible.
### **2. Q&A** ### **2. Q&A**
Create issue on dev.gitlab.org gitlab repository, named "GitLab X.X release" in order to keep track of the progress. Create issue on dev.gitlab.org `gitlab` repository, named "GitLab X.X release" in order to keep track of the progress.
Use the omnibus packages of Enterprise Edition using [this guide](https://dev.gitlab.org/gitlab/gitlab-ee/blob/master/doc/release/manual_testing.md). Use the omnibus packages of Enterprise Edition using [this guide](https://dev.gitlab.org/gitlab/gitlab-ee/blob/master/doc/release/manual_testing.md).
**NOTE** Upgrader can only be tested when tags are pushed to all repositories. Do not forget to confirm it is working before releasing. Note that in the issue. **NOTE** Upgrader can only be tested when tags are pushed to all repositories. Do not forget to confirm it is working before releasing. Note that in the issue.
### **3. Fix anything coming out of the QA** ### **3. Fix anything coming out of the QA**
Create an issue with description of a problem, if it is quick fix fix yourself otherwise contact the team for advice. Create an issue with description of a problem, if it is quick fix fix yourself otherwise contact the team for advice.
# **22nd - Release CE and EE** # **22nd - Release CE and EE**
For GitLab EE, append -ee to the branches and tags. For GitLab EE, append `-ee` to the branches and tags.
`x-x-stable-ee` `x-x-stable-ee`
...@@ -152,25 +155,24 @@ git push <remote> x-x-stable ...@@ -152,25 +155,24 @@ git push <remote> x-x-stable
``` ```
### **2. Build the Omnibus packages** ### **2. Build the Omnibus packages**
[Follow this guide](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/release.md) [Follow this guide](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/release.md)
### **3. Set VERSION to x.x.x and push** ### **3. Set VERSION to x.x.x and push**
Change the VERSION file in `master` branch of the CE repository and commit. Change the VERSION file in `master` branch of the CE repository and commit. Cherry-pick into the `x-x-stable` branch of CE.
Cherry-pick into the `x-x-stable` branch of CE.
Change the VERSION file in `master branch of the EE repository and commit. Change the VERSION file in `master` branch of the EE repository and commit. Cherry-pick into the `x-x-stable-ee` branch of EE.
Cherry-pick into the `x-x-stable-ee` branch of EE.
### **4. Create annotated tag vx.x.x** ### **4. Create annotated tag vx.x.x**
In `x-x-stable` branch check for the sha1 of the commit with VERSION file changed. Tag that commit, In `x-x-stable` branch check for the SHA-1 of the commit with VERSION file changed. Tag that commit,
``` ```
git tag -a vx.x.0 -m 'Version x.x.0' xxxxx git tag -a vx.x.0 -m 'Version x.x.0' xxxxx
``` ```
where `xxxxx` is sha1. where `xxxxx` is SHA-1.
### **5. Push the tag** ### **5. Push the tag**
...@@ -200,7 +202,7 @@ Proposed tweet for EE "GitLab X.X.X EE is released! It brings *** <link-to-blogp ...@@ -200,7 +202,7 @@ Proposed tweet for EE "GitLab X.X.X EE is released! It brings *** <link-to-blogp
### **9. Send out newsletter** ### **9. Send out newsletter**
In mailchimp replicate the former release newsletters to customers / newsletter subscribers (these are two separate things) and modify them accordingly. In MailChimp replicate the former release newsletters to customers / newsletter subscribers (these are two separate things) and modify them accordingly.
Include a link to the blog post and keep it short. Include a link to the blog post and keep it short.
......
...@@ -4,12 +4,13 @@ NOTE: This is a guide for GitLab developers. If you are trying to install GitLab ...@@ -4,12 +4,13 @@ NOTE: This is a guide for GitLab developers. If you are trying to install GitLab
## When to do a patch release ## When to do a patch release
Do a patch release when there is a critical regression that needs to be adresses before the next monthly release. Do a patch release when there is a critical regression that needs to be addresses before the next monthly release.
Otherwise include it in the monthly release and note there was a regression fix in the release announcement. Otherwise include it in the monthly release and note there was a regression fix in the release announcement.
## Release Procedure ## Release Procedure
1. Verify that the issue can be repoduced 1. Verify that the issue can be reproduced
1. Note in the 'GitLab X.X regressions' that you will create a patch 1. Note in the 'GitLab X.X regressions' that you will create a patch
1. Create an issue on private GitLab development server 1. Create an issue on private GitLab development server
1. Name the issue "Release X.X.X CE and X.X.X EE", this will make searching easier 1. Name the issue "Release X.X.X CE and X.X.X EE", this will make searching easier
...@@ -25,5 +26,5 @@ Otherwise include it in the monthly release and note there was a regression fix ...@@ -25,5 +26,5 @@ Otherwise include it in the monthly release and note there was a regression fix
1. Apply the patch to GitLab Cloud and the private GitLab development server 1. Apply the patch to GitLab Cloud and the private GitLab development server
1. Build new packages with the latest version 1. Build new packages with the latest version
1. Cherry-pick the changelog update back into master 1. Cherry-pick the changelog update back into master
1. Send tweets about the release from @gitlabhq, tweet should include the most important feature that the release is addressing as well as the link to the changelog 1. Send tweets about the release from `@gitlabhq`, tweet should include the most important feature that the release is addressing as well as the link to the changelog
1. Note in the 'GitLab X.X regressions' issue that the patch was published 1. Note in the 'GitLab X.X regressions' issue that the patch was published
...@@ -4,46 +4,48 @@ NOTE: This is a guide for GitLab developers. If you are trying to install GitLab ...@@ -4,46 +4,48 @@ NOTE: This is a guide for GitLab developers. If you are trying to install GitLab
## When to do a security release ## 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. Do a security release when there is a critical issue that needs to be addresses 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 ## 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. 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 ## Release Procedure
1. Verify that the issue can be repoduced 1. Verify that the issue can be reproduced
1. Acknowledge the issue to the researcher that disclosed it 1. Acknowledge the issue to the researcher that disclosed it
1. Do the steps from [patch release document](doc/release/patch.md), starting with "Create an issue on private GitLab development server" 1. Do the steps from [patch release document](doc/release/patch.md), starting with "Create an issue on private GitLab development server"
1. Create feature branches for the blog post on GitLab.com and link them from the code branch 1. Create feature branches for the blog post on GitLab.com and link them from the code branch
1. Merge and publish the blog posts 1. Merge and publish the blog posts
1. Send tweets about the release from @gitlabhq 1. Send tweets about the release from `@gitlabhq`
1. Send out an email to the subscribers mailing list on MailChimp 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 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. 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. 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. 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. Thank the security researcher in an email for their cooperation
1. Update the blogpost and the CHANGELOG when we receive the CVE number 1. Update the blog post and the CHANGELOG when we receive the CVE number
The timing of the code merge into master should be coordinated in advance. 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. After the merge we strive to publish the announcements within 60 minutes.
## Blog post template ## Blog post template
XXX Security Advisory for GitLab 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. 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.
We [have|haven't|XXX|PICKSOMETHING|] heard of this vulnerability being actively exploited.
### Version affected ### Version affected
GitLab Community Edition XXX and lower GitLab Community Edition XXX and lower
GitLab Enterprise Edition XXX and lower GitLab Enterprise Edition XXX and lower
### Fixed versions ### Fixed versions
GitLab Community Edition XXX and up GitLab Community Edition XXX and up
GitLab Enterprise Edition XXX and up GitLab Enterprise Edition XXX and up
### Impact ### Impact
......
+ [Password length limits](password_length_limits.md) # Security
+ [Rack attack](rack_attack.md)
- [Password length limits](password_length_limits.md)
- [Rack attack](rack_attack.md)
# Custom password length limits # Custom password length limits
If you want to enforce longer user passwords you can create an extra Devise initializer with the steps below. If you want to enforce longer user passwords you can create an extra Devise initializer with the steps below.
If you do not use the `devise_password_length.rb` initializer the password length is set to a minimum of 8 characters in `config/initializers/devise.rb`. If you do not use the `devise_password_length.rb` initializer the password length is set to a minimum of 8 characters in `config/initializers/devise.rb`.
```bash ```bash
......
# Rack attack # Rack attack
To prevent abusive clients doing damage GitLab uses rack-attack gem. To prevent abusive clients doing damage GitLab uses rack-attack gem.
If you installed or upgraded GitLab by following the official guides this should be enabled by default. If you installed or upgraded GitLab by following the official guides this should be enabled by default.
If you are missing `config/initializers/rack_attack.rb` the following steps need to be taken in order to enable protection for your GitLab instance: If you are missing `config/initializers/rack_attack.rb` the following steps need to be taken in order to enable protection for your GitLab instance:
1. In config/application.rb find and uncomment the following line: 1. In config/application.rb find and uncomment the following line:
config.middleware.use Rack::Attack config.middleware.use Rack::Attack
2. Rename config/initializers/rack_attack.rb.example to config/initializers/rack_attack.rb
3. Review the paths_to_be_protected and add any other path you need protecting
4. Restart GitLab instance
By default, user sign-in, user sign-up(if enabled) and user password reset is limited to 6 requests per minute. 1. Rename `config/initializers/rack_attack.rb.example` to `config/initializers/rack_attack.rb`.
After trying for 6 times, client will have to wait for the next minute to be able to try again.
These settings can be found in `config/initializers/rack_attack.rb` 1. Review the `paths_to_be_protected` and add any other path you need protecting.
1. Restart GitLab instance.
By default, user sign-in, user sign-up(if enabled) and user password reset is limited to 6 requests per minute. After trying for 6 times, client will have to wait for the next minute to be able to try again. These settings can be found in `config/initializers/rack_attack.rb`
If you want more restrictive/relaxed throttle rule change the `limit` or `period` values. For example, more relaxed throttle rule will be if you set limit: 3 and period: 1.second(this will allow 3 requests per second). You can also add other paths to the protected list by adding to `paths_to_be_protected` variable. If you change any of these settings do not forget to restart your GitLab instance. If you want more restrictive/relaxed throttle rule change the `limit` or `period` values. For example, more relaxed throttle rule will be if you set limit: 3 and period: 1.second(this will allow 3 requests per second). You can also add other paths to the protected list by adding to `paths_to_be_protected` variable. If you change any of these settings do not forget to restart your GitLab instance.
......
+ [Deploy keys](deploy_keys.md) # SSH
+ [SSH](ssh.md)
- [Deploy keys](deploy_keys.md)
- [SSH](ssh.md)
...@@ -2,13 +2,8 @@ ...@@ -2,13 +2,8 @@
Deploy keys allow read-only access one or multiple projects with a single SSH key. Deploy keys allow read-only access one or multiple projects with a single SSH key.
This is really useful for cloning repositories to your Continuous Integration (CI) server. This is really useful for cloning repositories to your Continuous Integration (CI) server. By using a deploy keys you don't have to setup a dummy user account.
By using a deploy keys you don't have to setup a dummy user account.
If you are a project master or owner you can add a deploy key in the project settings under the section Deploy Keys. If you are a project master or owner you can add a deploy key in the project settings under the section Deploy Keys. Press the 'New Deploy Key' button and upload a public ssh key. After this the machine that uses the corresponding private key has read-only access to the project.
Press the 'New Deploy Key' button and upload a public ssh key.
After this the machine that uses the corresponding private key has read-only access to the project.
You can't add the same deploy key twice with the 'New Deploy Key' option. You can't add the same deploy key twice with the 'New Deploy Key' option. If you want to add the same key to another project please enable it in the list that says 'Deploy keys from projects available to you'. All the deploy keys of all the projects you have access to are available. This project access can happen through being a direct member of the project or through a group. See `def accessible_deploy_keys` in `app/models/user.rb` for more information.
If you want to add the same key to another project please enable it in the list that says 'Deploy keys from projects available to you'.
All the deploy keys of all the projects you have access to are available. This project access can happen through being a direct member of the project or through a group. See `def accessible_deploy_keys` in `app/models/user.rb` for more information.
...@@ -2,13 +2,9 @@ ...@@ -2,13 +2,9 @@
SSH key allows you to establish a secure connection between your computer and GitLab SSH key allows you to establish a secure connection between your computer and GitLab
Before generating an SSH key, check if your system already has one by running `cat ~/.ssh/id_rsa.pub` If your see a long string starting with `ssh-rsa` or `ssh-dsa`, you can skip the ssh-keygen step.
Before generating an SSH key, check if your system already has one by running `cat ~/.ssh/id_rsa.pub` To generate a new SSH key just open your terminal and use code below. The ssh-keygen command prompts you for a location and filename to store the key pair and for a password. When prompted for the location and filename you can press enter to use the default.
If your see a long string starting with `ssh-rsa` or `ssh-dsa`, you can skip the ssh-keygen step.
To generate a new SSH key just open your terminal and use code below. The ssh-keygen command prompts you for a location and filename to store the key pair and for a password.
When prompted for the location and filename you can press enter to use the default.
It is a best practice to use a password for an SSH key but it is not required and you can skip creating a password by pressing enter. It is a best practice to use a password for an SSH key but it is not required and you can skip creating a password by pressing enter.
Note that the password you choose here can't be altered or retrieved. Note that the password you choose here can't be altered or retrieved.
...@@ -22,5 +18,4 @@ Use the code below to show your public key. ...@@ -22,5 +18,4 @@ Use the code below to show your public key.
cat ~/.ssh/id_rsa.pub cat ~/.ssh/id_rsa.pub
``` ```
Copy-paste the key to the 'My SSH Keys' section under the 'SSH' tab in your user profile. Copy-paste the key to the 'My SSH Keys' section under the 'SSH' tab in your user profile. Please copy the complete key starting with `ssh-` and ending with your username and host.
Please copy the complete key starting with `ssh-` and ending with your username and host.
...@@ -4,7 +4,7 @@ Your GitLab instance can perform HTTP POST requests on the following events: `cr ...@@ -4,7 +4,7 @@ Your GitLab instance can perform HTTP POST requests on the following events: `cr
System hooks can be used, e.g. for logging or changing information in a LDAP server. System hooks can be used, e.g. for logging or changing information in a LDAP server.
#### Hooks request example: ## Hooks request example
**Project created:** **Project created:**
......
# From 2.6 to 3.0 # From 2.6 to 3.0
### 1. Stop server & resque ## 1. Stop server & resque
sudo service gitlab stop sudo service gitlab stop
### 2. Update code & db ## 2. Update code & db
```bash ```bash
...@@ -54,10 +54,8 @@ sudo -u git -H sed -i "s/\(GIT_CONFIG_KEYS\s*=>*\s*\).\{2\}/\\1'\.\*'/g" /home/g ...@@ -54,10 +54,8 @@ sudo -u git -H sed -i "s/\(GIT_CONFIG_KEYS\s*=>*\s*\).\{2\}/\\1'\.\*'/g" /home/g
# Check app status # Check app status
sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production
``` ```
## 3. Start all
### 3. Start all
sudo service gitlab start sudo service gitlab start
# From 2.9 to 3.0 # From 2.9 to 3.0
### 1. Stop server & resque ## 1. Stop server & resque
sudo service gitlab stop sudo service gitlab stop
### 2. Follow instructions ## 2. Follow instructions
```bash ```bash
...@@ -31,7 +31,6 @@ sudo -u git -H sed -i 's/\(GL_GITCONFIG_KEYS\s*=>*\s*\).\{2\}/\\1"\.\*"/g' /home ...@@ -31,7 +31,6 @@ sudo -u git -H sed -i 's/\(GL_GITCONFIG_KEYS\s*=>*\s*\).\{2\}/\\1"\.\*"/g' /home
sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production
``` ```
## 3. Start all
### 3. Start all
sudo service gitlab start sudo service gitlab start
# From 3.0 to 3.1 # From 3.0 to 3.1
__IMPORTANT!__ **IMPORTANT!**
In this release __we moved Resque jobs under own gitlab namespace__. In this release **we moved Resque jobs under own gitlab namespace**
Despite a lot of advantages it requires from our users to __replace gitolite post-receive hook with new one__. Despite a lot of advantages it requires from our users to **replace gitolite post-receive hook with new one**.
Most of projects has post-receive file as symlink to gitolite `/home/git/.gitolite/hooks/post-receive`. Most of projects has post-receive file as symlink to gitolite `/home/git/.gitolite/hooks/post-receive`. But some of them may have a real file. In this case you should rewrite it with symlink to gitolite hook.
But some of them may have a real file. In this case you should rewrite it with symlink to gitolite hook.
I wrote a bash script which will do it automatically for you. Just make sure all path inside is valid for you I wrote a bash script which will do it automatically for you. Just make sure all path inside is valid for you
- - - ## 1. Stop server & resque
### 1. Stop server & resque
sudo service gitlab stop sudo service gitlab stop
### 2. Update GitLab ## 2. Update GitLab
```bash ```bash
# Get latest code # Get latest code
sudo -u gitlab -H git fetch sudo -u gitlab -H git fetch
sudo -u gitlab -H git checkout v3.1.0 sudo -u gitlab -H git checkout v3.1.0
...@@ -35,12 +31,11 @@ sudo -u gitlab -H bundle install --without development test postgres sqlite ...@@ -35,12 +31,11 @@ sudo -u gitlab -H bundle install --without development test postgres sqlite
# Migrate db # Migrate db
sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production
``` ```
### 3. Update post-receive hooks ## 3. Update post-receive hooks
#### Gitolite 3 ### Gitolite 3
Step 1: Rewrite post-receive hook Step 1: Rewrite post-receive hook
...@@ -60,7 +55,7 @@ sudo -u gitlab -H vim lib/support/rewrite-hooks.sh ...@@ -60,7 +55,7 @@ sudo -u gitlab -H vim lib/support/rewrite-hooks.sh
sudo -u git -H lib/support/rewrite-hooks.sh sudo -u git -H lib/support/rewrite-hooks.sh
``` ```
#### Gitolite v2 ### Gitolite v2
Step 1: rewrite post-receive hook for gitolite 2 Step 1: rewrite post-receive hook for gitolite 2
...@@ -71,7 +66,6 @@ sudo chown git:git /home/git/share/gitolite/hooks/common/post-receive ...@@ -71,7 +66,6 @@ sudo chown git:git /home/git/share/gitolite/hooks/common/post-receive
Step 2: Replace symlinks in project to valid place Step 2: Replace symlinks in project to valid place
#!/bin/bash #!/bin/bash
src="/home/git/repositories" src="/home/git/repositories"
for dir in `ls "$src/"` for dir in `ls "$src/"`
...@@ -90,19 +84,13 @@ Step 2: Replace symlinks in project to valid place ...@@ -90,19 +84,13 @@ Step 2: Replace symlinks in project to valid place
fi fi
done done
## 4. Check app status
### 4. Check app status
```bash ```bash
# Check APP Status # Check APP Status
sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production
``` ```
## 5. Start all
### 5. Start all
sudo service gitlab start sudo service gitlab start
...@@ -2,25 +2,22 @@ ...@@ -2,25 +2,22 @@
## Important changes ## Important changes
* Support for SQLite was dropped - Support for SQLite was dropped
* Support for gitolite 2 was dropped - Support for Gitolite 2 was dropped
* Projects are organized in namespaces - Projects are organized in namespaces
* The GitLab post-receive hook needs to be updated - The GitLab post-receive hook needs to be updated
* The configuration file needs to be updated - The configuration file needs to be updated
* Availability of `python2` executable - Availability of `python2` executable
Most of projects has post-receive file as symlink to gitolite `/home/git/.gitolite/hooks/post-receive`. Most of projects has post-receive file as symlink to Gitolite `/home/git/.gitolite/hooks/post-receive`. But some of them may have a real file. In this case you should rewrite it with symlink to Gitolite hook.
But some of them may have a real file. In this case you should rewrite it with symlink to gitolite hook.
I wrote a bash script which will do it automatically for you. Just make sure all path inside is valid for you I wrote a bash script which will do it automatically for you. Just make sure all path inside is valid for you
- - - ## 1. Stop GitLab & Resque
### 1. Stop GitLab & Resque
sudo service gitlab stop sudo service gitlab stop
### 2. Update GitLab ## 2. Update GitLab
```bash ```bash
...@@ -43,8 +40,7 @@ sudo -u gitlab -H bundle exec rake gitlab:enable_namespaces RAILS_ENV=production ...@@ -43,8 +40,7 @@ sudo -u gitlab -H bundle exec rake gitlab:enable_namespaces RAILS_ENV=production
``` ```
### 3. Update post-receive hooks (Requires gitolite v3 ) ## 3. Update post-receive hooks (Requires Gitolite v3 )
Step 1: Rewrite post-receive hook Step 1: Rewrite post-receive hook
...@@ -63,9 +59,7 @@ sudo -u gitlab -H vim lib/support/rewrite-hooks.sh ...@@ -63,9 +59,7 @@ sudo -u gitlab -H vim lib/support/rewrite-hooks.sh
sudo -u git -H lib/support/rewrite-hooks.sh sudo -u git -H lib/support/rewrite-hooks.sh
``` ```
## 4. Replace config with new one
### 4. Replace config with new one
# backup old one # backup old one
sudo -u gitlab -H cp config/gitlab.yml config/gitlab.yml.old sudo -u gitlab -H cp config/gitlab.yml config/gitlab.yml.old
...@@ -76,9 +70,7 @@ sudo -u git -H lib/support/rewrite-hooks.sh ...@@ -76,9 +70,7 @@ sudo -u git -H lib/support/rewrite-hooks.sh
# edit it # edit it
sudo -u gitlab -H vim config/gitlab.yml sudo -u gitlab -H vim config/gitlab.yml
## 5. Disable ssh known_host check for own domain
### 5. Disable ssh known_host check for own domain
echo "Host localhost echo "Host localhost
StrictHostKeyChecking no StrictHostKeyChecking no
...@@ -88,12 +80,10 @@ sudo -u git -H lib/support/rewrite-hooks.sh ...@@ -88,12 +80,10 @@ sudo -u git -H lib/support/rewrite-hooks.sh
StrictHostKeyChecking no StrictHostKeyChecking no
UserKnownHostsFile=/dev/null" | sudo tee -a /etc/ssh/ssh_config UserKnownHostsFile=/dev/null" | sudo tee -a /etc/ssh/ssh_config
## 6. Check GitLab's status
### 6. Check GitLab's status
sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
## 7. Start GitLab & Resque
### 7. Start GitLab & Resque
sudo service gitlab start sudo service gitlab start
...@@ -2,18 +2,16 @@ ...@@ -2,18 +2,16 @@
## Important changes ## Important changes
* Resque replaced with Sidekiq - Resque replaced with Sidekiq
* New options for configuration file added - New options for configuration file added
* Init.d script should be updated - Init.d script should be updated
* __requires ruby1.9.3-p327__ - **requires ruby1.9.3-p327**
- - - ## 1. Stop GitLab & Resque
### 1. Stop GitLab & Resque
sudo service gitlab stop sudo service gitlab stop
### 2. Update GitLab ## 2. Update GitLab
```bash ```bash
# Set the working directory # Set the working directory
...@@ -31,7 +29,7 @@ sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production ...@@ -31,7 +29,7 @@ sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production
``` ```
### 3. Replace init.d script with a new one ## 3. Replace init.d script with a new one
``` ```
# backup old one # backup old one
...@@ -43,15 +41,15 @@ sudo chmod +x /etc/init.d/gitlab ...@@ -43,15 +41,15 @@ sudo chmod +x /etc/init.d/gitlab
``` ```
### 4. Check GitLab's status ## 4. Check GitLab's status
sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
### 5. Start GitLab & Sidekiq ## 5. Start GitLab & Sidekiq
sudo service gitlab start sudo service gitlab start
### 6. Remove old init.d script ## 6. Remove old init.d script
sudo rm /etc/init.d/gitlab.old sudo rm /etc/init.d/gitlab.old
# From 4.1 to 4.2 # From 4.1 to 4.2
### 1. Stop server & resque ## 1. Stop server & Resque
sudo service gitlab stop sudo service gitlab stop
### 2. Update code & db ## 2. Update code & DB
```bash ```bash
...@@ -24,15 +24,12 @@ sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production ...@@ -24,15 +24,12 @@ sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production
``` ```
## 3. Check GitLab's status
### 3. Check GitLab's status
```bash ```bash
sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
``` ```
## 4. Start all
### 4. Start all
sudo service gitlab start sudo service gitlab start
# From 4.2 to 5.0 # From 4.2 to 5.0
## Warning ## Warning
GitLab 5.0 is affected by critical security vulnerability CVE-2013-4490. GitLab 5.0 is affected by critical security vulnerability CVE-2013-4490.
## Important changes ## Important changes
* We don't use `gitlab` user any more. Everything will be moved to `git` user - We don't use `gitlab` user any more. Everything will be moved to `git` user
* __requires ruby1.9.3__ - **requires ruby1.9.3**
__0. Stop gitlab__ ## 0. Stop gitlab
sudo service gitlab stop sudo service gitlab stop
__1. add bash to git user__ ## 1. add bash to git user
``` ```
sudo chsh -s /bin/bash git sudo chsh -s /bin/bash git
``` ```
__2. git clone gitlab-shell__ ## 2. git clone gitlab-shell
``` ```
cd /home/git/ cd /home/git/
sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git /home/git/gitlab-shell sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git /home/git/gitlab-shell
``` ```
__3. setup gitlab-shell__ ## 3. setup gitlab-shell
```bash ```bash
# chmod all repos and files under git # chmod all repos and files under git
...@@ -55,7 +55,7 @@ ruby -v ...@@ -55,7 +55,7 @@ ruby -v
exit exit
``` ```
__4. Copy gitlab instance to git user__ ## 4. Copy gitlab instance to git user
```bash ```bash
sudo cp -R /home/gitlab/gitlab /home/git/gitlab sudo cp -R /home/gitlab/gitlab /home/git/gitlab
...@@ -66,7 +66,7 @@ sudo rm -rf /home/gitlab/gitlab-satellites ...@@ -66,7 +66,7 @@ sudo rm -rf /home/gitlab/gitlab-satellites
sudo rm /tmp/gitlab.socket sudo rm /tmp/gitlab.socket
``` ```
__5. Update gitlab to recent version__ ## 5. Update gitlab to recent version
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -110,7 +110,7 @@ sudo chmod -R u+rwX /home/git/gitlab/tmp/pids ...@@ -110,7 +110,7 @@ sudo chmod -R u+rwX /home/git/gitlab/tmp/pids
``` ```
__6. Update init.d script and nginx config__ ## 6. Update init.d script and nginx config
```bash ```bash
# init.d # init.d
...@@ -127,14 +127,11 @@ sudo -u git -H cp /home/git/gitlab/config/unicorn.rb.example /home/git/gitlab/co ...@@ -127,14 +127,11 @@ sudo -u git -H cp /home/git/gitlab/config/unicorn.rb.example /home/git/gitlab/co
sudo vim /etc/nginx/sites-enabled/gitlab sudo vim /etc/nginx/sites-enabled/gitlab
sudo service nginx restart sudo service nginx restart
``` ```
__7. Start gitlab instance__ ## 7. Start GitLab instance
``` ```
sudo service gitlab start sudo service gitlab start
# check if unicorn and sidekiq started # check if unicorn and sidekiq started
...@@ -145,7 +142,7 @@ ps aux | grep sidekiq ...@@ -145,7 +142,7 @@ ps aux | grep sidekiq
``` ```
__8. Check installation__ ## 8. Check installation
```bash ```bash
...@@ -164,5 +161,4 @@ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production ...@@ -164,5 +161,4 @@ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
``` ```
**P.S. If everything works as expected you can remove gitlab user from system**
__P.S. If everything works as expected you can remove gitlab user from system__
# From 5.0 to 5.1 # From 5.0 to 5.1
## Warning ## Warning
GitLab 5.1 is affected by critical security vulnerability CVE-2013-4490. GitLab 5.1 is affected by critical security vulnerability CVE-2013-4490.
## Release notes: ## Release notes
* `unicorn` replaced with `puma` - `unicorn` replaced with `puma`
* merge request cached diff will be truncated - merge request cached diff will be truncated
### 1. Stop server ## 1. Stop server
sudo service gitlab stop sudo service gitlab stop
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -20,7 +21,7 @@ sudo -u git -H git fetch ...@@ -20,7 +21,7 @@ sudo -u git -H git fetch
sudo -u git -H git checkout 5-1-stable sudo -u git -H git checkout 5-1-stable
``` ```
### 3. Update gitlab-shell ## 3. Update gitlab-shell
```bash ```bash
cd /home/git/gitlab-shell cd /home/git/gitlab-shell
...@@ -33,8 +34,7 @@ sudo -u git -H cp config.yml.example config.yml ...@@ -33,8 +34,7 @@ sudo -u git -H cp config.yml.example config.yml
sudo -u git -H vi config.yml sudo -u git -H vi config.yml
``` ```
## 4. Install libs, migrations etc
### 4. Install libs, migrations etc
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -47,7 +47,7 @@ sudo -u git -H bundle exec rake migrate_merge_requests RAILS_ENV=production ...@@ -47,7 +47,7 @@ sudo -u git -H bundle exec rake migrate_merge_requests RAILS_ENV=production
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
``` ```
### 5. Update init.d script with a new one ## 5. Update init.d script with a new one
```bash ```bash
# init.d # init.d
...@@ -56,9 +56,9 @@ sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-rec ...@@ -56,9 +56,9 @@ sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-rec
sudo chmod +x /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab
``` ```
### 6. Mysql grant privileges ## 6. MySQL grant privileges
Only if you are using mysql: Only if you are using MySQL:
```bash ```bash
mysql -u root -p mysql -u root -p
...@@ -66,6 +66,6 @@ mysql> GRANT LOCK TABLES ON `gitlabhq_production`.* TO 'gitlab'@'localhost'; ...@@ -66,6 +66,6 @@ mysql> GRANT LOCK TABLES ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
mysql> \q mysql> \q
``` ```
### 7. Start application ## 7. Start application
sudo service gitlab start sudo service gitlab start
# From 5.1 to 5.2 # From 5.1 to 5.2
## Warning ## Warning
GitLab 5.2 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. GitLab 5.2 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489.
### 0. Backup ## 0. Backup
It's useful to make a backup just in case things go south: 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) (With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
...@@ -13,11 +14,11 @@ cd /home/git/gitlab ...@@ -13,11 +14,11 @@ cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
### 1. Stop server ## 1. Stop server
sudo service gitlab stop sudo service gitlab stop
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -25,7 +26,7 @@ sudo -u git -H git fetch ...@@ -25,7 +26,7 @@ sudo -u git -H git fetch
sudo -u git -H git checkout 5-2-stable sudo -u git -H git checkout 5-2-stable
``` ```
### 3. Update gitlab-shell ## 3. Update gitlab-shell
```bash ```bash
cd /home/git/gitlab-shell cd /home/git/gitlab-shell
...@@ -33,7 +34,7 @@ sudo -u git -H git fetch ...@@ -33,7 +34,7 @@ sudo -u git -H git fetch
sudo -u git -H git checkout v1.4.0 sudo -u git -H git checkout v1.4.0
``` ```
### 4. Install libs, migrations, etc. ## 4. Install libs, migrations, etc.
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -49,12 +50,12 @@ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production ...@@ -49,12 +50,12 @@ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
``` ```
### 5. Update config files ## 5. Update config files
* 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/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. - 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 ## 6. Update Init script
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -63,7 +64,7 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab ...@@ -63,7 +64,7 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab
``` ```
### 7. Create uploads directory ## 7. Create uploads directory
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -71,12 +72,12 @@ sudo -u git -H mkdir public/uploads ...@@ -71,12 +72,12 @@ sudo -u git -H mkdir public/uploads
sudo chmod -R u+rwX public/uploads sudo chmod -R u+rwX public/uploads
``` ```
### 8. Start application ## 8. Start application
sudo service gitlab start sudo service gitlab start
sudo service nginx restart sudo service nginx restart
### 9. Check application status ## 9. Check application status
Check if GitLab and its environment are configured correctly: Check if GitLab and its environment are configured correctly:
...@@ -91,10 +92,10 @@ If all items are green, then congratulations upgrade complete! ...@@ -91,10 +92,10 @@ If all items are green, then congratulations upgrade complete!
## Things went south? Revert to previous version (5.1) ## Things went south? Revert to previous version (5.1)
### 1. Revert the code to the previous version ### 1. Revert the code to the previous version
Follow the [`upgrade guide from 5.0 to 5.1`](5.0-to-5.1.md), except for the database migration
(The backup is already migrated to the previous version)
### 2. Restore from the backup: Follow the [`upgrade guide from 5.0 to 5.1`](5.0-to-5.1.md), except for the database migration (the backup is already migrated to the previous version).
### 2. Restore from the backup
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
......
# From 5.1 to 5.4 # From 5.1 to 5.4
Also works starting from 5.2. Also works starting from 5.2.
### 0. Backup ## 0. Backup
It's useful to make a backup just in case things go south: 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):
(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
### 1. Stop server ## 1. Stop server
sudo service gitlab stop sudo service gitlab stop
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -23,7 +23,7 @@ sudo -u git -H git fetch ...@@ -23,7 +23,7 @@ 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 sudo -u git -H git checkout 5-4-stable # Latest version of 5-4-stable addresses CVE-2013-4489
``` ```
### 3. Update gitlab-shell ## 3. Update gitlab-shell
```bash ```bash
cd /home/git/gitlab-shell cd /home/git/gitlab-shell
...@@ -31,7 +31,7 @@ sudo -u git -H git fetch ...@@ -31,7 +31,7 @@ sudo -u git -H git fetch
sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities
``` ```
### 4. Install libs, migrations, etc. ## 4. Install libs, migrations, etc.
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -47,12 +47,12 @@ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production ...@@ -47,12 +47,12 @@ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
``` ```
### 5. Update config files ## 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/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. - 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 ## 6. Update Init script
```bash ```bash
sudo rm /etc/init.d/gitlab sudo rm /etc/init.d/gitlab
...@@ -60,7 +60,7 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab ...@@ -60,7 +60,7 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab
``` ```
### 7. Create uploads directory ## 7. Create uploads directory
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -68,13 +68,12 @@ sudo -u git -H mkdir public/uploads ...@@ -68,13 +68,12 @@ sudo -u git -H mkdir public/uploads
sudo chmod -R u+rwX public/uploads sudo chmod -R u+rwX public/uploads
``` ```
## 8. Start application
### 8. Start application
sudo service gitlab start sudo service gitlab start
sudo service nginx restart sudo service nginx restart
### 9. Check application status ## 9. Check application status
Check if GitLab and its environment are configured correctly: Check if GitLab and its environment are configured correctly:
...@@ -89,8 +88,8 @@ If all items are green, then congratulations upgrade complete! ...@@ -89,8 +88,8 @@ If all items are green, then congratulations upgrade complete!
## Things went south? Revert to previous version (5.3) ## Things went south? Revert to previous version (5.3)
### 1. Revert the code to the previous version ### 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) 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: ### 2. Restore from the backup:
......
# From 5.1 to 6.0 # From 5.1 to 6.0
## Warning ## Warning
GitLab 6.0 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. GitLab 6.0 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489.
### Deprecations ## Deprecations
#### Global projects ### Global projects
The root (global) namespace for projects is deprecated. The root (global) namespace for projects is deprecated.
So you need to move all your global projects under groups or users manually before update or they will be automatically moved to the project owner namespace during the update. When a project is moved all its members will receive an email with instructions how to update their git remote url. Please make sure you disable sending email when you do a test of the upgrade.
#### Teams So you need to move all your global projects under groups or users manually before update or they will be automatically moved to the project owner namespace during the update. When a project is moved all its members will receive an email with instructions how to update their git remote URL. Please make sure you disable sending email when you do a test of the upgrade.
### Teams
We introduce group membership in 6.0 as a replacement for teams. We introduce group membership in 6.0 as a replacement for teams.
The old combination of groups and teams was confusing for a lot of people. The old combination of groups and teams was confusing for a lot of people.
And when the members of a team where changed this wasn't reflected in the project permissions. And when the members of a team where changed this wasn't reflected in the project permissions.
In GitLab 6.0 you will be able to add members to a group with a permission level for each member. In GitLab 6.0 you will be able to add members to a group with a permission level for each member.
These group members will have access to the projects in that group. These group members will have access to the projects in that group.
Any changes to group members will immediately be reflected in the project permissions. Any changes to group members will immediately be reflected in the project permissions.
You can even have multiple owners for a group, greatly simplifying administration. You can even have multiple owners for a group, greatly simplifying administration.
### 0. Backup ## 0. Backup
It's useful to make a backup just in case things go south: 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) (With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
...@@ -30,11 +38,11 @@ cd /home/git/gitlab ...@@ -30,11 +38,11 @@ cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
### 1. Stop server ## 1. Stop server
sudo service gitlab stop sudo service gitlab stop
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -42,7 +50,7 @@ sudo -u git -H git fetch ...@@ -42,7 +50,7 @@ sudo -u git -H git fetch
sudo -u git -H git checkout 6-0-stable sudo -u git -H git checkout 6-0-stable
``` ```
### 3. Update gitlab-shell ## 3. Update gitlab-shell
```bash ```bash
cd /home/git/gitlab-shell cd /home/git/gitlab-shell
...@@ -50,14 +58,14 @@ sudo -u git -H git fetch ...@@ -50,14 +58,14 @@ sudo -u git -H git fetch
sudo -u git -H git checkout v1.7.9 sudo -u git -H git checkout v1.7.9
``` ```
### 4. Install additional packages ## 4. Install additional packages
```bash ```bash
# For reStructuredText markup language support install required package: # For reStructuredText markup language support install required package:
sudo apt-get install python-docutils sudo apt-get install python-docutils
``` ```
### 5. Install libs, migrations, etc. ## 5. Install libs, migrations, etc.
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -83,14 +91,14 @@ sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production ...@@ -83,14 +91,14 @@ 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 assets:precompile RAILS_ENV=production
``` ```
### 6. Update config files ## 6. Update config files
Note: We switched from Puma in GitLab 5.x to unicorn in GitLab 6.0. 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://gitlab.com/gitlab-org/gitlab-ce/blob/masterconfig/gitlab.yml.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. - 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 ## 7. Update Init script
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -99,7 +107,7 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab ...@@ -99,7 +107,7 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab
``` ```
### 8. Create uploads directory ## 8. Create uploads directory
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -107,12 +115,12 @@ sudo -u git -H mkdir -p public/uploads ...@@ -107,12 +115,12 @@ sudo -u git -H mkdir -p public/uploads
sudo chmod -R u+rwX public/uploads sudo chmod -R u+rwX public/uploads
``` ```
### 9. Start application ## 9. Start application
sudo service gitlab start sudo service gitlab start
sudo service nginx restart sudo service nginx restart
### 10. Check application status ## 10. Check application status
Check if GitLab and its environment are configured correctly: Check if GitLab and its environment are configured correctly:
...@@ -127,8 +135,8 @@ If all items are green, then congratulations upgrade complete! ...@@ -127,8 +135,8 @@ If all items are green, then congratulations upgrade complete!
## Things went south? Revert to previous version (5.1) ## Things went south? Revert to previous version (5.1)
### 1. Revert the code to the previous version ### 1. Revert the code to the previous version
Follow the [`upgrade guide from 5.0 to 5.1`](5.0-to-5.1.md), except for the database migration
(The backup is already migrated to the previous version) Follow the [`upgrade guide from 5.0 to 5.1`](5.0-to-5.1.md), except for the database migration (the backup is already migrated to the previous version).
### 2. Restore from the backup: ### 2. Restore from the backup:
...@@ -137,20 +145,24 @@ cd /home/git/gitlab ...@@ -137,20 +145,24 @@ cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
``` ```
### Troubleshooting ## Troubleshooting
The migrations in this update are very sensitive to incomplete or inconsistent data. If you have a long-running GitLab installation and some of the previous upgrades did not work out 100% correct this may bite you now. The following commands can be run in the rails console to look for 'bad' data. The migrations in this update are very sensitive to incomplete or inconsistent data. If you have a long-running GitLab installation and some of the previous upgrades did not work out 100% correct this may bite you now. The following commands can be run in the rails console to look for 'bad' data.
All project owners should have an owner All project owners should have an owner:
``` ```
Project.all.select { |project| project.owner.blank? } Project.all.select { |project| project.owner.blank? }
``` ```
Every user should have a namespace Every user should have a namespace:
``` ```
User.all.select { |u| u.namespace.blank? } User.all.select { |u| u.namespace.blank? }
``` ```
Projects in the global namespace should not conflict with projects in the owner namespace Projects in the global namespace should not conflict with projects in the owner namespace:
``` ```
Project.where(namespace_id: nil).select { |p| Project.where(path: p.path, namespace_id: p.owner.try(:namespace).try(:id)).present? } Project.where(namespace_id: nil).select { |p| Project.where(path: p.path, namespace_id: p.owner.try(:namespace).try(:id)).present? }
``` ```
# From 5.2 to 5.3 # From 5.2 to 5.3
## Warning ## Warning
GitLab 5.3 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. GitLab 5.3 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489.
### 0. Backup ## 0. Backup
It's useful to make a backup just in case things go south: 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):
(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
### 1. Stop server ## 1. Stop server
sudo service gitlab stop sudo service gitlab stop
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -25,7 +25,7 @@ sudo -u git -H git fetch ...@@ -25,7 +25,7 @@ sudo -u git -H git fetch
sudo -u git -H git checkout 5-3-stable sudo -u git -H git checkout 5-3-stable
``` ```
### 3. Install libs, migrations, etc. ## 3. Install libs, migrations, etc.
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -41,12 +41,12 @@ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production ...@@ -41,12 +41,12 @@ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
``` ```
### 4. Update config files ## 4. Update config files
* 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/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. - 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 ## 5. Update Init script
```bash ```bash
sudo rm /etc/init.d/gitlab sudo rm /etc/init.d/gitlab
...@@ -54,12 +54,12 @@ sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5 ...@@ -54,12 +54,12 @@ sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5
sudo chmod +x /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab
``` ```
### 6. Start application ## 6. Start application
sudo service gitlab start sudo service gitlab start
sudo service nginx restart sudo service nginx restart
### 7. Check application status ## 7. Check application status
Check if GitLab and its environment are configured correctly: Check if GitLab and its environment are configured correctly:
...@@ -74,8 +74,8 @@ If all items are green, then congratulations upgrade complete! ...@@ -74,8 +74,8 @@ If all items are green, then congratulations upgrade complete!
## Things went south? Revert to previous version (5.2) ## Things went south? Revert to previous version (5.2)
### 1. Revert the code to the previous version ### 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) 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: ### 2. Restore from the backup:
......
# From 5.3 to 5.4 # From 5.3 to 5.4
### 0. Backup ## 0. Backup
It's useful to make a backup just in case things go south: 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):
(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
### 1. Stop server ## 1. Stop server
sudo service gitlab stop sudo service gitlab stop
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -22,7 +21,7 @@ sudo -u git -H git fetch ...@@ -22,7 +21,7 @@ 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 sudo -u git -H git checkout 5-4-stable # Latest version of 5-4-stable addresses CVE-2013-4489
``` ```
### 3. Update gitlab-shell ## 3. Update gitlab-shell
```bash ```bash
cd /home/git/gitlab-shell cd /home/git/gitlab-shell
...@@ -30,7 +29,7 @@ sudo -u git -H git fetch ...@@ -30,7 +29,7 @@ sudo -u git -H git fetch
sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities
``` ```
### 4. Install libs, migrations, etc. ## 4. Install libs, migrations, etc.
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -46,12 +45,12 @@ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production ...@@ -46,12 +45,12 @@ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
``` ```
### 5. Update config files ## 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/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. - 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 ## 6. Update Init script
```bash ```bash
sudo rm /etc/init.d/gitlab sudo rm /etc/init.d/gitlab
...@@ -59,12 +58,12 @@ sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5 ...@@ -59,12 +58,12 @@ sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5
sudo chmod +x /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab
``` ```
### 7. Start application ## 7. Start application
sudo service gitlab start sudo service gitlab start
sudo service nginx restart sudo service nginx restart
### 8. Check application status ## 8. Check application status
Check if GitLab and its environment are configured correctly: Check if GitLab and its environment are configured correctly:
...@@ -79,8 +78,8 @@ If all items are green, then congratulations upgrade complete! ...@@ -79,8 +78,8 @@ If all items are green, then congratulations upgrade complete!
## Things went south? Revert to previous version (5.3) ## Things went south? Revert to previous version (5.3)
### 1. Revert the code to the previous version ### 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) 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: ### 2. Restore from the backup:
......
# From 5.4 to 6.0 # From 5.4 to 6.0
## Warning ## Warning
GitLab 6.0 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. GitLab 6.0 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489.
### Deprecations ## Deprecations
#### Global projects ### Global projects
The root (global) namespace for projects is deprecated. The root (global) namespace for projects is deprecated.
So you need to move all your global projects under groups or users manually before update or they will be automatically moved to the project owner namespace during the update. When a project is moved all its members will receive an email with instructions how to update their git remote url. Please make sure you disable sending email when you do a test of the upgrade. So you need to move all your global projects under groups or users manually before update or they will be automatically moved to the project owner namespace during the update. When a project is moved all its members will receive an email with instructions how to update their git remote url. Please make sure you disable sending email when you do a test of the upgrade.
#### Teams ### Teams
We introduce group membership in 6.0 as a replacement for teams. We introduce group membership in 6.0 as a replacement for teams.
The old combination of groups and teams was confusing for a lot of people. The old combination of groups and teams was confusing for a lot of people.
And when the members of a team where changed this wasn't reflected in the project permissions. And when the members of a team where changed this wasn't reflected in the project permissions.
In GitLab 6.0 you will be able to add members to a group with a permission level for each member. In GitLab 6.0 you will be able to add members to a group with a permission level for each member.
These group members will have access to the projects in that group. These group members will have access to the projects in that group.
Any changes to group members will immediately be reflected in the project permissions. Any changes to group members will immediately be reflected in the project permissions.
You can even have multiple owners for a group, greatly simplifying administration. You can even have multiple owners for a group, greatly simplifying administration.
### 0. Backup ## 0. Backup
It's useful to make a backup just in case things go south: 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):
(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
### 1. Stop server ## 1. Stop server
sudo service gitlab stop sudo service gitlab stop
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -42,7 +49,7 @@ sudo -u git -H git fetch ...@@ -42,7 +49,7 @@ sudo -u git -H git fetch
sudo -u git -H git checkout 6-0-stable sudo -u git -H git checkout 6-0-stable
``` ```
### 3. Update gitlab-shell ## 3. Update gitlab-shell
```bash ```bash
cd /home/git/gitlab-shell cd /home/git/gitlab-shell
...@@ -50,14 +57,14 @@ sudo -u git -H git fetch ...@@ -50,14 +57,14 @@ sudo -u git -H git fetch
sudo -u git -H git checkout v1.7.9 sudo -u git -H git checkout v1.7.9
``` ```
### 4. Install additional packages ## 4. Install additional packages
```bash ```bash
# For reStructuredText markup language support install required package: # For reStructuredText markup language support install required package:
sudo apt-get install python-docutils sudo apt-get install python-docutils
``` ```
### 5. Install libs, migrations, etc. ## 5. Install libs, migrations, etc.
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -83,14 +90,14 @@ sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production ...@@ -83,14 +90,14 @@ 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 assets:precompile RAILS_ENV=production
``` ```
### 6. Update config files ## 6. Update config files
Note: We switched from Puma in GitLab 5.4 to unicorn in GitLab 6.0. 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://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example but with your settings. - Make `/home/git/gitlab/config/gitlab.yml` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/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/master/config/unicorn.rb.example but with your settings. - Make `/home/git/gitlab/config/unicorn.rb` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/unicorn.rb.example but with your settings.
### 7. Update Init script ## 7. Update Init script
```bash ```bash
sudo rm /etc/init.d/gitlab sudo rm /etc/init.d/gitlab
...@@ -98,12 +105,12 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab ...@@ -98,12 +105,12 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab
``` ```
### 8. Start application ## 8. Start application
sudo service gitlab start sudo service gitlab start
sudo service nginx restart sudo service nginx restart
### 9. Check application status ## 9. Check application status
Check if GitLab and its environment are configured correctly: Check if GitLab and its environment are configured correctly:
...@@ -115,20 +122,24 @@ To make sure you didn't miss anything run a more thorough check with: ...@@ -115,20 +122,24 @@ To make sure you didn't miss anything run a more thorough check with:
If all items are green, then congratulations upgrade complete! If all items are green, then congratulations upgrade complete!
### Troubleshooting ## Troubleshooting
The migrations in this update are very sensitive to incomplete or inconsistent data. If you have a long-running GitLab installation and some of the previous upgrades did not work out 100% correct this may bite you now. The following commands can be run in the rails console to look for 'bad' data. The migrations in this update are very sensitive to incomplete or inconsistent data. If you have a long-running GitLab installation and some of the previous upgrades did not work out 100% correct this may bite you now. The following commands can be run in the rails console to look for 'bad' data.
All project owners should have an owner All project owners should have an owner:
``` ```
Project.all.select { |project| project.owner.blank? } Project.all.select { |project| project.owner.blank? }
``` ```
Every user should have a namespace Every user should have a namespace:
``` ```
User.all.select { |u| u.namespace.blank? } User.all.select { |u| u.namespace.blank? }
``` ```
Projects in the global namespace should not conflict with projects in the owner namespace Projects in the global namespace should not conflict with projects in the owner namespace:
``` ```
Project.where(namespace_id: nil).select { |p| Project.where(path: p.path, namespace_id: p.owner.try(:namespace).try(:id)).present? } Project.where(namespace_id: nil).select { |p| Project.where(path: p.path, namespace_id: p.owner.try(:namespace).try(:id)).present? }
``` ```
# From 6.0 to 6.1 # From 6.0 to 6.1
## Warning ## Warning
GitLab 6.1 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. GitLab 6.1 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489.
# In 6.1 we remove a lot of deprecated code. **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.
**You should update to 6.0 before installing 6.1 so all the necessary conversions are run.**
### Deprecations ## Deprecations
#### Global issue numbers ### Global issue numbers
In 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. In 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 ## 0. Backup
It's useful to make a backup just in case things go south: 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):
(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
### 1. Stop server ## 1. Stop server
sudo service gitlab stop sudo service gitlab stop
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -35,7 +36,7 @@ sudo -u git -H git checkout 6-1-stable ...@@ -35,7 +36,7 @@ sudo -u git -H git checkout 6-1-stable
# For GitLab Enterprise Edition: sudo -u git -H git checkout 6-1-stable-ee # For GitLab Enterprise Edition: sudo -u git -H git checkout 6-1-stable-ee
``` ```
### 3. Update gitlab-shell ## 3. Update gitlab-shell
```bash ```bash
cd /home/git/gitlab-shell cd /home/git/gitlab-shell
...@@ -43,7 +44,7 @@ sudo -u git -H git fetch ...@@ -43,7 +44,7 @@ sudo -u git -H git fetch
sudo -u git -H git checkout v1.7.9 sudo -u git -H git checkout v1.7.9
``` ```
### 4. Install libs, migrations, etc. ## 4. Install libs, migrations, etc.
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -62,12 +63,12 @@ sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production ...@@ -62,12 +63,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 sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
``` ```
### 5. Update config files ## 5. Update config files
* 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/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. - 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 ## 6. Update Init script
```bash ```bash
sudo rm /etc/init.d/gitlab sudo rm /etc/init.d/gitlab
...@@ -75,12 +76,12 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab ...@@ -75,12 +76,12 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab
``` ```
### 7. Start application ## 7. Start application
sudo service gitlab start sudo service gitlab start
sudo service nginx restart sudo service nginx restart
### 8. Check application status ## 8. Check application status
Check if GitLab and its environment are configured correctly: Check if GitLab and its environment are configured correctly:
...@@ -96,8 +97,8 @@ If all items are green, then congratulations upgrade complete! ...@@ -96,8 +97,8 @@ If all items are green, then congratulations upgrade complete!
## Things went south? Revert to previous version (6.0) ## Things went south? Revert to previous version (6.0)
### 1. Revert the code to the previous version ### 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) 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: ### 2. Restore from the backup:
......
# From 6.0 to 6.8 # From 6.0 to 6.8
# In 6.1 we remove a lot of deprecated code. **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 **You should update to 6.0 before installing 6.1 or higher so all the necessary conversions are run.**
#### Global issue numbers ## Deprecations
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. ## Global issue numbers
### 0. Backup 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: 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) (With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
...@@ -19,18 +20,18 @@ cd /home/git/gitlab ...@@ -19,18 +20,18 @@ cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
### 1. Stop server ## 1. Stop server
sudo service gitlab stop sudo service gitlab stop
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
sudo -u git -H git fetch --all sudo -u git -H git fetch --all
``` ```
For Gitlab Community Edition: For GitLab Community Edition:
```bash ```bash
sudo -u git -H git checkout 6-8-stable sudo -u git -H git checkout 6-8-stable
...@@ -45,14 +46,14 @@ sudo -u git -H git checkout 6-8-stable-ee ...@@ -45,14 +46,14 @@ sudo -u git -H git checkout 6-8-stable-ee
``` ```
### 3. Install additional packages ## 3. Install additional packages
```bash ```bash
# Add support for lograte for better log file handling # Add support for lograte for better log file handling
sudo apt-get install logrotate sudo apt-get install logrotate
``` ```
### 4. Update gitlab-shell ## 4. Update gitlab-shell
```bash ```bash
cd /home/git/gitlab-shell cd /home/git/gitlab-shell
...@@ -60,7 +61,7 @@ sudo -u git -H git fetch ...@@ -60,7 +61,7 @@ sudo -u git -H git fetch
sudo -u git -H git checkout v1.9.3 # Addresses multiple critical security vulnerabilities sudo -u git -H git checkout v1.9.3 # Addresses multiple critical security vulnerabilities
``` ```
### 5. Install libs, migrations, etc. ## 5. Install libs, migrations, etc.
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -85,7 +86,7 @@ sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS ...@@ -85,7 +86,7 @@ sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS
sudo chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites sudo chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites
``` ```
### 6. Update config files ## 6. Update config files
TIP: to see what changed in gitlab.yml.example in this release use next command: TIP: to see what changed in gitlab.yml.example in this release use next command:
...@@ -108,18 +109,18 @@ sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers ...@@ -108,18 +109,18 @@ sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers
sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
``` ```
### 7. Update Init script ## 7. Update Init script
```bash ```bash
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
``` ```
### 8. Start application ## 8. Start application
sudo service gitlab start sudo service gitlab start
sudo service nginx restart sudo service nginx restart
### 9. Check application status ## 9. Check application status
Check if GitLab and its environment are configured correctly: Check if GitLab and its environment are configured correctly:
...@@ -135,8 +136,8 @@ If all items are green, then congratulations upgrade complete! ...@@ -135,8 +136,8 @@ If all items are green, then congratulations upgrade complete!
## Things went south? Revert to previous version (6.0) ## Things went south? Revert to previous version (6.0)
### 1. Revert the code to the previous version ### 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) 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: ### 2. Restore from the backup:
...@@ -146,4 +147,5 @@ sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production ...@@ -146,4 +147,5 @@ sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
``` ```
## Login issues after upgrade? ## Login issues after upgrade?
If running in https mode, be sure to read [Can't Verify csrf token authenticity](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide#cant-verify-csrf-token-authenticitycant-get-past-login-pageredirected-to-login-page)
If running in HTTPS mode, be sure to read [Can't Verify CSRF token authenticity](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide#cant-verify-csrf-token-authenticitycant-get-past-login-pageredirected-to-login-page)
# From 6.1 to 6.2 # From 6.1 to 6.2
# You should update to 6.1 before installing 6.2 so all the necessary conversions are run. **You should update to 6.1 before installing 6.2 so all the necessary conversions are run.**
### 0. Backup ## 0. Backup
It's useful to make a backup just in case things go south: 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).
(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
### 1. Stop server ## 1. Stop server
sudo service gitlab stop sudo service gitlab stop
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -25,7 +24,7 @@ sudo -u git -H git checkout 6-2-stable # Latest version of 6-2-stable addresses ...@@ -25,7 +24,7 @@ sudo -u git -H git checkout 6-2-stable # Latest version of 6-2-stable addresses
# For GitLab Enterprise Edition: sudo -u git -H git checkout 6-2-stable-ee # For GitLab Enterprise Edition: sudo -u git -H git checkout 6-2-stable-ee
``` ```
### 3. Update gitlab-shell ## 3. Update gitlab-shell
```bash ```bash
cd /home/git/gitlab-shell cd /home/git/gitlab-shell
...@@ -33,14 +32,14 @@ sudo -u git -H git fetch ...@@ -33,14 +32,14 @@ sudo -u git -H git fetch
sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities
``` ```
### 4. Install additional packages ## 4. Install additional packages
```bash ```bash
# Add support for lograte for better log file handling # Add support for lograte for better log file handling
sudo apt-get install logrotate sudo apt-get install logrotate
``` ```
### 5. Install libs, migrations, etc. ## 5. Install libs, migrations, etc.
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -58,29 +57,33 @@ sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production ...@@ -58,29 +57,33 @@ sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
``` ```
### 6. Update config files ## 6. Update config files
TIP: to see what changed in gitlab.yml.example in this release use next command: 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 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://gitlab.com/gitlab-org/gitlab-ce/blob/6-2-stable/config/gitlab.yml.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 - 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.
sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
``` - Copy rack attack middleware config:
* Uncomment `config.middleware.use Rack::Attack` in `/home/git/gitlab/config/application.rb`
* Set up logrotate ```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 ```bash
sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
``` ```
### 7. Update Init script ## 7. Update Init script
```bash ```bash
sudo rm /etc/init.d/gitlab sudo rm /etc/init.d/gitlab
...@@ -88,12 +91,12 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab ...@@ -88,12 +91,12 @@ sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab
``` ```
### 8. Start application ## 8. Start application
sudo service gitlab start sudo service gitlab start
sudo service nginx restart sudo service nginx restart
### 9. Check application status ## 9. Check application status
Check if GitLab and its environment are configured correctly: Check if GitLab and its environment are configured correctly:
...@@ -108,8 +111,8 @@ If all items are green, then congratulations upgrade complete! ...@@ -108,8 +111,8 @@ If all items are green, then congratulations upgrade complete!
## Things went south? Revert to previous version (6.1) ## Things went south? Revert to previous version (6.1)
### 1. Revert the code to the previous version ### 1. Revert the code to the previous version
Follow the [`upgrade guide from 6.0 to 6.1`](6.0-to-6.1.md), except for the database migration
(The backup is already migrated to the previous version) Follow the [`upgrade guide from 6.0 to 6.1`](6.0-to-6.1.md), except for the database migration (the backup is already migrated to the previous version).
### 2. Restore from the backup: ### 2. Restore from the backup:
......
# From 6.2 to 6.3 # From 6.2 to 6.3
## Requires version: 6.1 or 6.2 **Requires version: 6.1 or 6.2.**
### 0. Backup ## 0. Backup
It's useful to make a backup just in case things go south: 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)
(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
### 1. Stop server ## 1. Stop server
sudo service gitlab stop sudo service gitlab stop
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -25,7 +24,7 @@ sudo -u git -H git checkout 6-3-stable ...@@ -25,7 +24,7 @@ sudo -u git -H git checkout 6-3-stable
# For GitLab Enterprise Edition: sudo -u git -H git checkout 6-3-stable-ee # For GitLab Enterprise Edition: sudo -u git -H git checkout 6-3-stable-ee
``` ```
### 3. Update gitlab-shell (and its config) ## 3. Update gitlab-shell (and its config)
```bash ```bash
cd /home/git/gitlab-shell cd /home/git/gitlab-shell
...@@ -33,9 +32,9 @@ sudo -u git -H git fetch ...@@ -33,9 +32,9 @@ sudo -u git -H git fetch
sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities 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 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. ## 4. Install libs, migrations, etc.
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -54,7 +53,7 @@ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production ...@@ -54,7 +53,7 @@ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
``` ```
### 5. Update config files ## 5. Update config files
TIP: to see what changed in gitlab.yml.example in this release use next command: TIP: to see what changed in gitlab.yml.example in this release use next command:
...@@ -62,8 +61,8 @@ TIP: to see what changed in gitlab.yml.example in this release use next command: ...@@ -62,8 +61,8 @@ 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 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/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. - 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 ```bash
# Copy rack attack middleware config # Copy rack attack middleware config
...@@ -71,19 +70,19 @@ cd /home/git/gitlab ...@@ -71,19 +70,19 @@ cd /home/git/gitlab
sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
``` ```
### 6. Update Init script ## 6. Update Init script
```bash ```bash
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab
``` ```
### 7. Start application ## 7. Start application
sudo service gitlab start sudo service gitlab start
sudo service nginx restart sudo service nginx restart
### 8. Check application status ## 8. Check application status
Check if GitLab and its environment are configured correctly: Check if GitLab and its environment are configured correctly:
...@@ -98,8 +97,8 @@ If all items are green, then congratulations upgrade complete! ...@@ -98,8 +97,8 @@ If all items are green, then congratulations upgrade complete!
## Things went south? Revert to previous version (6.2) ## Things went south? Revert to previous version (6.2)
### 1. Revert the code to the previous version ### 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) 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: ### 2. Restore from the backup:
......
# From 6.3 to 6.4 # From 6.3 to 6.4
### 0. Backup ## 0. Backup
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
``` ```
### 1. Stop server ## 1. Stop server
```bash ```bash
sudo service gitlab stop sudo service gitlab stop
```` ````
### 2. Get latest code ## 2. Get latest code
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -22,7 +22,7 @@ sudo -u git -H git checkout 6-4-stable ...@@ -22,7 +22,7 @@ sudo -u git -H git checkout 6-4-stable
# For GitLab Enterprise Edition: sudo -u git -H git checkout 6-4-stable-ee # For GitLab Enterprise Edition: sudo -u git -H git checkout 6-4-stable-ee
``` ```
### 3. Update gitlab-shell (and its config) ## 3. Update gitlab-shell (and its config)
```bash ```bash
cd /home/git/gitlab-shell cd /home/git/gitlab-shell
...@@ -30,7 +30,7 @@ sudo -u git -H git fetch ...@@ -30,7 +30,7 @@ sudo -u git -H git fetch
sudo -u git -H git checkout v1.8.0 sudo -u git -H git checkout v1.8.0
``` ```
### 4. Install libs, migrations, etc. ## 4. Install libs, migrations, etc.
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
...@@ -52,14 +52,14 @@ sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS ...@@ -52,14 +52,14 @@ sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
``` ```
### 5. Start application ## 5. Start application
```bash ```bash
sudo service gitlab start sudo service gitlab start
sudo service nginx restart sudo service nginx restart
``` ```
### 6. Check application status ## 6. Check application status
Check if GitLab and its environment are configured correctly: Check if GitLab and its environment are configured correctly:
...@@ -78,8 +78,8 @@ If all items are green, then congratulations upgrade complete! ...@@ -78,8 +78,8 @@ If all items are green, then congratulations upgrade complete!
## Things went south? Revert to previous version (6.3) ## Things went south? Revert to previous version (6.3)
### 1. Revert the code to the previous version ### 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) 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: ### 2. Restore from the backup:
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
+ [The individual upgrade guides](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update) - [The individual upgrade guides](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update)
+ [Upgrader](upgrader.md) - [Upgrader](upgrader.md)
+ [Ruby](ruby.md) - [Ruby](ruby.md)
+ [Patch versions](patch_versions.md) - [Patch versions](patch_versions.md)
+ [MySQL to PostgreSQL](mysql_to_postgresql.md) - [MySQL to PostgreSQL](mysql_to_postgresql.md)
# Migrating GitLab from MySQL to Postgres # Migrating GitLab from MySQL to Postgres
If you are replacing MySQL with Postgres while keeping GitLab on the same If you are replacing MySQL with Postgres while keeping GitLab on the same server all you need to do is to export from MySQL, import into Postgres and rebuild the indexes as described below. If you are also moving GitLab to another server, or if you are switching to omnibus-gitlab, you may want to use a GitLab backup file. The second part of this documents explains the procedure to do this.
server all you need to do is to export from MySQL, import into Postgres and
rebuild the indexes as described below. If you are also moving GitLab to
another server, or if you are switching to omnibus-gitlab, you may want to use
a GitLab backup file. The second part of this documents explains the procedure
to do this.
## Export from MySQL and import into Postgres ## Export from MySQL and import into Postgres
...@@ -27,18 +22,13 @@ psql -f databasename.psql -d gitlabhq_production ...@@ -27,18 +22,13 @@ psql -f databasename.psql -d gitlabhq_production
sudo service gitlab start sudo service gitlab start
``` ```
## Rebuild indexes ## Rebuild indexes
The lanyrd database converter script does not preserve all indexes, so we have The lanyrd database converter script does not preserve all indexes, so we have to recreate them ourselves after migrating from MySQL. It is not necessary to shut down GitLab for this process.
to recreate them ourselves after migrating from MySQL. It is not necessary to
shut down GitLab for this process.
### For non-omnibus installations ### For non-omnibus installations
On non-omnibus installations (distributed using Git) we retrieve the index On non-omnibus installations (distributed using Git) we retrieve the index declarations from version control using `git stash`.
declarations from version control using `git stash`.
``` ```
# Clone the database converter on your Postgres-backed GitLab server # Clone the database converter on your Postgres-backed GitLab server
...@@ -59,8 +49,7 @@ sudo -u git -H bundle exec rails runner -e production 'eval $stdin.read' < /tmp/ ...@@ -59,8 +49,7 @@ sudo -u git -H bundle exec rails runner -e production 'eval $stdin.read' < /tmp/
### For omnibus-gitlab installations ### For omnibus-gitlab installations
On omnibus-gitlab we need to get the index declarations from a file called On omnibus-gitlab we need to get the index declarations from a file called `schema.rb.bundled`. For versions older than 6.9, we need to download the file.
`schema.rb.bundled`. For versions older than 6.9, we need to download the file.
``` ```
# Clone the database converter on your Postgres-backed GitLab server # Clone the database converter on your Postgres-backed GitLab server
...@@ -80,10 +69,7 @@ test -e /opt/gitlab/embedded/service/gitlab-rails/db/schema.rb.bundled || sudo / ...@@ -80,10 +69,7 @@ test -e /opt/gitlab/embedded/service/gitlab-rails/db/schema.rb.bundled || sudo /
## Converting a GitLab backup file from MySQL to Postgres ## Converting a GitLab backup file from MySQL to Postgres
GitLab backup files (<timestamp>_gitlab_backup.tar) contain a SQL dump. Using GitLab backup files (<timestamp>_gitlab_backup.tar) contain a SQL dump. Using the lanyrd database converter we can replace a MySQL database dump inside the tar file with a Postgres database dump. This can be useful if you are moving to another server.
the lanyrd database converter we can replace a MySQL database dump inside the
tar file with a Postgres database dump. This can be useful if you are moving to
another server.
``` ```
# Stop GitLab # Stop GitLab
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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