298 Commits

Author SHA1 Message Date
appleboy
6bb71c761c
chore: update dependencies in go.mod file
- Update the version of `golang.org/x/crypto` from `v0.17.0` to `v0.18.0` in the `go.mod` file
- Update the version of `golang.org/x/sys` from `v0.15.0` to `v0.16.0` in the `go.mod` file

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-01-11 20:52:49 +08:00
Bo-Yi Wu
bb91fba471
chore: update external dependencies versions
- Update the version of `github.com/appleboy/easyssh-proxy` from `v1.4.0` 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>
v1.6.14
2024-01-01 10:38:36 +08:00
Bo-Yi Wu
86f19b9c1c
chore: update dependencies to latest versions
- Update `easyssh-proxy` dependency from `v1.3.10` to `v1.4.0`
- Update `color` library from `v1.15.0` to `v1.16.0`
- Upgrade `urfave/cli` module from `v2.25.5` to `v2.26.0`
- Bump `x/crypto` version from `v0.9.0` to `v0.17.0`
- Increment `go-md2man` indirect dependency from `v2.0.2` to `v2.0.3`
- Update `go-isatty` indirect dependency from `v0.0.19` to `v0.0.20`
- Update `smetrics` indirect dependency to a newer commit
- Upgrade `x/sys` indirect dependency from `v0.8.0` to `v0.15.0`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
v1.6.13
2023-12-26 13:46:27 +08:00
appleboy
691ddecf48
chore: update Go version and base images
- Update the `go-version` to `^1` in the `.github/workflows/lint.yml` file
- Change the container in the `.github/workflows/lint.yml` file from `golang:1.20-alpine` to `golang:1.21-alpine`
- Update the base image in the `docker/Dockerfile` file from `alpine:3.19` to `alpine:3.17`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
v1.6.12
2023-12-24 20:18:12 +08:00
appleboy
a9c0fd3bbd
chore: refactor Dockerfile directory creation and ownership commands
- Change the directory creation and ownership commands in the Dockerfile

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-12-24 20:11:08 +08:00
appleboy
7df424cbf1
chore: update Dockerfile and add .hadolint.yaml
- Add a new file `.hadolint.yaml`
- Ignore the `DL3018` and `DL3008` rules in `.hadolint.yaml`
- Update the base image in `docker/Dockerfile` from `alpine:3.17` to `alpine:3.19`
- Remove the labels `org.label-schema.name`, `org.label-schema.vendor`, and `org.label-schema.schema-version` in `docker/Dockerfile`
- Update the package installation command in `docker/Dockerfile` to remove the specific version of `ca-certificates`
- Add a new user and group `deploy` with UID and GID `1000` in `docker/Dockerfile`
- Create a directory `/home/deploy` and change its ownership to `deploy:deploy` in `docker/Dockerfile`
- Set the user and group to `deploy:deploy` with UID and GID `1000` in `docker/Dockerfile`
- Copy the `drone-scp` binary to `/bin/` in `docker/Dockerfile`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-12-24 20:09:36 +08:00
appleboy
e5bd02fd8e
chore: update build process to output executables to bin directory
- Add `bin` to the `.gitignore` file
- Change the build command in the `Makefile` to output the executable to the `bin` directory

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-12-24 20:05:24 +08:00
Bo-Yi Wu
7e0d4951b9
ci: update GitHub action workflows to use setup-go v5
- Update the `setup-go` action from version 4 to version 5 in the Docker, Goreleaser, and Lint workflows.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-12-12 20:44:18 +08:00
Bo-Yi Wu
ac6c465050 chore: update github.com/stretchr/testify 2023-05-30 23:30:11 +08:00
Bo-Yi Wu
754c91fc38 chore: upgrade dependency 2023-05-30 23:29:24 +08:00
appleboy
bb2dd5543b ci: improve release process and test robustness
- Add .xz files to the checksum in .goreleaser.yaml

Signed-off-by: appleboy <appleboy.tw@gmail.com>
v1.6.11
2023-05-06 08:15:56 +08:00
appleboy
8b963288b3 chore: improve API usage and test robustness across OSs
- 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>
2023-05-06 08:01:03 +08:00
Bo-Yi Wu
bd2ddc2b6c chore: improve recordings, API, tests, and actions
- Add "strconv" import to main.go
- Update app.Copyright to use the current year dynamically

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-05-05 08:14:24 +08:00
Bo-Yi Wu
d098811ced build: improve build process and release packaging
- Add a post-build hook to compress artifacts using xz
- Include extra .xz files in the release package

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-05-05 08:13:24 +08:00
Bo-Yi.Wu
de6f344960 refactor: update Plugin Class Exec Method with Version Print Statement
- Add print of current version to Exec method of Plugin class

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-16 13:36:35 +08:00
Bo-Yi Wu
cf87fecefa
feat: improve file handling with OS-specific functions and tests (#178)
- Add functions for removing and creating files/directories based on the operating system
- Add unit tests for the functions
2023-04-16 12:15:02 +08:00
Bo-Yi Wu
665c665298
refactor: remove unnecessary quotes in plugin build process (#177)
- Modify `rmcmd` and `mkdircmd` to remove unneeded quotes
- Update `buildUnTarArgs` in `plugin.go` to use target without quotes
- Add `Exec` function to `plugin.go` with `strings.Replace` call
- Update tests in `plugin_test.go` to use target without quotes

ref: https://github.com/appleboy/scp-action/issues/112
v1.6.10
2023-04-16 12:05:23 +08:00
Bo-Yi Wu
c663c07449
feat: refactor plugin struct and add hostPort function with tests (#176)
- Change the `go` keyword to `gofmt` in line 259
- Add a new function `hostPort` to the `Plugin` struct
- Modify the `hostPort` function to set the port if it is specified in the host string
- Add 2 tests for `hostPort` function to `plugin_test.go`

ref https://github.com/appleboy/scp-action/issues/98
v1.6.9
2023-04-16 11:29:15 +08:00
Bo-Yi.Wu
30279a3e8d refactor: refactor command line flags in main function
- Remove the `t` alias from the `main` function&#39;s flags.

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
v1.6.8
2023-04-15 07:16:23 +08:00
Bo-Yi.Wu
b9cdc20c14 chore(config): align with drone-ssh
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-15 07:02:58 +08:00
Bo-Yi.Wu
cb8f851d7b refactor: refactor command execution configuration
- Remove 12 lines of code related to proxy configuration
- Remove 5 lines of code related to cipher configuration
- Add 18 lines of code related to proxy configuration
- Add a command timeout flag with a default value of 10 minutes

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-15 06:29:32 +08:00
Bo-Yi Wu
fb4058bc55
chore(main): remove unused variable (#175) 2023-04-15 01:49:26 +08:00
Bo-Yi.Wu
ec6021f1f1 chore: update dependencies to latest versions
- Update `com` to v0.1.7
- Update `easyssh-proxy` to v1.3.10
- Update `color` to v1.15.0
- Update `godotenv` to v1.5.1
- Update `testify` to v1.8.2
- Update `cli/v2` to v2.25.1
- Update `crypto` to v0.8.0
- Update `sshkeys` to v1.2.0
- Update `go-md2man/v2` to v2.0.2
- Update `go-spew` to v1.1.1
- Update `go-colorable` to v0.1.13
- Update `go-isatty` to v0.0.18
- Update `sys` to v0.7.0
- Update `yaml.v3` to v3.0.1

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-15 01:23:33 +08:00
Bo-Yi Wu
41313253fa
fix: improve support for folder names with spaces (#174)
- Add a test for a target folder with spaces in the name
- Fix a bug in the `buildUnTarArgs` function that caused it to fail when receiving a target with spaces
- Remove unused code in the `TestRemoveDestFile` function

ref https://github.com/appleboy/scp-action/issues/85
2023-04-11 12:54:53 +08:00
Bo-Yi.Wu
de5e936a05 chore: update Go version and dependencies
- Upgrade Go version from `1.20` to `1.18`
- Update dependencies:
  - `github.com/appleboy/com` from `v0.1.7` to `v0.1.6`
  - `github.com/appleboy/easyssh-proxy` from `v1.3.10` to `v1.3.9`
  - `github.com/fatih/color` from `v1.15.0` to `v1.9.0`
  - `github.com/joho/godotenv` from `v1.5.1` to `v1.4.0`
  - `github.com/stretchr/testify` from `v1.8.2` to `v1.7.0`
  - `github.com/urfave/cli/v2` from `v2.25.1` to `v2.8.1`
  - `golang.org/x/crypto` from `v0.8.0` to `v0.0.0-20220525230936-793ad666bf5e`
  - `github.com/ScaleFT/sshkeys` from `v1.2.0` to `v0.0.0-20200327173127-6142f742bca5`
  - `github.com/cpuguy83/go-md2man/v2` from `v2.0.2

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-10 21:42:31 +08:00
Bo-Yi.Wu
46df30d9ba refactor: refactor system type checks in SSH commands
- Remove `uname` check for system type from `removeAllDestFile` function.
- Add `ver` check for SSH command in `Exec` function.
- Remove `uname` check for system type from `Exec` function.

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-10 21:00:36 +08:00
Bo-Yi.Wu
87ebe720f5 feat: improve server logging with OS type detection
- Add a log message with the remote server OS type

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-10 20:53:18 +08:00
Bo-Yi Wu
55f04f07eb chore: update easyssh-proxy version in go.mod file
- Update the version of `github.com/appleboy/easyssh-proxy` from `v1.3.9` to `v1.3.10` in `go.mod` file.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-04-10 15:12:01 +08:00
Bo-Yi.Wu
0745e13d39 test: refactor plugin_test.go file and optimize code
- Remove the `TestSetPasswordAndKey` function from `plugin_test.go`

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
v1.6.7
2023-04-09 17:06:03 +08:00
Bo-Yi.Wu
f1301199ca fix: refactor error handling and panic statements
- Remove error message for setting password and key at the same time
- Replace `errMissingHost` error check with a panic statement

ref: https://github.com/appleboy/scp-action/issues/86

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-09 17:03:48 +08:00
Bo-Yi Wu
6fd87e0460
refactor: add dereference flag (#169)
- Add a `--dereference` flag to use with tar

fix https://github.com/appleboy/drone-scp/issues/112
2023-04-09 15:49:32 +08:00
Bo-Yi.Wu
cf09357b85 build: refactor buildArgs function argument
- Change argument from `-xf` to `-zxf` in `buildArgs` function

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-09 13:39:39 +08:00
Bo-Yi Wu
9bfb71b9ef
build: compress build artifacts using gzip (#168)
- Change the compression format from `tar` to `tar.gz`
- Replace the flag `-cf` with `-zcf` in the `buildArgs` function

fix https://github.com/appleboy/drone-scp/issues/123
2023-04-09 12:38:12 +08:00
Bo-Yi.Wu
9d8fc691c1 refactor: refactor testing functions for consistency
- Replace `trimPath` with `trimValues` in `TestTrimElement` function

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-09 12:14:31 +08:00
Bo-Yi Wu
244d28d58a
test: check ignore list function working or not. (#167)
Modify the assert function call to use trimValues instead of trimPath
2023-04-09 12:12:53 +08:00
Bo-Yi.Wu
42d07ba823 test: refactor test function names for clarity
- Change function name from `trimPath` to `trimValues` in `TestTrimElement` test

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-09 09:51:08 +08:00
Bo-Yi.Wu
dd5f3b500f refactor: refactor configuration file handling
- Remove the `trimPath` function
- Change `trimPath(p.Config.Source)` to `trimValues(p.Config.Source)`

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-09 09:50:39 +08:00
Bo-Yi.Wu
95b01590dc refactor: refactor host configuration handling
- Replace the iteration over `p.Config.Host` with `trimValues(p.Config.Host)`
- Replace `len(p.Config.Host)` with `len(hosts)`
- Replace iteration over `p.Config.Host` with `for _, host := range hosts`
- Add `trimValues` function to trim spaces and empty values of a string slice

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-09 09:13:21 +08:00
Bo-Yi.Wu
c42b26f044 build: update build process for cross-platform compatibility
- Update the container to `golang:1.20-alpine`
- Add a new file `.goreleaser.yaml`
- Modify `.goreleaser.yaml` to include additional builds and flags for cross-compiling and building the binary
- Add a new checksum file to the release archives

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-09 08:16:45 +08:00
Bo-Yi Wu
244b0a9e58
refactor: handling functions for cross-platform compatibility (#166)
- Change the `rmcmd` and `mkdircmd` functions to accept an OS parameter
- Remove `command_windows.go` file
- Modify `removeDestFile` and `Exec` functions to use the OS parameter
- Add OS detection logic to `removeAllDestFile` and `Exec` functions
- Modify `TestRemoveDestFile` function to use the OS parameter

fix https://github.com/appleboy/drone-scp/pull/119
2023-04-09 08:14:05 +08:00
Bo-Yi.Wu
8b578d1df8 chore: refactor Dockerfile for improved security
- Remove `.hadolint.yaml` from the project
- Add open container labels to the Dockerfile

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-09 06:52:54 +08:00
Bo-Yi.Wu
ea5c04f515 ci: update setup-go action version in workflows
- Update `setup-go` action to version 4 in 3 workflows

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-04-09 06:50:46 +08:00
Bo-Yi Wu
f4da147fda chore: upgrade dependencies in go.mod file
- Delete `.github/workflows/binary.yml` file.
- Upgrade `github.com/appleboy/com` from `v0.1.6` to `v0.1.7` in `go.mod`.
- Upgrade `github.com/fatih/color` from `v1.14.1` to `v1.15.0` in `go.mod`.
- Upgrade `github.com/urfave/cli/v2` from `v2.24.4` to `v2.25.1` in `go.mod`.
- Upgrade `golang.org/x/crypto` from `v0.6.0` to `v0.8.0` in `go.mod`.
- Upgrade `github.com/mattn/go-isatty` from `v0.0.17` to `v0.0.18` in `go.mod`.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-04-08 11:18:30 +08:00
dependabot[bot]
54bc4f9c50
chore(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.2 (#157)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-03 23:20:52 +08:00
Bo-Yi Wu
2f24f092e0 chore(docker): update plugin name 2023-02-27 13:58:56 +08:00
Bo-Yi Wu
c66c78f88f fix: lint error v1.6.6 2023-02-27 13:24:12 +08:00
Bo-Yi Wu
9723eea384 chore(CI): build docker image with multiple platform 2023-02-27 11:56:42 +08:00
dependabot[bot]
14ec2704bd
chore(deps): bump github.com/urfave/cli/v2 from 2.24.3 to 2.24.4 (#156)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-23 13:15:47 +08:00
dependabot[bot]
a1482e89a3
chore(deps): bump docker/build-push-action from 3 to 4 (#154)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-12 14:26:12 +08:00
Bo-Yi.Wu
9bf9ed00a4 chore(deps): upgrade go module
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2023-02-12 09:36:06 +08:00