docs: add passphrase example

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2019-12-31 09:46:38 +08:00
parent 6b488f1203
commit a046be092b
2 changed files with 25 additions and 2 deletions

23
DOCS.md
View File

@ -139,6 +139,23 @@ Example configuration for stoping script after first failure:
- echo "you can't see the steps."
```
Example configuration for passphrase which protecting a private key:
```diff
- name: ssh commands
image: appleboy/drone-ssh
settings:
host: foo.com
username: root
+ key:
+ from_secret: ssh_key
+ passphrase: 1234
port: 22
script:
- mkdir abc/def/efg
- echo "you can't see the steps."
```
## Secret Reference
ssh_username
@ -147,6 +164,9 @@ ssh_username
ssh_password
: password for target host user
ssh_passphrase
: The purpose of the passphrase is usually to encrypt the private key.
ssh_key
: plain text of user private key
@ -156,6 +176,9 @@ proxy_ssh_username
proxy_ssh_password
: password for user of proxy server
proxy_ssh_passphrase
: The purpose of the passphrase is usually to encrypt the private key.
proxy_ssh_key
: plain text of user private key for proxy server

View File

@ -40,7 +40,7 @@ func main() {
},
cli.StringFlag{
Name: "ssh-passphrase",
Usage: "ssh passphrase",
Usage: "The purpose of the passphrase is usually to encrypt the private key.",
EnvVar: "PLUGIN_SSH_PASSPHRASE,PLUGIN_PASSPHRASE,SSH_PASSPHRASE,PASSPHRASE,INPUT_PASSPHRASE",
},
cli.StringFlag{
@ -109,7 +109,7 @@ func main() {
},
cli.StringFlag{
Name: "proxy.ssh-passphrase",
Usage: "proxy ssh passphrase",
Usage: "The purpose of the passphrase is usually to encrypt the private key.",
EnvVar: "PLUGIN_PROXY_SSH_PASSPHRASE,PLUGIN_PROXY_PASSPHRASE,PROXY_SSH_PASSPHRASE,PROXY_PASSPHRASE,INPUT_PROXY_PASSPHRASE",
},
cli.StringFlag{