mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 16:44:24 +00:00
7a013c38e3
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>
46 lines
1.2 KiB
Docker
46 lines
1.2 KiB
Docker
FROM php:8.3-apache
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
libpng-dev \
|
|
libjpeg62-turbo-dev \
|
|
libfreetype6-dev \
|
|
libzip-dev \
|
|
zip \
|
|
unzip \
|
|
git \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Configure and install PHP extensions
|
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
&& docker-php-ext-install -j$(nproc) \
|
|
gd \
|
|
mysqli \
|
|
pdo \
|
|
pdo_mysql \
|
|
zip
|
|
|
|
# Enable Apache modules
|
|
RUN a2enmod rewrite headers
|
|
|
|
# Use the production PHP configuration as a baseline, then apply our overrides
|
|
# so that errors are hidden from end users and logged server-side instead.
|
|
RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
|
COPY docker/php/zz-travianz.ini "$PHP_INI_DIR/conf.d/zz-travianz.ini"
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www/html
|
|
|
|
# Runtime source code is bind-mounted by docker-compose.
|
|
# Keep only minimal folder bootstrap inside the image.
|
|
RUN mkdir -p /var/www/html/var
|
|
|
|
# Configure Apache to use /var/www/html as DocumentRoot
|
|
RUN sed -i 's!/var/www/html!/var/www/html!g' /etc/apache2/sites-available/000-default.conf
|
|
|
|
# Expose Apache port
|
|
EXPOSE 80
|
|
|
|
# Start Apache
|
|
CMD ["apache2-foreground"]
|