[ARVADOS] updated: 1.3.0-2837-g4da1edec9
Git user
git at public.arvados.org
Mon Aug 3 22:07:01 UTC 2020
Summary of changes:
services/api/config/arvados_config.rb | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
via 4da1edec9c50c7adef8ab9fa500d5f3c40fb296f (commit)
from 4d3b8b299deaa4fff45102a26768e26129b17f10 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 4da1edec9c50c7adef8ab9fa500d5f3c40fb296f
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..035a3972f 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,14 +278,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
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list