Matrix: Difference between revisions

From CSCWiki
Jump to navigation Jump to search
Content deleted Content added
 
(3 intermediate revisions by the same user not shown)
Line 19: Line 19:
We are currently running mautrix-discord. Bridge to IRC via heisenbridge may be added in the future.
We are currently running mautrix-discord. Bridge to IRC via heisenbridge may be added in the future.


=== Discord Instructions ===
=== Discord ===

{{code|@beefbot:csclub.uwaterloo.ca}} is a Matrix account that is used to configure the actual mautrix-discord. It is logged into mautrix-discord via login-token bot (token saved, if it expires, login to CSC Exec and reset it). The login password of beefbot (the matrix account) is stored in the CSC vault on [[Vaultwarden]].

{{code|Matrix Bridge#7477}} is the Discord bot that reads the messages on Discord and sends them to Matrix via puppeting. It needs read access to the channels for the Discord -> Matrix part to work properly.


* Create the Matrix channel to bridge to
* Create the Matrix channel to bridge to
* Invite {{code|@beefbot:csclub.uwaterloo.ca}} and {{code|@discordbot:csclub.uwaterloo.ca}} to the channel
* Invite {{code|@discordbot:csclub.uwaterloo.ca}} to the channel
* Invite the Discord bot to the bridged server using {{code|1=https://discord.com/oauth2/authorize?client_id=...&permissions=309774583872&scope=bot}}. client_id is found by logging in to the CSC Exec account on Discord and going to developer portal to find the ID of the Matrix Bridge bot.
* 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)
* Login to User {{code|beefbot}} (password in VaultWarden, idk if there is a better place to put it) on our matrix instance
* ''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)
* ''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)
* 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.
* Create a Discord Webhook URL for that channel on Discord's side, and then DM the discord bot (via beefbot on matrix) 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.

Latest revision as of 18:38, 12 August 2026

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

@beefbot:csclub.uwaterloo.ca is a Matrix account that is used to configure the actual mautrix-discord. It is logged into mautrix-discord via login-token bot (token saved, if it expires, login to CSC Exec and reset it). The login password of beefbot (the matrix account) is stored in the CSC vault on Vaultwarden.

Matrix Bridge#7477 is the Discord bot that reads the messages on Discord and sends them to Matrix via puppeting. It needs read access to the channels for the Discord -> Matrix part to work properly.

  • Create the Matrix channel to bridge to
  • Invite @discordbot:csclub.uwaterloo.ca to the channel
  • Invite the Discord bot to the bridged server using https://discord.com/oauth2/authorize?client_id=...&permissions=309774583872&scope=bot. client_id is found by logging in to the CSC Exec account on Discord and going to developer portal to find the ID of the Matrix Bridge bot.
  • Login to User beefbot (password in VaultWarden, idk if there is a better place to put it) on our matrix instance
  • 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 (via beefbot on matrix) 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.