import os


def env_bool(name: str, default: bool = False) -> bool:
    """Parse an environment variable as a boolean with common truthy values."""
    val = os.getenv(name)
    if val is None:
        return default

    return val.strip().lower() in {"1", "true", "yes", "y", "on"}
