Skip to content

Commit 1b492fb

Browse files
committed
fix: handle Plesk Obsidian 18.0.76.5+ removing --show-password (#42)
1 parent 9e705b1 commit 1b492fb

3 files changed

Lines changed: 22 additions & 7 deletions

File tree

Changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
- fix: add truthiness guards to `mysql_innodb` and `mysql_stats` subroutines.
3030
- fix: improve `which` logic for better container/minimal environment support.
3131
- fix: enhance login failure reporting with detailed output.
32+
- fix: handle Plesk Obsidian 18.0.76.5+ removing --show-password (#42).
3233
- chore: automated project maintenance and cleanup (extracted `RULES.md`, `MEMORY_DB.md`, `TESTS.md`).
3334
- ci: migrate maintenance script to GitHub Actions.
3435
- chore(deps): update docker/setup-buildx-action action to v4.

mysqltuner.pl

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,18 +2205,28 @@ sub mysql_setup {
22052205
elsif ( -r "/etc/psa/.psa.shadow" and $doremote == 0 ) {
22062206

22072207
# It's a Plesk box, use the available credentials
2208-
$mysqllogin =
2209-
"$defaults_options -u admin -p"
2210-
. execute_system_command("cat /etc/psa/.psa.shadow");
2208+
my $psa_pass = execute_system_command("cat /etc/psa/.psa.shadow");
2209+
chomp($psa_pass);
2210+
$psa_pass =~ s/'/'\\''/g;
2211+
$mysqllogin = "$defaults_options -u admin -p'$psa_pass'";
22112212
my $loginstatus =
22122213
execute_system_command("$mysqladmincmd $mysqllogin ping");
22132214
unless ( $loginstatus =~ /mysqld is alive/ ) {
22142215

22152216
# Plesk 10+
2216-
$mysqllogin =
2217-
"$defaults_options -u admin -p"
2218-
. execute_system_command(
2217+
my $plesk_pass = execute_system_command(
22192218
"/usr/local/psa/bin/admin --show-password");
2219+
chomp($plesk_pass);
2220+
2221+
# Plesk Obsidian 18.0.76.5+ no longer supports --show-password
2222+
if ($plesk_pass =~ /no longer supported/i || $plesk_pass =~ /--get-login-link/i) {
2223+
badprint
2224+
"Attempted to use login credentials from Plesk and Plesk 10+, but they failed.";
2225+
exit 1;
2226+
}
2227+
2228+
$plesk_pass =~ s/'/'\\''/g;
2229+
$mysqllogin = "$defaults_options -u admin -p'$plesk_pass'";
22202230
$loginstatus =
22212231
execute_system_command("$mysqladmincmd $mysqllogin ping");
22222232
unless ( $loginstatus =~ /mysqld is alive/ ) {
@@ -2241,7 +2251,8 @@ sub mysql_setup {
22412251
$mysqlpass =~ s/passwd=//;
22422252
$mysqlpass =~ s/[\r\n]//;
22432253

2244-
$mysqllogin = "$defaults_options -u $mysqluser -p$mysqlpass";
2254+
$mysqlpass =~ s/'/'\\''/g;
2255+
$mysqllogin = "$defaults_options -u $mysqluser -p'$mysqlpass'";
22452256

22462257
my $loginstatus = execute_system_command("mysqladmin $mysqllogin ping");
22472258
unless ( $loginstatus =~ /mysqld is alive/ ) {

releases/v2.8.41.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
- fix: add truthiness guards to `mysql_innodb` and `mysql_stats` subroutines.
3030
- fix: improve `which` logic for better container/minimal environment support.
3131
- fix: enhance login failure reporting with detailed output.
32+
- fix: handle Plesk Obsidian 18.0.76.5+ removing --show-password (#42).
3233
- ci: enhance Quality Gate to strictly enforce zero-warning policy on GitHub Actions tests.
3334
- ci: implement dynamic CI test environment detection by wrapping configuration extraction.
3435
- ci: refactor GitHub Actions release and prerelease workflows to support dynamic versions and checksum generation.
@@ -53,6 +54,8 @@
5354

5455
## 🛠️ Internal Commit History
5556

57+
- feat: finalize release 2.8.41 (c31b9fa)
58+
- ci: fix preflight scripts for changelog header and commitlint refname ambiguity (2bc36f9)
5659
- feat: release 2.8.41 (2a8371c)
5760
- style: tidy mysqltuner.pl (db23439)
5861
- ci: refactor Github release definitions with pre-releases and deliverables support (68f8d12)

0 commit comments

Comments
 (0)