Skip to content
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

Remove the parameters.yml file from the skeleton #6085

Merged
merged 3 commits into from Jun 2, 2023

Conversation

leofeyer
Copy link
Member

Implements #6070

@leofeyer leofeyer added the bug label May 26, 2023
@leofeyer leofeyer added this to the 5.2 milestone May 26, 2023
@leofeyer leofeyer self-assigned this May 26, 2023
@leofeyer leofeyer requested a review from a team May 26, 2023 08:30
@leofeyer leofeyer linked an issue May 26, 2023 that may be closed by this pull request
ausi
ausi previously approved these changes May 26, 2023
@aschempp
Copy link
Member

This would remove the defaut kernel secret, are you sure this still allows the application to boot and generate the auto secret etc.?

@ausi
Copy link
Member

ausi commented May 26, 2023

This would remove the defaut kernel secret

The secret from the parameters.yaml is not used anywhere, it does not define the kernel.secret parameter. (AFAIK)

@fritzmg
Copy link
Contributor

fritzmg commented May 26, 2023

The secret from the parameters.yaml is not used anywhere, it does not define the kernel.secret parameter. (AFAIK)

It is still used. If you do not define APP_SECRET, then the secret parameter is used as a fallback:

if (!isset($_SERVER['APP_SECRET'])) {
$container->setParameter('env(APP_SECRET)', $container->getParameter('secret'));
}

Same goes for the database credentials. If you do not use DATABASE_URL, then the database_* parameters are used as a fallback.

Copy link
Member

@ausi ausi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The secret from the parameters.yaml is not used anywhere

I was wrong it seems. I thought I searched for all getParameter('secret') 🙈

@leofeyer
Copy link
Member Author

We can probably replace secret with kernel.secret in line 209?

The database_* parameters are fine IMHO, because we still want to support them in case someone has a parameters.yml file in their app.

@ausi
Copy link
Member

ausi commented May 26, 2023

The database_* parameters are fine IMHO, because we still want to support them in case someone has a parameters.yml file in their app.

But we probably need to adjust the Plugin code to check for hasParameter('database_…') so that it does not fail without the defaults from the parameters.yaml

@fritzmg
Copy link
Contributor

fritzmg commented May 26, 2023

We can probably replace secret with kernel.secret in line 209?

That won't work since that's just %env(APP_SECRET)%. That's why we set

$container->setParameter('env(APP_SECRET)', $container->getParameter('secret'));

in order to have a fallback to the secret parameter.

@fritzmg
Copy link
Contributor

fritzmg commented May 26, 2023

While we could introduce hasParameter everywhere and thus implement the skeleton in PHP, we might as well just leave the parameters skeleton may be (and only remove it in Contao 6, where we will drop support for these parameters altogether).

@ausi
Copy link
Member

ausi commented May 26, 2023

While we could introduce hasParameter everywhere and thus implement the skeleton in PHP, we might as well just leave the parameters skeleton may be

I’d prefer the hasParameter() checks as I find it very confusing that I have a paramter %secret% in all my projects that always has the value ThisTokenIsNotSoSecretChangeIt, even though my %kernel.secret% is set correctly. This is actually how I noticed that these obsolete parameters are still there.

@leofeyer
Copy link
Member Author

That won't work since that's just %env(APP_SECRET)%.

I see. Then maybe we should indeed leave everything as is and discuss this again for Contao 6.

@leofeyer leofeyer merged commit 60b9331 into contao:5.x Jun 2, 2023
16 checks passed
@leofeyer leofeyer deleted the fix/parameters.yml branch June 2, 2023 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove skeleton/config/parameters.yaml
4 participants