@whyour/qinglong 2.21.0-8 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +13 -0
- package/.env.example +7 -0
- package/AGENTS.md +2 -2
- package/README-en.md +24 -0
- package/README.md +24 -0
- package/back/protos/api.proto +6 -1
- package/back/protos/cron.proto +4 -1
- package/docker/Dockerfile +31 -12
- package/docker/Dockerfile.310 +31 -12
- package/docker/Dockerfile.debian +22 -14
- package/docker/Dockerfile.debian310 +24 -14
- package/docker/build-manifest.cjs +28 -0
- package/docker/verify-build.cjs +49 -0
- package/docs/releases/2.22.0-validation.md +49 -0
- package/docs/releases/2.22.0.md +54 -0
- package/ecosystem.config.js +10 -1
- package/package.json +11 -6
- package/sample/config.sample.sh +10 -0
- package/sample/notify.js +54 -0
- package/sample/notify.py +37 -0
- package/scripts/benchmark-execution.cjs +96 -0
- package/scripts/write-build-info.cjs +27 -0
- package/shell/api.sh +34 -13
- package/shell/check.sh +59 -19
- package/shell/lang/en.sh +6 -0
- package/shell/lang/zh.sh +6 -0
- package/shell/node_path_cache.sh +128 -0
- package/shell/otask.sh +7 -1
- package/shell/preload/sitecustomize.js +5 -1
- package/shell/share.sh +25 -8
- package/shell/start.sh +6 -3
- package/shell/task.sh +13 -3
- package/shell/update.sh +65 -4
- package/static/build/api/clientIp.js +42 -0
- package/static/build/api/config.js +8 -16
- package/static/build/api/cron.js +38 -2
- package/static/build/api/dashboard.js +37 -0
- package/static/build/api/health.js +2 -2
- package/static/build/api/index.js +4 -0
- package/static/build/api/log.js +30 -19
- package/static/build/api/retention.js +63 -0
- package/static/build/api/script.js +23 -22
- package/static/build/api/subscription.js +16 -2
- package/static/build/api/system.js +25 -2
- package/static/build/api/user.js +75 -15
- package/static/build/app.js +54 -45
- package/static/build/bootstrap/database.js +51 -0
- package/static/build/config/const.js +1 -0
- package/static/build/config/share.js +5 -4
- package/static/build/config/util.js +133 -38
- package/static/build/data/cron.js +1 -0
- package/static/build/data/notify.js +11 -1
- package/static/build/loaders/app.js +2 -0
- package/static/build/loaders/db.js +3 -33
- package/static/build/loaders/deps.js +29 -0
- package/static/build/loaders/express.js +30 -21
- package/static/build/loaders/initData.js +10 -7
- package/static/build/loaders/sock.js +72 -6
- package/static/build/middlewares/monitoring.js +12 -33
- package/static/build/middlewares/protectedPathCase.js +17 -0
- package/static/build/protos/api.js +56 -2
- package/static/build/protos/cron.js +21 -4
- package/static/build/protos/health.js +1 -1
- package/static/build/schedule/addCron.js +9 -0
- package/static/build/schedule/api.js +5 -2
- package/static/build/schedule/client.js +38 -6
- package/static/build/schedule/health.js +72 -7
- package/static/build/services/config.js +5 -42
- package/static/build/services/cron.js +338 -199
- package/static/build/services/dependence.js +47 -0
- package/static/build/services/grpc.js +1 -1
- package/static/build/services/health.js +4 -7
- package/static/build/services/http.js +8 -2
- package/static/build/services/log.js +2 -3
- package/static/build/services/metrics.js +46 -14
- package/static/build/services/notify.js +26 -0
- package/static/build/services/retention.js +123 -0
- package/static/build/services/schedule.js +57 -33
- package/static/build/services/script.js +4 -5
- package/static/build/services/subscription.js +55 -34
- package/static/build/services/system.js +37 -9
- package/static/build/services/user.js +213 -25
- package/static/build/shared/auth.js +18 -5
- package/static/build/shared/authMutation.js +17 -0
- package/static/build/shared/childProcess.js +82 -0
- package/static/build/shared/clientIp.js +27 -0
- package/static/build/shared/errors.js +9 -0
- package/static/build/shared/fileAccess.js +60 -0
- package/static/build/shared/i18n.js +12 -5
- package/static/build/shared/logReader.js +85 -0
- package/static/build/shared/logStreamManager.js +80 -60
- package/static/build/shared/password.js +30 -0
- package/static/build/shared/retention.js +58 -0
- package/static/build/shared/runCron.js +28 -15
- package/static/build/shared/schedulerMutationLock.js +44 -0
- package/static/build/shared/schedulerReadiness.js +82 -0
- package/static/build/shared/schemaMigrations.js +58 -0
- package/static/build/shared/startupProcess.js +48 -0
- package/static/build/shared/store.js +7 -0
- package/static/build/shared/trustProxy.js +119 -0
- package/static/build/validation/schedule.js +3 -3
- package/static/dist/{1885.e1ea09f6.async.js → 1885.b8f427bf.async.js} +1 -1
- package/static/dist/2031.6af40025.async.js +1 -0
- package/static/dist/2693.51c2636b.async.js +1 -0
- package/static/dist/{2890.9e373f5b.async.js → 2890.add55e85.async.js} +1 -1
- package/static/dist/2901.2ca95295.async.js +1 -0
- package/static/dist/445.a65ff63b.async.js +1 -0
- package/static/dist/4736.1d2b5cb6.async.js +1 -0
- package/static/dist/{4859.6592cebb.async.js → 4859.97d6653c.async.js} +1 -1
- package/static/dist/{6013.4e38de36.async.js → 6013.db535339.async.js} +1 -1
- package/static/dist/6212.9e6d9913.async.js +1 -0
- package/static/dist/{6339.ab305e96.async.js → 6431.4603ad0e.async.js} +1 -1
- package/static/dist/{6872.42f939f1.async.js → 6872.a503ef55.async.js} +1 -1
- package/static/dist/7231.f7e5b668.async.js +1 -0
- package/static/dist/{7355.f9f263d8.async.js → 7355.fca746f5.async.js} +1 -1
- package/static/dist/{7508.7dcee91c.async.js → 7508.d90eac63.async.js} +1 -1
- package/static/dist/{7984.594296a5.async.js → 7984.eaac7402.async.js} +1 -1
- package/static/dist/8844.a0fef08e.async.js +1 -0
- package/static/dist/index.html +2 -2
- package/static/dist/layouts__index.633d3553.async.js +1 -0
- package/static/dist/preload_helper.cf7de3fa.js +1 -0
- package/static/dist/{src__pages__config__index.a22ff7dc.async.js → src__pages__config__index.9aba4054.async.js} +1 -1
- package/static/dist/src__pages__crontab__detail.86b2eebb.async.js +1 -0
- package/static/dist/src__pages__crontab__index.ae4e06f2.async.js +1 -0
- package/static/dist/{src__pages__crontab__logModal.831d5e4b.async.js → src__pages__crontab__logModal.930535e2.async.js} +1 -1
- package/static/dist/src__pages__crontab__modal.a2c8fdcc.async.js +1 -0
- package/static/dist/src__pages__crontab__viewCreateModal.7b4f9cbe.async.js +1 -0
- package/static/dist/src__pages__crontab__viewManageModal.cd454ea0.async.js +1 -0
- package/static/dist/src__pages__dashboard__index.243c5a35.async.js +1 -0
- package/static/dist/src__pages__dashboard__taskResultModal.7795d6e1.async.js +1 -0
- package/static/dist/src__pages__dependence__index.874d501f.async.js +1 -0
- package/static/dist/src__pages__dependence__logModal.154efe7a.async.js +1 -0
- package/static/dist/src__pages__dependence__modal.a29c1a0f.async.js +1 -0
- package/static/dist/{src__pages__diff__index.013b7c75.async.js → src__pages__diff__index.1714b941.async.js} +1 -1
- package/static/dist/src__pages__env__editNameModal.c13d47d2.async.js +1 -0
- package/static/dist/src__pages__env__index.fd6fd2b0.async.js +1 -0
- package/static/dist/src__pages__env__modal.4d71adb3.async.js +1 -0
- package/static/dist/src__pages__error__index.aae50c94.async.js +1 -0
- package/static/dist/src__pages__initialization__index.82a2e967.async.js +1 -0
- package/static/dist/src__pages__log__index.71250e0d.async.js +1 -0
- package/static/dist/{src__pages__login__index.8c813eb1.async.js → src__pages__login__index.a0fd5ed8.async.js} +1 -1
- package/static/dist/src__pages__script__editModal.22acdf7c.async.js +1 -0
- package/static/dist/src__pages__script__editNameModal.1a521cc0.async.js +1 -0
- package/static/dist/src__pages__script__index.a18b2692.async.js +1 -0
- package/static/dist/src__pages__script__renameModal.0ab029e7.async.js +1 -0
- package/static/dist/src__pages__script__saveModal.8965b74c.async.js +1 -0
- package/static/dist/src__pages__script__setting.35ad4f02.async.js +1 -0
- package/static/dist/src__pages__setting__appModal.7eaeb9d3.async.js +1 -0
- package/static/dist/{src__pages__setting__checkUpdate.34d773f2.async.js → src__pages__setting__checkUpdate.d175b154.async.js} +1 -1
- package/static/dist/src__pages__setting__clientIp.3a8711ed.async.js +1 -0
- package/static/dist/src__pages__setting__dependence.9c0f749b.async.js +1 -0
- package/static/dist/src__pages__setting__index.cb397741.async.js +1 -0
- package/static/dist/src__pages__setting__loginLog.e0a1f54d.async.js +1 -0
- package/static/dist/src__pages__setting__notification.2ffe4e5a.async.js +1 -0
- package/static/dist/src__pages__setting__other.3d0b8492.async.js +1 -0
- package/static/dist/{src__pages__setting__progress.8823ac90.async.js → src__pages__setting__progress.2ccae3d7.async.js} +1 -1
- package/static/dist/src__pages__setting__security.e2d71ebb.async.js +1 -0
- package/static/dist/src__pages__setting__systemLog.b3046955.async.js +1 -0
- package/static/dist/src__pages__subscription__index.43086a06.async.js +1 -0
- package/static/dist/src__pages__subscription__logModal.cdba5139.async.js +1 -0
- package/static/dist/src__pages__subscription__modal.38991e1e.async.js +1 -0
- package/static/dist/{umi.a54a59f6.js → umi.fc019050.js} +1 -1
- package/test/back/auth-security.test.cjs +74 -0
- package/test/back/build-provenance.test.cjs +150 -0
- package/test/back/cron-log-name.test.cjs +110 -0
- package/test/back/cron-validation.test.cjs +45 -0
- package/test/back/dashboard-failures.test.cjs +173 -0
- package/test/back/database-bootstrap.test.cjs +193 -0
- package/test/back/dependence-cache-status.test.cjs +125 -0
- package/test/back/deprecated-file-routes.test.cjs +82 -0
- package/test/back/ecosystem.test.cjs +28 -0
- package/test/back/env-name-parsing.test.cjs +96 -0
- package/test/back/execution-lifecycle.test.cjs +236 -0
- package/test/back/file-access-security.test.cjs +47 -0
- package/test/back/fileTreeListing.test.cjs +57 -0
- package/test/back/grpc-cron-response.test.cjs +60 -0
- package/test/back/http-exclusive-listen.test.cjs +31 -0
- package/test/back/http-security.test.cjs +213 -0
- package/test/back/listen-security.test.cjs +67 -0
- package/test/back/log-path-security.test.cjs +158 -0
- package/test/back/logReader.test.cjs +72 -0
- package/test/back/manual-execution.test.cjs +85 -0
- package/test/back/manual-stop-claim.test.cjs +220 -0
- package/test/back/metrics.test.cjs +34 -0
- package/test/back/monitoring.test.cjs +73 -0
- package/test/back/node-path-cache.test.cjs +173 -0
- package/test/back/node-path-lock.test.cjs +178 -0
- package/test/back/npm-publication.test.cjs +70 -0
- package/test/back/primary-apm.test.cjs +24 -0
- package/test/back/process-exit-state.test.cjs +81 -0
- package/test/back/process-stop-signal.test.cjs +77 -0
- package/test/back/protected-path-case.test.cjs +58 -0
- package/test/back/qlServiceLogCommand.test.cjs +128 -0
- package/test/back/retention.test.cjs +131 -0
- package/test/back/role-loading.test.cjs +118 -0
- package/test/back/schedule-health.test.cjs +86 -0
- package/test/back/scheduler-file-lock.test.cjs +51 -0
- package/test/back/scheduler-mutation.test.cjs +312 -0
- package/test/back/scheduler-readiness.test.cjs +85 -0
- package/test/back/scheduler-reconciliation.test.cjs +152 -0
- package/test/back/scheduler-rpc-timeout.test.cjs +49 -0
- package/test/back/schema-migrations.test.cjs +127 -0
- package/test/back/shell-api-parsing.test.cjs +184 -0
- package/test/back/sock-polling.test.cjs +297 -0
- package/test/back/sock-security.test.cjs +72 -0
- package/test/back/start-env-preservation.test.cjs +53 -0
- package/test/back/stop-failure-feedback.test.cjs +158 -0
- package/test/back/stop-race.test.cjs +167 -0
- package/test/back/subscription-cleanup.test.cjs +53 -0
- package/test/back/subscription-stop-state.test.cjs +66 -0
- package/test/back/system-dependence-cache.test.cjs +126 -0
- package/test/back/task-time.test.cjs +116 -0
- package/test/back/user-api.test.cjs +99 -0
- package/test/back/user-security.test.cjs +248 -0
- package/test/back/worker-apm.test.cjs +84 -0
- package/test/back/wpush-grpc.test.cjs +115 -0
- package/test/front/cron-log-pagination.test.cjs +214 -0
- package/test/front/http-auth.test.cjs +152 -0
- package/test/front/http-error.test.cjs +29 -0
- package/test/helpers/load-security-module.cjs +42 -0
- package/version.yaml +19 -34
- package/CLAUDE.md +0 -43
- package/static/dist/1147.62793604.async.js +0 -1
- package/static/dist/134.54df9e38.async.js +0 -1
- package/static/dist/2208.85285476.async.js +0 -1
- package/static/dist/2286.f371c743.async.js +0 -1
- package/static/dist/3191.545ab873.async.js +0 -1
- package/static/dist/4902.555f92ab.async.js +0 -1
- package/static/dist/5520.ff2cfd6b.async.js +0 -1
- package/static/dist/6431.c50479be.async.js +0 -1
- package/static/dist/8826.db34ad8d.async.js +0 -1
- package/static/dist/layouts__index.a7a2bfe0.async.js +0 -1
- package/static/dist/preload_helper.3048fe5b.js +0 -1
- package/static/dist/src__pages__crontab__detail.b98f0084.async.js +0 -1
- package/static/dist/src__pages__crontab__index.68e78a33.async.js +0 -1
- package/static/dist/src__pages__crontab__modal.f7041c7c.async.js +0 -1
- package/static/dist/src__pages__crontab__viewCreateModal.4d589f66.async.js +0 -1
- package/static/dist/src__pages__crontab__viewManageModal.0e317746.async.js +0 -1
- package/static/dist/src__pages__dashboard__index.58177357.async.js +0 -1
- package/static/dist/src__pages__dependence__index.b7bbc795.async.js +0 -1
- package/static/dist/src__pages__dependence__logModal.0681830b.async.js +0 -1
- package/static/dist/src__pages__dependence__modal.f7bb47ba.async.js +0 -1
- package/static/dist/src__pages__env__editNameModal.48715576.async.js +0 -1
- package/static/dist/src__pages__env__index.452cdc47.async.js +0 -1
- package/static/dist/src__pages__env__modal.e1234834.async.js +0 -1
- package/static/dist/src__pages__error__index.dedb2b90.async.js +0 -1
- package/static/dist/src__pages__initialization__index.22620a77.async.js +0 -1
- package/static/dist/src__pages__log__index.9c66639f.async.js +0 -1
- package/static/dist/src__pages__script__editModal.cbf4ec0e.async.js +0 -1
- package/static/dist/src__pages__script__editNameModal.532a3044.async.js +0 -1
- package/static/dist/src__pages__script__index.1fc20f22.async.js +0 -1
- package/static/dist/src__pages__script__renameModal.5cdde919.async.js +0 -1
- package/static/dist/src__pages__script__saveModal.5ffed35f.async.js +0 -1
- package/static/dist/src__pages__script__setting.1a82c6d7.async.js +0 -1
- package/static/dist/src__pages__setting__appModal.43b7758a.async.js +0 -1
- package/static/dist/src__pages__setting__dependence.9c04c79a.async.js +0 -1
- package/static/dist/src__pages__setting__index.7e070838.async.js +0 -1
- package/static/dist/src__pages__setting__loginLog.cea6056c.async.js +0 -1
- package/static/dist/src__pages__setting__notification.bac481c2.async.js +0 -1
- package/static/dist/src__pages__setting__other.707cfafe.async.js +0 -1
- package/static/dist/src__pages__setting__security.b7235753.async.js +0 -1
- package/static/dist/src__pages__setting__systemLog.b81a8c1d.async.js +0 -1
- package/static/dist/src__pages__subscription__index.d0ab2abc.async.js +0 -1
- package/static/dist/src__pages__subscription__logModal.3864b37f.async.js +0 -1
- package/static/dist/src__pages__subscription__modal.562448e2.async.js +0 -1
package/.dockerignore
ADDED
package/.env.example
CHANGED
|
@@ -6,6 +6,13 @@ BACK_PORT=5700
|
|
|
6
6
|
# BIND_HOST=0.0.0.0
|
|
7
7
|
# BIND_HOST_GRPC=0.0.0.0
|
|
8
8
|
|
|
9
|
+
# 可信反向代理。未设置时可在「系统设置 → 客户端 IP」中配置和诊断。
|
|
10
|
+
# 环境变量优先级高于系统设置。支持固定层数、IP、CIDR 或逗号分隔列表:
|
|
11
|
+
# QL_TRUST_PROXY=1
|
|
12
|
+
# QL_TRUST_PROXY=loopback,172.18.0.0/16,10.20.0.8/32
|
|
13
|
+
# 仅在面板端口绝对无法绕过代理直接访问时使用 true。
|
|
14
|
+
# QL_TRUST_PROXY=loopback
|
|
15
|
+
|
|
9
16
|
LOG_LEVEL='info'
|
|
10
17
|
|
|
11
18
|
JWT_SECRET=
|
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- gitnexus:start -->
|
|
2
2
|
# GitNexus — Code Intelligence
|
|
3
3
|
|
|
4
|
-
This project is indexed by GitNexus as **qinglong** (
|
|
4
|
+
This project is indexed by GitNexus as **qinglong** (2778 symbols, 6698 relationships, 233 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
|
5
5
|
|
|
6
6
|
> Index stale? Run `node .gitnexus/run.cjs analyze` from the project root — it auto-selects an available runner. No `.gitnexus/run.cjs` yet? `npx gitnexus analyze` (npm 11 crash → `npm i -g gitnexus`; #1939).
|
|
7
7
|
|
|
@@ -40,4 +40,4 @@ This project is indexed by GitNexus as **qinglong** (2740 symbols, 6583 relation
|
|
|
40
40
|
| Tools, resources, schema reference | `.claude/skills/gitnexus/gitnexus-guide/SKILL.md` |
|
|
41
41
|
| Index, status, clean, wiki CLI commands | `.claude/skills/gitnexus/gitnexus-cli/SKILL.md` |
|
|
42
42
|
|
|
43
|
-
<!-- gitnexus:end -->
|
|
43
|
+
<!-- gitnexus:end -->
|
package/README-en.md
CHANGED
|
@@ -34,6 +34,7 @@ Timed task management platform supporting Python3, JavaScript, Shell, Typescript
|
|
|
34
34
|
- Support system level notification
|
|
35
35
|
- Support dark mode
|
|
36
36
|
- Support cell phone operation
|
|
37
|
+
- Manage panels through the [remote CLI and Agent Skill](#remote-cli-and-agent-skill)
|
|
37
38
|
|
|
38
39
|
## Version
|
|
39
40
|
|
|
@@ -79,6 +80,29 @@ npm i @whyour/qinglong
|
|
|
79
80
|
|
|
80
81
|
[View Documentation](https://qinglong.online/guide/user-guide/basic-explanation)
|
|
81
82
|
|
|
83
|
+
## Remote CLI and Agent Skill
|
|
84
|
+
|
|
85
|
+
Use the standalone npm package [@whyour/qinglong-cli](https://www.npmjs.com/package/@whyour/qinglong-cli) to manage a remote QingLong panel from your terminal or automation workflows. Create, update and run tasks and subscriptions, inspect logs, and manage applications, environment variables, scripts, configuration, dependencies and other OpenAPI resources. JSON output supports scripts and AI agents.
|
|
86
|
+
|
|
87
|
+
Requires Node.js >=22.12; Node.js 24 is recommended. Install the package to use `ql`:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm install -g @whyour/qinglong-cli
|
|
91
|
+
ql login --url https://ql.example.com
|
|
92
|
+
ql auth status --json
|
|
93
|
+
ql task list --json
|
|
94
|
+
ql subscription list --json
|
|
95
|
+
ql --help
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Create an application in the panel's System Settings → Application Settings and grant the required permissions. Enter its Client ID/Secret when prompted during login. Existing tokens are also supported through `QL_URL` and `QL_ACCESS_TOKEN`. Each command supports `--help`; set `QL_LANG=en` for English help.
|
|
99
|
+
|
|
100
|
+
The npm CLI manages remote panels. The panel's built-in executable is also named `ql`; use a separate installation directory on panel hosts to avoid replacing it. For local script execution and maintenance, see [panel-internal tools](cli/LOCAL.en.md).
|
|
101
|
+
|
|
102
|
+
[CLI guide](cli/README.en.md) · [简体中文](cli/README.md) · [Full command reference](cli/skills/qinglong-cli/references/openapi.md)
|
|
103
|
+
|
|
104
|
+
The package includes a [remote management skill](cli/skills/qinglong-cli/SKILL.md) covering authentication, command selection and result verification for AI agents. Local execution and maintenance have a separate [internal skill](cli/skills/qinglong-local/SKILL.md).
|
|
105
|
+
|
|
82
106
|
## Development
|
|
83
107
|
|
|
84
108
|
```bash
|
package/README.md
CHANGED
|
@@ -36,6 +36,7 @@ Timed task management platform supporting Python3, JavaScript, Shell, Typescript
|
|
|
36
36
|
- 支持系统级通知
|
|
37
37
|
- 支持暗黑模式
|
|
38
38
|
- 支持手机端操作
|
|
39
|
+
- 支持通过 [远程 CLI 与 Agent Skill](#远程-cli-与-agent-skill) 管理面板
|
|
39
40
|
|
|
40
41
|
## 版本
|
|
41
42
|
|
|
@@ -81,6 +82,29 @@ npm i @whyour/qinglong
|
|
|
81
82
|
|
|
82
83
|
[查看文档](https://qinglong.online/guide/user-guide/basic-explanation)
|
|
83
84
|
|
|
85
|
+
## 远程 CLI 与 Agent Skill
|
|
86
|
+
|
|
87
|
+
使用独立 npm 包 [@whyour/qinglong-cli](https://www.npmjs.com/package/@whyour/qinglong-cli),可以从本机终端或自动化流程管理远程青龙面板。支持任务与订阅的创建、修改、运行和日志查看,以及应用、环境变量、脚本、配置、依赖等 OpenAPI 资源;JSON 输出便于脚本和 AI Agent 使用。
|
|
88
|
+
|
|
89
|
+
需要 Node.js >=22.12,推荐 Node.js 24。安装后使用 `ql` 命令:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm install -g @whyour/qinglong-cli
|
|
93
|
+
ql login --url https://ql.example.com
|
|
94
|
+
ql auth status --json
|
|
95
|
+
ql task list --json
|
|
96
|
+
ql subscription list --json
|
|
97
|
+
ql --help
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
在面板「系统设置 → 应用设置」创建应用并授予所需权限,登录时按提示输入 Client ID/Secret;也支持通过 `QL_URL` 和 `QL_ACCESS_TOKEN` 使用已有令牌。各命令支持 `--help`,`QL_LANG=en` 可切换英文帮助。
|
|
101
|
+
|
|
102
|
+
npm CLI 用于远程管理。面板内置 `ql` 同样使用这个命令名,已有面板的机器请使用独立安装目录,避免覆盖内置命令。本机脚本执行和运维见 [面板内部工具](cli/LOCAL.md)。
|
|
103
|
+
|
|
104
|
+
[CLI 中文说明](cli/README.md) · [English guide](cli/README.en.md) · [完整命令参考](cli/skills/qinglong-cli/references/openapi.md)
|
|
105
|
+
|
|
106
|
+
包内附带 [远程管理 Skill](cli/skills/qinglong-cli/SKILL.md),涵盖认证、命令选择和操作结果检查,可供 AI Agent 使用。本机执行与运维另见 [内部 Skill](cli/skills/qinglong-local/SKILL.md)。
|
|
107
|
+
|
|
84
108
|
## 开发
|
|
85
109
|
|
|
86
110
|
```bash
|
package/back/protos/api.proto
CHANGED
|
@@ -152,6 +152,7 @@ enum NotificationMode {
|
|
|
152
152
|
ntfy = 19;
|
|
153
153
|
wxPusherBot = 20;
|
|
154
154
|
wxPusherSpt = 21;
|
|
155
|
+
wpush = 22;
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
message NotificationInfo {
|
|
@@ -247,6 +248,10 @@ message NotificationInfo {
|
|
|
247
248
|
optional string wxPusherBotUids = 68;
|
|
248
249
|
|
|
249
250
|
optional string wxPusherSptList = 70;
|
|
251
|
+
|
|
252
|
+
optional string wpushApiKey = 71;
|
|
253
|
+
optional string wpushChannel = 72;
|
|
254
|
+
optional string wpushTopicCode = 73;
|
|
250
255
|
}
|
|
251
256
|
|
|
252
257
|
message SystemNotifyRequest {
|
|
@@ -275,4 +280,4 @@ service Api {
|
|
|
275
280
|
rpc EnableCrons(EnableCronsRequest) returns (Response) {}
|
|
276
281
|
rpc DisableCrons(DisableCronsRequest) returns (Response) {}
|
|
277
282
|
rpc RunCrons(RunCronsRequest) returns (Response) {}
|
|
278
|
-
}
|
|
283
|
+
}
|
package/back/protos/cron.proto
CHANGED
package/docker/Dockerfile
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
# Run Node package installation natively on the builder. Node/npm can spin at
|
|
2
|
+
# 100% CPU when Alpine s390x is emulated through QEMU.
|
|
3
|
+
FROM --platform=$BUILDPLATFORM node:18-alpine3.18 AS builder
|
|
4
|
+
|
|
5
|
+
ARG TARGETARCH
|
|
6
|
+
ENV NPM_CONFIG_PREFIX=/opt/node-global
|
|
7
|
+
ENV PATH=/opt/node-global/bin:${PATH}
|
|
8
|
+
|
|
2
9
|
COPY package.json .npmrc pnpm-lock.yaml /tmp/build/
|
|
3
10
|
RUN set -x \
|
|
4
|
-
&& apk
|
|
5
|
-
&&
|
|
6
|
-
&& npm i -g pnpm@8.3.1 pm2 ts-node \
|
|
11
|
+
&& apk add --no-cache git \
|
|
12
|
+
&& npm i -g pnpm@8.3.1 pm2 ts-node typescript@5 \
|
|
7
13
|
&& cd /tmp/build \
|
|
8
|
-
&&
|
|
14
|
+
&& case "${TARGETARCH}" in \
|
|
15
|
+
amd64) NODE_ARCH=x64 ;; \
|
|
16
|
+
386) NODE_ARCH=ia32 ;; \
|
|
17
|
+
ppc64le) NODE_ARCH=ppc64 ;; \
|
|
18
|
+
*) NODE_ARCH="${TARGETARCH}" ;; \
|
|
19
|
+
esac \
|
|
20
|
+
&& npm_config_target_platform=linux \
|
|
21
|
+
npm_config_target_arch="${NODE_ARCH}" \
|
|
22
|
+
npm_config_target_libc=musl \
|
|
23
|
+
pnpm install --prod --frozen-lockfile
|
|
9
24
|
|
|
10
25
|
FROM python:3.11-alpine
|
|
11
26
|
|
|
@@ -26,8 +41,8 @@ VOLUME /ql/data
|
|
|
26
41
|
|
|
27
42
|
EXPOSE 5700
|
|
28
43
|
|
|
29
|
-
COPY --from=builder /
|
|
30
|
-
COPY --from=builder /
|
|
44
|
+
COPY --from=builder /opt/node-global/lib/node_modules/. /usr/local/lib/node_modules/
|
|
45
|
+
COPY --from=builder /opt/node-global/bin/. /usr/local/bin/
|
|
31
46
|
|
|
32
47
|
RUN set -x \
|
|
33
48
|
&& apk update -f \
|
|
@@ -58,15 +73,19 @@ RUN set -x \
|
|
|
58
73
|
&& ulimit -c 0
|
|
59
74
|
|
|
60
75
|
ARG SOURCE_COMMIT
|
|
76
|
+
LABEL org.opencontainers.image.revision=${SOURCE_COMMIT}
|
|
61
77
|
RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \
|
|
62
78
|
&& cd ${QL_DIR} \
|
|
79
|
+
&& if [ -n "${SOURCE_COMMIT}" ]; then git fetch --depth=1 origin "${SOURCE_COMMIT}" && git reset --hard FETCH_HEAD; fi \
|
|
63
80
|
&& cp -f .env.example .env \
|
|
64
81
|
&& chmod 777 ${QL_DIR}/shell/*.sh \
|
|
65
|
-
&& chmod 777 ${QL_DIR}/docker/*.sh
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
82
|
+
&& chmod 777 ${QL_DIR}/docker/*.sh
|
|
83
|
+
|
|
84
|
+
# Downloaded by CI from the build-static job in this workflow run.
|
|
85
|
+
COPY static/ /ql/static/
|
|
86
|
+
COPY docker/verify-build.cjs docker/build-manifest.cjs /tmp/
|
|
87
|
+
COPY --from=builder /tmp/build/pnpm-lock.yaml /tmp/dependency-lock.yaml
|
|
88
|
+
RUN cd ${QL_DIR} && node /tmp/verify-build.cjs /tmp/dependency-lock.yaml
|
|
70
89
|
|
|
71
90
|
ENV PNPM_HOME=${QL_DIR}/data/dep_cache/node \
|
|
72
91
|
PYTHON_HOME=${QL_DIR}/data/dep_cache/python3 \
|
package/docker/Dockerfile.310
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
# Run Node package installation natively on the builder. Node/npm can spin at
|
|
2
|
+
# 100% CPU when Alpine s390x is emulated through QEMU.
|
|
3
|
+
FROM --platform=$BUILDPLATFORM node:18-alpine3.18 AS builder
|
|
4
|
+
|
|
5
|
+
ARG TARGETARCH
|
|
6
|
+
ENV NPM_CONFIG_PREFIX=/opt/node-global
|
|
7
|
+
ENV PATH=/opt/node-global/bin:${PATH}
|
|
8
|
+
|
|
2
9
|
COPY package.json .npmrc pnpm-lock.yaml /tmp/build/
|
|
3
10
|
RUN set -x \
|
|
4
|
-
&& apk
|
|
5
|
-
&&
|
|
6
|
-
&& npm i -g pnpm@8.3.1 pm2 ts-node \
|
|
11
|
+
&& apk add --no-cache git \
|
|
12
|
+
&& npm i -g pnpm@8.3.1 pm2 ts-node typescript@5 \
|
|
7
13
|
&& cd /tmp/build \
|
|
8
|
-
&&
|
|
14
|
+
&& case "${TARGETARCH}" in \
|
|
15
|
+
amd64) NODE_ARCH=x64 ;; \
|
|
16
|
+
386) NODE_ARCH=ia32 ;; \
|
|
17
|
+
ppc64le) NODE_ARCH=ppc64 ;; \
|
|
18
|
+
*) NODE_ARCH="${TARGETARCH}" ;; \
|
|
19
|
+
esac \
|
|
20
|
+
&& npm_config_target_platform=linux \
|
|
21
|
+
npm_config_target_arch="${NODE_ARCH}" \
|
|
22
|
+
npm_config_target_libc=musl \
|
|
23
|
+
pnpm install --prod --frozen-lockfile
|
|
9
24
|
|
|
10
25
|
FROM python:3.10-alpine
|
|
11
26
|
|
|
@@ -26,8 +41,8 @@ VOLUME /ql/data
|
|
|
26
41
|
|
|
27
42
|
EXPOSE 5700
|
|
28
43
|
|
|
29
|
-
COPY --from=builder /
|
|
30
|
-
COPY --from=builder /
|
|
44
|
+
COPY --from=builder /opt/node-global/lib/node_modules/. /usr/local/lib/node_modules/
|
|
45
|
+
COPY --from=builder /opt/node-global/bin/. /usr/local/bin/
|
|
31
46
|
|
|
32
47
|
RUN set -x \
|
|
33
48
|
&& apk update -f \
|
|
@@ -58,15 +73,19 @@ RUN set -x \
|
|
|
58
73
|
&& ulimit -c 0
|
|
59
74
|
|
|
60
75
|
ARG SOURCE_COMMIT
|
|
76
|
+
LABEL org.opencontainers.image.revision=${SOURCE_COMMIT}
|
|
61
77
|
RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \
|
|
62
78
|
&& cd ${QL_DIR} \
|
|
79
|
+
&& if [ -n "${SOURCE_COMMIT}" ]; then git fetch --depth=1 origin "${SOURCE_COMMIT}" && git reset --hard FETCH_HEAD; fi \
|
|
63
80
|
&& cp -f .env.example .env \
|
|
64
81
|
&& chmod 777 ${QL_DIR}/shell/*.sh \
|
|
65
|
-
&& chmod 777 ${QL_DIR}/docker/*.sh
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
82
|
+
&& chmod 777 ${QL_DIR}/docker/*.sh
|
|
83
|
+
|
|
84
|
+
# Downloaded by CI from the build-static job in this workflow run.
|
|
85
|
+
COPY static/ /ql/static/
|
|
86
|
+
COPY docker/verify-build.cjs docker/build-manifest.cjs /tmp/
|
|
87
|
+
COPY --from=builder /tmp/build/pnpm-lock.yaml /tmp/dependency-lock.yaml
|
|
88
|
+
RUN cd ${QL_DIR} && node /tmp/verify-build.cjs /tmp/dependency-lock.yaml
|
|
70
89
|
|
|
71
90
|
ENV PNPM_HOME=${QL_DIR}/data/dep_cache/node \
|
|
72
91
|
PYTHON_HOME=${QL_DIR}/data/dep_cache/python3 \
|
package/docker/Dockerfile.debian
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Node 20 Bookworm is the latest official Node image variant that covers the
|
|
2
|
+
# full Debian build matrix, including arm/v7, ppc64le, and s390x.
|
|
3
|
+
FROM node:20-bookworm-slim AS nodebuilder
|
|
2
4
|
|
|
3
|
-
FROM python:3.11-slim-bookworm AS builder
|
|
5
|
+
FROM python:3.11.14-slim-bookworm AS builder
|
|
4
6
|
COPY package.json .npmrc pnpm-lock.yaml /tmp/build/
|
|
5
7
|
COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/
|
|
6
8
|
COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/
|
|
@@ -10,9 +12,9 @@ RUN set -x && \
|
|
|
10
12
|
apt-get install --no-install-recommends -y libatomic1 && \
|
|
11
13
|
npm i -g pnpm@8.3.1 && \
|
|
12
14
|
cd /tmp/build && \
|
|
13
|
-
pnpm install --prod
|
|
15
|
+
pnpm install --prod --frozen-lockfile
|
|
14
16
|
|
|
15
|
-
FROM python:3.11-slim-bookworm
|
|
17
|
+
FROM python:3.11.14-slim-bookworm
|
|
16
18
|
|
|
17
19
|
ARG QL_MAINTAINER="whyour"
|
|
18
20
|
LABEL maintainer="${QL_MAINTAINER}"
|
|
@@ -67,9 +69,11 @@ RUN set -x && \
|
|
|
67
69
|
git config --global user.email "qinglong@users.noreply.github.com" && \
|
|
68
70
|
git config --global user.name "qinglong" && \
|
|
69
71
|
git config --global http.postBuffer 524288000 && \
|
|
70
|
-
npm install -g pnpm@8.3.1 pm2 ts-node && \
|
|
72
|
+
npm install -g pnpm@8.3.1 pm2 ts-node typescript@5 && \
|
|
73
|
+
npm cache clean --force && \
|
|
71
74
|
rm -rf /root/.cache && \
|
|
72
75
|
rm -rf /root/.npm && \
|
|
76
|
+
rm -rf /var/lib/apt/lists/* && \
|
|
73
77
|
rm -rf /etc/apt/apt.conf.d/docker-clean && \
|
|
74
78
|
ulimit -c 0
|
|
75
79
|
|
|
@@ -78,15 +82,19 @@ RUN mkdir -p ${QL_DIR} && \
|
|
|
78
82
|
|
|
79
83
|
USER qinglong
|
|
80
84
|
ARG SOURCE_COMMIT
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
LABEL org.opencontainers.image.revision=${SOURCE_COMMIT}
|
|
86
|
+
RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \
|
|
87
|
+
&& cd ${QL_DIR} \
|
|
88
|
+
&& if [ -n "${SOURCE_COMMIT}" ]; then git fetch --depth=1 origin "${SOURCE_COMMIT}" && git reset --hard FETCH_HEAD; fi \
|
|
89
|
+
&& cp -f .env.example .env \
|
|
90
|
+
&& chmod 777 ${QL_DIR}/shell/*.sh \
|
|
91
|
+
&& chmod 777 ${QL_DIR}/docker/*.sh
|
|
92
|
+
|
|
93
|
+
# Downloaded by CI from the build-static job in this workflow run.
|
|
94
|
+
COPY --chown=qinglong:qinglong static/ /ql/static/
|
|
95
|
+
COPY docker/verify-build.cjs docker/build-manifest.cjs /tmp/
|
|
96
|
+
COPY --from=builder /tmp/build/pnpm-lock.yaml /tmp/dependency-lock.yaml
|
|
97
|
+
RUN cd ${QL_DIR} && node /tmp/verify-build.cjs /tmp/dependency-lock.yaml
|
|
90
98
|
|
|
91
99
|
ENV PNPM_HOME=${QL_DIR}/data/dep_cache/node \
|
|
92
100
|
PYTHON_HOME=${QL_DIR}/data/dep_cache/python3 \
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
# Node 20 Bookworm is the latest official Node image variant that covers the
|
|
2
|
+
# full Debian build matrix, including arm/v7, ppc64le, and s390x.
|
|
3
|
+
FROM node:20-bookworm-slim AS nodebuilder
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
# Keep the full release matrix, including s390x, on the same immutable base.
|
|
6
|
+
# The floating 3.10-slim-bookworm tag no longer includes s390x.
|
|
7
|
+
FROM python:3.10.19-slim-bookworm@sha256:23f63358922e79a794f71be8f3723c84e5ccca9638af3f74456dc73d6184499e AS builder
|
|
4
8
|
COPY package.json .npmrc pnpm-lock.yaml /tmp/build/
|
|
5
9
|
COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/
|
|
6
10
|
COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/
|
|
@@ -10,9 +14,9 @@ RUN set -x && \
|
|
|
10
14
|
apt-get install --no-install-recommends -y libatomic1 && \
|
|
11
15
|
npm i -g pnpm@8.3.1 && \
|
|
12
16
|
cd /tmp/build && \
|
|
13
|
-
pnpm install --prod
|
|
17
|
+
pnpm install --prod --frozen-lockfile
|
|
14
18
|
|
|
15
|
-
FROM python:3.10-slim-bookworm
|
|
19
|
+
FROM python:3.10.19-slim-bookworm@sha256:23f63358922e79a794f71be8f3723c84e5ccca9638af3f74456dc73d6184499e
|
|
16
20
|
|
|
17
21
|
ARG QL_MAINTAINER="whyour"
|
|
18
22
|
LABEL maintainer="${QL_MAINTAINER}"
|
|
@@ -66,9 +70,11 @@ RUN set -x && \
|
|
|
66
70
|
git config --global user.email "qinglong@users.noreply.github.com" && \
|
|
67
71
|
git config --global user.name "qinglong" && \
|
|
68
72
|
git config --global http.postBuffer 524288000 && \
|
|
69
|
-
npm install -g pnpm@8.3.1 pm2 ts-node && \
|
|
73
|
+
npm install -g pnpm@8.3.1 pm2 ts-node typescript@5 && \
|
|
74
|
+
npm cache clean --force && \
|
|
70
75
|
rm -rf /root/.cache && \
|
|
71
76
|
rm -rf /root/.npm && \
|
|
77
|
+
rm -rf /var/lib/apt/lists/* && \
|
|
72
78
|
rm -rf /etc/apt/apt.conf.d/docker-clean && \
|
|
73
79
|
ulimit -c 0
|
|
74
80
|
|
|
@@ -78,15 +84,19 @@ RUN mkdir -p ${QL_DIR} && \
|
|
|
78
84
|
USER qinglong
|
|
79
85
|
|
|
80
86
|
ARG SOURCE_COMMIT
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
LABEL org.opencontainers.image.revision=${SOURCE_COMMIT}
|
|
88
|
+
RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \
|
|
89
|
+
&& cd ${QL_DIR} \
|
|
90
|
+
&& if [ -n "${SOURCE_COMMIT}" ]; then git fetch --depth=1 origin "${SOURCE_COMMIT}" && git reset --hard FETCH_HEAD; fi \
|
|
91
|
+
&& cp -f .env.example .env \
|
|
92
|
+
&& chmod 777 ${QL_DIR}/shell/*.sh \
|
|
93
|
+
&& chmod 777 ${QL_DIR}/docker/*.sh
|
|
94
|
+
|
|
95
|
+
# Downloaded by CI from the build-static job in this workflow run.
|
|
96
|
+
COPY --chown=qinglong:qinglong static/ /ql/static/
|
|
97
|
+
COPY docker/verify-build.cjs docker/build-manifest.cjs /tmp/
|
|
98
|
+
COPY --from=builder /tmp/build/pnpm-lock.yaml /tmp/dependency-lock.yaml
|
|
99
|
+
RUN cd ${QL_DIR} && node /tmp/verify-build.cjs /tmp/dependency-lock.yaml
|
|
90
100
|
|
|
91
101
|
ENV PNPM_HOME=${QL_DIR}/data/dep_cache/node \
|
|
92
102
|
PYTHON_HOME=${QL_DIR}/data/dep_cache/python3 \
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
const crypto = require('node:crypto');
|
|
4
|
+
|
|
5
|
+
// Include every artifact, including imported backend modules and frontend chunks.
|
|
6
|
+
function collectBuildFiles(root = 'static') {
|
|
7
|
+
const files = {};
|
|
8
|
+
function visit(relative) {
|
|
9
|
+
for (const name of fs.readdirSync(path.join(root, relative)).sort()) {
|
|
10
|
+
const entry = relative ? `${relative}/${name}` : name;
|
|
11
|
+
if (entry === 'build-info.json') continue;
|
|
12
|
+
const file = path.join(root, entry);
|
|
13
|
+
const stat = fs.lstatSync(file);
|
|
14
|
+
if (stat.isSymbolicLink())
|
|
15
|
+
throw new Error(`Build output symlink: ${entry}`);
|
|
16
|
+
if (stat.isDirectory()) visit(entry);
|
|
17
|
+
else if (stat.isFile()) {
|
|
18
|
+
files[entry] = crypto
|
|
19
|
+
.createHash('sha256')
|
|
20
|
+
.update(fs.readFileSync(file))
|
|
21
|
+
.digest('hex');
|
|
22
|
+
} else throw new Error(`Unsupported build output: ${entry}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
visit('');
|
|
26
|
+
return files;
|
|
27
|
+
}
|
|
28
|
+
module.exports = { collectBuildFiles };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const crypto = require('node:crypto');
|
|
3
|
+
const { execFileSync } = require('node:child_process');
|
|
4
|
+
const { collectBuildFiles } = require('./build-manifest.cjs');
|
|
5
|
+
|
|
6
|
+
const manifest = JSON.parse(fs.readFileSync('static/build-info.json', 'utf8'));
|
|
7
|
+
const sourceCommit = execFileSync('git', ['rev-parse', 'HEAD'], {
|
|
8
|
+
encoding: 'utf8',
|
|
9
|
+
}).trim();
|
|
10
|
+
const lockfileSha256 = crypto
|
|
11
|
+
.createHash('sha256')
|
|
12
|
+
.update(fs.readFileSync('pnpm-lock.yaml'))
|
|
13
|
+
.digest('hex');
|
|
14
|
+
if (
|
|
15
|
+
manifest.dirty !== false ||
|
|
16
|
+
manifest.sourceCommit !== sourceCommit ||
|
|
17
|
+
manifest.lockfileSha256 !== lockfileSha256
|
|
18
|
+
) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
'Build artifacts do not match the checked-out source and lockfile. Rebuild from the same clean commit.',
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (process.argv[2]) {
|
|
25
|
+
const dependencyLock = crypto
|
|
26
|
+
.createHash('sha256')
|
|
27
|
+
.update(fs.readFileSync(process.argv[2]))
|
|
28
|
+
.digest('hex');
|
|
29
|
+
if (dependencyLock !== manifest.lockfileSha256)
|
|
30
|
+
throw new Error(
|
|
31
|
+
'Production dependencies were built from a different lockfile.',
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const actual = collectBuildFiles();
|
|
36
|
+
if (
|
|
37
|
+
manifest.version !== 1 ||
|
|
38
|
+
!manifest.files ||
|
|
39
|
+
JSON.stringify(Object.keys(actual).sort()) !==
|
|
40
|
+
JSON.stringify(Object.keys(manifest.files).sort())
|
|
41
|
+
)
|
|
42
|
+
throw new Error(
|
|
43
|
+
'Build output file set mismatch. Rebuild the complete artifacts.',
|
|
44
|
+
);
|
|
45
|
+
for (const [file, hash] of Object.entries(actual)) {
|
|
46
|
+
if (hash !== manifest.files[file])
|
|
47
|
+
throw new Error(`Build output checksum mismatch: ${file}`);
|
|
48
|
+
}
|
|
49
|
+
console.log(`Verified build artifacts for ${sourceCommit}`);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# 2.22.0 发布准备验收
|
|
2
|
+
|
|
3
|
+
日期:2026-09-26。候选代码基于 `origin/develop@801a71d7402f5d4b582318ed88ad00633357a531`,主包和面板版本统一为 `2.22.0`。本文件记录验收证据,不代表已经发布。
|
|
4
|
+
|
|
5
|
+
## 自动化与构建
|
|
6
|
+
|
|
7
|
+
- 新增 5 项日志弹窗回归:大日志结束后读完分页、尾部截取不重复取历史、运行中空日志继续轮询、关闭取消定时器/丢弃在途响应、旧响应和不前进偏移不死循环。
|
|
8
|
+
- 用真实日志读取器写入 600 KiB 后结束任务:原 develop 在新增回归中失败,修复后 5 项全通过。
|
|
9
|
+
- macOS arm64、Node 20、按冻结锁文件独立安装依赖:228 项测试,225 通过、3 项平台相关跳过、0 失败。后端 TypeScript 与前端生产构建通过;前端有已有的大包体提示。
|
|
10
|
+
- `npm pack --dry-run` 成功,包含前后端产物,主包版本为 2.22.0;npm registry 查询该版本返回 E404(尚未占用,发布时仍需重新核实)。
|
|
11
|
+
- 上游基线 Linux CI 为 223 项回归全部通过;CLI Node 22.12/24 流水线通过,Node 24 的 291 项测试全部通过。该结果属于上游提交,不冒充本分支新的 CI 结果。
|
|
12
|
+
- GitNexus 对 `getCronLog` 修改前影响分析:LOW,直接调用者 `CronLogModal`,1 条流程。最终差异分析涉及日志弹窗流程;行号移动也将 `autoScroll` 列出,但该函数实现未修改。
|
|
13
|
+
|
|
14
|
+
## 容器升级与回退
|
|
15
|
+
|
|
16
|
+
测试仅使用新建账号、新建任务和隔离容器数据,不接触真实用户数据。
|
|
17
|
+
|
|
18
|
+
- 已发布旧版镜像 `whyour/qinglong:2.21.0` digest:`sha256:e72f77d855a86cfabf774de76b030731c38540b251a0c888038810fbcf256c48`。镜像内源码为 `9b37f064d815baf49b1869445bbd60e4209bacc9`,与当前 master 提交不同;这是已发布镜像到候选版的实际升级验收。
|
|
19
|
+
- 候选运行环境为 `whyour/qinglong:develop` digest:`sha256:35c5b9f2d0666ab7fcde954f175087c097e93fa852306360aa07b8aa0a5d0481`,revision 标签对应 `801a71d7402f5d4b582318ed88ad00633357a531`。装入本分支本地构建的前后端及版本文件。因此验证了候选代码的容器运行,不等同于最终发行镜像的完整构建验收。
|
|
20
|
+
- 旧版创建账号及真实 Shell 脚本任务并验证独立输出,停机复制完整 `/ql/data` 作为一致的升级前备份。
|
|
21
|
+
- 候选版读取该备份后原密码可登录、原任务仍存在并能真实执行,数据库已增加迁移表,测试账号密码已转为 scrypt(仅检查布尔值,未记录凭据)。
|
|
22
|
+
- 长运行脚本启动后确认实际 PID;停止后确认该进程不存在;立即重跑并再次停止成功。状态字段恢复为空闲;不把历史 PID 字段当作进程存活判断。
|
|
23
|
+
- 两步验证启用、密码阶段返回挑战、OTP 登录、同一验证码重放拒绝、关闭两步验证及重新登录均通过。
|
|
24
|
+
- 每 5 秒调度的测试脚本产生持续输出;本容器 HTTP 夹具订阅下载 V1 文件成功。
|
|
25
|
+
- 订阅夹具更新为 V2 后再次同步,落盘内容已变为 V2。
|
|
26
|
+
- 容器重启前调度标记 34 行,重启后 41 行,HTTP/gRPC 健康且可重新登录,确认定时注册恢复。
|
|
27
|
+
- 将升级前完整备份恢复到全新的 2.21.0 容器,原密码登录、原任务保留及真实脚本输出均通过。
|
|
28
|
+
|
|
29
|
+
## 生产依赖审计:仍需处理
|
|
30
|
+
|
|
31
|
+
在无共享 node_modules 的临时目录,使用候选 `package.json` 和 `pnpm-lock.yaml` 执行 `pnpm audit --prod --json`:414 个依赖,报告 3 Critical、38 High、49 Moderate、9 Low。数量是扫描公告命中,不等于独立漏洞数量或均能在面板中利用。审计时间与数据库变化会影响结果。
|
|
32
|
+
|
|
33
|
+
| Critical 命中 | 生产依赖路径 | 初步适用性与处理 |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| protobufjs 7.5.4 | `@grpc/proto-loader → protobufjs` | 公告要求攻击者能控制加载的 schema/descriptor;当前主要使用仓库内生成的协议,尚未证实外部可控 schema 入口。仍应升级到修复版本并验证 gRPC。 |
|
|
36
|
+
| websocket-driver 0.7.4 | `sockjs → websocket-driver` / `faye-websocket` | 处理网络协议帧,不能用面板业务鉴权替代协议层修复;应升级到至少 0.7.5 并回归 WebSocket。 |
|
|
37
|
+
| tar 6.2.1 | `@whyour/sqlite3 → tar`、`@mapbox/node-pre-gyp → tar` | 主要涉及安装/构建解压链,不能直接等同于面板上传接口漏洞。修复跨 tar 主版本,需验证 SQLite 预编译下载和源码编译路径;另有 tar 7.5.20 的后续公告。 |
|
|
38
|
+
|
|
39
|
+
参考:[protobufjs 公告](https://github.com/advisories/GHSA-xq3m-2v4x-88gg)、[websocket-driver 公告](https://github.com/advisories/GHSA-xv26-6w52-cph6)、[tar 公告](https://github.com/advisories/GHSA-23hp-3jrh-7fpw)。
|
|
40
|
+
|
|
41
|
+
High 命中还涉及 gRPC、multer、js-yaml、JWT 的 jws、undici 等运行时依赖。当前准备改动没有批量升级依赖;不能宣称安全扫描通过。正式发布仍需完成依赖升级与可达性评估、回归,或由维护者明确记录接受的风险。
|
|
42
|
+
|
|
43
|
+
## 尚未放行的发布步骤
|
|
44
|
+
|
|
45
|
+
- 本分支新的 Linux CI 尚待执行。
|
|
46
|
+
- Python 3.10 镜像和全部架构的最终候选构建尚未验证;上游 develop 工作流跳过这些发布专用任务。
|
|
47
|
+
- 主包及 CLI 的 npm Trusted Publisher 设置属于 npm 账户配置,未通过代码或只读公开 registry 验证;不得把 `id-token: write` 视作已完成授权。
|
|
48
|
+
- 最终发版时确认 `publishTime` 与实际发布时间一致,并重新核对版本是否可发布。
|
|
49
|
+
- 完成上述事项前不合并到 master、不打正式 tag、不执行 `shell/pub.sh`。
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# 青龙 2.22.0
|
|
2
|
+
|
|
3
|
+
## 新增功能
|
|
4
|
+
|
|
5
|
+
- 独立远程命令行包 `@whyour/qinglong-cli`:覆盖任务、订阅、环境变量、配置、脚本、日志、依赖、应用、系统等 OpenAPI,支持认证、JSON 输出和中英文帮助。
|
|
6
|
+
- 可选面板内部 TypeScript 工具:任务执行、订阅同步、启动检查、升级重载和账号恢复。默认继续使用原 Shell 入口。
|
|
7
|
+
- 仪表盘支持点击今日成功、今日失败查看任务明细。
|
|
8
|
+
- 客户端 IP 和代理链诊断、可信代理配置、登录 IP 黑名单。
|
|
9
|
+
- 历史运行实例和统计数据的保留参数、清理预览、手动清理、依赖缓存清理和数据库压缩。保存保留参数不等于开启自动清理。
|
|
10
|
+
- WPUSH 通知,支持面板、JavaScript、Python 和 gRPC。
|
|
11
|
+
- `ql log [--lines <n>] [--nostream]` 查看服务日志。
|
|
12
|
+
|
|
13
|
+
## 修复与优化
|
|
14
|
+
|
|
15
|
+
- 修复任务生命周期、调度锁、调度器就绪和恢复、排队与停止竞争、订阅清理,以及停止失败的反馈。
|
|
16
|
+
- 日志改为分块读取;任务结束后继续读完剩余分页,确保最后的输出和退出信息可见。修复中文任务日志名。
|
|
17
|
+
- 加固密码存储、JWT 有效性校验、两步验证、认证状态变更和文件路径访问。
|
|
18
|
+
- 修复过期登录令牌引起的页面刷新循环,完善任务字段校验提示。
|
|
19
|
+
- 减少常驻依赖和重复 WebSocket 鉴权,限制指标缓存和日志显示量,优化大目录枚举。
|
|
20
|
+
- 优化 Node 路径缓存与 Alpine 并发缓存锁,修正依赖缓存清理后的安装状态。
|
|
21
|
+
- 启动时保留 `.env` 配置;保留容器启动错误诊断;数据库迁移失败时中止启动。
|
|
22
|
+
- 镜像增加 provenance、SBOM、源码/静态产物/依赖锁文件一致性校验,改进多架构构建。
|
|
23
|
+
|
|
24
|
+
## 升级兼容性
|
|
25
|
+
|
|
26
|
+
### 数据备份与回退
|
|
27
|
+
|
|
28
|
+
升级前停止面板和任务,备份完整持久化数据目录,并记录当前镜像的不可变 digest、启动参数、挂载和环境配置。不要只复制正在写入的 SQLite 主文件;必须保留完整离线数据备份。
|
|
29
|
+
|
|
30
|
+
新版兼容旧密码;首次成功登录或修改密码后,密码会迁移为 scrypt 哈希。旧版不识别这种格式,因此**不能只回退镜像并继续使用升级后的数据**。
|
|
31
|
+
|
|
32
|
+
需要回退时:停止新版,另外保存升级后的数据,恢复升级前的完整备份,再使用原镜像 digest 和原启动配置启动旧版。恢复备份会丢弃备份后产生的任务、配置和日志变更。如必须保留升级后数据,应单独验证旧版兼容性,并通过可信终端使用旧版账号恢复功能重新设置密码;不要手工把哈希当作密码使用。
|
|
33
|
+
|
|
34
|
+
数据库迁移新增 `SchemaMigrations` 和任务排队标识;迁移异常会阻止启动。应检查启动日志并修复数据或恢复备份,不要通过删除数据库来绕过错误。
|
|
35
|
+
|
|
36
|
+
### API 与日志
|
|
37
|
+
|
|
38
|
+
旧文件读取路由 `/configs/:file`、`/scripts/:file`、`/logs/:file` 返回业务码 `410`,请改用对应的 `/detail` 接口(适用于 `/api` 和 `/open` 前缀)。
|
|
39
|
+
|
|
40
|
+
日志接口默认返回尾部片段。客户端需要使用 `offset`、`nextOffset`、`total` 读取后续数据;任务已结束不代表所有日志已经读取完毕。面板仅保留有限长度的日志显示,完整文件仍在日志目录中。
|
|
41
|
+
|
|
42
|
+
修改账号或两步验证配置会使旧会话失效;客户端应重新登录。IP 黑名单针对登录;反向代理场景应先在客户端 IP 页面确认识别结果再配置黑名单。
|
|
43
|
+
|
|
44
|
+
### CLI
|
|
45
|
+
|
|
46
|
+
远程 npm CLI 要求 Node >=22.12,推荐 Node 24。它与面板内置工具均使用 `ql` 名称;已有面板的机器应使用独立 npm prefix 或 `npm exec --package=@whyour/qinglong-cli -- ql ...`,避免覆盖内置命令。
|
|
47
|
+
|
|
48
|
+
远程 npm 包不包含本机执行器、升级、重载和账号恢复实现,也不会自动切换面板入口。使用内部工具需单独构建完整 `cli/dist`,在满足 Node 版本要求的环境中显式设置 `QL_CLI_ROOT`;清除该变量并重启恢复 Shell 入口。标准面板镜像并未默认启用内部 TypeScript 工具。
|
|
49
|
+
|
|
50
|
+
## 发布验收
|
|
51
|
+
|
|
52
|
+
正式发布前应完成:旧版离线数据升级、登录与两步验证、定时/手动任务、停止后立即重跑、订阅更新、容器重启调度恢复和备份回退。发布者还需检查 Python 3.10 镜像矩阵,以及主包和 CLI 的 npm Trusted Publisher 配置。
|
|
53
|
+
|
|
54
|
+
依赖审计与执行证据见同目录的 `2.22.0-validation.md`。通过单元测试或构建不代表完成所有平台和真实升级场景的验收。
|
package/ecosystem.config.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
+
const isContainer = process.env.QL_CONTAINER === 'true';
|
|
2
|
+
|
|
1
3
|
module.exports = {
|
|
2
4
|
apps: [
|
|
3
5
|
{
|
|
4
6
|
name: 'qinglong',
|
|
7
|
+
// Keep process supervision; enable injected diagnostics only on demand
|
|
8
|
+
// in containers. Standalone installs retain PM2's monitoring default.
|
|
9
|
+
pmx: !isContainer || process.env.QL_PRIMARY_APM === 'true',
|
|
5
10
|
max_restarts: 5,
|
|
6
11
|
kill_timeout: 1000,
|
|
7
12
|
wait_ready: true,
|
|
8
13
|
listen_timeout: 5000,
|
|
9
14
|
source_map_support: true,
|
|
10
|
-
time:
|
|
15
|
+
time: !isContainer,
|
|
16
|
+
out_file: isContainer ? '/dev/null' : undefined,
|
|
17
|
+
// Do not persist PM2 logs in containers, but keep early startup errors
|
|
18
|
+
// visible through `docker logs` before Winston is initialized.
|
|
19
|
+
error_file: isContainer ? '/proc/1/fd/2' : undefined,
|
|
11
20
|
script: 'static/build/app.js',
|
|
12
21
|
env: {
|
|
13
22
|
http_proxy: '',
|