Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HUBOT_HTTPD environment variable doesn't allow disabling the server properly #1471

Closed
mistydemeo opened this issue Oct 15, 2018 · 1 comment

Comments

@mistydemeo
Copy link
Contributor

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:

  1. All JavaScript strings except an empty string are truthy, and it's unintuitive that the only meaningful value is HUBOT_HTTPD=.
  2. [falsy value] || true evaluates to true, so regardless of what the user does the result is still the same.
@technicalpickles
Copy link
Member

Fixed by #1548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants