foundryvtt-docker icon indicating copy to clipboard operation
foundryvtt-docker copied to clipboard

Make boolean environment variables less pedantic

Open felddy opened this issue 2 years ago • 0 comments

Feature description

Some of the optional environment variables are booleans. While to documentation does say to set them to true to take effect, the implementation could be more lenient.

The implementation of the boolean variable CONTAINER_VERBOSE is a good example of how to handle these types of toggles: https://github.com/felddy/foundryvtt-docker/blob/3f4572da5e30234974d16da1be8352ad78e7af1d/src/logging.sh#L15-L17

It probably makes sense to explicitly document that the variable should be unset or empty and not false to disable a function.

Another approach would be to normalize all the expected variables at the start of the entry point.

Motivation

See:

  • #581

Example

Instead of setting a boolean environment variable exactly to true, it can be set to any non-empty value.

Compliant variables:

  • CONTAINER_VERBOSE

Candidate variables:

  • CONTAINER_PRESERVE_CONFIG
  • FOUNDRY_IP_DISCOVERY
  • FOUNDRY_MINIFY_STATIC_FILES
  • FOUNDRY_PROXY_SSL
  • FOUNDRY_UPNP

Pitch

To make it easier for users to successfully configure the container.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

felddy avatar Jan 31 '23 15:01 felddy