diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/dependency_decisions.yml | 183 | ||||
-rw-r--r-- | config/gitlab.yml.example | 2 | ||||
-rw-r--r-- | config/initializers/doorkeeper.rb | 2 | ||||
-rw-r--r-- | config/initializers/inflections.rb | 4 | ||||
-rw-r--r-- | config/initializers/metrics.rb | 24 | ||||
-rw-r--r-- | config/license_finder.yml | 2 | ||||
-rw-r--r-- | config/mail_room.yml | 2 | ||||
-rw-r--r-- | config/routes.rb | 42 |
8 files changed, 244 insertions, 17 deletions
diff --git a/config/dependency_decisions.yml b/config/dependency_decisions.yml new file mode 100644 index 00000000000..436a2c5e17a --- /dev/null +++ b/config/dependency_decisions.yml @@ -0,0 +1,183 @@ +--- +# IGNORED GROUPS AND GEMS +- - :ignore_group + - development + - :who: Connor Shea + :why: Development gems are not distributed with the final product and are therefore exempt. + :versions: [] + :when: 2016-04-17 21:27:01.054140000 Z +- - :ignore_group + - test + - :who: Connor Shea + :why: Test gems are not distributed with the final product and are therefore exempt. + :versions: [] + :when: 2016-04-17 21:27:06.250326000 Z +- - :ignore + - bundler + - :who: Connor Shea + :why: Bundler is MIT licensed but will sometimes fail in CI. + :versions: [] + :when: 2016-05-02 06:42:08.045090000 Z + +# LICENSE WHITELIST +- - :whitelist + - MIT + - :who: Connor Shea + :why: http://choosealicense.com/licenses/mit/ + :versions: [] + :when: 2016-04-17 21:12:24.558441000 Z +- - :whitelist + - Apache 2.0 + - :who: Connor Shea + :why: http://choosealicense.com/licenses/apache-2.0/ + :versions: [] + :when: 2016-05-02 05:27:43.762702000 Z +- - :whitelist + - ruby + - :who: Connor Shea + :why: https://github.com/ruby/ruby/blob/ruby_2_1/COPYING + :versions: [] + :when: 2016-05-02 05:31:54.498490000 Z +- - :whitelist + - LGPL + - :who: Connor Shea + :why: http://www.gnu.org/licenses/license-list.html#LGPLv2.1 + :versions: [] + :when: 2016-05-02 05:32:48.645841000 Z +- - :whitelist + - ISC + - :who: Connor Shea + :why: http://www.gnu.org/licenses/license-list.html#ISC + :versions: [] + :when: 2016-05-02 05:42:01.894452000 Z +- - :whitelist + - New BSD + - :who: Connor Shea + :why: https://opensource.org/licenses/BSD-3-Clause + :versions: [] + :when: 2016-05-02 05:44:38.246021000 Z +- - :whitelist + - LGPL-2.1+ + - :who: Connor Shea + :why: Equivalent to LGPL. + :versions: [] + :when: 2016-05-02 05:52:56.303239000 Z +- - :whitelist + - BSD + - :who: Connor Shea + :why: https://opensource.org/licenses/BSD-2-Clause + :versions: [] + :when: 2016-05-02 05:55:09.796363000 Z + +# LICENSE BLACKLIST +- - :blacklist + - GPLv2 + - :who: Connor Shea + :why: GPL-licensed libraries cannot be linked to from non-GPL projects. + :versions: [] + :when: 2016-05-02 05:29:27.637336000 Z +- - :blacklist + - GPLv3 + - :who: Connor Shea + :why: GPL-licensed libraries cannot be linked to from non-GPL projects. + :versions: [] + :when: 2016-05-02 05:29:43.904715000 Z + +# GEM LICENSES +- - :license + - raphael-rails + - MIT + - :who: Connor Shea + :why: https://github.com/mockdeep/raphael-rails/blob/master/license.txt + :versions: [] + :when: 2016-04-17 21:30:07.575392000 Z +- - :license + - rouge + - MIT + - :who: Connor Shea + :why: https://github.com/jneen/rouge/blob/master/LICENSE + :versions: [] + :when: 2016-04-17 21:31:29.490394000 Z +- - :license + - pyu-ruby-sasl + - MIT + - :who: Connor Shea + :why: https://github.com/pyu10055/ruby-sasl/blob/master/MIT-LICENSE + :versions: [] + :when: 2016-04-17 21:41:55.266420000 Z +- - :license + - six + - MIT + - :who: Connor Shea + :why: https://github.com/randx/six/blob/master/LICENSE + :versions: [] + :when: 2016-04-17 21:42:31.420186000 Z +- - :license + - rdoc + - ruby + - :who: Connor Shea + :why: https://github.com/rdoc/rdoc/blob/master/LICENSE.rdoc + :versions: [] + :when: 2016-04-17 21:43:30.480413000 Z +- - :license + - expression_parser + - MIT + - :who: Connor Shea + :why: https://github.com/nricciar/expression_parser/blob/master/MIT-LICENSE + :versions: [] + :when: 2016-04-17 21:45:41.829912000 Z +- - :license + - creole + - ruby + - :who: Connor Shea + :why: https://github.com/minad/creole#license + :versions: [] + :when: 2016-04-17 21:49:10.329759000 Z +- - :license + - eventmachine + - ruby + - :who: Connor Shea + :why: https://github.com/eventmachine/eventmachine/blob/master/LICENSE + :versions: [] + :when: 2016-04-17 21:49:10.329759001 Z +- - :license + - unicorn + - ruby + - :who: Connor Shea + :why: http://unicorn.bogomips.org/LICENSE.html + :versions: [] + :when: 2016-05-02 05:45:28.817510000 Z +- - :license + - unicorn-worker-killer + - ruby + - :who: Connor Shea + :why: https://github.com/kzk/unicorn-worker-killer/blob/master/LICENSE + :versions: [] + :when: 2016-05-02 05:45:38.323867000 Z +- - :license + - json + - ruby + - :who: Connor Shea + :why: https://github.com/flori/json/tree/master#license + :versions: [] + :when: 2016-05-02 05:50:07.826564000 Z +- - :license + - unf + - BSD + - :who: Connor Shea + :why: https://github.com/knu/ruby-unf/blob/master/LICENSE + :versions: [] + :when: 2016-05-02 05:51:46.886872000 Z +- - :license + - rubypants + - BSD + - :who: Connor Shea + :why: https://github.com/jmcnevin/rubypants/blob/master/LICENSE.rdoc + :versions: [] + :when: 2016-05-02 05:56:50.696858000 Z +- - :whitelist + - LGPLv2+ + - :who: Stan Hu + :why: Equivalent to LGPLv2 + :versions: [] + :when: 2016-06-07 17:14:10.907682000 Z diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 0510e7df597..1048ef6e243 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -181,7 +181,7 @@ production: &base # host: registry.example.com # port: 5005 # api_url: http://localhost:5000/ # internal address to the registry, will be used by GitLab to directly communicate with API - # key_path: config/registry.key + # key: config/registry.key # path: shared/registry # issuer: gitlab-issuer diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index 7bd13105045..618dba74151 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -12,7 +12,7 @@ Doorkeeper.configure do end resource_owner_from_credentials do |routes| - Gitlab::Auth.new.find(params[:username], params[:password]) + Gitlab::Auth.find_with_user_password(params[:username], params[:password]) end # If you want to restrict access to the web interface for adding oauth authorized applications, you need to declare the block below. diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 9e8b0131f8f..3d1a41a4652 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -8,3 +8,7 @@ # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end +# +ActiveSupport::Inflector.inflections do |inflect| + inflect.uncountable %w(award_emoji) +end diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb index 0c788714714..f6509ee43f1 100644 --- a/config/initializers/metrics.rb +++ b/config/initializers/metrics.rb @@ -96,13 +96,18 @@ if Gitlab::Metrics.enabled? config.instrument_instance_methods(const) end - # Instruments all Banzai filters - Dir[Rails.root.join('lib', 'banzai', 'filter', '*.rb')].each do |file| - klass = File.basename(file, File.extname(file)).camelize - const = Banzai::Filter.const_get(klass) + # Instruments all Banzai filters and reference parsers + { + Filter: Rails.root.join('lib', 'banzai', 'filter', '*.rb'), + ReferenceParser: Rails.root.join('lib', 'banzai', 'reference_parser', '*.rb') + }.each do |const_name, path| + Dir[path].each do |file| + klass = File.basename(file, File.extname(file)).camelize + const = Banzai.const_get(const_name).const_get(klass) - config.instrument_methods(const) - config.instrument_instance_methods(const) + config.instrument_methods(const) + config.instrument_instance_methods(const) + end end config.instrument_methods(Banzai::Renderer) @@ -121,6 +126,13 @@ if Gitlab::Metrics.enabled? config.instrument_instance_methods(Gitlab::GitAccessWiki) config.instrument_instance_methods(API::Helpers) + + config.instrument_instance_methods(RepositoryCheck::SingleRepositoryWorker) + # Iterate over each non-super private instance method to keep up to date if + # internals change + RepositoryCheck::SingleRepositoryWorker.private_instance_methods(false).each do |method| + config.instrument_instance_method(RepositoryCheck::SingleRepositoryWorker, method) + end end GC::Profiler.enable diff --git a/config/license_finder.yml b/config/license_finder.yml new file mode 100644 index 00000000000..e01ebec3298 --- /dev/null +++ b/config/license_finder.yml @@ -0,0 +1,2 @@ +--- +decisions_file: './config/dependency_decisions.yml' diff --git a/config/mail_room.yml b/config/mail_room.yml index 761a32adb9e..7cab24b295e 100644 --- a/config/mail_room.yml +++ b/config/mail_room.yml @@ -2,7 +2,7 @@ <% require "yaml" require "json" -require_relative "lib/gitlab/redis" +require_relative "lib/gitlab/redis" unless defined?(Gitlab::Redis) rails_env = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development" diff --git a/config/routes.rb b/config/routes.rb index 428302d0fd7..95fbe7dd9df 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,8 +80,8 @@ Rails.application.routes.draw do # Health check get 'health_check(/:checks)' => 'health_check#index', as: :health_check - # Enable Grack support - mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post, :put] + # Enable Grack support (for LFS only) + mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\/(info\/lfs|gitlab-lfs)/.match(request.path_info) }, via: [:get, :post, :put] # Help get 'help' => 'help#index' @@ -343,8 +343,9 @@ Rails.application.routes.draw do resources :keys resources :emails, only: [:index, :create, :destroy] resource :avatar, only: [:destroy] - resource :two_factor_auth, only: [:new, :create, :destroy] do + resource :two_factor_auth, only: [:show, :create, :destroy] do member do + post :create_u2f post :codes patch :skip end @@ -440,6 +441,7 @@ Rails.application.routes.draw do resources :namespaces, path: '/', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do resources(:projects, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }, except: [:new, :create, :index], path: "/") do + member do put :transfer delete :remove_fork @@ -453,6 +455,29 @@ Rails.application.routes.draw do end scope module: :projects do + # Git HTTP clients ('git clone' etc.) + scope constraints: { id: /.+\.git/, format: nil } do + get '/info/refs', to: 'git_http#info_refs' + post '/git-upload-pack', to: 'git_http#git_upload_pack' + post '/git-receive-pack', to: 'git_http#git_receive_pack' + end + + # Allow /info/refs, /info/refs?service=git-upload-pack, and + # /info/refs?service=git-receive-pack, but nothing else. + # + git_http_handshake = lambda do |request| + request.query_string.blank? || + request.query_string.match(/\Aservice=git-(upload|receive)-pack\z/) + end + + ref_redirect = redirect do |params, request| + path = "#{params[:namespace_id]}/#{params[:project_id]}.git/info/refs" + path << "?#{request.query_string}" unless request.query_string.blank? + path + end + + get '/info/refs', constraints: git_http_handshake, to: ref_redirect + # Blob routes: get '/new/*id', to: 'blob#new', constraints: { id: /.+/ }, as: 'new_blob' post '/create/*id', to: 'blob#create', constraints: { id: /.+/ }, as: 'create_blob' @@ -591,7 +616,6 @@ Rails.application.routes.draw do # Order matters to give priority to these matches get '/wikis/git_access', to: 'wikis#git_access' get '/wikis/pages', to: 'wikis#pages', as: 'wiki_pages' - post '/wikis/markdown_preview', to:'wikis#markdown_preview' post '/wikis', to: 'wikis#create' get '/wikis/*id/history', to: 'wikis#history', as: 'wiki_history', constraints: WIKI_SLUG_ID @@ -600,6 +624,7 @@ Rails.application.routes.draw do get '/wikis/*id', to: 'wikis#show', as: 'wiki', constraints: WIKI_SLUG_ID delete '/wikis/*id', to: 'wikis#destroy', constraints: WIKI_SLUG_ID put '/wikis/*id', to: 'wikis#update', constraints: WIKI_SLUG_ID + post '/wikis/*id/markdown_preview', to:'wikis#markdown_preview', constraints: WIKI_SLUG_ID, as: 'wiki_markdown_preview' end resource :repository, only: [:show, :create] do @@ -652,6 +677,7 @@ Rails.application.routes.draw do post :cancel_merge_when_build_succeeds get :ci_status post :toggle_subscription + post :toggle_award_emoji post :remove_wip end @@ -717,16 +743,19 @@ Rails.application.routes.draw do resources :labels, constraints: { id: /\d+/ } do collection do post :generate + post :set_priorities end member do post :toggle_subscription + delete :remove_priority end end resources :issues, constraints: { id: /\d+/ } do member do post :toggle_subscription + post :toggle_award_emoji get :referenced_merge_requests get :related_branches get :can_create_branch @@ -755,12 +784,9 @@ Rails.application.routes.draw do resources :notes, only: [:index, :create, :destroy, :update], constraints: { id: /\d+/ } do member do + post :toggle_award_emoji delete :delete_attachment end - - collection do - post :award_toggle - end end resources :uploads, only: [:create] do |