Move DB Credentials to it's own Config File

Post Reply
noimad46
User
Posts: 20

Move DB Credentials to it's own Config File

Post by noimad46 »

It would be extremely helpful if you could move the DB credentials to it's own file. I work on a development platform with a development database (different login) , then push to a live server. Every time I push to the live server, the system crashes and I have to go in and modify the database credentials to the live server. If they were in their own file I could just do a .gitignore on that particular file. Cant' really do that with the ewcfg because there may be changes in that file that need to be uploaded.


Adam
User
Posts: 480

Post by Adam »

Just use the Database_Connecting event - it contains the example code to do exactly that.


noimad46
User
Posts: 20

Post by noimad46 »

This could work i guess, but truly isn't ideal. Using the Database_Connecting function I'm now having to hard-code my database credentials into another location. And I have to write the logic for each project to account for this. Lastly, I would still have to upload my database credentials to the git repository because it is still stored in this file, which even though my repository is private, is not the most secure idea.

It seems like it could be an extremely easy fix to put the credentials in their own file and then just include that file into the ewcfg file.

That would be the correct thing to do for security purposes, and what you would see in any framework you would ever work with.

I guess I could look at storing my credentials in my own file, then including that file into this function and set it accordingly. A lot of extra work for what should be already be a standard security practice.


Webmaster
User
Posts: 9427

Post by Webmaster »

Try v2021.

Post Reply