Enable well_known_client_route #959
3 changed files with 16 additions and 3 deletions
11
DEPLOY.md
11
DEPLOY.md
|
@ -225,6 +225,9 @@ ServerName your.server.name # EDIT THIS
|
||||||
AllowEncodedSlashes NoDecode
|
AllowEncodedSlashes NoDecode
|
||||||
ProxyPass /_matrix/ http://127.0.0.1:6167/_matrix/ timeout=300 nocanon
|
ProxyPass /_matrix/ http://127.0.0.1:6167/_matrix/ timeout=300 nocanon
|
||||||
ProxyPassReverse /_matrix/ http://127.0.0.1:6167/_matrix/
|
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>
|
</VirtualHost>
|
||||||
```
|
```
|
||||||
|
@ -246,6 +249,7 @@ Create `/etc/caddy/conf.d/conduit_caddyfile` and enter this (substitute for your
|
||||||
```caddy
|
```caddy
|
||||||
your.server.name, your.server.name:8448 {
|
your.server.name, your.server.name:8448 {
|
||||||
reverse_proxy /_matrix/* 127.0.0.1:6167
|
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;
|
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 /etc/letsencrypt/live/your.server.name/fullchain.pem; # EDIT THIS
|
||||||
ssl_certificate_key /etc/letsencrypt/live/your.server.name/privkey.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
|
ssl_trusted_certificate /etc/letsencrypt/live/your.server.name/chain.pem; # EDIT THIS
|
||||||
|
|
|
@ -34,9 +34,7 @@ pub async fn get_supported_versions_route(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// # `GET /.well-known/matrix/client`
|
/// # `GET /.well-known/matrix/client`
|
||||||
pub async fn well_known_client_route(
|
pub async fn well_known_client_route() -> Result<impl IntoResponse> {
|
||||||
_body: Ruma<get_supported_versions::Request>,
|
|
||||||
) -> Result<impl IntoResponse> {
|
|
||||||
let client_url = match services().globals.well_known_client() {
|
let client_url = match services().globals.well_known_client() {
|
||||||
Some(url) => url.clone(),
|
Some(url) => url.clone(),
|
||||||
None => return Err(Error::BadRequest(ErrorKind::NotFound, "Not found.")),
|
None => return Err(Error::BadRequest(ErrorKind::NotFound, "Not found.")),
|
||||||
|
|
|
@ -435,6 +435,10 @@ fn routes() -> Router {
|
||||||
"/_matrix/client/v3/rooms/:room_id/initialSync",
|
"/_matrix/client/v3/rooms/:room_id/initialSync",
|
||||||
get(initial_sync),
|
get(initial_sync),
|
||||||
)
|
)
|
||||||
|
.route(
|
||||||
|
"/.well-known/matrix/client",
|
||||||
|
get(client_server::well_known_client_route),
|
||||||
|
)
|
||||||
.route("/", get(it_works))
|
.route("/", get(it_works))
|
||||||
.fallback(not_found)
|
.fallback(not_found)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue