Matrix: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
| (13 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
We are currently setting up a test server for Matrix. If everything goes well, we will set up a production Matrix server. |
We are currently setting up a test server for Matrix. We use Synapse. If everything goes well, we will set up a production Matrix server. |
||
== Server Setup == |
== Server Setup == |
||
We are currently running Matrix on a Proxmox |
We are currently running Matrix on a Proxmox LXE container on <code>citric-acid</code>. Ask Siracha for the credentials to access Proxmox and the VM. |
||
== Matrix Setup == |
|||
Note: all steps are adapted from https://element-hq.github.io/synapse/latest/setup/installation.html. |
|||
== Matrix Installation == |
== Matrix Installation == |
||
<pre> |
|||
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 |
|||
</pre> |
|||
We are using NixOS, so the config to setup both Synapse and PostgreSQL is hosted at https://git.csclub.uwaterloo.ca/k95ma/matrix-nixos/. |
|||
The reverse proxy, Caddy is configured on citric-acid. |
|||
== Testing == |
|||
Go to https://app.cinny.in/login/csclub.uwaterloo.ca, and click "Continue with CSC". |
|||
== Database Setup == |
|||
Install PostgreSQL and related packages. |
|||
<pre> |
|||
apt install postgresql libpq5 |
|||
</pre> |
|||
== Bridging == |
|||
Authenticate as database user |
|||
<pre> |
|||
su - postgres |
|||
# Or, if your system uses sudo to get administrative rights |
|||
sudo -u postgres bash |
|||
</pre> |
|||
We are currently running mautrix-discord. Bridge to IRC via heisenbridge may be added in the future. |
|||
- Create a postgres user and a database |
|||
<pre> |
|||
# this will prompt for a password for the new user |
|||
createuser --pwprompt synapse_user |
|||
=== Discord Instructions === |
|||
createdb --encoding=UTF8 --locale=C --template=template0 --owner=synapse_user synapse |
|||
</pre> |
|||
* Create the Matrix channel to bridge to |
|||
Edit Synapse config in <code>/etc/matrix-synapse/homeserver.yaml</code> |
|||
* Invite {{code|@beefbot:csclub.uwaterloo.ca}} and {{code|@discordbot:csclub.uwaterloo.ca}} to the channel |
|||
<pre> |
|||
* Login to User {{code|beefbot}} (ask syscom for password) on our matrix instance (when we eventually disable password login, you will need to edit the nix config to re-enable it) |
|||
database: |
|||
* ''Inside'' the matrix channel, send, {{code|!discord bridge <channel ID>}} (the channel ID on Discord, the Discord bot must be able to see that channel) |
|||
name: psycopg2 |
|||
* Create a Discord Webhook URL for that channel on Discord's side, and then DM the discord bot with {{code|!discord set-relay !26DmcJd3cQ...:csclub.uwaterloo.ca --url https://discord.com/...}} with the first argument replaced by the actual room identifier and the second parameter the webhook URL. |
|||
args: |
|||
user: synapse_user |
|||
password: <pass> |
|||
dbname: synapse |
|||
host: localhost |
|||
cp_min: 5 |
|||
cp_max: 10 |
|||
</pre> |
|||
Latest revision as of 21:00, 28 October 2025
We are currently setting up a test server for Matrix. We use Synapse. If everything goes well, we will set up a production Matrix server.
Server Setup
We are currently running Matrix on a Proxmox LXE container on citric-acid. Ask Siracha for the credentials to access Proxmox and the VM.
Matrix Installation
We are using NixOS, so the config to setup both Synapse and PostgreSQL is hosted at https://git.csclub.uwaterloo.ca/k95ma/matrix-nixos/.
The reverse proxy, Caddy is configured on citric-acid.
Testing
Go to https://app.cinny.in/login/csclub.uwaterloo.ca, and click "Continue with CSC".
Bridging
We are currently running mautrix-discord. Bridge to IRC via heisenbridge may be added in the future.
Discord Instructions
- Create the Matrix channel to bridge to
- Invite
@beefbot:csclub.uwaterloo.caand@discordbot:csclub.uwaterloo.cato the channel - Login to User
beefbot(ask syscom for password) on our matrix instance (when we eventually disable password login, you will need to edit the nix config to re-enable it) - Inside the matrix channel, send,
!discord bridge <channel ID>(the channel ID on Discord, the Discord bot must be able to see that channel) - Create a Discord Webhook URL for that channel on Discord's side, and then DM the discord bot with
!discord set-relay !26DmcJd3cQ...:csclub.uwaterloo.ca --url https://discord.com/...with the first argument replaced by the actual room identifier and the second parameter the webhook URL.