Skip to content

MySQL Management Script, PhpMyAdmin 5.2.3 Update & Maintenance Fixes#15

Open
diskyer wants to merge 6 commits into
devilbox-community:mainlinefrom
diskyer:mainline
Open

MySQL Management Script, PhpMyAdmin 5.2.3 Update & Maintenance Fixes#15
diskyer wants to merge 6 commits into
devilbox-community:mainlinefrom
diskyer:mainline

Conversation

@diskyer
Copy link
Copy Markdown

@diskyer diskyer commented Apr 1, 2026

MySQL Management Script, PhpMyAdmin 5.2.3 Update (respect PHP 8.4)

Goal

  • Provide a convenient interactive tool for managing MySQL databases and users within DevilBox (as new sub-commands for dvl.sh)
  • Update PhpMyAdmin to v5.2.3 for PHP 8.4 compatibility
  • improve gitignore rules

DESCRIPTION

This PR includes the following changes:

1. MySQL Database & User Manager Script (inside dvl.sh)

  • New interactive bash script for managing MySQL databases and users inside DevilBox
  • Features: create databases, create users, grant privileges, list databases/users

new ./dvl.sh [command]

 db-create        Create a new database and user.
 db-grant         Grant privileges to existing user on existing database.
 db-user          Create a new MySQL user (without database).
 db-password      Change password for existing MySQL user.

2. PhpMyAdmin Update (v5.2.1 → v5.2.3)

  • Upgraded PhpMyAdmin to version 5.2.3, which adds compatibility with PHP 8.4
  • Updated related config and CSS references in .devilbox/www/

3. Gitignore Improvements (.gitignore)

  • Added rule for docker-compose.override*.dockerfile
  • Added rules for IDE/editor directories: .zed, .obsidian

@nntoan
Copy link
Copy Markdown

nntoan commented Apr 6, 2026

@diskyer Thanks for this, however the DEFAULT_DVL_CONTAINERS are created like that as intentional purpose. In real-life working scenarios (like us), we worked through multiple PHP versions and we need ability to init new projects without knowing too much about infra changes locally.

Regarding mysql-db-user-manager.sh, can you combine this into dvl.sh as new sub-commands (e.g dvl db:import) ?

@diskyer
Copy link
Copy Markdown
Author

diskyer commented Apr 11, 2026

@diskyer Thanks for this, however the DEFAULT_DVL_CONTAINERS are created like that as intentional purpose. In real-life working scenarios (like us), we worked through multiple PHP versions and we need ability to init new projects without knowing too much about infra changes locally.

Regarding mysql-db-user-manager.sh, can you combine this into dvl.sh as new sub-commands (e.g dvl db:import) ?

Hi @nntoan!

Thanks for the feedback. I've updated the PR with the following changes:

  • Reverted DEFAULT_DVL_CONTAINERS to their original state (kept them untouched).
  • Integrated the functionality of mysql-db-user-manager.sh into dvl.sh as new sub-commands:
    • db-create: Create a new database and user.
    • db-grant: Grant privileges to an existing user on an existing database.
    • db-user: Create a new MySQL user (without a database).
    • db-password: Change the password for an existing MySQL user.
  • Added a helpful notice for users when the DEVILBOX_PATH environment variable is not set:
    ✘ Environment variable DEVILBOX_PATH is not set. How to fix: ...
  • Removed mysql-db-user-manager.sh as it is no longer needed.

You can review the latest changes here: 350f01e

Looking forward to your thoughts!

@nntoan nntoan requested a review from Copilot April 25, 2026 03:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds small maintenance fixes to the DevilBox web config/theme, including a safer Redis password extraction step and some UI color adjustments (in support of the PhpMyAdmin update/compatibility work referenced in the description).

Changes:

  • Adjusted custom CSS to set default text colors for table cells and the page body.
  • Refactored Redis password extraction to avoid passing non-variables by reference.

Reviewed changes

Copilot reviewed 2 out of 4662 changed files in this pull request and generated 4 comments.

File Description
.devilbox/www/htdocs/assets/css/custom.css Updates default text coloring for tables and body.
.devilbox/www/config.php Refactors Redis password parsing to avoid end(end(...)) reference warnings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .devilbox/www/config.php
Comment on lines +149 to 151
$_REDIS_PASS_ROW = end($_REDIS_PASS);
$_REDIS_PASS = end($_REDIS_PASS_ROW);

Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end() requires an array/object passed by reference. If $_REDIS_PASS is empty (or if its last element isn’t an array), end($_REDIS_PASS) can yield false/scalar and end($_REDIS_PASS_ROW) will raise a TypeError on PHP 8+. Add a guard ensuring $_REDIS_PASS_ROW is an array before calling end(), and default to an empty string when the regex doesn’t produce the expected nested array structure (e.g., use array_key_last(...) + indexing with ?? '', or is_array($_REDIS_PASS_ROW) checks).

Suggested change
$_REDIS_PASS_ROW = end($_REDIS_PASS);
$_REDIS_PASS = end($_REDIS_PASS_ROW);
$_REDIS_PASS_LAST_KEY = array_key_last($_REDIS_PASS);
$_REDIS_PASS_ROW = $_REDIS_PASS_LAST_KEY !== null ? ($_REDIS_PASS[$_REDIS_PASS_LAST_KEY] ?? null) : null;
$_REDIS_PASS = '';
if (is_array($_REDIS_PASS_ROW)) {
$_REDIS_PASS_ROW_LAST_KEY = array_key_last($_REDIS_PASS_ROW);
$_REDIS_PASS = $_REDIS_PASS_ROW_LAST_KEY !== null ? ($_REDIS_PASS_ROW[$_REDIS_PASS_ROW_LAST_KEY] ?? '') : '';
}

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +66
.table-bordered td, .table-bordered th {
color: #dffce3;
}
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting very light foreground colors (#dffce3 for table cells and #888888 for body text) without also ensuring an appropriate background can drop contrast below WCAG recommendations, especially on default light backgrounds (e.g., white table backgrounds). Consider selecting colors that meet contrast ratios for normal text, or pair these rules with explicit background colors/variables that guarantee compliant contrast.

Copilot uses AI. Check for mistakes.
body {
/* Margin bottom by footer height */
margin-bottom: 80px !important;
color: #888888;
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting very light foreground colors (#dffce3 for table cells and #888888 for body text) without also ensuring an appropriate background can drop contrast below WCAG recommendations, especially on default light backgrounds (e.g., white table backgrounds). Consider selecting colors that meet contrast ratios for normal text, or pair these rules with explicit background colors/variables that guarantee compliant contrast.

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +66
.table-bordered td, .table-bordered th {
color: #dffce3;
}
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation in this file appears to primarily use tabs elsewhere, but this block introduces space-indented lines. Aligning indentation with the surrounding convention will reduce noisy diffs and keep formatting consistent.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants