-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix apprise integration for Zulip Streams #1604
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this needs a default value of some sort. Else its not fixing anything.
Maybe the hostname or IP of uptime-kuma.
@gaby I'm totally open to adding a default, however I need to point out that it would be a backwards incompatible change as any deployment of uptime-kuma that uses an apprise backend which doesn't require a title (e.g. Zulip direct messages) will have the behavior changed. I read in the contributing guide here that backwards incompatible changes won't be merged, which is why I went with the opt-in path in this PR. I'm not familiar with all the apprise backends (I just use it for Zulip) so I can't say how prevalent the title requirement actually is. Let me know what you think. |
Yeah, I see what you mean now. 👍🏻 looks good to me. |
Thanks for the review @gaby. What's the process for getting something merged and published? Anything I can help with? |
Environment Variable is not encouraged in the project. (https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md) In this case, if a user want to use Zulip Streams, they need to add the env variable and restart the Uptime Kuma instance in order to activate it. Also users can setup multiple Apprise notifications, it will affect all Apprise notifications. My suggestion would be add an optional field if (title is undefined || title is empty string) {
call apprise without title (original call)
} else {
call apprise with title (new)
} |
Description
Currently it's impossible to send a notification from uptime-kuma to a Zulip stream via the apprise integration. This is because some apprise backends (including messaging a Zulip stream) fail if the notification title isn't included in the request:
If we add the argument
-t "title"
the notification is sent correctly:To fix this scenario, this pull request adds an environment variable
APPRISE_NOTIFICATION_TITLE
that can be used to include the title argument in the call to apprise.In an ideal world, the title would be derived from the data that's passed into the send function, but this would be a breaking change. The approach proposed in this pull request is fully backwards compatible as a user of uptime-kuma must explicitly opt-in to the new behavior by setting the new environment variable.
Type of change
Checklist
My code needed automated testing. I have added them (this is optional task)