-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,83 @@ | ||
# mirai-http-docker | ||
# mirai-http-docker | ||
|
||
[mirai-api-http](https://github.com/project-mirai/mirai-api-http) - 提供HTTP API供所有语言使用 mirai QQ 机器人 | ||
|
||
![Github stars](https://badgen.net/github/stars/chung1912/mirai-http-docker?icon=github&label=stars) | ||
[![Docker build latest](https://github.com/chung1912/mirai-http-docker/actions/workflows/docker-latest.yml/badge.svg?branch=main)](https://github.com/chung1912/mirai-http-docker/actions/workflows/docker-latest.yml) | ||
[![Docker Pulls](https://badgen.net/docker/pulls/chung1912/mirai-api-http?icon=docker&label=pulls)](https://hub.docker.com/r/chung1912/mirai-api-http/) | ||
[![Docker Image Size](https://badgen.net/docker/size/chung1912/mirai-api-http/latest/amd64?icon=docker&label=image%20size)](https://hub.docker.com/r/chung1912/mirai-api-http/) | ||
|
||
拉取镜像,创建容器 | ||
|
||
```text | ||
docker run -d --restart=always --name="mirai-api-http" -p 8080:8080 -v /mirai/bots:/app/bots -v mirai/config:/app/config -v /mirai/data:/app/data chung1912/mirai-api-http | ||
``` | ||
|
||
修改\config\net.mamoe.mirai-api-http下的setting.yml | ||
|
||
```text | ||
## 配置文件中的值,全为默认值 | ||
## 启用的 adapter, 内置有 http, ws, reverse-ws, webhook | ||
adapters: | ||
- http | ||
- ws | ||
## 是否开启认证流程, 若为 true 则建立连接时需要验证 verifyKey | ||
## 建议公网连接时开启 | ||
enableVerify: true | ||
verifyKey: 1234567890 | ||
## 开启一些调试信息 | ||
debug: false | ||
## 是否开启单 session 模式, 若为 true,则自动创建 session 绑定 console 中登录的 bot | ||
## 开启后,接口中任何 sessionKey 不需要传递参数 | ||
## 若 console 中有多个 bot 登录,则行为未定义 | ||
## 确保 console 中只有一个 bot 登录时启用 | ||
singleMode: false | ||
## 历史消息的缓存大小 | ||
## 同时,也是 http adapter 的消息队列容量 | ||
cacheSize: 4096 | ||
## adapter 的单独配置,键名与 adapters 项配置相同 | ||
adapterSettings: | ||
## 详情看 http adapter 使用说明 配置 | ||
http: | ||
host: localhost | ||
port: 8080 | ||
cors: ["*"] | ||
unreadQueueMaxSize: 100 | ||
## 详情看 websocket adapter 使用说明 配置 | ||
ws: | ||
host: localhost | ||
port: 8080 | ||
reservedSyncId: -1 | ||
``` | ||
|
||
修改\config\Console下的AutoLogin.yml | ||
|
||
```text | ||
accounts: | ||
- # 账号, 现只支持 QQ 数字账号 | ||
account: 123456 | ||
password: | ||
# 密码种类, 可选 PLAIN 或 MD5 | ||
kind: PLAIN | ||
# 密码内容, PLAIN 时为密码文本, MD5 时为 16 进制 | ||
value: | ||
# 账号配置. 可用配置列表 (注意大小写): | ||
# "protocol": "ANDROID_PHONE" / "ANDROID_PAD" / "ANDROID_WATCH" / "MACOS" / "IPAD" | ||
# "device": "device.json" | ||
# "enable": true | ||
# "heartbeatStrategy": "STAT_HB" / "REGISTER" / "NONE" | ||
configuration: | ||
protocol: ANDROID_PHONE | ||
device: device.json | ||
enable: true | ||
heartbeatStrategy: STAT_HB | ||
``` | ||
|
||
重启容器 |