From 0945e9359e0ea55ccfcd9cebe112b8be8efd9525 Mon Sep 17 00:00:00 2001 From: Awiteb Date: Fri, 3 May 2024 11:07:29 +0300 Subject: [PATCH] Update README.md --- README.md | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 544d66f..bb3cac9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is my personal matrix homeserver. You can clone this repository and run the ## Overview In this repository I use `4rs.nl` (my domain) as an example. You should replace this with your own domain. -After reading this README you should have a `/.well-known/matrix/server` and `/.well-known/matrix/client` file on your domain (4rs.nl) and your matrix subdomain (matrix.4rs.nl). The client will use `matrix.4rs.nl` as the homeserver and the displayed homeserver will be `4rs.nl`. +After reading this README you should have a `/.well-known/matrix/server` and `/.well-known/matrix/client` file on your domain (4rs.nl). The client will use `matrix.4rs.nl` as the homeserver and the displayed server name will be `4rs.nl`. ## Requirements - docker @@ -12,14 +12,14 @@ After reading this README you should have a `/.well-known/matrix/server` and `/. - nginx ## Domain requirements -- Have a `/.well-known/matrix/server` file on your domain that points to your homeserver. This is required for federation to work. +- Have a `/.well-known/matrix/server` file on your domain (server name) that points to your homeserver. This is required for federation to work. The content of the file should be: ``` { "m.server": "matrix.4rs.nl:443" } ``` -- Have a `/.well-known/matrix/client` file on your domain that points to your homeserver. This is required for the client to work. +- Have a `/.well-known/matrix/client` file on your domain (server name) that points to your homeserver. This is required for the client to work. The content of the file should be: ``` { @@ -29,7 +29,8 @@ The content of the file should be: } ``` -For me, I created the files in my static blog and then deployed it in GitHub pages. See the [justfile that I use to deploy the files to the domain](https://git.4rs.nl/awiteb/blog/src/branch/master/Justfile#L15-L17). You can use any other method to deploy the files and make them accessible on your domain, as long as they are accessible at `/.well-known/matrix/server` and `/.well-known/matrix/client`. +For me, I created the files in my static blog and then deployed it in GitHub pages. See the files [here](https://git.4rs.nl/awiteb/blog/src/branch/master/static/.well-known/matrix) in my blog repository. +You can use any other method to deploy the files and make them accessible on your domain, as long as they are accessible at `/.well-known/matrix/server` and `/.well-known/matrix/client`. ## Nginx configuration of the matrix subdomain @@ -87,17 +88,7 @@ server { client_body_timeout 5s; client_header_timeout 5s; - location /.well-known/matrix/server { - return 200 '{"m.server": "matrix.4rs.nl:443"}'; - default_type application/json; - add_header Access-Control-Allow-Origin *; - } - location /.well-known/matrix/client { - return 200 '{"m.homeserver": {"base_url": "https://matrix.4rs.nl}}'; - default_type application/json; - add_header Access-Control-Allow-Origin *; - } - location / { + location / { proxy_pass http://localhost:8008; proxy_set_header X-Forwarded-For $remote_addr; client_max_body_size 200M; @@ -116,12 +107,13 @@ After you have cloned the repository, replace all `4rs.nl` with your domain also There is tow things only you need to change it, the first one is the secrets in `./data/homeserver.yaml` and the second one is the signing key in `./data/4rs.nl.signing.key`. -### Homeserver.yaml +### homeserver.yaml After replacing all `4rs.nl` with your domain, you need to generate a secret for each secret in the `homeserver.yaml` file. You can generate a secret with `openssl rand -base64 32`. Replace the secret with the generated secret. ### Signing key -> **Note** +> [!NOTE] +> > You need `signedjson` dependency to generate a signing key. You can install it with `pip3 install signedjson`. Change the content of the `4rs.nl.signing.key` file with a generated key. You can generate a key with `generate_signing_key` script in root of the repository. Run `python3 generate_signing_key` and replace the content of the `4rs.nl.signing.key` file with the generated key. @@ -134,7 +126,8 @@ Now you need to create an admin user with `docker exec -it synapse register_new_ ## Backup -> **Note** +> [!NOTE] +> > You need [`just`](https://just.systems/) to backup the homeserver. You can install it with `cargo install just`. You can backup the homeserver with `just backup `. And it's will stored as encrypted AES256 7z file.