发布应用 Synapse
Signed-off-by: Meng Sen <qyg2297248353@gmail.com>
This commit is contained in:
parent
5e610647fd
commit
78590e265e
|
|
@ -0,0 +1,10 @@
|
|||
additionalProperties:
|
||||
formFields:
|
||||
- default: 8008
|
||||
edit: true
|
||||
envKey: PANEL_APP_PORT_HTTP
|
||||
labelZh: 访问端口
|
||||
labelEn: Port
|
||||
required: true
|
||||
rule: paramPort
|
||||
type: number
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
networks:
|
||||
1panel-network:
|
||||
external: true
|
||||
|
||||
services:
|
||||
synapse:
|
||||
image: matrixdotorg/synapse:v1.118.0
|
||||
container_name: ${CONTAINER_NAME}
|
||||
labels:
|
||||
createdBy: "Apps"
|
||||
restart: always
|
||||
networks:
|
||||
- 1panel-network
|
||||
ports:
|
||||
- ${PANEL_APP_PORT_HTTP}:8008
|
||||
env_file:
|
||||
- /etc/1panel/envs/global.env
|
||||
- ${ENV_FILE:-/etc/1panel/envs/default.env}
|
||||
volumes:
|
||||
- ./data:/data
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -f .env ]; then
|
||||
source .env
|
||||
|
||||
# setup-1 add default values
|
||||
CURRENT_DIR=$(pwd)
|
||||
sed -i '/^ENV_FILE=/d' .env
|
||||
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
|
||||
|
||||
# setup-2 generate key
|
||||
mkdir -p "${CURRENT_DIR}/data"
|
||||
docker run -it --rm \
|
||||
--mount type=bind,src="${CURRENT_DIR}/data",dst=/data \
|
||||
-e SYNAPSE_SERVER_NAME="$DOMAIN_NAME" \
|
||||
-e SYNAPSE_REPORT_STATS=no \
|
||||
matrixdotorg/synapse:latest generate
|
||||
|
||||
# setup-3 check permission
|
||||
chmod -R 777 "${CURRENT_DIR}/data"
|
||||
|
||||
echo "Check Finish."
|
||||
|
||||
else
|
||||
echo "Error: .env file not found."
|
||||
fi
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -f .env ]; then
|
||||
source .env
|
||||
|
||||
echo "Check Finish."
|
||||
|
||||
else
|
||||
echo "Error: .env file not found."
|
||||
fi
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -f .env ]; then
|
||||
source .env
|
||||
|
||||
# setup-1 add default values
|
||||
CURRENT_DIR=$(pwd)
|
||||
sed -i '/^ENV_FILE=/d' .env
|
||||
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
|
||||
|
||||
echo "Check Finish."
|
||||
|
||||
else
|
||||
echo "Error: .env file not found."
|
||||
fi
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
# Synapse
|
||||
|
||||
Synapse 是一个开源的 Matrix 家庭服务器实现,由 Element 开发和维护。Matrix 是安全且可互操作实时通信的开放标准。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 安装说明
|
||||
|
||||
### 快捷命令
|
||||
|
||||
#### 查看帮助
|
||||
|
||||
```sh
|
||||
register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml --help
|
||||
```
|
||||
|
||||
#### 生成管理员用户
|
||||
|
||||
> 请替换以下参数
|
||||
>
|
||||
> adminName: 管理员用户名
|
||||
>
|
||||
> password: 管理员密码
|
||||
|
||||
```sh
|
||||
register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml -u adminName -p password -a
|
||||
```
|
||||
|
||||
#### 生成普通用户
|
||||
|
||||
> 请替换以下参数
|
||||
>
|
||||
> userName: 用户名
|
||||
>
|
||||
> password: 密码
|
||||
|
||||
```sh
|
||||
register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml -u userName -p password
|
||||
```
|
||||
|
||||
## 反向代理
|
||||
|
||||
> Nginx
|
||||
|
||||
```nginx
|
||||
location ~ ^(/_matrix|/_synapse/client) {
|
||||
# note: do not add a path (even a single /) after the port in `proxy_pass`,
|
||||
# otherwise nginx will canonicalise the URI and cause signature verification
|
||||
# errors.
|
||||
proxy_pass http://localhost:8008;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Host $host;
|
||||
|
||||
# Nginx by default only allows file uploads up to 1M in size
|
||||
# Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
|
||||
client_max_body_size 50M;
|
||||
|
||||
# Synapse responses may be chunked, which is an HTTP/1.1 feature.
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
|
@ -0,0 +1,15 @@
|
|||
additionalProperties:
|
||||
key: synapse
|
||||
name: Synapse
|
||||
tags:
|
||||
- WebSite
|
||||
- Middleware
|
||||
- Local
|
||||
shortDescZh: 用于安全、分散通信的开放网络
|
||||
shortDescEn: An open network for secure, decentralised communication
|
||||
type: website
|
||||
crossVersionUpdate: true
|
||||
limit: 0
|
||||
website: https://matrix.org/
|
||||
github: https://github.com/matrix-org/synapse/
|
||||
document: https://matrix.org/
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Loading…
Reference in New Issue