From 036cad7df774e9168d1de6c77d668c6a292d4540 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 14 Jul 2024 16:17:12 +0800 Subject: [PATCH 1/6] chore: update drone-ssh to version 1.7.7 - Update drone-ssh Docker image version from `1.7.4` to `1.7.7` - Update DRONE_SSH_VERSION environment variable default from `1.7.4` to `1.7.7` Signed-off-by: Bo-Yi Wu --- Dockerfile | 2 +- entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d84c375..960d488 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/appleboy/drone-ssh:1.7.4 +FROM ghcr.io/appleboy/drone-ssh:1.7.7 COPY entrypoint.sh /bin/entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index f50d56e..c48f963 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,7 +8,7 @@ export GITHUB="true" GITHUB_ACTION_PATH="${GITHUB_ACTION_PATH%/}" DRONE_SSH_RELEASE_URL="${DRONE_SSH_RELEASE_URL:-https://github.com/appleboy/drone-ssh/releases/download}" -DRONE_SSH_VERSION="${DRONE_SSH_VERSION:-1.7.4}" +DRONE_SSH_VERSION="${DRONE_SSH_VERSION:-1.7.7}" function detect_client_info() { if [ -n "${SSH_CLIENT_OS-}" ]; then From 8b6078208d71a6d9364c7f23d78ca9b38bed48c0 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 14 Jul 2024 16:21:41 +0800 Subject: [PATCH 2/6] chore(cli): enhance version handling and testing mechanisms - Add a command to print the version of the target before running the main command Signed-off-by: Bo-Yi Wu --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index c48f963..a9e359d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -63,4 +63,5 @@ TARGET="${GITHUB_ACTION_PATH}/${CLIENT_BINARY}" echo "Will download ${CLIENT_BINARY} from ${DOWNLOAD_URL_PREFIX}" curl -fL --retry 3 --keepalive-time 2 "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o ${TARGET} chmod +x ${TARGET} -sh -c "${TARGET} $*" +sh -c "${TARGET} --version" # print version +sh -c "${TARGET} $*" # run the command From 5ade82648576fb5118b586573e9c607af4941b24 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 14 Jul 2024 16:42:46 +0800 Subject: [PATCH 3/6] chore: improve CLI reliability and version visibility - Increase curl retry attempts from 3 to 5 - Add echo statements to display CLI version before and after running the version command Signed-off-by: Bo-Yi Wu --- entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index a9e359d..19d6b5d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -61,7 +61,9 @@ DOWNLOAD_URL_PREFIX="${DRONE_SSH_RELEASE_URL}/v${DRONE_SSH_VERSION}" CLIENT_BINARY="drone-ssh-${DRONE_SSH_VERSION}-${CLIENT_PLATFORM}-${CLIENT_ARCH}" TARGET="${GITHUB_ACTION_PATH}/${CLIENT_BINARY}" echo "Will download ${CLIENT_BINARY} from ${DOWNLOAD_URL_PREFIX}" -curl -fL --retry 3 --keepalive-time 2 "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o ${TARGET} +curl -fL --retry 5 --keepalive-time 2 "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o ${TARGET} chmod +x ${TARGET} +echo "======= CLI Version =======" sh -c "${TARGET} --version" # print version +echo "===========================" sh -c "${TARGET} $*" # run the command From 28428a13f5b0283d667b1c6501d144f15b059726 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 14 Jul 2024 16:59:55 +0800 Subject: [PATCH 4/6] docs: improve cross-platform clipboard support for key copying - Add instructions to install `xclip` on Ubuntu before copying the private key - Replace `clip` command with platform-specific commands (`pbcopy` for macOS and `xclip` for Ubuntu) for copying the private key Signed-off-by: Bo-Yi Wu --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7055cf5..75fe1c4 100644 --- a/README.md +++ b/README.md @@ -122,14 +122,29 @@ Copy Private Key content and paste in Github Secrets. ### Copy rsa Private key +Before copying the private key, install `clip` command as shown below: + ```bash -clip < ~/.ssh/id_rsa +# Ubuntu +sudo apt-get install xclip +``` + +copy the private key: + +```bash +# macOS +pbcopy < ~/.ssh/id_rsa +# Ubuntu +xclip < ~/.ssh/id_rsa ``` ### Copy ed25519 Private key ```bash -clip < ~/.ssh/id_ed25519 +# macOS +pbcopy < ~/.ssh/id_ed25519 +# Ubuntu +xclip < ~/.ssh/id_ed25519 ``` See the detail information about [SSH login without password](http://www.linuxproblem.org/art_9.html). From 06fa62e61cac6c39015db4efcde64776f56965c4 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 14 Jul 2024 17:19:13 +0800 Subject: [PATCH 5/6] ci: rename the workflow files. - Rename `ci.yml` to `main.yml` - Rename `ssh-server.yml` to `stable.yml` Signed-off-by: Bo-Yi Wu --- .github/workflows/{ci.yml => main.yml} | 0 .github/workflows/{ssh-server.yml => stable.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ci.yml => main.yml} (100%) rename .github/workflows/{ssh-server.yml => stable.yml} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/main.yml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/main.yml diff --git a/.github/workflows/ssh-server.yml b/.github/workflows/stable.yml similarity index 100% rename from .github/workflows/ssh-server.yml rename to .github/workflows/stable.yml From eaeb06998d86f5e66259ee8dc3d0909612f0ce65 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 14 Jul 2024 20:55:52 +0800 Subject: [PATCH 6/6] chore(cli): enhance curl command with silent mode and redirects - Add silent mode and follow redirects to curl command in entrypoint.sh Signed-off-by: Bo-Yi Wu --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 19d6b5d..67132c6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -61,7 +61,7 @@ DOWNLOAD_URL_PREFIX="${DRONE_SSH_RELEASE_URL}/v${DRONE_SSH_VERSION}" CLIENT_BINARY="drone-ssh-${DRONE_SSH_VERSION}-${CLIENT_PLATFORM}-${CLIENT_ARCH}" TARGET="${GITHUB_ACTION_PATH}/${CLIENT_BINARY}" echo "Will download ${CLIENT_BINARY} from ${DOWNLOAD_URL_PREFIX}" -curl -fL --retry 5 --keepalive-time 2 "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o ${TARGET} +curl -fsSL --retry 5 --keepalive-time 2 "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o ${TARGET} chmod +x ${TARGET} echo "======= CLI Version =======" sh -c "${TARGET} --version" # print version