mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-11 19:05:20 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5afac3a3ac | ||
|
|
71ba1534f2 | ||
|
|
791cf657b5 | ||
|
|
c1ef021009 | ||
|
|
90fe63211d |
+3
-5
@@ -48,7 +48,7 @@ docker pull whyour/qinglong:debian
|
|||||||
|
|
||||||
### npm
|
### npm
|
||||||
|
|
||||||
The npm version supports `debian/ubuntu/centos/alpine` systems and requires `node/python3` to be installed.
|
The npm version supports `debian/ubuntu/alpine` systems and requires `node/npm/python3/pip3/pnpm` to be installed.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm i @whyour/qinglong
|
npm i @whyour/qinglong
|
||||||
@@ -105,15 +105,13 @@ podman run -dit \
|
|||||||
docker.io/whyour/qinglong:latest
|
docker.io/whyour/qinglong:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
### Local
|
### Npm
|
||||||
|
|
||||||
It is recommended to use a pure system installation to avoid losing the original system data, you need to install node/npm/python3/pip3 yourself
|
It is recommended to use a pure system installation to avoid losing the original system data, you need to install node/npm/python3/pip3/pnpm yourself
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Debian/Ubuntu
|
# Debian/Ubuntu
|
||||||
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||||
# Centos
|
|
||||||
curl --silent --location https://rpm.nodesource.com/setup_20.x | sudo bash
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ docker pull whyour/qinglong:debian
|
|||||||
|
|
||||||
### npm
|
### npm
|
||||||
|
|
||||||
npm 版本支持 `debian/ubuntu/centos/alpine` 系统,需要自行安装 `node/python3`
|
npm 版本支持 `debian/ubuntu/alpine` 系统,需要自行安装 `node/npm/python3/pip3/pnpm`
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm i @whyour/qinglong
|
npm i @whyour/qinglong
|
||||||
@@ -107,15 +107,13 @@ podman run -dit \
|
|||||||
docker.io/whyour/qinglong:latest
|
docker.io/whyour/qinglong:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
### 本机
|
### npm
|
||||||
|
|
||||||
建议使用纯净系统安装,避免系统原有数据丢失,需要自己安装 node/npm/python3/pip3
|
建议使用纯净系统安装,避免系统原有数据丢失,需要自己安装 node/npm/python3/pip3/pnpm
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Debian/Ubuntu
|
# Debian/Ubuntu
|
||||||
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||||
# Centos
|
|
||||||
curl --silent --location https://rpm.nodesource.com/setup_20.x | sudo bash
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ export default (app: Router) => {
|
|||||||
const logger: Logger = Container.get('logger');
|
const logger: Logger = Container.get('logger');
|
||||||
try {
|
try {
|
||||||
const envService = Container.get(EnvService);
|
const envService = Container.get(EnvService);
|
||||||
|
if (!req.body?.length) {
|
||||||
|
return res.send({ code: 400, message: '参数不正确' });
|
||||||
|
}
|
||||||
const data = await envService.create(req.body);
|
const data = await envService.create(req.body);
|
||||||
return res.send({ code: 200, data });
|
return res.send({ code: 200, data });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ 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(configPath, 'env.sh');
|
||||||
|
const jsEnvFile = path.join(configPath, 'env.js');
|
||||||
|
const pyEnvFile = path.join(configPath, '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');
|
||||||
@@ -87,6 +89,8 @@ export default {
|
|||||||
sampleFile,
|
sampleFile,
|
||||||
confFile,
|
confFile,
|
||||||
envFile,
|
envFile,
|
||||||
|
jsEnvFile,
|
||||||
|
pyEnvFile,
|
||||||
dbPath,
|
dbPath,
|
||||||
uploadPath,
|
uploadPath,
|
||||||
configPath,
|
configPath,
|
||||||
@@ -99,6 +103,8 @@ export default {
|
|||||||
'crontab.list',
|
'crontab.list',
|
||||||
'dependence-proxy.sh',
|
'dependence-proxy.sh',
|
||||||
'env.sh',
|
'env.sh',
|
||||||
|
'env.js',
|
||||||
|
'env.py',
|
||||||
'token.json',
|
'token.json',
|
||||||
],
|
],
|
||||||
writePathList: [configPath, scriptPath],
|
writePathList: [configPath, scriptPath],
|
||||||
|
|||||||
@@ -114,7 +114,13 @@ export default class CronService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const id of ids) {
|
for (const id of ids) {
|
||||||
const cron = await this.getDb({ id });
|
let cron;
|
||||||
|
try {
|
||||||
|
cron = await this.getDb({ id });
|
||||||
|
} catch (err) {}
|
||||||
|
if (!cron) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (status === CrontabStatus.idle && log_path !== cron.log_path) {
|
if (status === CrontabStatus.idle && log_path !== cron.log_path) {
|
||||||
options = omit(options, ['status', 'log_path', 'pid']);
|
options = omit(options, ['status', 'log_path', 'pid']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,6 +196,8 @@ export default class EnvService {
|
|||||||
});
|
});
|
||||||
const groups = groupBy(envs, 'name');
|
const groups = groupBy(envs, 'name');
|
||||||
let env_string = '';
|
let env_string = '';
|
||||||
|
let js_env_string = '';
|
||||||
|
let py_env_string = 'import os\n';
|
||||||
for (const key in groups) {
|
for (const key in groups) {
|
||||||
if (Object.prototype.hasOwnProperty.call(groups, key)) {
|
if (Object.prototype.hasOwnProperty.call(groups, key)) {
|
||||||
const group = groups[key];
|
const group = groups[key];
|
||||||
@@ -208,9 +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
|
||||||
|
.map((x) => x.value)
|
||||||
|
.join('&')
|
||||||
|
.replace(/\\/g, '\\\\')
|
||||||
|
.replace(/'/g, "\\'")}'`;
|
||||||
|
js_env_string += `process.env.${key}=${_env_value};\n`;
|
||||||
|
py_env_string += `os.environ['${key}']=${_env_value}\n`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await fs.writeFile(config.envFile, env_string);
|
await fs.writeFile(config.envFile, env_string);
|
||||||
|
await fs.writeFile(config.jsEnvFile, js_env_string);
|
||||||
|
await fs.writeFile(config.pyEnvFile, py_env_string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Service, Inject } from 'typedi';
|
import { Service, Inject } from 'typedi';
|
||||||
import winston from 'winston';
|
import winston from 'winston';
|
||||||
import {
|
import {
|
||||||
|
createFile,
|
||||||
createRandomString,
|
createRandomString,
|
||||||
fileExist,
|
fileExist,
|
||||||
getNetIp,
|
getNetIp,
|
||||||
@@ -266,7 +267,7 @@ export default class UserService {
|
|||||||
public async getUserInfo(): Promise<any> {
|
public async getUserInfo(): Promise<any> {
|
||||||
const authFileExist = await fileExist(config.authConfigFile);
|
const authFileExist = await fileExist(config.authConfigFile);
|
||||||
if (!authFileExist) {
|
if (!authFileExist) {
|
||||||
await fs.writeFile(
|
await createFile(
|
||||||
config.authConfigFile,
|
config.authConfigFile,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
username: 'admin',
|
username: 'admin',
|
||||||
|
|||||||
+3
-1
@@ -74,7 +74,9 @@ init_env() {
|
|||||||
|
|
||||||
import_config() {
|
import_config() {
|
||||||
[[ -f $file_config_user ]] && . $file_config_user
|
[[ -f $file_config_user ]] && . $file_config_user
|
||||||
[[ -f $file_env ]] && . $file_env
|
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"}
|
||||||
|
|||||||
@@ -48,8 +48,9 @@ const Dependence = () => {
|
|||||||
pick(systemConfig, dataMap[path]),
|
pick(systemConfig, dataMap[path]),
|
||||||
)
|
)
|
||||||
.then((res) => {})
|
.then((res) => {})
|
||||||
.catch((error: any) => {
|
.catch(() => {
|
||||||
console.log(error);
|
setLoading(false);
|
||||||
|
setLog((p) => `${p}update mirror error`);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+7
-6
@@ -1,7 +1,8 @@
|
|||||||
version: 2.17.6
|
version: 2.17.7
|
||||||
changeLogLink: https://t.me/jiao_long/407
|
changeLogLink: https://t.me/jiao_long/408
|
||||||
publishTime: 2024-06-14 23:00
|
publishTime: 2024-06-30 16:00
|
||||||
changeLog: |
|
changeLog: |
|
||||||
1. bark 推送改为 post 请求,防止请求头过大
|
1. 修复更新任务状态错误
|
||||||
2. 修复单文件订阅代理无效
|
2. 修复查询系统 health 状态错误
|
||||||
3. 修复系统设置通知和依赖数据未初始化
|
3. 修复更新 linux 镜像源错误
|
||||||
|
4. npm 包支持 alpine 和 debian、ubuntu,修复 linux 依赖安装命令
|
||||||
|
|||||||
Reference in New Issue
Block a user