def parse_bool(name, value):
    """Parse an environment variable value as a boolean."""
    value = value.lower()
    if value in ("false", "off", "no", "0"):
        return False
    if value in ("true", "on", "yes", "1"):
        return True
    raise ValueError(f"Invalid boolean environment variable: {name}={value}")