HUBOT_HTTPD environment variable doesn't allow disabling the server properly
mistydemeo opened this issue · comments
bin/hubot.js
allows specifying several options via environment variables and commandline switches: https://github.com/hubotio/hubot/blob/master/bin/hubot.js#L23-L29
Most of these values take arguments, but one, HUBOT_HTTPD
, is a boolean. It defaults to true
and, when set to false
, the Express HTTP server is disabled. However, the logic for setting it is buggy; the variable is assigned the same way as with the others that take arguments, so it effectively assigns enableHttpd
to a string or true
. This has two problems:
- All JavaScript strings except an empty string are truthy, and it's unintuitive that the only meaningful value is
HUBOT_HTTPD=
. [falsy value] || true
evaluates totrue
, so regardless of what the user does the result is still the same.
Fixed by #1548