Answer the question
In order to leave comments, you need to log in
How to store configs with passwords in a repository
Just starting to use svn and maybe a stupid question. Here I have a project in php, stored in the SVN repository. It has a build.xml for phing that deploys the application in two versions on the test and main servers. All parameters for accessing the database are written in build.xml. Actually, is it normal to store passwords in the repository to access databases and other external resources, or is it done differently?
Answer the question
In order to leave comments, you need to log in
There are several approaches, for example:
1. Store the build.xml.example file (in a turnip)
In this case, each developer should copy it with the name build.xml, changing the parameters to the desired ones, and the build.xml itself is added to .svnignore, so that the values \u200b\u200bof individual developers are not frayed and there is always an example of a config.
2. Sometimes they do this - build.xml (in a turnip) stores settings common to all, and to override or add, each developer needs to create his own build.xml.local, which is listed in the repository ignore. Naturally, when connecting configs, this should be taken into account, and a check for the local config should take place.
3. The approach, which I consider the most successful, is used in many frameworks, and not only in PHP, for example, in Zend, Symphony, and in Rails, Django - when one config contains several sections, with the possibility of inheriting parameters from other sections, each separate section can be inherited and extended/modified Sections are included depending on the environment variable.
And yes, answering the question, it is normal to store access parameters in the repository, unless of course it is a public rap, for the general ones, the 1st, and partially the 2nd methods are suitable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question