Files
zulip/zproject
Greg Price 4374ee403d push_notifs: In dev, use EXTERNAL_HOST directly as bouncer
The `push.{EXTERNAL_HOST}` formula effectively assumes that the host
in EXTERNAL_HOST is zulipdev.com -- it's relying on the fact that
push.zulipdev.com is in DNS as an alias of zulipdev.com.  That's a
special fact that wouldn't be true of most hostnames.

It especially isn't true of IP addresses.  If one has set
EXTERNAL_HOST to a value like `192.168.0.2:9991` -- for example in
order to reach the dev server from a separate machine, such as a
physical mobile device:
  https://github.com/zulip/zulip-mobile/blob/main/docs/howto/dev-server.md
then setting ZULIP_SERVICES_URL to `http://push.192.168.0.2:9991`
is definitely not going to work.  For example:
  https://chat.zulip.org/#narrow/channel/243-mobile-team/topic/notifications.20from.20dev.20server/near/2159863

In the dev server, the point with ZULIP_SERVICES_URL is that it
should point back to the same dev server.  So use a formula that
says that more directly and so more reliably.

Tests are a different matter: we want a distinct URL there, because
we'll be inspecting the URLs in requests.  But in tests there's also
no requirement that the two hosts have anything to do with each
other; so the existing formula is fine there, and keep it in place.

(In tests it'd probably be better to use proper RFC 6761 test
domains, like `chat.example.com` and `push.example.net`.  But
that's an independent question.)
2025-04-28 20:24:05 -07:00
..