Matrix:
Matrix 是一个开放的通信协议,用于实时通信,包括即时消息、音频和视频通话。
它是去中心化的,这意味着任何人都可以设置自己的 Matrix 服务器,并与其他 Matrix 服务器通信。
Matrix 的目标是为所有不同的通信服务提供一个统一的标准,使得不同的服务可以互相通信。
Element:
Element 是基于 Matrix 协议的一个客户端应用。
它允许用户通过 Matrix 协议进行即时消息、音频和视频通话。
Element 有多个版本,包括 Web、桌面和移动应用。
它是 Matrix 生态系统中最流行的客户端之一。
创建安装目录
mkdir -p /volume1/docker/docker-compose/matrix/data/ && cd /volume1/docker/docker-compose/matrix/
运行docker生成配置文件
sudo docker run -it --rm \
-v /volume1/docker/docker-compose/matrix/data:/data \
-e SYNAPSE_SERVER_NAME=mx.169.al \
-e SYNAPSE_REPORT_STATS=yes \
matrixdotorg/synapse:latest generate
更改配置文件信息
cd data/
vi homeserver.yaml
按键盘的 i 进行编辑
# Configuration file for Synapse.
#
# This is a YAML file: see [1] for a quick introduction. Note in particular
# that *indentation is important*: all the elements of a list or dictionary
# should have the same indentation.
#
# [1] https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
#
# For more information on how to configure Synapse, including a complete accounting of
# each option, go to docs/usage/configuration/config_documentation.md or
# https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html
server_name: "改成你的域名"
pid_file: /data/homeserver.pid
listeners:
- port: 8008
tls: false
type: http
x_forwarded: true
resources:
- names: [client, federation]
compress: false
database:
name: sqlite3
args:
database: /data/homeserver.db
log_config: "/data/matrix.gugu.ovh.log.config"
media_store_path: /data/media_store
registration_shared_secret: "wwaftxJ&3W3Xkx1y4gYoeoY0p6ywmkx96JZB7rCYg2+_bd~M,t"
report_stats: true
macaroon_secret_key: "+i6*ZU+ZgxnIjX98@F3F#Oxw*Un*40=58ESt=+HW=SVA@N6ITy"
form_secret: "xMGG5P~DD-7Brm19jaYR9v0d.wG:abNxN9ikdWcgNE7Z3F;NmB"
signing_key_path: "/data/matrix.gugu.ovh.signing.key"
trusted_key_servers:
- server_name: "matrix.org"
# 加入一下两行,用于开放注册功能。
enable_registration: true
enable_registration_without_verification: true
# vim:ft=yaml
修改好之后,按一下 esc,然后 :wq 保存退出。
创建docker-compose.yml文件
cd /volume1/docker/docker-compose/matrix/
vi dockeer-compose.yml
按小写 i 进入编辑状态,把下面的复制进去
version: "3.3"
services:
synapse:
image: "matrixdotorg/synapse:latest"
container_name: "matrix_synapse"
restart: unless-stopped
ports:
- 8008:8008
volumes:
- "./data:/data" # it will look at the current directory where you save the file and look for the data folder inside
environment:
VIRTUAL_HOST: "mx.169.al"
VIRTUAL_PORT: 8008
LETSENCRYPT_HOST: "mx.169.al"
SYNAPSE_SERVER_NAME: "mx.169.al"
SYNAPSE_REPORT_STATS: "yes"
element-web:
ports:
- '8009:80'
#volumes:
# - '/etc/element-web/config.json:/app/config.json'
image: vectorim/element-web
restart: unless-stopped
评论区