Skip to content
Snippets Groups Projects
Commit e0131c5d authored by Valery Sizov's avatar Valery Sizov
Browse files

Merge branch 'rails_update_to_4_2' into 'master'

Rails update to 4.2.4

https://gitlab.com/gitlab-org/gitlab-ce/issues/2694

See merge request !1902
parents a8e05cec f1504e1a
No related branches found
No related tags found
No related merge requests found
Showing
with 90 additions and 85 deletions
Loading
Loading
@@ -99,6 +99,10 @@ module Gitlab
redis_config_hash[:expires_in] = 2.weeks # Cache should not grow forever
config.cache_store = :redis_store, redis_config_hash
 
config.active_record.raise_in_transactional_callbacks = true
config.active_job.queue_adapter = :sidekiq
# This is needed for gitlab-shell
ENV['GITLAB_PATH_OUTSIDE_HOOK'] = ENV['PATH']
end
Loading
Loading
Loading
Loading
@@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)
 
# Initialize the rails application
Gitlab::Application.initialize!
Rails.application.initialize!
Gitlab::Application.configure do
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb
 
# In the development environment your application's code is reloaded on
Loading
Loading
Gitlab::Application.configure do
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb
 
# Code is not reloaded between requests
Loading
Loading
@@ -9,7 +9,7 @@ Gitlab::Application.configure do
config.action_controller.perform_caching = true
 
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
config.serve_static_files = false
 
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
Loading
Loading
Gitlab::Application.configure do
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb
 
# The test environment is used exclusively to run your application's
Loading
Loading
@@ -8,7 +8,7 @@ Gitlab::Application.configure do
config.cache_classes = false
 
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"
 
# Show full error reports and disable caching
Loading
Loading
@@ -32,4 +32,6 @@ Gitlab::Application.configure do
config.eager_load = false
 
config.cache_store = :null_store
config.active_job.queue_adapter = :test
end
# Be sure to restart your server when you modify this file.
 
Gitlab::Application.config.action_dispatch.cookies_serializer = :hybrid
Rails.application.config.action_dispatch.cookies_serializer = :hybrid
Loading
Loading
@@ -8,4 +8,4 @@ unless Gitlab.config.gitlab_on_standard_port?
default_url_options[:port] = Gitlab.config.gitlab.port
end
 
Gitlab::Application.routes.default_url_options = default_url_options
Rails.application.routes.default_url_options = default_url_options
Loading
Loading
@@ -4,13 +4,13 @@
# If you change this file in a Merge Request, please also create a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
 
paths_to_be_protected = [
"#{Gitlab::Application.config.relative_url_root}/users/password",
"#{Gitlab::Application.config.relative_url_root}/users/sign_in",
"#{Gitlab::Application.config.relative_url_root}/api/#{API::API.version}/session.json",
"#{Gitlab::Application.config.relative_url_root}/api/#{API::API.version}/session",
"#{Gitlab::Application.config.relative_url_root}/users",
"#{Gitlab::Application.config.relative_url_root}/users/confirmation",
"#{Gitlab::Application.config.relative_url_root}/unsubscribes/"
"#{Rails.application.config.relative_url_root}/users/password",
"#{Rails.application.config.relative_url_root}/users/sign_in",
"#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session.json",
"#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session",
"#{Rails.application.config.relative_url_root}/users",
"#{Rails.application.config.relative_url_root}/users/confirmation",
"#{Rails.application.config.relative_url_root}/unsubscribes/"
 
]
 
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
# with darker backgrounds. This patch tweaks the colors a bit so the output is
# actually readable.
if Rails.env.development? and RUBY_ENGINE == 'ruby' and ENV['ENABLE_LINEPROF']
Gitlab::Application.config.middleware.use(Rack::Lineprof)
Rails.application.config.middleware.use(Rack::Lineprof)
 
module Rack
class Lineprof
Loading
Loading
Loading
Loading
@@ -22,15 +22,15 @@ def find_secure_token
end
end
 
Gitlab::Application.config.secret_token = find_secure_token
Gitlab::Application.config.secret_key_base = find_secure_token
Rails.application.config.secret_token = find_secure_token
Rails.application.config.secret_key_base = find_secure_token
 
# CI
def generate_new_secure_token
SecureRandom.hex(64)
end
 
if Gitlab::Application.secrets.db_key_base.blank?
if Rails.application.secrets.db_key_base.blank?
warn "Missing `db_key_base` for '#{Rails.env}' environment. The secrets will be generated and stored in `config/secrets.yml`"
 
all_secrets = YAML.load_file('config/secrets.yml') if File.exist?('config/secrets.yml')
Loading
Loading
@@ -46,5 +46,5 @@ if Gitlab::Application.secrets.db_key_base.blank?
file.write(YAML.dump(all_secrets))
end
 
Gitlab::Application.secrets.db_key_base = env_secrets['db_key_base']
Rails.application.secrets.db_key_base = env_secrets['db_key_base']
end
Loading
Loading
@@ -13,11 +13,11 @@ end
unless Rails.env.test?
Gitlab::Application.config.session_store(
:redis_store, # Using the cookie_store would enable session replay attacks.
servers: Gitlab::Application.config.cache_store[1].merge(namespace: 'session:gitlab'), # re-use the Redis config from the Rails cache store
servers: Rails.application.config.cache_store[1].merge(namespace: 'session:gitlab'), # re-use the Redis config from the Rails cache store
key: '_gitlab_session',
secure: Gitlab.config.gitlab.https,
httponly: true,
expire_after: Settings.gitlab['session_expire_delay'] * 60,
path: (Gitlab::Application.config.relative_url_root.nil?) ? '/' : Gitlab::Application.config.relative_url_root
path: (Rails.application.config.relative_url_root.nil?) ? '/' : Gitlab::Application.config.relative_url_root
)
end
if Gitlab::Sherlock.enabled?
Gitlab::Application.configure do |config|
Rails.application.configure do |config|
config.middleware.use(Gitlab::Sherlock::Middleware)
end
end
Loading
Loading
@@ -8,7 +8,7 @@
# If you change this file in a Merge Request, please also create a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
 
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
Rails.application.config.action_mailer.delivery_method = :smtp
 
ActionMailer::Base.smtp_settings = {
address: "email.server.com",
Loading
Loading
app = Gitlab::Application
app = Rails.application
 
if app.config.serve_static_assets
if app.config.serve_static_files
# The `ActionDispatch::Static` middleware intercepts requests for static files
# by checking if they exist in the `/public` directory.
# We're replacing it with our `Gitlab::Middleware::Static` that does the same,
Loading
Loading
require 'sidekiq/web'
require 'api/api'
 
Gitlab::Application.routes.draw do
Rails.application.routes.draw do
if Gitlab::Sherlock.enabled?
namespace :sherlock do
resources :transactions, only: [:index, :show] do
Loading
Loading
This diff is collapsed.
Loading
Loading
@@ -46,7 +46,7 @@ module Gitlab
end
 
def github_options
OmniAuth::Strategies::GitHub.default_options[:client_options].symbolize_keys
OmniAuth::Strategies::GitHub.default_options[:client_options].to_h.symbolize_keys
end
end
end
Loading
Loading
Loading
Loading
@@ -75,7 +75,7 @@ module Gitlab
end
 
def gitlab_options
OmniAuth::Strategies::GitLab.default_options[:client_options].symbolize_keys
OmniAuth::Strategies::GitLab.default_options[:client_options].to_h.symbolize_keys
end
end
end
Loading
Loading
Loading
Loading
@@ -60,8 +60,7 @@ module Gitlab
def url_for_label(project, label)
h = Gitlab::Application.routes.url_helpers
h.namespace_project_issues_path(project.namespace, project,
label_name: label.name,
only_path: context[:only_path])
label_name: label.name)
end
 
def render_colored_label(label)
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ module Gitlab
 
def self.mute_mailer
code = <<-eos
def Notify.delay
def Notify.deliver_later
self
end
eos
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment