diff --git a/config/initializers/external_apis/dmphub.rb b/config/initializers/external_apis/dmphub.rb index 8f9b19bd1..838cc6671 100644 --- a/config/initializers/external_apis/dmphub.rb +++ b/config/initializers/external_apis/dmphub.rb @@ -8,12 +8,19 @@ # Credentials for minting DOIs via a DMPHub system: https://github.com/CDLUC3/dmphub # To disable this feature, simply set 'active' to false Rails.configuration.x.dmphub.landing_page_url = "https://doi.org/" -Rails.configuration.x.dmphub.api_base_url = "http://localhost:3001/api/v0/" # "https://dmphub-stg.cdlib.org/api/v0/" Rails.configuration.x.dmphub.auth_path = "authenticate" Rails.configuration.x.dmphub.mint_path = "data_management_plans" Rails.configuration.x.dmphub.update_path = "data_management_plans" Rails.configuration.x.dmphub.delete_path = "data_management_plans" -Rails.configuration.x.dmphub.client_id = "E0rukf2HM3DuQbWESclCzddYOY9j44ZJkflwoKhM6vM" # Rails.application.credentials.dmphub[:client_id] -Rails.configuration.x.dmphub.client_secret = "H3YtnycXQfFH6Lxbx7Sbazsx-DNKij8Z3Nsndfe4g6I" # Rails.application.credentials.dmphub[:client_secret] +if Rails.env.development? + Rails.configuration.x.dmphub.api_base_url = "http://localhost:3001/api/v0/" + Rails.configuration.x.dmphub.client_id = "E0rukf2HM3DuQbWESclCzddYOY9j44ZJkflwoKhM6vM" + Rails.configuration.x.dmphub.client_secret = "H3YtnycXQfFH6Lxbx7Sbazsx-DNKij8Z3Nsndfe4g6I" +else + Rails.configuration.x.dmphub.api_base_url = ENV["DMPHUB_URL"] + Rails.configuration.x.dmphub.client_id = Rails.application.credentials.dmphub[:client_id] + Rails.configuration.x.dmphub.client_secret = Rails.application.credentials.dmphub[:client_secret] +end + Rails.configuration.x.dmphub.active = true