mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-07 17:24:31 +08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 929d2eb574 | |||
| ebedd994dd | |||
| ee7d39f433 | |||
| eab8a93f28 | |||
| 16b20e8b54 | |||
| 6dbd980881 | |||
| 35a17fce95 |
@@ -129,13 +129,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cache: "pnpm"
|
cache: "pnpm"
|
||||||
|
|
||||||
- name: Read version from version.yaml
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
VERSION=$(grep '^version:' version.yaml | awk '{print $2}')
|
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
||||||
echo "Version: $VERSION"
|
|
||||||
|
|
||||||
- name: Setup timezone
|
- name: Setup timezone
|
||||||
uses: szenius/set-timezone@v2.0
|
uses: szenius/set-timezone@v2.0
|
||||||
with:
|
with:
|
||||||
@@ -161,13 +154,19 @@ jobs:
|
|||||||
images: |
|
images: |
|
||||||
${{ github.repository }}
|
${{ github.repository }}
|
||||||
ghcr.io/${{ github.repository }}
|
ghcr.io/${{ github.repository }}
|
||||||
|
# generate Docker tags based on the following events/attributes
|
||||||
|
# nightly, master, pr-2, 1.2.3, 1.2, 1
|
||||||
flavor: |
|
flavor: |
|
||||||
latest=false
|
latest=false
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch,enable=${{ github.ref == format('refs/heads/{0}', 'develop') }}
|
type=schedule,pattern=nightly
|
||||||
|
type=edge
|
||||||
|
type=ref,event=pr
|
||||||
|
type=ref,event=branch,enable=${{ github.ref != format('refs/heads/{0}', 'master') }}
|
||||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
|
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
|
||||||
type=raw,value=${{ steps.version.outputs.version }},enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
|
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
@@ -217,13 +216,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cache: "pnpm"
|
cache: "pnpm"
|
||||||
|
|
||||||
- name: Read version from version.yaml
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
VERSION=$(grep '^version:' version.yaml | awk '{print $2}')
|
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
||||||
echo "Version: $VERSION"
|
|
||||||
|
|
||||||
- name: Setup timezone
|
- name: Setup timezone
|
||||||
uses: szenius/set-timezone@v2.0
|
uses: szenius/set-timezone@v2.0
|
||||||
with:
|
with:
|
||||||
@@ -262,9 +254,7 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
file: ./docker/310.Dockerfile
|
file: ./docker/310.Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: whyour/qinglong:python3.10
|
||||||
whyour/qinglong:python3.10
|
|
||||||
whyour/qinglong:${{ steps.version.outputs.version }}-python3.10
|
|
||||||
cache-from: type=registry,ref=whyour/qinglong:cache-python3.10
|
cache-from: type=registry,ref=whyour/qinglong:cache-python3.10
|
||||||
cache-to: type=registry,ref=whyour/qinglong:cache-python3.10,mode=max
|
cache-to: type=registry,ref=whyour/qinglong:cache-python3.10,mode=max
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,6 @@ export default (app: Router) => {
|
|||||||
content: Joi.string().optional().allow(''),
|
content: Joi.string().optional().allow(''),
|
||||||
originFilename: Joi.string().optional().allow(''),
|
originFilename: Joi.string().optional().allow(''),
|
||||||
directory: Joi.string().optional().allow(''),
|
directory: Joi.string().optional().allow(''),
|
||||||
file: Joi.string().optional().allow(''),
|
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
async (req: Request, res: Response, next: NextFunction) => {
|
async (req: Request, res: Response, next: NextFunction) => {
|
||||||
@@ -176,7 +175,6 @@ export default (app: Router) => {
|
|||||||
path,
|
path,
|
||||||
`${originFilename.replace(/\//g, '')}`,
|
`${originFilename.replace(/\//g, '')}`,
|
||||||
);
|
);
|
||||||
await fs.mkdir(path, { recursive: true });
|
|
||||||
const filePath = join(path, `${filename.replace(/\//g, '')}`);
|
const filePath = join(path, `${filename.replace(/\//g, '')}`);
|
||||||
const fileExists = await fileExist(filePath);
|
const fileExists = await fileExist(filePath);
|
||||||
if (fileExists) {
|
if (fileExists) {
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ export class WebhookNotification extends NotificationBaseInfo {
|
|||||||
|
|
||||||
export class LarkNotification extends NotificationBaseInfo {
|
export class LarkNotification extends NotificationBaseInfo {
|
||||||
public larkKey = '';
|
public larkKey = '';
|
||||||
public larkSecret = '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NtfyNotification extends NotificationBaseInfo {
|
export class NtfyNotification extends NotificationBaseInfo {
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export default class DependenceService {
|
|||||||
query: any = {},
|
query: any = {},
|
||||||
): Promise<Dependence[]> {
|
): Promise<Dependence[]> {
|
||||||
let condition = query;
|
let condition = query;
|
||||||
if (type && DependenceTypes[type] !== undefined) {
|
if (DependenceTypes[type]) {
|
||||||
condition.type = DependenceTypes[type];
|
condition.type = DependenceTypes[type];
|
||||||
}
|
}
|
||||||
if (status) {
|
if (status) {
|
||||||
|
|||||||
+5
-19
@@ -550,33 +550,19 @@ export default class NotificationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async lark() {
|
private async lark() {
|
||||||
let { larkKey, larkSecret } = this.params;
|
let { larkKey } = this.params;
|
||||||
|
|
||||||
if (!larkKey.startsWith('http')) {
|
if (!larkKey.startsWith('http')) {
|
||||||
larkKey = `https://open.feishu.cn/open-apis/bot/v2/hook/${larkKey}`;
|
larkKey = `https://open.feishu.cn/open-apis/bot/v2/hook/${larkKey}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const body: Record<string, any> = {
|
|
||||||
msg_type: 'text',
|
|
||||||
content: { text: `${this.title}\n\n${this.content}` },
|
|
||||||
};
|
|
||||||
|
|
||||||
// Add signature if secret is provided
|
|
||||||
// Note: Feishu's signature algorithm uses timestamp+"\n"+secret as the HMAC key
|
|
||||||
// and signs an empty message, which differs from typical HMAC usage
|
|
||||||
if (larkSecret) {
|
|
||||||
const timestamp = Math.floor(Date.now() / 1000).toString();
|
|
||||||
const stringToSign = `${timestamp}\n${larkSecret}`;
|
|
||||||
const hmac = crypto.createHmac('sha256', stringToSign);
|
|
||||||
const sign = hmac.digest('base64');
|
|
||||||
body.timestamp = timestamp;
|
|
||||||
body.sign = sign;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await httpClient.post(larkKey, {
|
const res = await httpClient.post(larkKey, {
|
||||||
...this.gotOption,
|
...this.gotOption,
|
||||||
json: body,
|
json: {
|
||||||
|
msg_type: 'text',
|
||||||
|
content: { text: `${this.title}\n\n${this.content}` },
|
||||||
|
},
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
});
|
});
|
||||||
if (res.StatusCode === 0 || res.code === 0) {
|
if (res.StatusCode === 0 || res.code === 0) {
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ export function runCron(cmd: string, cron: ICron): Promise<number | void> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Default to single instance mode (0) for backward compatibility
|
// Default to single instance mode (0) for backward compatibility
|
||||||
const allowSingleInstances =
|
const allowMultipleInstances =
|
||||||
existingCron?.allow_multiple_instances === 0;
|
existingCron?.allow_multiple_instances === 1;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
allowSingleInstances &&
|
!allowMultipleInstances &&
|
||||||
existingCron &&
|
existingCron &&
|
||||||
existingCron.pid &&
|
existingCron.pid &&
|
||||||
(existingCron.status === CrontabStatus.running ||
|
(existingCron.status === CrontabStatus.running ||
|
||||||
|
|||||||
@@ -81,5 +81,5 @@ export const commonCronSchema = {
|
|||||||
'string.max': '日志名称不能超过100个字符',
|
'string.max': '日志名称不能超过100个字符',
|
||||||
'string.unsafePath': '绝对路径必须在日志目录内或使用 /dev/null',
|
'string.unsafePath': '绝对路径必须在日志目录内或使用 /dev/null',
|
||||||
}),
|
}),
|
||||||
allow_multiple_instances: Joi.number().optional().valid(0, 1).allow(null),
|
allow_multiple_instances: Joi.number().optional().valid(0, 1),
|
||||||
};
|
};
|
||||||
|
|||||||
+2
-18
@@ -52,7 +52,6 @@ const push_config = {
|
|||||||
DD_BOT_TOKEN: '', // 钉钉机器人的 DD_BOT_TOKEN
|
DD_BOT_TOKEN: '', // 钉钉机器人的 DD_BOT_TOKEN
|
||||||
|
|
||||||
FSKEY: '', // 飞书机器人的 FSKEY
|
FSKEY: '', // 飞书机器人的 FSKEY
|
||||||
FSSECRET: '', // 飞书机器人的 FSSECRET,对应安全设置里的签名校验密钥
|
|
||||||
|
|
||||||
// 推送到个人QQ:http://127.0.0.1/send_private_msg
|
// 推送到个人QQ:http://127.0.0.1/send_private_msg
|
||||||
// 群:http://127.0.0.1/send_group_msg
|
// 群:http://127.0.0.1/send_group_msg
|
||||||
@@ -990,26 +989,11 @@ function aibotkNotify(text, desp) {
|
|||||||
|
|
||||||
function fsBotNotify(text, desp) {
|
function fsBotNotify(text, desp) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const { FSKEY, FSSECRET } = push_config;
|
const { FSKEY } = push_config;
|
||||||
if (FSKEY) {
|
if (FSKEY) {
|
||||||
const body = { msg_type: 'text', content: { text: `${text}\n\n${desp}` } };
|
|
||||||
|
|
||||||
// Add signature if secret is provided
|
|
||||||
// Note: Feishu's signature algorithm uses timestamp+"\n"+secret as the HMAC key
|
|
||||||
// and signs an empty message, which differs from typical HMAC usage
|
|
||||||
if (FSSECRET) {
|
|
||||||
const crypto = require('crypto');
|
|
||||||
const timestamp = Math.floor(Date.now() / 1000).toString();
|
|
||||||
const stringToSign = `${timestamp}\n${FSSECRET}`;
|
|
||||||
const hmac = crypto.createHmac('sha256', stringToSign);
|
|
||||||
const sign = hmac.digest('base64');
|
|
||||||
body.timestamp = timestamp;
|
|
||||||
body.sign = sign;
|
|
||||||
}
|
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
url: `https://open.feishu.cn/open-apis/bot/v2/hook/${FSKEY}`,
|
url: `https://open.feishu.cn/open-apis/bot/v2/hook/${FSKEY}`,
|
||||||
json: body,
|
json: { msg_type: 'text', content: { text: `${text}\n\n${desp}` } },
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ push_config = {
|
|||||||
'DD_BOT_TOKEN': '', # 钉钉机器人的 DD_BOT_TOKEN
|
'DD_BOT_TOKEN': '', # 钉钉机器人的 DD_BOT_TOKEN
|
||||||
|
|
||||||
'FSKEY': '', # 飞书机器人的 FSKEY
|
'FSKEY': '', # 飞书机器人的 FSKEY
|
||||||
'FSSECRET': '', # 飞书机器人的 FSSECRET,对应安全设置里的签名校验密钥
|
|
||||||
|
|
||||||
'GOBOT_URL': '', # go-cqhttp
|
'GOBOT_URL': '', # go-cqhttp
|
||||||
# 推送到个人QQ:http://127.0.0.1/send_private_msg
|
# 推送到个人QQ:http://127.0.0.1/send_private_msg
|
||||||
@@ -234,20 +233,6 @@ def feishu_bot(title: str, content: str) -> None:
|
|||||||
|
|
||||||
url = f'https://open.feishu.cn/open-apis/bot/v2/hook/{push_config.get("FSKEY")}'
|
url = f'https://open.feishu.cn/open-apis/bot/v2/hook/{push_config.get("FSKEY")}'
|
||||||
data = {"msg_type": "text", "content": {"text": f"{title}\n\n{content}"}}
|
data = {"msg_type": "text", "content": {"text": f"{title}\n\n{content}"}}
|
||||||
|
|
||||||
# Add signature if secret is provided
|
|
||||||
# Note: Feishu's signature algorithm uses timestamp+"\n"+secret as the HMAC key
|
|
||||||
# and signs an empty message, which differs from typical HMAC usage
|
|
||||||
if push_config.get("FSSECRET"):
|
|
||||||
timestamp = str(int(time.time()))
|
|
||||||
string_to_sign = f'{timestamp}\n{push_config.get("FSSECRET")}'
|
|
||||||
hmac_code = hmac.new(
|
|
||||||
string_to_sign.encode("utf-8"), digestmod=hashlib.sha256
|
|
||||||
).digest()
|
|
||||||
sign = base64.b64encode(hmac_code).decode("utf-8")
|
|
||||||
data["timestamp"] = timestamp
|
|
||||||
data["sign"] = sign
|
|
||||||
|
|
||||||
response = requests.post(url, data=json.dumps(data)).json()
|
response = requests.post(url, data=json.dumps(data)).json()
|
||||||
|
|
||||||
if response.get("StatusCode") == 0 or response.get("code") == 0:
|
if response.get("StatusCode") == 0 or response.get("code") == 0:
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ function run() {
|
|||||||
numParam,
|
numParam,
|
||||||
file_task_before,
|
file_task_before,
|
||||||
file_task_before_js,
|
file_task_before_js,
|
||||||
|
file_preload_js,
|
||||||
dir_scripts,
|
dir_scripts,
|
||||||
task_before,
|
task_before,
|
||||||
PREV_NODE_OPTIONS,
|
PREV_NODE_OPTIONS,
|
||||||
@@ -40,7 +41,13 @@ function run() {
|
|||||||
const fileName = process.argv[1].replace(`${dir_scripts}/`, '');
|
const fileName = process.argv[1].replace(`${dir_scripts}/`, '');
|
||||||
const tempFile = `/tmp/env_${process.pid}.json`;
|
const tempFile = `/tmp/env_${process.pid}.json`;
|
||||||
|
|
||||||
|
// Export NODE_OPTIONS so task_before can use it for any node commands
|
||||||
|
const nodeOptionsForBash = file_preload_js
|
||||||
|
? ['-r', file_preload_js, PREV_NODE_OPTIONS].filter(Boolean).join(' ')
|
||||||
|
: PREV_NODE_OPTIONS || '';
|
||||||
|
|
||||||
const commands = [
|
const commands = [
|
||||||
|
`export NODE_OPTIONS="${nodeOptionsForBash}"`,
|
||||||
`source ${file_task_before} ${fileName}`,
|
`source ${file_task_before} ${fileName}`,
|
||||||
task_before ? `eval '${task_before.replace(/'/g, "'\\''")}'` : null,
|
task_before ? `eval '${task_before.replace(/'/g, "'\\''")}'` : null,
|
||||||
`echo -e '${splitStr}'`,
|
`echo -e '${splitStr}'`,
|
||||||
|
|||||||
@@ -44,11 +44,19 @@ def run():
|
|||||||
split_str = "__sitecustomize__"
|
split_str = "__sitecustomize__"
|
||||||
file_name = sys.argv[0].replace(f"{os.getenv('dir_scripts')}/", "")
|
file_name = sys.argv[0].replace(f"{os.getenv('dir_scripts')}/", "")
|
||||||
|
|
||||||
|
# Get environment variables needed for PYTHONPATH
|
||||||
|
dir_preload = os.getenv("dir_preload", "")
|
||||||
|
dir_config = os.getenv("dir_config", "")
|
||||||
|
|
||||||
# 创建临时文件路径
|
# 创建临时文件路径
|
||||||
temp_file = f"/tmp/env_{os.getpid()}.json"
|
temp_file = f"/tmp/env_{os.getpid()}.json"
|
||||||
|
|
||||||
|
# Export PYTHONPATH so task_before can use it for any python commands
|
||||||
|
pythonpath_for_bash = ':'.join(filter(None, [dir_preload, dir_config, prev_pythonpath]))
|
||||||
|
|
||||||
# 构建命令数组
|
# 构建命令数组
|
||||||
commands = [
|
commands = [
|
||||||
|
f'export PYTHONPATH="{pythonpath_for_bash}"',
|
||||||
f'source {os.getenv("file_task_before")} {file_name}'
|
f'source {os.getenv("file_task_before")} {file_name}'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -389,7 +389,6 @@
|
|||||||
"消息接收人": "message recipient",
|
"消息接收人": "message recipient",
|
||||||
"调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版": "Version, you can specify 'pro' for the Professional version and 'personal' for the Personal version. If left blank, it will default to the Professional version.",
|
"调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版": "Version, you can specify 'pro' for the Professional version and 'personal' for the Personal version. If left blank, it will default to the Professional version.",
|
||||||
"飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973": "Feishu group bot: https://www.feishu.cn/hc/zh-CN/articles/360024984973",
|
"飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973": "Feishu group bot: https://www.feishu.cn/hc/zh-CN/articles/360024984973",
|
||||||
"飞书群组机器人加签密钥,安全设置中开启签名校验后获得": "Feishu group bot signature secret, obtained after enabling signature verification in security settings",
|
|
||||||
"邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json": "Email service name, e.g., 126, 163, Gmail, QQ, etc. Supported list: https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json",
|
"邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json": "Email service name, e.g., 126, 163, Gmail, QQ, etc. Supported list: https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json",
|
||||||
"邮箱地址": "Email Address",
|
"邮箱地址": "Email Address",
|
||||||
"SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定": "The SMTP login password may also be a special passphrase, depending on the specific email service provider's instructions",
|
"SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定": "The SMTP login password may also be a special passphrase, depending on the specific email service provider's instructions",
|
||||||
|
|||||||
@@ -389,7 +389,6 @@
|
|||||||
"消息接收人": "消息接收人",
|
"消息接收人": "消息接收人",
|
||||||
"调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版": "调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版",
|
"调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版": "调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版",
|
||||||
"飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973": "飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973",
|
"飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973": "飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973",
|
||||||
"飞书群组机器人加签密钥,安全设置中开启签名校验后获得": "飞书群组机器人加签密钥,安全设置中开启签名校验后获得",
|
|
||||||
"邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json": "邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json",
|
"邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json": "邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json",
|
||||||
"邮箱地址": "邮箱地址",
|
"邮箱地址": "邮箱地址",
|
||||||
"SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定": "SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定",
|
"SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定": "SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import config from '@/utils/config';
|
|||||||
import { request } from '@/utils/http';
|
import { request } from '@/utils/http';
|
||||||
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
||||||
import { Button, Form, Input, Modal, Select, Space, message } from 'antd';
|
import { Button, Form, Input, Modal, Select, Space, message } from 'antd';
|
||||||
import cronParser from 'cron-parser';
|
import { CronExpressionParser } from 'cron-parser';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import { getScheduleType, scheduleTypeMap } from './const';
|
import { getScheduleType, scheduleTypeMap } from './const';
|
||||||
@@ -91,14 +91,10 @@ const CronModal = ({
|
|||||||
{ required: true },
|
{ required: true },
|
||||||
{
|
{
|
||||||
validator: (_, value) => {
|
validator: (_, value) => {
|
||||||
try {
|
if (!value || CronExpressionParser.parse(value).hasNext()) {
|
||||||
if (!value || cronParser.CronExpressionParser.parse(value).hasNext()) {
|
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
return Promise.reject(intl.get('Cron表达式格式有误'));
|
return Promise.reject(intl.get('Cron表达式格式有误'));
|
||||||
} catch (e) {
|
|
||||||
return Promise.reject(intl.get('Cron表达式格式有误'));
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const SaveModal = ({
|
|||||||
|
|
||||||
const handleOk = async (values: any) => {
|
const handleOk = async (values: any) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const payload = { ...values, originFilename: file.title, content: file.content };
|
const payload = { ...file, ...values, originFilename: file.title };
|
||||||
request
|
request
|
||||||
.post(`${config.apiPrefix}scripts`, payload)
|
.post(`${config.apiPrefix}scripts`, payload)
|
||||||
.then(({ code, data }) => {
|
.then(({ code, data }) => {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
} from 'antd';
|
} from 'antd';
|
||||||
import { request } from '@/utils/http';
|
import { request } from '@/utils/http';
|
||||||
import config from '@/utils/config';
|
import config from '@/utils/config';
|
||||||
import cronParser from 'cron-parser';
|
import { CronExpressionParser } from 'cron-parser';
|
||||||
import isNil from 'lodash/isNil';
|
import isNil from 'lodash/isNil';
|
||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
@@ -378,19 +378,15 @@ const SubscriptionModal = ({
|
|||||||
{ required: true },
|
{ required: true },
|
||||||
{
|
{
|
||||||
validator: (rule, value) => {
|
validator: (rule, value) => {
|
||||||
try {
|
|
||||||
if (
|
if (
|
||||||
scheduleType === 'interval' ||
|
scheduleType === 'interval' ||
|
||||||
!value ||
|
!value ||
|
||||||
cronParser.CronExpressionParser.parse(value).hasNext()
|
CronExpressionParser.parse(value).hasNext()
|
||||||
) {
|
) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
} else {
|
} else {
|
||||||
return Promise.reject(intl.get('Subscription表达式格式有误'));
|
return Promise.reject(intl.get('Subscription表达式格式有误'));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
return Promise.reject(intl.get('Subscription表达式格式有误'));
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
|||||||
@@ -395,12 +395,6 @@ export default {
|
|||||||
),
|
),
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'larkSecret',
|
|
||||||
tip: intl.get(
|
|
||||||
'飞书群组机器人加签密钥,安全设置中开启签名校验后获得',
|
|
||||||
),
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
email: [
|
email: [
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import { LANG_MAP, LOG_END_SYMBOL } from './const';
|
import { LANG_MAP, LOG_END_SYMBOL } from './const';
|
||||||
import cronParser from 'cron-parser';
|
import { CronExpressionParser } from 'cron-parser';
|
||||||
import { ICrontab } from '@/pages/crontab/type';
|
import { ICrontab } from '@/pages/crontab/type';
|
||||||
|
|
||||||
export default function browserType() {
|
export default function browserType() {
|
||||||
@@ -333,7 +333,7 @@ export function getCommandScript(
|
|||||||
|
|
||||||
export function parseCrontab(schedule: string): Date | null {
|
export function parseCrontab(schedule: string): Date | null {
|
||||||
try {
|
try {
|
||||||
const time = cronParser.CronExpressionParser.parse(schedule);
|
const time = CronExpressionParser.parse(schedule);
|
||||||
if (time) {
|
if (time) {
|
||||||
return time.next().toDate();
|
return time.next().toDate();
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-46
@@ -1,47 +1,10 @@
|
|||||||
version: 2.20.0
|
version: 2.19.2
|
||||||
changeLogLink: https://t.me/jiao_long/432
|
changeLogLink: https://t.me/jiao_long/431
|
||||||
publishTime: 2025-12-10 01:05
|
publishTime: 2025-06-27 23:59
|
||||||
changeLog: |
|
changeLog: |
|
||||||
1. 定时任务(cron / task)相关的大量修复 & 增强
|
1. 备份数据支持选择模块,支持清除依赖缓存
|
||||||
|
2. QLAPI 和 openapi 的 systemNotify 支持自定义通知类型和参数
|
||||||
修复 cron 解析错误(修复 parse cron / 升级 cron-parser)
|
3. ntfy 增加可选的认证与用户动作,感谢 https://github.com/liheji
|
||||||
修复集群模式下定时任务可能不执行(race condition)
|
4. 修复取消安装依赖
|
||||||
定时任务支持订阅筛选
|
5. 修复环境变量过大解析报错
|
||||||
定时任务支持排序调整
|
6. 修改服务启动方式
|
||||||
定时任务支持自定义日志文件或无日志
|
|
||||||
修复任务实例默认值
|
|
||||||
任务支持单实例 / 多实例模式
|
|
||||||
修复 task 命令软链可能失败问题
|
|
||||||
|
|
||||||
2. 日志系统相关的大更新
|
|
||||||
|
|
||||||
修复日志目录逻辑
|
|
||||||
修复 pm2 日志目录
|
|
||||||
优化日志写入(stream pooling)
|
|
||||||
|
|
||||||
3. 环境变量(env)系统的改进与修复
|
|
||||||
|
|
||||||
修复环境变量复制到剪贴板时可能失败
|
|
||||||
添加环境变量“置顶”功能
|
|
||||||
修复 QlPort 与 QlGrpcPort 环境变量在 host network 模式下被忽略
|
|
||||||
增加全局 SSH 私钥配置
|
|
||||||
|
|
||||||
4. Docker / 非 root 用户 / Alpine 兼容性增强
|
|
||||||
|
|
||||||
新增非 root Docker 用户支持,自动初始化命令
|
|
||||||
修复 Alpine 容器 DNS 解析失败(设置 ndots:0)
|
|
||||||
修复 PM2 在 ARM 路由器(Node.js 不兼容)上的启动失败
|
|
||||||
移除 nginx(可能是考虑更轻量的镜像运行)
|
|
||||||
|
|
||||||
5. API 安全与校验增强
|
|
||||||
|
|
||||||
Dependencies GET endpoint 增加校验
|
|
||||||
Script API routes 增加输入校验
|
|
||||||
修复 JWT 认证问题
|
|
||||||
Feishu 机器人通知增加签名校验
|
|
||||||
QLAPI 增加 cron task 管理功能
|
|
||||||
修复 URIError(错误 cookie 导致白屏)
|
|
||||||
|
|
||||||
6. 系统设置
|
|
||||||
|
|
||||||
新增多终端/多平台的并发登录会话支持
|
|
||||||
Reference in New Issue
Block a user