summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2014-12-07 20:25:58 -0700
committerVinnie Okada <vokada@mrvinn.com>2014-12-07 20:25:58 -0700
commit742e6eeed221489d5f35bdfde2e6ce55db75d25f (patch)
tree710c01fbd18e81a7590819161434e19855e35a97 /config
parent7a5072c5a8f03cd7342a5f8e74e1fde0250ce360 (diff)
parentbbf9953b99d59801c72dd7b9550ee149ca77bfcf (diff)
downloadgitlab-ce-742e6eeed221489d5f35bdfde2e6ce55db75d25f.tar.gz
Merge branch 'upstream-master' into markdown-preview
Conflicts: spec/routing/project_routing_spec.rb
Diffstat (limited to 'config')
-rw-r--r--config/application.rb8
-rw-r--r--config/gitlab.yml.example7
-rw-r--r--config/initializers/1_settings.rb4
-rw-r--r--config/initializers/4_sidekiq.rb3
-rw-r--r--config/initializers/7_omniauth.rb3
-rw-r--r--config/initializers/disable_email_interceptor.rb2
-rw-r--r--config/initializers/gitlab_shell_secret_token.rb19
-rw-r--r--config/initializers/time_zone.rb1
-rw-r--r--config/routes.rb19
-rw-r--r--config/unicorn.rb.example1
10 files changed, 50 insertions, 17 deletions
diff --git a/config/application.rb b/config/application.rb
index e36df913d0b..8a280de6fac 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -13,7 +13,6 @@ module Gitlab
# Custom directories with classes and modules you want to be autoloadable.
config.autoload_paths += %W(#{config.root}/lib
- #{config.root}/app/finders
#{config.root}/app/models/hooks
#{config.root}/app/models/concerns
#{config.root}/app/models/project_services
@@ -23,10 +22,6 @@ module Gitlab
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
- # config.time_zone = 'Central Time (US & Canada)'
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
@@ -97,5 +92,8 @@ module Gitlab
redis_config_hash[:namespace] = 'cache:gitlab'
config.cache_store = :redis_store, redis_config_hash
+
+ # This is needed for gitlab-shell
+ ENV['GITLAB_PATH_OUTSIDE_HOOK'] = ENV['PATH']
end
end
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index e7a8d08dc83..7b4c180fccc 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -33,7 +33,14 @@ production: &base
# Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
# user: git
+ ## Date & Time settings
+ # Uncomment and customize if you want to change the default time zone of GitLab application.
+ # To see all available zones, run `bundle exec rake time:zones:all RAILS_ENV=production`
+ # time_zone: 'UTC'
+
## Email settings
+ # Uncomment and set to false if you need to disable email sending from GitLab (default: true)
+ # email_enabled: true
# Email address used in the "From" field in mails sent by GitLab
email_from: example@example.com
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 7e7c91ced77..27bb83784ba 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -61,7 +61,6 @@ Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil?
if Settings.ldap['enabled'] || Rails.env.test?
if Settings.ldap['host'].present?
server = Settings.ldap.except('sync_time')
- server['label'] = 'LDAP'
server['provider_name'] = 'ldap'
Settings.ldap['servers'] = {
'ldap' => server
@@ -69,6 +68,7 @@ if Settings.ldap['enabled'] || Rails.env.test?
end
Settings.ldap['servers'].each do |key, server|
+ server['label'] ||= 'LDAP'
server['allow_username_or_email_login'] = false if server['allow_username_or_email_login'].nil?
server['active_directory'] = true if server['active_directory'].nil?
server['provider_name'] ||= "ldap#{key}".downcase
@@ -95,6 +95,7 @@ Settings.gitlab['https'] = false if Settings.gitlab['https'].nil?
Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80
Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http"
+Settings.gitlab['email_enabled'] ||= true if Settings.gitlab['email_enabled'].nil?
Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'
@@ -103,6 +104,7 @@ Settings.gitlab['user_home'] ||= begin
rescue ArgumentError # no user configured
'/home/' + Settings.gitlab['user']
end
+Settings.gitlab['time_zone'] ||= nil
Settings.gitlab['signup_enabled'] ||= false
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'], [])
diff --git a/config/initializers/4_sidekiq.rb b/config/initializers/4_sidekiq.rb
index 228b14cb526..75c543c0f47 100644
--- a/config/initializers/4_sidekiq.rb
+++ b/config/initializers/4_sidekiq.rb
@@ -14,7 +14,8 @@ Sidekiq.configure_server do |config|
}
config.server_middleware do |chain|
- chain.add Gitlab::SidekiqMiddleware::ArgumentsLogger
+ chain.add Gitlab::SidekiqMiddleware::ArgumentsLogger if ENV['SIDEKIQ_LOG_ARGUMENTS']
+ chain.add Gitlab::SidekiqMiddleware::MemoryKiller if ENV['SIDEKIQ_MAX_RSS']
end
end
diff --git a/config/initializers/7_omniauth.rb b/config/initializers/7_omniauth.rb
index b8ac87fbd5a..18759f0cfb0 100644
--- a/config/initializers/7_omniauth.rb
+++ b/config/initializers/7_omniauth.rb
@@ -1,7 +1,8 @@
if Gitlab::LDAP::Config.enabled?
module OmniAuth::Strategies
server = Gitlab.config.ldap.servers.values.first
- const_set(server['provider_class'], Class.new(LDAP))
+ klass = server['provider_class']
+ const_set(klass, Class.new(LDAP)) unless klass == 'LDAP'
end
OmniauthCallbacksController.class_eval do
diff --git a/config/initializers/disable_email_interceptor.rb b/config/initializers/disable_email_interceptor.rb
new file mode 100644
index 00000000000..c76a6b8b19f
--- /dev/null
+++ b/config/initializers/disable_email_interceptor.rb
@@ -0,0 +1,2 @@
+# Interceptor in lib/disable_email_interceptor.rb
+ActionMailer::Base.register_interceptor(DisableEmailInterceptor) unless Gitlab.config.gitlab.email_enabled
diff --git a/config/initializers/gitlab_shell_secret_token.rb b/config/initializers/gitlab_shell_secret_token.rb
new file mode 100644
index 00000000000..8d2b771e535
--- /dev/null
+++ b/config/initializers/gitlab_shell_secret_token.rb
@@ -0,0 +1,19 @@
+# Be sure to restart your server when you modify this file.
+
+require 'securerandom'
+
+# Your secret key for verifying the gitlab_shell.
+
+
+secret_file = Rails.root.join('.gitlab_shell_secret')
+gitlab_shell_symlink = File.join(Gitlab.config.gitlab_shell.path, '.gitlab_shell_secret')
+
+unless File.exist? secret_file
+ # Generate a new token of 16 random hexadecimal characters and store it in secret_file.
+ token = SecureRandom.hex(16)
+ File.write(secret_file, token)
+end
+
+if File.exist?(Gitlab.config.gitlab_shell.path) && !File.exist?(gitlab_shell_symlink)
+ FileUtils.symlink(secret_file, gitlab_shell_symlink)
+end \ No newline at end of file
diff --git a/config/initializers/time_zone.rb b/config/initializers/time_zone.rb
new file mode 100644
index 00000000000..ee246e67d66
--- /dev/null
+++ b/config/initializers/time_zone.rb
@@ -0,0 +1 @@
+Time.zone = Gitlab.config.gitlab.time_zone || Time.zone
diff --git a/config/routes.rb b/config/routes.rb
index 3edc78cee33..7480f7cdc85 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -137,7 +137,8 @@ Gitlab::Application.routes.draw do
end
end
- match "/u/:username" => "users#show", as: :user, constraints: { username: /.*/ }, via: :get
+ match "/u/:username" => "users#show", as: :user,
+ constraints: {username: /(?:[^.]|\.(?!atom$))+/, format: /atom/}, via: :get
#
# Dashboard Area
@@ -181,15 +182,12 @@ Gitlab::Application.routes.draw do
resources :projects, constraints: { id: /[a-zA-Z.0-9_\-]+\/[a-zA-Z.0-9_\-]+/ }, except: [:new, :create, :index], path: "/" do
member do
put :transfer
- post :fork
post :archive
post :unarchive
post :upload_image
post :toggle_star
get :markdown_preview
get :autocomplete_sources
- get :import
- put :retry_import
end
scope module: :projects do
@@ -215,11 +213,11 @@ Gitlab::Application.routes.draw do
match "/compare/:from...:to" => "compare#show", as: "compare", via: [:get, :post], constraints: {from: /.+/, to: /.+/}
- resources :snippets, constraints: {id: /\d+/} do
- member do
- get "raw"
- end
+ resources :snippets, constraints: {id: /\d+/} do
+ member do
+ get "raw"
end
+ end
resources :wikis, only: [:show, :edit, :destroy, :create], constraints: {id: /[a-zA-Z.0-9_\-\/]+/} do
collection do
@@ -233,7 +231,10 @@ Gitlab::Application.routes.draw do
end
end
- resource :repository, only: [:show] do
+ resource :fork, only: [:new, :create]
+ resource :import, only: [:new, :create, :show]
+
+ resource :repository, only: [:show, :create] do
member do
get "archive", constraints: { format: Gitlab::Regex.archive_formats_regex }
end
diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example
index 6833082d68b..ea22744fd90 100644
--- a/config/unicorn.rb.example
+++ b/config/unicorn.rb.example
@@ -15,6 +15,7 @@
# Use at least one worker per core if you're on a dedicated server,
# more will usually help for _short_ waits on databases/caches.
+# The minimum is 2
worker_processes 2
# Since Unicorn is never exposed to outside clients, it does not need to