Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add agent option #3

Merged
merged 1 commit into from
Feb 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,22 @@ The root directory where the files will be searched for. By default, this option
RSA key file. You must upload a public key to the remote server before attempting to upload any content.
- `'/Users/User1/.ssh/id_rsa'`

Either this option or `password` must be set.
Either this option, `agent` or `password` must be set.

*Default:* `undefined`

### agent

Path to ssh-agent's UNIX socket for ssh-agent-based user authentication (when your private keys are loaded into your agent). You must upload a public key to the remote server before attempting to upload any content. Windows users: set to 'pageant' for authenticating with Pageant or (actual) path to a cygwin "UNIX socket."
- `process.env.SSH_AUTH_SOCK`

Either this option, `privateKey` or `password` must be set.

*Default:* `undefined`

### password

Password for `remoteUser`. Either this option or `privateKey` must be set.
Password for `remoteUser`. Either this option, `agent` or `privateKey` must be set.

*Default:* `undefined`

Expand Down
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ module.exports = {
privateKey: function(context) {
return context.privateKey;
},
agent: function(context) {
return context.agent;
},
password: function(context) {
return context.password;
}
Expand All @@ -47,6 +50,7 @@ module.exports = {
path: this.readConfig('distDir'),
remoteDir: this.readConfig('remoteDir'),
privateKey: this.readConfig('privateKey') && fs.readFileSync(this.readConfig('privateKey')),
agent: this.readConfig('agent'),
password: this.readConfig('password')
},
sftp = new Sftp(options);
Expand Down