mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-12 03:10:48 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f47a788184 | ||
|
|
738fe04ce4 | ||
|
|
a2812d9c03 | ||
|
|
5c53ae4993 | ||
|
|
e191aca41f |
@@ -7,7 +7,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- "master"
|
- "master"
|
||||||
- "develop"
|
- "develop"
|
||||||
- "test-cli"
|
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
schedule:
|
schedule:
|
||||||
|
|||||||
@@ -23,3 +23,5 @@
|
|||||||
.history
|
.history
|
||||||
.version.ts
|
.version.ts
|
||||||
/.tmp
|
/.tmp
|
||||||
|
__pycache__
|
||||||
|
/shell/preload/env.*
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
**/*.svg
|
**/*.svg
|
||||||
**/*.ejs
|
**/*.ejs
|
||||||
**/*.html
|
**/*.html
|
||||||
package.json
|
|
||||||
.umi
|
.umi
|
||||||
.umi-production
|
.umi-production
|
||||||
.umi-test
|
.umi-test
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ if (process.env.QL_DATA_DIR) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const shellPath = path.join(rootPath, 'shell/');
|
const shellPath = path.join(rootPath, 'shell/');
|
||||||
|
const preloadPath = path.join(shellPath, 'preload/');
|
||||||
const tmpPath = path.join(rootPath, '.tmp/');
|
const tmpPath = path.join(rootPath, '.tmp/');
|
||||||
const samplePath = path.join(rootPath, 'sample/');
|
const samplePath = path.join(rootPath, 'sample/');
|
||||||
const configPath = path.join(dataPath, 'config/');
|
const configPath = path.join(dataPath, 'config/');
|
||||||
@@ -37,9 +38,9 @@ const uploadPath = path.join(dataPath, 'upload/');
|
|||||||
const sshdPath = path.join(dataPath, 'ssh.d/');
|
const sshdPath = path.join(dataPath, 'ssh.d/');
|
||||||
const systemLogPath = path.join(dataPath, 'syslog/');
|
const systemLogPath = path.join(dataPath, 'syslog/');
|
||||||
|
|
||||||
const envFile = path.join(configPath, 'env.sh');
|
const envFile = path.join(preloadPath, 'env.sh');
|
||||||
const jsEnvFile = path.join(configPath, 'env.js');
|
const jsEnvFile = path.join(preloadPath, 'env.js');
|
||||||
const pyEnvFile = path.join(configPath, 'env.py');
|
const pyEnvFile = path.join(preloadPath, 'env.py');
|
||||||
const confFile = path.join(configPath, 'config.sh');
|
const confFile = path.join(configPath, 'config.sh');
|
||||||
const crontabFile = path.join(configPath, 'crontab.list');
|
const crontabFile = path.join(configPath, 'crontab.list');
|
||||||
const authConfigFile = path.join(configPath, 'auth.json');
|
const authConfigFile = path.join(configPath, 'auth.json');
|
||||||
|
|||||||
+7
-16
@@ -19,35 +19,26 @@ async function linkToNodeModule(src: string, dst?: string) {
|
|||||||
async function linkCommand() {
|
async function linkCommand() {
|
||||||
const commandPath = await promiseExec('which node');
|
const commandPath = await promiseExec('which node');
|
||||||
const commandDir = path.dirname(commandPath);
|
const commandDir = path.dirname(commandPath);
|
||||||
const oldLinkShell = [
|
const linkShell = [
|
||||||
{
|
{
|
||||||
src: 'update.sh',
|
src: 'update.sh',
|
||||||
dest: 'ql',
|
dest: 'ql',
|
||||||
tmp: 'ql_tmp',
|
tmp: 'ql_tmp',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
src: 'task.sh',
|
||||||
|
dest: 'task',
|
||||||
|
tmp: 'task_tmp',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
// const newLinkShell = [
|
|
||||||
// {
|
|
||||||
// src: 'task.mjs',
|
|
||||||
// dest: 'task',
|
|
||||||
// tmp: 'task_tmp',
|
|
||||||
// },
|
|
||||||
// ];
|
|
||||||
|
|
||||||
for (const link of oldLinkShell) {
|
for (const link of linkShell) {
|
||||||
const source = path.join(config.rootPath, 'shell', link.src);
|
const source = path.join(config.rootPath, 'shell', link.src);
|
||||||
const target = path.join(commandDir, link.dest);
|
const target = path.join(commandDir, link.dest);
|
||||||
const tmpTarget = path.join(commandDir, link.tmp);
|
const tmpTarget = path.join(commandDir, link.tmp);
|
||||||
await fs.symlink(source, tmpTarget);
|
await fs.symlink(source, tmpTarget);
|
||||||
await fs.rename(tmpTarget, target);
|
await fs.rename(tmpTarget, target);
|
||||||
}
|
}
|
||||||
// for (const link of newLinkShell) {
|
|
||||||
// const source = path.join(config.rootPath, 'cli', link.src);
|
|
||||||
// const target = path.join(commandDir, link.dest);
|
|
||||||
// const tmpTarget = path.join(commandDir, link.tmp);
|
|
||||||
// await fs.symlink(source, tmpTarget);
|
|
||||||
// await fs.rename(tmpTarget, target);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async (src: string = 'deps') => {
|
export default async (src: string = 'deps') => {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ if (process.env.QL_DATA_DIR) {
|
|||||||
dataPath = process.env.QL_DATA_DIR.replace(/\/$/g, '');
|
dataPath = process.env.QL_DATA_DIR.replace(/\/$/g, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const preloadPath = path.join(rootPath, 'shell/preload/');
|
||||||
const configPath = path.join(dataPath, 'config/');
|
const configPath = path.join(dataPath, 'config/');
|
||||||
const scriptPath = path.join(dataPath, 'scripts/');
|
const scriptPath = path.join(dataPath, 'scripts/');
|
||||||
const logPath = path.join(dataPath, 'log/');
|
const logPath = path.join(dataPath, 'log/');
|
||||||
@@ -38,6 +39,7 @@ export default async () => {
|
|||||||
const authFileExist = await fileExist(authConfigFile);
|
const authFileExist = await fileExist(authConfigFile);
|
||||||
const confFileExist = await fileExist(confFile);
|
const confFileExist = await fileExist(confFile);
|
||||||
const scriptDirExist = await fileExist(scriptPath);
|
const scriptDirExist = await fileExist(scriptPath);
|
||||||
|
const preloadDirExist = await fileExist(preloadPath);
|
||||||
const logDirExist = await fileExist(logPath);
|
const logDirExist = await fileExist(logPath);
|
||||||
const configDirExist = await fileExist(configPath);
|
const configDirExist = await fileExist(configPath);
|
||||||
const uploadDirExist = await fileExist(uploadPath);
|
const uploadDirExist = await fileExist(uploadPath);
|
||||||
@@ -59,6 +61,10 @@ export default async () => {
|
|||||||
await fs.mkdir(scriptPath);
|
await fs.mkdir(scriptPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!preloadDirExist) {
|
||||||
|
await fs.mkdir(preloadPath);
|
||||||
|
}
|
||||||
|
|
||||||
if (!logDirExist) {
|
if (!logDirExist) {
|
||||||
await fs.mkdir(logPath);
|
await fs.mkdir(logPath);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default async () => {
|
|||||||
const subscriptionService = Container.get(SubscriptionService);
|
const subscriptionService = Container.get(SubscriptionService);
|
||||||
|
|
||||||
// 生成内置token
|
// 生成内置token
|
||||||
let tokenCommand = `tsx ${join(config.rootPath, 'back/token.ts')}`;
|
let tokenCommand = `ts-node-transpile-only ${join(config.rootPath, 'back/token.ts')}`;
|
||||||
const tokenFile = join(config.rootPath, 'static/build/token.js');
|
const tokenFile = join(config.rootPath, 'static/build/token.js');
|
||||||
|
|
||||||
if (await fileExist(tokenFile)) {
|
if (await fileExist(tokenFile)) {
|
||||||
|
|||||||
+10
-5
@@ -210,13 +210,18 @@ export default class EnvService {
|
|||||||
.replace(/'/g, "'\\''")
|
.replace(/'/g, "'\\''")
|
||||||
.trim();
|
.trim();
|
||||||
env_string += `export ${key}='${value}'\n`;
|
env_string += `export ${key}='${value}'\n`;
|
||||||
const _env_value = `'${group
|
const _env_value = `${group
|
||||||
.map((x) => x.value)
|
.map((x) => x.value)
|
||||||
.join('&')
|
.join('&')
|
||||||
.replace(/\\/g, '\\\\')
|
.replace(/\\/g, '\\\\')}`;
|
||||||
.replace(/'/g, "\\'")}'`;
|
js_env_string += `process.env.${key}=\`${_env_value.replace(
|
||||||
js_env_string += `process.env.${key}=${_env_value};\n`;
|
/\`/g,
|
||||||
py_env_string += `os.environ['${key}']=${_env_value}\n`;
|
'\\`',
|
||||||
|
)}\`;\n`;
|
||||||
|
py_env_string += `os.environ['${key}']='''${_env_value.replace(
|
||||||
|
/\'/g,
|
||||||
|
"\\'",
|
||||||
|
)}'''\n`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import taskLimit from '../shared/pLimit';
|
|||||||
import NotificationService from './notify';
|
import NotificationService from './notify';
|
||||||
import ScheduleService, { TaskCallbacks } from './schedule';
|
import ScheduleService, { TaskCallbacks } from './schedule';
|
||||||
import SockService from './sock';
|
import SockService from './sock';
|
||||||
|
import os from 'os';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export default class SystemService {
|
export default class SystemService {
|
||||||
@@ -205,6 +206,9 @@ export default class SystemService {
|
|||||||
});
|
});
|
||||||
let defaultDomain = 'https://dl-cdn.alpinelinux.org';
|
let defaultDomain = 'https://dl-cdn.alpinelinux.org';
|
||||||
let targetDomain = 'https://dl-cdn.alpinelinux.org';
|
let targetDomain = 'https://dl-cdn.alpinelinux.org';
|
||||||
|
if (os.platform() !== 'linux') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const content = await fs.promises.readFile('/etc/apk/repositories', {
|
const content = await fs.promises.readFile('/etc/apk/repositories', {
|
||||||
encoding: 'utf-8',
|
encoding: 'utf-8',
|
||||||
});
|
});
|
||||||
|
|||||||
-274
@@ -1,274 +0,0 @@
|
|||||||
#!/usr/bin/env zx
|
|
||||||
import path from 'path';
|
|
||||||
|
|
||||||
const dir_root = process.env.QL_DIR;
|
|
||||||
const file_auth_token = path.join(dir_root, 'static/auth.json');
|
|
||||||
const token_file = path.join(dir_root, 'static/build/token.js');
|
|
||||||
|
|
||||||
let token;
|
|
||||||
|
|
||||||
const createToken = async () => {
|
|
||||||
let tokenCommand = `tsx ${dir_root}/back/token.ts`;
|
|
||||||
if (await fs.exists(token_file)) {
|
|
||||||
tokenCommand = `node ${token_file}`;
|
|
||||||
}
|
|
||||||
token = (await $([tokenCommand])).stdout.trim();
|
|
||||||
};
|
|
||||||
|
|
||||||
const getToken = async () => {
|
|
||||||
if (fs.existsSync(file_auth_token)) {
|
|
||||||
const authTokenData = JSON.parse(fs.readFileSync(file_auth_token, 'utf8'));
|
|
||||||
token = authTokenData.value;
|
|
||||||
const expiration = authTokenData.expiration;
|
|
||||||
const currentTimeStamp = Math.floor(Date.now() / 1000);
|
|
||||||
if (currentTimeStamp >= expiration) {
|
|
||||||
await createToken();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
await createToken();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const addCronApi = async (schedule, command, name, subId = null) => {
|
|
||||||
const currentTimeStamp = Math.floor(Date.now() / 1000);
|
|
||||||
const data = {
|
|
||||||
name,
|
|
||||||
command,
|
|
||||||
schedule,
|
|
||||||
sub_id: subId,
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(
|
|
||||||
`http://0.0.0.0:5600/open/crons?t=${currentTimeStamp}`,
|
|
||||||
{
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${token}`,
|
|
||||||
'User-Agent': 'Mozilla/5.0',
|
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(data),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const responseData = await response.json();
|
|
||||||
const { code, message } = responseData;
|
|
||||||
if (code === 200) {
|
|
||||||
console.log(`${name} -> 添加成功`);
|
|
||||||
} else {
|
|
||||||
console.log(`${name} -> 添加失败(${message})`);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`${name} -> 添加失败(${error.message})`);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const updateCronApi = async (schedule, command, name, id) => {
|
|
||||||
const currentTimeStamp = Math.floor(Date.now() / 1000);
|
|
||||||
const data = {
|
|
||||||
name,
|
|
||||||
command,
|
|
||||||
schedule,
|
|
||||||
id,
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(
|
|
||||||
`http://0.0.0.0:5600/open/crons?t=${currentTimeStamp}`,
|
|
||||||
{
|
|
||||||
method: 'PUT',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${token}`,
|
|
||||||
'User-Agent': 'Mozilla/5.0',
|
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(data),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const responseData = await response.json();
|
|
||||||
const { code, message } = responseData;
|
|
||||||
if (code === 200) {
|
|
||||||
console.log(`${name} -> 更新成功`);
|
|
||||||
} else {
|
|
||||||
console.log(`${name} -> 更新失败(${message})`);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`${name} -> 更新失败(${error.message})`);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const updateCronCommandApi = async (command, id) => {
|
|
||||||
const currentTimeStamp = Math.floor(Date.now() / 1000);
|
|
||||||
const data = {
|
|
||||||
command,
|
|
||||||
id,
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(
|
|
||||||
`http://0.0.0.0:5600/open/crons?t=${currentTimeStamp}`,
|
|
||||||
{
|
|
||||||
method: 'PUT',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${token}`,
|
|
||||||
'User-Agent': 'Mozilla/5.0',
|
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(data),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const responseData = await response.json();
|
|
||||||
const { code, message } = responseData;
|
|
||||||
if (code === 200) {
|
|
||||||
console.log(`${command} -> 更新成功`);
|
|
||||||
} else {
|
|
||||||
console.log(`${command} -> 更新失败(${message})`);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`${command} -> 更新失败(${error.message})`);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const delCronApi = async (ids) => {
|
|
||||||
const currentTimeStamp = Math.floor(Date.now() / 1000);
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(
|
|
||||||
`http://0.0.0.0:5600/open/crons?t=${currentTimeStamp}`,
|
|
||||||
{
|
|
||||||
method: 'DELETE',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${token}`,
|
|
||||||
'User-Agent': 'Mozilla/5.0',
|
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(ids),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const responseData = await response.json();
|
|
||||||
const { code, message } = responseData;
|
|
||||||
if (code === 200) {
|
|
||||||
console.log('成功');
|
|
||||||
} else {
|
|
||||||
console.log(`失败(${message})`);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`删除失败(${error.message})`);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const updateCron = async (
|
|
||||||
ids,
|
|
||||||
status,
|
|
||||||
pid,
|
|
||||||
logPath,
|
|
||||||
lastExecutingTime = 0,
|
|
||||||
runningTime = 0,
|
|
||||||
) => {
|
|
||||||
const currentTimeStamp = Math.floor(Date.now() / 1000);
|
|
||||||
const data = {
|
|
||||||
ids,
|
|
||||||
status,
|
|
||||||
pid,
|
|
||||||
log_path: logPath,
|
|
||||||
last_execution_time: lastExecutingTime,
|
|
||||||
last_running_time: runningTime,
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(
|
|
||||||
`http://0.0.0.0:5600/open/crons/status?t=${currentTimeStamp}`,
|
|
||||||
{
|
|
||||||
method: 'PUT',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${token}`,
|
|
||||||
'User-Agent': 'Mozilla/5.0',
|
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(data),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const responseData = await response.json();
|
|
||||||
const { code, message } = responseData;
|
|
||||||
if (code !== 200) {
|
|
||||||
console.log(`更新任务状态失败(${message})`);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`更新任务状态失败(${error.message})`);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const notifyApi = async (title, content) => {
|
|
||||||
const currentTimeStamp = Math.floor(Date.now() / 1000);
|
|
||||||
const data = {
|
|
||||||
title,
|
|
||||||
content,
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(
|
|
||||||
`http://0.0.0.0:5600/open/system/notify?t=${currentTimeStamp}`,
|
|
||||||
{
|
|
||||||
method: 'PUT',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${token}`,
|
|
||||||
'User-Agent': 'Mozilla/5.0',
|
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(data),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const responseData = await response.json();
|
|
||||||
const { code, message } = responseData;
|
|
||||||
if (code === 200) {
|
|
||||||
console.log('通知发送成功🎉');
|
|
||||||
} else {
|
|
||||||
console.log(`通知失败(${message})`);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`通知失败(${error.message})`);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const findCronApi = async (params) => {
|
|
||||||
const currentTimeStamp = Math.floor(Date.now() / 1000);
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(
|
|
||||||
`http://0.0.0.0:5600/open/crons/detail?${params}&t=${currentTimeStamp}`,
|
|
||||||
{
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${token}`,
|
|
||||||
'User-Agent': 'Mozilla/5.0',
|
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const responseData = await response.json();
|
|
||||||
const { data } = responseData;
|
|
||||||
if (data === 'null') {
|
|
||||||
console.log('');
|
|
||||||
} else {
|
|
||||||
const { name } = data;
|
|
||||||
console.log(name);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`查找失败(${error.message})`);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
await getToken();
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { CommandModule } from 'yargs';
|
||||||
|
export const updateCommand: CommandModule = {
|
||||||
|
command: 'update',
|
||||||
|
describe: 'Update and restart qinglong',
|
||||||
|
builder: (yargs) => {
|
||||||
|
return yargs.option('repositority', {
|
||||||
|
type: 'string',
|
||||||
|
alias: 'r',
|
||||||
|
describe: `Specify the release warehouse address of the package`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handler: async (argv) => {},
|
||||||
|
};
|
||||||
-22
@@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env zx
|
|
||||||
|
|
||||||
import 'zx/globals';
|
|
||||||
let initialVars = [];
|
|
||||||
|
|
||||||
export const storeEnvVars = async () => {
|
|
||||||
const stdout = (await $`env`).lines();
|
|
||||||
initialVars = stdout.map((line) => line.split('=')[0]);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const restoreEnvVars = async () => {
|
|
||||||
const stdout = (await $`env`).lines();
|
|
||||||
const currentVars = stdout.map((line) => line.split('=')[0]);
|
|
||||||
|
|
||||||
for (const key of currentVars) {
|
|
||||||
if (!initialVars.includes(key)) {
|
|
||||||
await $`unset ${key}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
await storeEnvVars();
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import * as yargs from 'yargs';
|
||||||
|
import { green, red } from 'chalk';
|
||||||
|
import { updateCommand } from './commands/update';
|
||||||
|
|
||||||
|
yargs
|
||||||
|
.usage('Usage: ql [command] <options>')
|
||||||
|
.command(updateCommand)
|
||||||
|
.fail((err) => {
|
||||||
|
console.error(`${red(err)}`);
|
||||||
|
})
|
||||||
|
.alias('h', 'help')
|
||||||
|
.showHelp()
|
||||||
|
.recommendCommands().argv;
|
||||||
-302
@@ -1,302 +0,0 @@
|
|||||||
#!/usr/bin/env zx
|
|
||||||
|
|
||||||
import {
|
|
||||||
dirScripts,
|
|
||||||
dirLog,
|
|
||||||
handleTaskStart,
|
|
||||||
runTaskBefore,
|
|
||||||
runTaskAfter,
|
|
||||||
handleTaskEnd,
|
|
||||||
globalState,
|
|
||||||
formatLogTime,
|
|
||||||
} from './share.mjs';
|
|
||||||
import { basename, dirname } from 'path';
|
|
||||||
|
|
||||||
function defineProgram(fileParam) {
|
|
||||||
if (fileParam.endsWith('.js') || fileParam.endsWith('.mjs')) {
|
|
||||||
return 'node';
|
|
||||||
} else if (fileParam.endsWith('.py') || fileParam.endsWith('.pyc')) {
|
|
||||||
return 'python3';
|
|
||||||
} else if (fileParam.endsWith('.sh')) {
|
|
||||||
return 'bash';
|
|
||||||
} else if (fileParam.endsWith('.ts')) {
|
|
||||||
return $`command -v tsx`
|
|
||||||
.then(() => 'tsx')
|
|
||||||
.catch(() => 'ts-node-transpile-only');
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function randomDelay(fileParam) {
|
|
||||||
const randomDelayMax = process.env.RandomDelay;
|
|
||||||
if (randomDelayMax && randomDelayMax > 0) {
|
|
||||||
const fileExtensions = process.env.RandomDelayFileExtensions || 'js';
|
|
||||||
const ignoredMinutes = process.env.RandomDelayIgnoredMinutes || '0 30';
|
|
||||||
const currentMin = new Date().getMinutes();
|
|
||||||
|
|
||||||
if (
|
|
||||||
fileExtensions.split(' ').some((ext) => fileParam.endsWith(`.${ext}`))
|
|
||||||
) {
|
|
||||||
if (
|
|
||||||
ignoredMinutes.split(' ').some((min) => parseInt(min) === currentMin)
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const delaySecond = Math.floor(Math.random() * randomDelayMax) + 1;
|
|
||||||
console.log(
|
|
||||||
`任务随机延迟 ${delaySecond} 秒,配置文件参数 RandomDelay 置空可取消延迟`,
|
|
||||||
);
|
|
||||||
await sleep(delaySecond * 1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function genArrayScripts() {
|
|
||||||
const arrayScripts = [];
|
|
||||||
const arrayScriptsName = [];
|
|
||||||
const files = await fs.readdir(dirScripts);
|
|
||||||
|
|
||||||
for (const file of files) {
|
|
||||||
if (file.endsWith('.js') && file !== 'sendNotify.js') {
|
|
||||||
arrayScripts.push(file);
|
|
||||||
const content = await fs.readFile(`${dirScripts}/${file}`, 'utf8');
|
|
||||||
const match = content.match(/new Env\(['"]([^'"]+)['"]\)/);
|
|
||||||
arrayScriptsName.push(match ? match[1] : '<未识别出活动名称>');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return { arrayScripts, arrayScriptsName };
|
|
||||||
}
|
|
||||||
|
|
||||||
async function usage() {
|
|
||||||
const { arrayScripts, arrayScriptsName } = await genArrayScripts();
|
|
||||||
console.log(
|
|
||||||
`task命令运行本程序自动添加进crontab的脚本,需要输入脚本的绝对路径或去掉 “${dirScripts}/” 目录后的相对路径(定时任务中请写作相对路径),用法为:`,
|
|
||||||
);
|
|
||||||
console.log(
|
|
||||||
`1.$cmdTask <fileName> # 依次执行,如果设置了随机延迟,将随机延迟一定秒数`,
|
|
||||||
);
|
|
||||||
console.log(
|
|
||||||
`2.$cmdTask <fileName> now # 依次执行,无论是否设置了随机延迟,均立即运行,前台会输出日志,同时记录在日志文件中`,
|
|
||||||
);
|
|
||||||
console.log(
|
|
||||||
`3.$cmdTask <fileName> conc <环境变量名称> <账号编号,空格分隔>(可选的) # 并发执行,无论是否设置了随机延迟,均立即运行,前台不产生日志,直接记录在日志文件中,且可指定账号执行`,
|
|
||||||
);
|
|
||||||
console.log(
|
|
||||||
`4.$cmdTask <fileName> desi <环境变量名称> <账号编号,空格分隔> # 指定账号执行,无论是否设置了随机延迟,均立即运行`,
|
|
||||||
);
|
|
||||||
if (arrayScripts.length > 0) {
|
|
||||||
console.log(`\n当前有以下脚本可以运行:`);
|
|
||||||
arrayScripts.forEach((script, i) =>
|
|
||||||
console.log(`${i + 1}. ${arrayScriptsName[i]}:${script}`),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
console.log(`\n暂无脚本可以执行`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function parseDuration(d) {
|
|
||||||
if (typeof d == 'number') {
|
|
||||||
if (isNaN(d) || d < 0) throw new Error(`Invalid duration: "${d}".`);
|
|
||||||
return d;
|
|
||||||
} else if (/\d+s/.test(d)) {
|
|
||||||
return +d.slice(0, -1) * 1000;
|
|
||||||
} else if (/\d+ms/.test(d)) {
|
|
||||||
return +d.slice(0, -2);
|
|
||||||
} else if (/\d+m/.test(d)) {
|
|
||||||
return +d.slice(0, -1) * 1000 * 60;
|
|
||||||
} else if (/\d+h/.test(d)) {
|
|
||||||
return +d.slice(0, -1) * 1000 * 60 * 60;
|
|
||||||
} else if (/\d+d/.test(d)) {
|
|
||||||
return +d.slice(0, -1) * 1000 * 60 * 60 * 24;
|
|
||||||
}
|
|
||||||
throw new Error(`Unknown duration: "${d}".`);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function runWithTimeout(command) {
|
|
||||||
if (globalState.commandTimeoutTime) {
|
|
||||||
const timeoutNumber = parseDuration(globalState.commandTimeoutTime);
|
|
||||||
await $([command]).timeout(timeoutNumber).nothrow().pipe(process.stdout);
|
|
||||||
} else {
|
|
||||||
await $([command]).nothrow().pipe(process.stdout);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function runNormal(fileParam, scriptParams) {
|
|
||||||
if (
|
|
||||||
!scriptParams.includes('now') &&
|
|
||||||
process.env.realTime !== 'true' &&
|
|
||||||
process.env.noDelay !== 'true'
|
|
||||||
) {
|
|
||||||
await randomDelay(fileParam);
|
|
||||||
}
|
|
||||||
cd(dirScripts);
|
|
||||||
const relativePath = dirname(fileParam);
|
|
||||||
if (!fileParam.startsWith('/') && relativePath) {
|
|
||||||
cd(relativePath);
|
|
||||||
fileParam = fileParam.replace(`${relativePath}/`, '');
|
|
||||||
}
|
|
||||||
await runWithTimeout(
|
|
||||||
`${globalState.whichProgram} ${fileParam} ${scriptParams}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function runConcurrent(fileParam, envParam, numParam, scriptParams) {
|
|
||||||
if (!envParam || !numParam) {
|
|
||||||
console.log(`缺少并发运行的环境变量参数 task xxx.js conc Test 1 3`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const array = (process.env[envParam] || '').split('&');
|
|
||||||
const runArr = expandRange(numParam, array.length);
|
|
||||||
const arrayRun = runArr.map((i) => array[i - 1]).filter(Boolean);
|
|
||||||
|
|
||||||
const singleLogTime = formatLogTime(new Date());
|
|
||||||
|
|
||||||
cd(dirScripts);
|
|
||||||
const relativePath = dirname(fileParam);
|
|
||||||
if (relativePath && fileParam.includes('/')) {
|
|
||||||
cd(relativePath);
|
|
||||||
fileParam = fileParam.replace(`${relativePath}/`, '');
|
|
||||||
}
|
|
||||||
|
|
||||||
await Promise.all(
|
|
||||||
arrayRun.map(async (env, i) => {
|
|
||||||
const singleLogPath = `${dirLog}/${globalState.logDir}/${singleLogTime}_${
|
|
||||||
i + 1
|
|
||||||
}.log`;
|
|
||||||
await runWithTimeout(
|
|
||||||
`${envParam}="${env.replace('"', '\\"')}" ${
|
|
||||||
globalState.whichProgram
|
|
||||||
} ${fileParam} ${scriptParams} &>${singleLogPath}`,
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
for (let i = 0; i < arrayRun.length; i++) {
|
|
||||||
const singleLogPath = `${dirLog}/${globalState.logDir}/${singleLogTime}_${
|
|
||||||
i + 1
|
|
||||||
}.log`;
|
|
||||||
const log = await fs.readFile(singleLogPath, 'utf8');
|
|
||||||
console.log(log);
|
|
||||||
await fs.unlink(singleLogPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function runDesignated(fileParam, envParam, numParam, scriptParams) {
|
|
||||||
if (!envParam || !numParam) {
|
|
||||||
console.log(`缺少单独运行的参数 task xxx.js desi Test 1 3`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const array = (process.env[envParam] || '').split('&');
|
|
||||||
const runArr = expandRange(numParam, array.length);
|
|
||||||
const arrayRun = runArr.map((i) => array[i - 1]).filter(Boolean);
|
|
||||||
const cookieStr = arrayRun.join('&');
|
|
||||||
cd(dirScripts);
|
|
||||||
const relativePath = dirname(fileParam);
|
|
||||||
if (relativePath && fileParam.includes('/')) {
|
|
||||||
cd(relativePath);
|
|
||||||
fileParam = fileParam.replace(`${relativePath}/`, '');
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('cookieStr', cookieStr.length, arrayRun.length);
|
|
||||||
// ${envParam}="${cookieStr.replace('"', '\\"')}"
|
|
||||||
await runWithTimeout(
|
|
||||||
`${globalState.whichProgram} ${fileParam} ${scriptParams}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function runElse(fileParam, scriptParams) {
|
|
||||||
cd(dirScripts);
|
|
||||||
const relativePath = dirname(fileParam);
|
|
||||||
if (relativePath && fileParam.includes('/')) {
|
|
||||||
cd(relativePath);
|
|
||||||
fileParam = fileParam.replace(`${relativePath}/`, './');
|
|
||||||
}
|
|
||||||
|
|
||||||
await runWithTimeout(
|
|
||||||
`${globalState.whichProgram} ${fileParam} ${scriptParams}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function expandRange(rangeStr, max) {
|
|
||||||
const tempRangeStr = rangeStr
|
|
||||||
.replace(/-max/g, `-${max}`)
|
|
||||||
.replace(/max-/g, `${max}-`);
|
|
||||||
|
|
||||||
return tempRangeStr.split(' ').flatMap((part) => {
|
|
||||||
const rangeMatch = part.match(/^(\d+)([-~_])(\d+)$/);
|
|
||||||
if (rangeMatch) {
|
|
||||||
const [, start, , end] = rangeMatch.map(Number);
|
|
||||||
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
||||||
}
|
|
||||||
return Number(part);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function main(taskShellParams, scriptParams) {
|
|
||||||
const [fileParam, action, envParam, ...others] = taskShellParams;
|
|
||||||
if (taskShellParams.length === 0) {
|
|
||||||
return await usage();
|
|
||||||
}
|
|
||||||
if (fileParam && /\.(js|py|pyc|sh|ts)$/.test(fileParam)) {
|
|
||||||
const filePath = fileParam.startsWith('/')
|
|
||||||
? fileParam
|
|
||||||
: path.join(dirScripts, fileParam);
|
|
||||||
if (!(await fs.exists(filePath))) {
|
|
||||||
console.log(`文件不存在 ${fileParam}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch (action) {
|
|
||||||
case undefined:
|
|
||||||
return await runNormal(fileParam, scriptParams);
|
|
||||||
case 'now':
|
|
||||||
return await runNormal(fileParam, scriptParams);
|
|
||||||
case 'conc':
|
|
||||||
return await runConcurrent(
|
|
||||||
fileParam,
|
|
||||||
envParam,
|
|
||||||
others.join(' '),
|
|
||||||
scriptParams,
|
|
||||||
);
|
|
||||||
case 'desi':
|
|
||||||
return await runDesignated(
|
|
||||||
fileParam,
|
|
||||||
envParam,
|
|
||||||
others.join(' '),
|
|
||||||
scriptParams,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await runElse(fileParam, taskShellParams.slice(1).concat(scriptParams));
|
|
||||||
}
|
|
||||||
|
|
||||||
async function run() {
|
|
||||||
const taskArgv = minimist(process.argv.slice(3), {
|
|
||||||
'--': true,
|
|
||||||
});
|
|
||||||
const { _: taskShellParams, m, '--': scriptParams, GlobalState } = taskArgv;
|
|
||||||
const cacheState = JSON.parse(GlobalState || '{}');
|
|
||||||
for (const key in cacheState) {
|
|
||||||
globalState[key] = cacheState[key];
|
|
||||||
}
|
|
||||||
if (m) {
|
|
||||||
globalState.commandTimeoutTime = m;
|
|
||||||
}
|
|
||||||
globalState.whichProgram = await defineProgram(taskShellParams[0]);
|
|
||||||
|
|
||||||
await handleTaskStart();
|
|
||||||
await runTaskBefore();
|
|
||||||
await main(taskShellParams, scriptParams);
|
|
||||||
await runTaskAfter();
|
|
||||||
await handleTaskEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function singleHandle() {}
|
|
||||||
|
|
||||||
const signals = ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGQUIT', 'SIGTSTP'];
|
|
||||||
signals.forEach((sig) => process.on(sig, singleHandle));
|
|
||||||
|
|
||||||
await run();
|
|
||||||
-500
@@ -1,500 +0,0 @@
|
|||||||
#!/usr/bin/env zx
|
|
||||||
import 'zx/globals';
|
|
||||||
// $.verbose = true;
|
|
||||||
|
|
||||||
import { updateCron, notifyApi } from './api.mjs';
|
|
||||||
import { restoreEnvVars } from './env.mjs';
|
|
||||||
|
|
||||||
export const dirRoot = process.env.QL_DIR;
|
|
||||||
export const dirTmp = path.join(dirRoot, '.tmp');
|
|
||||||
export const dirData = process.env.QL_DATA_DIR
|
|
||||||
? process.env.QL_DATA_DIR.endsWith('/')
|
|
||||||
? process.env.QL_DATA_DIR.slice(-1)
|
|
||||||
: process.env.QL_DATA_DIR
|
|
||||||
: path.join(dirRoot, 'data');
|
|
||||||
export const dirShell = path.join(dirRoot, 'shell');
|
|
||||||
export const dirCli = path.join(dirRoot, 'cli');
|
|
||||||
export const dirSample = path.join(dirRoot, 'sample');
|
|
||||||
export const dirStatic = path.join(dirRoot, 'static');
|
|
||||||
export const dirConfig = path.join(dirData, 'config');
|
|
||||||
export const dirScripts = path.join(dirData, 'scripts');
|
|
||||||
export const dirRepo = path.join(dirData, 'repo');
|
|
||||||
export const dirRaw = path.join(dirData, 'raw');
|
|
||||||
export const dirLog = path.join(dirData, 'log');
|
|
||||||
export const dirDb = path.join(dirData, 'db');
|
|
||||||
export const dirDep = path.join(dirData, 'deps');
|
|
||||||
export const dirListTmp = path.join(dirLog, '.tmp');
|
|
||||||
export const dirUpdateLog = path.join(dirLog, 'update');
|
|
||||||
export const qlStaticRepo = path.join(dirRepo, 'static');
|
|
||||||
|
|
||||||
export const fileConfigSample = path.join(dirSample, 'config.sample.sh');
|
|
||||||
export const fileEnv = path.join(dirConfig, 'env.sh');
|
|
||||||
export const jsFileEnv = path.join(dirConfig, 'env.js');
|
|
||||||
export const fileConfigUser = path.join(dirConfig, 'config.sh');
|
|
||||||
export const fileAuthSample = path.join(dirSample, 'auth.sample.json');
|
|
||||||
export const fileAuthUser = path.join(dirConfig, 'auth.json');
|
|
||||||
export const fileAuthToken = path.join(dirConfig, 'token.json');
|
|
||||||
export const fileExtraShell = path.join(dirConfig, 'extra.sh');
|
|
||||||
export const fileTaskBefore = path.join(dirConfig, 'task_before.sh');
|
|
||||||
export const fileTaskAfter = path.join(dirConfig, 'task_after.sh');
|
|
||||||
export const fileTaskSample = path.join(dirSample, 'task.sample.sh');
|
|
||||||
export const fileExtraSample = path.join(dirSample, 'extra.sample.sh');
|
|
||||||
export const fileNotifyJsSample = path.join(dirSample, 'notify.js');
|
|
||||||
export const fileNotifyPySample = path.join(dirSample, 'notify.py');
|
|
||||||
export const fileTestJsSample = path.join(dirSample, 'ql_sample.js');
|
|
||||||
export const fileTestPySample = path.join(dirSample, 'ql_sample.py');
|
|
||||||
export const fileNotifyPy = path.join(dirScripts, 'notify.py');
|
|
||||||
export const fileNotifyJs = path.join(dirScripts, 'sendNotify.js');
|
|
||||||
export const fileTestJs = path.join(dirScripts, 'ql_sample.js');
|
|
||||||
export const fileTestPy = path.join(dirScripts, 'ql_sample.py');
|
|
||||||
export const nginxAppConf = path.join(dirRoot, 'docker/front.conf');
|
|
||||||
export const nginxConf = path.join(dirRoot, 'docker/nginx.conf');
|
|
||||||
export const depNotifyPy = path.join(dirDep, 'notify.py');
|
|
||||||
export const depNotifyJs = path.join(dirDep, 'sendNotify.js');
|
|
||||||
|
|
||||||
export const listCrontabUser = path.join(dirConfig, 'crontab.list');
|
|
||||||
export const listCrontabSample = path.join(dirSample, 'crontab.sample.list');
|
|
||||||
export const listOwnScripts = path.join(dirListTmp, 'own_scripts.list');
|
|
||||||
export const listOwnUser = path.join(dirListTmp, 'own_user.list');
|
|
||||||
export const listOwnAdd = path.join(dirListTmp, 'own_add.list');
|
|
||||||
export const listOwnDrop = path.join(dirListTmp, 'own_drop.list');
|
|
||||||
|
|
||||||
export const globalState = {};
|
|
||||||
|
|
||||||
export const initEnv = () => {
|
|
||||||
$.prefix +=
|
|
||||||
'export NODE_PATH=/usr/local/bin:/usr/local/pnpm-global/5/node_modules:/usr/local/lib/node_modules:/root/.local/share/pnpm/global/5/node_modules;';
|
|
||||||
$.prefix += 'export PYTHONUNBUFFERED=1;';
|
|
||||||
$.prefix += 'export TERM=xterm-color;';
|
|
||||||
};
|
|
||||||
|
|
||||||
export const importConfig = async () => {
|
|
||||||
if (await fs.exists(fileConfigUser)) {
|
|
||||||
$.prefix += (await fs.readFile(fileConfigUser, 'utf8'));
|
|
||||||
}
|
|
||||||
// if (process.env.LOAD_ENV !== 'false' && (await fs.exists(fileEnv))) {
|
|
||||||
// $.prefix += (await fs.readFile(fileEnv, 'utf8'));
|
|
||||||
// }
|
|
||||||
require(jsFileEnv)
|
|
||||||
|
|
||||||
globalState.qlBaseUrl = process.env.QlBaseUrl || '/';
|
|
||||||
globalState.qlPort = process.env.QlPort || '5700';
|
|
||||||
globalState.commandTimeoutTime = process.env.CommandTimeoutTime;
|
|
||||||
globalState.fileExtensions = process.env.RepoFileExtensions || 'js py';
|
|
||||||
globalState.proxyUrl = process.env.ProxyUrl || '';
|
|
||||||
globalState.currentBranch = process.env.QL_BRANCH;
|
|
||||||
|
|
||||||
if (process.env.DefaultCronRule) {
|
|
||||||
globalState.defaultCron = process.env.DefaultCronRule;
|
|
||||||
} else {
|
|
||||||
globalState.defaultCron = `${Math.floor(Math.random() * 60)} ${Math.floor(
|
|
||||||
Math.random() * 24,
|
|
||||||
)} * * *`;
|
|
||||||
}
|
|
||||||
|
|
||||||
globalState.cpuWarn = process.env.CpuWarn;
|
|
||||||
globalState.memWarn = process.env.MemoryWarn;
|
|
||||||
globalState.diskWarn = process.env.DiskWarn;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const setProxy = (proxy) => {
|
|
||||||
if (proxy) {
|
|
||||||
globalState.proxyUrl = proxy;
|
|
||||||
}
|
|
||||||
if (globalState.proxyUrl) {
|
|
||||||
$`export http_proxy=${globalState.proxyUrl}`;
|
|
||||||
$`export https_proxy=${globalState.proxyUrl}`;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const unsetProxy = () => {
|
|
||||||
$`unset http_proxy`;
|
|
||||||
$`unset https_proxy`;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const makeDir = async (dir) => {
|
|
||||||
if (!(await fs.exists(dir))) {
|
|
||||||
await fs.mkdir(dir, { recursive: true });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const detectTermux = () => {
|
|
||||||
globalState.isTermux = process.env.PATH?.includes('com.termux') ? 1 : 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const detectMacos = () => {
|
|
||||||
globalState.isMacos = os.type() === 'Darwin' ? 1 : 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const genRandomNum = (number) => {
|
|
||||||
return Math.floor(Math.random() * number);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const fixConfig = async () => {
|
|
||||||
await makeDir(dirTmp);
|
|
||||||
await makeDir(dirStatic);
|
|
||||||
await makeDir(dirData);
|
|
||||||
await makeDir(dirConfig);
|
|
||||||
await makeDir(dirLog);
|
|
||||||
await makeDir(dirDb);
|
|
||||||
await makeDir(dirScripts);
|
|
||||||
await makeDir(dirListTmp);
|
|
||||||
await makeDir(dirRepo);
|
|
||||||
await makeDir(dirRaw);
|
|
||||||
await makeDir(dirUpdateLog);
|
|
||||||
await makeDir(dirDep);
|
|
||||||
|
|
||||||
if (!(await fs.exists(fileConfigUser))) {
|
|
||||||
console.log(
|
|
||||||
`复制一份 ${fileConfigSample} 为 ${fileConfigUser},随后请按注释编辑你的配置文件:${fileConfigUser}`,
|
|
||||||
);
|
|
||||||
await fs.copyFile(fileConfigSample, fileConfigUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(await fs.exists(fileEnv))) {
|
|
||||||
console.log(
|
|
||||||
'检测到config配置目录下不存在env.sh,创建一个空文件用于初始化...',
|
|
||||||
);
|
|
||||||
await fs.writeFile(fileEnv, '');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(await fs.exists(fileTaskBefore))) {
|
|
||||||
console.log(`复制一份 ${fileTaskSample} 为 ${fileTaskBefore}`);
|
|
||||||
await fs.copyFile(fileTaskSample, fileTaskBefore);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(await fs.exists(fileTaskAfter))) {
|
|
||||||
console.log(`复制一份 ${fileTaskSample} 为 ${fileTaskAfter}`);
|
|
||||||
await fs.copyFile(fileTaskSample, fileTaskAfter);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(await fs.exists(fileExtraShell))) {
|
|
||||||
console.log(`复制一份 ${fileExtraSample} 为 ${fileExtraShell}`);
|
|
||||||
await fs.copyFile(fileExtraSample, fileExtraShell);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(await fs.exists(fileAuthUser))) {
|
|
||||||
console.log(`复制一份 ${fileAuthSample} 为 ${fileAuthUser}`);
|
|
||||||
await fs.copyFile(fileAuthSample, fileAuthUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(await fs.exists(fileNotifyPy))) {
|
|
||||||
console.log(`复制一份 ${fileNotifyPySample} 为 ${fileNotifyPy}`);
|
|
||||||
await fs.copyFile(fileNotifyPySample, fileNotifyPy);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(await fs.exists(fileNotifyJs))) {
|
|
||||||
console.log(`复制一份 ${fileNotifyJsSample} 为 ${fileNotifyJs}`);
|
|
||||||
await fs.copyFile(fileNotifyJsSample, fileNotifyJs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(await fs.exists(fileTestJs))) {
|
|
||||||
await fs.copyFile(fileTestJsSample, fileTestJs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(await fs.exists(fileTestPy))) {
|
|
||||||
await fs.copyFile(fileTestPySample, fileTestPy);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (await fs.exists('/etc/nginx/conf.d/default.conf')) {
|
|
||||||
console.log('检测到你可能未修改过默认nginx配置,将帮你删除');
|
|
||||||
await fs.unlink('/etc/nginx/conf.d/default.conf');
|
|
||||||
}
|
|
||||||
if (!(await fs.exists(depNotifyJs))) {
|
|
||||||
console.log(`复制一份 ${fileNotifyJsSample} 为 ${depNotifyJs}`);
|
|
||||||
await fs.copyFile(fileNotifyJsSample, depNotifyJs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(await fs.exists(depNotifyPy))) {
|
|
||||||
console.log(`复制一份 ${fileNotifyPySample} 为 ${depNotifyPy}`);
|
|
||||||
await fs.copyFile(fileNotifyPySample, depNotifyPy);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const npmInstallSub = async () => {
|
|
||||||
if (globalState.isTermux === 1) {
|
|
||||||
await $`npm install --production --no-bin-links`;
|
|
||||||
} else if (!(await $`command -v pnpm`)) {
|
|
||||||
await $`npm install --production`;
|
|
||||||
} else {
|
|
||||||
await $`pnpm install --loglevel error --production`;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const npmInstall = async (dirWork) => {
|
|
||||||
const dirCurrent = process.cwd();
|
|
||||||
|
|
||||||
await $`cd ${dirWork}`;
|
|
||||||
console.log(`安装 ${dirWork} 依赖包...`);
|
|
||||||
await npmInstallSub();
|
|
||||||
await $`cd ${dirCurrent}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const diffAndCopy = async (copySource, copyTo) => {
|
|
||||||
if (
|
|
||||||
!(await fs.exists(copyTo)) ||
|
|
||||||
(await $`diff ${copySource} ${copyTo}`).exitCode !== 0
|
|
||||||
) {
|
|
||||||
await fs.copyFile(copySource, copyTo);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const gitCloneScripts = async (url, dir, branch, proxy) => {
|
|
||||||
const partCmd = branch ? `-b ${branch}` : '';
|
|
||||||
console.log(`开始拉取仓库 ${globalState.uniqPath} 到 ${dir}`);
|
|
||||||
|
|
||||||
setProxy(proxy);
|
|
||||||
|
|
||||||
const res = await $`git clone -q --depth=1 ${partCmd} ${url} ${dir}`;
|
|
||||||
globalState.exitStatus = res.exitCode;
|
|
||||||
|
|
||||||
unsetProxy();
|
|
||||||
};
|
|
||||||
|
|
||||||
export const randomRange = (begin, end) => {
|
|
||||||
return Math.floor(Math.random() * (end - begin) + begin);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const deletePm2 = async () => {
|
|
||||||
await $`cd ${dirRoot}`;
|
|
||||||
await $`pm2 delete ecosystem.config.js`;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const reloadPm2 = async () => {
|
|
||||||
await $`cd ${dirRoot}`;
|
|
||||||
restoreEnvVars();
|
|
||||||
await $`pm2 flush &>/dev/null`;
|
|
||||||
await $`pm2 startOrGracefulReload ecosystem.config.js`;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const reloadUpdate = async () => {
|
|
||||||
await $`cd ${dirRoot}`;
|
|
||||||
restoreEnvVars();
|
|
||||||
await $`pm2 flush &>/dev/null`;
|
|
||||||
await $`pm2 startOrGracefulReload other.config.js`;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const diffTime = (beginTime, endTime) => {
|
|
||||||
let diffTime;
|
|
||||||
if (globalState.isMacos === 1) {
|
|
||||||
diffTime = (+new Date(endTime) - +new Date(beginTime)) / 1000;
|
|
||||||
} else {
|
|
||||||
diffTime =
|
|
||||||
(new Date(endTime).getTime() - new Date(beginTime).getTime()) / 1000;
|
|
||||||
}
|
|
||||||
return diffTime;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const formatTime = (time) => {
|
|
||||||
// 秒
|
|
||||||
return new Date(time).toLocaleString();
|
|
||||||
};
|
|
||||||
|
|
||||||
function pad(n, min = 10) {
|
|
||||||
return n < min ? '0' + n : n;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function formatDate(date) {
|
|
||||||
const year = date.getFullYear();
|
|
||||||
const month = pad(date.getMonth() + 1);
|
|
||||||
const day = pad(date.getDate());
|
|
||||||
const hour = pad(date.getHours());
|
|
||||||
const minute = pad(date.getMinutes());
|
|
||||||
const second = pad(date.getSeconds());
|
|
||||||
|
|
||||||
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const formatLogTime = (date) => {
|
|
||||||
const year = date.getFullYear();
|
|
||||||
const month = pad(date.getMonth() + 1);
|
|
||||||
const day = pad(date.getDate());
|
|
||||||
const hour = pad(date.getHours());
|
|
||||||
const minute = pad(date.getMinutes());
|
|
||||||
const second = pad(date.getSeconds());
|
|
||||||
const milliSecond = pad(date.getMilliseconds(), 100);
|
|
||||||
|
|
||||||
return `${year}-${month}-${day}-${hour}-${minute}-${second}-${milliSecond}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const formatTimestamp = (date) => {
|
|
||||||
return Math.floor(date.getTime() / 1000);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const patchVersion = async () => {
|
|
||||||
await $`git config --global pull.rebase false`;
|
|
||||||
|
|
||||||
if (await fs.exists(path.join(dirRoot, 'db/cookie.db'))) {
|
|
||||||
console.log('检测到旧的db文件,拷贝为新db...');
|
|
||||||
await $`mv ${path.join(dirRoot, 'db/cookie.db')} ${path.join(
|
|
||||||
dirRoot,
|
|
||||||
'db/env.db',
|
|
||||||
)}`;
|
|
||||||
await $`rm -rf ${path.join(dirRoot, 'db/cookie.db')}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (await fs.exists(path.join(dirRoot, 'db'))) {
|
|
||||||
console.log('检测到旧的db目录,拷贝到data目录...');
|
|
||||||
await $`cp -rf ${path.join(dirRoot, 'config')} ${dirData}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (await fs.exists(path.join(dirRoot, 'scripts'))) {
|
|
||||||
console.log('检测到旧的scripts目录,拷贝到data目录...');
|
|
||||||
await $`cp -rf ${path.join(dirRoot, 'scripts')} ${dirData}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (await fs.exists(path.join(dirRoot, 'log'))) {
|
|
||||||
console.log('检测到旧的log目录,拷贝到data目录...');
|
|
||||||
await $`cp -rf ${path.join(dirRoot, 'log')} ${dirData}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (await fs.exists(path.join(dirRoot, 'config'))) {
|
|
||||||
console.log('检测到旧的config目录,拷贝到data目录...');
|
|
||||||
await $`cp -rf ${path.join(dirRoot, 'config')} ${dirData}`;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const initNginx = async () => {
|
|
||||||
await fs.copyFile(nginxConf, '/etc/nginx/nginx.conf');
|
|
||||||
await fs.copyFile(nginxAppConf, '/etc/nginx/conf.d/front.conf');
|
|
||||||
let locationUrl = '/';
|
|
||||||
let aliasStr = '';
|
|
||||||
let rootStr = '';
|
|
||||||
let qlBaseUrl = globalState.qlBaseUrl;
|
|
||||||
let qlPort = globalState.qlPort;
|
|
||||||
if (qlBaseUrl !== '/') {
|
|
||||||
if (!qlBaseUrl.startsWith('/')) {
|
|
||||||
qlBaseUrl = `/${qlBaseUrl}`;
|
|
||||||
}
|
|
||||||
if (!qlBaseUrl.endsWith('/')) {
|
|
||||||
qlBaseUrl = `${qlBaseUrl}/`;
|
|
||||||
}
|
|
||||||
locationUrl = `^~${qlBaseUrl.slice(0, -1)}`;
|
|
||||||
aliasStr = `alias ${path.join(dirStatic, 'dist')};`;
|
|
||||||
const file = await fs.readFile(
|
|
||||||
path.join(dirStatic, 'dist/index.html'),
|
|
||||||
'utf8',
|
|
||||||
);
|
|
||||||
if (!file.includes(`<base href="${qlBaseUrl}">`)) {
|
|
||||||
await fs.writeFile(
|
|
||||||
path.join(dirStatic, 'dist/index.html'),
|
|
||||||
`<base href="${qlBaseUrl}">\n${file}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
rootStr = `root ${path.join(dirStatic, 'dist')};`;
|
|
||||||
}
|
|
||||||
await $`sed -i "s,QL_ALIAS_CONFIG,${aliasStr},g" /etc/nginx/conf.d/front.conf`;
|
|
||||||
await $`sed -i "s,QL_ROOT_CONFIG,${rootStr},g" /etc/nginx/conf.d/front.conf`;
|
|
||||||
await $`sed -i "s,QL_BASE_URL_LOCATION,${locationUrl},g" /etc/nginx/conf.d/front.conf`;
|
|
||||||
let ipv6Str = '';
|
|
||||||
const ipv6 = await $`ip a | grep inet6`;
|
|
||||||
if (ipv6.stdout.trim()) {
|
|
||||||
ipv6Str = 'listen [::]:${qlPort} ipv6only=on;';
|
|
||||||
}
|
|
||||||
const ipv4Str = `listen ${qlPort};`;
|
|
||||||
await $`sed -i "s,IPV6_CONFIG,${ipv6Str},g" /etc/nginx/conf.d/front.conf`;
|
|
||||||
await $`sed -i "s,IPV4_CONFIG,${ipv4Str},g" /etc/nginx/conf.d/front.conf`;
|
|
||||||
};
|
|
||||||
|
|
||||||
async function checkServer() {
|
|
||||||
const cpuWarn = parseInt(process.env.cpuWarn || '0');
|
|
||||||
const memWarn = parseInt(process.env.memWarn || '0');
|
|
||||||
const diskWarn = parseInt(process.env.diskWarn || '0');
|
|
||||||
|
|
||||||
if (cpuWarn && memWarn && diskWarn) {
|
|
||||||
const topResult = await $`top -b -n 1`;
|
|
||||||
const cpuUse = parseInt(
|
|
||||||
topResult.stdout.match(/CPU\s+(\d+)\%/)?.[1] || '0',
|
|
||||||
);
|
|
||||||
const memFree = parseInt(
|
|
||||||
(await $`free -m`).stdout.match(/Mem:\s+(\d+)/)?.[1] || '0',
|
|
||||||
);
|
|
||||||
const memTotal = parseInt(
|
|
||||||
(await $`free -m`).stdout.match(/Mem:\s+\d+\s+(\d+)/)?.[1] || '0',
|
|
||||||
);
|
|
||||||
const diskUse = parseInt(
|
|
||||||
(await $`df -P`).stdout.match(/\/dev.*\s+(\d+)\%/)?.[1] || '0',
|
|
||||||
);
|
|
||||||
if (memFree && memTotal && diskUse && cpuUse) {
|
|
||||||
const memUse = Math.floor((memFree * 100) / memTotal);
|
|
||||||
|
|
||||||
if (cpuUse > cpuWarn || memFree < memWarn || diskUse > diskWarn) {
|
|
||||||
const resource = topResult.stdout
|
|
||||||
.split('\n')
|
|
||||||
.slice(7, 17)
|
|
||||||
.map((line) => line.replace(/\s+/g, ' '))
|
|
||||||
.join('\\n');
|
|
||||||
await notifyApi(
|
|
||||||
'服务器资源异常警告',
|
|
||||||
`当前CPU占用 ${cpuUse}% 内存占用 ${memUse}% 磁盘占用 ${diskUse}% \n资源占用详情 \n\n ${resource}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const handleTaskStart = async () => {
|
|
||||||
if (globalState.ID) {
|
|
||||||
await updateCron(
|
|
||||||
[globalState.ID],
|
|
||||||
'0',
|
|
||||||
String(process.pid),
|
|
||||||
globalState.logPath,
|
|
||||||
globalState.beginTimestamp,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
console.log(`## 开始执行... ${globalState.beginTime}\n`);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const runTaskBefore = async () => {
|
|
||||||
if (globalState.isMacos === 0) {
|
|
||||||
await checkServer();
|
|
||||||
}
|
|
||||||
await $`. ${fileTaskBefore} "$@"`;
|
|
||||||
|
|
||||||
if (globalState.taskBefore) {
|
|
||||||
console.log('执行前置命令');
|
|
||||||
await $`eval ${globalState.taskBefore}`;
|
|
||||||
console.log('执行前置命令结束');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const runTaskAfter = async () => {
|
|
||||||
await $`. ${fileTaskAfter} "$@"`;
|
|
||||||
|
|
||||||
if (globalState.taskAfter) {
|
|
||||||
console.log('执行后置命令');
|
|
||||||
await $`eval "${globalState.taskAfter}"`;
|
|
||||||
console.log('执行后置命令结束');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handleTaskEnd = async () => {
|
|
||||||
const etime = new Date();
|
|
||||||
const endTime = formatDate(etime);
|
|
||||||
const endTimestamp = formatTimestamp(etime);
|
|
||||||
let diffTime = endTimestamp - globalState.beginTimestamp;
|
|
||||||
|
|
||||||
if (diffTime === 0) {
|
|
||||||
diffTime = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (globalState.ID) {
|
|
||||||
await updateCron(
|
|
||||||
[globalState.ID],
|
|
||||||
'1',
|
|
||||||
`${process.pid}`,
|
|
||||||
globalState.logPath,
|
|
||||||
globalState.beginTimestamp,
|
|
||||||
diffTime,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`\n## 执行结束... ${endTime} 耗时 ${diffTime} 秒`);
|
|
||||||
};
|
|
||||||
|
|
||||||
initEnv();
|
|
||||||
detectTermux();
|
|
||||||
detectMacos();
|
|
||||||
await importConfig();
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
#!/usr/bin/env zx
|
|
||||||
import 'zx/globals';
|
|
||||||
|
|
||||||
import { PassThrough } from 'node:stream';
|
|
||||||
import {
|
|
||||||
listCrontabUser,
|
|
||||||
formatLogTime,
|
|
||||||
formatTimestamp,
|
|
||||||
formatDate,
|
|
||||||
dirLog,
|
|
||||||
dirCli,
|
|
||||||
globalState,
|
|
||||||
handleTaskEnd,
|
|
||||||
} from './share.mjs';
|
|
||||||
import './api.mjs';
|
|
||||||
|
|
||||||
// $.verbose = true;
|
|
||||||
|
|
||||||
async function singleHandle() {}
|
|
||||||
|
|
||||||
const signals = ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGQUIT', 'SIGTSTP'];
|
|
||||||
signals.forEach((sig) => process.on(sig, singleHandle));
|
|
||||||
|
|
||||||
export async function handleLogPath(fileParam) {
|
|
||||||
let ID = $.env.ID;
|
|
||||||
if (!ID) {
|
|
||||||
const grepResult =
|
|
||||||
await $`grep -E "task.* ${fileParam}" ${listCrontabUser}`.nothrow();
|
|
||||||
ID = grepResult.stdout.match(/ID=(\d+)/)?.[1];
|
|
||||||
}
|
|
||||||
globalState.ID = ID;
|
|
||||||
|
|
||||||
const suffix = ID && parseInt(ID, 10) > 0 ? `_${ID}` : '';
|
|
||||||
globalState.time = new Date();
|
|
||||||
const logTime = formatLogTime(globalState.time);
|
|
||||||
let logDirTmp = path.basename(fileParam);
|
|
||||||
let logDirTmpPath = '';
|
|
||||||
|
|
||||||
if (fileParam.includes('/')) {
|
|
||||||
logDirTmpPath = path.isAbsolute(fileParam)
|
|
||||||
? fileParam.substring(1)
|
|
||||||
: fileParam;
|
|
||||||
logDirTmpPath = path.basename(path.dirname(logDirTmpPath));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (logDirTmpPath) {
|
|
||||||
logDirTmp = `${logDirTmpPath}_${logDirTmp}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const logDir = `${logDirTmp.replace(/\.[^/.]+$/, '')}${suffix}`;
|
|
||||||
globalState.logDir = logDir;
|
|
||||||
globalState.logPath = `${logDir}/${logTime}.log`;
|
|
||||||
if ($.env.real_log_path) {
|
|
||||||
globalState.logPath = realLogPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
await $`mkdir -p ${dirLog}/${logDir}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function initBeginTime() {
|
|
||||||
globalState.beginTime = formatDate(globalState.time);
|
|
||||||
globalState.beginTimestamp = formatTimestamp(globalState.time);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function main() {
|
|
||||||
const taskArgv = minimist(process.argv.slice(3), {
|
|
||||||
'--': true,
|
|
||||||
});
|
|
||||||
const {
|
|
||||||
_: [scriptFile],
|
|
||||||
} = taskArgv;
|
|
||||||
|
|
||||||
await handleLogPath(scriptFile);
|
|
||||||
initBeginTime();
|
|
||||||
|
|
||||||
cd(`${dirCli}`);
|
|
||||||
const logStream = fs.createWriteStream(`${dirLog}/${globalState.logPath}`);
|
|
||||||
const passThrough = new PassThrough();
|
|
||||||
passThrough.pipe(logStream);
|
|
||||||
const p = $`./otask.mjs ${process.argv.slice(
|
|
||||||
3,
|
|
||||||
)} --GlobalState=${JSON.stringify(globalState)} 2>&1`.nothrow();
|
|
||||||
p.stdout.pipe(passThrough).pipe(process.stdout);
|
|
||||||
await p;
|
|
||||||
}
|
|
||||||
|
|
||||||
main()
|
|
||||||
.then(() => {
|
|
||||||
process.exit(0);
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error(err);
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
@@ -3,7 +3,7 @@ COPY package.json .npmrc pnpm-lock.yaml /tmp/build/
|
|||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& apk update \
|
&& apk update \
|
||||||
&& apk add nodejs npm git \
|
&& apk add nodejs npm git \
|
||||||
&& npm i -g pnpm@8.3.1 pm2 tsx \
|
&& npm i -g pnpm@8.3.1 pm2 ts-node \
|
||||||
&& cd /tmp/build \
|
&& cd /tmp/build \
|
||||||
&& pnpm install --prod
|
&& pnpm install --prod
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ COPY package.json .npmrc pnpm-lock.yaml /tmp/build/
|
|||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& apk update \
|
&& apk update \
|
||||||
&& apk add nodejs npm git \
|
&& apk add nodejs npm git \
|
||||||
&& npm i -g pnpm@8.3.1 pm2 tsx \
|
&& npm i -g pnpm@8.3.1 pm2 ts-node \
|
||||||
&& cd /tmp/build \
|
&& cd /tmp/build \
|
||||||
&& pnpm install --prod
|
&& pnpm install --prod
|
||||||
|
|
||||||
|
|||||||
+2
-6
@@ -19,9 +19,6 @@
|
|||||||
"test": "umi-test",
|
"test": "umi-test",
|
||||||
"test:coverage": "umi-test --coverage"
|
"test:coverage": "umi-test --coverage"
|
||||||
},
|
},
|
||||||
"bin": {
|
|
||||||
"task": "./cli/task.mjs"
|
|
||||||
},
|
|
||||||
"gitHooks": {
|
"gitHooks": {
|
||||||
"pre-commit": "lint-staged"
|
"pre-commit": "lint-staged"
|
||||||
},
|
},
|
||||||
@@ -100,7 +97,7 @@
|
|||||||
"uuid": "^8.3.2",
|
"uuid": "^8.3.2",
|
||||||
"winston": "^3.6.0",
|
"winston": "^3.6.0",
|
||||||
"winston-daily-rotate-file": "^4.7.1",
|
"winston-daily-rotate-file": "^4.7.1",
|
||||||
"zx": "^8.1.4",
|
"yargs": "^17.3.1",
|
||||||
"tough-cookie": "^4.0.0",
|
"tough-cookie": "^4.0.0",
|
||||||
"request-ip": "3.3.0",
|
"request-ip": "3.3.0",
|
||||||
"ip2region": "2.3.0"
|
"ip2region": "2.3.0"
|
||||||
@@ -166,10 +163,9 @@
|
|||||||
"react-intl-universal": "^2.6.21",
|
"react-intl-universal": "^2.6.21",
|
||||||
"react-split-pane": "^0.1.92",
|
"react-split-pane": "^0.1.92",
|
||||||
"sockjs-client": "^1.6.0",
|
"sockjs-client": "^1.6.0",
|
||||||
"ts-node": "^10.6.0",
|
"ts-node": "^10.9.2",
|
||||||
"ts-proto": "^1.146.0",
|
"ts-proto": "^1.146.0",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.0",
|
||||||
"tsx": "^4.7.3",
|
|
||||||
"typescript": "5.2.2",
|
"typescript": "5.2.2",
|
||||||
"vh-check": "^2.0.5",
|
"vh-check": "^2.0.5",
|
||||||
"virtualizedtableforantd4": "1.3.0",
|
"virtualizedtableforantd4": "1.3.0",
|
||||||
|
|||||||
Generated
+7
-299
@@ -134,9 +134,9 @@ dependencies:
|
|||||||
winston-daily-rotate-file:
|
winston-daily-rotate-file:
|
||||||
specifier: ^4.7.1
|
specifier: ^4.7.1
|
||||||
version: 4.7.1(winston@3.9.0)
|
version: 4.7.1(winston@3.9.0)
|
||||||
zx:
|
yargs:
|
||||||
specifier: ^8.1.4
|
specifier: ^17.3.1
|
||||||
version: 8.1.4
|
version: 17.7.2
|
||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@ant-design/icons':
|
'@ant-design/icons':
|
||||||
@@ -320,17 +320,14 @@ devDependencies:
|
|||||||
specifier: ^1.6.0
|
specifier: ^1.6.0
|
||||||
version: 1.6.1
|
version: 1.6.1
|
||||||
ts-node:
|
ts-node:
|
||||||
specifier: ^10.6.0
|
specifier: ^10.9.2
|
||||||
version: 10.9.1(@types/node@17.0.45)(typescript@5.2.2)
|
version: 10.9.2(@types/node@17.0.45)(typescript@5.2.2)
|
||||||
ts-proto:
|
ts-proto:
|
||||||
specifier: ^1.146.0
|
specifier: ^1.146.0
|
||||||
version: 1.148.2
|
version: 1.148.2
|
||||||
tslib:
|
tslib:
|
||||||
specifier: ^2.4.0
|
specifier: ^2.4.0
|
||||||
version: 2.5.3
|
version: 2.5.3
|
||||||
tsx:
|
|
||||||
specifier: ^4.7.3
|
|
||||||
version: 4.7.3
|
|
||||||
typescript:
|
typescript:
|
||||||
specifier: 5.2.2
|
specifier: 5.2.2
|
||||||
version: 5.2.2
|
version: 5.2.2
|
||||||
@@ -3399,15 +3396,6 @@ packages:
|
|||||||
get-tsconfig: 4.7.3
|
get-tsconfig: 4.7.3
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@esbuild/aix-ppc64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [ppc64]
|
|
||||||
os: [aix]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/android-arm64@0.17.19:
|
/@esbuild/android-arm64@0.17.19:
|
||||||
resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==}
|
resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3417,15 +3405,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/android-arm64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [android]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/android-arm@0.17.19:
|
/@esbuild/android-arm@0.17.19:
|
||||||
resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==}
|
resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3435,15 +3414,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/android-arm@0.19.12:
|
|
||||||
resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [arm]
|
|
||||||
os: [android]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/android-x64@0.17.19:
|
/@esbuild/android-x64@0.17.19:
|
||||||
resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==}
|
resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3453,15 +3423,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/android-x64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [android]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/darwin-arm64@0.17.19:
|
/@esbuild/darwin-arm64@0.17.19:
|
||||||
resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==}
|
resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3471,15 +3432,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/darwin-arm64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [darwin]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/darwin-x64@0.17.19:
|
/@esbuild/darwin-x64@0.17.19:
|
||||||
resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==}
|
resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3489,15 +3441,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/darwin-x64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [darwin]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/freebsd-arm64@0.17.19:
|
/@esbuild/freebsd-arm64@0.17.19:
|
||||||
resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==}
|
resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3507,15 +3450,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/freebsd-arm64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [freebsd]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/freebsd-x64@0.17.19:
|
/@esbuild/freebsd-x64@0.17.19:
|
||||||
resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==}
|
resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3525,15 +3459,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/freebsd-x64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [freebsd]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/linux-arm64@0.17.19:
|
/@esbuild/linux-arm64@0.17.19:
|
||||||
resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==}
|
resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3543,15 +3468,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-arm64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/linux-arm@0.17.19:
|
/@esbuild/linux-arm@0.17.19:
|
||||||
resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==}
|
resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3561,15 +3477,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-arm@0.19.12:
|
|
||||||
resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [arm]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/linux-ia32@0.17.19:
|
/@esbuild/linux-ia32@0.17.19:
|
||||||
resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==}
|
resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3579,15 +3486,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-ia32@0.19.12:
|
|
||||||
resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [ia32]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/linux-loong64@0.17.19:
|
/@esbuild/linux-loong64@0.17.19:
|
||||||
resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==}
|
resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3597,15 +3495,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-loong64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [loong64]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/linux-mips64el@0.17.19:
|
/@esbuild/linux-mips64el@0.17.19:
|
||||||
resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==}
|
resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3615,15 +3504,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-mips64el@0.19.12:
|
|
||||||
resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [mips64el]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/linux-ppc64@0.17.19:
|
/@esbuild/linux-ppc64@0.17.19:
|
||||||
resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==}
|
resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3633,15 +3513,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-ppc64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [ppc64]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/linux-riscv64@0.17.19:
|
/@esbuild/linux-riscv64@0.17.19:
|
||||||
resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==}
|
resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3651,15 +3522,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-riscv64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [riscv64]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/linux-s390x@0.17.19:
|
/@esbuild/linux-s390x@0.17.19:
|
||||||
resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==}
|
resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3669,15 +3531,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-s390x@0.19.12:
|
|
||||||
resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [s390x]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/linux-x64@0.17.19:
|
/@esbuild/linux-x64@0.17.19:
|
||||||
resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==}
|
resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3687,15 +3540,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-x64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/netbsd-x64@0.17.19:
|
/@esbuild/netbsd-x64@0.17.19:
|
||||||
resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==}
|
resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3705,15 +3549,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/netbsd-x64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [netbsd]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/openbsd-x64@0.17.19:
|
/@esbuild/openbsd-x64@0.17.19:
|
||||||
resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==}
|
resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3723,15 +3558,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/openbsd-x64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [openbsd]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/sunos-x64@0.17.19:
|
/@esbuild/sunos-x64@0.17.19:
|
||||||
resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==}
|
resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3741,15 +3567,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/sunos-x64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [sunos]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/win32-arm64@0.17.19:
|
/@esbuild/win32-arm64@0.17.19:
|
||||||
resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==}
|
resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3759,15 +3576,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/win32-arm64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [win32]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/win32-ia32@0.17.19:
|
/@esbuild/win32-ia32@0.17.19:
|
||||||
resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==}
|
resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3777,15 +3585,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/win32-ia32@0.19.12:
|
|
||||||
resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [ia32]
|
|
||||||
os: [win32]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@esbuild/win32-x64@0.17.19:
|
/@esbuild/win32-x64@0.17.19:
|
||||||
resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==}
|
resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -3795,15 +3594,6 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@esbuild/win32-x64@0.19.12:
|
|
||||||
resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [win32]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@eslint-community/eslint-utils@4.4.0(eslint@8.35.0):
|
/@eslint-community/eslint-utils@4.4.0(eslint@8.35.0):
|
||||||
resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
|
resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
@@ -5114,15 +4904,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-xbqnZmGrCEqi/KUzOkeUSe77p7APvLuyellGaAoeww3CHJ1AbjQWjPSCFtKIzZn8L7LpEax4NXnC+gfa6nM7IA==}
|
resolution: {integrity: sha512-xbqnZmGrCEqi/KUzOkeUSe77p7APvLuyellGaAoeww3CHJ1AbjQWjPSCFtKIzZn8L7LpEax4NXnC+gfa6nM7IA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/fs-extra@11.0.4:
|
|
||||||
resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==}
|
|
||||||
requiresBuild: true
|
|
||||||
dependencies:
|
|
||||||
'@types/jsonfile': 6.1.4
|
|
||||||
'@types/node': 17.0.45
|
|
||||||
dev: false
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@types/graceful-fs@4.1.6:
|
/@types/graceful-fs@4.1.6:
|
||||||
resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==}
|
resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -5186,14 +4967,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==}
|
resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/jsonfile@6.1.4:
|
|
||||||
resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==}
|
|
||||||
requiresBuild: true
|
|
||||||
dependencies:
|
|
||||||
'@types/node': 17.0.45
|
|
||||||
dev: false
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@types/jsonwebtoken@8.5.9:
|
/@types/jsonwebtoken@8.5.9:
|
||||||
resolution: {integrity: sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==}
|
resolution: {integrity: sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -5248,14 +5021,6 @@ packages:
|
|||||||
/@types/node@17.0.45:
|
/@types/node@17.0.45:
|
||||||
resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==}
|
resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==}
|
||||||
|
|
||||||
/@types/node@20.14.9:
|
|
||||||
resolution: {integrity: sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==}
|
|
||||||
requiresBuild: true
|
|
||||||
dependencies:
|
|
||||||
undici-types: 5.26.5
|
|
||||||
dev: false
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@types/nodemailer@6.4.8:
|
/@types/nodemailer@6.4.8:
|
||||||
resolution: {integrity: sha512-oVsJSCkqViCn8/pEu2hfjwVO+Gb3e+eTWjg3PcjeFKRItfKpKwHphQqbYmPQrlMk+op7pNNWPbsJIEthpFN/OQ==}
|
resolution: {integrity: sha512-oVsJSCkqViCn8/pEu2hfjwVO+Gb3e+eTWjg3PcjeFKRItfKpKwHphQqbYmPQrlMk+op7pNNWPbsJIEthpFN/OQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -8675,37 +8440,6 @@ packages:
|
|||||||
'@esbuild/win32-x64': 0.17.19
|
'@esbuild/win32-x64': 0.17.19
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/esbuild@0.19.12:
|
|
||||||
resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==}
|
|
||||||
engines: {node: '>=12'}
|
|
||||||
hasBin: true
|
|
||||||
requiresBuild: true
|
|
||||||
optionalDependencies:
|
|
||||||
'@esbuild/aix-ppc64': 0.19.12
|
|
||||||
'@esbuild/android-arm': 0.19.12
|
|
||||||
'@esbuild/android-arm64': 0.19.12
|
|
||||||
'@esbuild/android-x64': 0.19.12
|
|
||||||
'@esbuild/darwin-arm64': 0.19.12
|
|
||||||
'@esbuild/darwin-x64': 0.19.12
|
|
||||||
'@esbuild/freebsd-arm64': 0.19.12
|
|
||||||
'@esbuild/freebsd-x64': 0.19.12
|
|
||||||
'@esbuild/linux-arm': 0.19.12
|
|
||||||
'@esbuild/linux-arm64': 0.19.12
|
|
||||||
'@esbuild/linux-ia32': 0.19.12
|
|
||||||
'@esbuild/linux-loong64': 0.19.12
|
|
||||||
'@esbuild/linux-mips64el': 0.19.12
|
|
||||||
'@esbuild/linux-ppc64': 0.19.12
|
|
||||||
'@esbuild/linux-riscv64': 0.19.12
|
|
||||||
'@esbuild/linux-s390x': 0.19.12
|
|
||||||
'@esbuild/linux-x64': 0.19.12
|
|
||||||
'@esbuild/netbsd-x64': 0.19.12
|
|
||||||
'@esbuild/openbsd-x64': 0.19.12
|
|
||||||
'@esbuild/sunos-x64': 0.19.12
|
|
||||||
'@esbuild/win32-arm64': 0.19.12
|
|
||||||
'@esbuild/win32-ia32': 0.19.12
|
|
||||||
'@esbuild/win32-x64': 0.19.12
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/escalade@3.1.1:
|
/escalade@3.1.1:
|
||||||
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
|
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
@@ -15742,8 +15476,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==}
|
resolution: {integrity: sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/ts-node@10.9.1(@types/node@17.0.45)(typescript@5.2.2):
|
/ts-node@10.9.2(@types/node@17.0.45)(typescript@5.2.2):
|
||||||
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
|
resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@swc/core': '>=1.2.50'
|
'@swc/core': '>=1.2.50'
|
||||||
@@ -15831,17 +15565,6 @@ packages:
|
|||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/tsx@4.7.3:
|
|
||||||
resolution: {integrity: sha512-+fQnMqIp/jxZEXLcj6WzYy9FhcS5/Dfk8y4AtzJ6ejKcKqmfTF8Gso/jtrzDggCF2zTU20gJa6n8XqPYwDAUYQ==}
|
|
||||||
engines: {node: '>=18.0.0'}
|
|
||||||
hasBin: true
|
|
||||||
dependencies:
|
|
||||||
esbuild: 0.19.12
|
|
||||||
get-tsconfig: 4.7.3
|
|
||||||
optionalDependencies:
|
|
||||||
fsevents: 2.3.3
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/tty-browserify@0.0.0:
|
/tty-browserify@0.0.0:
|
||||||
resolution: {integrity: sha512-JVa5ijo+j/sOoHGjw0sxw734b1LhBkQ3bvUGNdxnVXDCX81Yx7TFgnZygxrIIWn23hbfTaMYLwRmAxFyDuFmIw==}
|
resolution: {integrity: sha512-JVa5ijo+j/sOoHGjw0sxw734b1LhBkQ3bvUGNdxnVXDCX81Yx7TFgnZygxrIIWn23hbfTaMYLwRmAxFyDuFmIw==}
|
||||||
dev: true
|
dev: true
|
||||||
@@ -16013,12 +15736,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-ZqGrAgaqqZM7LGRzNjLnw5elevWb5M8LEoDMadxIW3OWbcv72wMMgKdwOKpd5Fqxe8choLD8HN3iSj3TUh/giQ==}
|
resolution: {integrity: sha512-ZqGrAgaqqZM7LGRzNjLnw5elevWb5M8LEoDMadxIW3OWbcv72wMMgKdwOKpd5Fqxe8choLD8HN3iSj3TUh/giQ==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/undici-types@5.26.5:
|
|
||||||
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
|
|
||||||
requiresBuild: true
|
|
||||||
dev: false
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/unescape@1.0.1:
|
/unescape@1.0.1:
|
||||||
resolution: {integrity: sha512-O0+af1Gs50lyH1nUu3ZyYS1cRh01Q/kUKatTOkSs7jukXE6/NebucDVxyiDsA9AQ4JC1V1jUH9EO8JX2nMDgGQ==}
|
resolution: {integrity: sha512-O0+af1Gs50lyH1nUu3ZyYS1cRh01Q/kUKatTOkSs7jukXE6/NebucDVxyiDsA9AQ4JC1V1jUH9EO8JX2nMDgGQ==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
@@ -16681,15 +16398,6 @@ packages:
|
|||||||
strip-indent: 2.0.0
|
strip-indent: 2.0.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/zx@8.1.4:
|
|
||||||
resolution: {integrity: sha512-QFDYYpnzdpRiJ3dL2102Cw26FpXpWshW4QLTGxiYfIcwdAqg084jRCkK/kuP/NOSkxOjydRwNFG81qzA5r1a6w==}
|
|
||||||
engines: {node: '>= 12.17.0'}
|
|
||||||
hasBin: true
|
|
||||||
optionalDependencies:
|
|
||||||
'@types/fs-extra': 11.0.4
|
|
||||||
'@types/node': 20.14.9
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
github.com/whyour/node-sqlite3/3a00af0b5d7603b7f1b290032507320b18a6b741:
|
github.com/whyour/node-sqlite3/3a00af0b5d7603b7f1b290032507320b18a6b741:
|
||||||
resolution: {tarball: https://codeload.github.com/whyour/node-sqlite3/tar.gz/3a00af0b5d7603b7f1b290032507320b18a6b741}
|
resolution: {tarball: https://codeload.github.com/whyour/node-sqlite3/tar.gz/3a00af0b5d7603b7f1b290032507320b18a6b741}
|
||||||
name: '@whyour/sqlite3'
|
name: '@whyour/sqlite3'
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ AutoAddCron="true"
|
|||||||
DefaultCronRule=""
|
DefaultCronRule=""
|
||||||
|
|
||||||
## ql repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可
|
## ql repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可
|
||||||
RepoFileExtensions="js py"
|
RepoFileExtensions="js mjs py pyc"
|
||||||
|
|
||||||
## 代理地址,支持HTTP/SOCK5,例如 http://127.0.0.1:7890
|
## 代理地址,支持HTTP/SOCK5,例如 http://127.0.0.1:7890
|
||||||
ProxyUrl=""
|
ProxyUrl=""
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
create_token() {
|
create_token() {
|
||||||
local token_command="tsx ${dir_root}/back/token.ts"
|
local token_command="ts-node-transpile-only ${dir_root}/back/token.ts"
|
||||||
local token_file="${dir_root}/static/build/token.js"
|
local token_file="${dir_root}/static/build/token.js"
|
||||||
if [[ -f $token_file ]]; then
|
if [[ -f $token_file ]]; then
|
||||||
token_command="node ${token_file}"
|
token_command="node ${token_file}"
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ check_pm2() {
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
echo -e "=====> 开始检测"
|
echo -e "=====> 开始检测"
|
||||||
npm i -g pnpm@8.3.1 pm2 tsx
|
npm i -g pnpm@8.3.1 pm2 ts-node
|
||||||
patch_version
|
patch_version
|
||||||
|
|
||||||
reset_env
|
reset_env
|
||||||
|
|||||||
+80
-45
@@ -87,8 +87,17 @@ check_server() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
env_str_to_array() {
|
env_str_to_array() {
|
||||||
|
. $file_env
|
||||||
local IFS="&"
|
local IFS="&"
|
||||||
read -ra array <<<"${!env_param}"
|
read -ra array <<<"${!env_param}"
|
||||||
|
array_length=${#array[@]}
|
||||||
|
clear_env
|
||||||
|
}
|
||||||
|
|
||||||
|
clear_non_sh_env() {
|
||||||
|
if [[ $file_param != *.sh ]]; then
|
||||||
|
clear_env
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
## 正常运行单个脚本,$1:传入参数
|
## 正常运行单个脚本,$1:传入参数
|
||||||
@@ -105,37 +114,34 @@ run_normal() {
|
|||||||
file_param=${file_param/$relative_path\//}
|
file_param=${file_param/$relative_path\//}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$timeoutCmd $which_program $file_param "${script_params[@]}"
|
if [[ $isJsOrPythonFile == 'false' ]]; then
|
||||||
|
clear_non_sh_env
|
||||||
|
fi
|
||||||
|
configDir="${dir_config}" $timeoutCmd $which_program $file_param "${script_params[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_env_split() {
|
||||||
|
if [[ ! $num_param ]]; then
|
||||||
|
num_param="1-max"
|
||||||
|
fi
|
||||||
|
|
||||||
|
env_str_to_array
|
||||||
|
local tempArr=$(echo $num_param | sed "s/-max/-${array_length}/g" | sed "s/max-/${array_length}-/g" | perl -pe "s|(\d+)(-\|~\|_)(\d+)|{\1..\3}|g")
|
||||||
|
local runArr=($(eval echo $tempArr))
|
||||||
|
array_run=($(awk -v RS=' ' '!a[$1]++' <<<${runArr[@]}))
|
||||||
}
|
}
|
||||||
|
|
||||||
## 并发执行时,设定的 RandomDelay 不会生效,即所有任务立即执行
|
## 并发执行时,设定的 RandomDelay 不会生效,即所有任务立即执行
|
||||||
run_concurrent() {
|
run_concurrent() {
|
||||||
local file_param="$1"
|
local file_param="$1"
|
||||||
local env_param="$2"
|
local env_param="$2"
|
||||||
local num_param=$(echo "$3" | perl -pe "s|.*$2(.*)|\1|")
|
local num_param=$(echo "$3" | perl -pe "s|.*$2(.*)|\1|" | awk '{$1=$1};1')
|
||||||
if [[ ! $env_param ]]; then
|
if [[ ! $env_param ]]; then
|
||||||
echo -e "\n 缺少并发运行的环境变量参数"
|
echo -e "\n 缺少并发运行的环境变量参数"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
env_str_to_array
|
handle_env_split
|
||||||
local tempArr=$(echo $num_param | sed "s/-max/-${#array[@]}/g" | sed "s/max-/${#array[@]}-/g" | perl -pe "s|(\d+)(-\|~\|_)(\d+)|{\1..\3}|g")
|
|
||||||
local runArr=($(eval echo $tempArr))
|
|
||||||
runArr=($(awk -v RS=' ' '!a[$1]++' <<<${runArr[@]}))
|
|
||||||
|
|
||||||
local n=0
|
|
||||||
for i in ${runArr[@]}; do
|
|
||||||
array_run[n]=${array[$i - 1]}
|
|
||||||
let n++
|
|
||||||
done
|
|
||||||
|
|
||||||
local cookieStr=$(
|
|
||||||
IFS="&"
|
|
||||||
echo "${array_run[*]}"
|
|
||||||
)
|
|
||||||
[[ ! -z $cookieStr ]] && export "${env_param}=${cookieStr}"
|
|
||||||
|
|
||||||
env_str_to_array
|
|
||||||
single_log_time=$(date "+%Y-%m-%d-%H-%M-%S.%3N")
|
single_log_time=$(date "+%Y-%m-%d-%H-%M-%S.%3N")
|
||||||
|
|
||||||
cd $dir_scripts
|
cd $dir_scripts
|
||||||
@@ -144,15 +150,24 @@ run_concurrent() {
|
|||||||
cd ${relative_path}
|
cd ${relative_path}
|
||||||
file_param=${file_param/$relative_path\//}
|
file_param=${file_param/$relative_path\//}
|
||||||
fi
|
fi
|
||||||
for i in "${!array[@]}"; do
|
|
||||||
export "${env_param}=${array[i]}"
|
local j=0
|
||||||
single_log_path="$dir_log/$log_dir/${single_log_time}_$((i + 1)).log"
|
for i in ${array_run[@]}; do
|
||||||
eval $timeoutCmd $which_program $file_param "${script_params[@]}" &>$single_log_path &
|
single_log_path="$dir_log/$log_dir/${single_log_time}_$((j + 1)).log"
|
||||||
|
let j++
|
||||||
|
|
||||||
|
if [[ $isJsOrPythonFile == 'false' ]]; then
|
||||||
|
export "${env_param}=${array[$i - 1]}"
|
||||||
|
clear_non_sh_env
|
||||||
|
fi
|
||||||
|
eval configDir="${dir_config}" envParam="${env_param}" numParam="${i}" $timeoutCmd $which_program $file_param "${script_params[@]}" &>$single_log_path &
|
||||||
done
|
done
|
||||||
|
|
||||||
wait
|
wait
|
||||||
for i in "${!array[@]}"; do
|
local k=0
|
||||||
single_log_path="$dir_log/$log_dir/${single_log_time}_$((i + 1)).log"
|
for i in ${array_run[@]}; do
|
||||||
|
single_log_path="$dir_log/$log_dir/${single_log_time}_$((k + 1)).log"
|
||||||
|
let k++
|
||||||
cat $single_log_path
|
cat $single_log_path
|
||||||
[[ -f $single_log_path ]] && rm -f $single_log_path
|
[[ -f $single_log_path ]] && rm -f $single_log_path
|
||||||
done
|
done
|
||||||
@@ -161,28 +176,27 @@ run_concurrent() {
|
|||||||
run_designated() {
|
run_designated() {
|
||||||
local file_param="$1"
|
local file_param="$1"
|
||||||
local env_param="$2"
|
local env_param="$2"
|
||||||
local num_param=$(echo "$3" | perl -pe "s|.*$2(.*)|\1|")
|
local num_param=$(echo "$3" | perl -pe "s|.*$2(.*)|\1|" | awk '{$1=$1};1')
|
||||||
if [[ ! $env_param ]] || [[ ! $num_param ]]; then
|
if [[ ! $env_param ]]; then
|
||||||
echo -e "\n 缺少单独运行的参数 task xxx.js desi Test 1 3"
|
echo -e "\n 缺少单独运行的参数 task xxx.js desi Test"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
env_str_to_array
|
handle_env_split
|
||||||
local tempArr=$(echo $num_param | sed "s/-max/-${#array[@]}/g" | sed "s/max-/${#array[@]}-/g" | perl -pe "s|(\d+)(-\|~\|_)(\d+)|{\1..\3}|g")
|
|
||||||
local runArr=($(eval echo $tempArr))
|
|
||||||
runArr=($(awk -v RS=' ' '!a[$1]++' <<<${runArr[@]}))
|
|
||||||
|
|
||||||
local n=0
|
if [[ $isJsOrPythonFile == 'false' ]]; then
|
||||||
for i in ${runArr[@]}; do
|
local n=0
|
||||||
array_run[n]=${array[$i - 1]}
|
for i in ${array_run[@]}; do
|
||||||
let n++
|
array_str[n]=${array[$i - 1]}
|
||||||
done
|
let n++
|
||||||
|
done
|
||||||
local cookieStr=$(
|
local envStr=$(
|
||||||
IFS="&"
|
IFS="&"
|
||||||
echo "${array_run[*]}"
|
echo "${array_str[*]}"
|
||||||
)
|
)
|
||||||
[[ ! -z $cookieStr ]] && export "${env_param}=${cookieStr}"
|
[[ ! -z $envStr ]] && export "${env_param}=${envStr}"
|
||||||
|
clear_non_sh_env
|
||||||
|
fi
|
||||||
|
|
||||||
cd $dir_scripts
|
cd $dir_scripts
|
||||||
local relative_path="${file_param%/*}"
|
local relative_path="${file_param%/*}"
|
||||||
@@ -190,7 +204,8 @@ run_designated() {
|
|||||||
cd ${relative_path}
|
cd ${relative_path}
|
||||||
file_param=${file_param/$relative_path\//}
|
file_param=${file_param/$relative_path\//}
|
||||||
fi
|
fi
|
||||||
$timeoutCmd $which_program $file_param "${script_params[@]}"
|
|
||||||
|
configDir="${dir_config}" envParam="${env_param}" numParam="${num_param}" $timeoutCmd $which_program $file_param "${script_params[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
## 运行其他命令
|
## 运行其他命令
|
||||||
@@ -206,12 +221,31 @@ run_else() {
|
|||||||
|
|
||||||
shift
|
shift
|
||||||
|
|
||||||
|
clear_non_sh_env
|
||||||
$timeoutCmd $which_program $file_param "$@"
|
$timeoutCmd $which_program $file_param "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
## 命令检测
|
## 命令检测
|
||||||
main() {
|
main() {
|
||||||
|
isJsOrPythonFile="false"
|
||||||
|
if [[ $1 == *.js ]] || [[ $1 == *.py ]] || [[ $1 == *.pyc ]] || [[ $1 == *.ts ]]; then
|
||||||
|
isJsOrPythonFile="true"
|
||||||
|
fi
|
||||||
|
if [[ -f $file_env ]]; then
|
||||||
|
get_env_array
|
||||||
|
if [[ $isJsOrPythonFile == 'true' ]]; then
|
||||||
|
export NODE_OPTIONS="${NODE_OPTIONS} -r ${preload_js_file}"
|
||||||
|
export PYTHONPATH="${PYTHONPATH}:${dir_preload}"
|
||||||
|
else
|
||||||
|
. $file_env
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $1 == *.js ]] || [[ $1 == *.py ]] || [[ $1 == *.pyc ]] || [[ $1 == *.sh ]] || [[ $1 == *.ts ]]; then
|
if [[ $1 == *.js ]] || [[ $1 == *.py ]] || [[ $1 == *.pyc ]] || [[ $1 == *.sh ]] || [[ $1 == *.ts ]]; then
|
||||||
|
if [[ $1 == *.sh ]]; then
|
||||||
|
timeoutCmd=""
|
||||||
|
fi
|
||||||
|
|
||||||
case $# in
|
case $# in
|
||||||
1)
|
1)
|
||||||
run_normal "$1"
|
run_normal "$1"
|
||||||
@@ -245,4 +279,5 @@ handle_task_start "${task_shell_params[@]}"
|
|||||||
run_task_before "${task_shell_params[@]}"
|
run_task_before "${task_shell_params[@]}"
|
||||||
main "${task_shell_params[@]}"
|
main "${task_shell_params[@]}"
|
||||||
run_task_after "${task_shell_params[@]}"
|
run_task_after "${task_shell_params[@]}"
|
||||||
|
clear_env
|
||||||
handle_task_end "${task_shell_params[@]}"
|
handle_task_end "${task_shell_params[@]}"
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
require(`./env.js`);
|
||||||
|
|
||||||
|
function expandRange(rangeStr, max) {
|
||||||
|
const tempRangeStr = rangeStr
|
||||||
|
.trim()
|
||||||
|
.replace(/-max/g, `-${max}`)
|
||||||
|
.replace(/max-/g, `${max}-`);
|
||||||
|
|
||||||
|
return tempRangeStr.split(' ').flatMap((part) => {
|
||||||
|
const rangeMatch = part.match(/^(\d+)([-~_])(\d+)$/);
|
||||||
|
if (rangeMatch) {
|
||||||
|
const [, start, , end] = rangeMatch.map(Number);
|
||||||
|
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
||||||
|
}
|
||||||
|
return Number(part);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function run() {
|
||||||
|
if (process.env.envParam && process.env.numParam) {
|
||||||
|
const { envParam, numParam } = process.env;
|
||||||
|
const array = (process.env[envParam] || '').split('&');
|
||||||
|
const runArr = expandRange(numParam, array.length);
|
||||||
|
const arrayRun = runArr.map((i) => array[i - 1]);
|
||||||
|
const envStr = arrayRun.join('&');
|
||||||
|
process.env[envParam] = envStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
run();
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import os
|
||||||
|
import re
|
||||||
|
import env
|
||||||
|
|
||||||
|
|
||||||
|
def try_parse_int(value):
|
||||||
|
try:
|
||||||
|
return int(value)
|
||||||
|
except ValueError:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def expand_range(range_str, max_value):
|
||||||
|
temp_range_str = (
|
||||||
|
range_str.strip()
|
||||||
|
.replace("-max", f"-{max_value}")
|
||||||
|
.replace("max-", f"{max_value}-")
|
||||||
|
)
|
||||||
|
|
||||||
|
result = []
|
||||||
|
for part in temp_range_str.split(" "):
|
||||||
|
range_match = re.match(r"^(\d+)([-~_])(\d+)$", part)
|
||||||
|
if range_match:
|
||||||
|
start, _, end = map(try_parse_int, range_match.groups())
|
||||||
|
result.extend(range(start, end + 1))
|
||||||
|
else:
|
||||||
|
result.append(int(part))
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def run():
|
||||||
|
env_param = os.getenv("envParam")
|
||||||
|
num_param = os.getenv("numParam")
|
||||||
|
|
||||||
|
if env_param and num_param:
|
||||||
|
array = (os.getenv(env_param) or "").split("&")
|
||||||
|
run_arr = expand_range(num_param, len(array))
|
||||||
|
array_run = [array[i - 1] for i in run_arr if i - 1 < len(array) and i > 0]
|
||||||
|
env_str = "&".join(array_run)
|
||||||
|
os.environ[env_param] = env_str
|
||||||
|
|
||||||
|
|
||||||
|
run()
|
||||||
+1
-1
@@ -11,7 +11,7 @@ echo -e "提交master代码"
|
|||||||
git push
|
git push
|
||||||
|
|
||||||
echo -e "更新cdn文件"
|
echo -e "更新cdn文件"
|
||||||
tsx sample/tool.ts
|
ts-node-transpile-only sample/tool.ts
|
||||||
|
|
||||||
string=$(cat version.yaml | grep "version" | egrep "[^ ]*" -o | egrep "\d\.*")
|
string=$(cat version.yaml | grep "version" | egrep "[^ ]*" -o | egrep "\d\.*")
|
||||||
version="v$string"
|
version="v$string"
|
||||||
|
|||||||
+43
-6
@@ -10,6 +10,7 @@ if [[ $QL_DATA_DIR ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
dir_shell=$dir_root/shell
|
dir_shell=$dir_root/shell
|
||||||
|
dir_preload=$dir_shell/preload
|
||||||
dir_sample=$dir_root/sample
|
dir_sample=$dir_root/sample
|
||||||
dir_static=$dir_root/static
|
dir_static=$dir_root/static
|
||||||
dir_config=$dir_data/config
|
dir_config=$dir_data/config
|
||||||
@@ -25,7 +26,10 @@ ql_static_repo=$dir_repo/static
|
|||||||
|
|
||||||
## 文件
|
## 文件
|
||||||
file_config_sample=$dir_sample/config.sample.sh
|
file_config_sample=$dir_sample/config.sample.sh
|
||||||
file_env=$dir_config/env.sh
|
file_env=$dir_preload/env.sh
|
||||||
|
js_file_env=$dir_preload/env.js
|
||||||
|
py_file_env=$dir_preload/env.py
|
||||||
|
preload_js_file=$dir_preload/sitecustomize.js
|
||||||
file_sharecode=$dir_config/sharecode.sh
|
file_sharecode=$dir_config/sharecode.sh
|
||||||
file_config_user=$dir_config/config.sh
|
file_config_user=$dir_config/config.sh
|
||||||
file_auth_sample=$dir_sample/auth.sample.json
|
file_auth_sample=$dir_sample/auth.sample.json
|
||||||
@@ -59,11 +63,11 @@ list_own_drop=$dir_list_tmp/own_drop.list
|
|||||||
|
|
||||||
## 软连接及其原始文件对应关系
|
## 软连接及其原始文件对应关系
|
||||||
link_name=(
|
link_name=(
|
||||||
# task
|
task
|
||||||
ql
|
ql
|
||||||
)
|
)
|
||||||
original_name=(
|
original_name=(
|
||||||
# task.sh
|
task.sh
|
||||||
update.sh
|
update.sh
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -74,9 +78,6 @@ init_env() {
|
|||||||
|
|
||||||
import_config() {
|
import_config() {
|
||||||
[[ -f $file_config_user ]] && . $file_config_user
|
[[ -f $file_config_user ]] && . $file_config_user
|
||||||
if [[ $LOAD_ENV != 'false' ]] && [[ -f $file_env ]]; then
|
|
||||||
. $file_env
|
|
||||||
fi
|
|
||||||
|
|
||||||
ql_base_url=${QlBaseUrl:-"/"}
|
ql_base_url=${QlBaseUrl:-"/"}
|
||||||
ql_port=${QlPort:-"5700"}
|
ql_port=${QlPort:-"5700"}
|
||||||
@@ -136,6 +137,28 @@ gen_random_num() {
|
|||||||
echo $((${RANDOM} % $divi))
|
echo $((${RANDOM} % $divi))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define_cmd() {
|
||||||
|
local cmd_prefix cmd_suffix
|
||||||
|
if type task &>/dev/null; then
|
||||||
|
cmd_suffix=""
|
||||||
|
if [[ -f "$dir_shell/task.sh" ]]; then
|
||||||
|
cmd_prefix=""
|
||||||
|
else
|
||||||
|
cmd_prefix="bash "
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
cmd_suffix=".sh"
|
||||||
|
if [[ -f "$dir_shell/task.sh" ]]; then
|
||||||
|
cmd_prefix="$dir_shell/"
|
||||||
|
else
|
||||||
|
cmd_prefix="bash $dir_shell/"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
for ((i = 0; i < ${#link_name[*]}; i++)); do
|
||||||
|
export cmd_${link_name[i]}="${cmd_prefix}${link_name[i]}${cmd_suffix}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
fix_config() {
|
fix_config() {
|
||||||
make_dir $dir_tmp
|
make_dir $dir_tmp
|
||||||
make_dir $dir_static
|
make_dir $dir_static
|
||||||
@@ -417,6 +440,19 @@ init_nginx() {
|
|||||||
sed -i "s,IPV4_CONFIG,${ipv4Str},g" /etc/nginx/conf.d/front.conf
|
sed -i "s,IPV4_CONFIG,${ipv4Str},g" /etc/nginx/conf.d/front.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_env_array() {
|
||||||
|
exported_variables=()
|
||||||
|
while IFS= read -r line; do
|
||||||
|
exported_variables+=("$line")
|
||||||
|
done < <(grep '^export ' $file_env | awk '{print $2}' | cut -d= -f1)
|
||||||
|
}
|
||||||
|
|
||||||
|
clear_env() {
|
||||||
|
for var in "${exported_variables[@]}"; do
|
||||||
|
unset "$var"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
handle_task_start() {
|
handle_task_start() {
|
||||||
[[ $ID ]] && update_cron "\"$ID\"" "0" "$$" "$log_path" "$begin_timestamp"
|
[[ $ID ]] && update_cron "\"$ID\"" "0" "$$" "$log_path" "$begin_timestamp"
|
||||||
echo -e "## 开始执行... $begin_time\n"
|
echo -e "## 开始执行... $begin_time\n"
|
||||||
@@ -459,5 +495,6 @@ handle_task_end() {
|
|||||||
init_env
|
init_env
|
||||||
detect_termux
|
detect_termux
|
||||||
detect_macos
|
detect_macos
|
||||||
|
define_cmd
|
||||||
|
|
||||||
import_config $1
|
import_config $1
|
||||||
|
|||||||
+2
-6
@@ -19,13 +19,9 @@ define_program() {
|
|||||||
elif [[ $file_param == *.py ]] || [[ $file_param == *.pyc ]]; then
|
elif [[ $file_param == *.py ]] || [[ $file_param == *.pyc ]]; then
|
||||||
which_program="python3"
|
which_program="python3"
|
||||||
elif [[ $file_param == *.sh ]]; then
|
elif [[ $file_param == *.sh ]]; then
|
||||||
which_program="bash"
|
which_program="."
|
||||||
elif [[ $file_param == *.ts ]]; then
|
elif [[ $file_param == *.ts ]]; then
|
||||||
if ! type tsx &>/dev/null; then
|
which_program="ts-node-transpile-only"
|
||||||
which_program="ts-node-transpile-only"
|
|
||||||
else
|
|
||||||
which_program="tsx"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
which_program=""
|
which_program=""
|
||||||
fi
|
fi
|
||||||
|
|||||||
+6
-7
@@ -1,8 +1,7 @@
|
|||||||
version: 2.17.7
|
version: 2.17.8
|
||||||
changeLogLink: https://t.me/jiao_long/408
|
changeLogLink: https://t.me/jiao_long/419
|
||||||
publishTime: 2024-06-30 16:00
|
publishTime: 2024-07-13 08:00
|
||||||
changeLog: |
|
changeLog: |
|
||||||
1. 修复更新任务状态错误
|
1. 修改环境变量加载逻辑
|
||||||
2. 修复查询系统 health 状态错误
|
2. 修复执行任务报错 Argument list too long
|
||||||
3. 修复更新 linux 镜像源错误
|
|
||||||
4. npm 包支持 alpine 和 debian、ubuntu,修复 linux 依赖安装命令
|
|
||||||
Reference in New Issue
Block a user