[ARVADOS] created: 1.3.0-2836-g6e1e0086e
Git user
git at public.arvados.org
Mon Aug 3 19:18:10 UTC 2020
at 6e1e0086e3dbb9c6c55a186ff081df638df25124 (commit)
commit 6e1e0086e3dbb9c6c55a186ff081df638df25124
Author: medcelerate <32549017+medcelerate at users.noreply.github.com>
Date: Mon Jul 27 13:00:30 2020 -0400
16625: Added fix to prevent ruby from failing when @ appears in the user for the database config.
Added escaping to password and dbname.
refs #16625
Arvados-DCO-1.1-Signed-off-by: Evan Clark <evan.clark.professional at gmail.com>
diff --git a/services/api/config/arvados_config.rb b/services/api/config/arvados_config.rb
index f63f8af03..a501f8dbe 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'
@@ -277,13 +278,15 @@ 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"]}"
+ "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
@@ -294,3 +297,4 @@ Server::Application.configure do
ConfigLoader.copy_into_config $remaining_config, config
secrets.secret_key_base = $arvados_config["API"]["RailsSessionSecretToken"]
end
+
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list