Skip to content

Update matrix-appservice-irc version#3512

Closed
thomwiggers wants to merge 23 commits intospantaleev:masterfrom
thomwiggers:patch-11
Closed

Update matrix-appservice-irc version#3512
thomwiggers wants to merge 23 commits intospantaleev:masterfrom
thomwiggers:patch-11

Conversation

@thomwiggers
Copy link
Copy Markdown
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
Comment thread roles/custom/matrix-bridge-appservice-irc/templates/config.yaml.j2 Outdated
@thomwiggers
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@thomwiggers
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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
Copy Markdown
Contributor Author

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

@thomwiggers
Copy link
Copy Markdown
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
Copy Markdown
Contributor

The Traefik GUI dashboard is likely to show more hints

@thomwiggers
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

… naming conventions

Variables that map to nested YAML config properties should follow the pattern:
matrix_<component>_<configPath>_<nestedProperty>

For ircService.mediaProxy.*, we now use:
- matrix_appservice_irc_ircService_mediaProxy_bindPort
- matrix_appservice_irc_ircService_mediaProxy_publicUrl_hostname
- matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix

This follows the existing pattern used by matrix_appservice_irc_ircService_servers
and similar variables in other roles (e.g., matrix_hookshot_github_defaultOptions_*).

Also renamed the Traefik path prefix variable to include 'media_proxy' for clarity:
- matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix
Instead of hardcoding 'https' in the publicUrl, introduce a scheme variable
that can be configured. This follows the pattern used by other roles
(e.g., matrix_mautrix_discord_scheme, matrix_hookshot_public_scheme).

New variables:
- matrix_appservice_irc_ircService_mediaProxy_publicUrl_scheme (defaults to https)
- matrix_appservice_irc_ircService_mediaProxy_publicUrl (combines scheme, hostname, pathPrefix)

The scheme is wired in group_vars/matrix_servers based on matrix_playbook_ssl_enabled,
consistent with how other roles handle this.
Role defaults should not reference playbook-level variables like
matrix_playbook_reverse_proxy_type or traefik_entrypoint_primary,
as this breaks standalone usage of the role.

Following the pattern established by other roles (matrix-sliding-sync,
matrix-synapse-admin, matrix-media-repo, etc.), Traefik variables now
use safe standalone defaults (true, web-secure, default) while the
actual playbook wiring remains in group_vars/matrix_servers.

Also standardized certResolver variable naming to use camelCase,
consistent with other roles in the playbook.
…Prefix

Instead of hardcoding '/irc' in two places, the Traefik path prefix is now
derived from the mediaProxy publicUrl_pathPrefix variable by stripping the
trailing slash (Traefik paths must not end with a slash, except for '/').

Added validation to ensure:
- publicUrl_pathPrefix starts and ends with a slash (required by the service)
- Traefik path prefix doesn't end with a slash (consistent with other roles)
…media_url

The matrix_appservice_irc_homeserver_media_url variable was removed and
replaced by the new mediaProxy configuration. Users who had this variable
set will now get a helpful message pointing them to the new approach.
Update copyright year ranges to reflect actual contributions:
- Thom Wiggers contributions extended to 2026
- Slavi Pantaleev contributions extended to 2026
- Added Jade Ellis as original author of labels.j2
@spantaleev
Copy link
Copy Markdown
Owner

Thanks for the contribution! I've made some adjustments on top of your work to improve consistency with the rest of the playbook:

  • Renamed the new mediaProxy variables to follow playbook naming conventions (matrix_appservice_irc_ircService_mediaProxy_*)
  • Added a scheme variable instead of hardcoding https
  • Fixed Traefik variable defaults to use standalone values (not referencing playbook-level variables)
  • Derived the Traefik path prefix from the *_publicUrl_pathPrefix to avoid duplication
  • Added validation and a deprecation notice for the removed variable
  • Updated SPDX license headers

Squash-merged now. Thanks again to you and @JadedBlueEyes!

@luixxiul luixxiul removed the request for review from spantaleev January 29, 2026 12:18
@luixxiul luixxiul removed the help-wanted Extra attention from the community is needed label Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants