From a282b78c31be363a4fa5869c59588aa39da57b88 Mon Sep 17 00:00:00 2001 From: Yaohan Chen Date: Fri, 4 Apr 2014 11:13:02 -0400 Subject: Make PhantomJS read password from environment This way the password is not included in the command line of the phantomjs process. --- discover-url.coffee | 4 +++- hib-dlagent | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/discover-url.coffee b/discover-url.coffee index 4dbc66b..bd7bcba 100644 --- a/discover-url.coffee +++ b/discover-url.coffee @@ -1,5 +1,7 @@ system = require 'system' -[_, listing_page, filename, username, password] = system.args +[_, listing_page, filename, username] = system.args +password = system.env.PASSWORD +system.env.PASSWORD = '' util = require './util' page = util.page diff --git a/hib-dlagent b/hib-dlagent index 0396633..9863a2e 100755 --- a/hib-dlagent +++ b/hib-dlagent @@ -20,9 +20,10 @@ STORAGE= discover_url() { local LISTING_PAGE="$1" # Running a new shell in order to split PHANTOM_JS_OPTIONS into multiple arguments + PASSWORD="$PASSWORD" \ sh -c "phantomjs --config='$CONFIG_PATH'/phantomjs-config.json --cookies-file='$COOKIE_JAR' \ $PHANTOM_JS_OPTIONS \ - '$SCRIPT_PATH'/discover-url.coffee '$LISTING_PAGE' '$FILE' '$USERNAME' '$PASSWORD'" + '$SCRIPT_PATH'/discover-url.coffee '$LISTING_PAGE' '$FILE' '$USERNAME'" } usage() { -- cgit v1.2.3-70-g09d2