I second Manuel's environment variable approach. On 
heroku<https://devcenter.heroku.com/articles/config-vars>this is easy to set 
with

heroku config:add PASSWORD_FILE="/etc/passwords"

For more complex deployments, you can use automation systems like Pallet or 
Chef to manage environment variables.

On Wednesday, December 19, 2012 1:40:18 PM UTC-8, Alex Baranosky wrote:
>
> I don't like the environment variable approach because of the dependency 
> on global state makes deploying harder.
>
> I'd usually have a config file like config.clj whose contents were just a 
> Clojure map.  When loading the application I'd pass in the location of the 
> config file as a parameter, and read-string the file at run-time.  That 
> said, it can sometimes be convenient for development to have some default 
> config file location, so you don't always need to pass the config location 
> in.
>
> Alex
>
> On Wed, Dec 19, 2012 at 12:13 PM, Manuel Paccagnella <
> manuel.pa...@gmail.com <javascript:>> wrote:
>
>> I'm not sure that a password file is an optimal solution for this 
>> problem. Maybe the 12 factors <http://www.12factor.net/>, and in 
>> particular the config <http://www.12factor.net/config> one, could give 
>> you some ideas.
>>
>> Personally I think that credentials are environment-specific, not 
>> application-specific. So I'd place them in an external storage service 
>> (like a DB). Or, to make things simple, put them in a file somewhere in the 
>> system and load it through an environment variable (see 12 factors, III).
>>
>> This is as simple as writing:
>>
>> (load-passwords-from-file (System/getenv "PASSWORD_FILE"))
>>
>> Hope it helps :)
>>
>> Il giorno martedì 18 dicembre 2012 03:21:31 UTC+1, Marco Munizaga ha 
>> scritto:
>>
>>> I'm currently doing something like src/project/passwords.clj and git 
>>> ignoring that, does anyone have a better solution? maybe a way to place the 
>>> passwords.clj alongside project.clj in the root directory? Would this be 
>>> possible through leiningen profiles?
>>>
>>>
>>> Thanks
>>>
>>  -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com<javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to