diff --git a/.gitignore b/.gitignore index af64fae5..61d87a69 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ db/*.sqlite3 log/*.log tmp/**/* +Capfile diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4ba144ae..5aaa42f6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,11 +5,7 @@ module ApplicationHelper end def auth_server_icon_url - # TODO: if auth servers expand, don't hardcode path - URI::HTTP.build( - :host => Openneo::Auth.config.auth_server, - :path => '/favicon.png' - ).to_s + "http://#{Openneo::Auth.config.auth_server}/favicon.png" end def body_class diff --git a/config/.gitignore b/config/.gitignore index b5649dd0..ec2c36e4 100644 --- a/config/.gitignore +++ b/config/.gitignore @@ -1 +1,3 @@ database.yml +deploy.rb +openneo_auth.yml diff --git a/config/environments/development.rb b/config/environments/development.rb index fdce68a7..3a320a36 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -21,8 +21,3 @@ OpenneoImpressItems::Application.configure do end RemoteImpressHost = 'beta.impress.openneo.net' -OPENNEO_AUTH_CONFIG = { - :app => 'beta.items.impress', - :auth_server => 'openneo-id', - :secret => 'zaheh2draswAb8eneca$3an?2ADAsTuwra8h7BujUBr_w--p2-a@e?u!taQux3tr' -} diff --git a/config/environments/development_async.rb b/config/environments/development_async.rb index 9b82847a..6f7f8c49 100644 --- a/config/environments/development_async.rb +++ b/config/environments/development_async.rb @@ -25,9 +25,3 @@ end RemoteImpressHost = 'beta.impress.openneo.net' USE_FIBER_POOL = true - -OPENNEO_AUTH_CONFIG = { - :app => 'beta.items.impress', - :auth_server => 'beta.id.openneo.net', - :secret => 'zaheh2draswAb8eneca$3an?2ADAsTuwra8h7BujUBr_w--p2-a@e?u!taQux3tr' -} diff --git a/config/initializers/warden.rb b/config/initializers/warden.rb index e574f4b9..4f5358cb 100644 --- a/config/initializers/warden.rb +++ b/config/initializers/warden.rb @@ -4,9 +4,10 @@ Rails.configuration.middleware.use RailsWarden::Manager do |manager| end require 'openneo-auth' +require 'yaml' Openneo::Auth.configure do |config| - OPENNEO_AUTH_CONFIG.each do |key, value| + YAML.load_file(Rails.root.join('config', 'openneo_auth.yml'))[Rails.env].each do |key, value| config.send("#{key}=", value) end