X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/374cc9ffdd945cec08abbc3ff91b4b2b147cd840..2dab77693f534331324293aac49a36dc43119186:/services/api/config/arvados_config.rb diff --git a/services/api/config/arvados_config.rb b/services/api/config/arvados_config.rb index 7dc6481008..69b20420ab 100644 --- a/services/api/config/arvados_config.rb +++ b/services/api/config/arvados_config.rb @@ -16,6 +16,7 @@ # config:migrate to /etc/arvados/config.yml, you will be able to # delete application.yml and database.yml. +require "cgi" require 'config_loader' require 'open3' @@ -109,7 +110,9 @@ arvcfg.declare_config "Users.NewInactiveUserNotificationRecipients", Hash, :new_ 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.TrustedClients", Hash arvcfg.declare_config "Login.RemoteTokenRefresh", ActiveSupport::Duration +arvcfg.declare_config "Login.TokenLifetime", ActiveSupport::Duration arvcfg.declare_config "TLS.Insecure", Boolean, :sso_insecure arvcfg.declare_config "Services.SSO.ExternalURL", String, :sso_provider_url arvcfg.declare_config "AuditLogs.MaxAge", ActiveSupport::Duration, :max_audit_log_age @@ -190,6 +193,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| @@ -257,6 +261,8 @@ 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? @@ -274,13 +280,16 @@ end # For config migration, we've previously populated the PostgreSQL # section of the config from database.yml # -ENV["DATABASE_URL"] = "postgresql://#{$arvados_config["PostgreSQL"]["Connection"]["user"]}:"+ - "#{$arvados_config["PostgreSQL"]["Connection"]["password"]}@"+ - "#{dbhost}/#{$arvados_config["PostgreSQL"]["Connection"]["dbname"]}?"+ +database_url = "postgresql://#{CGI.escape $arvados_config["PostgreSQL"]["Connection"]["user"]}:"+ + "#{CGI.escape $arvados_config["PostgreSQL"]["Connection"]["password"]}@"+ + "#{dbhost}/#{CGI.escape $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"]}" +ENV["DATABASE_URL"] = database_url + Server::Application.configure do # Copy into the Rails config object. This also turns Hash into # OrderedOptions so that application code can use