Skip to content

Commit a32f0e5

Browse files
Feature(Subscribe): 🚀 为管理员添加公共模板库加速切换功能 (Fixes #605,#581,#566) (#607)
* [Change] 默认关闭公共模板加速 * Change(Config): 📝 切换加速源为 gh-proxy Refactors environment variable handling for clarity Improves readability and maintainability of environment variable assignments in the configuration settings. Changes include consistent formatting and multi-line assignments for better organization, enhancing overall code clarity. No functional changes are introduced, focusing purely on code style improvements. * Feature(Subscribe): 🚀 为管理员添加公共模板库加速切换功能 (Fixes #605,#581,#566) Adds repository acceleration toggle functionality for admins Implements a new handler to allow admin users to toggle the acceleration status of repositories. Enhances user experience by providing immediate feedback on the action's success or failure through UI updates and logging. Improves code organization by introducing new functionality while maintaining existing features. * Bugfix(Web): 🐛 Fix DOM text reinterpreted as HTML Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: a76yyyy <56478790+a76yyyy@users.noreply.github.com> --------- Signed-off-by: a76yyyy <56478790+a76yyyy@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 4dd5cf7 commit a32f0e5

7 files changed

Lines changed: 1368 additions & 604 deletions

File tree

config.py

Lines changed: 230 additions & 95 deletions
Large diffs are not rendered by default.

db/db_converter.py

Lines changed: 360 additions & 169 deletions
Large diffs are not rendered by default.

web/docs/guide/faq.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
QD uses **sqlite3** as the framework database by default, and the `database.db` file is saved in `config` directory. When deploying with a Docker container, you can use the `docker cp` command to back up the database file, and then use the `docker cp` command to restore the database file in the new container.
66

7-
``` sh
7+
```sh
88
# database backup
99
docker cp container_name:/usr/src/app/config/database.db .
1010
# Database recovery
@@ -13,13 +13,13 @@ docker cp database.db container_name:/usr/src/app/config/
1313

1414
## how to configure the email server in Docker?
1515

16-
``` sh
16+
```sh
1717
docker run -d --name qd -p 8923:80 -v $(pwd)/qd/config:/usr/src/app/config --env MAIL_SMTP=$STMP_Server_ --env MAIL_PORT=$Mailbox_server_port --env MAIL_USER=$Username --env MAIL_PASSWORD=$Password --env DOMAIN=$Domain qdtoday/qd
1818
```
1919

2020
## how to use MySQL in Docker?
2121

22-
``` sh
22+
```sh
2323
docker run -d --name qd -p 8923:80 -v $(pwd)/qd/config:/usr/src/app/config --ENV DB_TYPE=mysql --ENV JAWSDB_MARIA_URL=mysql://$username:$password@$hostname:$port/$database_name?auth_plugin= qdtoday/qd
2424
```
2525

@@ -55,33 +55,33 @@ If you are still worried, you can build the QD framework by yourself, download t
5555

5656
1. If it is an ARM32 Debian system, please check whether the `Docker` version is less than `20.10.0`, and whether the `libseccomp` version is less than `2.4.4`. If so, please upgrade the above components.
5757

58-
Update `libseccomp` reference operation:
58+
Update `libseccomp` reference operation:
5959

60-
```sh
61-
# Get signing keys to verify the new packages, otherwise they will not install
62-
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138
60+
```sh
61+
# Get signing keys to verify the new packages, otherwise they will not install
62+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138
6363

64-
# Add the Buster backport repository to apt sources.list
65-
echo 'deb http://httpredir.debian.org/debian buster-backports main contrib non-free' | sudo tee -a /etc/apt/sources.list.d/debian-backports.list
64+
# Add the Buster backport repository to apt sources.list
65+
echo 'deb http://httpredir.debian.org/debian buster-backports main contrib non-free' | sudo tee -a /etc/apt/sources.list.d/debian-backports.list
6666

67-
sudo apt update
68-
sudo apt install libseccomp2 -t buster-backports
69-
```
67+
sudo apt update
68+
sudo apt install libseccomp2 -t buster-backports
69+
```
7070

71-
> Source:
72-
>
73-
> - <https://github.com/Taxel/PlexTraktSync/pull/474>
74-
> - <https://stackoverflow.com/questions/70195968/dockerfile-raspberry-pi-python-pip-install-permissionerror-errno-1-operation>
71+
> Source:
72+
>
73+
> - <https://github.com/Taxel/PlexTraktSync/pull/474>
74+
> - <https://stackoverflow.com/questions/70195968/dockerfile-raspberry-pi-python-pip-install-permissionerror-errno-1-operation>
7575
7676
2. Check if the `/usr/src/app` directory inside the container is mapped to the outside of the container.
7777

78-
> Note that the framework only needs to map the `/usr/src/app/config` directory.
78+
> Note that the framework only needs to map the `/usr/src/app/config` directory.
7979
8080
## Prompt warning message: `Connect Redis falied: Error 10061`
8181

8282
QD uses `redis` as a flow limiting tool. If the `redis` service is not installed, the framework will prompt the following warning message.
8383

84-
``` sh
84+
```sh
8585
[W xxxxxx xx:xx:xx QD.RedisDB redisdb:28] Connect Redis falied: Error 10061 connecting to localhost:6379. No connection could be made because the target machine actively refused it.
8686
```
8787

@@ -93,7 +93,7 @@ However, `redis` is not required in this framework, if you don't need to use the
9393

9494
QD uses the `pycurl` module to send HTTP proxy requests. If the `pycurl` module is not installed, the framework will prompt the following warning message:
9595

96-
``` sh
96+
```sh
9797
[W xxxxxx xx:xx:xx QD.Http.Fetcher fetcher:34] Import PyCurl module falied: No module named 'pycurl'
9898
```
9999

@@ -119,7 +119,7 @@ Please check if the "reverse proxy" configuration is correct, refer to [Nginx re
119119

120120
> Reference configuration is as follows:
121121
>
122-
> ``` Nginx
122+
> ```Nginx
123123
> server {
124124
> listen 80;
125125
> # Modify server_name by yourself
@@ -140,3 +140,16 @@ Please check if the "reverse proxy" configuration is correct, refer to [Nginx re
140140
> }
141141
> }
142142
> ```
143+
144+
## Error Code: 4006
145+
146+
> Error message: "Update failed, reason: Cannot connect to host xxx.xxx:443 ssl:False"
147+
148+
Cause: Unable to connect to Github or GitHub acceleration source.
149+
150+
Solution 1: Use a proxy
151+
152+
Solution 2: Change the GitHub acceleration source
153+
154+
Add/modify the environment variable in the container: `SUBSCRIBE_ACCELERATE_URL=https://xxx.xxx/https://raw.githubusercontent.com/`
155+
Replace `https://xxx.xxx/` with an available acceleration source. If you can't find an acceleration source, you can refer to <https://ghproxy.link/> or <https://gh-proxy.com> for published acceleration sources.

web/docs/zh_CN/guide/faq.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ docker run -d --name qd -p 8923:80 -v $(pwd)/qd/config:/usr/src/app/config --ENV
2929

3030
## 如何查看当前框架支持的 API 和 Jinja2 模板变量?
3131

32-
请进入框架首页,然后点击左上角的 `常用 API/过滤器` 按钮,可以查看当前框架支持的API和Jinja2模板变量
32+
请进入框架首页,然后点击左上角的 `常用 API/过滤器` 按钮,可以查看当前框架支持的 API 和 Jinja2 模板变量
3333

3434
## 如何提交 bug 问题?
3535

@@ -49,7 +49,7 @@ docker run -d --name qd -p 8923:80 -v $(pwd)/qd/config:/usr/src/app/config --ENV
4949

5050
为了帮助用户发起请求,终究需要记录用户名和密码。这只能靠服务器维护人员的自律来保证后端数据的安全。但在框架设计中,每个用户在存储时都使用安全密钥进行加密。使用密钥对用户数据进行加密,可以保证仅获取数据库就无法解密用户数据。(加密的用户数据包括用户上传的模板、用户为任务设置的变量等)
5151

52-
如果还是不放心,可以自己搭建QD框架,下载模板在自己的服务器上运行。
52+
如果还是不放心,可以自己搭建 QD 框架,下载模板在自己的服务器上运行。
5353

5454
## 提示错误信息 `PermissionError: [Errno 1] Operation not permitted`?
5555

@@ -72,11 +72,10 @@ docker run -d --name qd -p 8923:80 -v $(pwd)/qd/config:/usr/src/app/config --ENV
7272
>
7373
> - [https://github.com/Taxel/PlexTraktSync/pull/474](https://github.com/Taxel/PlexTraktSync/pull/474)
7474
> - [https://stackoverflow.com/questions/70195968/dockerfile-raspberry-pi-python-pip-install-permissionerror-errno-1-operation](https://stackoverflow.com/questions/70195968/dockerfile-raspberry-pi-python-pip-install-permissionerror-errno-1-operation)
75-
>
75+
7676
2. 请检查是否将容器内的 `/usr/src/app` 目录映射至容器外部.
7777

7878
> 请注意框架仅需映射 `/usr/src/app/config` 目录即可.
79-
>
8079
8180
## 提示警告信息: `Connect Redis falied: Error 10061`
8281

@@ -100,9 +99,9 @@ QD 使用 `pycurl` 模块来发送 HTTP Proxy 请求。如果没有安装 `pycur
10099

101100
然而,`pycurl` 在框架中并不是必须的,如果你不需要使用 `Proxy` 功能,可以忽略该警告信息。
102101

103-
> `pycurl` 模块在 Windows 系统上安装比较麻烦,需要安装 `libcurl` 库,具体安装方法请参考 [pycurl官方文档](http://pycurl.io/docs/latest/install.html)
102+
> `pycurl` 模块在 Windows 系统上安装比较麻烦,需要安装 `libcurl` 库,具体安装方法请参考 [pycurl 官方文档](http://pycurl.io/docs/latest/install.html)
104103
>
105-
> 建议使用容器或 linux 系统部署 QD 框架, Docker 容器已预装Curl环境, 默认安装pycurl模组
104+
> 建议使用容器或 linux 系统部署 QD 框架, Docker 容器已预装 Curl 环境, 默认安装 pycurl 模组
106105
107106
## 如何注册推送方式
108107

@@ -116,7 +115,7 @@ QD 使用 `pycurl` 模块来发送 HTTP Proxy 请求。如果没有安装 `pycur
116115

117116
> 公共模板更新页面提示错误代码为 undefined, 或者控制台显示 WebSocket 连接 failed 但不显示错误原因
118117
119-
请检查反向代理相关配置是否正确, 参考 [Nginx反向代理WebSocket服务连接报错](https://blog.csdn.net/tiven_/article/details/126126442)
118+
请检查反向代理相关配置是否正确, 参考 [Nginx 反向代理 WebSocket 服务连接报错](https://blog.csdn.net/tiven_/article/details/126126442)
120119

121120
> 参考配置如下:
122121
>
@@ -145,12 +144,14 @@ QD 使用 `pycurl` 模块来发送 HTTP Proxy 请求。如果没有安装 `pycur
145144
> ```
146145
147146
## 错误代码:4006
148-
> 提示错误信息为:"更新失败,原因:Cannot connect to host xxx.xxx:443ssl:False"
149147
150-
报错原因:github/或github加速源无法连接。
148+
> 提示错误信息为:"更新失败,原因:Cannot connect to host xxx.xxx:443 ssl:False"
149+
150+
报错原因:Github 或 GitHub 加速源无法连接。
151+
152+
解决方法 1:使用代理
151153
152-
解决方法1:挂代理
154+
解决方法 2:更换 Github 加速源
153155
154-
解决方法2:更换github加速源
155-
容器的环境变量中增加/修改`SUBSCRIBE_ACCELERATE_URL=https://xxx.xxx/https://raw.githubusercontent.com/`
156-
`https://xxx.xxx/`替换为可用的加速源,找不到加速源的可以参考 https://ghproxy.link/中发布的加速源
156+
容器的环境变量中增加/修改 `SUBSCRIBE_ACCELERATE_URL=https://xxx.xxx/https://raw.githubusercontent.com/`
157+
`https://xxx.xxx/` 替换为可用的加速源,找不到加速源的可以参考 <https://ghproxy.link> 或 <https://gh-proxy.com> 中发布的加速源

0 commit comments

Comments
 (0)