Configure OSEM via environment variables

Instead of reading a yaml file we get configuration from the
environment.
This commit is contained in:
Henne Vogelsang 2016-03-22 18:14:40 +01:00
parent 45c31f210f
commit ebcb2780cd
17 changed files with 39 additions and 34 deletions

View file

@ -274,8 +274,10 @@ module ApplicationHelper
unless Rails.application.secrets.send(provider_key).blank? || Rails.application.secrets.send(provider_secret).blank?
providers << provider
end
providers << provider if !ENV["OSEM_#{provider.upcase}_KEY"].blank? && !ENV["OSEM_#{provider.upcase}_SECRET"].blank?
end
return providers
return providers.uniq
end
# Receives a hash, generated from User model, function get_roles
@ -294,7 +296,7 @@ module ApplicationHelper
end
def sign_in_path
if CONFIG['authentication']['ichain']['enabled']
if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
new_user_ichain_session_path
else
new_user_session_path
@ -302,7 +304,7 @@ module ApplicationHelper
end
def sign_up_path
if CONFIG['authentication']['ichain']['enabled']
if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
new_user_ichain_registration_path
else
new_user_registration_path