Closed badlop closed 4 months ago
Reported in the ejabberd chatroom by Arcanicanis:
There seems to be a bug where server_name in /_matrix/key/v2/server will be listed literally as "@HOST@" if matrix_domain isn't set for mod_matrix_gw. And to clarify, I mean as the string literal @HOST@, and not the intended substitution (the server's default hostname).
There seems to be a bug where server_name in /_matrix/key/v2/server will be listed literally as "@HOST@" if matrix_domain isn't set for mod_matrix_gw.
server_name
/_matrix/key/v2/server
"@HOST@"
matrix_domain
And to clarify, I mean as the string literal @HOST@, and not the intended substitution (the server's default hostname).
@HOST@
It's easy to reproduce, simply use ejabberd 24.02 and configure
listen: - port: 8448 module: ejabberd_http tls: true request_handlers: "/_matrix": mod_matrix_gw modules: mod_matrix_gw: key_name: "key1" key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" matrix_id_as_jid: true
And visiting https://localhost:8448/_matrix/key/v2/server returns as result:
{ "verify_keys":{"ed25519:key1":{"key":"ftd/itbHcx5iqJ/IUhcDXA+QVQJjqUIe04EoUQO/ODU"}}, "valid_until_ts":1709719180881, "signatures":{"@HOST@": {"ed25519:key1":"bpgphjYuYYB5BU..."}}, "server_name":"@HOST@", "old_verify_keys":{} }
In fact, setting the option matrix_domain: "@HOST@.aaa" will make the page show "server_name":"@HOST@.aaa".
matrix_domain: "@HOST@.aaa"
"server_name":"@HOST@.aaa"
It seems mod_matrix lacks a call to misc:expand_keyword(<<"@HOST@">>, Domain, Host) in the proper place...
misc:expand_keyword(<<"@HOST@">>, Domain, Host)
Reported in the ejabberd chatroom by Arcanicanis:
It's easy to reproduce, simply use ejabberd 24.02 and configure
And visiting https://localhost:8448/_matrix/key/v2/server returns as result:
In fact, setting the option
matrix_domain: "@HOST@.aaa"
will make the page show"server_name":"@HOST@.aaa"
.It seems mod_matrix lacks a call to
misc:expand_keyword(<<"@HOST@">>, Domain, Host)
in the proper place...