From 73c63b5d869f4b65d2c3abc8159d0f74d93e7f38 Mon Sep 17 00:00:00 2001 From: Michael Chus Date: Sun, 25 Jan 2026 04:02:17 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D1=91?= =?UTF-8?q?=D0=BD=20README:=20Docker=20=D0=BA=D0=B0=D0=BA=20=D1=80=D0=B5?= =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=B5=D0=BD=D0=B4=D1=83=D0=B5=D0=BC=D1=8B?= =?UTF-8?q?=D0=B9=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20=D1=83=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Добавлена секция Installation (Docker) с примером запуска - Таблица переменных окружения (DB_HOST, DB_PORT, DB_CHARSET) - Обновлена секция Configuration и Troubleshooting Co-Authored-By: Claude Opus 4.5 --- README.md | 63 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 24 deletions(-) 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