Reputation: 31151
I have a Hubot instance whose source code is public, but it needs some API keys which I need to keep secret.
My server configuration files /etc/supervisor/conf.d
I also want to keep public, so others can see my configuration. As a result, I can't write:
[program:hubot]
environment=API_KEY=12345
...
I've tried writing a bash wrapper script which isn't public and contains my secret API keys:
#!/bin/bash
export API_KEY=12345
~/src/handybot/bin/hubot -a xmpp
and calling it from supervisor:
[program:hubot]
command=/home/hubot/run_hubot.sh
This works, but the hubot process is not monitored by supervisor, only the bash process. As a result, if I do supervisorctl restart hubot
, I end up with two hubot instances.
Is it possible to include
other files in supervisor configuration files? I've also found dotenv but I'd have to hack Hubot itself to use it.
Upvotes: 0
Views: 484
Reputation: 8327
I didn't understand the part about wanting to keep conf.d
public (why do that?), but aside from that, try using exec
in the last line of the shell script:
exec ~/src/handybot/bin/hubot -a xmpp
Alternatively you can usually pass env vars like
ABC=2 DEF=3 ~/src/handybot/bin/hubot -a xmpp
I say "usually" only because I haven't tested it in supervisor.
Upvotes: 1