From a046be092b2b0fae8755ff7ed1248b87f0674a4a Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 31 Dec 2019 09:46:38 +0800 Subject: [PATCH] docs: add passphrase example Signed-off-by: Bo-Yi Wu --- DOCS.md | 23 +++++++++++++++++++++++ main.go | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/DOCS.md b/DOCS.md index c379573..fed8677 100644 --- a/DOCS.md +++ b/DOCS.md @@ -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 diff --git a/main.go b/main.go index 9c25784..4635117 100644 --- a/main.go +++ b/main.go @@ -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{