scala - environmental variable substitution when including another configuration file in Play 2.2 -
is possible use environmental variable substitution when including configuration file?
i have that:
include "${home}/.foo/credentials.conf"
configuration documentation mentions locating resources , include substitution not together.
this works:
include "/home/me/.foo/credentials.conf"
and home correctly set.
but attempts make include "${home}/.foo/credentials.conf"
far failed
background:
i deliberately want keep credentials , other sensitive data out of our code base have them available local dev environments testing. aware of more sophisticated solutions using external storage hinted here playframework 2 - storing credentials , use similar live , preview environments these not suitable local dev setup.
an alternative include credentials file code base after use git ignore prevent pushing it, fragile solution , risk push , compromise credentials.
tbh i'm not able include file absolute path /home/me...
anyway approach work using alternative conf file described in the same doc:
in file /home/me/.foo/credentials.conf need include application.conf
- play fallback file in classpath (this under vcs):
include "application.conf" mycredentials.user="espinosa" mycredentials.password="foobar123"
then run
/start
app config file locally:
play -dconfig.file=${home}/.foo/credentials.conf ~run
and that's it.
note: of course it's easier setup addition in ide (i.e. intellij: run > edit configurations) or write shell script containing command
Comments
Post a Comment