feat: Add generic cloud support and translated documentation#857
feat: Add generic cloud support and translated documentation#857jmrenouard merged 2 commits intomajor:masterfrom
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.
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`; |
There was a problem hiding this comment.
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'"; |
There was a problem hiding this comment.
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.
@copilot open a new pull request to apply changes based on this feedback
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
There was a problem hiding this comment.
@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.