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_prefixpull/3512/head
| @@ -46,10 +46,13 @@ matrix_appservice_irc_config_path: "{{ matrix_appservice_irc_base_path }}/config | |||||
| matrix_appservice_irc_data_path: "{{ matrix_appservice_irc_base_path }}/data" | matrix_appservice_irc_data_path: "{{ matrix_appservice_irc_base_path }}/data" | ||||
| matrix_appservice_irc_homeserver_url: "" | matrix_appservice_irc_homeserver_url: "" | ||||
| matrix_appservice_irc_homeserver_media_domain: '{{ matrix_server_fqn_matrix }}' | |||||
| matrix_appservice_irc_homeserver_media_path: '/irc/' | |||||
| matrix_appservice_irc_homeserver_media_bind_port: 11111 | |||||
| matrix_appservice_irc_homeserver_domain: '{{ matrix_domain }}' | matrix_appservice_irc_homeserver_domain: '{{ matrix_domain }}' | ||||
| # ircService.mediaProxy configuration for serving publicly accessible URLs to authenticated Matrix media | |||||
| matrix_appservice_irc_ircService_mediaProxy_bindPort: 11111 # noqa var-naming | |||||
| matrix_appservice_irc_ircService_mediaProxy_publicUrl_hostname: '{{ matrix_server_fqn_matrix }}' # noqa var-naming | |||||
| matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix: '/irc/' # noqa var-naming | |||||
| matrix_appservice_irc_homeserver_enablePresence: true # noqa var-naming | matrix_appservice_irc_homeserver_enablePresence: true # noqa var-naming | ||||
| matrix_appservice_irc_appservice_address: 'http://matrix-appservice-irc:9999' | matrix_appservice_irc_appservice_address: 'http://matrix-appservice-irc:9999' | ||||
| @@ -469,7 +472,7 @@ matrix_appservice_irc_ircService_servers: [] # noqa var-naming | |||||
| # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9999"), or empty string to not expose. | # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9999"), or empty string to not expose. | ||||
| matrix_appservice_irc_container_http_host_bind_port: '' | matrix_appservice_irc_container_http_host_bind_port: '' | ||||
| # Controls whether the matrix-appservice-irc container exposes its media proxy HTTP port (tcp/11111 in the container). | |||||
| # Controls whether the matrix-appservice-irc container exposes its media proxy HTTP port. | |||||
| # | # | ||||
| # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:11111"), or empty string to not expose. | # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:11111"), or empty string to not expose. | ||||
| matrix_appservice_irc_container_media_proxy_host_bind_port: '' | matrix_appservice_irc_container_media_proxy_host_bind_port: '' | ||||
| @@ -492,8 +495,8 @@ matrix_appservice_irc_container_labels_traefik_tls_certresolver: "{{ traefik_cer | |||||
| # Controls whether Traefik labels for the media proxy will be applied | # 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_media_proxy_enabled: true | ||||
| matrix_appservice_irc_container_labels_traefik_path_prefix: "/irc" | |||||
| 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 }}`)" | |||||
| matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix: "/irc" | |||||
| matrix_appservice_irc_container_labels_media_proxy_traefik_rule: "Host(`{{ matrix_appservice_irc_ircService_mediaProxy_publicUrl_hostname }}`) && PathPrefix(`{{ matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix }}`)" | |||||
| matrix_appservice_irc_container_labels_media_proxy_traefik_priority: 2000 | matrix_appservice_irc_container_labels_media_proxy_traefik_priority: 2000 | ||||
| matrix_appservice_irc_container_labels_media_proxy_traefik_entrypoints: "{{ matrix_appservice_irc_container_labels_traefik_entrypoints }}" | matrix_appservice_irc_container_labels_media_proxy_traefik_entrypoints: "{{ matrix_appservice_irc_container_labels_traefik_entrypoints }}" | ||||
| matrix_appservice_irc_container_labels_media_proxy_traefik_tls: "{{ matrix_appservice_irc_container_labels_media_proxy_traefik_entrypoints != 'web' }}" | matrix_appservice_irc_container_labels_media_proxy_traefik_tls: "{{ matrix_appservice_irc_container_labels_media_proxy_traefik_entrypoints != 'web' }}" | ||||
| @@ -141,9 +141,9 @@ ircService: | |||||
| # How long should the generated URLs be valid for | # How long should the generated URLs be valid for | ||||
| ttlSeconds: 604800 | ttlSeconds: 604800 | ||||
| # The port for the media proxy to listen on | # The port for the media proxy to listen on | ||||
| bindPort: {{ matrix_appservice_irc_homeserver_media_bind_port | to_json }} | |||||
| bindPort: {{ matrix_appservice_irc_ircService_mediaProxy_bindPort | to_json }} | |||||
| # The publicly accessible URL to the media proxy | # The publicly accessible URL to the media proxy | ||||
| publicUrl: "https://{{ matrix_appservice_irc_homeserver_media_domain }}{{ matrix_appservice_irc_homeserver_media_path }}" | |||||
| publicUrl: "https://{{ matrix_appservice_irc_ircService_mediaProxy_publicUrl_hostname }}{{ matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix }}" | |||||
| # Options here are generally only applicable to large-scale bridges and may have | # Options here are generally only applicable to large-scale bridges and may have | ||||
| # consequences greater than other options in this configuration file. | # consequences greater than other options in this configuration file. | ||||
| @@ -11,7 +11,7 @@ traefik.enable=true | |||||
| traefik.docker.network={{ matrix_appservice_irc_container_labels_traefik_docker_network }} | traefik.docker.network={{ matrix_appservice_irc_container_labels_traefik_docker_network }} | ||||
| {% endif %} | {% endif %} | ||||
| traefik.http.services.matrix-appservice-irc-media-proxy.loadbalancer.server.port={{ matrix_appservice_irc_homeserver_media_bind_port }} | |||||
| traefik.http.services.matrix-appservice-irc-media-proxy.loadbalancer.server.port={{ matrix_appservice_irc_ircService_mediaProxy_bindPort }} | |||||
| ############################################################ | ############################################################ | ||||
| # # | # # | ||||
| @@ -23,14 +23,14 @@ traefik.http.services.matrix-appservice-irc-media-proxy.loadbalancer.server.port | |||||
| traefik.http.routers.matrix-appservice-irc-media-proxy.rule={{ matrix_appservice_irc_container_labels_media_proxy_traefik_rule }} | traefik.http.routers.matrix-appservice-irc-media-proxy.rule={{ matrix_appservice_irc_container_labels_media_proxy_traefik_rule }} | ||||
| {% if matrix_appservice_irc_container_labels_traefik_path_prefix != '/' %} | |||||
| traefik.http.middlewares.matrix-appservice-irc-media-proxy-slashless-redirect.redirectregex.regex=({{ matrix_appservice_irc_container_labels_traefik_path_prefix | quote }})$ | |||||
| {% if matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix != '/' %} | |||||
| traefik.http.middlewares.matrix-appservice-irc-media-proxy-slashless-redirect.redirectregex.regex=({{ matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix | quote }})$ | |||||
| traefik.http.middlewares.matrix-appservice-irc-media-proxy-slashless-redirect.redirectregex.replacement=${1}/ | traefik.http.middlewares.matrix-appservice-irc-media-proxy-slashless-redirect.redirectregex.replacement=${1}/ | ||||
| {% set middlewares = middlewares + ['matrix-appservice-irc-media-proxy-slashless-redirect'] %} | {% set middlewares = middlewares + ['matrix-appservice-irc-media-proxy-slashless-redirect'] %} | ||||
| {% endif %} | {% endif %} | ||||
| {% if matrix_appservice_irc_container_labels_traefik_path_prefix != '/' %} | |||||
| traefik.http.middlewares.matrix-appservice-irc-media-proxy-strip-prefix.stripprefix.prefixes={{ matrix_appservice_irc_container_labels_traefik_path_prefix }} | |||||
| {% if matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix != '/' %} | |||||
| traefik.http.middlewares.matrix-appservice-irc-media-proxy-strip-prefix.stripprefix.prefixes={{ matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix }} | |||||
| {% set middlewares = middlewares + ['matrix-appservice-irc-media-proxy-strip-prefix'] %} | {% set middlewares = middlewares + ['matrix-appservice-irc-media-proxy-strip-prefix'] %} | ||||
| {% endif %} | {% endif %} | ||||
| @@ -27,7 +27,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ | |||||
| -p {{ matrix_appservice_irc_container_http_host_bind_port }}:9999 \ | -p {{ matrix_appservice_irc_container_http_host_bind_port }}:9999 \ | ||||
| {% endif %} | {% endif %} | ||||
| {% if matrix_appservice_irc_container_media_proxy_host_bind_port %} | {% if matrix_appservice_irc_container_media_proxy_host_bind_port %} | ||||
| -p {{ matrix_appservice_irc_container_media_proxy_host_bind_port }}:{{ matrix_appservice_irc_homeserver_media_bind_port }} \ | |||||
| -p {{ matrix_appservice_irc_container_media_proxy_host_bind_port }}:{{ matrix_appservice_irc_ircService_mediaProxy_bindPort }} \ | |||||
| {% endif %} | {% endif %} | ||||
| --mount type=bind,src={{ matrix_appservice_irc_config_path }},dst=/config \ | --mount type=bind,src={{ matrix_appservice_irc_config_path }},dst=/config \ | ||||
| --mount type=bind,src={{ matrix_appservice_irc_data_path }},dst=/data \ | --mount type=bind,src={{ matrix_appservice_irc_data_path }},dst=/data \ | ||||