Commit Graph

363 Commits

Author SHA1 Message Date
Bo-Yi.Wu 30b18520ed refactor(setting): reorder format. 2023-04-15 06:25:31 +08:00
Bo-Yi Wu 67a2631616 docs: improve clarity of `Usage` message in main.go
- Modify the `Usage` message in main.go

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-04-13 09:48:46 +08:00
Alexey Smirnov fdc4c8de43
fix: example with secrets (#178) 2023-04-13 09:39:43 +08:00
Bo-Yi Wu 49542638c6
refactor: set default environment variables format in plugin (#253)
- 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
2023-04-13 09:32:31 +08:00
Vladimir Sigalkin 6464d9999f
chore: flexible configuration of environment value transfer (#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}`.
2023-04-13 09:13:07 +08:00
Bo-Yi Wu 4aabfc90dd chore: upgrade Dependencies to Latest Versions
- 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>
2023-04-13 09:09:37 +08:00
Bo-Yi Wu b9cfca60e9
refactor: standardize environment variables naming conventions (#252)
- 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
2023-04-13 09:08:12 +08:00
Bo-Yi Wu a8d30dc133
feat: refactor code for parallel execution on multiple hosts (#249)
- 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
2023-04-04 16:56:50 +08:00
Bo-Yi.Wu f733bb5ebf chore: remove Hadolint configuration file
- Delete the `.hadolint.yaml` file.

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-04 15:39:10 +08:00
Bo-Yi.Wu b0ddeb9413 chore: update container security measures
- 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>
2023-04-04 15:38:42 +08:00
Bo-Yi Wu 8c5d17d83d chore: refactor release process to use main.Version flag
- Change the `drone-ssh` version flag to `main.Version` in `.goreleaser.yaml`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-03-29 08:59:31 +08:00
Bo-Yi Wu 050e0e6efd docs: use ghcr.io/appleboy/drone-ssh image for SSH connections
- 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>
2023-03-28 14:43:00 +08:00
Bo-Yi Wu f01d5d9454 chore(deps): update go.sum 2023-03-28 14:23:20 +08:00
Bo-Yi.Wu c004469746 ci: upgrade setup-go action and remove release binary action
- Remove release binary github action
- Upgrade setup-go action from v3 to v4 in docker, goreleaser, and lint github actions

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-03-27 22:02:48 +08:00
Bo-Yi.Wu bc2dac669a chore: refactor installation command for `drone-ssh` using `go install`
- Update `drone-ssh` installation command to use `go install` instead of `go get`

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-03-27 22:01:11 +08:00
Albert Wang 541508632d
chore: remove dotenv autoloading (#243) 2023-03-27 21:56:04 +08:00
Bo-Yi.Wu 22cd751b47 chore: update third-party libraries for improved security and performance
- 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>
2023-03-27 21:52:44 +08:00
Bo-Yi.Wu 5a6a923356 build: configure cross-platform builds with Goreleaser
- 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>
2023-03-27 21:51:52 +08:00
Bo-Yi Wu 1a95b5f1b3
chore(auth): allow use password and key at same time (#240) 2023-02-28 17:04:39 +08:00
Bo-Yi Wu d0ed2bb2fb chore(docker): support multiple platform 2023-02-27 14:01:12 +08:00
Bo-Yi.Wu b2a60a2fec chore(CI): upgrade build push actions
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-02-24 09:35:20 +08:00
Bo-Yi.Wu 7c7619ebbc chore(deps): upgrade dependency.
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-02-24 09:33:41 +08:00
dependabot[bot] fc62fb377c
chore(deps): bump hadolint/hadolint-action from 3.0.0 to 3.1.0 (#225)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-01 16:27:36 +08:00
Bo-Yi Wu 808373f717 docs: fix wrong link 2023-02-01 16:27:18 +08:00
Albert Wang 6d9d6acc6a
Document configuration through dotenv variables (#224)
* Format parameter table

* Format parameter keys as code

* Add documentation of configuration overrides
2023-02-01 16:26:22 +08:00
dependabot[bot] 439ca59b8f
chore(deps): bump github.com/urfave/cli/v2 from 2.23.7 to 2.24.2 (#229)
Bumps [github.com/urfave/cli/v2](https://github.com/urfave/cli) from 2.23.7 to 2.24.2.
- [Release notes](https://github.com/urfave/cli/releases)
- [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/urfave/cli/compare/v2.23.7...v2.24.2)

---
updated-dependencies:
- dependency-name: github.com/urfave/cli/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-01 16:24:25 +08:00
Bo-Yi Wu d9493e4563 chore(deps): upgrade go 2023-01-10 13:36:56 +08:00
Prashant Shahi cc7a2d5983
fix(envs): 🐛 set environment variable instead of bash variable (#219) 2023-01-08 08:36:33 +08:00
Bo-Yi Wu 0a6e4de21c chore(CI): latest tag for linux and amd64 2023-01-03 11:10:09 +08:00
Bo-Yi.Wu 48f817effb chore(CI): add strategy in docker build
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-01-01 15:16:29 +08:00
Bo-Yi Wu c8ecc03ef5
Revert "chore(scripts): disable SliceFlagSeparator" (#215) 2022-12-27 08:25:11 +08:00
Bo-Yi Wu ddf9ca3e6f
chore(scripts): disable SliceFlagSeparator (#212) 2022-12-25 15:48:42 +08:00
Bo-Yi Wu a568d2e551
chore(cli): upgrade urfave/cli to v2 (#211) 2022-12-25 15:44:30 +08:00
Bo-Yi Wu d17a10dd0c
Revert "chore(cli): upgrade urfave/cli to v2" (#210) 2022-12-25 15:15:55 +08:00
Bo-Yi Wu d83798f25b
chore(cli): upgrade urfave/cli to v2 (#152) 2022-12-25 14:56:47 +08:00
Bo-Yi.Wu 59b08e1b4c chore(CI): Add Codecov
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 14:32:58 +08:00
Bo-Yi.Wu 8d07792340 chore(CI): replace go get with go install
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 14:27:10 +08:00
Bo-Yi.Wu 55bebcef3d chore(CI): add sshd service and testing
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 14:21:18 +08:00
Bo-Yi.Wu dfa002a267 chore(CI): release binary
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 11:12:32 +08:00
Bo-Yi.Wu 60da6458b5 docs(readme): remove drone badge
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 10:02:55 +08:00
Bo-Yi.Wu fe2455ee6d chore(CI): rename
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 10:01:25 +08:00
Bo-Yi.Wu d2cea88132 chore(CI): add hadolint checker
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-25 09:51:48 +08:00
Bo-Yi.Wu 8da3787c97 chore(CI): add enable checker
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-24 21:50:42 +08:00
Bo-Yi.Wu bf419cebf8 chore(CI): check push event
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-24 21:41:20 +08:00
Bo-Yi.Wu 7b141b72ae chore(dockerfile): replace ADD with COPY
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-24 21:34:09 +08:00
Bo-Yi.Wu 058dcd40d8 chore(CI): remove drone CI config
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-24 21:31:52 +08:00
Bo-Yi.Wu 598a11a626 chore(CI): update setup-go version
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-24 21:29:23 +08:00
Bo-Yi.Wu 31c298bb19 chore(CI): update version check.
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-24 21:26:33 +08:00
Bo-Yi.Wu df6997a8e1 chore(CI): add build config
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-24 21:16:51 +08:00
Bo-Yi.Wu 8c5823d726 chore(CI): rename
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-12-24 21:15:56 +08:00