From 015d8da7319e8e58869d56c8f516c275035a6c56 Mon Sep 17 00:00:00 2001 From: GitLab Date: Mon, 1 Jul 2013 21:14:39 -0500 Subject: [PATCH 1/9] Updating documentation to reflect #3836 (resolving #4443) --- app/views/admin/hooks/_data_ex.html.erb | 29 ++++++++++++++----------- 1 file changed, 16 insertions(+), 13 deletions(-) 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 = < Date: Wed, 3 Jul 2013 15:15:50 +1000 Subject: [PATCH 2/9] move 'make config/database.yml readable to git only' instruction I've moved the instruction in question to the the 'Configure GitLab DB settings'. Can't change permission to a file that doesn't already exist :wink: --- doc/install/installation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 47faab407e3..146f45f7cd6 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 From 702dc30448b6f1c5f4f3e45a9b170c2bcc0a2f15 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Wed, 3 Jul 2013 12:57:35 +0200 Subject: [PATCH 3/9] Add 'services' to path blacklist, fixes #4470 --- lib/gitlab/blacklist.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From b8f51acf7bf72fb832be7aefe8d7009f2a23a0f0 Mon Sep 17 00:00:00 2001 From: dekimsey Date: Wed, 3 Jul 2013 13:34:23 -0400 Subject: [PATCH 4/9] Fix misspelling in social accounts tip --- app/views/profiles/account.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/profiles/account.html.haml b/app/views/profiles/account.html.haml index 09d9ec10e81..9b1354d9f2c 100644 --- a/app/views/profiles/account.html.haml +++ b/app/views/profiles/account.html.haml @@ -3,7 +3,7 @@ %fieldset %legend Social Accounts .oauth_select_holder - %p.hint Tip: Click on icon to activate sigin with one of the following services + %p.hint Tip: Click on icon to activate signin with one of the following services - enabled_social_providers.each do |provider| %span{class: oauth_active_class(provider) } = link_to authbutton(provider, 32), omniauth_authorize_path(User, provider) From ae9e4a52c5b9e090c8df61978b5838a94408c265 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 4 Jul 2013 11:09:19 +0200 Subject: [PATCH 5/9] Add cluster mode instructions to puma.rb.example --- config/puma.rb.example | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/puma.rb.example b/config/puma.rb.example index ad5e3e23501..08eace369fd 100644 --- a/config/puma.rb.example +++ b/config/puma.rb.example @@ -93,6 +93,13 @@ bind "unix://#{application_path}/tmp/sockets/gitlab.socket" # # workers 2 +# GitLab cluster mode recommendations +# If you have more than 1 GB RAM, uncomment one of the following lines: +# +# workers 2 # if you have at least 1.5 GB RAM +# workers 3 # if you have at least 2 GB RAM +# workers 4 # if you have at least 2.5 GB RAM + # Code to run when a worker boots to setup the process before booting # the app. # From 4bba945437f67ffa5fb6a4afad60729c1827e26b Mon Sep 17 00:00:00 2001 From: Matt Humphrey Date: Sat, 6 Jul 2013 10:14:06 +0100 Subject: [PATCH 6/9] Added client list to API doc --- doc/api/README.md | 5 +++++ 1 file changed, 5 insertions(+) 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 From c64ee6ac3390560a782011bcc261162de88375a9 Mon Sep 17 00:00:00 2001 From: Sytse Sijbrandij Date: Sun, 7 Jul 2013 11:30:31 +0200 Subject: [PATCH 7/9] Rename support forum to mailing list to prevent duplication on community page of GitLab.org. --- CONTRIBUTING.md | 2 +- README.md | 2 +- app/views/help/index.html.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95fa25823ba..36bfdeda32e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,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 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/help/index.html.haml b/app/views/help/index.html.haml index 1685c6eec53..80ddc05b503 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -26,7 +26,7 @@ on the top of this page %li Ask in our - = link_to "support forum", "https://groups.google.com/forum/#!forum/gitlabhq" + = link_to "mailing list", "https://groups.google.com/forum/#!forum/gitlabhq" or on = link_to "Stack Overflow", "http://stackoverflow.com/questions/tagged/gitlab" %li From b686b4b9623f277c35d0972ada4d8f8803cb7c97 Mon Sep 17 00:00:00 2001 From: Ben Bodenmiller Date: Sun, 7 Jul 2013 04:46:37 -0700 Subject: [PATCH 8/9] minor contributing guide updates * issues & pr in English * appropriate language * typo & format fix * not catch all pull request * update changelog --- CONTRIBUTING.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95fa25823ba..761cfe3e261 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/). @@ -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). From 6f5f5e7ee32bbd693796571fa6fcb8575accc08a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 8 Jul 2013 09:47:31 +0300 Subject: [PATCH 9/9] Add suppoort of unicorn and fog gems --- Gemfile | 6 ++- Gemfile.lock | 27 +++++++++- config/unicorn.rb.example | 102 ++++++++++++++++++++++++++++++++++++ doc/install/installation.md | 4 +- 4 files changed, 133 insertions(+), 6 deletions(-) create mode 100644 config/unicorn.rb.example diff --git a/Gemfile b/Gemfile index 0150ffb94ea..089646e110c 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.0.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 313d2ffbca5..d26f4d8a28f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,6 +116,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) @@ -131,6 +132,16 @@ GEM eventmachine (>= 0.12.0) ffaker (1.16.0) ffi (1.8.1) + 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) @@ -243,6 +254,7 @@ GEM kaminari (0.14.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) + kgio (2.8.0) launchy (2.2.0) addressable (~> 2.3) letter_opener (1.1.0) @@ -267,6 +279,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.9) oauth (0.4.7) oauth2 (0.8.1) @@ -305,7 +320,7 @@ GEM coderay (~> 1.0.5) method_source (~> 0.8) slop (~> 3.4) - puma (2.0.1) + puma (2.3.1) rack (>= 1.1, < 2.0) pygments.rb (0.4.2) posix-spawn (~> 0.3.6) @@ -354,6 +369,7 @@ GEM rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) + raindrops (0.11.0) rake (10.0.4) rb-fsevent (0.9.3) rb-inotify (0.9.0) @@ -400,6 +416,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.0.2) rubyntlm (0.1.1) rubyzip (0.9.9) @@ -499,6 +516,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.4) backports (~> 2.6.1) descendants_tracker (~> 0.0.1) @@ -536,6 +557,7 @@ DEPENDENCIES enumerize factory_girl_rails ffaker + fog (~> 1.3.1) font-awesome-rails (~> 3.1.1) foreman gemoji (~> 1.2.1) @@ -574,7 +596,7 @@ DEPENDENCIES pg poltergeist (~> 1.3.0) pry - puma (~> 2.0.1) + puma (~> 2.3.1) quiet_assets (~> 1.0.1) rack-mini-profiler rails (= 3.2.13) @@ -608,4 +630,5 @@ DEPENDENCIES turbolinks uglifier underscore-rails (~> 1.4.4) + unicorn (~> 4.6.3) webmock diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example new file mode 100644 index 00000000000..00c509dd829 --- /dev/null +++ b/config/unicorn.rb.example @@ -0,0 +1,102 @@ +# Sample verbose configuration file for Unicorn (not Rack) +# +# This configuration file documents many features of Unicorn +# that may not be needed for some applications. See +# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb +# for a much simpler configuration file. +# +# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete +# documentation. + +# Use at least one worker per core if you're on a dedicated server, +# more will usually help for _short_ waits on databases/caches. +worker_processes 2 + +# Since Unicorn is never exposed to outside clients, it does not need to +# run on the standard HTTP port (80), there is no reason to start Unicorn +# as root unless it's from system init scripts. +# If running the master process as root and the workers as an unprivileged +# user, do this to switch euid/egid in the workers (also chowns logs): +# user "unprivileged_user", "unprivileged_group" + +# Help ensure your application will always spawn in the symlinked +# "current" directory that Capistrano sets up. +working_directory "/home/git/gitlab/current" # available in 0.94.0+ + +# listen on both a Unix domain socket and a TCP port, +# we use a shorter backlog for quicker failover when busy +listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 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/install/installation.md b/doc/install/installation.md index 146f45f7cd6..800e06fdfdf 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -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