contao / manager-bundle

[READ-ONLY] Contao Manager Bundle
GNU Lesser General Public License v3.0
17 stars 10 forks source link

Allow to set trusted proxies in the environment variables #68

Closed aschempp closed 6 years ago

aschempp commented 6 years ago

fixes https://github.com/contao/manager-bundle/issues/63

aschempp commented 6 years ago

There are valid reasons why Symfony recommends not to use the Dotenv component in production.

Yes, the don't recommend it, because you should use environment variables. Unfortunately, as we know, 95% of Contao setups on shared hosting don't support environment variables. That's what the DotEnv component is for. If your server does support ENV variables, don't create the file and use it to adjust your setup, and then this will work as well. Obviously not through the Contao Manager, but if you have and use environment variables, you probably don't need the Contao Manager.

leofeyer commented 6 years ago

Correct me if I'm wrong, but environment variables can easily be set in e.g. a .htaccesfile.

<IfModule mod_env.c>
    SetEnv SYMFONY_ENV prod
</IfModule>

But nevertheless, this kind of configuration should go into the parameters.yml file in production!

aschempp commented 6 years ago

But nevertheless, this kind of configuration should go into the parameters.yml file in production!

No they don't, because this is application configuration that is loaded before the kernel is booted or the container is available.

leofeyer commented 6 years ago

Thank you @aschempp.