-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Add generic cloud support and translated documentation #857
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
feat: Add generic cloud support and translated documentation #857
Conversation
This commit introduces a generic framework for connecting to cloud-based MySQL services, with an initial focus on Azure. It adds new command-line options to facilitate both direct and SSH-proxied connections. The implementation includes: - A generic cloud mode activated by the `--cloud` flag. - Azure-specific support via the `--azure` flag, which now acts as an alias for `--cloud`. - SSH connection options: `--ssh-host`, `--ssh-user`, `--ssh-password`, and `--ssh-identity-file`. - A unified `execute_system_command` function to handle both local and remote command execution with proper error handling. - Updated documentation in the `README.md` to reflect the new features, with translations in French, Italian, and Russian.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a generic cloud support framework for MySQLTuner, enabling connections to cloud-based MySQL services through SSH tunneling or direct connections. The implementation focuses on Azure support as the initial cloud provider.
Key changes:
- New cloud mode infrastructure with
--cloudand--azureflags for enabling cloud connectivity - SSH connection options (
--ssh-host,--ssh-user,--ssh-password,--ssh-identity-file) for remote command execution - Unified
execute_system_commandfunction that wraps all system calls to support both local and SSH-proxied execution
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| mysqltuner.pl | Adds cloud mode support with new command-line options, SSH infrastructure, and unified system command execution wrapper |
| README.md | Documents the new cloud support features with translations in English, French, Italian, and Russian |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $mysqladmincmd = $ssh_prefix . $mysqladmincmd; | ||
| $mysqlcmd = $ssh_prefix . $mysqlcmd; | ||
| $mysqlcmd =~ s/\n$//g; | ||
| my $mysqlclidefaults = `$mysqlcmd --print-defaults`; |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This backtick command execution should be replaced with execute_system_command for consistency with the rest of the changes and to properly support SSH-based cloud connections. Use: my $mysqlclidefaults = execute_system_command("$mysqlcmd --print-defaults");
| my $mysqlclidefaults = `$mysqlcmd --print-defaults`; | |
| my $mysqlclidefaults = execute_system_command("$mysqlcmd --print-defaults"); |
| if ($opt{'ssh-identity-file'} ne '') { | ||
| $ssh_base_cmd .= " -i '" . $opt{'ssh-identity-file'} . "'"; | ||
| } | ||
| $ssh_base_cmd .= " -o 'StrictHostKeyChecking=no' -o 'UserKnownHostsFile=/dev/null'"; |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling StrictHostKeyChecking and using /dev/null for UserKnownHostsFile makes connections vulnerable to man-in-the-middle attacks. Consider documenting this security risk or providing an option for users to enable strict host key checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <[email protected]>
This commit introduces a generic framework for connecting to cloud-based MySQL services, with an initial focus on Azure. It adds new command-line options to facilitate both direct and SSH-proxied connections.
The implementation includes:
--cloudflag.--azureflag, which now acts as an alias for--cloud.--ssh-host,--ssh-user,--ssh-password, and--ssh-identity-file.execute_system_commandfunction to handle both local and remote command execution with proper error handling.README.mdto reflect the new features, with translations in French, Italian, and Russian.