- Refactor SSH-related integration tests to use a reusable SSHTestConfig struct and a new runSSHContainerTest helper function
- Support testing both key-based and password-based authentication by passing configuration via SSHTestConfig
- Move duplicated test setup code for containerized SSH server to the helper function
- Update assertions to check outputs against configurable expected values for each test
- Add test for password-based authentication in addition to existing sudo command test
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Remove USER_PASSWORD from test environment setup
- Update comment to correctly state that password authentication is disabled
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Disable password authentication by setting PASSWORD_ACCESS to false in TestSudoCommand
- Remove the use of direct password authentication in favor of key-based authentication in TestSudoCommand
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a test that dynamically starts an OpenSSH server in a Docker container for integration testing.
- Configure the container with test credentials, allow password and sudo access, and inject the public key.
- Update the test to use the actual Docker container's hostname, dynamic port, username, and password.
- Improve error handling and test skipping if the Docker environment is not available.
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Remove unused import of strconv
- Remove environment variables PUID and PGID from the test container setup
- Enable UseInsecureCipher in SSH options for compatibility
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update several dependencies to newer versions, including urfave/cli, x/crypto, ScaleFT/sshkeys, go-md2man, and x/sys
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a Table of Contents section to the English, Simplified Chinese, and Traditional Chinese README files
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Improve and clarify English wording and formatting throughout the documentation for better readability
- Update section titles and add missing punctuation for consistency
- Revise build instructions and descriptions for accuracy and clarity
- Enhance phrasing in Chinese (Simplified and Traditional) documentation for clarity and consistency
- Remove outdated explanatory comments and improve example references in all README files
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add links to Traditional and Simplified Chinese README files, and label English as the default language
- Fix formatting for the list of supported platforms in the main README
- Add a Simplified Chinese version of the README with equivalent content and instructions
- Add a Traditional Chinese version of the README with equivalent content and instructions
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* chore: enhance testing with updated libraries and new test cases
- Update `testify` library from `v1.8.4` to `v1.10.0`
- Add dependency for `testcontainers-go` library
- Add various indirect dependencies
- Include `context` and `fmt` packages in test file
- Add test for SSH connection using `testcontainers` library
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* refactor: improve performance by optimizing string conversions
- Add the `strconv` import.
- Replace `fmt.Sprintf` with `strconv.Itoa` for converting UID and GID to string.
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* test: switch to alternative image source for SSH testing
- Update image name in the SSH test from `lscr.io/linuxserver/openssh-server:latest` to `linuxserver/openssh-server:latest`.
Signed-off-by: appleboy <appleboy.tw@gmail.com>
---------
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update `.golangci.yaml` to version 2 and streamline settings
- Remove specific linters from `.golangci.yaml` configuration
- Add exclusion and formatter settings to `.golangci.yaml`
- Change error message formatting in `plugin.go` to lowercase
- Use `strings.ReplaceAll` instead of `strings.Replace` for better readability and performance in `plugin.go` and `plugin_test.go`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update Go version from 1.22 to 1.23
- Upgrade golang.org/x/crypto from version 0.29.0 to 0.36.0
- Upgrade golang.org/x/sys from version 0.27.0 to 0.31.0
- Change Docker image in GitHub Actions from golang:1.22-alpine to golang:1.23-alpine
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a new dependency on `github.com/yassinebenaid/godump`
- Include `godump` in the import statements
- Add a new environment variable `DEBUG` to the existing list
- Implement a debug dump of the plugin if debugging is enabled
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Simplify log output by removing "out:" and "err:" prefixes in `plugin.go`
- Update test expectations to match the new log output format
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update `github.com/urfave/cli/v2` to version `2.27.5`
- Update `golang.org/x/crypto` to version `0.29.0`
- Update `github.com/cpuguy83/go-md2man/v2` to version `2.0.5`
- Update `golang.org/x/sys` to version `0.27.0`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a `.golangci.yaml` configuration file with various linters enabled and specific settings for `gosec` and `perfsprint`.
- Change `isTimeout` from being initialized to `true` to being declared as a `bool` variable without an initial value in `plugin.go`.
Signed-off-by: appleboy <appleboy.tw@gmail.com>
My OCD just kicks in :)) This has bothered me for a long time. Will also update README in https://github.com/appleboy/ssh-action to reflect this change.
- Alias `github.com/appleboy/easyssh-proxy` import as `easyssh` in `main.go`
- Alias `github.com/appleboy/easyssh-proxy` import as `easyssh` in `plugin.go`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update `golang.org/x/crypto` dependency from `v0.24.0` to `v0.25.0`
- Update `golang.org/x/sys` dependency from `v0.21.0` to `v0.22.0`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Remove `make build_linux_arm` step
- Update `docker/setup-qemu-action` from v2 to v3
- Update `docker/setup-buildx-action` from v2 to v3
- Update `docker/login-action` from v2 to v3
- Update `docker/metadata-action` from v4 to v5
- Update `docker/build-push-action` from v4 to v6
- Remove `linux/arm` from the platforms list
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update `golang.org/x/crypto` dependency from v0.23.0 to v0.24.0
- Update `golang.org/x/sys` dependency from v0.20.0 to v0.21.0
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update `github.com/urfave/cli/v2` to version `2.27.2`
- Update `golang.org/x/crypto` to version `0.23.0`
- Update `github.com/xrash/smetrics` to version `0.0.0-20240521201337-686a1a2994c1`
- Update `golang.org/x/sys` to version `0.20.0`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Change the changelog generation from using git to using GitHub
- Add custom changelog sections for build process and documentation updates with specific regex patterns and order
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update `golang.org/x/crypto` from `v0.18.0` to `v0.22.0`
- Update `github.com/cpuguy83/go-md2man/v2` from `v2.0.3` to `v2.0.4`
- Update `github.com/xrash/smetrics` to a newer commit
- Update `golang.org/x/sys` from `v0.16.0` to `v0.19.0`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Change the name template in `.goreleaser.yaml` from single to double quotes
- Add a changelog configuration to `.goreleaser.yaml` with categorized groups for features, bug fixes, enhancements, refactor, and others
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update GitHub Actions to use newer versions (checkout to v4, codeql-action to v3, setup-go to v5, goreleaser-action to v5, golangci-lint-action to v4, codecov-action to v4)
- Remove specific Go version pinning in favor of using the version specified in go.mod
- Enable checking for the latest Go version in setup-go action
- Replace `release --rm-dist` argument with `release --clean` in goreleaser action
- Reorder steps and remove redundant checkout step in testing workflow
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>