diff --git a/docker-compose.yaml b/docker-compose.yaml index 15d33722..23d891ba 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -23,6 +23,13 @@ services: container_name: zincsearch image: 'public.ecr.aws/zinclabs/zinc:latest' restart: unless-stopped + sign: + image: xzhouqd/qsign:core-1.1.9 + restart: unless-stopped + environment: + # 需要与下方的 SIGN_VER 同步 + # 配置请参考 https://hub.docker.com/r/xzhouqd/qsign + - BASE_PATH=/srv/qsign/qsign/txlib/8.9.71 q2tg: image: ghcr.io/clansty/q2tg:rainbowcat container_name: main_q2tg @@ -30,6 +37,7 @@ services: depends_on: - postgres - zinclabs + - sign volumes: - ./data:/app/data environment: @@ -42,6 +50,8 @@ services: - ZINC_URL=http://zinclabs:4080 - ZINC_USERNAME=admin - ZINC_PASSWORD=password + - SIGN_API=http://sign:8080/sign?key=114514 + - SIGN_VER=8.9.71 # 与上方 sign 容器的配置同步 # 要支持转发时自动识别语音,请设置以下参数 - BAIDU_APP_ID= - BAIDU_API_KEY= diff --git a/src/controllers/SetupController.ts b/src/controllers/SetupController.ts index b6f02feb..683afdfe 100644 --- a/src/controllers/SetupController.ts +++ b/src/controllers/SetupController.ts @@ -85,13 +85,18 @@ export default class SetupController { ]); const platform = setupHelper.convertTextToPlatform(platformText); - let signApi = await this.setupService.waitForOwnerInput('请输入签名服务器地址', [ - [Button.text('不需要签名服务器', true, true)], - ]); - signApi = setupHelper.checkSignApiAddress(signApi); + let signApi: string; + + if (!process.env.SIGN_API) { + signApi = await this.setupService.waitForOwnerInput('请输入签名服务器地址', [ + [Button.text('不需要签名服务器', true, true)], + ]); + signApi = setupHelper.checkSignApiAddress(signApi); + } + + let signVer: string; - let signVer = "" - if (signApi !== "") { + if (signApi && !process.env.SIGN_VER) { signVer = await this.setupService.waitForOwnerInput('请输入签名服务器版本,当前支持安卓(8.9.63、8.9.68、8.9.70)、Tim(3.5.1、3.5.2)', [ [Button.text('8.9.63', true, true)], [Button.text('8.9.68', true, true)], @@ -99,7 +104,7 @@ export default class SetupController { [Button.text('3.5.1', true, true)], [Button.text('3.5.2', true, true)], ]); - }; + } let password = await this.setupService.waitForOwnerInput('请输入密码', undefined, true); password = md5Hex(password); diff --git a/src/models/Instance.ts b/src/models/Instance.ts index 4d38b9ea..f5e1bdf5 100644 --- a/src/models/Instance.ts +++ b/src/models/Instance.ts @@ -121,8 +121,8 @@ export default class Instance { uin: Number(this.qq.uin), password: this.qq.password, platform: this.qq.platform, - signApi: this.qq.signApi, - signVer: this._qq.signVer, + signApi: this.qq.signApi || process.env.SIGN_API, + signVer: this.qq.signVer || process.env.SIGN_VER, onQrCode: async (file) => { await this.ownerChat.sendMessage({ message: '请使用已登录这个账号的手机 QQ 扫描这个二维码授权',