hifi / heisenbridge

a bouncer-style Matrix IRC bridge
MIT License
244 stars 34 forks source link

Media proxy does not seem to be getting used #294

Closed spantaleev closed 2 months ago

spantaleev commented 3 months ago

In 9d11271d59a054, I've worked on adapting matrix-docker-ansible-deploy to your v1.15.0 release which is supposed to run a media proxy serving /_heisenbridge/media/* paths and being exposed publicly under media_url.

Our intention (expectation) is to:

It seems like currently Heisenbridge still generates URLs destined for the Matrix Media API, looking like this: {media_url}/_matrix/media/v3/download/DOMAIN/FILE_ID/FILE_NAME. Unless media_url is pointed to the homeserver URL, this cannot work.


Is there something else that needs to be done to enable the media proxy functionality? Is it possible only enabled for certain media and not other?

Perhaps us adding an additional /heisenbridge prefix and putting it in the media_url configuration key is not compatible with Heisenbridge's expectations.

It's probably most straightforward if Heisenbridge always proxied all media, instead of constructing 2 different types of URLs (sometimes leading to the Media API, sometimes leading to the media proxy).

tulir commented 3 months ago

There's only one way of constructing URLs, not two. However, the media path is configurable too (heisenbridge -> media_path). I guess the config can technically be used to bypass the new proxy, but by default the proxy is always used. If the media path hasn't been overridden, then the most likely explanation is that the bridge wasn't actually updated.