ubuntu部署Matrix

1.创建安装目录:mkdir -p /root/data/docker_data/matrix && cd /root/data/docker_data/matrix

运行sudo docker run -it –rm \ -v /root/data/docker_data/matrix/data:/data \ -e SYNAPSE_SERVER_NAME=反代域名 \ -e SYNAPSE_REPORT_STATS=yes \ matrixdotorg/synapse:latest generate生成配置文件

2.ls -al

cd /root/data/docker_data/matrix/data

ls -al

nano homeserver.yaml

ctrl+x  回车Y 退出

# 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/反代域名.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

即添加enable_registration: true

enable_registration_without_verification: true 注册和不需要验证也能注册

.

3.cd /root/data/docker_data/matrix

nano docker-compose.yml

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: “matrix.gugu.ovh”
VIRTUAL_PORT: 8008
LETSENCRYPT_HOST: “反代域名”
SYNAPSE_SERVER_NAME: “反代域名”
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

docker ps

4.ip:8009

查看8089是否被占用:lsof -i:8009

如果-bash: lsof: command not found

apt install lsof

5.更新和卸载

cd /root/data/docker_data/matrix

docker-compose pull

docker -compose up -d

docker image prune # prune 命令用来删除不再使用的 docker 对象。删除所有未被 tag 标记和未被容器使用的镜像

cd /root/data/docker_data/matrix

docker-compose down

rm -rf /root/data/docker_data/matrix # 完全删除

------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容