As a relatively new web developer, I think I have spent more time learning about tools and how to use them than I have coding. That might be an overstatement, but I do find myself spending tons of hours doing things to ensure the integrity of my work environment and processes.
Based on a misspent youth as a COBOL/BAL programmer, I knew I needed a version control and repository system which quickly took me to Git. I’ve learned the bare minimums. I learned that there is a .git directory and that I can manage a .gitignore file. I can check status, do adds and commits and push to a GitHub repo. I have not yet found a need for branching.
I think it’s time for me to learn more, but most of the tutorials I’ve been through advance too quickly and cover ground that has no application for me. So, I’m seeking advice on free tutorials that I can investigate to improve my understanding of the git process and specifically to make better use of tools. So far, I’m done every thing in the command window; therefore, if there are tools and UIs you might suggest I look into, please list them, too.
so you do all you development in the development branch which reflects more or less your local version of the web app.
When you finished a new feature, you merge it into the release branch, which is a copy of what you have on your web server (host).
Normally you have something like a
Stage
branch in between. This is the copy of the test version on the web server.
So the standard workflow is:
Do your changes in Develop and test locally. Merge them into Stage, test them on the server and then merge Stage into Relase to deploy to production.
When you use GitHub you can add an action runner to your repos. This is then able to move all the files to your server. This means, when you push a stage or release version to GitHub, this versions are automatically deployed on the web server. Little bit tricky to install and configure this but super cool when it works as it saves you so much time and also reduces deployment errors you often have when you do it manually like forgetting a changed file, forget to set correct file owners or access rights etc.
when you find a bug in your release, you just create a new branch
Bugfix
from the release branch, fix the error, merge the Bugfix branch back into the release branch and deploy it. Then you also merge the Bugfix branch into your Develop branch to have the bug fixed in your actual working code also.
this all saves so much time and nerves I will never ever miss it
I can second that. The number of hits we get on our servers at work looking for .env files is insane. If you put it there it’s not a matter if someone will find it, it’s a matter of when they will find it.
.env file is not accessible by webservers (unless you misconfigure it). That is like saying your app source code is accessible by webserververs. In fact sometimes webservers run in what is called demilitarize zones, and the webapp run behind firewalls.
.env are loaded by the app, requests are not able to get to it.
Yes, if you want extract protection of not sending the .env file by mistake to github, then yes put it outside the project.
Not sure what we are talking about but Apache does not take care about what extension a file has. Maybe some crazy windows server stuff is doing this be default but I don’t think your message is true in general.
Basically, you put your website in /home/someuser/somewebsite.com/public, tell Apache to serve from there (use it as DocumentRoot) and then put your .env file in /home/someuser/somewebsite.com/.env. So there is absolutely no way to get that file from Apache as it won’t serve files outside the document root.
Same applies to other servers like NGiNX, IIS, etc.