Skip to content

Comments

fix(flex): only accept 'true' or 'false' for boolean env vars#565

Open
kojiromike wants to merge 2 commits intoopenemr:masterfrom
kojiromike:simplify-bool-env
Open

fix(flex): only accept 'true' or 'false' for boolean env vars#565
kojiromike wants to merge 2 commits intoopenemr:masterfrom
kojiromike:simplify-bool-env

Conversation

@kojiromike
Copy link
Member

Summary

  • Replace permissive boolean handling with strict true/false validation
  • Add validate_bool() function that exits with clear error message for invalid values
  • Simplify all boolean checks to use shell builtins (if ${VAR}; then)

Migration

Users with EASY_DEV_MODE=1 or =yes will see:

Error: EASY_DEV_MODE must be 'true' or 'false', got '1'

Test plan

  • Test with valid values (EASY_DEV_MODE=true, EASY_DEV_MODE=false)
  • Test with invalid values (EASY_DEV_MODE=yes) - should fail immediately with clear error
  • Test that container starts correctly with default values

Closes #564

🤖 Generated with Claude Code

Replace the permissive boolean handling that accepted 'yes', 'no', '1',
'0', 'true', 'false' with strict validation requiring only 'true' or
'false' string values.

Benefits:
- Simpler checks using shell builtins (e.g., `if ${VAR}; then`)
- Fail-fast with clear error messages for invalid values
- No normalization logic needed
- Consistent behavior across all boolean env vars

Affected variables:
- DEVELOPER_TOOLS
- EASY_DEV_MODE
- EASY_DEV_MODE_NEW
- EMPTY
- FORCE_NO_BUILD_MODE
- INSANE_DEV_MODE
- MANUAL_SETUP
- PCOV_ON
- SWARM_MODE
- XDEBUG_ON

Closes openemr#564
@kojiromike kojiromike requested a review from a team February 11, 2026 23:39
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

Successfully merging this pull request may close these issues.

Simplify boolean env var handling: only accept 'true'/'false'

1 participant