mautic / docker-mautic

Docker Image for Mautic
https://www.mautic.org
362 stars 274 forks source link

Mautic 4 images #193

Closed dennisameling closed 3 years ago

dennisameling commented 3 years ago

Fixes the builds for Mautic 4 (already bumped PHP version to 7.4 and Mautic version to 4.0.0-alpha1 in https://github.com/mautic/docker-mautic/commit/6d994c354d50598003958a34ec136b206738a424)

Added the sockets extension because while I was playing with Mautic from Git (composer installation), I ran into

  Problem 1
    - php-amqplib/php-amqplib is locked to version v3.0.0 and an update of this package was not requested.
    - php-amqplib/php-amqplib v3.0.0 requires ext-sockets * -> it is missing from your system. Install or enable PHP's sockets extension.
  Problem 2
    - php-amqplib/php-amqplib v3.0.0 requires ext-sockets * -> it is missing from your system. Install or enable PHP's sockets extension.
    - php-amqplib/rabbitmq-bundle 2.6.0 requires php-amqplib/php-amqplib ^2.12.2|^3.0 -> satisfiable by php-amqplib/php-amqplib[v3.0.0].
    - php-amqplib/rabbitmq-bundle is locked to version 2.6.0 and an update of this package was not requested.

The only missing piece is that the installer can't be opened due to an issue with MAUTIC_TRUSTED_PROXIES - would appreciate if someone could look into this!

mautic_1  | [Tue May 04 20:18:28.751872 2021] [php7:notice] [pid 43] [client 172.27.0.1:46774] Symfony\\Component\\DependencyInjection\\Exception\\RuntimeException: Invalid JSON in env var "resolve:MAUTIC_TRUSTED_PROXIES": Syntax error - in file /var/www/html/vendor/symfony/dependency-injection/EnvVarProcessor.php - at line 230

image

thinkl33t commented 3 years ago

It looks like that issue is because as of M3, MAUTIC_TRUSTED_PROXIES is an environment variable that mautic itself reads (via symphony) and is expecting to be JSON, but we also have code in makeconfig.php that is trying to read the same environment variable as a comma-separated value that its going to shove into trusted_proxies in local.php - I assume you are providing that in your tests?

I think the correct thing to do here is to remove our extra magic MAUTIC_TRUSTED_PROXIES code in makeconfig.php for v3 + v4 and document that environment variable as needing json

The correct formatting for that environment variable for the container to start correctly is:

MAUTIC_TRUSTED_PROXIES=["172.16.0.0/12"]
thinkl33t commented 3 years ago

An alternative would be to:

unset MAUTIC_TRUSTED_PROXIES

In docker-entrypoint.sh after running makeconfig.php, but i think using the built in pass-a-json way of specifying proxies and removing the existing CSV format is a better solution going forward.

thinkl33t commented 3 years ago

We have a fix in place for my review comments above, i think this is now ready to merge