X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1e3eacb0ca6f2228f50f13514c7577a149a707e6..2be95ce7f069d9eb131b0d2d922a5e556f75810c:/services/api/config/arvados_config.rb?ds=sidebyside diff --git a/services/api/config/arvados_config.rb b/services/api/config/arvados_config.rb index 8d2544dde1..f63f8af033 100644 --- a/services/api/config/arvados_config.rb +++ b/services/api/config/arvados_config.rb @@ -37,8 +37,8 @@ EOS # Real values will be copied from globals by omniauth_init.rb. For # now, assign some strings so the generic *.yml config loader # doesn't overwrite them or complain that they're missing. - Rails.configuration.Login["ProviderAppID"] = 'xxx' - Rails.configuration.Login["ProviderAppSecret"] = 'xxx' + Rails.configuration.Login["SSO"]["ProviderAppID"] = 'xxx' + Rails.configuration.Login["SSO"]["ProviderAppSecret"] = 'xxx' Rails.configuration.Services["SSO"]["ExternalURL"] = '//xxx' WARNED_OMNIAUTH_CONFIG = true end @@ -106,8 +106,8 @@ arvcfg.declare_config "Users.EmailSubjectPrefix", String, :email_subject_prefix arvcfg.declare_config "Users.UserNotifierEmailFrom", String, :user_notifier_email_from arvcfg.declare_config "Users.NewUserNotificationRecipients", Hash, :new_user_notification_recipients, ->(cfg, k, v) { arrayToHash cfg, "Users.NewUserNotificationRecipients", v } arvcfg.declare_config "Users.NewInactiveUserNotificationRecipients", Hash, :new_inactive_user_notification_recipients, method(:arrayToHash) -arvcfg.declare_config "Login.ProviderAppSecret", String, :sso_app_secret -arvcfg.declare_config "Login.ProviderAppID", String, :sso_app_id +arvcfg.declare_config "Login.SSO.ProviderAppSecret", String, :sso_app_secret +arvcfg.declare_config "Login.SSO.ProviderAppID", String, :sso_app_id arvcfg.declare_config "Login.LoginCluster", String arvcfg.declare_config "Login.RemoteTokenRefresh", ActiveSupport::Duration arvcfg.declare_config "TLS.Insecure", Boolean, :sso_insecure @@ -190,6 +190,7 @@ dbcfg.declare_config "PostgreSQL.Connection.password", String, :password dbcfg.declare_config "PostgreSQL.Connection.dbname", String, :database dbcfg.declare_config "PostgreSQL.Connection.template", String, :template dbcfg.declare_config "PostgreSQL.Connection.encoding", String, :encoding +dbcfg.declare_config "PostgreSQL.Connection.collation", String, :collation application_config = {} %w(application.default application).each do |cfgfile| @@ -253,6 +254,13 @@ end if ::Rails.env.to_s == "test" && db_config["test"].nil? $arvados_config["PostgreSQL"]["Connection"]["dbname"] = "arvados_test" end +if ::Rails.env.to_s == "test" + # Use template0 when creating a new database. Avoids + # character-encoding/collation problems. + $arvados_config["PostgreSQL"]["Connection"]["template"] = "template0" + # Some test cases depend on en_US.UTF-8 collation. + $arvados_config["PostgreSQL"]["Connection"]["collation"] = "en_US.UTF-8" +end if $arvados_config["PostgreSQL"]["Connection"]["password"].empty? raise "Database password is empty, PostgreSQL section is: #{$arvados_config["PostgreSQL"]}" @@ -274,6 +282,7 @@ ENV["DATABASE_URL"] = "postgresql://#{$arvados_config["PostgreSQL"]["Connection" "#{dbhost}/#{$arvados_config["PostgreSQL"]["Connection"]["dbname"]}?"+ "template=#{$arvados_config["PostgreSQL"]["Connection"]["template"]}&"+ "encoding=#{$arvados_config["PostgreSQL"]["Connection"]["client_encoding"]}&"+ + "collation=#{$arvados_config["PostgreSQL"]["Connection"]["collation"]}&"+ "pool=#{$arvados_config["PostgreSQL"]["ConnectionPool"]}" Server::Application.configure do