@whyour/qinglong 0.19.9 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-en.md +62 -62
- package/README.md +60 -60
- package/package.json +1 -1
- package/sample/notify.js +15 -9
- package/sample/notify.py +19 -11
- package/shell/update.sh +6 -12
- package/static/build/api/env.js +1 -1
- package/static/build/config/subscription.js +1 -1
- package/static/build/data/system.js +3 -3
- package/static/build/loaders/app.js +15 -21
- package/static/build/loaders/initData.js +3 -2
- package/static/build/services/cron.js +4 -1
- package/static/build/services/cronView.js +4 -1
- package/static/build/services/dependence.js +4 -1
- package/static/build/services/env.js +4 -1
- package/static/build/services/notify.js +12 -2
- package/static/build/services/open.js +4 -1
- package/static/build/services/subscription.js +1 -1
- package/static/build/services/system.js +5 -2
- package/static/build/services/user.js +5 -2
- package/version.yaml +6 -8
package/README-en.md
CHANGED
|
@@ -54,62 +54,6 @@ The npm version supports `debian/ubuntu/centos/alpine` systems and requires `nod
|
|
|
54
54
|
npm i @whyour/qinglong
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
## Built-in commands
|
|
58
|
-
|
|
59
|
-
- task
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
# Execute in sequence, if a random delay is set, it will be randomly delayed by a certain number of seconds
|
|
63
|
-
task <file_path>
|
|
64
|
-
# Execute in sequence, regardless of whether a random delay is set, all run immediately,
|
|
65
|
-
# and the foreground will output the day, while recorded in the log file
|
|
66
|
-
task <file_path> now
|
|
67
|
-
# Concurrent execution, regardless of whether a random delay is set, are run immediately,
|
|
68
|
-
# the foreground does not generate the day, directly recorded in the log file, and can be specified account execution
|
|
69
|
-
task <file_path> conc <env_name> <account_number>(Optional)
|
|
70
|
-
# Specify the account to execute and run immediately regardless of whether a random delay is set
|
|
71
|
-
task <file_path> desi <env_name> <account_number>
|
|
72
|
-
# Set task timeout
|
|
73
|
-
task -m <max_time> <file_path>
|
|
74
|
-
# Use -- to split, -- followed by a parameter that is passed to the script, as in the following example, the script receives the parameter -u whyour -p password
|
|
75
|
-
task <file_path> -- -u whyour -p password
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
- ql
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
# Update and restart Green Dragon
|
|
82
|
-
ql update
|
|
83
|
-
# Run custom scripts extra.sh
|
|
84
|
-
ql extra
|
|
85
|
-
# Adding a single script file
|
|
86
|
-
ql raw <file_url>
|
|
87
|
-
# Add a specific script for a single repository
|
|
88
|
-
ql repo <repo_url> <whitelist> <blacklist> <dependence> <branch>
|
|
89
|
-
# Delete old logs
|
|
90
|
-
ql rmlog <days>
|
|
91
|
-
# Start bot
|
|
92
|
-
ql bot
|
|
93
|
-
# Detecting the Green Dragon environment and repairing it
|
|
94
|
-
ql check
|
|
95
|
-
# Reset the number of login errors
|
|
96
|
-
ql resetlet
|
|
97
|
-
# Disable two-step login
|
|
98
|
-
ql resettfa
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
| **Parameter** | **Description** |
|
|
102
|
-
|---|---|
|
|
103
|
-
| file_url | Script address |
|
|
104
|
-
| repo_url | Repository address |
|
|
105
|
-
| whitelist | The whitelist when pulling the repository, i.e., the string contained in the path of the script to be pulled |
|
|
106
|
-
| blacklist | Blacklisting when pulling repositories, i.e. strings that are not included in the path of the script to be pulled |
|
|
107
|
-
| dependence | Pulling the dependencies needed for the repository will be copied directly from the repository to the repository directory under scripts, regardless of the blacklist |
|
|
108
|
-
| extensions | Pull the branch of the repository |
|
|
109
|
-
| branch | Number of days of logs to be kept |
|
|
110
|
-
| days | File path for task execution |
|
|
111
|
-
| file_path | The name of the environment variable that needs to be concurrent or specified at the time of task execution |
|
|
112
|
-
|
|
113
57
|
## Deployment
|
|
114
58
|
|
|
115
59
|
### Docker (Recommended)
|
|
@@ -183,16 +127,72 @@ export QL_DATA_DIR=""
|
|
|
183
127
|
qinglong
|
|
184
128
|
```
|
|
185
129
|
|
|
130
|
+
## Built-in commands
|
|
131
|
+
|
|
132
|
+
- task
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Execute in sequence, if a random delay is set, it will be randomly delayed by a certain number of seconds
|
|
136
|
+
task <file_path>
|
|
137
|
+
# Execute in sequence, regardless of whether a random delay is set, all run immediately,
|
|
138
|
+
# and the foreground will output the day, while recorded in the log file
|
|
139
|
+
task <file_path> now
|
|
140
|
+
# Concurrent execution, regardless of whether a random delay is set, are run immediately,
|
|
141
|
+
# the foreground does not generate the day, directly recorded in the log file, and can be specified account execution
|
|
142
|
+
task <file_path> conc <env_name> <account_number>(Optional)
|
|
143
|
+
# Specify the account to execute and run immediately regardless of whether a random delay is set
|
|
144
|
+
task <file_path> desi <env_name> <account_number>
|
|
145
|
+
# Set task timeout
|
|
146
|
+
task -m <max_time> <file_path>
|
|
147
|
+
# Use -- to split, -- followed by a parameter that is passed to the script, as in the following example, the script receives the parameter -u whyour -p password
|
|
148
|
+
task <file_path> -- -u whyour -p password
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- ql
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Update and restart Green Dragon
|
|
155
|
+
ql update
|
|
156
|
+
# Run custom scripts extra.sh
|
|
157
|
+
ql extra
|
|
158
|
+
# Adding a single script file
|
|
159
|
+
ql raw <file_url>
|
|
160
|
+
# Add a specific script for a single repository
|
|
161
|
+
ql repo <repo_url> <whitelist> <blacklist> <dependence> <branch>
|
|
162
|
+
# Delete old logs
|
|
163
|
+
ql rmlog <days>
|
|
164
|
+
# Start bot
|
|
165
|
+
ql bot
|
|
166
|
+
# Detecting the Green Dragon environment and repairing it
|
|
167
|
+
ql check
|
|
168
|
+
# Reset the number of login errors
|
|
169
|
+
ql resetlet
|
|
170
|
+
# Disable two-step login
|
|
171
|
+
ql resettfa
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
| **Parameter** | **Description** |
|
|
175
|
+
|---|---|
|
|
176
|
+
| file_url | Script address |
|
|
177
|
+
| repo_url | Repository address |
|
|
178
|
+
| whitelist | The whitelist when pulling the repository, i.e., the string contained in the path of the script to be pulled |
|
|
179
|
+
| blacklist | Blacklisting when pulling repositories, i.e. strings that are not included in the path of the script to be pulled |
|
|
180
|
+
| dependence | Pulling the dependencies needed for the repository will be copied directly from the repository to the repository directory under scripts, regardless of the blacklist |
|
|
181
|
+
| extensions | Pull the branch of the repository |
|
|
182
|
+
| branch | Number of days of logs to be kept |
|
|
183
|
+
| days | File path for task execution |
|
|
184
|
+
| file_path | The name of the environment variable that needs to be concurrent or specified at the time of task execution |
|
|
185
|
+
|
|
186
186
|
## Development
|
|
187
187
|
|
|
188
188
|
```bash
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
git clone https://github.com/whyour/qinglong.git
|
|
190
|
+
cd qinglong
|
|
191
|
+
cp .env.example .env
|
|
192
192
|
# Recommended use pnpm https://pnpm.io/zh/installation
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
npm install -g pnpm@8.3.1
|
|
194
|
+
pnpm install
|
|
195
|
+
pnpm start
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
Open your browser and visit <http://127.0.0.1:5700>
|
package/README.md
CHANGED
|
@@ -56,60 +56,6 @@ npm 版本支持 `debian/ubuntu/centos/alpine` 系统,需要自行安装 `node
|
|
|
56
56
|
npm i @whyour/qinglong
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
## 内置命令
|
|
60
|
-
|
|
61
|
-
- task
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
# 依次执行,如果设置了随机延迟,将随机延迟一定秒数
|
|
65
|
-
task <file_path>
|
|
66
|
-
# 依次执行,无论是否设置了随机延迟,均立即运行,前台会输出日,同时记录在日志文件中
|
|
67
|
-
task <file_path> now
|
|
68
|
-
# 并发执行,无论是否设置了随机延迟,均立即运行,前台不产生日,直接记录在日志文件中,且可指定账号执行
|
|
69
|
-
task <file_path> conc <env_name> <account_number>(可选的)
|
|
70
|
-
# 指定账号执行,无论是否设置了随机延迟,均立即运行
|
|
71
|
-
task <file_path> desi <env_name> <account_number>
|
|
72
|
-
# 设置任务超时时间
|
|
73
|
-
task -m <max_time> <file_path>
|
|
74
|
-
# 使用 -- 分割,-- 后面的参数会传给脚本,下面的例子,脚本就可接收到参数 -u whyour -p password
|
|
75
|
-
task <file_path> -- -u whyour -p password
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
- ql
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
# 更新并重启青龙
|
|
82
|
-
ql update
|
|
83
|
-
# 运行自定义脚本extra.sh
|
|
84
|
-
ql extra
|
|
85
|
-
# 添加单个脚本文件
|
|
86
|
-
ql raw <file_url>
|
|
87
|
-
# 添加单个仓库的指定脚本
|
|
88
|
-
ql repo <repo_url> <whitelist> <blacklist> <dependence> <branch> <extensions>
|
|
89
|
-
# 删除旧日志
|
|
90
|
-
ql rmlog <days>
|
|
91
|
-
# 启动tg-bot
|
|
92
|
-
ql bot
|
|
93
|
-
# 检测青龙环境并修复
|
|
94
|
-
ql check
|
|
95
|
-
# 重置登录错误次数
|
|
96
|
-
ql resetlet
|
|
97
|
-
# 禁用两步登录
|
|
98
|
-
ql resettfa
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
| **参数** | **说明** |
|
|
102
|
-
|------------|---------------------------------------------------------------------------------------------|
|
|
103
|
-
| file_url | 脚本地址 |
|
|
104
|
-
| repo_url | 仓库地址 |
|
|
105
|
-
| whitelist | 拉取仓库时的白名单,即就是需要拉取的脚本的路径包含的字符串,多个竖线分割 |
|
|
106
|
-
| blacklist | 拉取仓库时的黑名单,即就是需要拉取的脚本的路径不包含的字符串,多个竖线分割 |
|
|
107
|
-
| dependence | 拉取仓库需要的依赖文件,会直接从仓库拷贝到scripts下的仓库目录,不受黑名单影响,多个竖线分割 |
|
|
108
|
-
| extensions | 拉取仓库的文件后缀,多个竖线分割 |
|
|
109
|
-
| branch | 拉取仓库的分支 |
|
|
110
|
-
| days | 需要保留的日志的天数 |
|
|
111
|
-
| file_path | 任务执行时的文件路径 |
|
|
112
|
-
|
|
113
59
|
## 部署
|
|
114
60
|
|
|
115
61
|
### docker (推荐)
|
|
@@ -183,16 +129,70 @@ export QL_DATA_DIR=""
|
|
|
183
129
|
qinglong
|
|
184
130
|
```
|
|
185
131
|
|
|
132
|
+
## 内置命令
|
|
133
|
+
|
|
134
|
+
- task
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# 依次执行,如果设置了随机延迟,将随机延迟一定秒数
|
|
138
|
+
task <file_path>
|
|
139
|
+
# 依次执行,无论是否设置了随机延迟,均立即运行,前台会输出日,同时记录在日志文件中
|
|
140
|
+
task <file_path> now
|
|
141
|
+
# 并发执行,无论是否设置了随机延迟,均立即运行,前台不产生日,直接记录在日志文件中,且可指定账号执行
|
|
142
|
+
task <file_path> conc <env_name> <account_number>(可选的)
|
|
143
|
+
# 指定账号执行,无论是否设置了随机延迟,均立即运行
|
|
144
|
+
task <file_path> desi <env_name> <account_number>
|
|
145
|
+
# 设置任务超时时间
|
|
146
|
+
task -m <max_time> <file_path>
|
|
147
|
+
# 使用 -- 分割,-- 后面的参数会传给脚本,下面的例子,脚本就可接收到参数 -u whyour -p password
|
|
148
|
+
task <file_path> -- -u whyour -p password
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- ql
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# 更新并重启青龙
|
|
155
|
+
ql update
|
|
156
|
+
# 运行自定义脚本extra.sh
|
|
157
|
+
ql extra
|
|
158
|
+
# 添加单个脚本文件
|
|
159
|
+
ql raw <file_url>
|
|
160
|
+
# 添加单个仓库的指定脚本
|
|
161
|
+
ql repo <repo_url> <whitelist> <blacklist> <dependence> <branch> <extensions>
|
|
162
|
+
# 删除旧日志
|
|
163
|
+
ql rmlog <days>
|
|
164
|
+
# 启动tg-bot
|
|
165
|
+
ql bot
|
|
166
|
+
# 检测青龙环境并修复
|
|
167
|
+
ql check
|
|
168
|
+
# 重置登录错误次数
|
|
169
|
+
ql resetlet
|
|
170
|
+
# 禁用两步登录
|
|
171
|
+
ql resettfa
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
| **参数** | **说明** |
|
|
175
|
+
|------------|---------------------------------------------------------------------------------------------|
|
|
176
|
+
| file_url | 脚本地址 |
|
|
177
|
+
| repo_url | 仓库地址 |
|
|
178
|
+
| whitelist | 拉取仓库时的白名单,即就是需要拉取的脚本的路径包含的字符串,多个竖线分割 |
|
|
179
|
+
| blacklist | 拉取仓库时的黑名单,即就是需要拉取的脚本的路径不包含的字符串,多个竖线分割 |
|
|
180
|
+
| dependence | 拉取仓库需要的依赖文件,会直接从仓库拷贝到scripts下的仓库目录,不受黑名单影响,多个竖线分割 |
|
|
181
|
+
| extensions | 拉取仓库的文件后缀,多个竖线分割 |
|
|
182
|
+
| branch | 拉取仓库的分支 |
|
|
183
|
+
| days | 需要保留的日志的天数 |
|
|
184
|
+
| file_path | 任务执行时的文件路径 |
|
|
185
|
+
|
|
186
186
|
## 开发
|
|
187
187
|
|
|
188
188
|
```bash
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
git clone https://github.com/whyour/qinglong.git
|
|
190
|
+
cd qinglong
|
|
191
|
+
cp .env.example .env
|
|
192
192
|
# 推荐使用 pnpm https://pnpm.io/zh/installation
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
npm install -g pnpm@8.3.1
|
|
194
|
+
pnpm install
|
|
195
|
+
pnpm start
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
打开你的浏览器,访问 <http://127.0.0.1:5700>
|
package/package.json
CHANGED
package/sample/notify.js
CHANGED
|
@@ -97,7 +97,6 @@ const push_config = {
|
|
|
97
97
|
WEBHOOK_CONTENT_TYPE: '', // 自定义通知 content-type
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
// 首先读取 面板变量 或者 github action 运行变量
|
|
101
100
|
for (const key in push_config) {
|
|
102
101
|
const v = process.env[key];
|
|
103
102
|
if (v) {
|
|
@@ -358,17 +357,24 @@ function barkNotify(text, desp, params = {}) {
|
|
|
358
357
|
BARK_PUSH = `https://api.day.app/${BARK_PUSH}`;
|
|
359
358
|
}
|
|
360
359
|
const options = {
|
|
361
|
-
url: `${BARK_PUSH}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
360
|
+
url: `${BARK_PUSH}`,
|
|
361
|
+
json: {
|
|
362
|
+
title: text,
|
|
363
|
+
body: desp,
|
|
364
|
+
icon: BARK_ICON,
|
|
365
|
+
sound: BARK_SOUND,
|
|
366
|
+
group: BARK_GROUP,
|
|
367
|
+
isArchive: BARK_ARCHIVE,
|
|
368
|
+
level: BARK_LEVEL,
|
|
369
|
+
url: BARK_URL,
|
|
370
|
+
...params,
|
|
371
|
+
},
|
|
366
372
|
headers: {
|
|
367
|
-
'Content-Type': 'application/
|
|
373
|
+
'Content-Type': 'application/json',
|
|
368
374
|
},
|
|
369
375
|
timeout,
|
|
370
376
|
};
|
|
371
|
-
$.
|
|
377
|
+
$.post(options, (err, resp, data) => {
|
|
372
378
|
try {
|
|
373
379
|
if (err) {
|
|
374
380
|
console.log('Bark APP 发送通知调用API失败😞\n', err);
|
|
@@ -1283,7 +1289,7 @@ async function sendNotify(text, desp, params = {}) {
|
|
|
1283
1289
|
}
|
|
1284
1290
|
}
|
|
1285
1291
|
|
|
1286
|
-
if (push_config.HITOKOTO) {
|
|
1292
|
+
if (push_config.HITOKOTO !== 'false') {
|
|
1287
1293
|
desp += '\n\n' + (await one());
|
|
1288
1294
|
}
|
|
1289
1295
|
|
package/sample/notify.py
CHANGED
|
@@ -120,7 +120,6 @@ push_config = {
|
|
|
120
120
|
}
|
|
121
121
|
# fmt: on
|
|
122
122
|
|
|
123
|
-
# 首先读取 面板变量 或者 github action 运行变量
|
|
124
123
|
for k in push_config:
|
|
125
124
|
if os.getenv(k):
|
|
126
125
|
v = os.getenv(k)
|
|
@@ -137,9 +136,9 @@ def bark(title: str, content: str) -> None:
|
|
|
137
136
|
print("bark 服务启动")
|
|
138
137
|
|
|
139
138
|
if push_config.get("BARK_PUSH").startswith("http"):
|
|
140
|
-
url = f'{push_config.get("BARK_PUSH")}
|
|
139
|
+
url = f'{push_config.get("BARK_PUSH")}'
|
|
141
140
|
else:
|
|
142
|
-
url = f'https://api.day.app/{push_config.get("BARK_PUSH")}
|
|
141
|
+
url = f'https://api.day.app/{push_config.get("BARK_PUSH")}'
|
|
143
142
|
|
|
144
143
|
bark_params = {
|
|
145
144
|
"BARK_ARCHIVE": "isArchive",
|
|
@@ -149,7 +148,10 @@ def bark(title: str, content: str) -> None:
|
|
|
149
148
|
"BARK_LEVEL": "level",
|
|
150
149
|
"BARK_URL": "url",
|
|
151
150
|
}
|
|
152
|
-
|
|
151
|
+
data = {
|
|
152
|
+
"title": title,
|
|
153
|
+
"body": content,
|
|
154
|
+
}
|
|
153
155
|
for pair in filter(
|
|
154
156
|
lambda pairs: pairs[0].startswith("BARK_")
|
|
155
157
|
and pairs[0] != "BARK_PUSH"
|
|
@@ -157,10 +159,11 @@ def bark(title: str, content: str) -> None:
|
|
|
157
159
|
and bark_params.get(pairs[0]),
|
|
158
160
|
push_config.items(),
|
|
159
161
|
):
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
data[bark_params.get(pair[0])] = pair[1]
|
|
163
|
+
headers = {"Content-Type": "application/json;charset=utf-8"}
|
|
164
|
+
response = requests.post(
|
|
165
|
+
url=url, data=json.dumps(data), headers=headers, timeout=15
|
|
166
|
+
).json()
|
|
164
167
|
|
|
165
168
|
if response["code"] == 200:
|
|
166
169
|
print("bark 推送成功!")
|
|
@@ -385,6 +388,7 @@ def pushplus_bot(title: str, content: str) -> None:
|
|
|
385
388
|
else:
|
|
386
389
|
print("PUSHPLUS 推送失败!")
|
|
387
390
|
|
|
391
|
+
|
|
388
392
|
def weplus_bot(title: str, content: str) -> None:
|
|
389
393
|
"""
|
|
390
394
|
通过 微加机器人 推送消息。
|
|
@@ -396,7 +400,7 @@ def weplus_bot(title: str, content: str) -> None:
|
|
|
396
400
|
|
|
397
401
|
template = "txt"
|
|
398
402
|
if len(content) > 800:
|
|
399
|
-
|
|
403
|
+
template = "html"
|
|
400
404
|
|
|
401
405
|
url = "https://www.weplusbot.com/send"
|
|
402
406
|
data = {
|
|
@@ -704,7 +708,11 @@ def pushme(title: str, content: str) -> None:
|
|
|
704
708
|
return
|
|
705
709
|
print("PushMe 服务启动")
|
|
706
710
|
|
|
707
|
-
url =
|
|
711
|
+
url = (
|
|
712
|
+
push_config.get("PUSHME_URL")
|
|
713
|
+
if push_config.get("PUSHME_URL")
|
|
714
|
+
else "https://push.i-i.me/"
|
|
715
|
+
)
|
|
708
716
|
data = {
|
|
709
717
|
"push_key": push_config.get("PUSHME_KEY"),
|
|
710
718
|
"title": title,
|
|
@@ -953,7 +961,7 @@ def send(title: str, content: str, ignore_default_config: bool = False, **kwargs
|
|
|
953
961
|
return
|
|
954
962
|
|
|
955
963
|
hitokoto = push_config.get("HITOKOTO")
|
|
956
|
-
content += "\n\n" + one() if hitokoto else ""
|
|
964
|
+
content += "\n\n" + one() if hitokoto != "false" else ""
|
|
957
965
|
|
|
958
966
|
notify_function = add_notify_function()
|
|
959
967
|
ts = [
|
package/shell/update.sh
CHANGED
|
@@ -156,21 +156,15 @@ update_raw() {
|
|
|
156
156
|
autoDelCron=${AutoDelCron}
|
|
157
157
|
fi
|
|
158
158
|
|
|
159
|
-
local proxyStr=""
|
|
160
|
-
if [[ $proxy ]]; then
|
|
161
|
-
if [[ $url == http:* ]]; then
|
|
162
|
-
proxyStr="-e \"http_proxy=${proxy}\""
|
|
163
|
-
elif [[ $url == https:* ]]; then
|
|
164
|
-
proxyStr="-e \"http_proxy=${proxy};https_proxy=${proxy}\""
|
|
165
|
-
fi
|
|
166
|
-
fi
|
|
167
|
-
|
|
168
159
|
local raw_url="$url"
|
|
169
160
|
local suffix="${raw_url##*.}"
|
|
170
161
|
local raw_file_name="${uniq_path}.${suffix}"
|
|
171
162
|
echo -e "开始下载:${raw_url} \n\n保存路径:$dir_raw/${raw_file_name}\n"
|
|
172
163
|
|
|
173
|
-
|
|
164
|
+
set_proxy "$proxy"
|
|
165
|
+
wget -q --no-check-certificate -O "$dir_raw/${raw_file_name}.new" ${raw_url}
|
|
166
|
+
exit_status=$?
|
|
167
|
+
unset_proxy
|
|
174
168
|
|
|
175
169
|
if [[ $? -eq 0 ]]; then
|
|
176
170
|
mv "$dir_raw/${raw_file_name}.new" "$dir_raw/${raw_file_name}"
|
|
@@ -255,7 +249,7 @@ reload_qinglong() {
|
|
|
255
249
|
reload_pm2
|
|
256
250
|
}
|
|
257
251
|
|
|
258
|
-
## 更新qinglong
|
|
252
|
+
## 更新 qinglong
|
|
259
253
|
update_qinglong() {
|
|
260
254
|
rm -rf ${dir_tmp}/*
|
|
261
255
|
local mirror="gitee"
|
|
@@ -527,7 +521,7 @@ main() {
|
|
|
527
521
|
raw)
|
|
528
522
|
get_uniq_path "$p2"
|
|
529
523
|
if [[ -n $p2 ]]; then
|
|
530
|
-
update_raw "$p2" "$p3" "$p4"
|
|
524
|
+
update_raw "$p2" "$p3" "$p4" "$p5"
|
|
531
525
|
else
|
|
532
526
|
eval echo -e "命令输入错误...\\\n" $cmd
|
|
533
527
|
eval usage $cmd
|
package/static/build/api/env.js
CHANGED
|
@@ -27,7 +27,7 @@ function formatCommand(doc, url) {
|
|
|
27
27
|
let _url = url || formatUrl(doc).url;
|
|
28
28
|
const { type, whitelist, blacklist, dependences, branch, extensions, proxy, autoAddCron, autoDelCron, } = doc;
|
|
29
29
|
if (type === 'file') {
|
|
30
|
-
command += `raw "${_url}"`;
|
|
30
|
+
command += `raw "${_url}" "${proxy || ''}" "${(0, isNil_1.default)(autoAddCron) ? true : Boolean(autoAddCron)}" "${(0, isNil_1.default)(autoDelCron) ? true : Boolean(autoDelCron)}"`;
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
33
|
command += `repo "${_url}" "${whitelist || ''}" "${blacklist || ''}" "${dependences || ''}" "${branch || ''}" "${extensions || ''}" "${proxy || ''}" "${(0, isNil_1.default)(autoAddCron) ? true : Boolean(autoAddCron)}" "${(0, isNil_1.default)(autoDelCron) ? true : Boolean(autoDelCron)}"`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SystemModel = exports.AuthDataType = exports.LoginStatus = exports.
|
|
3
|
+
exports.SystemModel = exports.AuthDataType = exports.LoginStatus = exports.SystemInfo = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
5
|
const sequelize_1 = require("sequelize");
|
|
6
|
-
class
|
|
6
|
+
class SystemInfo {
|
|
7
7
|
constructor(options) {
|
|
8
8
|
this.ip = options.ip;
|
|
9
9
|
this.info = options.info;
|
|
@@ -11,7 +11,7 @@ class AuthInfo {
|
|
|
11
11
|
this.id = options.id;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
exports.
|
|
14
|
+
exports.SystemInfo = SystemInfo;
|
|
15
15
|
var LoginStatus;
|
|
16
16
|
(function (LoginStatus) {
|
|
17
17
|
LoginStatus[LoginStatus["success"] = 0] = "success";
|
|
@@ -10,26 +10,20 @@ const initData_1 = __importDefault(require("./initData"));
|
|
|
10
10
|
const deps_1 = __importDefault(require("./deps"));
|
|
11
11
|
const initTask_1 = __importDefault(require("./initTask"));
|
|
12
12
|
exports.default = async ({ expressApp }) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
console.log('✌️ init task loaded');
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
logger_1.default.error(`✌️ depInjectorLoader expressLoader initData linkDeps failed, ${error}`);
|
|
32
|
-
console.error(`✌️ depInjectorLoader expressLoader initData linkDeps failed ${error}`);
|
|
33
|
-
}
|
|
13
|
+
(0, depInjector_1.default)();
|
|
14
|
+
logger_1.default.info('✌️ Dependency loaded');
|
|
15
|
+
console.log('✌️ Dependency loaded');
|
|
16
|
+
await (0, initData_1.default)();
|
|
17
|
+
logger_1.default.info('✌️ Init data loaded');
|
|
18
|
+
console.log('✌️ Init data loaded');
|
|
19
|
+
await (0, deps_1.default)();
|
|
20
|
+
logger_1.default.info('✌️ Link deps loaded');
|
|
21
|
+
console.log('✌️ Link deps loaded');
|
|
22
|
+
(0, initTask_1.default)();
|
|
23
|
+
logger_1.default.info('✌️ Init task loaded');
|
|
24
|
+
console.log('✌️ Init task loaded');
|
|
25
|
+
(0, express_1.default)({ app: expressApp });
|
|
26
|
+
logger_1.default.info('✌️ Express loaded');
|
|
27
|
+
console.log('✌️ Express loaded');
|
|
34
28
|
};
|
|
35
29
|
//# sourceMappingURL=app.js.map
|
|
@@ -22,6 +22,9 @@ exports.default = async () => {
|
|
|
22
22
|
const envService = typedi_1.Container.get(env_1.default);
|
|
23
23
|
const dependenceService = typedi_1.Container.get(dependence_1.default);
|
|
24
24
|
const systemService = typedi_1.Container.get(system_2.default);
|
|
25
|
+
// 初始化增加系统配置
|
|
26
|
+
await system_1.SystemModel.upsert({ type: system_1.AuthDataType.systemConfig });
|
|
27
|
+
await system_1.SystemModel.upsert({ type: system_1.AuthDataType.notification });
|
|
25
28
|
const installDependencies = () => {
|
|
26
29
|
// 初始化时安装所有处于安装中,安装成功,安装失败的依赖
|
|
27
30
|
dependence_2.DependenceModel.findAll({
|
|
@@ -129,7 +132,5 @@ exports.default = async () => {
|
|
|
129
132
|
// 初始化保存一次ck和定时任务数据
|
|
130
133
|
await cronService.autosave_crontab();
|
|
131
134
|
await envService.set_envs();
|
|
132
|
-
// 初始化增加系统配置
|
|
133
|
-
await system_1.SystemModel.upsert({ type: system_1.AuthDataType.systemConfig });
|
|
134
135
|
};
|
|
135
136
|
//# sourceMappingURL=initData.js.map
|
|
@@ -323,7 +323,10 @@ let CronService = class CronService {
|
|
|
323
323
|
}
|
|
324
324
|
async getDb(query) {
|
|
325
325
|
const doc = await cron_1.CrontabModel.findOne({ where: Object.assign({}, query) });
|
|
326
|
-
|
|
326
|
+
if (!doc) {
|
|
327
|
+
throw new Error(`Cron ${JSON.stringify(query)} not found`);
|
|
328
|
+
}
|
|
329
|
+
return doc.get({ plain: true });
|
|
327
330
|
}
|
|
328
331
|
async run(ids) {
|
|
329
332
|
await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.queued }, { where: { id: ids } });
|
|
@@ -65,7 +65,10 @@ let CronViewService = class CronViewService {
|
|
|
65
65
|
}
|
|
66
66
|
async getDb(query) {
|
|
67
67
|
const doc = await cronView_1.CrontabViewModel.findOne({ where: Object.assign({}, query) });
|
|
68
|
-
|
|
68
|
+
if (!doc) {
|
|
69
|
+
throw new Error(`CronView ${JSON.stringify(query)} not found`);
|
|
70
|
+
}
|
|
71
|
+
return doc.get({ plain: true });
|
|
69
72
|
}
|
|
70
73
|
async disabled(ids) {
|
|
71
74
|
await cronView_1.CrontabViewModel.update({ isDisabled: 1 }, { where: { id: ids } });
|
|
@@ -141,7 +141,10 @@ let DependenceService = class DependenceService {
|
|
|
141
141
|
}
|
|
142
142
|
async getDb(query) {
|
|
143
143
|
const doc = await dependence_1.DependenceModel.findOne({ where: Object.assign({}, query) });
|
|
144
|
-
|
|
144
|
+
if (!doc) {
|
|
145
|
+
throw new Error(`Dependency ${JSON.stringify(query)} not found`);
|
|
146
|
+
}
|
|
147
|
+
return doc.get({ plain: true });
|
|
145
148
|
}
|
|
146
149
|
async updateLog(ids, log) {
|
|
147
150
|
pLimit_1.default.updateDepLog(async () => {
|
|
@@ -169,7 +169,10 @@ let EnvService = class EnvService {
|
|
|
169
169
|
}
|
|
170
170
|
async getDb(query) {
|
|
171
171
|
const doc = await env_1.EnvModel.findOne({ where: Object.assign({}, query) });
|
|
172
|
-
|
|
172
|
+
if (!doc) {
|
|
173
|
+
throw new Error(`Env ${JSON.stringify(query)} not found`);
|
|
174
|
+
}
|
|
175
|
+
return doc.get({ plain: true });
|
|
173
176
|
}
|
|
174
177
|
async disabled(ids) {
|
|
175
178
|
await env_1.EnvModel.update({ status: env_1.EnvStatus.disabled }, { where: { id: ids } });
|
|
@@ -190,10 +190,20 @@ let NotificationService = class NotificationService {
|
|
|
190
190
|
if (!barkPush.startsWith('http')) {
|
|
191
191
|
barkPush = `https://api.day.app/${barkPush}`;
|
|
192
192
|
}
|
|
193
|
-
const url = `${barkPush}
|
|
193
|
+
const url = `${barkPush}`;
|
|
194
|
+
const body = {
|
|
195
|
+
title: this.title,
|
|
196
|
+
body: this.content,
|
|
197
|
+
icon: barkIcon,
|
|
198
|
+
sound: barkSound,
|
|
199
|
+
group: barkGroup,
|
|
200
|
+
isArchive: barkArchive,
|
|
201
|
+
level: barkLevel,
|
|
202
|
+
url: barkUrl,
|
|
203
|
+
};
|
|
194
204
|
try {
|
|
195
205
|
const res = await got_1.default
|
|
196
|
-
.
|
|
206
|
+
.post(url, Object.assign(Object.assign({}, this.gotOption), { json: body, headers: { 'Content-Type': 'application/json' } }))
|
|
197
207
|
.json();
|
|
198
208
|
if (res.code === 200) {
|
|
199
209
|
return true;
|
|
@@ -55,7 +55,10 @@ let OpenService = class OpenService {
|
|
|
55
55
|
}
|
|
56
56
|
async getDb(query) {
|
|
57
57
|
const doc = await open_1.AppModel.findOne({ where: query });
|
|
58
|
-
|
|
58
|
+
if (!doc) {
|
|
59
|
+
throw new Error(`App ${JSON.stringify(query)} not found`);
|
|
60
|
+
}
|
|
61
|
+
return doc.get({ plain: true });
|
|
59
62
|
}
|
|
60
63
|
async remove(ids) {
|
|
61
64
|
await open_1.AppModel.destroy({ where: { id: ids } });
|
|
@@ -238,7 +238,7 @@ let SubscriptionService = class SubscriptionService {
|
|
|
238
238
|
async getDb(query) {
|
|
239
239
|
const doc = await subscription_1.SubscriptionModel.findOne({ where: Object.assign({}, query) });
|
|
240
240
|
if (!doc) {
|
|
241
|
-
throw new Error(
|
|
241
|
+
throw new Error(`Subscription ${JSON.stringify(query)} not found`);
|
|
242
242
|
}
|
|
243
243
|
return doc.get({ plain: true });
|
|
244
244
|
}
|
|
@@ -39,7 +39,7 @@ let SystemService = class SystemService {
|
|
|
39
39
|
}
|
|
40
40
|
async getSystemConfig() {
|
|
41
41
|
const doc = await this.getDb({ type: system_1.AuthDataType.systemConfig });
|
|
42
|
-
return doc
|
|
42
|
+
return doc;
|
|
43
43
|
}
|
|
44
44
|
async updateAuthDb(payload) {
|
|
45
45
|
await system_1.SystemModel.upsert(Object.assign({}, payload));
|
|
@@ -48,7 +48,10 @@ let SystemService = class SystemService {
|
|
|
48
48
|
}
|
|
49
49
|
async getDb(query) {
|
|
50
50
|
const doc = await system_1.SystemModel.findOne({ where: Object.assign({}, query) });
|
|
51
|
-
|
|
51
|
+
if (!doc) {
|
|
52
|
+
throw new Error(`System ${JSON.stringify(query)} not found`);
|
|
53
|
+
}
|
|
54
|
+
return doc.get({ plain: true });
|
|
52
55
|
}
|
|
53
56
|
async updateNotificationMode(notificationInfo) {
|
|
54
57
|
const code = Math.random().toString().slice(-6);
|
|
@@ -294,7 +294,7 @@ let UserService = class UserService {
|
|
|
294
294
|
}
|
|
295
295
|
async getNotificationMode() {
|
|
296
296
|
const doc = await this.getDb({ type: system_1.AuthDataType.notification });
|
|
297
|
-
return
|
|
297
|
+
return doc.info;
|
|
298
298
|
}
|
|
299
299
|
async updateAuthDb(payload) {
|
|
300
300
|
let doc = await system_1.SystemModel.findOne({ type: payload.type });
|
|
@@ -312,7 +312,10 @@ let UserService = class UserService {
|
|
|
312
312
|
}
|
|
313
313
|
async getDb(query) {
|
|
314
314
|
const doc = await system_1.SystemModel.findOne({ where: Object.assign({}, query) });
|
|
315
|
-
|
|
315
|
+
if (!doc) {
|
|
316
|
+
throw new Error(`${JSON.stringify(query)} not found`);
|
|
317
|
+
}
|
|
318
|
+
return doc.get({ plain: true });
|
|
316
319
|
}
|
|
317
320
|
async updateNotificationMode(notificationInfo) {
|
|
318
321
|
const code = Math.random().toString().slice(-6);
|
package/version.yaml
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
version: 2.17.
|
|
2
|
-
changeLogLink: https://t.me/jiao_long/
|
|
3
|
-
publishTime: 2024-
|
|
1
|
+
version: 2.17.6
|
|
2
|
+
changeLogLink: https://t.me/jiao_long/407
|
|
3
|
+
publishTime: 2024-06-14 23:00
|
|
4
4
|
changeLog: |
|
|
5
|
-
1.
|
|
6
|
-
2.
|
|
7
|
-
3.
|
|
8
|
-
4. 增加微加机器人消息通道
|
|
9
|
-
5. 修复任务详情查看脚本错误
|
|
5
|
+
1. bark 推送改为 post 请求,防止请求头过大
|
|
6
|
+
2. 修复单文件订阅代理无效
|
|
7
|
+
3. 修复系统设置通知和依赖数据未初始化
|