Move ENV debug logging before appending scriptCommands to env slice,
so ======ENV====== only appears when Envs are configured and only
contains export statements, matching v1.8.2 behavior.
- revert TestCommandOutput: remove ENV section (no Envs configured)
- revert TestEnvOutput: remove echo commands from ENV section
- normalize \r\n to \n in unindent to handle TTY output from RequireTty tests
- add script commands to ======ENV====== expected section in TestEnvOutput
- bump actions/checkout to v6
- bump actions/setup-go to v6
- bump actions/cache to v5
- bump goreleaser/goreleaser-action to v7
- bump golangci/golangci-lint-action to v9
- bump github/codeql-action/* to v4
- bump codecov/codecov-action to v5
- bump docker/build-push-action to v7
- bump docker/login-action to v4
- bump docker/metadata-action to v6
- bump docker/setup-buildx-action to v4
- bump docker/setup-qemu-action to v4
- bump hadolint/hadolint-action to v3.3.0
- bump aquasecurity/trivy-action to v0.35.0
- Upgrade docker/docker from v28.0.1 to v28.5.2 to fix AuthZ bypass
- Upgrade testcontainers-go from v0.36.0 to v0.41.0
- Update all transitive dependencies to latest compatible versions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Bump minimum Go version from 1.24 to 1.25
- Update CI test matrix to Go 1.25 and 1.26, drop 1.24
- Upgrade easyssh-proxy to v1.5.2, urfave/cli to v2.27.7
- Upgrade golang.org/x/crypto to v0.49.0 and other x/ packages
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add getWriter method to centralize writer-nil-check logic
- Replace inline writer initialization in log and Exec methods
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace interface{} with any and fix value receiver mutation in log method
- Use fmt.Fprintln instead of forbidden fmt.Println in Exec output
- Fix appendAssign by splitting append and assignment into two lines
- Replace assert.Nil/NotNil with assert.NoError/Error for error checks
- Upgrade error assertions to require when followed by dependent assertions
- Replace os.Setenv with t.Setenv in all test functions
- Restructure TestFindEnvs to use t.Setenv with unique prefixes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove Trivy vulnerability scanning and upload of scan results to GitHub Security tab from the workflow
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add gpg to the list of installed packages for testing
- Specify Codecov upload flags based on Go version
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Enable testing across Go 1.24 and 1.25 using a matrix strategy
- Update the container image to dynamically use the selected Go version
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add golines to the list of golangci-lint formatters
- Format multi-line env variable declarations for CLI flags for consistency
- Split string slice initializations onto multiple lines for improved readability in tests
- Use multi-line function calls for better readability in plugin and test code
- Improve readability of script command appends in logic and tests
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add explicit permissions for contents, packages, and security-events to the Docker GitHub Actions workflow
- Integrate Trivy vulnerability scanning and results upload into the Docker workflow
- Add a dedicated GitHub Actions workflow for Trivy security scanning of both repository files and Docker images, with scheduled, push, and pull request triggers
- Ensure Trivy SARIF results are uploaded to the GitHub Security tab after scans
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update Go version requirement from 1.23.0 to 1.24.0
- Upgrade golang.org/x/crypto dependency to v0.45.0
- Upgrade golang.org/x/sys dependency to v0.38.0
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- 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>