@whyour/qinglong 2.21.0 → 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 +9 -1
- package/back/protos/cron.proto +4 -1
- package/deploy/kubernetes/README.md +81 -0
- package/deploy/kubernetes/base/kustomization.yaml +5 -0
- package/deploy/kubernetes/base/qinglong.yaml +95 -0
- package/deploy/kubernetes/overlays/example/kustomization.yaml +10 -0
- 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 +17 -2
- package/sample/notify.js +118 -0
- package/sample/notify.py +93 -0
- package/scripts/benchmark-execution.cjs +96 -0
- package/scripts/write-build-info.cjs +27 -0
- package/shell/api.sh +41 -14
- 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 +10 -1
- package/shell/preload/sitecustomize.js +5 -1
- package/shell/share.sh +26 -9
- 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 +39 -3
- package/static/build/api/dashboard.js +50 -6
- package/static/build/api/env.js +2 -2
- package/static/build/api/health.js +2 -2
- package/static/build/api/index.js +4 -0
- package/static/build/api/log.js +39 -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 +31 -9
- package/static/build/api/user.js +75 -15
- package/static/build/app.js +63 -54
- package/static/build/bootstrap/database.js +51 -0
- package/static/build/config/const.js +2 -0
- package/static/build/config/grpcCerts.js +4 -4
- package/static/build/config/index.js +0 -4
- package/static/build/config/share.js +5 -4
- package/static/build/config/util.js +136 -41
- package/static/build/data/cron.js +1 -0
- package/static/build/data/notify.js +18 -1
- package/static/build/data/sock.js +1 -0
- package/static/build/loaders/app.js +8 -6
- package/static/build/loaders/db.js +5 -35
- package/static/build/loaders/deps.js +30 -22
- package/static/build/loaders/express.js +44 -32
- package/static/build/loaders/initData.js +10 -7
- package/static/build/loaders/initFile.js +1 -1
- package/static/build/loaders/initTask.js +3 -2
- package/static/build/loaders/server.js +1 -1
- 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 +78 -2
- package/static/build/protos/cron.js +21 -4
- package/static/build/protos/health.js +1 -1
- package/static/build/schedule/addCron.js +76 -10
- package/static/build/schedule/api.js +5 -2
- package/static/build/schedule/client.js +38 -6
- package/static/build/schedule/delCron.js +11 -1
- package/static/build/schedule/health.js +72 -7
- package/static/build/services/config.js +5 -42
- package/static/build/services/cron.js +353 -164
- package/static/build/services/dependence.js +66 -18
- package/static/build/services/grpc.js +2 -2
- package/static/build/services/health.js +4 -7
- package/static/build/services/http.js +9 -3
- package/static/build/services/log.js +2 -3
- package/static/build/services/metrics.js +46 -14
- package/static/build/services/notify.js +73 -5
- 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 +57 -34
- package/static/build/services/system.js +49 -11
- package/static/build/services/user.js +244 -31
- package/static/build/shared/auth.js +22 -3
- 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 +62 -4
- package/static/build/shared/logReader.js +85 -0
- package/static/build/shared/logStreamManager.js +80 -60
- package/static/build/shared/pLimit.js +3 -2
- 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 +12 -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.0b8cce8c.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.d175b154.async.js +1 -0
- 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.ca04a019.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.c420132e.async.js +0 -1
- package/static/dist/134.54df9e38.async.js +0 -1
- package/static/dist/2208.f7ba3dfa.async.js +0 -1
- package/static/dist/2286.164bb089.async.js +0 -1
- package/static/dist/3191.63263871.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.2447a104.async.js +0 -1
- package/static/dist/layouts__index.a7a2bfe0.async.js +0 -1
- package/static/dist/preload_helper.0431c0f3.js +0 -1
- package/static/dist/src__pages__crontab__detail.b9c36808.async.js +0 -1
- package/static/dist/src__pages__crontab__index.fed99fd0.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.b30f2f47.async.js +0 -1
- package/static/dist/src__pages__dependence__index.3d87ceac.async.js +0 -1
- package/static/dist/src__pages__dependence__logModal.0681830b.async.js +0 -1
- package/static/dist/src__pages__dependence__modal.11124896.async.js +0 -1
- package/static/dist/src__pages__env__editNameModal.5d264b25.async.js +0 -1
- package/static/dist/src__pages__env__index.baa27d4e.async.js +0 -1
- package/static/dist/src__pages__env__modal.7f2ef1bc.async.js +0 -1
- package/static/dist/src__pages__error__index.f156b45e.async.js +0 -1
- package/static/dist/src__pages__initialization__index.e96d4ba8.async.js +0 -1
- package/static/dist/src__pages__log__index.e0978bae.async.js +0 -1
- package/static/dist/src__pages__script__editModal.cbf4ec0e.async.js +0 -1
- package/static/dist/src__pages__script__editNameModal.3e7e100d.async.js +0 -1
- package/static/dist/src__pages__script__index.2765d1b8.async.js +0 -1
- package/static/dist/src__pages__script__renameModal.5e987ef5.async.js +0 -1
- package/static/dist/src__pages__script__saveModal.3f9d23d6.async.js +0 -1
- package/static/dist/src__pages__script__setting.a535793a.async.js +0 -1
- package/static/dist/src__pages__setting__appModal.251cd14f.async.js +0 -1
- package/static/dist/src__pages__setting__checkUpdate.46efe057.async.js +0 -1
- package/static/dist/src__pages__setting__dependence.8a7a9529.async.js +0 -1
- package/static/dist/src__pages__setting__index.cc85fdfb.async.js +0 -1
- package/static/dist/src__pages__setting__loginLog.cea6056c.async.js +0 -1
- package/static/dist/src__pages__setting__notification.390fc905.async.js +0 -1
- package/static/dist/src__pages__setting__other.b22d2165.async.js +0 -1
- package/static/dist/src__pages__setting__security.598720a8.async.js +0 -1
- package/static/dist/src__pages__setting__systemLog.67406721.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.3562c670.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
|
@@ -151,6 +151,8 @@ enum NotificationMode {
|
|
|
151
151
|
chronocat = 18;
|
|
152
152
|
ntfy = 19;
|
|
153
153
|
wxPusherBot = 20;
|
|
154
|
+
wxPusherSpt = 21;
|
|
155
|
+
wpush = 22;
|
|
154
156
|
}
|
|
155
157
|
|
|
156
158
|
message NotificationInfo {
|
|
@@ -244,6 +246,12 @@ message NotificationInfo {
|
|
|
244
246
|
optional string wxPusherBotAppToken = 66;
|
|
245
247
|
optional string wxPusherBotTopicIds = 67;
|
|
246
248
|
optional string wxPusherBotUids = 68;
|
|
249
|
+
|
|
250
|
+
optional string wxPusherSptList = 70;
|
|
251
|
+
|
|
252
|
+
optional string wpushApiKey = 71;
|
|
253
|
+
optional string wpushChannel = 72;
|
|
254
|
+
optional string wpushTopicCode = 73;
|
|
247
255
|
}
|
|
248
256
|
|
|
249
257
|
message SystemNotifyRequest {
|
|
@@ -272,4 +280,4 @@ service Api {
|
|
|
272
280
|
rpc EnableCrons(EnableCronsRequest) returns (Response) {}
|
|
273
281
|
rpc DisableCrons(DisableCronsRequest) returns (Response) {}
|
|
274
282
|
rpc RunCrons(RunCronsRequest) returns (Response) {}
|
|
275
|
-
}
|
|
283
|
+
}
|
package/back/protos/cron.proto
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Kubernetes deployment
|
|
2
|
+
|
|
3
|
+
This deploys Qinglong as a single-replica `StatefulSet` with persistent data at `/ql/data`.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
kubectl apply -k deploy/kubernetes/overlays/local
|
|
7
|
+
kubectl -n qinglong rollout status statefulset/qinglong
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Open the panel locally:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
kubectl -n qinglong port-forward svc/qinglong 5700:5700
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Then visit <http://127.0.0.1:5700>.
|
|
17
|
+
|
|
18
|
+
## Image registry overlays
|
|
19
|
+
|
|
20
|
+
Use `overlays/example` as the committed template for registry customization:
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
whyour/qinglong:debian -> registry.example.com/whyour/qinglong:debian
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Create `overlays/local/kustomization.yaml` for the actual cluster image. The `local` overlay is ignored by git so private registry names, digests, and credentials-related references stay local.
|
|
27
|
+
|
|
28
|
+
## Storage
|
|
29
|
+
|
|
30
|
+
The manifest creates a 5 GiB `ReadWriteOnce` PVC from the cluster's default `StorageClass`.
|
|
31
|
+
If your cluster has no default storage class, add `storageClassName` under:
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
volumeClaimTemplates:
|
|
35
|
+
- metadata:
|
|
36
|
+
name: data
|
|
37
|
+
spec:
|
|
38
|
+
storageClassName: your-storage-class
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Keep `replicas: 1`. Qinglong stores state in the persistent data directory, including SQLite files, so multiple replicas should not share the same data volume.
|
|
42
|
+
|
|
43
|
+
## Ingress example
|
|
44
|
+
|
|
45
|
+
If you expose Qinglong through an Ingress path other than `/`, set `QlBaseUrl` to the same path with leading and trailing slashes.
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
env:
|
|
49
|
+
- name: QlBaseUrl
|
|
50
|
+
value: "/qinglong/"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Example Ingress:
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
apiVersion: networking.k8s.io/v1
|
|
57
|
+
kind: Ingress
|
|
58
|
+
metadata:
|
|
59
|
+
name: qinglong
|
|
60
|
+
namespace: qinglong
|
|
61
|
+
spec:
|
|
62
|
+
rules:
|
|
63
|
+
- host: qinglong.example.com
|
|
64
|
+
http:
|
|
65
|
+
paths:
|
|
66
|
+
- path: /
|
|
67
|
+
pathType: Prefix
|
|
68
|
+
backend:
|
|
69
|
+
service:
|
|
70
|
+
name: qinglong
|
|
71
|
+
port:
|
|
72
|
+
number: 5700
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Maintenance commands
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
kubectl -n qinglong logs -f statefulset/qinglong
|
|
79
|
+
kubectl -n qinglong exec -it statefulset/qinglong -- ql check
|
|
80
|
+
kubectl -n qinglong exec -it statefulset/qinglong -- ql update
|
|
81
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
kind: Namespace
|
|
3
|
+
metadata:
|
|
4
|
+
name: qinglong
|
|
5
|
+
---
|
|
6
|
+
apiVersion: v1
|
|
7
|
+
kind: Service
|
|
8
|
+
metadata:
|
|
9
|
+
name: qinglong
|
|
10
|
+
namespace: qinglong
|
|
11
|
+
labels:
|
|
12
|
+
app.kubernetes.io/name: qinglong
|
|
13
|
+
spec:
|
|
14
|
+
type: ClusterIP
|
|
15
|
+
selector:
|
|
16
|
+
app.kubernetes.io/name: qinglong
|
|
17
|
+
ports:
|
|
18
|
+
- name: http
|
|
19
|
+
port: 5700
|
|
20
|
+
targetPort: http
|
|
21
|
+
---
|
|
22
|
+
apiVersion: apps/v1
|
|
23
|
+
kind: StatefulSet
|
|
24
|
+
metadata:
|
|
25
|
+
name: qinglong
|
|
26
|
+
namespace: qinglong
|
|
27
|
+
labels:
|
|
28
|
+
app.kubernetes.io/name: qinglong
|
|
29
|
+
spec:
|
|
30
|
+
serviceName: qinglong
|
|
31
|
+
replicas: 1
|
|
32
|
+
selector:
|
|
33
|
+
matchLabels:
|
|
34
|
+
app.kubernetes.io/name: qinglong
|
|
35
|
+
template:
|
|
36
|
+
metadata:
|
|
37
|
+
labels:
|
|
38
|
+
app.kubernetes.io/name: qinglong
|
|
39
|
+
spec:
|
|
40
|
+
securityContext:
|
|
41
|
+
fsGroup: 5432
|
|
42
|
+
fsGroupChangePolicy: OnRootMismatch
|
|
43
|
+
containers:
|
|
44
|
+
- name: qinglong
|
|
45
|
+
image: whyour/qinglong:debian
|
|
46
|
+
imagePullPolicy: IfNotPresent
|
|
47
|
+
env:
|
|
48
|
+
- name: QlBaseUrl
|
|
49
|
+
value: "/"
|
|
50
|
+
- name: TZ
|
|
51
|
+
value: Asia/Shanghai
|
|
52
|
+
ports:
|
|
53
|
+
- name: http
|
|
54
|
+
containerPort: 5700
|
|
55
|
+
readinessProbe:
|
|
56
|
+
httpGet:
|
|
57
|
+
path: /api/health
|
|
58
|
+
port: http
|
|
59
|
+
initialDelaySeconds: 20
|
|
60
|
+
periodSeconds: 10
|
|
61
|
+
timeoutSeconds: 3
|
|
62
|
+
failureThreshold: 6
|
|
63
|
+
livenessProbe:
|
|
64
|
+
httpGet:
|
|
65
|
+
path: /api/health
|
|
66
|
+
port: http
|
|
67
|
+
initialDelaySeconds: 60
|
|
68
|
+
periodSeconds: 20
|
|
69
|
+
timeoutSeconds: 3
|
|
70
|
+
failureThreshold: 6
|
|
71
|
+
startupProbe:
|
|
72
|
+
httpGet:
|
|
73
|
+
path: /api/health
|
|
74
|
+
port: http
|
|
75
|
+
periodSeconds: 5
|
|
76
|
+
timeoutSeconds: 3
|
|
77
|
+
failureThreshold: 60
|
|
78
|
+
resources:
|
|
79
|
+
requests:
|
|
80
|
+
cpu: 100m
|
|
81
|
+
memory: 256Mi
|
|
82
|
+
limits:
|
|
83
|
+
memory: 1Gi
|
|
84
|
+
volumeMounts:
|
|
85
|
+
- name: data
|
|
86
|
+
mountPath: /ql/data
|
|
87
|
+
volumeClaimTemplates:
|
|
88
|
+
- metadata:
|
|
89
|
+
name: data
|
|
90
|
+
spec:
|
|
91
|
+
accessModes:
|
|
92
|
+
- ReadWriteOnce
|
|
93
|
+
resources:
|
|
94
|
+
requests:
|
|
95
|
+
storage: 5Gi
|
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 };
|