diff --git a/README.md b/README.md index 2632695..2dd70bc 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,34 @@ -# Turbo RFQ - MariaDB simple Web UI +# TurboRFQ - MariaDB Web UI -A lightweight PHP web application that provides an Excel-like interface for browsing and editing MariaDB tables. +A lightweight PHP web application that provides an Excel-like interface for browsing and editing MariaDB tables. Users authenticate with **their own MariaDB credentials**, and the app works with *any* schema by reading metadata from `information_schema`. -> Note: This README assumes a Linux environment with PHP 8.1+ and MariaDB available. +--- + +## Installation (Docker) + +**Recommended method:** + +```bash +docker pull git.mchus.pro/mchus/turborfq:latest + +docker run -d \ + --name turborfq \ + -p 8080:8080 \ + -e DB_HOST=your-mariadb-host \ + -e DB_PORT=3306 \ + git.mchus.pro/mchus/turborfq:latest +``` + +Open http://localhost:8080 in your browser. + +### Environment Variables + +| Variable | Default | Description | +|----------|---------|-------------| +| `DB_HOST` | localhost | MariaDB server address | +| `DB_PORT` | 3306 | MariaDB server port | +| `DB_CHARSET` | utf8mb4 | Connection charset | --- @@ -79,9 +104,11 @@ php -r "unlink('composer-setup.php');" --- -## Installation +## Installation (Manual) -1. Clone or copy the project: +If you prefer to run without Docker: + +1. Clone the project: ```bash cd /path/to @@ -101,17 +128,7 @@ This reads `composer.json` and installs Slim, PHP-DI and all required packages i ## Configuration -By default, `Db.php` uses: - -- Host: `localhost` -- Port: `3306` -- Charset: `utf8mb4` - -If your MariaDB server is different, update the DSN in `src/Db.php`: - -```php -$dsn = 'mysql:host=localhost;port=3306;charset=utf8mb4'; -``` +Connection settings are configured via environment variables (see table above). No database name is hardcoded: the app reads available schemas from `information_schema` and shows only those the connected user can see. @@ -196,16 +213,14 @@ http://localhost:8080/ ## Troubleshooting -- **Blank page or PHP errors** - Make sure `display_errors` is enabled in development, or check web server error logs. +- **Blank page or PHP errors** + Make sure `display_errors` is enabled in development, or check container logs: `docker logs turborfq` -- **“Not authenticated” / 401 responses** +- **"Not authenticated" / 401 responses** Ensure you logged in successfully and that your browser accepts cookies (session). -- **Cannot connect to MariaDB** - - Verify host/port in `Db.php`. +- **Cannot connect to MariaDB** + - Verify `DB_HOST` and `DB_PORT` environment variables. - Confirm credentials using `mysql` client or another tool. - Check firewall and bind-address on the MariaDB server. - - -``` \ No newline at end of file + - If running in Docker, use host IP or `host.docker.internal` instead of `localhost`. \ No newline at end of file