-
Notifications
You must be signed in to change notification settings - Fork 577
Resolve Security Vulnerabilities and linting issues #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mshedsilegx
wants to merge
26
commits into
bcicen:master
Choose a base branch
from
mshedsilegx:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit addresses issues identified by the `go vet` command. - In `menus.go`, unkeyed struct literals for `menu.Item` have been converted to keyed literals to improve code clarity and maintainability. - In `main.go`, unreachable code following a `panic()` call in the `panicExit` function has been removed.
This commit addresses a wide range of issues identified by the `golangci-lint` command. The changes include: - Handling previously unchecked errors. - Removing deprecated `+build` tags and replacing them with `//go:build` directives. - Replacing deprecated function calls, including `rand.Seed`, `io/ioutil`, and `InspectContainer`. - Fixing ineffective assignments and break statements. - Correcting error string formatting. - Removing redundant assignments and break statements. - Simplifying string replacements. - Removing a significant amount of unused code, including functions, variables, and fields.
This commit adds the `LINTING.md` file, which contains a detailed code review and summary of the changes made to address the issues reported by `go vet` and `golangci-lint`.
This commit introduces the `ARCHITECTURE.md` file, which provides a detailed explanation of the ctop application's architecture and design. The document includes: - An overview of the application and its objectives. - A breakdown of the architecture and key design choices, including the connector interface, data model, and concurrency model. - A comprehensive list of command-line arguments with descriptions, types, and default values. - Examples of how to use the application.
Fix go vet issues
This commit adds support for executing shells on Windows by checking the operating system and using "cmd.exe" when running on a Windows environment. The existing functionality for Linux and other Unix-like systems is preserved.
This commit adds support for executing shells on Windows by checking the operating system and using "cmd.exe" when running on a Windows environment. The existing functionality for Linux and other Unix-like systems is preserved.
Windows shell support
This commit enhances the `ExecShell` functionality on Windows by: - Clearing the screen before launching the shell using `cmd.exe /c "cls && cmd.exe"`. - Refreshing the display after the shell exits to prevent UI corruption. This provides a cleaner and more reliable user experience on Windows, while preserving the existing behavior on other platforms.
This commit enhances the `ExecShell` functionality on Windows by: - Clearing the screen before launching the shell using `cmd.exe /c "cls && cmd.exe"`. - Refreshing the display after the shell exits to prevent UI corruption, only on Windows. - Handling the error returned by `RefreshDisplay()`. This provides a cleaner and more reliable user experience on Windows, while preserving the existing behavior on other platforms.
Windows shell support
This commit resolves an issue where the termui TUI would interfere with the shell session when running `ctop` on a Windows host and connecting to a Windows container. This interference caused ANSI escape codes to corrupt the shell display. The `ExecShell` function is modified to: 1. Check if the host OS is Windows. 2. If it is Windows, use `cmd.exe` as the shell to execute in the container. 3. Crucially, the `termui` interface is now properly suspended (`ui.Close()`) before executing the shell and re-initialized (`ui.Init()`) and refreshed afterward. This prevents the TUI from leaking control codes into the shell session, providing a clean and usable shell experience on Windows. The existing behavior for Linux and macOS hosts is preserved.
This commit resolves an issue where the termui TUI would interfere with the shell session when running `ctop` on a Windows host and connecting to a Windows container. This interference caused ANSI escape codes to corrupt the shell display. The `ExecShell` function is modified to: 1. Check if the host OS is Windows. 2. If it is Windows, use `cmd.exe` as the shell to execute in the container. 3. Crucially, the `termui` interface is now properly suspended (`ui.Close()`) before executing the shell and re-initialized (`ui.Init()`) and refreshed afterward. This prevents the TUI from leaking control codes into the shell session, providing a clean and usable shell experience on Windows. The existing behavior for Linux and macOS hosts is preserved.
Windows shell support
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1- Resolved 51 security vulnerabilities by updating modules as much as possible
2- 4 go vet issues
3- 51 linting issues detected by golangci-lint