From acf64d3524abc7e358a26d029c764e71b820af9d Mon Sep 17 00:00:00 2001 From: ChrisDoernen Date: Thu, 5 Mar 2020 21:34:50 +0100 Subject: [PATCH 1/2] Add input parameter to enforce ssl encryption --- README.md | 2 ++ action.yml | 4 ++++ entrypoint.sh | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ac3687..a6e8991 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ jobs: host: ${{ secrets.FTP_SERVER }} user: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} + forceSsl: true localDir: "dist" remoteDir: "www" ``` @@ -30,5 +31,6 @@ Input parameter | Description | Required | Default host | FTP server name | Yes | N/A user | FTP username | Yes | N/A password | FTP password | Yes | N/A +forceSsl | Force SSL encryption | No | false localDir | The local directory to copy | No | . remoteDir | The remote directory to copy to | No | . diff --git a/action.yml b/action.yml index 903df30..2f21399 100644 --- a/action.yml +++ b/action.yml @@ -11,6 +11,10 @@ inputs: password: description: 'FTP password' required: true + forceSsl: + description: 'Force SSL encryption' + required: false + default: false localDir: description: 'Local directory' required: false diff --git a/entrypoint.sh b/entrypoint.sh index d134a62..fabd34d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,3 @@ #!/bin/sh -l -lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ssl:verify-certificate false; mirror --reverse --continue --dereference -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" +lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ftp:ssl-force $INPUT_FORCESSL; set ssl:verify-certificate false; mirror --reverse --continue --dereference -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit" From 169e275151698816e35a872c7a84a9f84355569d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20D=C3=B6rnen?= <32569989+ChrisDoernen@users.noreply.github.com> Date: Mon, 9 Mar 2020 20:07:47 +0100 Subject: [PATCH 2/2] Default values should be a string --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 2f21399..86ea246 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,7 @@ inputs: forceSsl: description: 'Force SSL encryption' required: false - default: false + default: 'false' localDir: description: 'Local directory' required: false