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

Make boolean environment variables less pedantic #587

Open
1 task done
felddy opened this issue Jan 31, 2023 · 0 comments
Open
1 task done

Make boolean environment variables less pedantic #587

felddy opened this issue Jan 31, 2023 · 0 comments
Assignees

Comments

@felddy
Copy link
Owner

felddy commented Jan 31, 2023

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:

if [[ "${CONTAINER_VERBOSE:-}" ]]; then
echo -e "${LOG_NAME} | $(date +%Y-%m-%d\ %H:%M:%S) | [${BLUE}debug${RESET}] $*"
fi

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:

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

  • I agree to follow this project's Code of Conduct
@felddy felddy self-assigned this Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant