Back

自己写了个 Dockerfile 备忘,自己部署用。

Matrix 服务端程序排除过时的应该是有四个 可见 https://matrix.org/ecosystem/servers/.

  • Synapse (Apache-2.0 Python) Matrix.org homeserver
  • Construct (BSD C++) Construct is a C++ Matrix Homeserver
  • Conduit (Apache-2.0 Rust) Conduit is a simple, fast and reliable chat server written in Rust
  • Dendrite (Apache-2.0 Go) Dendrite is a second-generation Matrix homeserver written in Go!

目前只有 Synapse 是 Stable ,其他 Beta 。按照 star 数排序 Synapse (11k+) > Dendrite (5k+) > Conduit (500+) > Construct (300+) .

Conduit 现在是 0.5 版本,目前签名配置我没都找到,正常来说建议使用 Synapse 。签名很重要,不可丢失,例如从旧的如 Synapse ,Dendrite 等服务端迁移需要这个,来和其他服务器联邦创建可信网络。但是如果不能配置,或者重新部署时,使用了新的签名,这个域名在之后的联邦中会出现困难,具体表现为 401 错误。目前重新信任新签名草案似乎几年没有推进了,可见 https://github.com/matrix-org/matrix-spec/issues/234

所以不建议在生产环境使用 Conduit , 目前只是玩玩。使用默认的域名不进行联邦,或者使用一个无关紧要的域名来使用 Conduit 是个不错的主意。

准备工作

需要准备 conduit, conduit.toml 配置文件

创建 Dockerfile , docker-entrypoint.sh 文件

docker-entrypoint.sh

#!/bin/bash
mkdir /app/data 
/app/conduit
bash

conduit.toml

打包部署

docker build -t kkbt/matrix_rs . 
docker run -d -p 6167:6167  -v /home/kkbt/app/conduit/data/:/app/data/ --privileged --name conduit  kkbt/matrix_rs 
bash

使用

完成部署后可进行反向代理,然后使用客户端创建第一个账户。第一个账户会默认拉入管理群。不要对这个群进行加密,因为群机器人仅支持无加密房间。@ 群机器加指令可以查看运行情况和配置参数之类的。 如 @conduit:example.com: -h

继续配置可以部署语音服务器 ,语音服务需要使用 TURN 协议。可以使用 coturn 。coturn 是一个免费的开源的 TURN/STUN 服务器。coturn 服务器完整的实现了 STUN/TURN/ICE 协议。

Matrix 服务端程序 Conduit (Rust实现)
https://www.ftls.xyz/posts/20230710/
Author 恐咖兵糖
Published at
Copyright CC BY-NC-SA 4.0