-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Untrack .env file from Git #1106
Conversation
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.
Can you share the motivation behind this? The tracking is intentional as we bake in the released versions into the env file and your proposed solution would not work with that when upgrading.
Sure, I'll update it. I've marked this PR as draft for now. :) Yes, I know. I'll also update everything related to it, so that it's still working as before. |
5238b8b
to
d7ea428
Compare
d7ea428
to
3a7f61f
Compare
Ok, I've updated the merge request. Based on the Git workflows, it should still work like before. |
Any news regarding this change @BYK ? At least your Github actions seem to be happy about this change: https://github.com/TS3Tools/onpremise/pull/1/checks :) |
@Sebi94nbg, I'm still very skeptical about the cost/benefit ratio of this change. It is possible to pass different env files to Do you have a strong motivation for your use case to make this change? |
This is not how |
Ok, if there are these dependencies and concerns on the part of the project, how about adding the ability to provide a "custom" Just as an example: if [[ -f ".env.custom" ]]; then
docker-compose --env-file .env.custom up
else
docker-compose --env-file .env up
# Identical to the line above
# docker-compose up
fi Reference: https://docs.docker.com/compose/environment-variables/#using-the---env-file--option This would allow administrators to change options from the |
I think this is a much better solution as it keeps the defaults simple, relatively easy to implement (as we alias I have to go back to my original question for clarification though: These values are not intended to be changed, at least on disk, what is the exact need you have that you want to change the values here? |
Closing this merge request. I've created a new one with the discussed change: #1113 |
This merge request will...
.env
file from the Git tracking.env.example
instead of the previous well known.env
file.env
file at the installation, when no such file exists yetscripts/bump-version.sh
to update the.env.example
file instead.env
file to the readmeMotivation:
The
.env
file provides environment specific configurations, which can be always different at each installation. Due to this, the.env
file - which is actually loaded and used by the application - should never be committed to Git. Instead, you rather should commit and track a template, an example file.Such an
.env
file could also contain secrets like usernames, passwords or API tokens, which is one more good reason to avoid committing it to Git as everyone could see your secrets there.Additional, when you check out this repository using Git, change something in the
.env
file and do agit status
, it shouldn't show any changes as the.env
should be handled like normal system environment variables, which are also not checked by Git. Git also won't be that happy about changed and not committed files when you execute certain Git commands. Git will then ask you to undo, commit or stash these changes first.A clean and working installation also shouldn't report any changes, when you run a
git status
. Otherwise, the application is not properly checked out.Also see these articles regarding the DotEnv file: