protect password in open source project
I was thinking about starting an open source project in github but I dont have idea how to hide m开发者_运维知识库y passwords that I use when I am developing! because even if I change them people can see it in the commits history when I have changed my password and then use it! now I am making some sort of webmail with PHP and I am using my personal password. What are your suggestions?
Generally, the approach would be to isolate your passwords in configuration files and do not check in your deployment configuration files. Instead, you would keep those on the side and apply them to your local working copy after the fact. Many projects will have template configuration files that one can fill out to get started.
See, for example, WordPress: http://core.trac.wordpress.org/browser/trunk/wp-config-sample.php
Make your code read the password from a property file that you don't commit to the git repo.
精彩评论