This is an automated email from the ASF dual-hosted git repository.

daisyguo pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-deploy-kube.git


The following commit(s) were added to refs/heads/master by this push:
     new 28023ee  avoid embedding username:password directly in the URL 
initdb.sh (#412)
28023ee is described below

commit 28023eea7f7a981dc46858e3cf8ebdacf9cc0d7c
Author: David Grove <[email protected]>
AuthorDate: Tue Jan 22 21:36:11 2019 -0500

    avoid embedding username:password directly in the URL initdb.sh (#412)
    
    Partially fixes #406.
    
    By using the -u option to curl we can avoid problems with
    special characters in passwords that are not valid in URLs.
---
 helm/openwhisk/configMapFiles/initCouchDB/initdb.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/helm/openwhisk/configMapFiles/initCouchDB/initdb.sh 
b/helm/openwhisk/configMapFiles/initCouchDB/initdb.sh
index 4c03139..b42a1e9 100755
--- a/helm/openwhisk/configMapFiles/initCouchDB/initdb.sh
+++ b/helm/openwhisk/configMapFiles/initCouchDB/initdb.sh
@@ -32,11 +32,11 @@ done
 
 # Enable single node mode (this also creates the system databases)
 echo "Enabling single node cluster"
-curl --silent -X POST -H "Content-Type: application/json" 
$DB_PROTOCOL://$COUCHDB_USER:$COUCHDB_PASSWORD@$DB_HOST:$DB_PORT/_cluster_setup 
-d '{"action": "enable_single_node"}'
+curl --silent -X POST -H "Content-Type: application/json" -u 
"$COUCHDB_USER:$COUCHDB_PASSWORD" 
$DB_PROTOCOL://$DB_HOST:$DB_PORT/_cluster_setup -d '{"action": 
"enable_single_node"}' || exit 1
 
 # disable reduce limits on views
 echo "Disabling reduce limits on views"
-curl --silent -X PUT 
$DB_PROTOCOL://$COUCHDB_USER:$COUCHDB_PASSWORD@$DB_HOST:$DB_PORT/_node/couchdb@$NODENAME/_config/query_server_config/reduce_limit
 -d '"false"'
+curl --silent -X PUT -u "$COUCHDB_USER:$COUCHDB_PASSWORD" 
$DB_PROTOCOL://$DB_HOST:$DB_PORT/_node/couchdb@$NODENAME/_config/query_server_config/reduce_limit
 -d '"false"' || exit 1
 
 
 # initialize the DB tables for OpenWhisk
@@ -59,6 +59,6 @@ pushd /openwhisk/ansible
 popd
 
 echo "Creating ow_kube_couchdb_initialized_marker database"
-curl --silent -X PUT 
$DB_PROTOCOL://$COUCHDB_USER:$COUCHDB_PASSWORD@$DB_HOST:$DB_PORT/ow_kube_couchdb_initialized_marker
+curl --silent -X PUT -u "$COUCHDB_USER:$COUCHDB_PASSWORD" 
$DB_PROTOCOL://$DB_HOST:$DB_PORT/ow_kube_couchdb_initialized_marker || exit 1
 
 echo "successfully initialized CouchDB for OpenWhisk"

Reply via email to