From a509cd3a88a198ac6f7963d05b2c369e21c2c5ba Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 16 Jul 2021 09:58:42 -0400 Subject: matrix article to finish later --- matrix.html | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 matrix.html (limited to 'matrix.html') diff --git a/matrix.html b/matrix.html new file mode 100644 index 0000000..47898f8 --- /dev/null +++ b/matrix.html @@ -0,0 +1,87 @@ + + + + Matrix Synapse Server – LandChad.net + + + + + + + +

Matrix Synapse Server

+ +
+

Matrix is easy-to-use, decentralized and encrypted private chat software. + Matrix is federated, meaning that with a Matrix account on any server, including your own, you can talk to any other Matrix account on the internet, similar to email. + Matrix also allows fully end-to-end encrypted group chats. +

+ +

Synapse is the name of the default Matrix server. It is written in Python.

+ +

Installation

+ +

Synapse is not in the Debian package repositories by default, but we can easily add Matrix's repository including it:

+ +
apt install -y lsb-release wget apt-transport-https
+wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
+echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/matrix-org.list
+

After we update our packages lists, we will be able to install Synapse with apt.

+ +
apt update
+apt install matrix-synapse-py3
+ +

When prompted, give your main domain name (not a subdomain). This will be the domain appended to your Matrix address, e.g. @chad:landchad.net.

+ +

Nginx configuration

+ +

Create an Nginx configuration file for Matrix, say /etc/nginx/sites-available/matrix and add the content below: +

+ +
server {
+         server_name matrix.example.org ;
+        listen 80;
+        listen [::]:80;
+        location / {
+                proxy_pass http://localhost:8008;
+        }
+        location ~* ^(\/_matrix|\/_synapse\/client) {
+                proxy_pass http://localhost:8008;
+                proxy_set_header X-Forwarded-For $remote_addr;
+                client_max_body_size 50M ;
+        }
+        location /.well-known/matrix/client {
+                return 200 '{"m.homeserver": {"base_url": "https://matrix.example.org"}}';
+                default_type application/json;
+                add_header Access-Control-Allow-Origin *;
+        }
+}
+ + + +

Now let's enable the Nginx Matrix site and reload Nginx to make it active.

+ +
ln -s /etc/nginx/sites-available/matrix /etc/nginx/sites-enabled
+systemctl reload nginx
+ +

Encryption

+ +

Obviously, we need to encrypt our matrix subdomain as well. Let's do that with certbot:

+ +
certbot --nginx -d matrix.example.org
+ +

Configuration

+ +

+ The configuration file for Matrix is in /etc/matrix-synapse/homeserver.yaml. + It is well documented and commented, so you can read about the settings, but let's change the essential ones here. +

+ +

This article isn't finished. Deal with basic settings and registering accounts.

+
+ + + -- cgit v1.2.3