Conf file for event daemon - env variables?

Hi,

I was wondering if the conf file for the event daemon can read environment variables, so that the email user name and password could be stored outside of the file?!

Cheers,
frank

5 Likes

Currently, it can not.

This is a great suggestion, tho.

I’ll make note of it as a possible future improvement but if you’re keen to implement it, the project is open source. :wink:

4 Likes

ha, if only I had the time I would take a peek

2 Likes

2 Likes

1 Like

Hi,

I’m somewhat wary of contradicting Patrick, but EvenDeamon uses ConfigParser (SafeConfigParser to be exact) so you can use %(YOUR_ENV_VARIABLE)s in conf file and it will get resolved.

Am I missing something here @bouchep? I’m pretty sure that’s how I’ve set it up at our place…

1 Like

Hi @koaleksa, I tried this:

username: %(SG_EMAIL_NAME)s
password: %(SG_EMAIL_PWD)s

But with that the service refuses to start claiming an “incorrect function”

1 Like

Hello, I am not sure about environment variables, but I also do not like putting the password into the config. One thing I chose to do is create a dummy gmail account used purely for the emails used in the event daemon. You just need to setup access to the smtp server to allow less secure apps.

1 Like

I agree, that is exactly what I reckommded the other day when I helped somebody else with their setup.

1 Like

Hi @koaleksa,

Please, feel free to second guess me at any time. Especially if it is with great ideas like this one! :wink:

Unfortunately, the code uses ConfigParser and not SafeConfigParser. The repo is currently undergoing some fairly important changes but I’ll remember this for future improvement once the current work is done.

This gets me thinking… Did you edit your code or fork to use SafeConfigParser? If so… Would you have a diff handy for the community? :stuck_out_tongue:

1 Like

Ha! I see now whats going on. In fact, I didn’t, but Anthony Kramer of Chicken Bone Effects did and I forked their fork so credit to those guys!

Cheers :smiley:

3 Likes

ah, nice, thanks!

1 Like

I’m gonna steal that. Thanks Chicken Bone Effects. :heart:

1 Like

Hey folks!

Environment variables are now officially supported in the config file and the example config file removes the Shotgun URL, script name, script key, email username and email password literal values in favour of environment variables.

3 Likes