@whyour/qinglong 2.22.0 → 2.24.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/.env.example +3 -0
- package/README-NODE.md +10 -0
- package/back/protos/api.proto +10 -0
- package/cli/README.en.md +156 -0
- package/cli/README.md +156 -0
- package/cli/src/internal/maintenance/nodeRuntime.cjs +18 -0
- package/cli/src/internal/maintenance/panelUpgrade.cjs +577 -0
- package/cli/src/internal/maintenance/platformBundle.cjs +582 -0
- package/cli/src/internal/maintenance/upgradeArtifacts.cjs +979 -0
- package/cli/src/internal/maintenance/upgradePrestart.cjs +396 -0
- package/ecosystem.config.js +3 -0
- package/package.json +59 -15
- package/sample/notify.js +308 -135
- package/sample/notify.py +174 -27
- package/shell/api.sh +71 -74
- package/shell/install-bundle.cjs +320 -0
- package/shell/install-package.cjs +74 -0
- package/shell/lang/en.sh +38 -0
- package/shell/node-runtime-probe.cjs +62 -0
- package/shell/node_path_cache.sh +10 -2
- package/shell/otask.sh +41 -41
- package/shell/preload/client.js +1 -0
- package/shell/preload/notificationAudit.js +51 -0
- package/shell/preload/sitecustomize.js +9 -5
- package/shell/preload/sitecustomize.py +9 -7
- package/shell/rmlog.sh +21 -16
- package/shell/share.sh +62 -45
- package/shell/start-simplify.sh +90 -0
- package/shell/start.sh +48 -71
- package/shell/task-timeout.sh +75 -0
- package/shell/task.sh +14 -12
- package/shell/update.sh +92 -133
- package/shell/upgrade-lock.yaml +16122 -0
- package/shell/upgrade.cjs +8 -0
- package/static/build/api/clientIp.js +2 -1
- package/static/build/api/clientIp.js.map +1 -0
- package/static/build/api/config.js +2 -6
- package/static/build/api/config.js.map +1 -0
- package/static/build/api/cron.js.map +1 -0
- package/static/build/api/dashboard.js.map +1 -0
- package/static/build/api/dependence.js.map +1 -0
- package/static/build/api/env.js +15 -14
- package/static/build/api/env.js.map +1 -0
- package/static/build/api/health.js.map +1 -0
- package/static/build/api/index.js.map +1 -0
- package/static/build/api/log.js.map +1 -0
- package/static/build/api/open.js +2 -1
- package/static/build/api/open.js.map +1 -0
- package/static/build/api/retention.js.map +1 -0
- package/static/build/api/script.js +155 -9
- package/static/build/api/script.js.map +1 -0
- package/static/build/api/subscription.js +3 -6
- package/static/build/api/subscription.js.map +1 -0
- package/static/build/api/system.js +53 -3
- package/static/build/api/system.js.map +1 -0
- package/static/build/api/update.js.map +1 -0
- package/static/build/api/user.js.map +1 -0
- package/static/build/app.js +10 -23
- package/static/build/app.js.map +1 -0
- package/static/build/bootstrap/database.js.map +1 -0
- package/static/build/bootstrap/upgradeProbe.js +154 -0
- package/static/build/bootstrap/upgradeProbe.js.map +1 -0
- package/static/build/config/const.js +2 -1
- package/static/build/config/const.js.map +1 -0
- package/static/build/config/container.js.map +1 -0
- package/static/build/config/grpcCerts.js +89 -40
- package/static/build/config/grpcCerts.js.map +1 -0
- package/static/build/config/http.js.map +1 -0
- package/static/build/config/index.js.map +1 -0
- package/static/build/config/serverEnv.js.map +1 -0
- package/static/build/config/share.js.map +1 -0
- package/static/build/config/subscription.js +19 -11
- package/static/build/config/subscription.js.map +1 -0
- package/static/build/config/util.js +178 -77
- package/static/build/config/util.js.map +1 -0
- package/static/build/data/cron.js.map +1 -0
- package/static/build/data/cronStats.js.map +1 -0
- package/static/build/data/cronView.js.map +1 -0
- package/static/build/data/dependence.js.map +1 -0
- package/static/build/data/env.js.map +1 -0
- package/static/build/data/index.js.map +1 -0
- package/static/build/data/notify.js.map +1 -0
- package/static/build/data/open.js.map +1 -0
- package/static/build/data/runningInstance.js.map +1 -0
- package/static/build/data/sock.js.map +1 -0
- package/static/build/data/subscription.js.map +1 -0
- package/static/build/data/system.js +3 -1
- package/static/build/data/system.js.map +1 -0
- package/static/build/interface/schedule.js.map +1 -0
- package/static/build/loaders/app.js.map +1 -0
- package/static/build/loaders/bootAfter.js.map +1 -0
- package/static/build/loaders/db.js.map +1 -0
- package/static/build/loaders/depInjector.js.map +1 -0
- package/static/build/loaders/deps.js.map +1 -0
- package/static/build/loaders/express.js +10 -3
- package/static/build/loaders/express.js.map +1 -0
- package/static/build/loaders/httpApplication.js +55 -0
- package/static/build/loaders/httpApplication.js.map +1 -0
- package/static/build/loaders/initData.js +20 -30
- package/static/build/loaders/initData.js.map +1 -0
- package/static/build/loaders/initFile.js.map +1 -0
- package/static/build/loaders/initTask.js +11 -1
- package/static/build/loaders/initTask.js.map +1 -0
- package/static/build/loaders/logger.js.map +1 -0
- package/static/build/loaders/server.js.map +1 -0
- package/static/build/loaders/sock.js.map +1 -0
- package/static/build/middlewares/monitoring.js.map +1 -0
- package/static/build/middlewares/protectedPathCase.js.map +1 -0
- package/static/build/middlewares/uniqueConstraintError.js +15 -0
- package/static/build/middlewares/uniqueConstraintError.js.map +1 -0
- package/static/build/middlewares/validationErrors.js +17 -0
- package/static/build/middlewares/validationErrors.js.map +1 -0
- package/static/build/protos/api.js +140 -2
- package/static/build/protos/api.js.map +1 -0
- package/static/build/protos/cron.js +63 -2
- package/static/build/protos/cron.js.map +1 -0
- package/static/build/protos/health.js.map +1 -0
- package/static/build/schedule/addCron.js +45 -63
- package/static/build/schedule/addCron.js.map +1 -0
- package/static/build/schedule/api.js +21 -2
- package/static/build/schedule/api.js.map +1 -0
- package/static/build/schedule/client.js +19 -1
- package/static/build/schedule/client.js.map +1 -0
- package/static/build/schedule/data.js.map +1 -0
- package/static/build/schedule/delCron.js +6 -4
- package/static/build/schedule/delCron.js.map +1 -0
- package/static/build/schedule/health.js.map +1 -0
- package/static/build/schedule/setConcurrency.js +27 -0
- package/static/build/schedule/setConcurrency.js.map +1 -0
- package/static/build/services/config.js +2 -3
- package/static/build/services/config.js.map +1 -0
- package/static/build/services/cron.js +43 -17
- package/static/build/services/cron.js.map +1 -0
- package/static/build/services/cronView.js.map +1 -0
- package/static/build/services/dependence.js +48 -13
- package/static/build/services/dependence.js.map +1 -0
- package/static/build/services/env.js +1 -1
- package/static/build/services/env.js.map +1 -0
- package/static/build/services/grpc.js +4 -3
- package/static/build/services/grpc.js.map +1 -0
- package/static/build/services/health.js +2 -0
- package/static/build/services/health.js.map +1 -0
- package/static/build/services/http.js.map +1 -0
- package/static/build/services/log.js +1 -1
- package/static/build/services/log.js.map +1 -0
- package/static/build/services/metrics.js +2 -1
- package/static/build/services/metrics.js.map +1 -0
- package/static/build/services/notify.js +45 -24
- package/static/build/services/notify.js.map +1 -0
- package/static/build/services/open.js +106 -31
- package/static/build/services/open.js.map +1 -0
- package/static/build/services/retention.js.map +1 -0
- package/static/build/services/schedule.js +32 -21
- package/static/build/services/schedule.js.map +1 -0
- package/static/build/services/script.js +1 -1
- package/static/build/services/script.js.map +1 -0
- package/static/build/services/scriptHistory.js +30 -0
- package/static/build/services/scriptHistory.js.map +1 -0
- package/static/build/services/sock.js.map +1 -0
- package/static/build/services/sshKey.js +45 -17
- package/static/build/services/sshKey.js.map +1 -0
- package/static/build/services/subscription.js +104 -53
- package/static/build/services/subscription.js.map +1 -0
- package/static/build/services/system.js +139 -74
- package/static/build/services/system.js.map +1 -0
- package/static/build/services/user.js +17 -12
- package/static/build/services/user.js.map +1 -0
- package/static/build/shared/auth.js.map +1 -0
- package/static/build/shared/authMutation.js.map +1 -0
- package/static/build/shared/childProcess.js.map +1 -0
- package/static/build/shared/clientIp.js.map +1 -0
- package/static/build/shared/cronCommand.js +17 -0
- package/static/build/shared/cronCommand.js.map +1 -0
- package/static/build/shared/cronSchedule.js +157 -0
- package/static/build/shared/cronSchedule.js.map +1 -0
- package/static/build/shared/cronScheduler.js +74 -0
- package/static/build/shared/cronScheduler.js.map +1 -0
- package/static/build/shared/errors.js.map +1 -0
- package/static/build/shared/fileAccess.js.map +1 -0
- package/static/build/shared/i18n.js +167 -87
- package/static/build/shared/i18n.js.map +1 -0
- package/static/build/shared/interface.js.map +1 -0
- package/static/build/shared/languageSync.js +61 -0
- package/static/build/shared/languageSync.js.map +1 -0
- package/static/build/shared/linuxMirror.js +96 -0
- package/static/build/shared/linuxMirror.js.map +1 -0
- package/static/build/shared/logPath.js +15 -0
- package/static/build/shared/logPath.js.map +1 -0
- package/static/build/shared/logReader.js.map +1 -0
- package/static/build/shared/logStreamManager.js.map +1 -0
- package/static/build/shared/loginThrottle.js +45 -0
- package/static/build/shared/loginThrottle.js.map +1 -0
- package/static/build/shared/notificationAudit.js +46 -0
- package/static/build/shared/notificationAudit.js.map +1 -0
- package/static/build/shared/pLimit.js +27 -14
- package/static/build/shared/pLimit.js.map +1 -0
- package/static/build/shared/password.js.map +1 -0
- package/static/build/shared/retention.js.map +1 -0
- package/static/build/shared/runCron.js +81 -29
- package/static/build/shared/runCron.js.map +1 -0
- package/static/build/shared/runtimeBuild.js +44 -0
- package/static/build/shared/runtimeBuild.js.map +1 -0
- package/static/build/shared/schedulerMutationLock.js.map +1 -0
- package/static/build/shared/schedulerReadiness.js.map +1 -0
- package/static/build/shared/schemaMigrations.js.map +1 -0
- package/static/build/shared/scriptHistory.js +445 -0
- package/static/build/shared/scriptHistory.js.map +1 -0
- package/static/build/shared/shellQuote.js +11 -0
- package/static/build/shared/shellQuote.js.map +1 -0
- package/static/build/shared/startupProcess.js.map +1 -0
- package/static/build/shared/store.js.map +1 -0
- package/static/build/shared/subscriptionMutationLock.js +34 -0
- package/static/build/shared/subscriptionMutationLock.js.map +1 -0
- package/static/build/shared/subscriptionPath.js +41 -0
- package/static/build/shared/subscriptionPath.js.map +1 -0
- package/static/build/shared/subscriptionStorage.js +98 -0
- package/static/build/shared/subscriptionStorage.js.map +1 -0
- package/static/build/shared/trustProxy.js +5 -4
- package/static/build/shared/trustProxy.js.map +1 -0
- package/static/build/shared/utils.js +2 -1
- package/static/build/shared/utils.js.map +1 -0
- package/static/build/token.js +3 -14
- package/static/build/token.js.map +1 -0
- package/static/build/validation/schedule.js +22 -19
- package/static/build/validation/schedule.js.map +1 -0
- package/static/build-info.json +754 -0
- package/static/dist/1089.0ecc5383.async.js.gz +0 -0
- package/static/dist/1174.41a43fee.async.js.gz +0 -0
- package/static/dist/119.89e2d610.async.js.gz +0 -0
- package/static/dist/1212.f87fd07a.async.js.gz +0 -0
- package/static/dist/1352.96a77e1d.async.js.gz +0 -0
- package/static/dist/1379.f91563a1.async.js.gz +0 -0
- package/static/dist/1571.94ddca13.async.js.gz +0 -0
- package/static/dist/1706.ac98cb3f.async.js.gz +0 -0
- package/static/dist/1765.5ac01a93.async.js.gz +0 -0
- package/static/dist/1836.f0b74cf1.async.js.gz +0 -0
- package/static/dist/1883.675b6a18.chunk.css.gz +0 -0
- package/static/dist/1885.b8f427bf.async.js.gz +0 -0
- package/static/dist/1887.9e0d3da8.async.js.gz +0 -0
- package/static/dist/1967.3f3945d0.async.js.gz +0 -0
- package/static/dist/198.db47fc1a.async.js.gz +0 -0
- package/static/dist/2325.dfa32834.async.js.gz +0 -0
- package/static/dist/2338.d678967d.async.js.gz +0 -0
- package/static/dist/2372.b5a50ee7.async.js +1 -0
- package/static/dist/2372.b5a50ee7.async.js.gz +0 -0
- package/static/dist/2476.4e9b0992.async.js.gz +0 -0
- package/static/dist/2537.2b262ee0.async.js.gz +0 -0
- package/static/dist/2577.aa8fe709.async.js.gz +0 -0
- package/static/dist/2635.d4c59d23.async.js.gz +0 -0
- package/static/dist/2664.e69530fb.async.js +1 -0
- package/static/dist/2664.e69530fb.async.js.gz +0 -0
- package/static/dist/2693.51c2636b.async.js.gz +0 -0
- package/static/dist/2808.cdc0995c.async.js.gz +0 -0
- package/static/dist/2821.651f31e5.async.js.gz +0 -0
- package/static/dist/2890.add55e85.async.js.gz +0 -0
- package/static/dist/2901.6d0de54e.async.js +1 -0
- package/static/dist/2901.6d0de54e.async.js.gz +0 -0
- package/static/dist/292.1b962b29.chunk.css.gz +0 -0
- package/static/dist/292.27ce781f.async.js +1 -0
- package/static/dist/292.27ce781f.async.js.gz +0 -0
- package/static/dist/300.08ac9875.async.js.gz +0 -0
- package/static/dist/3191.3b7e4b42.async.js +1 -0
- package/static/dist/3191.3b7e4b42.async.js.gz +0 -0
- package/static/dist/3382.a584a111.async.js.gz +0 -0
- package/static/dist/3383.041eee73.async.js.gz +0 -0
- package/static/dist/3512.95e41255.async.js +1 -0
- package/static/dist/3512.95e41255.async.js.gz +0 -0
- package/static/dist/3714.8d6dba9e.async.js.gz +0 -0
- package/static/dist/3906.a5eee612.async.js.gz +0 -0
- package/static/dist/3948.4fe809fd.async.js.gz +0 -0
- package/static/dist/4324.5a5887d1.async.js.gz +0 -0
- package/static/dist/4559.faab3673.async.js.gz +0 -0
- package/static/dist/4573.16f19278.async.js.gz +0 -0
- package/static/dist/{4736.1d2b5cb6.async.js → 4736.7c4c489b.async.js} +1 -1
- package/static/dist/4736.7c4c489b.async.js.gz +0 -0
- package/static/dist/4887.8e3ae573.async.js.gz +0 -0
- package/static/dist/4934.f3539d08.async.js.gz +0 -0
- package/static/dist/5077.cbd111cd.async.js.gz +0 -0
- package/static/dist/{5481.624d0e07.async.js → 5481.e2945a63.async.js} +1 -1
- package/static/dist/5481.e2945a63.async.js.gz +0 -0
- package/static/dist/5662.678b0cfb.async.js.gz +0 -0
- package/static/dist/5970.5862e59e.async.js +1 -0
- package/static/dist/5970.5862e59e.async.js.gz +0 -0
- package/static/dist/6013.db535339.async.js.gz +0 -0
- package/static/dist/6035.32ebfad9.async.js.gz +0 -0
- package/static/dist/6212.30a9c190.async.js +1 -0
- package/static/dist/6212.30a9c190.async.js.gz +0 -0
- package/static/dist/6341.673fb65c.async.js.gz +0 -0
- package/static/dist/6367.8b0e838c.async.js.gz +0 -0
- package/static/dist/6431.c50479be.async.js +1 -0
- package/static/dist/6569.55177f6a.async.js.gz +0 -0
- package/static/dist/6610.c111af7e.async.js.gz +0 -0
- package/static/dist/6638.87a163d2.async.js.gz +0 -0
- package/static/dist/6646.95e92533.async.js.gz +0 -0
- package/static/dist/{6872.a503ef55.async.js → 6872.fcc9ce17.async.js} +1 -1
- package/static/dist/6872.fcc9ce17.async.js.gz +0 -0
- package/static/dist/691.187a388c.async.js.gz +0 -0
- package/static/dist/7146.4dc150b1.async.js +1 -0
- package/static/dist/7146.4dc150b1.async.js.gz +0 -0
- package/static/dist/7231.f7e5b668.async.js.gz +0 -0
- package/static/dist/7253.4b9bf133.async.js.gz +0 -0
- package/static/dist/7278.96bf439f.async.js.gz +0 -0
- package/static/dist/7355.fca746f5.async.js.gz +0 -0
- package/static/dist/7384.1bb449d5.async.js.gz +0 -0
- package/static/dist/7508.3fffed15.chunk.css.gz +0 -0
- package/static/dist/7508.d90eac63.async.js.gz +0 -0
- package/static/dist/7802.34255805.async.js.gz +0 -0
- package/static/dist/7984.eaac7402.async.js.gz +0 -0
- package/static/dist/8033.5cb31493.async.js.gz +0 -0
- package/static/dist/8078.8586c875.async.js.gz +0 -0
- package/static/dist/8147.2fb55202.async.js.gz +0 -0
- package/static/dist/8187.48c130d6.async.js.gz +0 -0
- package/static/dist/8495.d53e15ca.async.js.gz +0 -0
- package/static/dist/8844.a0fef08e.async.js.gz +0 -0
- package/static/dist/9308.3202ac13.async.js.gz +0 -0
- package/static/dist/9323.a33f47da.async.js.gz +0 -0
- package/static/dist/965.8d9b1fbd.async.js +1 -0
- package/static/dist/965.8d9b1fbd.async.js.gz +0 -0
- package/static/dist/9761.360a19d8.async.js.gz +0 -0
- package/static/dist/index.html +2 -2
- package/static/dist/layouts__index.86b6bcbe.chunk.css +1 -0
- package/static/dist/layouts__index.86b6bcbe.chunk.css.gz +0 -0
- package/static/dist/layouts__index.c8e9788e.async.js +1 -0
- package/static/dist/layouts__index.c8e9788e.async.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/base/worker/workerMain.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/basic-languages/abap/abap.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/basic-languages/clojure/clojure.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/basic-languages/elixir/elixir.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/basic-languages/freemarker2/freemarker2.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/basic-languages/mysql/mysql.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/basic-languages/pgsql/pgsql.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/basic-languages/powerquery/powerquery.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/basic-languages/redshift/redshift.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/basic-languages/solidity/solidity.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/basic-languages/sql/sql.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.css.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.de.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.es.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.fr.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.it.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.ja.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.ko.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.ru.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.zh-cn.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.zh-tw.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/language/css/cssMode.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/language/css/cssWorker.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/language/html/htmlMode.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/language/html/htmlWorker.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/language/json/jsonMode.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/language/json/jsonWorker.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/language/typescript/tsMode.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/language/typescript/tsWorker.js.gz +0 -0
- package/static/dist/monaco-editor/min/vs/loader.js.gz +0 -0
- package/static/dist/preload_helper.8b8f6581.js +1 -0
- package/static/dist/src__pages__404.3fd8332e.async.js +1 -0
- package/static/dist/src__pages__config__index.d18d8f95.async.js +1 -0
- package/static/dist/src__pages__crontab__detail.88729e8f.async.js +1 -0
- package/static/dist/src__pages__crontab__detail.88729e8f.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__index.8aa9d297.async.js +1 -0
- package/static/dist/src__pages__crontab__index.8aa9d297.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__logModal.930535e2.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__modal.a2c8fdcc.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__viewCreateModal.7b4f9cbe.async.js.gz +0 -0
- package/static/dist/src__pages__crontab__viewManageModal.cd454ea0.async.js.gz +0 -0
- package/static/dist/src__pages__dashboard__index.c05ce904.async.js +1 -0
- package/static/dist/src__pages__dashboard__index.c05ce904.async.js.gz +0 -0
- package/static/dist/src__pages__dependence__index.5b7fd97d.async.js +1 -0
- package/static/dist/src__pages__dependence__index.5b7fd97d.async.js.gz +0 -0
- package/static/dist/{src__pages__dependence__logModal.154efe7a.async.js → src__pages__dependence__logModal.01729f63.async.js} +1 -1
- package/static/dist/src__pages__dependence__logModal.01729f63.async.js.gz +0 -0
- package/static/dist/src__pages__dependence__modal.ef7ae53b.async.js +1 -0
- package/static/dist/src__pages__dependence__modal.ef7ae53b.async.js.gz +0 -0
- package/static/dist/src__pages__diff__index.4233ea93.async.js +1 -0
- package/static/dist/src__pages__diff__index.4233ea93.async.js.gz +0 -0
- package/static/dist/src__pages__env__index.eddb35bf.async.js +1 -0
- package/static/dist/src__pages__env__index.eddb35bf.async.js.gz +0 -0
- package/static/dist/src__pages__env__modal.4d71adb3.async.js.gz +0 -0
- package/static/dist/src__pages__error__index.66605c72.async.js +1 -0
- package/static/dist/src__pages__initialization__index.9c1c5b76.async.js +1 -0
- package/static/dist/src__pages__initialization__index.9c1c5b76.async.js.gz +0 -0
- package/static/dist/src__pages__log__index.71250e0d.async.js.gz +0 -0
- package/static/dist/src__pages__login__index.58bb4b38.async.js +1 -0
- package/static/dist/src__pages__login__index.58bb4b38.async.js.gz +0 -0
- package/static/dist/src__pages__script__components__UnsupportedFilePreview__index.c347a13a.async.js.gz +0 -0
- package/static/dist/src__pages__script__editModal.d15f8d78.async.js +1 -0
- package/static/dist/src__pages__script__editModal.d15f8d78.async.js.gz +0 -0
- package/static/dist/src__pages__script__editNameModal.789ad87b.async.js +1 -0
- package/static/dist/src__pages__script__editNameModal.789ad87b.async.js.gz +0 -0
- package/static/dist/src__pages__script__historyDrawer.8c58d958.async.js +1 -0
- package/static/dist/src__pages__script__historyDrawer.8c58d958.async.js.gz +0 -0
- package/static/dist/src__pages__script__historyDrawer.a449193a.chunk.css +1 -0
- package/static/dist/src__pages__script__index.96a6d30f.async.js +1 -0
- package/static/dist/src__pages__script__index.96a6d30f.async.js.gz +0 -0
- package/static/dist/src__pages__script__index.ab360776.chunk.css +1 -0
- package/static/dist/src__pages__script__saveModal.8fca1a22.async.js +1 -0
- package/static/dist/src__pages__script__saveWithHistory.99ece830.async.js +1 -0
- package/static/dist/{src__pages__setting__about.e6db5090.chunk.css → src__pages__setting__about.0d6ea255.chunk.css} +1 -1
- package/static/dist/src__pages__setting__about.3d3c019f.async.js.gz +0 -0
- package/static/dist/src__pages__setting__checkUpdate.429a42f3.async.js +1 -0
- package/static/dist/src__pages__setting__checkUpdate.429a42f3.async.js.gz +0 -0
- package/static/dist/src__pages__setting__clientIp.3a8711ed.async.js.gz +0 -0
- package/static/dist/{src__pages__setting__dependence.28ecea01.chunk.css → src__pages__setting__dependence.80b183a5.chunk.css} +1 -1
- package/static/dist/src__pages__setting__dependence.c227c0f5.async.js +1 -0
- package/static/dist/src__pages__setting__dependence.c227c0f5.async.js.gz +0 -0
- package/static/dist/src__pages__setting__index.274ad415.async.js +1 -0
- package/static/dist/src__pages__setting__index.274ad415.async.js.gz +0 -0
- package/static/dist/{src__pages__setting__index.7cf46d4a.chunk.css → src__pages__setting__index.46315660.chunk.css} +1 -1
- package/static/dist/src__pages__setting__loginLog.ef135f19.async.js +1 -0
- package/static/dist/src__pages__setting__loginLog.ef135f19.async.js.gz +0 -0
- package/static/dist/src__pages__setting__notifyLog.5ef5b578.async.js +1 -0
- package/static/dist/src__pages__setting__notifyLog.5ef5b578.async.js.gz +0 -0
- package/static/dist/{src__pages__setting__other.28ecea01.chunk.css → src__pages__setting__notifyLog.80b183a5.chunk.css} +1 -1
- package/static/dist/src__pages__setting__other.80b183a5.chunk.css +1 -0
- package/static/dist/src__pages__setting__other.e744c0d1.async.js +1 -0
- package/static/dist/src__pages__setting__other.e744c0d1.async.js.gz +0 -0
- package/static/dist/src__pages__setting__security.e2d71ebb.async.js.gz +0 -0
- package/static/dist/src__pages__setting__systemLog.000bcb5e.async.js +1 -0
- package/static/dist/src__pages__setting__systemLog.000bcb5e.async.js.gz +0 -0
- package/static/dist/src__pages__subscription__index.f556ae4c.async.js +1 -0
- package/static/dist/src__pages__subscription__index.f556ae4c.async.js.gz +0 -0
- package/static/dist/src__pages__subscription__logModal.cdba5139.async.js.gz +0 -0
- package/static/dist/src__pages__subscription__modal.8f04f506.async.js +1 -0
- package/static/dist/umi.73936e34.js +1 -0
- package/static/dist/umi.73936e34.js.gz +0 -0
- package/static/dist/umi.a4d14b92.css.gz +0 -0
- package/version.yaml +11 -19
- package/.dockerignore +0 -13
- package/AGENTS.md +0 -43
- package/SECURITY.md +0 -5
- package/back/protos/cron.proto +0 -29
- package/back/protos/health.proto +0 -22
- package/deploy/kubernetes/README.md +0 -81
- package/deploy/kubernetes/base/kustomization.yaml +0 -5
- package/deploy/kubernetes/base/qinglong.yaml +0 -95
- package/deploy/kubernetes/overlays/example/kustomization.yaml +0 -10
- package/docker/Dockerfile +0 -113
- package/docker/Dockerfile.310 +0 -113
- package/docker/Dockerfile.debian +0 -128
- package/docker/Dockerfile.debian310 +0 -130
- package/docker/build-manifest.cjs +0 -28
- package/docker/docker-compose.yml +0 -10
- package/docker/docker-entrypoint.sh +0 -147
- package/docker/verify-build.cjs +0 -49
- package/docs/PROJECT_ARCHITECTURE.md +0 -550
- package/docs/releases/2.22.0-validation.md +0 -49
- package/docs/releases/2.22.0.md +0 -54
- package/sample/tool.ts +0 -40
- package/scripts/benchmark-execution.cjs +0 -96
- package/scripts/write-build-info.cjs +0 -27
- package/shell/pub.sh +0 -28
- package/static/dist/2096.6d98fd12.async.js +0 -1
- package/static/dist/255.8a80b983.async.js +0 -1
- package/static/dist/2901.2ca95295.async.js +0 -1
- package/static/dist/3600.7637c822.async.js +0 -1
- package/static/dist/445.a65ff63b.async.js +0 -1
- package/static/dist/4859.97d6653c.async.js +0 -1
- package/static/dist/5970.d3a6e7bd.async.js +0 -1
- package/static/dist/6212.9e6d9913.async.js +0 -1
- package/static/dist/6431.4603ad0e.async.js +0 -1
- package/static/dist/6707.801b886b.async.js +0 -1
- package/static/dist/9066.605168f8.async.js +0 -1
- package/static/dist/9313.37acaf13.async.js +0 -1
- package/static/dist/layouts__index.633d3553.async.js +0 -1
- package/static/dist/layouts__index.adf0692f.chunk.css +0 -1
- package/static/dist/preload_helper.cf7de3fa.js +0 -1
- package/static/dist/src__pages__404.771168fc.async.js +0 -1
- package/static/dist/src__pages__config__index.9aba4054.async.js +0 -1
- package/static/dist/src__pages__crontab__detail.86b2eebb.async.js +0 -1
- package/static/dist/src__pages__crontab__index.ae4e06f2.async.js +0 -1
- package/static/dist/src__pages__dashboard__index.243c5a35.async.js +0 -1
- package/static/dist/src__pages__dependence__index.874d501f.async.js +0 -1
- package/static/dist/src__pages__dependence__modal.a29c1a0f.async.js +0 -1
- package/static/dist/src__pages__diff__index.1714b941.async.js +0 -1
- package/static/dist/src__pages__env__index.fd6fd2b0.async.js +0 -1
- package/static/dist/src__pages__error__index.aae50c94.async.js +0 -1
- package/static/dist/src__pages__initialization__index.82a2e967.async.js +0 -1
- package/static/dist/src__pages__login__index.a0fd5ed8.async.js +0 -1
- package/static/dist/src__pages__script__editModal.22acdf7c.async.js +0 -1
- package/static/dist/src__pages__script__editNameModal.1a521cc0.async.js +0 -1
- package/static/dist/src__pages__script__index.60b6f827.chunk.css +0 -1
- package/static/dist/src__pages__script__index.a18b2692.async.js +0 -1
- package/static/dist/src__pages__script__saveModal.8965b74c.async.js +0 -1
- package/static/dist/src__pages__setting__checkUpdate.d175b154.async.js +0 -1
- package/static/dist/src__pages__setting__dependence.9c0f749b.async.js +0 -1
- package/static/dist/src__pages__setting__index.cb397741.async.js +0 -1
- package/static/dist/src__pages__setting__loginLog.e0a1f54d.async.js +0 -1
- package/static/dist/src__pages__setting__other.3d0b8492.async.js +0 -1
- package/static/dist/src__pages__setting__systemLog.b3046955.async.js +0 -1
- package/static/dist/src__pages__subscription__index.43086a06.async.js +0 -1
- package/static/dist/src__pages__subscription__modal.38991e1e.async.js +0 -1
- package/static/dist/umi.fc019050.js +0 -1
- package/test/back/auth-security.test.cjs +0 -74
- package/test/back/build-provenance.test.cjs +0 -150
- package/test/back/cron-log-name.test.cjs +0 -110
- package/test/back/cron-validation.test.cjs +0 -45
- package/test/back/dashboard-failures.test.cjs +0 -173
- package/test/back/database-bootstrap.test.cjs +0 -193
- package/test/back/dependence-cache-status.test.cjs +0 -125
- package/test/back/deprecated-file-routes.test.cjs +0 -82
- package/test/back/ecosystem.test.cjs +0 -28
- package/test/back/env-name-parsing.test.cjs +0 -96
- package/test/back/execution-lifecycle.test.cjs +0 -236
- package/test/back/file-access-security.test.cjs +0 -47
- package/test/back/fileTreeListing.test.cjs +0 -57
- package/test/back/grpc-cron-response.test.cjs +0 -60
- package/test/back/http-exclusive-listen.test.cjs +0 -31
- package/test/back/http-security.test.cjs +0 -213
- package/test/back/listen-security.test.cjs +0 -67
- package/test/back/log-path-security.test.cjs +0 -158
- package/test/back/logReader.test.cjs +0 -72
- package/test/back/manual-execution.test.cjs +0 -85
- package/test/back/manual-stop-claim.test.cjs +0 -220
- package/test/back/metrics.test.cjs +0 -34
- package/test/back/monitoring.test.cjs +0 -73
- package/test/back/node-path-cache.test.cjs +0 -173
- package/test/back/node-path-lock.test.cjs +0 -178
- package/test/back/npm-publication.test.cjs +0 -70
- package/test/back/primary-apm.test.cjs +0 -24
- package/test/back/process-exit-state.test.cjs +0 -81
- package/test/back/process-stop-signal.test.cjs +0 -77
- package/test/back/protected-path-case.test.cjs +0 -58
- package/test/back/qlServiceLogCommand.test.cjs +0 -128
- package/test/back/retention.test.cjs +0 -131
- package/test/back/role-loading.test.cjs +0 -118
- package/test/back/schedule-health.test.cjs +0 -86
- package/test/back/scheduler-file-lock.test.cjs +0 -51
- package/test/back/scheduler-mutation.test.cjs +0 -312
- package/test/back/scheduler-readiness.test.cjs +0 -85
- package/test/back/scheduler-reconciliation.test.cjs +0 -152
- package/test/back/scheduler-rpc-timeout.test.cjs +0 -49
- package/test/back/schema-migrations.test.cjs +0 -127
- package/test/back/shell-api-parsing.test.cjs +0 -184
- package/test/back/sock-polling.test.cjs +0 -297
- package/test/back/sock-security.test.cjs +0 -72
- package/test/back/start-env-preservation.test.cjs +0 -53
- package/test/back/stop-failure-feedback.test.cjs +0 -158
- package/test/back/stop-race.test.cjs +0 -167
- package/test/back/subscription-cleanup.test.cjs +0 -53
- package/test/back/subscription-stop-state.test.cjs +0 -66
- package/test/back/system-dependence-cache.test.cjs +0 -126
- package/test/back/task-time.test.cjs +0 -116
- package/test/back/user-api.test.cjs +0 -99
- package/test/back/user-security.test.cjs +0 -248
- package/test/back/worker-apm.test.cjs +0 -84
- package/test/back/wpush-grpc.test.cjs +0 -115
- package/test/front/cron-log-pagination.test.cjs +0 -214
- package/test/front/http-auth.test.cjs +0 -152
- package/test/front/http-error.test.cjs +0 -29
- package/test/helpers/load-security-module.cjs +0 -42
- /package/static/dist/{4859.1b962b29.chunk.css → 292.1b962b29.chunk.css} +0 -0
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
const assert = require('node:assert/strict');
|
|
2
|
-
const test = require('node:test');
|
|
3
|
-
const path = require('node:path');
|
|
4
|
-
const load = require('../helpers/load-security-module.cjs');
|
|
5
|
-
const logger = { debug() {}, warn() {}, error() {} };
|
|
6
|
-
|
|
7
|
-
for (const host of ['127.0.0.1', '::1', '192.0.2.1', '::']) {
|
|
8
|
-
test(`HTTP binding ${host} never broadens an explicit private address`, async () => {
|
|
9
|
-
const Http = load(path.join(__dirname, '../../back/services/http.ts'), {
|
|
10
|
-
'../config': { bindHost: host },
|
|
11
|
-
'../loaders/logger': logger,
|
|
12
|
-
'./metrics': { metricsService: { record() {} } },
|
|
13
|
-
typedi: { Service: () => (x) => x },
|
|
14
|
-
}).HttpServerService;
|
|
15
|
-
const instance = new Http();
|
|
16
|
-
const attempted = [];
|
|
17
|
-
instance.tryListen = async (_app, _port, address) => {
|
|
18
|
-
attempted.push(address);
|
|
19
|
-
throw new Error('unavailable');
|
|
20
|
-
};
|
|
21
|
-
await assert.rejects(instance.initialize({}, 5700));
|
|
22
|
-
assert.deepEqual(attempted, host === '::' ? ['::', '0.0.0.0'] : [host]);
|
|
23
|
-
});
|
|
24
|
-
test(`gRPC binding ${host} never broadens an explicit private address`, async () => {
|
|
25
|
-
const attempted = [];
|
|
26
|
-
const Grpc = load(path.join(__dirname, '../../back/services/grpc.ts'), {
|
|
27
|
-
'../config': { bindHostGrpc: host, grpcPort: 5500 },
|
|
28
|
-
'../loaders/logger': logger,
|
|
29
|
-
'./metrics': { metricsService: { record() {} } },
|
|
30
|
-
typedi: { Service: () => (x) => x },
|
|
31
|
-
'@grpc/grpc-js': {
|
|
32
|
-
Server: class {
|
|
33
|
-
addService() {}
|
|
34
|
-
bindAsync(address, _credentials, cb) {
|
|
35
|
-
attempted.push(address);
|
|
36
|
-
cb(new Error('unavailable'));
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
ServerCredentials: {
|
|
40
|
-
createSsl(_ca, _certs, requireClientCert) {
|
|
41
|
-
assert.equal(requireClientCert, true);
|
|
42
|
-
return {};
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
'../protos/cron': { CronService: {} },
|
|
47
|
-
'../protos/health': { HealthService: {} },
|
|
48
|
-
'../protos/api': { ApiService: {} },
|
|
49
|
-
'../schedule/addCron': {},
|
|
50
|
-
'../schedule/delCron': {},
|
|
51
|
-
'../schedule/health': {},
|
|
52
|
-
'../schedule/api': {},
|
|
53
|
-
'../config/grpcCerts': {
|
|
54
|
-
initGrpcCerts: async () => ({
|
|
55
|
-
caCert: 'test',
|
|
56
|
-
serverCert: 'test',
|
|
57
|
-
serverKey: 'test',
|
|
58
|
-
}),
|
|
59
|
-
},
|
|
60
|
-
}).GrpcServerService;
|
|
61
|
-
await assert.rejects(new Grpc().initialize());
|
|
62
|
-
assert.deepEqual(
|
|
63
|
-
attempted,
|
|
64
|
-
host === '::' ? ['[::]:5500', '0.0.0.0:5500'] : [`${host}:5500`],
|
|
65
|
-
);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
const assert = require('node:assert/strict');
|
|
2
|
-
const test = require('node:test');
|
|
3
|
-
const fs = require('node:fs/promises');
|
|
4
|
-
const os = require('node:os');
|
|
5
|
-
const path = require('node:path');
|
|
6
|
-
const load = require('../helpers/load-security-module.cjs');
|
|
7
|
-
const { LogStreamManager } = require('../../back/shared/logStreamManager');
|
|
8
|
-
|
|
9
|
-
async function fixture(t) {
|
|
10
|
-
const base = await fs.mkdtemp(path.join(os.tmpdir(), 'ql-log-boundary-'));
|
|
11
|
-
t.after(() => fs.rm(base, { recursive: true, force: true }));
|
|
12
|
-
const root = path.join(base, 'log');
|
|
13
|
-
const outside = path.join(base, 'log-other');
|
|
14
|
-
await fs.mkdir(root);
|
|
15
|
-
await fs.mkdir(outside);
|
|
16
|
-
const victim = path.join(outside, 'victim.log');
|
|
17
|
-
await fs.writeFile(victim, 'unchanged');
|
|
18
|
-
await fs.symlink(outside, path.join(root, 'escape-dir'));
|
|
19
|
-
await fs.symlink(victim, path.join(root, 'escape-file'));
|
|
20
|
-
await fs.symlink(
|
|
21
|
-
path.join(outside, 'missing.log'),
|
|
22
|
-
path.join(root, 'dangling'),
|
|
23
|
-
);
|
|
24
|
-
const invalid = [
|
|
25
|
-
path.join(root, '..', 'log-other', 'new.log'),
|
|
26
|
-
path.join(root, 'escape-dir', 'new.log'),
|
|
27
|
-
path.join(root, 'escape-file'),
|
|
28
|
-
path.join(root, 'dangling'),
|
|
29
|
-
root,
|
|
30
|
-
path.join(root, 'bad\0name'),
|
|
31
|
-
];
|
|
32
|
-
return { root, outside, victim, invalid };
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
test('log streams reject traversal, sibling prefixes and escaping symlinks before writing', async (t) => {
|
|
36
|
-
const { root, outside, victim, invalid } = await fixture(t);
|
|
37
|
-
const manager = new LogStreamManager(root);
|
|
38
|
-
for (const target of invalid) {
|
|
39
|
-
await assert.rejects(
|
|
40
|
-
manager.write(target, 'overwrite'),
|
|
41
|
-
/outside the log directory/,
|
|
42
|
-
);
|
|
43
|
-
await assert.rejects(
|
|
44
|
-
manager.closeStream(target),
|
|
45
|
-
/outside the log directory/,
|
|
46
|
-
);
|
|
47
|
-
assert.equal(manager.getOpenStreamCount(), 0);
|
|
48
|
-
}
|
|
49
|
-
assert.equal(await fs.readFile(victim, 'utf8'), 'unchanged');
|
|
50
|
-
assert.deepEqual(await fs.readdir(outside), ['victim.log']);
|
|
51
|
-
const folder = path.join(root, '中文 日志');
|
|
52
|
-
await fs.mkdir(folder);
|
|
53
|
-
const log = path.join(folder, 'task.log');
|
|
54
|
-
await Promise.all([
|
|
55
|
-
manager.write(log, '开始\n'),
|
|
56
|
-
manager.write(log, '结束\n'),
|
|
57
|
-
]);
|
|
58
|
-
await manager.closeAll();
|
|
59
|
-
assert.equal(await fs.readFile(log, 'utf8'), '开始\n结束\n');
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
test('log initialization rejects unsafe paths before mkdir or file writes', async (t) => {
|
|
63
|
-
const { root, outside, victim, invalid } = await fixture(t);
|
|
64
|
-
const { handleLogPath } = load(path.resolve('back/config/util.ts'), {
|
|
65
|
-
'./index': { logPath: root },
|
|
66
|
-
'./share': {},
|
|
67
|
-
'../loaders/logger': {},
|
|
68
|
-
'../shared/utils': {
|
|
69
|
-
writeFileWithLock: (file, data) => fs.writeFile(file, data),
|
|
70
|
-
},
|
|
71
|
-
'../data/dependence': { DependenceTypes: {} },
|
|
72
|
-
});
|
|
73
|
-
for (const target of invalid) {
|
|
74
|
-
await assert.rejects(
|
|
75
|
-
handleLogPath(target, 'overwrite'),
|
|
76
|
-
/outside the log directory/,
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
await assert.rejects(
|
|
80
|
-
handleLogPath('../log-other/new/sub/task.log', 'overwrite'),
|
|
81
|
-
/outside the log directory/,
|
|
82
|
-
);
|
|
83
|
-
assert.equal(await fs.readFile(victim, 'utf8'), 'unchanged');
|
|
84
|
-
assert.deepEqual(await fs.readdir(outside), ['victim.log']);
|
|
85
|
-
const log = await handleLogPath('中文 日志/nested/task.log', 'initial');
|
|
86
|
-
assert.equal(await fs.readFile(log, 'utf8'), 'initial');
|
|
87
|
-
assert.equal(await handleLogPath(log, 'ignored'), log);
|
|
88
|
-
assert.equal(await fs.readFile(log, 'utf8'), 'initial');
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
test('manual execution rejects escaping log names before creating directories or spawning', async (t) => {
|
|
92
|
-
const { root, outside, victim } = await fixture(t);
|
|
93
|
-
let spawned = 0;
|
|
94
|
-
let releases = 0;
|
|
95
|
-
const errors = [];
|
|
96
|
-
const CronService = load(path.resolve('back/services/cron.ts'), {
|
|
97
|
-
'../config': { logPath: root },
|
|
98
|
-
'../data/cron': {
|
|
99
|
-
CrontabStatus: { queued: 3, idle: 1 },
|
|
100
|
-
CrontabModel: { update: async () => {} },
|
|
101
|
-
},
|
|
102
|
-
'../data/runningInstance': { RunningInstanceModel: {}, InstanceStatus: {} },
|
|
103
|
-
'../config/util': {},
|
|
104
|
-
'../config/const': {},
|
|
105
|
-
'../schedule/client': {},
|
|
106
|
-
'../shared/pLimit': {
|
|
107
|
-
manualRunWithCronLimit: async (fn) => {
|
|
108
|
-
try {
|
|
109
|
-
return await fn();
|
|
110
|
-
} finally {
|
|
111
|
-
releases++;
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
'../shared/utils': {},
|
|
116
|
-
'../shared/i18n': { t: (s) => s },
|
|
117
|
-
'../shared/logReader': {},
|
|
118
|
-
'../shared/logStreamManager': {
|
|
119
|
-
logStreamManager: { closeStream: async () => {} },
|
|
120
|
-
},
|
|
121
|
-
'cross-spawn': {
|
|
122
|
-
spawn: () => {
|
|
123
|
-
spawned++;
|
|
124
|
-
throw new Error('must not spawn');
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
}).default;
|
|
128
|
-
const service = new CronService({
|
|
129
|
-
info() {},
|
|
130
|
-
error: (...args) => errors.push(args),
|
|
131
|
-
});
|
|
132
|
-
for (const log_name of [
|
|
133
|
-
'../log-other/new',
|
|
134
|
-
outside,
|
|
135
|
-
'escape-dir/new',
|
|
136
|
-
'dangling',
|
|
137
|
-
'bad\0name',
|
|
138
|
-
]) {
|
|
139
|
-
service.getDb = async () => ({
|
|
140
|
-
id: 1,
|
|
141
|
-
status: 3,
|
|
142
|
-
command: 'ignored',
|
|
143
|
-
log_path: '',
|
|
144
|
-
log_name,
|
|
145
|
-
});
|
|
146
|
-
await service.runSingle(1);
|
|
147
|
-
}
|
|
148
|
-
assert.equal(spawned, 0);
|
|
149
|
-
assert.equal(releases, 5);
|
|
150
|
-
assert.equal(
|
|
151
|
-
errors.filter((args) =>
|
|
152
|
-
args.includes('Log path is outside the log directory'),
|
|
153
|
-
).length,
|
|
154
|
-
5,
|
|
155
|
-
);
|
|
156
|
-
assert.equal(await fs.readFile(victim, 'utf8'), 'unchanged');
|
|
157
|
-
assert.deepEqual(await fs.readdir(outside), ['victim.log']);
|
|
158
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
const assert = require('node:assert/strict');
|
|
2
|
-
const fs = require('node:fs/promises');
|
|
3
|
-
const os = require('node:os');
|
|
4
|
-
const path = require('node:path');
|
|
5
|
-
const test = require('node:test');
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
DEFAULT_LOG_CHUNK_BYTES,
|
|
9
|
-
MAX_LOG_CHUNK_BYTES,
|
|
10
|
-
readLogChunk,
|
|
11
|
-
} = require('../../back/shared/logReader');
|
|
12
|
-
|
|
13
|
-
test('log reader defaults to a bounded tail and supports incremental reads', async (t) => {
|
|
14
|
-
const directory = await fs.mkdtemp(path.join(os.tmpdir(), 'ql-log-reader-'));
|
|
15
|
-
const file = path.join(directory, 'task.log');
|
|
16
|
-
t.after(() => fs.rm(directory, { recursive: true, force: true }));
|
|
17
|
-
|
|
18
|
-
const initial = 'a'.repeat(DEFAULT_LOG_CHUNK_BYTES * 2);
|
|
19
|
-
await fs.writeFile(file, initial);
|
|
20
|
-
|
|
21
|
-
const tail = await readLogChunk(file);
|
|
22
|
-
assert.equal(tail.content.length, DEFAULT_LOG_CHUNK_BYTES);
|
|
23
|
-
assert.equal(tail.offset, DEFAULT_LOG_CHUNK_BYTES);
|
|
24
|
-
assert.equal(tail.nextOffset, initial.length);
|
|
25
|
-
assert.equal(tail.truncated, true);
|
|
26
|
-
|
|
27
|
-
await fs.appendFile(file, 'next');
|
|
28
|
-
const incremental = await readLogChunk(file, { offset: tail.nextOffset });
|
|
29
|
-
assert.equal(incremental.content, 'next');
|
|
30
|
-
assert.equal(incremental.nextOffset, initial.length + 4);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
test('log reader enforces the maximum chunk size', async (t) => {
|
|
34
|
-
const directory = await fs.mkdtemp(path.join(os.tmpdir(), 'ql-log-reader-'));
|
|
35
|
-
const file = path.join(directory, 'large.log');
|
|
36
|
-
t.after(() => fs.rm(directory, { recursive: true, force: true }));
|
|
37
|
-
await fs.writeFile(file, 'x'.repeat(MAX_LOG_CHUNK_BYTES + 1024));
|
|
38
|
-
|
|
39
|
-
const chunk = await readLogChunk(file, { limit: Number.MAX_SAFE_INTEGER });
|
|
40
|
-
assert.equal(Buffer.byteLength(chunk.content), MAX_LOG_CHUNK_BYTES);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test('log reader preserves UTF-8 characters across byte boundaries', async (t) => {
|
|
44
|
-
const directory = await fs.mkdtemp(path.join(os.tmpdir(), 'ql-log-reader-'));
|
|
45
|
-
const file = path.join(directory, 'utf8.log');
|
|
46
|
-
t.after(() => fs.rm(directory, { recursive: true, force: true }));
|
|
47
|
-
await fs.writeFile(file, 'a'.repeat(5) + '中文日志');
|
|
48
|
-
|
|
49
|
-
const first = await readLogChunk(file, { offset: 0, limit: 7 });
|
|
50
|
-
const second = await readLogChunk(file, {
|
|
51
|
-
offset: first.nextOffset,
|
|
52
|
-
limit: 7,
|
|
53
|
-
});
|
|
54
|
-
const third = await readLogChunk(file, {
|
|
55
|
-
offset: second.nextOffset,
|
|
56
|
-
limit: 7,
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
assert.equal(first.content + second.content + third.content, 'aaaaa中文日志');
|
|
60
|
-
assert.equal((first.content + second.content + third.content).includes('�'), false);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
test('missing logs return an empty chunk', async () => {
|
|
64
|
-
const chunk = await readLogChunk('/path/that/does/not/exist.log');
|
|
65
|
-
assert.deepEqual(chunk, {
|
|
66
|
-
content: '',
|
|
67
|
-
offset: 0,
|
|
68
|
-
nextOffset: 0,
|
|
69
|
-
total: 0,
|
|
70
|
-
truncated: false,
|
|
71
|
-
});
|
|
72
|
-
});
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const assert = require('node:assert/strict');
|
|
2
|
-
const test = require('node:test');
|
|
3
|
-
const fs = require('node:fs/promises');
|
|
4
|
-
const path = require('node:path');
|
|
5
|
-
const os = require('node:os');
|
|
6
|
-
const { spawn } = require('node:child_process');
|
|
7
|
-
const load = require('../helpers/load-security-module.cjs');
|
|
8
|
-
const { LogStreamManager } = require('../../back/shared/logStreamManager');
|
|
9
|
-
|
|
10
|
-
test(
|
|
11
|
-
'manual execution captures a short child before slow status storage and flushes before release',
|
|
12
|
-
{ timeout: 5000 },
|
|
13
|
-
async (t) => {
|
|
14
|
-
const root = await fs.mkdtemp(path.join(os.tmpdir(), 'ql-manual-'));
|
|
15
|
-
t.after(() => fs.rm(root, { recursive: true, force: true }));
|
|
16
|
-
const logs = new LogStreamManager(root);
|
|
17
|
-
const updates = [];
|
|
18
|
-
let active = 0;
|
|
19
|
-
let failSpawn = false;
|
|
20
|
-
const CronService = load(path.resolve('back/services/cron.ts'), {
|
|
21
|
-
'../config': { logPath: root },
|
|
22
|
-
'../data/cron': {
|
|
23
|
-
CrontabStatus: { queued: 3, running: 0, idle: 1 },
|
|
24
|
-
CrontabModel: {
|
|
25
|
-
update: async (data, options) => {
|
|
26
|
-
await new Promise((resolve) => setTimeout(resolve, 40));
|
|
27
|
-
updates.push({ data, options });
|
|
28
|
-
return [1];
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
'../data/runningInstance': {
|
|
33
|
-
RunningInstanceModel: {},
|
|
34
|
-
InstanceStatus: {},
|
|
35
|
-
},
|
|
36
|
-
'../config/util': { getUniqPath: async () => 'task' },
|
|
37
|
-
'../config/const': { TASK_PREFIX: 'task ', QL_PREFIX: 'ql ' },
|
|
38
|
-
'../schedule/client': {},
|
|
39
|
-
'../shared/pLimit': {
|
|
40
|
-
manualRunWithCronLimit: async (fn) => {
|
|
41
|
-
active++;
|
|
42
|
-
try {
|
|
43
|
-
return await fn();
|
|
44
|
-
} finally {
|
|
45
|
-
active--;
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
'../shared/utils': {},
|
|
50
|
-
'../shared/i18n': { t: (s) => s },
|
|
51
|
-
'../shared/logReader': {},
|
|
52
|
-
'../shared/logStreamManager': { logStreamManager: logs },
|
|
53
|
-
'cross-spawn': {
|
|
54
|
-
spawn: () =>
|
|
55
|
-
failSpawn
|
|
56
|
-
? spawn('true', { shell: '/nonexistent-ql-manual-shell' })
|
|
57
|
-
: spawn(process.execPath, [
|
|
58
|
-
'-e',
|
|
59
|
-
'process.stdout.write("末尾\\n")',
|
|
60
|
-
]),
|
|
61
|
-
},
|
|
62
|
-
}).default;
|
|
63
|
-
const service = new CronService({ info() {}, error() {} });
|
|
64
|
-
service.getDb = async () => ({
|
|
65
|
-
id: 1,
|
|
66
|
-
status: 3,
|
|
67
|
-
command: 'ignored',
|
|
68
|
-
log_path: '',
|
|
69
|
-
});
|
|
70
|
-
service.makeCommand = () => 'ignored';
|
|
71
|
-
await service.runSingle(1);
|
|
72
|
-
const [file] = await fs.readdir(path.join(root, 'task'));
|
|
73
|
-
assert.equal(
|
|
74
|
-
await fs.readFile(path.join(root, 'task', file), 'utf8'),
|
|
75
|
-
'末尾\n',
|
|
76
|
-
);
|
|
77
|
-
assert.equal(logs.getOpenStreamCount(), 0);
|
|
78
|
-
assert.equal(active, 0);
|
|
79
|
-
assert.equal(updates.at(-1).data.status, 1);
|
|
80
|
-
failSpawn = true;
|
|
81
|
-
await service.runSingle(1);
|
|
82
|
-
assert.equal(active, 0);
|
|
83
|
-
assert.equal(updates.at(-1).data.status, 1);
|
|
84
|
-
},
|
|
85
|
-
);
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
const test = require('node:test');
|
|
2
|
-
const assert = require('node:assert/strict');
|
|
3
|
-
const fs = require('node:fs/promises');
|
|
4
|
-
const os = require('node:os');
|
|
5
|
-
const path = require('node:path');
|
|
6
|
-
const { spawn } = require('node:child_process');
|
|
7
|
-
const { once } = require('node:events');
|
|
8
|
-
const { Sequelize, DataTypes } = require('sequelize');
|
|
9
|
-
const load = require('../helpers/load-security-module.cjs');
|
|
10
|
-
const { killTask } = require('../../back/config/util');
|
|
11
|
-
const { LogStreamManager } = require('../../back/shared/logStreamManager');
|
|
12
|
-
|
|
13
|
-
for (const conflict of ['stop', 'newer-queue', 'stop-requeue']) {
|
|
14
|
-
test(
|
|
15
|
-
`manual startup loses its conditional claim after ${conflict} and terminates the late child`,
|
|
16
|
-
{ timeout: 10000 },
|
|
17
|
-
async (t) => {
|
|
18
|
-
const root = await fs.mkdtemp(path.join(os.tmpdir(), 'ql-manual-claim-'));
|
|
19
|
-
const db = new Sequelize({
|
|
20
|
-
dialect: 'sqlite',
|
|
21
|
-
storage: ':memory:',
|
|
22
|
-
logging: false,
|
|
23
|
-
});
|
|
24
|
-
t.after(async () => {
|
|
25
|
-
await db.close();
|
|
26
|
-
await fs.rm(root, { recursive: true, force: true });
|
|
27
|
-
});
|
|
28
|
-
const crons = db.define('Cron', {
|
|
29
|
-
status: DataTypes.INTEGER,
|
|
30
|
-
pid: DataTypes.INTEGER,
|
|
31
|
-
log_path: DataTypes.STRING,
|
|
32
|
-
queued_token: DataTypes.STRING,
|
|
33
|
-
command: DataTypes.STRING,
|
|
34
|
-
});
|
|
35
|
-
const instances = db.define('Instance', {
|
|
36
|
-
cron_id: DataTypes.INTEGER,
|
|
37
|
-
status: DataTypes.INTEGER,
|
|
38
|
-
pid: DataTypes.INTEGER,
|
|
39
|
-
});
|
|
40
|
-
await db.sync();
|
|
41
|
-
await crons.create({
|
|
42
|
-
id: 1,
|
|
43
|
-
status: 3,
|
|
44
|
-
pid: null,
|
|
45
|
-
log_path: 'previous.log',
|
|
46
|
-
command: 'ignored',
|
|
47
|
-
});
|
|
48
|
-
let release,
|
|
49
|
-
entered,
|
|
50
|
-
child,
|
|
51
|
-
released = 0;
|
|
52
|
-
const pending = new Promise((resolve) => (entered = resolve));
|
|
53
|
-
const gate = new Promise((resolve) => (release = resolve));
|
|
54
|
-
const logs = new LogStreamManager(root);
|
|
55
|
-
t.after(() => logs.closeAll());
|
|
56
|
-
const CronService = load('back/services/cron.ts', {
|
|
57
|
-
'../config': { logPath: root },
|
|
58
|
-
'../data/cron': {
|
|
59
|
-
CrontabModel: crons,
|
|
60
|
-
CrontabStatus: { queued: 3, running: 0, idle: 1 },
|
|
61
|
-
},
|
|
62
|
-
'../data/runningInstance': {
|
|
63
|
-
RunningInstanceModel: instances,
|
|
64
|
-
InstanceStatus: { running: 0, stopped: 2 },
|
|
65
|
-
},
|
|
66
|
-
'../config/util': {
|
|
67
|
-
getUniqPath: async () => {
|
|
68
|
-
entered();
|
|
69
|
-
await gate;
|
|
70
|
-
return 'task';
|
|
71
|
-
},
|
|
72
|
-
killTask,
|
|
73
|
-
},
|
|
74
|
-
'../config/const': {},
|
|
75
|
-
'../schedule/client': {},
|
|
76
|
-
'../shared/pLimit': {
|
|
77
|
-
manualRunWithCronLimit: async (fn) => {
|
|
78
|
-
try {
|
|
79
|
-
return await fn();
|
|
80
|
-
} finally {
|
|
81
|
-
released++;
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
'../shared/utils': {},
|
|
86
|
-
'../shared/i18n': { t: (s) => s },
|
|
87
|
-
'../shared/logReader': {},
|
|
88
|
-
'../shared/logStreamManager': { logStreamManager: logs },
|
|
89
|
-
'cross-spawn': {
|
|
90
|
-
spawn: () => {
|
|
91
|
-
child = spawn(process.execPath, [
|
|
92
|
-
'-e',
|
|
93
|
-
'setInterval(() => {}, 1000)',
|
|
94
|
-
]);
|
|
95
|
-
t.after(() => {
|
|
96
|
-
if (child.exitCode === null && child.signalCode === null)
|
|
97
|
-
child.kill('SIGKILL');
|
|
98
|
-
});
|
|
99
|
-
return child;
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
}).default;
|
|
103
|
-
const service = new CronService({ info() {}, error() {} });
|
|
104
|
-
service.getDb = async () =>
|
|
105
|
-
(await crons.findByPk(1)).get({ plain: true });
|
|
106
|
-
service.makeCommand = () => 'ignored';
|
|
107
|
-
const running = service.runSingle(1);
|
|
108
|
-
await pending;
|
|
109
|
-
if (conflict === 'stop-requeue') {
|
|
110
|
-
await service.stop([1]);
|
|
111
|
-
// Queue again through the real API; leave the new runner pending.
|
|
112
|
-
const pendingRuns = [];
|
|
113
|
-
service.runSingle = (id, token) => pendingRuns.push({ id, token });
|
|
114
|
-
await service.run([1]);
|
|
115
|
-
assert.equal(pendingRuns.length, 1);
|
|
116
|
-
assert.equal(
|
|
117
|
-
pendingRuns[0].token,
|
|
118
|
-
(await crons.findByPk(1)).queued_token,
|
|
119
|
-
);
|
|
120
|
-
} else if (conflict === 'stop') await service.stop([1]);
|
|
121
|
-
else await crons.update({ log_path: 'newer.log' }, { where: { id: 1 } });
|
|
122
|
-
release();
|
|
123
|
-
const result = await running;
|
|
124
|
-
assert.match(result.error.message, /stopped or superseded/);
|
|
125
|
-
assert.ok(child.signalCode || child.exitCode !== null);
|
|
126
|
-
assert.throws(() => process.kill(child.pid, 0), { code: 'ESRCH' });
|
|
127
|
-
const row = await crons.findByPk(1);
|
|
128
|
-
assert.equal(row.status, conflict === 'stop' ? 1 : 3);
|
|
129
|
-
assert.equal(
|
|
130
|
-
row.log_path,
|
|
131
|
-
conflict === 'newer-queue' ? 'newer.log' : 'previous.log',
|
|
132
|
-
);
|
|
133
|
-
assert.equal(row.pid, null);
|
|
134
|
-
assert.equal(released, 1);
|
|
135
|
-
},
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
test(
|
|
140
|
-
'verified termination waits for a SIGTERM-resistant target to exit',
|
|
141
|
-
{ timeout: 5000 },
|
|
142
|
-
async (t) => {
|
|
143
|
-
const child = spawn(process.execPath, [
|
|
144
|
-
'-e',
|
|
145
|
-
'process.on("SIGTERM",()=>{}); process.stdout.write("ready"); setInterval(()=>{},1000)',
|
|
146
|
-
]);
|
|
147
|
-
t.after(() => {
|
|
148
|
-
if (child.exitCode === null && child.signalCode === null)
|
|
149
|
-
child.kill('SIGKILL');
|
|
150
|
-
});
|
|
151
|
-
const exited = once(child, 'exit');
|
|
152
|
-
await new Promise((resolve) => child.stdout.once('data', resolve));
|
|
153
|
-
await killTask(child.pid, true);
|
|
154
|
-
// Linux may report an exited zombie before Node reaps our child. Wait for
|
|
155
|
-
// that separate event before requiring the PID to disappear.
|
|
156
|
-
await exited;
|
|
157
|
-
assert.throws(() => process.kill(child.pid, 0), { code: 'ESRCH' });
|
|
158
|
-
assert.equal(child.signalCode, 'SIGKILL');
|
|
159
|
-
},
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
test('a runner waiting for a concurrency slot cannot adopt a newer queued generation', async (t) => {
|
|
163
|
-
const db = new Sequelize({
|
|
164
|
-
dialect: 'sqlite',
|
|
165
|
-
storage: ':memory:',
|
|
166
|
-
logging: false,
|
|
167
|
-
});
|
|
168
|
-
t.after(() => db.close());
|
|
169
|
-
const crons = db.define('Cron', {
|
|
170
|
-
status: DataTypes.INTEGER,
|
|
171
|
-
pid: DataTypes.INTEGER,
|
|
172
|
-
log_path: DataTypes.STRING,
|
|
173
|
-
queued_token: DataTypes.STRING,
|
|
174
|
-
});
|
|
175
|
-
await db.sync();
|
|
176
|
-
await crons.create({ id: 1, status: 1, log_path: 'same.log' });
|
|
177
|
-
const waiting = [];
|
|
178
|
-
const CronService = load('back/services/cron.ts', {
|
|
179
|
-
'../config': {},
|
|
180
|
-
'../data/cron': {
|
|
181
|
-
CrontabModel: crons,
|
|
182
|
-
CrontabStatus: { queued: 3, idle: 1, running: 0 },
|
|
183
|
-
},
|
|
184
|
-
'../data/runningInstance': {
|
|
185
|
-
RunningInstanceModel: { findAll: async () => [] },
|
|
186
|
-
InstanceStatus: { running: 0 },
|
|
187
|
-
},
|
|
188
|
-
'../config/util': {
|
|
189
|
-
getUniqPath: () => assert.fail('stale runner must not prepare a child'),
|
|
190
|
-
},
|
|
191
|
-
'../config/const': {},
|
|
192
|
-
'../schedule/client': {},
|
|
193
|
-
'../shared/pLimit': {
|
|
194
|
-
manualRunWithCronLimit: (fn) => {
|
|
195
|
-
waiting.push(fn);
|
|
196
|
-
return Promise.resolve();
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
'../shared/utils': {},
|
|
200
|
-
'../shared/i18n': {},
|
|
201
|
-
'../shared/logReader': {},
|
|
202
|
-
'../shared/logStreamManager': {},
|
|
203
|
-
'cross-spawn': { spawn: () => assert.fail('stale runner must not spawn') },
|
|
204
|
-
}).default;
|
|
205
|
-
const errors = [];
|
|
206
|
-
const service = new CronService({ error: (...args) => errors.push(args) });
|
|
207
|
-
await service.run([1]);
|
|
208
|
-
const first = (await crons.findByPk(1)).queued_token;
|
|
209
|
-
await service.stop([1]);
|
|
210
|
-
await service.run([1]);
|
|
211
|
-
const second = (await crons.findByPk(1)).queued_token;
|
|
212
|
-
assert.notEqual(first, second);
|
|
213
|
-
assert.equal(waiting.length, 2);
|
|
214
|
-
await waiting[0]();
|
|
215
|
-
const row = await crons.findByPk(1);
|
|
216
|
-
assert.equal(row.status, 3);
|
|
217
|
-
assert.equal(row.queued_token, second);
|
|
218
|
-
assert.equal(row.log_path, 'same.log');
|
|
219
|
-
assert.deepEqual(errors, []);
|
|
220
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const assert = require('node:assert/strict');
|
|
2
|
-
const test = require('node:test');
|
|
3
|
-
|
|
4
|
-
const {
|
|
5
|
-
MAX_METRIC_SAMPLES,
|
|
6
|
-
metricsService,
|
|
7
|
-
} = require('../../back/services/metrics');
|
|
8
|
-
|
|
9
|
-
test('metrics keep only the newest bounded samples', () => {
|
|
10
|
-
const sampleCount = MAX_METRIC_SAMPLES * 50;
|
|
11
|
-
for (let index = 0; index < sampleCount; index++) {
|
|
12
|
-
metricsService.record('http_request', index, {
|
|
13
|
-
path: `/health/${index}`,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const result = metricsService.getMetrics('http_request');
|
|
18
|
-
assert.equal(result.count, MAX_METRIC_SAMPLES);
|
|
19
|
-
assert.equal(result.metrics[0].value, sampleCount - MAX_METRIC_SAMPLES);
|
|
20
|
-
assert.equal(result.metrics.at(-1).value, sampleCount - 1);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test('empty metric queries return finite aggregates', () => {
|
|
24
|
-
const result = metricsService.getMetrics('missing_metric');
|
|
25
|
-
assert.deepEqual(
|
|
26
|
-
{
|
|
27
|
-
count: result.count,
|
|
28
|
-
average: result.average,
|
|
29
|
-
min: result.min,
|
|
30
|
-
max: result.max,
|
|
31
|
-
},
|
|
32
|
-
{ count: 0, average: 0, min: 0, max: 0 },
|
|
33
|
-
);
|
|
34
|
-
});
|