From acf64d3524abc7e358a26d029c764e71b820af9d Mon Sep 17 00:00:00 2001 From: ChrisDoernen Date: Thu, 5 Mar 2020 21:34:50 +0100 Subject: [PATCH 1/5] 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/5] 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 From 1204235acfa086acf73f3c9976a1407e3824d23e Mon Sep 17 00:00:00 2001 From: Sebastian Popp Date: Mon, 16 Mar 2020 10:01:41 +0100 Subject: [PATCH 3/5] use latest alpine image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 83666f5..145c391 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.10 +FROM alpine:3.11 COPY LICENSE README.md / From eb75c5cb29d23ee4a729720a27dfb66403cb0f6d Mon Sep 17 00:00:00 2001 From: Sebastian Popp Date: Mon, 16 Mar 2020 10:45:32 +0100 Subject: [PATCH 4/5] update readme and license --- LICENSE | 2 +- README.md | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index a576e9d..c371d5f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Sebastian Popp +Copyright (c) 2020 Sebastian Popp and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index a6e8991..22ae874 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,13 @@ jobs: name: Deploy runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 - name: Upload ftp - uses: sebastianpopp/ftp-action@releases/v1 + uses: sebastianpopp/ftp-action@releases/v2 with: host: ${{ secrets.FTP_SERVER }} user: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} - forceSsl: true localDir: "dist" remoteDir: "www" ``` @@ -31,6 +30,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 | . +forceSsl | Force SSL encryption | No | false From ca3f8d253d20ddd6aa658f8cb27fc847fd610882 Mon Sep 17 00:00:00 2001 From: hsimah Date: Sun, 31 Jan 2021 11:42:23 -0800 Subject: [PATCH 5/5] Feature/add additional opts (#17) * Update entrypoint.sh * Update action.yml * Update README.md * Update entrypoint.sh * pass through additional mirror options * restore meta-data --- 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 22ae874..50c4a78 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ jobs: password: ${{ secrets.FTP_PASSWORD }} localDir: "dist" remoteDir: "www" + options: "--delete --asci" ``` ## Input parameters @@ -33,3 +34,4 @@ password | FTP password | Yes | N/A localDir | The local directory to copy | No | . remoteDir | The remote directory to copy to | No | . forceSsl | Force SSL encryption | No | false +options | Mirror command options | No | '' diff --git a/action.yml b/action.yml index 86ea246..6d362cb 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,10 @@ inputs: description: 'Remote directory' required: false default: '.' + options: + description: 'Additional mirror command options' + required: false + default: '' runs: using: 'docker' image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index fabd34d..45331f7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,3 @@ #!/bin/sh -l -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" +lftp $INPUT_HOST -u $INPUT_USER,$INPUT_PASSWORD -e "set ftp:ssl-force $INPUT_FORCESSL; set ssl:verify-certificate false; mirror $INPUT_OPTIONS --reverse --continue --dereference -x ^\.git/$ $INPUT_LOCALDIR $INPUT_REMOTEDIR; quit"