[Dancer-users] Plugin::Database - suggestion to read username/password from a different file

Assaf Gordon gordon at cshl.edu
Thu Sep 22 23:35:20 CEST 2011


Hello Dancers,

Somewhat related to the "sensitive" config data in SCM" topic discussed recently,
I would like to suggest the followng small patch to "Dancer::Plugin::Database" :

Instead of specifying "username/password" in your yml config file, I've added a new setting called "credentials".
This one points to a simple text file that would contain the user name and password.

With this one can checkin all the configuration files, never worrying about passwords.

Samba uses similar option in "smbclient" .

So my new config looks like this:
====
plugins:
    Database:
        driver: 'mysql'
        database: 'devdb'
        credentials: 'database.secret'
=====
And the username password are stored in "database.secret":
=====
$ cat database.secret
username=myuser
password=mypassword
====

The patch is available here:
https://github.com/agordon/Dancer-Plugin-Database/commit/5564d0c729899c45b86a7f9872cf680d940f2b0c


Comments are welcomed,
  -gordon


More information about the Dancer-users mailing list