Phala-Network / community-bridges

Bridges to connect Phala community (Discord, Matrix, Telegram, etc)
0 stars 2 forks source link

Add Matterbridge #3

Closed vinhbhn closed 3 years ago

vinhbhn commented 3 years ago
  1. Research the proper software to bridge Matrix-Discrod bridge

    • [x] Two way message bridging
    • [ ] Can simulate the user name and avatar on the both side
    • [x] Can be deployed to a Kubernetes cluster
    • [ ] Can expose the basic monitoring metrics
  2. Document the detailed deployment guide, including how to:

    • [x] set up the bot accounts
    • [x] config the software
    • [ ] deploy to production

I can't create @__discord__ because it runs on synapse. You have to install synapse on the server and run matrix-appservice-discord or mx-puppet-discord.

h4x3rotab commented 3 years ago

Will review soon!

h4x3rotab commented 3 years ago

Hello. I have a few questions:

  1. What is @discord ?
  2. Does it require to configure a server with host and HTTPS certificate?
  3. How do we monitor it?
  4. Does avatar impersonating works?
vinhbhn commented 3 years ago
  1. @__discord__bot is generated on matrix chat. It runs on Synapse. Synapse as a node because Matrix is decentralized social network.
  2. Yes. It runs on a (vps) server ( + domain ). It requires HTTPS/SSL certificate.
  3. You can use Prometheus/Grafana to monitor it.
  4. Yes. It works just like t2bot.io.

Note: Synapse is not related to Matterbridge.

h4x3rotab commented 3 years ago

It's a bit unclear. Synapse is the matrix node. In my understanding it's usually used when we want to create our own matrix server (with our own domain). If we are using the matrix.io hosted server, do we still need to run Synapse? If yes, is it for getting some advanced API for the bridge bots?

vinhbhn commented 3 years ago

That's right. But to do the message bridge, username and avatar impersonating task, you need a service called matrix-appservice-discord (or mx-puppet-discord), configuring them requires a homeserver other than matrix.org. That means you have to run synapse on your domain. It works the same functions as the t2bot.io you are using.

h4x3rotab commented 3 years ago

AFAIK t2bot.io supports the matriox.org domain. So I guess we have missed something here, or probably t2bot can somehow run a homeserver on matrix.org.

vinhbhn commented 3 years ago

I see @discordbot:t2bot.io when I add t2bot to my matrix room. So I understand that the homeserver that t2bot is using is t2bot.io. Screenshot from 2021-10-13 11-40-42

h4x3rotab commented 3 years ago

Ahhh, I got it. So it creates impersonate accounts on-the-fly on their homeserver. Okay now it makes a lot of sense. Thanks!

Btw, have you tried to configure a homeserver for that? And there's no additional config required for impersonate account on Discord, right?

vinhbhn commented 3 years ago

AFAIK Matterbridge is just a messaging bridge, it cannot spoof usernames and avatars on matrix rooms. It means you have two options:

  1. Matterbridge
  2. Synapse + a matrix service that I told you on the above (and here it means we are preparing to create an identical version of t2bot).

Below are pictures when I used matterbridge. It can display username and avatar from matrix to discord. Screenshot from 2021-10-13 11-29-05 Screenshot from 2021-10-13 11-29-03

vinhbhn commented 3 years ago

Ahhh, I got it. So it creates impersonate accounts on-the-fly on their homeserver. Okay now it makes a lot of sense. Thanks!

Btw, have you tried to configure a homeserver for that? And there's no additional config required for impersonate account on Discord, right?

I think you don't need to worry about spoofing usernames and avatars from other social networks to discord because discord supports that via discord webhook.

h4x3rotab commented 3 years ago

Thanks a lot. I'm glad to announce the PR is accepted. I'm going to payout the bounty in 3 days. Note that there's an ongoing PR on Gitcoin side to fix the DOT payment issue. If it cannot be merged in time, I will send it out manually.