mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-08 01:34:33 +08:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 86e3d8736b | |||
| 85d32d00e1 | |||
| 6a52e2f804 | |||
| b4cb72c5d0 | |||
| 79fd4ec58f | |||
| 49ed5c6632 | |||
| ffba7ee4a1 | |||
| 91d080472f | |||
| 826f214f0f | |||
| ca150dc6a6 | |||
| ae5db60211 | |||
| 490bdc15f6 |
@@ -85,8 +85,6 @@ jobs:
|
||||
git push --force --quiet gitlab ${GITHUB_BRANCH}:${GITHUB_BRANCH}
|
||||
|
||||
build:
|
||||
if: github.ref != 'refs/heads/master'
|
||||
|
||||
needs: build-static
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
@@ -131,11 +129,14 @@ jobs:
|
||||
ghcr.io/${{ github.repository }}
|
||||
# generate Docker tags based on the following events/attributes
|
||||
# nightly, master, pr-2, 1.2.3, 1.2, 1
|
||||
flavor: |
|
||||
latest=false
|
||||
tags: |
|
||||
type=schedule,pattern=nightly
|
||||
type=edge
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=ref,event=branch,enable=${{ github.ref != format('refs/heads/{0}', 'master') }}
|
||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
|
||||
@@ -1,26 +1,28 @@
|
||||
import { defineConfig } from '@umijs/max';
|
||||
const CompressionPlugin = require('compression-webpack-plugin');
|
||||
|
||||
const baseUrl = process.env.QlBaseUrl || '/';
|
||||
export default defineConfig({
|
||||
hash: true,
|
||||
antd: {},
|
||||
outputPath: 'static/dist',
|
||||
fastRefresh: true,
|
||||
favicons: ['./images/favicon.svg'],
|
||||
favicons: [`https://qn.whyour.cn/favicon.svg`],
|
||||
mfsu: {
|
||||
strategy: 'eager',
|
||||
},
|
||||
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
|
||||
proxy: {
|
||||
'/api/public': {
|
||||
[`${baseUrl}api/public`]: {
|
||||
target: 'http://127.0.0.1:5400/',
|
||||
changeOrigin: true,
|
||||
pathRewrite: { '^/api/public': '/api/' },
|
||||
pathRewrite: { [`^${baseUrl}api/public`]: '/api' },
|
||||
},
|
||||
'/api': {
|
||||
[`${baseUrl}api`]: {
|
||||
target: 'http://127.0.0.1:5600/',
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
pathRewrite: { [`^${baseUrl}api`]: '/api' },
|
||||
},
|
||||
},
|
||||
chainWebpack: ((config: any) => {
|
||||
@@ -38,6 +40,7 @@ export default defineConfig({
|
||||
'react-dom': 'window.ReactDOM',
|
||||
},
|
||||
headScripts: [
|
||||
`./api/env.js`,
|
||||
'https://gw.alipayobjects.com/os/lib/react/18.2.0/umd/react.production.min.js',
|
||||
'https://gw.alipayobjects.com/os/lib/react-dom/18.2.0/umd/react-dom.production.min.js',
|
||||
],
|
||||
|
||||
@@ -59,6 +59,8 @@ podman run -dit \
|
||||
--network bridge \
|
||||
-v $PWD/ql/data:/ql/data \
|
||||
-p 5700:5700 \
|
||||
# 部署路径非必须,以斜杠开头和结尾,比如 /test/
|
||||
-e QlBaseUrl="/" \
|
||||
--name qinglong \
|
||||
--hostname qinglong \
|
||||
docker.io/whyour/qinglong:latest
|
||||
@@ -97,6 +99,8 @@ systemctl restart docker
|
||||
docker run -dit \
|
||||
-v $PWD/ql/data:/ql/data \
|
||||
-p 5700:5700 \
|
||||
# 部署路径非必须,以斜杠开头和结尾,比如 /test/
|
||||
-e QlBaseUrl="/" \
|
||||
--name qinglong \
|
||||
--hostname qinglong \
|
||||
--restart unless-stopped \
|
||||
|
||||
@@ -92,6 +92,11 @@ export default {
|
||||
'/api/system',
|
||||
'/api/user/init',
|
||||
'/api/user/notification/init',
|
||||
'/open/user/login',
|
||||
'/open/user/two-factor/login',
|
||||
'/open/system',
|
||||
'/open/user/init',
|
||||
'/open/user/notification/init',
|
||||
],
|
||||
versionFile,
|
||||
lastVersionFile,
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Request, Response } from 'express';
|
||||
import { pick } from 'lodash';
|
||||
|
||||
let pickedEnv: Record<string, string>;
|
||||
|
||||
function getPickedEnv() {
|
||||
if (pickedEnv) return pickedEnv;
|
||||
const picked = pick(process.env, ['QlBaseUrl']);
|
||||
pickedEnv = picked as Record<string, string>;
|
||||
return picked;
|
||||
}
|
||||
|
||||
export function serveEnv(_req: Request, res: Response) {
|
||||
res.type('.js');
|
||||
res.send(
|
||||
Object.entries(getPickedEnv())
|
||||
.map(([k, v]) => `window.__ENV__${k}=${JSON.stringify(v)};`)
|
||||
.join('\n'),
|
||||
);
|
||||
}
|
||||
+2
-21
@@ -16,10 +16,12 @@ import { EnvModel } from '../data/env';
|
||||
import { errors } from 'celebrate';
|
||||
import path from 'path';
|
||||
import { createProxyMiddleware } from 'http-proxy-middleware';
|
||||
import { serveEnv } from '../config/serverEnv';
|
||||
|
||||
export default ({ app }: { app: Application }) => {
|
||||
app.enable('trust proxy');
|
||||
app.use(cors());
|
||||
app.get(`${config.api.prefix}/env.js`, serveEnv);
|
||||
app.use(`${config.api.prefix}/static`, express.static(config.uploadPath));
|
||||
|
||||
app.use(
|
||||
@@ -31,27 +33,6 @@ export default ({ app }: { app: Application }) => {
|
||||
}),
|
||||
);
|
||||
|
||||
app.use((req, res, next) => {
|
||||
if (req.path.startsWith('/api') || req.path.startsWith('/open')) {
|
||||
next();
|
||||
} else {
|
||||
return handler(req, res, {
|
||||
public: path.join(config.rootPath, 'static/dist'),
|
||||
rewrites: [{ source: '**', destination: '/index.html' }],
|
||||
headers: [
|
||||
{
|
||||
source: 'index.html',
|
||||
headers: [
|
||||
{
|
||||
key: 'Cache-Control',
|
||||
value: 'no-cache',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
});
|
||||
app.use(bodyParser.json({ limit: '50mb' }));
|
||||
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
|
||||
|
||||
|
||||
@@ -17,10 +17,13 @@ const check = async (
|
||||
if (res.includes('200')) {
|
||||
return callback(null, { status: 1 });
|
||||
}
|
||||
const errLog = await promiseExec(
|
||||
const panelErrLog = await promiseExec(
|
||||
`tail -n 300 ~/.pm2/logs/panel-error.log`,
|
||||
);
|
||||
return callback(new Error(errLog));
|
||||
const scheduleErrLog = await promiseExec(
|
||||
`tail -n 300 ~/.pm2/logs/schedule-error.log`,
|
||||
);
|
||||
return callback(new Error(`${scheduleErrLog}\n${panelErrLog}`));
|
||||
|
||||
default:
|
||||
return callback(null, { status: 1 });
|
||||
|
||||
@@ -13,7 +13,10 @@ server.addService(CronService, { addCron, delCron });
|
||||
server.bindAsync(
|
||||
`localhost:${config.cronPort}`,
|
||||
ServerCredentials.createInsecure(),
|
||||
() => {
|
||||
(err, port) => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
server.start();
|
||||
Logger.debug(`✌️ 定时服务启动成功!`);
|
||||
process.send?.('ready');
|
||||
|
||||
+83
-19
@@ -93,7 +93,11 @@ export default class NotificationService {
|
||||
},
|
||||
})
|
||||
.json();
|
||||
return typeof res.id === 'number';
|
||||
if (typeof res.id === 'number') {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -109,7 +113,11 @@ export default class NotificationService {
|
||||
headers: { Authorization: 'Bearer ' + goCqHttpBotToken },
|
||||
})
|
||||
.json();
|
||||
return res.retcode === 0;
|
||||
if (res.retcode === 0) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -128,7 +136,11 @@ export default class NotificationService {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
})
|
||||
.json();
|
||||
return res.errno === 0 || res.data.errno === 0;
|
||||
if (res.errno === 0 || res.data.errno === 0) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -147,9 +159,14 @@ export default class NotificationService {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
})
|
||||
.json();
|
||||
return (
|
||||
res.content.result.length !== undefined && res.content.result.length > 0
|
||||
);
|
||||
if (
|
||||
res.content.result.length !== undefined &&
|
||||
res.content.result.length > 0
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -166,7 +183,11 @@ export default class NotificationService {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
})
|
||||
.json();
|
||||
return res.success;
|
||||
if (res.success) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -190,7 +211,11 @@ export default class NotificationService {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
})
|
||||
.json();
|
||||
return res.code === 200;
|
||||
if (res.code === 200) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -234,7 +259,11 @@ export default class NotificationService {
|
||||
agent,
|
||||
})
|
||||
.json();
|
||||
return !!res.ok;
|
||||
if (res.ok) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -263,7 +292,11 @@ export default class NotificationService {
|
||||
},
|
||||
})
|
||||
.json();
|
||||
return res.errcode === 0;
|
||||
if (res.errcode === 0) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -284,7 +317,11 @@ export default class NotificationService {
|
||||
},
|
||||
})
|
||||
.json();
|
||||
return res.errcode === 0;
|
||||
if (res.errcode === 0) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -359,7 +396,11 @@ export default class NotificationService {
|
||||
)
|
||||
.json();
|
||||
|
||||
return res.errcode === 0;
|
||||
if (res.errcode === 0) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -403,8 +444,11 @@ export default class NotificationService {
|
||||
},
|
||||
})
|
||||
.json();
|
||||
|
||||
return res.code === 0;
|
||||
if (res.code === 0) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -422,7 +466,11 @@ export default class NotificationService {
|
||||
})
|
||||
.json();
|
||||
|
||||
return res.ret === 0;
|
||||
if (res.ret === 0) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -444,7 +492,11 @@ export default class NotificationService {
|
||||
})
|
||||
.json();
|
||||
|
||||
return res.code === 200;
|
||||
if (res.code === 200) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -468,7 +520,11 @@ export default class NotificationService {
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
.json();
|
||||
return res.StatusCode === 0;
|
||||
if (res.StatusCode === 0) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -495,7 +551,11 @@ export default class NotificationService {
|
||||
|
||||
transporter.close();
|
||||
|
||||
return !!info.messageId;
|
||||
if (info.messageId) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(info));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
@@ -529,7 +589,11 @@ export default class NotificationService {
|
||||
};
|
||||
try {
|
||||
const res = await got(formatUrl, options);
|
||||
return String(res.statusCode).startsWith('20');
|
||||
if (String(res.statusCode).startsWith('20')) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(res));
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.response ? error.response.body : error);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,9 @@ export default class SshKeyService {
|
||||
if (host === 'github.com') {
|
||||
host = `ssh.github.com\n Port 443\n HostkeyAlgorithms +ssh-rsa\n PubkeyAcceptedAlgorithms +ssh-rsa`;
|
||||
}
|
||||
const proxyStr = proxy ? ` ProxyCommand nc -v -x ${proxy} %h %p\n` : '';
|
||||
const proxyStr = proxy
|
||||
? ` ProxyCommand nc -v -x ${proxy} %h %p 2>/dev/null\n`
|
||||
: '';
|
||||
const config = `Host ${alias}\n Hostname ${host}\n IdentityFile ${path.join(
|
||||
this.sshPath,
|
||||
alias,
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
version: '2'
|
||||
services:
|
||||
web:
|
||||
# alpine 基础镜像版本
|
||||
image: whyour/qinglong:latest
|
||||
# debian-slim 基础镜像版本
|
||||
# image: whyour/qinglong:debian
|
||||
volumes:
|
||||
- ./data:/ql/data
|
||||
ports:
|
||||
- "0.0.0.0:5700:5700"
|
||||
environment:
|
||||
# 部署路径非必须,以斜杠开头和结尾,比如 /test/
|
||||
QlBaseUrl: '/'
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-sf", "http://127.0.0.1:5400/api/health", "||", "exit", "1"]
|
||||
interval: 2m
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
+7
-6
@@ -14,10 +14,9 @@ map $http_upgrade $connection_upgrade {
|
||||
server {
|
||||
listen 5700;
|
||||
IPV6_CONFIG
|
||||
root /ql/static/dist;
|
||||
ssl_session_timeout 5m;
|
||||
|
||||
location QL_BASE_URL/api/public/ {
|
||||
location QL_BASE_URLapi/public/ {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -25,7 +24,7 @@ server {
|
||||
proxy_buffering off;
|
||||
}
|
||||
|
||||
location QL_BASE_URL/api/ {
|
||||
location QL_BASE_URLapi/ {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -36,7 +35,7 @@ server {
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
}
|
||||
|
||||
location QL_BASE_URL/open/ {
|
||||
location QL_BASE_URLopen/ {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -52,10 +51,12 @@ server {
|
||||
gzip_comp_level 6;
|
||||
gzip_buffers 16 8k;
|
||||
gzip_http_version 1.0;
|
||||
QL_ROOT_CONFIG
|
||||
|
||||
location QL_BASE_URL/ {
|
||||
location QL_BASE_URL_LOCATION {
|
||||
QL_ALIAS_CONFIG
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ QL_BASE_URL/index.html;
|
||||
try_files $uri QL_BASE_URLindex.html;
|
||||
}
|
||||
|
||||
location ~ .*\.(html)$ {
|
||||
|
||||
@@ -5,6 +5,7 @@ module.exports = {
|
||||
max_restarts: 10,
|
||||
kill_timeout: 15000,
|
||||
wait_ready: true,
|
||||
listen_timeout: 10000,
|
||||
source_map_support: true,
|
||||
time: true,
|
||||
script: 'static/build/schedule/index.js',
|
||||
@@ -14,6 +15,7 @@ module.exports = {
|
||||
max_restarts: 10,
|
||||
kill_timeout: 15000,
|
||||
wait_ready: true,
|
||||
listen_timeout: 10000,
|
||||
source_map_support: true,
|
||||
time: true,
|
||||
script: 'static/build/public.js',
|
||||
@@ -23,6 +25,7 @@ module.exports = {
|
||||
max_restarts: 10,
|
||||
kill_timeout: 15000,
|
||||
wait_ready: true,
|
||||
listen_timeout: 10000,
|
||||
source_map_support: true,
|
||||
time: true,
|
||||
script: 'static/build/app.js',
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 6.8 KiB |
+1
-1
@@ -193,7 +193,7 @@ run_else() {
|
||||
local relative_path="${file_param%/*}"
|
||||
if [[ ! -z ${relative_path} ]] && [[ ${file_param} =~ "/" ]]; then
|
||||
cd ${relative_path}
|
||||
file_param=${file_param/$relative_path\//}
|
||||
file_param=${file_param/$relative_path\//.\/}
|
||||
fi
|
||||
|
||||
shift
|
||||
|
||||
+15
-9
@@ -35,7 +35,6 @@ file_notify_js_sample=$dir_sample/notify.js
|
||||
file_notify_py_sample=$dir_sample/notify.py
|
||||
file_notify_py=$dir_scripts/notify.py
|
||||
file_notify_js=$dir_scripts/sendNotify.js
|
||||
task_error_log_path=$dir_log/task_error.log
|
||||
nginx_app_conf=$dir_root/docker/front.conf
|
||||
nginx_conf=$dir_root/docker/nginx.conf
|
||||
dep_notify_py=$dir_dep/notify.py
|
||||
@@ -68,7 +67,7 @@ import_config() {
|
||||
[[ -f $file_config_user ]] && . $file_config_user
|
||||
[[ -f $file_env ]] && . $file_env
|
||||
|
||||
ql_base_url=${QlBaseUrl:-""}
|
||||
ql_base_url=${QlBaseUrl:-"/"}
|
||||
command_timeout_time=${CommandTimeoutTime:-""}
|
||||
proxy_url=${ProxyUrl:-""}
|
||||
file_extensions=${RepoFileExtensions:-"js py"}
|
||||
@@ -468,7 +467,19 @@ patch_version() {
|
||||
init_nginx() {
|
||||
cp -fv $nginx_conf /etc/nginx/nginx.conf
|
||||
cp -fv $nginx_app_conf /etc/nginx/conf.d/front.conf
|
||||
sed -i "s,QL_BASE_URL,${qlBaseUrl},g" /etc/nginx/conf.d/front.conf
|
||||
local location_url="/"
|
||||
local aliasStr=""
|
||||
local rootStr=""
|
||||
if [[ $ql_base_url != "/" ]]; then
|
||||
location_url="^~${ql_base_url%*/}"
|
||||
aliasStr="alias ${dir_static}/dist;"
|
||||
else
|
||||
rootStr="root ${dir_static}/dist;"
|
||||
fi
|
||||
sed -i "s,QL_ALIAS_CONFIG,${aliasStr},g" /etc/nginx/conf.d/front.conf
|
||||
sed -i "s,QL_ROOT_CONFIG,${rootStr},g" /etc/nginx/conf.d/front.conf
|
||||
sed -i "s,QL_BASE_URL_LOCATION,${location_url},g" /etc/nginx/conf.d/front.conf
|
||||
sed -i "s,QL_BASE_URL,${ql_base_url},g" /etc/nginx/conf.d/front.conf
|
||||
|
||||
ipv6=$(ip a | grep inet6)
|
||||
ipv6Str=""
|
||||
@@ -485,11 +496,6 @@ handle_task_before() {
|
||||
|
||||
[[ $is_macos -eq 0 ]] && check_server
|
||||
|
||||
if [[ -s $task_error_log_path ]]; then
|
||||
cat $task_error_log_path
|
||||
echo -e "加载 config.sh 出错,请手动检查"
|
||||
fi
|
||||
|
||||
. $file_task_before "$@"
|
||||
}
|
||||
|
||||
@@ -513,4 +519,4 @@ detect_termux
|
||||
detect_macos
|
||||
define_cmd
|
||||
|
||||
import_config $1 2>$task_error_log_path
|
||||
import_config $1
|
||||
|
||||
+2
-9
@@ -243,10 +243,9 @@ update_qinglong() {
|
||||
echo -e "使用 ${mirror} 源更新...\n"
|
||||
export isFirstStartServer=false
|
||||
|
||||
local all_branch=$(cd ${dir_root} && git branch -a)
|
||||
local primary_branch="master"
|
||||
if [[ "${all_branch}" =~ "${current_branch}" ]]; then
|
||||
primary_branch="${current_branch}"
|
||||
if [[ "${QL_BRANCH}" == "develop" ]]; then
|
||||
primary_branch="develop"
|
||||
fi
|
||||
[[ -f $dir_root/package.json ]] && ql_depend_old=$(cat $dir_root/package.json)
|
||||
reset_romote_url ${dir_root} "https://${mirror}.com/whyour/qinglong.git" ${primary_branch}
|
||||
@@ -457,12 +456,6 @@ main() {
|
||||
eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd
|
||||
fi
|
||||
|
||||
if [[ -s $task_error_log_path ]]; then
|
||||
eval cat $task_error_log_path $cmd
|
||||
eval echo -e "加载 config.sh 出错,请手动检查" $cmd
|
||||
eval echo $cmd
|
||||
fi
|
||||
|
||||
if [[ "$show_log" == "true" ]] && [[ $ID ]]; then
|
||||
eval echo -e "请移除 -l 参数" $cmd
|
||||
exit 1
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
const baseUrl = window.__ENV__QlBaseUrl || '/';
|
||||
|
||||
export function modifyClientRenderOpts(memo: any) {
|
||||
return {
|
||||
...memo,
|
||||
publicPath: baseUrl,
|
||||
basename: baseUrl,
|
||||
};
|
||||
}
|
||||
|
||||
export function modifyContextOpts(memo: any) {
|
||||
return {
|
||||
...memo,
|
||||
basename: baseUrl,
|
||||
};
|
||||
}
|
||||
@@ -332,8 +332,14 @@ select:-webkit-autofill:focus {
|
||||
}
|
||||
|
||||
.ant-pro-sider-logo {
|
||||
h1 {
|
||||
margin-left: 5px !important;
|
||||
.title {
|
||||
height: 32px;
|
||||
margin: 0 5px;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
line-height: 32px;
|
||||
vertical-align: middle;
|
||||
animation: pro-layout-title-hide 0.3s;
|
||||
}
|
||||
|
||||
img {
|
||||
|
||||
@@ -280,11 +280,10 @@ export default function () {
|
||||
selectedKeys={[location.pathname]}
|
||||
loading={loading}
|
||||
ErrorBoundary={Sentry.ErrorBoundary}
|
||||
logo={<Image preview={false} src="https://qn.whyour.cn/logo.png" />}
|
||||
// @ts-ignore
|
||||
title={
|
||||
logo={
|
||||
<>
|
||||
<span style={{ fontSize: 16, marginRight: 5 }}>青龙</span>
|
||||
<Image preview={false} src="https://qn.whyour.cn/logo.png" />
|
||||
<span className="title">青龙</span>
|
||||
<a
|
||||
href={systemInfo?.changeLogLink}
|
||||
target="_blank"
|
||||
@@ -313,6 +312,7 @@ export default function () {
|
||||
</a>
|
||||
</>
|
||||
}
|
||||
title={false}
|
||||
menuItemRender={(menuItemProps: any, defaultDom: any) => {
|
||||
if (
|
||||
menuItemProps.isUrl ||
|
||||
|
||||
@@ -253,9 +253,9 @@ const ViewCreateModal = ({
|
||||
name={[name, 'value']}
|
||||
rules={[{ required: true, message: '请输入内容' }]}
|
||||
>
|
||||
{EOperation[filtersValue[name]['operation']] ===
|
||||
{EOperation[filtersValue?.[name]['operation']] ===
|
||||
'select' ? (
|
||||
statusElement(filtersValue[name]['property'])
|
||||
statusElement(filtersValue?.[name]['property'])
|
||||
) : (
|
||||
<Input placeholder="请输入内容" />
|
||||
)}
|
||||
|
||||
@@ -17,9 +17,9 @@ const Error = () => {
|
||||
needLoading && setLoading(true);
|
||||
request
|
||||
.get(`${config.apiPrefix}public/health`)
|
||||
.then(({ error, status }) => {
|
||||
if (status === 1) {
|
||||
return reloadUser();
|
||||
.then(({ error, data }) => {
|
||||
if (data?.status === 1) {
|
||||
return;
|
||||
}
|
||||
if (retryTimes.current > 3) {
|
||||
setData(error?.details);
|
||||
@@ -59,18 +59,19 @@ const Error = () => {
|
||||
}
|
||||
description={
|
||||
<Typography.Text type="danger">
|
||||
<div>
|
||||
请先按如下方式修复,如果无法解决,可结合日志
|
||||
<Typography.Link href="https://github.com/whyour/qinglong/issues/new?assignees=&labels=&template=bug_report.yml">
|
||||
提交 issue
|
||||
</Typography.Link>
|
||||
</div>
|
||||
<div>请先按如下方式修复:</div>
|
||||
<div>
|
||||
1. 宿主机执行 docker run --rm -v
|
||||
/var/run/docker.sock:/var/run/docker.sock
|
||||
containrrr/watchtower -cR <容器名>
|
||||
</div>
|
||||
<div>2. 容器内执行 ql -l check、ql -l update</div>
|
||||
<div>
|
||||
3. 如果无法解决,容器内执行 pm2 logs,拷贝执行结果
|
||||
<Typography.Link href="https://github.com/whyour/qinglong/issues/new?assignees=&labels=&template=bug_report.yml">
|
||||
提交 issue
|
||||
</Typography.Link>
|
||||
</div>
|
||||
</Typography.Text>
|
||||
}
|
||||
banner
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
const baseUrl = window.__ENV__QlBaseUrl || '/';
|
||||
|
||||
export default {
|
||||
siteName: '青龙',
|
||||
apiPrefix: '/api/',
|
||||
apiPrefix: `${baseUrl}api/`,
|
||||
authKey: 'token',
|
||||
|
||||
/* Layout configuration, specify which layout to use for route. */
|
||||
|
||||
+10
-3
@@ -4,7 +4,7 @@ import config from './config';
|
||||
import { history } from '@umijs/max';
|
||||
|
||||
message.config({
|
||||
duration: 1.5,
|
||||
duration: 2,
|
||||
});
|
||||
|
||||
const time = Date.now();
|
||||
@@ -23,7 +23,10 @@ const errorHandler = function (error: any) {
|
||||
history.push('/login');
|
||||
}
|
||||
} else {
|
||||
message.error(msg);
|
||||
message.error({
|
||||
content: msg,
|
||||
style: { maxWidth: 500, margin: '0 auto' },
|
||||
});
|
||||
}
|
||||
} else {
|
||||
console.log(error.message);
|
||||
@@ -66,7 +69,11 @@ _request.interceptors.response.use(async (response) => {
|
||||
const res = await response.clone().json();
|
||||
if (res.code !== 200) {
|
||||
const msg = res.message || res.data;
|
||||
msg && message.error(msg);
|
||||
msg &&
|
||||
message.error({
|
||||
content: msg,
|
||||
style: { maxWidth: 500, margin: '0 auto' },
|
||||
});
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Vendored
+4
@@ -10,3 +10,7 @@ declare module '*.svg' {
|
||||
}
|
||||
|
||||
declare module 'pstree.remy';
|
||||
|
||||
interface Window {
|
||||
__ENV__QlBaseUrl: string;
|
||||
}
|
||||
|
||||
+5
-4
@@ -1,5 +1,6 @@
|
||||
version: 2.15.14
|
||||
changeLogLink: https://t.me/jiao_long/374
|
||||
version: 2.15.15
|
||||
changeLogLink: https://t.me/jiao_long/376
|
||||
changeLog: |
|
||||
1. 接口 system/command-run 返回响应头 QL-Task-Pid,system/command-stop 支持 pid 参数
|
||||
2. 其他 bug 修复
|
||||
1. 支持非跟目录部署,启动时增加参数 -e QlBaseUrl="/test/",参数前后需要斜杠
|
||||
2. 修复 task 执行可执行文件路径,感谢 https://github.com/jzksnsjswkw
|
||||
3. 其他 bug 修复
|
||||
|
||||
Reference in New Issue
Block a user