Skip to content

Conversation

thomwiggers
Copy link
Contributor

The update to 3.0 brings with it that it now uses MediaProxy.

@thomwiggers thomwiggers marked this pull request as draft September 9, 2024 11:57
@thomwiggers
Copy link
Contributor Author

Setting up media proxy is a bit above my level

@luixxiul luixxiul added the help-wanted Extra attention from the community is needed label Nov 11, 2024
@thomwiggers
Copy link
Contributor Author

I have rebased this, but would appreciate some help getting the authenticated media set up correctly

@thomwiggers
Copy link
Contributor Author

It seems that the media proxy is indeed part of the bridge, but that you need to set up e.g. traefik to route traffic to it. This is well above my paygrade.

@JadedBlueEyes
Copy link

@thomwiggers I had a shot at the traefik changes, not really tested though: https://github.com/JadedBlueEyes/matrix-docker-ansible-deploy/tree/patch-11

@thomwiggers
Copy link
Contributor Author

Thanks, that does look plausible... I hope I will have some time to test it.

@thomwiggers
Copy link
Contributor Author

The following gets posted to IRC

https://matrix.example.com/irc/v1/media/download/AXhzMyKXPbuQNpDBTy0kF9LvE0dTD7gjU9AbvfQaqoTBvqISAPERZVGQLJiz0IS9MrwQaNG33xyAY-bLjVrKSsBCeZheuENAAHdnZ3JzLm5sL3docFF4R0hhYXB1dmpXWW1rV092RmVVSA

But following it just gets a 404 :(

I haven't had time to dig into the logs yet.

@JadedBlueEyes
Copy link

The Traefik GUI dashboard is likely to show more hints

@thomwiggers
Copy link
Contributor Author

thomwiggers commented Sep 24, 2025

The Traefik GUI says the rule is Host(`example.com`) && PathPrefix(`/irc/`) so it appears the hostname is not properly specified (matrix is on a subdomain)

@thomwiggers
Copy link
Contributor Author

thomwiggers commented Sep 24, 2025

Using matrix_server_fqn_matrix instead of matrix_host brings me to:

Cannot GET /irc/v1/media/download/AXhzMyKXPbuQNpDBTy0kF9LvE0dTD7gjU9AbvfQaqoTBvqISAPERZVGQLJiz0IS9MrwQaNG33xyAY-bLjVrKSsBCeZheuENAAHdnZ3JzLm5sL3docFF4R0hhYXB1dmpXWW1rV092RmVVSA

which appears to result from the bridge, because:

sep 24 17:34:48 archeron matrix-appservice-irc[1084584]: INFO 15:34:48:214 [MediaProxy] GET /irc/v1/media/download/AduY_44ZkBJckUbjG2zsp9ZDKKyjFpnEJuC07BiWMnBjmm2QHUKgrL5JoUrRsjOcyEdV-P7R3cuLM6fdygaSL8lCeZoGljJQAHdnZ3JzLm5sL3RES2xpZWxPZHJYRGpjaHVmaXFXR3NvUQ 172.26.0.2 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15

@thomwiggers
Copy link
Contributor Author

thomwiggers commented Sep 24, 2025

Going off matrix-org/matrix-appservice-irc#1828 it may be that /irc needs to get stripped off the URL

Copy link
Contributor Author

@thomwiggers thomwiggers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consistency changes required


matrix_appservice_irc_homeserver_url: ""
matrix_appservice_irc_homeserver_media_url: '{{ matrix_homeserver_url }}'
matrix_appservice_irc_homeserver_media_url: '{{ matrix_homeserver_url }}/irc/'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matrix_appservice_irc_homeserver_media_domain: '{{ matrix_server_fqn_matrix }}'
matrix_appservice_irc_homeserver_media_path: '/irc/'


# Controls whether Traefik labels for the media proxy will be applied
matrix_appservice_irc_container_labels_media_proxy_enabled: true
matrix_appservice_irc_container_labels_traefik_path_prefix: "/irc"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
matrix_appservice_irc_container_labels_traefik_path_prefix: "/irc"
matrix_appservice_irc_container_labels_traefik_path_prefix: "{{ matrix_appservice_irc_homeserver_media_domain }}"

# Controls whether Traefik labels for the media proxy will be applied
matrix_appservice_irc_container_labels_media_proxy_enabled: true
matrix_appservice_irc_container_labels_traefik_path_prefix: "/irc"
matrix_appservice_irc_container_labels_media_proxy_traefik_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathPrefix(`{{ matrix_appservice_irc_container_labels_traefik_path_prefix }}`)"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
matrix_appservice_irc_container_labels_media_proxy_traefik_rule: "Host(`{{ matrix_server_fqn_matrix }}`) && PathPrefix(`{{ matrix_appservice_irc_container_labels_traefik_path_prefix }}`)"
matrix_appservice_irc_container_labels_media_proxy_traefik_rule: "Host(`{{ matrix_appservice_irc_homeserver_media_domain }}`) && PathPrefix(`{{ matrix_appservice_irc_container_labels_traefik_path_prefix }}`)"

# The port for the media proxy to listen on
bindPort: {{ matrix_appservice_irc_homeserver_media_bind_port | to_json }}
# The publically accessible URL to the media proxy
publicUrl: "{{ matrix_appservice_irc_homeserver_media_url }}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
publicUrl: "{{ matrix_appservice_irc_homeserver_media_url }}"
publicUrl: "https://{{ matrix_appservice_irc_homeserver_media_domain }}{{ matrix_appservice_irc_homeserver_media_path }}"

@thomwiggers thomwiggers marked this pull request as ready for review September 25, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-wanted Extra attention from the community is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants