Closed hashworks closed 1 year ago
I try to hide the matrix bridge from IRC users as much as possible. However, sending attachments breaks the illusion atm, since it is a matrix URL: https://example.net/_matrix/media/r0/download/example.net/dbWPYNbBQVdkWqCVWZzvFADD/foo.jpg
https://example.net/_matrix/media/r0/download/example.net/dbWPYNbBQVdkWqCVWZzvFADD/foo.jpg
While I can adjust the domain with MEDIA_URL, the rest remains unchanged. It would be great if one could provide a template that adjusts https://github.com/hifi/heisenbridge/blob/master/heisenbridge/__main__.py#L343. The default would be:
MEDIA_URL
https:/${MEDIA_URL}/_matrix/media/r0/download/${NETLOC}${PATH}${FILENAME}
With a properly configured reverse proxy one could reduce it to:
https:/irc.example.net/${PATH}${FILENAME}
Which would result in:
https://irc.example.net/dbWPYNbBQVdkWqCVWZzvFADD/foo.jpg
This would work since the netloc never changes with the bridge.
I think this would help with #257, since ATM one needs to adjust the reverse proxy to Content-Disposition: inline anyway.
Content-Disposition: inline
I try to hide the matrix bridge from IRC users as much as possible. However, sending attachments breaks the illusion atm, since it is a matrix URL:
https://example.net/_matrix/media/r0/download/example.net/dbWPYNbBQVdkWqCVWZzvFADD/foo.jpg
While I can adjust the domain with
MEDIA_URL
, the rest remains unchanged. It would be great if one could provide a template that adjusts https://github.com/hifi/heisenbridge/blob/master/heisenbridge/__main__.py#L343. The default would be:https:/${MEDIA_URL}/_matrix/media/r0/download/${NETLOC}${PATH}${FILENAME}
With a properly configured reverse proxy one could reduce it to:
https:/irc.example.net/${PATH}${FILENAME}
Which would result in:
https://irc.example.net/dbWPYNbBQVdkWqCVWZzvFADD/foo.jpg
This would work since the netloc never changes with the bridge.