Dancer icon indicating copy to clipboard operation
Dancer copied to clipboard

dancer cookbook should offer guidance how to handle config without committing it to repo

Open wchristian opened this issue 13 years ago • 0 comments

Very often with web apps you have config details that you do not want to end up in the source repo, like database credentials for example. If you deploy the app yourself, that's fine, but you have a problem when you have to hand your app to a user who barely knows which end of perl not to stick in his mouth. You'll likely want him to run it with the production settings by default and you want the settings for the prod environment to have certain defaults, so you'll want to provide a file with some settings existing. But you also need to let him edit that with the database credentials since you don't want them in the repo. But then again, you don't want to end up having him edit a file under source control, because that means subsequent updates to the app in the deply location may become pretty arse.

Right now one possible solution is to rename the production.yml file to production-example.yml and mention it in the readme, so that trying to run it as prod blows up unless example is copied and adapted.

However that precludes changing the production default settings via further updates, so a better solution would be to have Dancer look for a .local.yml file and merge that into the settings when found or bail if there's no local. That way could just edit in what's needed and override stuff from the default file.

Alternatively an /install route could be made to edit the config file via web interface.

Either way, options are many, and some of them are sub-optimal, not possible yet or unimplemented. It would be nice if at least the Cookbook would be amended to point some of these things out. :)

wchristian avatar Aug 05 '11 10:08 wchristian