diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95fa25823ba..2a6eb71b654 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,6 +8,8 @@ GitLab is a popular open source project and the capacity to deal with issues and Please treat our volunteers with courtesy and respect, it will go a long way towards getting your issue resolved. +Issues and pull requests should be in English and contain appropriate language for audiences of all ages. + ## Issue tracker To get support for your particular problem please use the channels as detailed in [the getting help section of the readme](https://github.com/gitlabhq/gitlabhq#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/). @@ -16,7 +18,7 @@ The [issue tracker](https://github.com/gitlabhq/gitlabhq/issues) is only for obv Do not use the issue tracker for feature requests. We have a specific [feedback and suggestions forum](http://feedback.gitlab.com) for this purpose. -Please send a pull request with a tested solution or a pull request with a failing test instead of opening an issue if you can. If you're unsure where to post, post to the [Support Forum](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 pull request with a tested solution or a pull 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. ### Issue tracker guidelines @@ -26,7 +28,7 @@ Please send a pull request with a tested solution or a pull request with a faili 2. **Steps to reproduce:** How can we reproduce the issue, preferably on the [GitLab Vagrant virtual machine](https://github.com/gitlabhq/gitlab-vagrant-vm) (start with: `vagrant destroy && vagrant up && vagrant ssh`) 3. **Expected behavior:** Describe your issue in detail 4. **Observed behavior** -5. **Relevant logs and/or screen shots:** Please use code blocks (\`\`\`) to format console output, logs, and code as it's very hard to read otherwise. +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. 6. **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 * 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) @@ -45,6 +47,7 @@ If you can, please submit a pull request with the fix or improvements including 1. Fork the project on GitHub 1. Create a feature branch 1. Write [tests](README.md#run-the-tests) and code +1. Add your changes to the [CHANGELOG](CHANGELOG) 1. If you have multiple commits please combine them into one commit by [squashing them](http://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) 1. Push the commit to your fork 1. Submit a pull request @@ -54,12 +57,13 @@ We will accept pull requests if: * The code has proper tests and all tests pass (or it is a test exposing a failure in existing code) * It can be merged without problems (if not please use: `git rebase master`) -* It doesn't break any existing functionality +* It does not break any existing functionality * It's quality code that conforms to the [Ruby](https://github.com/bbatsov/ruby-style-guide) and [Rails](https://github.com/bbatsov/rails-style-guide) style guides and best practices * The description includes a motive for your change and the method you used to achieve it +* It is not a catch all pull request but rather fixes a specific issue or implements a specific feature * It keeps the GitLab code base clean and well structured * We think other users will benefit from the same functionality * If it makes changes to the UI the pull request should include screenshots -* It is a single commit (please use git rebase -i to squash commits) +* It is a single commit (please use `git rebase -i` to squash commits) For examples of feedback on pull requests please look at already [closed pull requests](https://github.com/gitlabhq/gitlabhq/pulls?direction=desc&page=1&sort=created&state=closed). diff --git a/Gemfile b/Gemfile index 3810073c260..26b2b358d80 100644 --- a/Gemfile +++ b/Gemfile @@ -59,8 +59,9 @@ gem "haml-rails" # Files attachments gem "carrierwave" + # for aws storage -# gem "fog", "~> 1.3.1" +gem "fog", "~> 1.3.1", group: :aws # Authorization gem "six" @@ -76,7 +77,8 @@ gem "github-markup", "~> 0.7.4", require: 'github/markup' gem "asciidoctor" # Servers -gem "puma", '~> 2.3.1' +gem "puma", '~> 2.3.1', group: :puma +gem "unicorn", '~> 4.6.3', group: :unicorn # State machine gem "state_machine" diff --git a/Gemfile.lock b/Gemfile.lock index f259f908a22..4866f9585d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -117,6 +117,7 @@ GEM erubis (2.7.0) escape_utils (0.2.4) eventmachine (1.0.3) + excon (0.13.4) execjs (1.4.0) multi_json (~> 1.0) factory_girl (4.2.0) @@ -132,6 +133,16 @@ GEM eventmachine (>= 0.12.0) ffaker (1.16.1) ffi (1.9.0) + fog (1.3.1) + builder + excon (~> 0.13.0) + formatador (~> 0.2.0) + mime-types + multi_json (~> 1.0) + net-scp (~> 1.0.4) + net-ssh (>= 2.1.3) + nokogiri (~> 1.5.0) + ruby-hmac font-awesome-rails (3.1.1.3) railties (>= 3.2, < 5.0) foreman (0.63.0) @@ -245,6 +256,7 @@ GEM kaminari (0.14.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) + kgio (2.8.0) launchy (2.3.0) addressable (~> 2.3) letter_opener (1.1.1) @@ -268,6 +280,9 @@ GEM multipart-post (1.2.0) mysql2 (0.3.11) net-ldap (0.3.1) + net-scp (1.0.4) + net-ssh (>= 1.99.1) + net-ssh (2.6.8) nokogiri (1.5.10) oauth (0.4.7) oauth2 (0.8.1) @@ -355,6 +370,7 @@ GEM rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) + raindrops (0.11.0) rake (10.1.0) rb-fsevent (0.9.3) rb-inotify (0.9.0) @@ -401,6 +417,7 @@ GEM rspec-core (~> 2.13.0) rspec-expectations (~> 2.13.0) rspec-mocks (~> 2.13.0) + ruby-hmac (0.4.0) ruby-progressbar (1.1.1) rubyntlm (0.1.1) rubyzip (0.9.9) @@ -501,6 +518,10 @@ GEM execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) underscore-rails (1.4.4) + unicorn (4.6.3) + kgio (~> 2.6) + rack + raindrops (~> 0.7) virtus (0.5.5) backports (~> 3.3) descendants_tracker (~> 0.0.1) @@ -538,6 +559,7 @@ DEPENDENCIES enumerize factory_girl_rails ffaker + fog (~> 1.3.1) font-awesome-rails (~> 3.1.1) foreman gemoji (~> 1.2.1) @@ -610,4 +632,5 @@ DEPENDENCIES turbolinks uglifier underscore-rails (~> 1.4.4) + unicorn (~> 4.6.3) webmock diff --git a/README.md b/README.md index b5b39648a01..de773cce0eb 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ or start each component separately * [Troubleshooting guide](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide) contains solutions to common problems. -* [Support forum](https://groups.google.com/forum/#!forum/gitlabhq) and [Stack Overflow](http://stackoverflow.com/questions/tagged/gitlab) are the best places to ask questions. For example you can use it if you have questions about: permission denied errors, invisible repos, can't clone/pull/push or with web hooks that don't fire. Please search for similar issues before posting your own, there's a good chance somebody else had the same issue you have now and has resolved it. 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 to a fix. +* [Mailing list](https://groups.google.com/forum/#!forum/gitlabhq) and [Stack Overflow](http://stackoverflow.com/questions/tagged/gitlab) are the best places to ask questions. For example you can use it if you have questions about: permission denied errors, invisible repos, can't clone/pull/push or with web hooks that don't fire. Please search for similar issues before posting your own, there's a good chance somebody else had the same issue you have now and has resolved it. 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 to a fix. * [Feedback and suggestions forum](http://feedback.gitlab.com) is the place to propose and discuss new features for GitLab. diff --git a/app/views/admin/hooks/_data_ex.html.erb b/app/views/admin/hooks/_data_ex.html.erb index eeb78b5f0c5..b69aa92716d 100644 --- a/app/views/admin/hooks/_data_ex.html.erb +++ b/app/views/admin/hooks/_data_ex.html.erb @@ -1,23 +1,26 @@ <% data_ex_str = < 64 +listen 8080, :tcp_nopush => true + +# nuke workers after 30 seconds instead of 60 seconds (the default) +timeout 30 + +# feel free to point this anywhere accessible on the filesystem +pid "/home/git/gitlab/tmp/pids/unicorn.pid" + +# By default, the Unicorn logger will write to stderr. +# Additionally, ome applications/frameworks log to stderr or stdout, +# so prevent them from going to /dev/null when daemonized here: +stderr_path "/home/git/gitlab/log/unicorn.stderr.log" +stdout_path "/home/git/gitlab/log/unicorn.stdout.log" + +# combine Ruby 2.0.0dev or REE with "preload_app true" for memory savings +# http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow +preload_app true +GC.respond_to?(:copy_on_write_friendly=) and + GC.copy_on_write_friendly = true + +# Enable this flag to have unicorn test client connections by writing the +# beginning of the HTTP headers before calling the application. This +# prevents calling the application for connections that have disconnected +# while queued. This is only guaranteed to detect clients on the same +# host unicorn runs on, and unlikely to detect disconnects even on a +# fast LAN. +check_client_connection false + +before_fork do |server, worker| + # the following is highly recomended for Rails + "preload_app true" + # as there's no need for the master process to hold a connection + defined?(ActiveRecord::Base) and + ActiveRecord::Base.connection.disconnect! + + # The following is only recommended for memory/DB-constrained + # installations. It is not needed if your system can house + # twice as many worker_processes as you have configured. + # + # # This allows a new master process to incrementally + # # phase out the old master process with SIGTTOU to avoid a + # # thundering herd (especially in the "preload_app false" case) + # # when doing a transparent upgrade. The last worker spawned + # # will then kill off the old master process with a SIGQUIT. + # old_pid = "#{server.config[:pid]}.oldbin" + # if old_pid != server.pid + # begin + # sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU + # Process.kill(sig, File.read(old_pid).to_i) + # rescue Errno::ENOENT, Errno::ESRCH + # end + # end + # + # Throttle the master from forking too quickly by sleeping. Due + # to the implementation of standard Unix signal handlers, this + # helps (but does not completely) prevent identical, repeated signals + # from being lost when the receiving process is busy. + # sleep 1 +end + +after_fork do |server, worker| + # per-process listener ports for debugging/admin/migrations + # addr = "127.0.0.1:#{9293 + worker.nr}" + # server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true) + + # the following is *required* for Rails + "preload_app true", + defined?(ActiveRecord::Base) and + ActiveRecord::Base.establish_connection + + # if preload_app is true, then you may also want to check and + # restart any other shared sockets/descriptors such as Memcached, + # and Redis. TokyoCabinet file handles are safe to reuse + # between any number of forked children (assuming your kernel + # correctly implements pread()/pwrite() system calls) +end diff --git a/doc/api/README.md b/doc/api/README.md index 6faf6dcc7c2..4bcd89949df 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -81,3 +81,8 @@ When listing resources you can pass the following parameters: + [System Hooks](system_hooks.md) + [Groups](groups.md) + [User Teams](user_teams.md) + +## Clients + ++ [php-gitlab-api](https://github.com/m4tthumphrey/php-gitlab-api) - PHP ++ [Ruby Wrapper](https://github.com/NARKOZ/gitlab) - Ruby diff --git a/doc/install/installation.md b/doc/install/installation.md index ed58d5ccbb0..09b09c2aa45 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -173,9 +173,6 @@ You can change `5-3-stable` to `master` if you want the *bleeding edge* version, # Create directory for satellites sudo -u git -H mkdir /home/git/gitlab-satellites - # Make config/database.yml readable to git only - sudo -u git -H chmod o-rwx config/database.yml - # Create directories for sockets/pids and make sure GitLab can write to them sudo -u git -H mkdir tmp/pids/ sudo -u git -H mkdir tmp/sockets/ @@ -218,6 +215,9 @@ Make sure to edit both `gitlab.yml` and `puma.rb` to match your setup. # Change 'secure password' with the value you have given to $password # You can keep the double quotes around the password sudo -u git -H vim config/database.yml + + # Make config/database.yml readable to git only + sudo -u git -H chmod o-rwx config/database.yml ## Install Gems @@ -226,10 +226,10 @@ Make sure to edit both `gitlab.yml` and `puma.rb` to match your setup. sudo gem install charlock_holmes --version '0.6.9.4' # For MySQL (note, the option says "without ... postgres") - sudo -u git -H bundle install --deployment --without development test postgres + sudo -u git -H bundle install --deployment --without development test postgres unicorn aws # Or for PostgreSQL (note, the option says "without ... mysql") - sudo -u git -H bundle install --deployment --without development test mysql + sudo -u git -H bundle install --deployment --without development test mysql unicorn aws ## Initialize Database and Activate Advanced Features diff --git a/lib/gitlab/blacklist.rb b/lib/gitlab/blacklist.rb index b678a83fabf..59203b2fbd6 100644 --- a/lib/gitlab/blacklist.rb +++ b/lib/gitlab/blacklist.rb @@ -3,7 +3,7 @@ module Gitlab extend self def path - %w(admin dashboard groups help profile projects search public assets u s teams merge_requests issues users snippets ) + %w(admin dashboard groups help profile projects search public assets u s teams merge_requests issues users snippets services) end end end