element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
Apache License 2.0
3.31k stars 702 forks source link

Give the possiblity to configure the push gateway http url for airgapped deployments #7381

Closed gaelgatelement closed 1 year ago

gaelgatelement commented 1 year ago

Your use case

What would you like to do?

I'd like to be able to configure the http push gateway. It's currently hardcoded and defaulted to https://matrix.gateway.unifiedpush.org/_matrix/push/v1/notify.

Why would you like to do it?

When deploying Synapse/Element in an airgapped environment, I need to setup NTFY in this airgapped environment to enable push notifications. But at the moment, element cannot be configured to ask synapse to connect to this airgapped NTFY Push Gateway. Synapse tries to connect to the matrix.gateway.unifiedpush.org and gets a connection failure.

How would you like to achieve it?

Have you considered any alternatives?

No response

Additional context

No response

Are you willing to provide a PR?

No

karmanyaahm commented 1 year ago

Kind of an old issue, but this is not the case.

Element already works on an air-gapped network w/ ntfy since ntfy v1.26.0.

The hardcoded gateway is just a backup. Element prioritizes your self-hosted gateway. https://github.com/vector-im/element-android/blob/a2f8fed63cc237081e699cd9046dc9c52bc88271/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt#L105-L119

Only thing to keep in mind is Synapse needs HTTPS pushers, not HTTP. But that's a homeserver limitation, not Element. This issue should probably be closed, you can come to #unifiedpush:matrix.org for any questions.

simaddis commented 1 year ago

Is this for Android and iOS Element clients?

mcg-android commented 8 months ago

The hardcoded gateway is just a backup. Element prioritizes your self-hosted gateway. https://github.com/vector-im/element-android/blob/a2f8fed63cc237081e699cd9046dc9c52bc88271/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt#L105-L119

Can someone point a wannabe admin to the place where the address of the self-hosted gateway needs to be entered/stored/set so that Element-Android will see it and make use of it?

(Currently, matrix.gateway.unifiedpush.org has been unreachable for almost 24 hours; this dependency came as a bit of a surprise...)

karmanyaahm commented 8 months ago

where the address of the self-hosted gateway needs to be entered/stored/set

It detects a gateway automatically if it's set up on your server, and depends on what push server you're using. Feel free to ask with more details in the Unifiedpush Matrix room.