Skip to content

Commit

Permalink
Merge branch 'Clansty-rainbowcat' into rainbowcat
Browse files Browse the repository at this point in the history
  • Loading branch information
Nofated095 committed Oct 19, 2023
2 parents eedbe2a + 7faef3f commit 1bd3521
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Q2TG - without User Bot
QQ 群与 Telegram 群相互转发的 bot,但是去除了 _UserBot_ 模式,再也不用担心杜叔叔瞎几把封号啦!

A **fork** of [Clansty/Q2TG](https://github.com/Clansty/Q2TG). Deleted UserBot function.

QQ 群与 Telegram 群相互转发的 bot,但是去除了 _UserBot_ 模式,再也不用担心杜叔叔把 UserBot 封号啦!

## 为什么不需要 User Bot

Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@ 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/nofated095/q2tg:rainbowcat
container_name: main_q2tg
restart: unless-stopped
depends_on:
- postgres
- zinclabs
- sign
volumes:
- ./data:/app/data
environment:
Expand All @@ -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=
Expand Down
19 changes: 12 additions & 7 deletions src/controllers/SetupController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,26 @@ 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)],
[Button.text('8.9.70', true, true)],
[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);
Expand Down
4 changes: 2 additions & 2 deletions src/models/Instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,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 扫描这个二维码授权',
Expand Down

0 comments on commit 1bd3521

Please sign in to comment.