Enable well_known_client_route #959

Open
x4u wants to merge 3 commits from well-known-client into next
3 changed files with 16 additions and 3 deletions

View file

@ -225,6 +225,9 @@ ServerName your.server.name # EDIT THIS
AllowEncodedSlashes NoDecode
ProxyPass /_matrix/ http://127.0.0.1:6167/_matrix/ timeout=300 nocanon
ProxyPassReverse /_matrix/ http://127.0.0.1:6167/_matrix/
<Location "/.well-known/matrix/client">
ProxyPass http://127.0.0.1:6167/.well-known/matrix/client timeout=300 nocanon
</Location>
</VirtualHost>
```
@ -246,6 +249,7 @@ Create `/etc/caddy/conf.d/conduit_caddyfile` and enter this (substitute for your
```caddy
your.server.name, your.server.name:8448 {
reverse_proxy /_matrix/* 127.0.0.1:6167
reverse_proxy /.well-known/matrix/client 127.0.0.1:6167
}
```
@ -279,6 +283,13 @@ server {
proxy_read_timeout 5m;
}
location /.well-known/matrix/client {
proxy_pass http://127.0.0.1:6167$request_uri;
proxy_set_header Host $http_host;
proxy_buffering off;
proxy_read_timeout 5m;
}
ssl_certificate /etc/letsencrypt/live/your.server.name/fullchain.pem; # EDIT THIS
ssl_certificate_key /etc/letsencrypt/live/your.server.name/privkey.pem; # EDIT THIS
ssl_trusted_certificate /etc/letsencrypt/live/your.server.name/chain.pem; # EDIT THIS

View file

@ -34,9 +34,7 @@ pub async fn get_supported_versions_route(
}
/// # `GET /.well-known/matrix/client`
pub async fn well_known_client_route(
_body: Ruma<get_supported_versions::Request>,
) -> Result<impl IntoResponse> {
pub async fn well_known_client_route() -> Result<impl IntoResponse> {
let client_url = match services().globals.well_known_client() {
Some(url) => url.clone(),
None => return Err(Error::BadRequest(ErrorKind::NotFound, "Not found.")),

View file

@ -435,6 +435,10 @@ fn routes() -> Router {
"/_matrix/client/v3/rooms/:room_id/initialSync",
get(initial_sync),
)
.route(
"/.well-known/matrix/client",
get(client_server::well_known_client_route),
)
.route("/", get(it_works))
.fallback(not_found)
}