Post by Peter Cooper on January 26th, 2007
Request Database Authentication When Rails Starts

- Control your Rails Process Sizes with Ruby 1.8.5
- More New Rails Screencasts from RailsCasts.com
- 16 RJS Resources and Tutorials for Rails Programmers



Derek (usernamed perraultd) shows us how to rewrite your Rails application's database.yml file to manually prompt you for database authentication information when your Rails app starts. This might not be of much use in automated deployment environments, but it demonstrates the dynamism of the templating system (I didn't even realize database.yml was processed in this way).

Click here to add on del.icio.us









January 26th, 2007 at 8:20 pm
I am astonished.
This new info on yaml processing will open a bunch of possibilities.
Extremely interesting.
January 26th, 2007 at 11:02 pm
The manual prompt wouldn't work too hot for automated deployments, but if you decrypt a hashed password in database.yml, that would work.
I just needed something very lightweight, but like Dejan Dimic said, there's a bunch of possibilities. :)
January 27th, 2007 at 9:24 am
Wow...
But, being on the negative side, I can see automatically processing files using ERB (or anything that can "run code") without explicit request may be a... security concern. (for some people)