Skip to content

Commit

Permalink
Don't allow unmasked password entry via --instance
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Jan 26, 2018
1 parent f6f2cb0 commit a7d0a9f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ To upgrade to the latest version

### To a specific Medic instance

medic-conf --instance username:password@instance-name.dev
medic-conf --instance instance-name.dev

Username `admin` is used. A prompt is shown for entering password.

### To an arbitrary URL

Expand Down
3 changes: 2 additions & 1 deletion bin/medic-conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ switch(args[0]) {

//> instance URL handling:
case '--instance':
instanceUrl = `https://${args[1]}.medicmobile.org`;
const password = readline.question('🔑 Password: ', { hideEchoBack:true })
instanceUrl = `https://admin:${password}@${args[1]}.medicmobile.org`;
shift(2);
break;
case '--local':
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "medic-conf",
"version": "1.10.0",
"version": "1.10.1",
"description": "Configure Medic Mobile deployments",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/cli/usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ${bold('SPECIFYING URL')}
--local
Upload to http://admin:pass@localhost:5988
--instance <username:password@instance-name>
Upload to https://username:password@instance-name.medicmobile.org
--instance <instance-name>
Upload to https://admin:<password>@instance-name.medicmobile.org
--url <url>
Upload to URL specified.
Expand Down

0 comments on commit a7d0a9f

Please sign in to comment.