diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-08-07 15:20:09 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-08-07 15:20:09 -0500 |
commit | 7767ceef47a57baf2bc03f609e3dbf77ed44c9aa (patch) | |
tree | 0d057168bfba56bff88f2bf1b4e8f19af0aa2204 /config | |
parent | 1d5a306596e56398c3f6f46feafd1f4ce23c3c2c (diff) | |
parent | b12107a0b953b566cd58db30ae880800a4a695a6 (diff) | |
download | gitlab-ce-7767ceef47a57baf2bc03f609e3dbf77ed44c9aa.tar.gz |
Merge branch 'master' into ide
* master: (177 commits)
Add changelog
Bump gitlab-shell version to 5.8.0 to fix Git for Windows 2.14
Make contextual sidebar collapsible
Fixed sidebar context header hover colors
Use correct `Environment`-class within `Gitlab` namespace
Remove gl.Activities from Commits page
Move `let` calls inside the `describe` block using them
Add `/assign me` alias support for assigning issuables to oneself
GRPC::Unavailable (< GRPC::BadStatus) is wrapped in a CommandError
Use `broken_storage` in the fs_shards_spec.
Eager load project creators for project dashboards
Memoize a user's personal projects count
Remove redundant query from User#recent_push
Improve checking if projects would be returned
Change spelling of gitlab-shell
Remove unused #tree-holder
Add custom linter for inline JavaScript to haml_lint
Rename user_can_admin? because it's more accurate
Synchronous zanata community contribution translation
Add Korean translation to i18n
...
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 4 | ||||
-rw-r--r-- | config/gitlab.yml.example | 9 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 11 | ||||
-rw-r--r-- | config/initializers/6_validations.rb | 16 | ||||
-rw-r--r-- | config/routes/admin.rb | 4 | ||||
-rw-r--r-- | config/routes/repository.rb | 2 | ||||
-rw-r--r-- | config/webpack.config.js | 5 |
7 files changed, 46 insertions, 5 deletions
diff --git a/config/application.rb b/config/application.rb index 1c13cc81270..f7145566262 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,13 +23,13 @@ module Gitlab # https://github.com/rails/rails/blob/v4.2.6/railties/lib/rails/engine.rb#L687 # This is a nice reference article on autoloading/eager loading: # http://blog.arkency.com/2014/11/dont-forget-about-eager-load-when-extending-autoload - config.eager_load_paths.push(*%W(#{config.root}/lib + config.eager_load_paths.push(*%W[#{config.root}/lib #{config.root}/app/models/hooks #{config.root}/app/models/members #{config.root}/app/models/project_services #{config.root}/app/workers/concerns #{config.root}/app/services/concerns - #{config.root}/app/finders/concerns)) + #{config.root}/app/finders/concerns]) config.generators.templates.push("#{config.root}/generator_templates") diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 73a68c6da1b..45ab4e1a851 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -506,6 +506,11 @@ production: &base path: /home/git/repositories/ gitaly_address: unix:/home/git/gitlab/tmp/sockets/private/gitaly.socket # TCP connections are supported too (e.g. tcp://host:port) # gitaly_token: 'special token' # Optional: override global gitaly.token for this storage. + failure_count_threshold: 10 # number of failures before stopping attempts + failure_wait_time: 30 # Seconds after an access failure before allowing access again + failure_reset_time: 1800 # Time in seconds to expire failures + storage_timeout: 5 # Time in seconds to wait before aborting a storage access attempt + ## Backup settings backup: @@ -638,6 +643,10 @@ test: default: path: tmp/tests/repositories/ gitaly_address: unix:tmp/tests/gitaly/gitaly.socket + broken: + path: tmp/tests/non-existent-repositories + gitaly_address: unix:tmp/tests/gitaly/gitaly.socket + gitaly: enabled: true token: secret diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 63f4c8c9e0a..7a43bf939ea 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -433,6 +433,17 @@ end Settings.repositories.storages.values.each do |storage| # Expand relative paths storage['path'] = Settings.absolute(storage['path']) + # Set failure defaults + storage['failure_count_threshold'] ||= 10 + storage['failure_wait_time'] ||= 30 + storage['failure_reset_time'] ||= 1800 + storage['storage_timeout'] ||= 5 + # Set turn strings into numbers + storage['failure_count_threshold'] = storage['failure_count_threshold'].to_i + storage['failure_wait_time'] = storage['failure_wait_time'].to_i + storage['failure_reset_time'] = storage['failure_reset_time'].to_i + # We might want to have a timeout shorter than 1 second. + storage['storage_timeout'] = storage['storage_timeout'].to_f end # diff --git a/config/initializers/6_validations.rb b/config/initializers/6_validations.rb index 9e24f42d284..92ce4dd03cd 100644 --- a/config/initializers/6_validations.rb +++ b/config/initializers/6_validations.rb @@ -7,6 +7,13 @@ def find_parent_path(name, path) Gitlab.config.repositories.storages.detect do |n, rs| name != n && Pathname.new(rs['path']).realpath == parent end +rescue Errno::EIO, Errno::ENOENT => e + warning = "WARNING: couldn't verify #{path} (#{name}). "\ + "If this is an external storage, it might be offline." + message = "#{warning}\n#{e.message}" + Rails.logger.error("#{message}\n\t" + e.backtrace.join("\n\t")) + + nil end def storage_validation_error(message) @@ -29,6 +36,15 @@ def validate_storages_config if !repository_storage.is_a?(Hash) || repository_storage['path'].nil? storage_validation_error("#{name} is not a valid storage, because it has no `path` key. Refer to gitlab.yml.example for an updated example") end + + %w(failure_count_threshold failure_wait_time failure_reset_time storage_timeout).each do |setting| + # Falling back to the defaults is fine! + next if repository_storage[setting].nil? + + unless repository_storage[setting].to_f > 0 + storage_validation_error("#{setting}, for storage `#{name}` needs to be greater than 0") + end + end end end diff --git a/config/routes/admin.rb b/config/routes/admin.rb index 5427bab93ce..c0748231813 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -67,7 +67,9 @@ namespace :admin do end resource :logs, only: [:show] - resource :health_check, controller: 'health_check', only: [:show] + resource :health_check, controller: 'health_check', only: [:show] do + post :reset_storage_health + end resource :background_jobs, controller: 'background_jobs', only: [:show] resource :system_info, controller: 'system_info', only: [:show] resources :requests_profiles, only: [:index, :show], param: :name, constraints: { name: /.+\.html/ } diff --git a/config/routes/repository.rb b/config/routes/repository.rb index edcf3ddf57b..2ba16035ece 100644 --- a/config/routes/repository.rb +++ b/config/routes/repository.rb @@ -2,7 +2,7 @@ resource :repository, only: [:create] do member do - get 'archive', constraints: { format: Gitlab::PathRegex.archive_formats_regex } + get ':ref/archive', constraints: { format: Gitlab::PathRegex.archive_formats_regex, ref: /.+/ }, action: 'archive', as: 'archive' end end diff --git a/config/webpack.config.js b/config/webpack.config.js index d3dc512beca..e2a4cade2e4 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -112,9 +112,12 @@ var config = { options: { limit: 2048 }, }, { - test: /\.(worker\.js|pdf|bmpr)$/, + test: /\.(worker(\.min)?\.js|pdf|bmpr)$/, exclude: /node_modules/, loader: 'file-loader', + options: { + name: '[name].[hash].[ext]', + } }, { test: /locale\/\w+\/(.*)\.js$/, |