* docs: improve documentation and configuration handling
- Clarify valid values for the IP protocol in usage messages for both main application and proxy settings
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* test: improve IPv6 command execution tests
- Add a new test function `TestCommandWithIPv6` to check command execution with an IPv6 address
- Initialize test variables and expected output for the IPv6 command test
- Set up a `Plugin` struct with IPv6 host, user, port, key path, script, and command timeout for testing
- Verify that `plugin.Exec()` returns `nil` (no error) in the IPv6 test
- Assert that the output of the command execution matches the expected output in the IPv6 test
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* test: enhance test suite and CI robustness
- Add support for IPv6 protocol in `TestCommandWithIPv6` test case in `plugin_test.go`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* update
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* update
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* update
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* update
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* update2
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* update3
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* update4
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* update5
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* update5
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* update5
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
---------
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Add a new flag to the main.go file
- Add a new field to the Plugin type in the plugin.go file
- Remove two lines from the plugin_test.go file
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Add `requiretty` to the `Defaults` in sudoers
- Allow `drone-scp` to run commands without password prompt
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update the version of `github.com/appleboy/easyssh-proxy` from `v1.4.1-0.20231106031702-5666e2ea5156` to `v1.5.0`
- Update the version of `github.com/urfave/cli/v2` from `v2.26.0` to `v2.27.1`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update `github.com/urfave/cli` dependency from `v2.25.7` to `v2.26.0`
- Upgrade `golang.org/x/crypto` from `v0.14.0` to `v0.17.0`
- Bump `github.com/cpuguy83/go-md2man` from `v2.0.2` to `v2.0.3`
- Update `github.com/xrash/smetrics` to a newer commit
- Update `golang.org/x/sys` from `v0.14.0` to `v0.15.0`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Add a new `.hadolint.yaml` configuration file with specific rule ignores
- Update the Dockerfile to install `ca-certificates` without a fixed version
- Add commands to create a `deploy` user and group with UID and GID `1000`, set home directory, and set ownership
- Set the Docker container to run as the `deploy` user with UID and GID `1000`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update the `go-version` in the lint.yml file from `^1` to `^1.21`
- Update the version of `github.com/appleboy/easyssh-proxy` in the go.mod file from `v1.4.0` to `v1.4.1-0.20231106031702-5666e2ea5156`
- Update the version of `golang.org/x/crypto` in the go.mod file from `v0.10.0` to `v0.14.0`
- Update the version of `golang.org/x/sys` in the go.mod file from `v0.9.0` to `v0.14.0`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Fix a typo in the cron expression for the codeql.yml workflow
- Change the language specification from ['go'] to ['go'] in the codeql.yml workflow
- Change the version specification from 'v*' to 'v*' in the docker.yml workflow
- Change the branch specification from 'master' to 'master' in the docker.yml workflow
- Change the go-version specification from '^1' to '^1.21' in the docker.yml workflow
- Remove the name "Set up QEMU" in the docker.yml workflow
- Remove the name "Set up Docker Buildx" in the docker.yml workflow
- Remove the name "Login to Docker Hub" in the docker.yml workflow
- Remove the name "Login to GitHub Container Registry" in the docker.yml workflow
- Remove the name "Docker meta" in the docker.yml workflow
- Remove the name "Build and push" in the docker.yml workflow
- Change the version specification from '*' to '*' in the goreleaser.yml workflow
- Remove the name "Checkout" in the goreleaser.yml workflow
- Remove the name "Setup go" in the goreleaser.yml workflow
- Change the go-version specification from '^1' to '^1' in the goreleaser.yml workflow
- Remove the name "Run GoReleaser" in the goreleaser.yml workflow
- Change the go-version specification from '^1' to '^1' in the lint.yml workflow
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Add a new flag `allenvs` to pass all environment variables to the shell script
- Implement the `AllEnvs` functionality in the `exec` function
- Add a new function `findEnvs` to find all environment variables with specified prefixes
- Add tests for the `findEnvs` function and the `AllEnvs` functionality
- Add a comment to clarify the purpose of the `format` function
- Add a comment to clarify the purpose of the `log` function
- Modify the `log` function to always print the message, removing the previous conditional statement
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update urfave/cli/v2 from v2.25.5 to v2.25.7
- Update golang.org/x/crypto from v0.9.0 to v0.10.0
- Update golang.org/x/sys from v0.8.0 to v0.9.0 (indirect)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Add `bin` to .gitignore
- Change output path for the executable in Makefile
- Update `github.com/stretchr/testify` to v1.8.4
- Update `github.com/urfave/cli/v2` to v2.25.5
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update `github.com/urfave/cli/v2` dependency from `v2.25.3` to `v2.25.4`
- Update `golang.org/x/crypto` dependency from `v0.8.0` to `v0.9.0`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update `github.com/urfave/cli/v2` from `v2.25.1` to `v2.25.3`
- Update `golang.org/x/sys` from `v0.7.0` to `v0.8.0` (indirect)
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add an option to include extra pre-existing files in the release with a specified file format (`.xz`)
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add `INPUT_ENVS_FORMAT` to the list of environment variables in `main.go`
- Define `envsFormat` variable in `plugin.go`
- Add default value for `Config.EnvsFormat` in `plugin.go` `Exec()` function
fix https://github.com/appleboy/drone-ssh/pull/235
**Reason:**
I have to use drone-ssh to work with Windows SSH. Initially, drone-ssh is written so that it transmits environment variables through the `export` command. Which makes it unsuitable for working with Power Shell.
**Solution:**
I have added a new option to configure environment variable commands formatting, with default value: `export {NAME}={VALUE}`. When I use drone-ssh with PowerShell I set this option like this: `$env:{NAME} = {VALUE}`.
- Upgrade easyssh-proxy from v1.3.9 to v1.3.10
- Upgrade testify from v1.8.1 to v1.8.2
- Upgrade crypto from v0.7.0 to v0.8.0
- Upgrade sys from v0.6.0 to v0.7.0
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Modify the `EnvVars` slice to include `INPUT_` prefix when needed
- Remove unused environment variables from the `EnvVars` slice
- Update the `EnvVars` slice to include `PROXY_` prefix when needed
- Modify the `EnvVars` slice to include `PLUGIN_SSH_CIPHERS` as `PROXY_SSH_CIPHERS`
- Modify the `EnvVars` slice to include `PLUGIN_PROXY_USE_INSECURE_CIPHER` as `PROXY_SSH_USE_INSECURE_CIPHER`
- Modify the `EnvVars` slice to include `PLUGIN_PROXY_FINGERPRINT` as `PROXY_SSH_FINGERPRINT`
- Remove the environment variable `PROXY_HOST`
- Modify the `EnvVars` slice to include `PLUGIN_DEBUG` as `INPUT_DEBUG`
* https://github.com/appleboy/ssh-action/issues/53#issuecomment-1184700432
* https://github.com/appleboy/ssh-action/issues/32#issuecomment-1184700363
* https://github.com/appleboy/ssh-action/issues/213
- Add `trimValues` function for cleaning up slice values
- Remove unused `wg.Done()` call
- Modify `Exec` function to launch goroutines for each host in `Config.Host`
- Add test for `ScriptStop` with multiple hosts and sync mode
refer to: https://github.com/appleboy/ssh-action/issues/233
- Add Open Container Initiative labels for image source, description, and licenses
- Update `apk` command to include specific version of `ca-certificates`
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
- Update the `image` field to use `ghcr.io/appleboy/drone-ssh` in DOCS.md
- Update the `image` field to use `ghcr.io/appleboy/drone-ssh` in README.md
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update urfave/cli to version 2.25.1
- Update golang.org/x/crypto to version 0.7.0
- Update golang.org/x/sys to version 0.6.0 (indirect)
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
- Add a new file `.goreleaser.yaml`
- Configure builds for multiple operating systems and architectures
- Set flags and ldflags for the builds
- Add a binary name template for the builds
- Add an archive format
- Add a checksum template
- Add a snapshot template
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>