8000 [WebProfilerBundle] Display environment variables by sanpii · Pull Request #22406 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[WebProfilerBundle] Display environment variables #22406

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

Closed
wants to merge 2 commits into from
Closed

[WebProfilerBundle] Display environment variables #22406

wants to merge 2 commits into from

Conversation

sanpii
Copy link
Contributor
@sanpii sanpii commented Apr 12, 2017
Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

With the new dotenv component it’s usefull to have environment variables in the profiler page.

screen shot 2017-04-12 at 21 02 37-fullpage

@sanpii sanpii changed the title Profiler environment variables [web-profiler-bundle] Profiler environment variables Apr 12, 2017
@sanpii sanpii changed the title [web-profiler-bundle] Profiler environment variables [WebProfilerBundle] Profiler environment variables Apr 12, 2017
@sanpii sanpii changed the title [WebProfilerBundle] Profiler environment variables [WebProfilerBundle] Display environment variables Apr 12, 2017
@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Apr 12, 2017
@linaori
Copy link
Contributor
linaori commented Apr 13, 2017

What if there are passwords in there?

@javiereguiluz
Copy link
Member
javiereguiluz commented Apr 13, 2017

@iltar although your concern is true, we may already display passwords and other sensitive information in other panels. That's why it's suicidal to put the profiler in production or forget to remove app_dev.php (luckily Symfony Flex will avoid this issue).

@linaori
Copy link
Contributor
linaori commented Apr 13, 2017

@javiereguiluz We use app_dev.php to reproduce issues in production and check the debug/profiler information, removing this is not really an option for us unless an alternative is provided. However, this also means that wherever possible, I would like to avoid displaying sensitive data, regardless of environment. Not sure if the env variables is something that you want to see. They are a replacement of the parameters and I never had the need to display those either.

@sanpii
Copy link
Contributor Author
sanpii commented Apr 13, 2017

@iltar How could you distinguish sensitive data?

@javiereguiluz
Copy link
Member

@iltar I meant it's suicidal to put the profiler in production ... without protecting it. You are already protecting it, so there's no issue for showing a few more sensitive data.

@sanpii you can't. There's no solution to this issue :(

@wouterj
Copy link
Member
wouterj commented Apr 14, 2017

I wonder how usefull this is. Profilers should show request dependent data, data that changes per request. Env variables are bound to the server, not the request, isn't it?

@sanpii
Copy link
Contributor Author
sanpii commented Apr 16, 2017

I wonder how usefull this is

It’s usefull when you use the environment variables to configure your application.

http://fabien.potencier.org/symfony4-best-practices.html#environment-variables

@wouterj
Copy link
Member
wouterj commented Apr 16, 2017

It’s usefull when you use the environment variables to configure your application.

Yeah, but it doesn't change per request. If people find it usefull to get this information, I think a debug:dotenv or debug:env etc. command fits this data better.

@sanpii
Copy link
Contributor Author
sanpii commented Apr 17, 2017

Yeah, but it doesn't change per request.

It’s possible. You can define a variable from bash command.

If people find it usefull to get this information, I think a debug:dotenv or debug:env etc. command fits this data better.

It’s a good idea, however environment variables may be different between the command line and the web server.

@fabpot
Copy link
Member
fabpot commented Apr 17, 2017

I think @wouterj is right. The web profiler is about "things" that are related to the current request.

@javiereguiluz
Copy link
Member

@sanpii don't worry if this proposal is rejected. When using the new Dotenv component (as in Symfony Flex, Symfony 4.0, etc.) those env vars already appear in the profiler thanks to this line: https://github.com/symfony/dotenv/blob/master/Dotenv.php#L76

In this example, the APP_ENV, APP_DEBUG, etc. are variables defined in the .env file:

env_vars_profiler

@fabpot
Copy link
Member
fabpot commented Apr 18, 2017

Good catch @javiereguiluz, then we're all good.

@fabpot fabpot closed this Apr 18, 2017
@sanpii sanpii deleted the profiler-environment branch April 18, 2017 14:15
@sanpii
Copy link
Contributor Author
sanpii commented Apr 18, 2017

@javiereguiluz I didn’t see, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
0