[DRE-commits] [SCM] redmine.git branch, master-experimental, updated. debian/1.4.4+dfsg1-1-44-ga5600f5

Ondřej Surý ondrej at sury.org
Mon Dec 10 11:34:45 UTC 2012


The following commit has been merged in the master-experimental branch:
commit e937553fda05b60bb8f02124c0ca0d1c82907f3f
Author: Ondřej Surý <ondrej at sury.org>
Date:   Mon Dec 10 11:50:38 2012 +0100

    Load session.yml only if the file exists

diff --git a/debian/patches/2003_externalize_session_config.patch b/debian/patches/2003_externalize_session_config.patch
index d8a30fc..f213291 100644
--- a/debian/patches/2003_externalize_session_config.patch
+++ b/debian/patches/2003_externalize_session_config.patch
@@ -50,7 +50,7 @@ Last-Update: 2010-01-10
 -task :generate_secret_token => ['config/initializers/secret_token.rb']
 --- a/config/application.rb
 +++ b/config/application.rb
-@@ -61,7 +61,16 @@ module RedmineApp
+@@ -61,7 +61,20 @@ module RedmineApp
  
      config.action_mailer.perform_deliveries = false
  
@@ -59,12 +59,16 @@ Last-Update: 2010-01-10
 +    # this is needed here because initializers are loaded after plugins,
 +    # and some plugins initialize ActionController which requires a secret to be set.
 +    # crash if file not found
-+    filename = ENV['RAILS_ETC'] ? File.join(ENV['RAILS_ETC'], 'session.yml') : File.join(File.dirname(__FILE__), '..', 'session.yml')
-+    sessionconfig = YAML::load_file(filename)
 +    relativeUrlRoot = ENV['RAILS_RELATIVE_URL_ROOT']
-+
-+    config.session_store :cookie_store, :key => sessionconfig[Rails.env]['key'], :path => (relativeUrlRoot.blank?) ? '/' : relativeUrlRoot
-+    config.secret_token = sessionconfig[Rails.env]['secret']
++    filename = ENV['RAILS_ETC'] ? File.join(ENV['RAILS_ETC'], 'session.yml') : File.join(File.dirname(__FILE__), '..', 'session.yml')
++    if File.exists?(filename)
++      sessionconfig = YAML::load_file(filename)
++      config.session_store :cookie_store, :key => sessionconfig[Rails.env]['key'], :path => (relativeUrlRoot.blank?) ? '/' : relativeUrlRoot
++      config.secret_token = sessionconfig[Rails.env]['secret']
++    else
++      # temporary settings before session.yml is created
++      config.session_store :cookie_store, :key => '_redmine_session', :path => (relativeUrlRoot.blank?) ? '/' : relativeUrlRoot
++    end
  
      # log path
      config.paths['log'] = File.join(ENV['RAILS_LOG'], "#{Rails.env}.log") unless !ENV['RAILS_LOG']

-- 
redmine.git



More information about the Pkg-ruby-extras-commits mailing list