Skip to content

[🐛 Bug]: PUSHER_USE_SSL is incorrectly parsed #6582

Description

@paul-serdiuk

In keep/api/core/dependencies.py, and in the docs, the env PUSHER_USE_SSL is expected to be a boolean, but Docker Compose doesn't support booleans. Setting PUSHER_USE_SSL: false will therefore pass it on as a string and evaluate to True.

The fix should look something like this:

pusher_use_ssl = os.environ.get("PUSHER_USE_SSL", "false").lower() in (
    "1",
    "true",
    "yes",
    "on",
)

pusher = Pusher(
    host=pusher_host,
    port=int(os.environ["PUSHER_PORT"]) if os.environ.get("PUSHER_PORT") else None,
    app_id=pusher_app_id,
    key=pusher_app_key,
    secret=pusher_app_secret,
    ssl=pusher_use_ssl,
    cluster=os.environ.get("PUSHER_CLUSTER"),
)

This bug might be affecting other similar cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions