summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-04-12 17:44:02 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-04-12 17:44:02 +0200
commit7b1bb0f4db3f729a045bc086efa0c22ca3d9270b (patch)
treecc531d9dfbfc90952428550c737c77ff5cace745 /config
parentea787165b3a9604aa86304e29778066bb014824e (diff)
parentd65d5c2d1a7e19c0a5a3ff6fcd68ce7fdf0661a2 (diff)
downloadgitlab-ce-7b1bb0f4db3f729a045bc086efa0c22ca3d9270b.tar.gz
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into auto-fsck
Diffstat (limited to 'config')
-rw-r--r--config/application.rb4
-rw-r--r--config/environments/production.rb3
-rw-r--r--config/environments/test.rb1
-rw-r--r--config/gitlab.yml.example5
-rw-r--r--config/initializers/1_settings.rb2
-rw-r--r--config/initializers/metrics.rb33
-rw-r--r--config/initializers/premailer.rb3
-rw-r--r--config/routes.rb8
8 files changed, 50 insertions, 9 deletions
diff --git a/config/application.rb b/config/application.rb
index 9633084d603..2e2ed48db07 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -7,8 +7,6 @@ Bundler.require(:default, Rails.env)
require_relative '../lib/gitlab/redis'
module Gitlab
- REDIS_CACHE_NAMESPACE = 'cache:gitlab'
-
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
@@ -70,7 +68,7 @@ module Gitlab
end
redis_config_hash = Gitlab::Redis.redis_store_options
- redis_config_hash[:namespace] = REDIS_CACHE_NAMESPACE
+ redis_config_hash[:namespace] = Gitlab::Redis::CACHE_NAMESPACE
redis_config_hash[:expires_in] = 2.weeks # Cache should not grow forever
config.cache_store = :redis_store, redis_config_hash
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 909526605a1..a9d8ac4b6d4 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -21,6 +21,9 @@ Rails.application.configure do
# Generate digests for assets URLs
config.assets.digest = true
+ # Enable compression of compiled assets using gzip.
+ config.assets.compress = true
+
# Defaults to nil and saved in location specified by config.assets.prefix
# config.assets.manifest = YOUR_PATH
diff --git a/config/environments/test.rb b/config/environments/test.rb
index f96ac6f9753..a703c0934f7 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -8,6 +8,7 @@ Rails.application.configure do
config.cache_classes = false
# Configure static asset server for tests with Cache-Control for performance
+ config.assets.digest = false
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 4fbef653bc1..90224f9bbd6 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -80,7 +80,7 @@ production: &base
# This happens when the commit is pushed or merged into the default branch of a project.
# When not specified the default issue_closing_pattern as specified below will be used.
# Tip: you can test your closing pattern at http://rubular.com.
- # issue_closing_pattern: '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?))+)'
+ # issue_closing_pattern: '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e[sd]|ing)?|[Rr]esolv(?:e[sd]?|ing))(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?)|([A-Z][A-Z0-9_]+-\d+))+)'
## Default project features settings
default_projects_features:
@@ -352,6 +352,8 @@ production: &base
#
# - { name: 'saml',
# label: 'Our SAML Provider',
+ # groups_attribute: 'Groups',
+ # external_groups: ['Contractors', 'Freelancers'],
# args: {
# assertion_consumer_service_url: 'https://gitlab.example.com/users/auth/saml/callback',
# idp_cert_fingerprint: '43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8',
@@ -359,6 +361,7 @@ production: &base
# issuer: 'https://gitlab.example.com',
# name_identifier_format: 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient'
# } }
+ #
# - { name: 'crowd',
# args: {
# crowd_server_url: 'CROWD SERVER URL',
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 23771553c45..5eb7fdff551 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -176,7 +176,7 @@ Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled'].
Settings.gitlab['signin_enabled'] ||= true if Settings.gitlab['signin_enabled'].nil?
Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], [])
Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
-Settings.gitlab['issue_closing_pattern'] = '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e[sd]|ing)?|[Rr]esolv(?:e[sd]?|ing)) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?)|([A-Z][A-Z0-9_]+-\d+))+)' if Settings.gitlab['issue_closing_pattern'].nil?
+Settings.gitlab['issue_closing_pattern'] = '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e[sd]|ing)?|[Rr]esolv(?:e[sd]?|ing))(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?)|([A-Z][A-Z0-9_]+-\d+))+)' if Settings.gitlab['issue_closing_pattern'].nil?
Settings.gitlab['default_projects_features'] ||= {}
Settings.gitlab['webhook_timeout'] ||= 10
Settings.gitlab['max_attachment_size'] ||= 10
diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb
index 3e1deb8d306..22fe51a4534 100644
--- a/config/initializers/metrics.rb
+++ b/config/initializers/metrics.rb
@@ -1,4 +1,5 @@
if Gitlab::Metrics.enabled?
+ require 'pathname'
require 'influxdb'
require 'connection_pool'
require 'method_source'
@@ -7,6 +8,7 @@ if Gitlab::Metrics.enabled?
# ActiveSupport.
require 'gitlab/metrics/subscribers/action_view'
require 'gitlab/metrics/subscribers/active_record'
+ require 'gitlab/metrics/subscribers/rails_cache'
Gitlab::Application.configure do |config|
config.middleware.use(Gitlab::Metrics::RackMiddleware)
@@ -74,6 +76,37 @@ if Gitlab::Metrics.enabled?
config.instrument_methods(const)
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)
+
+ config.instrument_methods(const)
+ config.instrument_instance_methods(const)
+ end
+
+ config.instrument_methods(Banzai::Renderer)
+ config.instrument_methods(Banzai::Querying)
+
+ [Issuable, Mentionable, Participable].each do |klass|
+ config.instrument_instance_methods(klass)
+ config.instrument_instance_methods(klass::ClassMethods)
+ end
+
+ config.instrument_methods(Gitlab::ReferenceExtractor)
+ config.instrument_instance_methods(Gitlab::ReferenceExtractor)
+
+ # Instrument all service classes
+ services = Rails.root.join('app', 'services')
+
+ Dir[services.join('**', '*.rb')].each do |file_path|
+ path = Pathname.new(file_path).relative_path_from(services)
+ const = path.to_s.sub('.rb', '').camelize.constantize
+
+ config.instrument_methods(const)
+ config.instrument_instance_methods(const)
+ end
end
GC::Profiler.enable
diff --git a/config/initializers/premailer.rb b/config/initializers/premailer.rb
index a44316bc3a4..b9176688bc4 100644
--- a/config/initializers/premailer.rb
+++ b/config/initializers/premailer.rb
@@ -3,5 +3,6 @@ Premailer::Rails.config.merge!(
generate_text_part: false,
preserve_styles: true,
remove_comments: true,
- remove_ids: true
+ remove_ids: true,
+ remove_scripts: false
)
diff --git a/config/routes.rb b/config/routes.rb
index c163602126d..3343f2a13ac 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -577,6 +577,7 @@ 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
@@ -751,10 +752,11 @@ Rails.application.routes.draw do
end
resources :runner_projects, only: [:create, :destroy]
- resources :badges, only: [], path: 'badges/*ref',
- constraints: { ref: Gitlab::Regex.git_reference_regex } do
+ resources :badges, only: [:index] do
collection do
- get :build, constraints: { format: /svg/ }
+ scope '*ref', constraints: { ref: Gitlab::Regex.git_reference_regex } do
+ get :build, constraints: { format: /svg/ }
+ end
end
end
end