New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the DNS mapping migration #6529
Conversation
Co-authored-by: Leo Feyer <1192057+leofeyer@users.noreply.github.com>
As discussed in the last call, the definition of the environment variable has now been moved to the Manager Bundle. However, it is not possible to also provide this as a bundle configuration, as you cannot reference an environment variable for array config nodes yet (see symfony/symfony#40906). Thus this is again solely based on a The core bundle checks whether such a parameter has been defined in the container and if not sets an empty default. The manager bundle also checks whether such a parameter has been defined in the container (e.g. in the App) and if not sets it to the |
In a non-managed edition you will have to add this to your config (if you want to use an environment variable for the parameter): parameters:
env(DNS_MAPPING): []
contao.dns_mapping: '%env(json:DNS_MAPPING)%' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would personally add a TODO
and link to the Symfony issue so that we can get rid of the workaround if this was fixed eventually but other than that 👍
Co-authored-by: Martin Auswöger <martin@auswoeger.com>
As discussed in the Contao call today, the |
Thank you @fritzmg. |
Alternative approach to #4077 and #4583. This allows you to define mappings via a
DNS_MAPPING
environment variable which will update thedns
entries for all given domains to the updated domain in the database during migrations.This allows you to - for example - copy the live database to your staging or local environment and then automatically change the domains according to the mapping in the respective environment during
contao:migrate
.As a bonus you can also migrate the
useSSL
setting to different settings in the respective environment, which might be useful if you haven't set up an SSL certificate in your local development environment.This also works if you do not use a
dns
name in some of your website roots (although that is not a recommended setup).Instead of the environment variable, you can also directly set the parameter in your
parameters.yaml
(or wherever):