yesodweb / yesod-scaffold

The Yesod scaffolding, with branches for different versions.
MIT License
76 stars 39 forks source link

Environment variable names #185

Closed snoyberg closed 6 years ago

snoyberg commented 6 years ago

Right now, the environment variables in config/settings.yml are unprefixed, e.g. HOST, PORT, and STATIC_DIR. This has caused issues in at least one place, see https://github.com/yesodweb/yesod/issues/1517. Should we prefix all of the variables with, e.g. YESOD_? Should we only prefix variables that are likely to be overloaded, like HOST and PORT?

CC @rszibele @psibi @StevenXL @bitemyapp

psibi commented 6 years ago

I don't have a strong opinion either way. But I would prefer everything to be prefixed.

rszibele commented 6 years ago

I would personally prefix all environment variables. This would have two advantages in comparison to only prefixing variables that are likely to be overloaded:

  1. Ensuring similar occurrences will not happen with other variables, even if unlikely. (e.g SQLITE_DATABASE)
  2. Providing a consistent naming convention of environment variables. Having some variables prefixed and others not could be confusing to newcomers.
snoyberg commented 6 years ago

Looks like pretty universal support for prefixing all the variables, I'll make the update.

snoyberg commented 6 years ago

Alright, changes pushed, closing.