Fix install + admin bugs reported in issue #169

Addresses the five bugs found on master (6e139a1b) during a fresh
Docker install and admin testing:

1. Missing `details` column in gold_fin_log (HTTP 500 on finishing
   construction with gold, buying Gold Club, admin giving gold):
   - Add `details varchar(255)` to the gold_fin_log schema, matching
     every INSERT and the a2b2.php reader that already use it.
   - Fix the broken positional INSERT in Logging::goldFinLog() (it sent
     3 values for a 7-column table) which 500'd on the same gold path.

2. Admin "View Player Info" fatal error: `<? php` -> `<?php` in
   Admin/Templates/playerinfo.tpl.

3. "Reset Server" leaving the DB corrupted (Duplicate key name
   'idx_ft_bonus_xy'): move the croppers indexes inline into the
   CREATE TABLE IF NOT EXISTS so structure recreation is idempotent,
   and add `croppers` to the reset truncate list.

4. Install wizard crash on failed DB connection (mysqli_error(false)):
   use mysqli_connect_error() and show a friendly, actionable message
   (incl. the Docker "db" hostname hint).

5. PHP exposing errors/stack traces to end users: ship a production
   php.ini baseline + docker/php/zz-travianz.ini that turns off
   display_errors and logs to stderr instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
TravianZ Patcher
2026-06-03 08:32:00 +02:00
parent 6e139a1b61
commit 7a013c38e3
7 changed files with 34 additions and 9 deletions
+11
View File
@@ -0,0 +1,11 @@
; TravianZ production PHP settings
; -----------------------------------------------------------------------------
; Do NOT show PHP errors, warnings or stack traces to end users. Leaking server
; paths and internal structure is both a security risk and makes the game look
; unstable. Errors are still logged server-side (visible via `docker logs`).
display_errors = Off
display_startup_errors = Off
log_errors = On
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE & ~E_WARNING
; Send the error log to the container's stderr so it shows up in `docker logs web`.
error_log = /dev/stderr