Difference between revisions of "Matrix"

From Jon's Wiki
Line 3: Line 3:
 
== Installing for a domain ==
 
== Installing for a domain ==
  
Create a 'matrix' subdomain A record for the domain, e.g. matrix.example.com then add a .well-known to https://example.com/.well-known/matrix/server that returns MIME type application/json with <tt>{"m.server": "matrix.example.com:443"}</tt> and a client in the same directory with <tt>{"m.homeserver": {"base_url": "https://matrix.example.com"}}</tt>
+
Create a 'matrix' subdomain A record for the domain, e.g. matrix.example.com then add a .well-known to https://example.com/.well-known/matrix/server that returns MIME type application/json with <tt>{"m.server": "matrix.'''example.com''':443"}</tt> and a client in the same directory with <tt>{"m.homeserver": {"base_url": "<nowiki>https://</nowiki>matrix.'''example.com'''"}}</tt>
  
Create a user and empty database on PostgreSQL.
+
Create a user and empty database on PostgreSQL. For some (possibly retarded?) reason, this requires C style collation, which means we have to use template0:
 +
createuser -SDRP <dbuser>
 +
createdb -O <dbuser> -T template0 --lc-ctype=C --lc-collate=C -E UTF-8 <dbname>
  
 +
Then, add the upstream matrix apt repositories:
 
  sudo apt install -y lsb-release wget apt-transport-https
 
  sudo apt install -y lsb-release wget apt-transport-https
  sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
+
  sudo wget -O /usr/share/keyrings/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" | sudo tee /etc/apt/sources.list.d/matrix-org.list
+
    <nowiki>https://</nowiki>packages.matrix.org/debian/matrix-org-archive-keyring.gpg
 +
  echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] <nowiki>https://</nowiki>packages.matrix.org/debian/ $(lsb_release -cs) main" \
 +
    | sudo tee /etc/apt/sources.list.d/matrix-org.list
 
  sudo apt update
 
  sudo apt update
 
  sudo apt install matrix-synapse-py3
 
  sudo apt install matrix-synapse-py3
  
Edit /etc/matrix-synapse/homeserver.yaml for database and SMTP server details.
+
=== Configuration ===
  
See: https://matrix.org/docs/guides/installing-synapse
+
Edit <tt>/etc/matrix-synapse/homeserver.yaml</tt> for database and SMTP server details.
 +
 
 +
=== Registering new users ===
 +
 
 +
The Debian package disables online user registration by default; use the <tt>register_new_matrix_user</tt> command from the cli, or enable it in the configuration.
 +
 
 +
== References ==
 +
 
 +
* Matrix.org documentation, [https://matrix.org/docs/guides/installing-synapse "Installing Synapse"]

Revision as of 08:05, 28 November 2020

The IRC of the future!

Installing for a domain

Create a 'matrix' subdomain A record for the domain, e.g. matrix.example.com then add a .well-known to https://example.com/.well-known/matrix/server that returns MIME type application/json with {"m.server": "matrix.example.com:443"} and a client in the same directory with {"m.homeserver": {"base_url": "https://matrix.example.com"}}

Create a user and empty database on PostgreSQL. For some (possibly retarded?) reason, this requires C style collation, which means we have to use template0:

createuser -SDRP <dbuser>
createdb -O <dbuser> -T template0 --lc-ctype=C --lc-collate=C -E UTF-8 <dbname>

Then, add the upstream matrix apt repositories:

sudo apt install -y lsb-release wget apt-transport-https
sudo 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" \
   | sudo tee /etc/apt/sources.list.d/matrix-org.list
sudo apt update
sudo apt install matrix-synapse-py3

Configuration

Edit /etc/matrix-synapse/homeserver.yaml for database and SMTP server details.

Registering new users

The Debian package disables online user registration by default; use the register_new_matrix_user command from the cli, or enable it in the configuration.

References