WordPress / openverse

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
https://openverse.org
MIT License
254 stars 204 forks source link

Prefix environment variables not read from `.env` files with `OPENVERSE_` to disambiguate them #1944

Open sarayourfriend opened 1 year ago

sarayourfriend commented 1 year ago

Current Situation

Our environment variable practice is slightly error-prone. Variables like SERVICE or DC_USER are sufficiently ambiguous that it wouldn't be surprising if they conflicted with variables set in someone's personal shell environment.

Others, like DISABLE_SENTRY in the frontend, are slightly more "one-off" that it would be surprising if they conflicted and we set those in scripts. It's not unfounded that someone could have DISABLE_SENTRY in their shell environment though, so disambiguating those might not be a bad idea either.

Suggested Improvement

Rename the following environment variables:

Benefit

Disambiguates these variables. The suggested names above are sometimes more descriptive and self-documenting than the current ones, especially in the monorepo context.

dhruvkb commented 1 year ago

Closely related to https://github.com/WordPress/openverse/issues/1867 (now converted to a tracking issue).