@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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const assert = require('node:assert/strict');
|
|
2
|
+
const fs = require('node:fs');
|
|
3
|
+
const os = require('node:os');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const { createHash } = require('node:crypto');
|
|
6
|
+
const { spawnSync } = require('node:child_process');
|
|
7
|
+
|
|
8
|
+
// Run in new processes: a healthy parent can outlive a broken native runtime.
|
|
9
|
+
function probeNodeRuntime(executable = process.execPath) {
|
|
10
|
+
const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'ql-node-url-'));
|
|
11
|
+
const source = `
|
|
12
|
+
const assert = require('node:assert/strict');
|
|
13
|
+
const { pathToFileURL, fileURLToPath } = require('node:url');
|
|
14
|
+
for (let i = 0; i < 1000; i++) {
|
|
15
|
+
assert.equal(new URL('/任务?q=' + i, 'https://example.com').hostname, 'example.com');
|
|
16
|
+
assert.equal(new URL('https://例子.测试').hostname, 'xn--fsqu00a.xn--0zwm56d');
|
|
17
|
+
assert.equal(new URL('http://[::1]:5700').port, '5700');
|
|
18
|
+
const filename = '/tmp/中文 path/' + i + '.cjs';
|
|
19
|
+
assert.equal(fileURLToPath(pathToFileURL(filename)), filename);
|
|
20
|
+
}
|
|
21
|
+
console.log('QINGLONG_NODE_URL_OK');
|
|
22
|
+
`;
|
|
23
|
+
const file = path.join(directory, 'probe.cjs');
|
|
24
|
+
fs.writeFileSync(file, source);
|
|
25
|
+
try {
|
|
26
|
+
for (let i = 0; i < 4; i++) {
|
|
27
|
+
const args = process.execArgv.includes('--jitless') ? ['--jitless'] : [];
|
|
28
|
+
args.push(...(i % 2 ? [file] : ['-e', source]));
|
|
29
|
+
const child = spawnSync(executable, args, {
|
|
30
|
+
encoding: 'utf8',
|
|
31
|
+
// Multi-architecture CI runs this same probe through QEMU.
|
|
32
|
+
timeout: 120000,
|
|
33
|
+
maxBuffer: 65536,
|
|
34
|
+
env: { ...process.env, NODE_OPTIONS: '' },
|
|
35
|
+
});
|
|
36
|
+
assert.equal(
|
|
37
|
+
child.status,
|
|
38
|
+
0,
|
|
39
|
+
`Node URL runtime probe failed (${i % 2 ? 'file' : 'eval'}): signal=${
|
|
40
|
+
child.signal
|
|
41
|
+
}; status=${child.status}; ${child.error?.message || child.stderr}`,
|
|
42
|
+
);
|
|
43
|
+
assert.match(child.stdout, /QINGLONG_NODE_URL_OK/);
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
ok: true,
|
|
47
|
+
node: process.version,
|
|
48
|
+
architecture: process.arch,
|
|
49
|
+
ada: process.versions.ada,
|
|
50
|
+
processes: 4,
|
|
51
|
+
urlIterationsPerProcess: 1000,
|
|
52
|
+
nodeSha256: createHash('sha256')
|
|
53
|
+
.update(fs.readFileSync(executable))
|
|
54
|
+
.digest('hex'),
|
|
55
|
+
};
|
|
56
|
+
} finally {
|
|
57
|
+
fs.rmSync(directory, { recursive: true, force: true });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = { probeNodeRuntime };
|
|
62
|
+
if (require.main === module) console.log(JSON.stringify(probeNodeRuntime()));
|
package/shell/node_path_cache.sh
CHANGED
|
@@ -65,7 +65,9 @@ ql_read_node_path_cache() {
|
|
|
65
65
|
# the caller's descriptors. A crashed refresher releases the kernel lock.
|
|
66
66
|
ql_refresh_node_global_path() (
|
|
67
67
|
local cache="$1" key="$2" now result previous_umask
|
|
68
|
-
|
|
68
|
+
# Keep one persistent lock per owner. Removing per-key lock files could
|
|
69
|
+
# split concurrent waiters across different inodes during cache cleanup.
|
|
70
|
+
local lock="${dir_tmp}/pnpm-root-${EUID}.lock"
|
|
69
71
|
previous_umask=$(umask)
|
|
70
72
|
umask 077
|
|
71
73
|
if type -P flock &>/dev/null && mkdir -p -- "$dir_tmp" 2>/dev/null; then
|
|
@@ -93,6 +95,10 @@ ql_refresh_node_global_path() (
|
|
|
93
95
|
|
|
94
96
|
# Private lock creation must not change pnpm's inherited creation mask.
|
|
95
97
|
umask "$previous_umask"
|
|
98
|
+
# Warm lookups never scan the directory. Retire old environment records on
|
|
99
|
+
# refresh, while preserving the shared lock and unrelated cache files.
|
|
100
|
+
find "$dir_tmp" -maxdepth 1 -type f -user "$EUID" \
|
|
101
|
+
-name "pnpm-root-${EUID}-*.cache" -mmin +60 -delete 2>/dev/null || true
|
|
96
102
|
now=${EPOCHSECONDS:-$(date +%s)}
|
|
97
103
|
result=$(pnpm root -g 9>&- 2>/dev/null) || return $?
|
|
98
104
|
# Never cache failed, empty, multiline or non-absolute answers.
|
|
@@ -119,8 +125,10 @@ ql_get_node_global_path() {
|
|
|
119
125
|
fi
|
|
120
126
|
|
|
121
127
|
local key cache
|
|
122
|
-
cache="${dir_tmp}/pnpm-root-${EUID}.cache"
|
|
123
128
|
key=$(ql_node_path_cache_key) || { pnpm root -g 2>/dev/null; return $?; }
|
|
129
|
+
# Node and crond may have different working directories/configuration.
|
|
130
|
+
# Preserve both discoveries instead of evicting each other on every run.
|
|
131
|
+
cache="${dir_tmp}/pnpm-root-${EUID}-${key// /-}.cache"
|
|
124
132
|
if ql_read_node_path_cache "$cache" "$key"; then
|
|
125
133
|
return 0
|
|
126
134
|
fi
|
package/shell/otask.sh
CHANGED
|
@@ -39,44 +39,44 @@ random_delay() {
|
|
|
39
39
|
gen_array_scripts() {
|
|
40
40
|
local dir_current=$(pwd)
|
|
41
41
|
local i="-1"
|
|
42
|
-
cd $dir_scripts
|
|
43
|
-
for file in
|
|
42
|
+
cd "$dir_scripts" || return $?
|
|
43
|
+
for file in *; do
|
|
44
44
|
if [[ -f $file ]] && [[ $file == *.js && $file != sendNotify.js ]]; then
|
|
45
45
|
let i++
|
|
46
|
-
array_scripts[i]=$
|
|
47
|
-
array_scripts_name[i]=$(grep "new Env" $file | awk -F
|
|
48
|
-
[[ -z ${array_scripts_name[i]} ]] && array_scripts_name[i]="<未识别出活动名称>"
|
|
46
|
+
array_scripts[i]=$file
|
|
47
|
+
array_scripts_name[i]=$(grep -- "new Env" "$file" | awk -F '[(]' '{print $2}' | awk -F '[)]' '{print $1}' | sed 's:.*\('\''\|"\)\([^"'\'']*\)\('\''\|"\).*:\2:' | sed 's:"::g' | sed "s:'::g" | head -1)
|
|
48
|
+
[[ -z ${array_scripts_name[i]} ]] && array_scripts_name[i]="$(t '<未识别出活动名称>')"
|
|
49
49
|
fi
|
|
50
50
|
done
|
|
51
|
-
cd $dir_current
|
|
51
|
+
cd "$dir_current" || return $?
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
## 使用说明
|
|
55
55
|
usage() {
|
|
56
56
|
gen_array_scripts
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
t 'task命令运行本程序自动添加进crontab的脚本,需要输入脚本的绝对路径或去掉 “%s/” 目录后的相对路径(定时任务中请写作相对路径),用法为:' "$dir_scripts"
|
|
58
|
+
t '1.%s <file_name> # 依次执行,如果设置了随机延迟,将随机延迟一定秒数' "$cmd_task"
|
|
59
|
+
t '2.%s <file_name> now # 依次执行,无论是否设置了随机延迟,均立即运行,前台会输出日志,同时记录在日志文件中' "$cmd_task"
|
|
60
|
+
t '3.%s <file_name> conc <环境变量名称> <账号编号,空格分隔>(可选的) # 并发执行,无论是否设置了随机延迟,均立即运行,前台不产生日志,直接记录在日志文件中,且可指定账号执行' "$cmd_task"
|
|
61
|
+
t '4.%s <file_name> desi <环境变量名称> <账号编号,空格分隔> # 指定账号执行,无论是否设置了随机延迟,均立即运行' "$cmd_task"
|
|
62
62
|
if [[ ${#array_scripts[*]} -gt 0 ]]; then
|
|
63
|
-
|
|
63
|
+
t '\n当前有以下脚本可以运行:'
|
|
64
64
|
for ((i = 0; i < ${#array_scripts[*]}; i++)); do
|
|
65
65
|
echo -e "$(($i + 1)). ${array_scripts_name[i]}:${array_scripts[i]}"
|
|
66
66
|
done
|
|
67
67
|
else
|
|
68
|
-
|
|
68
|
+
t '\n暂无脚本可以执行'
|
|
69
69
|
fi
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
## run nohup,$1:文件名,不含路径,带后缀
|
|
73
73
|
run_nohup() {
|
|
74
74
|
local file_name=$1
|
|
75
|
-
nohup node $file_name
|
|
75
|
+
nohup node "$file_name" &>"$log_path" &
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
env_str_to_array() {
|
|
79
|
-
. $file_env
|
|
79
|
+
. "$file_env"
|
|
80
80
|
local IFS="&"
|
|
81
81
|
read -ra array <<<"${!env_param}"
|
|
82
82
|
array_length=${#array[@]}
|
|
@@ -84,7 +84,9 @@ env_str_to_array() {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
clear_non_sh_env() {
|
|
87
|
-
|
|
87
|
+
# Only automatic Node/Python preloads reconstruct the generated environment.
|
|
88
|
+
# Explicit interpreters and other commands must keep the shell-loaded values.
|
|
89
|
+
if [[ $isJsOrPythonFile == 'true' ]]; then
|
|
88
90
|
clear_env
|
|
89
91
|
fi
|
|
90
92
|
}
|
|
@@ -120,7 +122,7 @@ enter_script_workdir() {
|
|
|
120
122
|
_target_dir="${dir_scripts}/${work_dir}"
|
|
121
123
|
fi
|
|
122
124
|
if [[ -d "${_target_dir}" ]]; then
|
|
123
|
-
cd "${_target_dir}"
|
|
125
|
+
cd "${_target_dir}" || return $?
|
|
124
126
|
if [[ ${file_param} =~ "/" ]]; then
|
|
125
127
|
local script_name="${file_param##*/}"
|
|
126
128
|
if [[ "${use_dot_prefix}" == "true" ]]; then
|
|
@@ -134,13 +136,13 @@ enter_script_workdir() {
|
|
|
134
136
|
t '警告:工作目录不存在 %s' "${_target_dir}"
|
|
135
137
|
fi
|
|
136
138
|
|
|
137
|
-
cd $dir_scripts
|
|
139
|
+
cd "$dir_scripts" || return $?
|
|
138
140
|
if [[ ${file_param} =~ "/" ]]; then
|
|
139
141
|
local script_dir="${file_param%/*}"
|
|
140
142
|
local script_name="${file_param##*/}"
|
|
141
143
|
|
|
142
144
|
if [[ -d ${script_dir} ]]; then
|
|
143
|
-
cd $
|
|
145
|
+
cd "$script_dir" || return $?
|
|
144
146
|
if [[ "${use_dot_prefix}" == "true" ]]; then
|
|
145
147
|
file_param="./${script_name}"
|
|
146
148
|
else
|
|
@@ -157,12 +159,12 @@ run_normal() {
|
|
|
157
159
|
random_delay "$file_param"
|
|
158
160
|
fi
|
|
159
161
|
|
|
160
|
-
enter_script_workdir
|
|
162
|
+
enter_script_workdir || return $?
|
|
161
163
|
|
|
162
164
|
if [[ $isJsOrPythonFile == 'false' ]]; then
|
|
163
165
|
clear_non_sh_env
|
|
164
166
|
fi
|
|
165
|
-
|
|
167
|
+
run_task_command ${which_program:+"$which_program"} "$file_param" "${script_params[@]}"
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
handle_env_split() {
|
|
@@ -173,7 +175,7 @@ handle_env_split() {
|
|
|
173
175
|
env_str_to_array
|
|
174
176
|
local tempArr=$(echo $num_param | sed "s/-max/-${array_length}/g" | sed "s/max-/${array_length}-/g" | perl -pe "s|(\d+)(-\|~\|_)(\d+)|{\1..\3}|g")
|
|
175
177
|
local runArr=($(eval echo $tempArr))
|
|
176
|
-
array_run=($(awk -v RS=' ' '!a[$1]++'
|
|
178
|
+
array_run=($(awk -v RS=' ' '!a[$1]++' <<<"${runArr[*]}"))
|
|
177
179
|
}
|
|
178
180
|
|
|
179
181
|
## 并发执行时,设定的 RandomDelay 不会生效,即所有任务立即执行
|
|
@@ -190,10 +192,10 @@ run_concurrent() {
|
|
|
190
192
|
time=$(date "+$mtime_format")
|
|
191
193
|
single_log_time=$(format_log_time "$mtime_format" "$time")
|
|
192
194
|
|
|
193
|
-
enter_script_workdir
|
|
195
|
+
enter_script_workdir || return $?
|
|
194
196
|
|
|
195
197
|
local j=0
|
|
196
|
-
for i in ${array_run[@]}; do
|
|
198
|
+
for i in "${array_run[@]}"; do
|
|
197
199
|
single_log_path="$dir_log/$log_dir/${single_log_time}_$((j + 1)).log"
|
|
198
200
|
let j++
|
|
199
201
|
|
|
@@ -201,16 +203,16 @@ run_concurrent() {
|
|
|
201
203
|
export "${env_param}=${array[$i - 1]}"
|
|
202
204
|
clear_non_sh_env
|
|
203
205
|
fi
|
|
204
|
-
|
|
206
|
+
envParam="${env_param}" numParam="${i}" run_task_command ${which_program:+"$which_program"} "$file_param" "${script_params[@]}" &>"$single_log_path" &
|
|
205
207
|
done
|
|
206
208
|
|
|
207
209
|
wait
|
|
208
210
|
local k=0
|
|
209
|
-
for i in ${array_run[@]}; do
|
|
211
|
+
for i in "${array_run[@]}"; do
|
|
210
212
|
single_log_path="$dir_log/$log_dir/${single_log_time}_$((k + 1)).log"
|
|
211
213
|
let k++
|
|
212
|
-
cat $single_log_path
|
|
213
|
-
[[ -f $single_log_path ]] && rm -f $single_log_path
|
|
214
|
+
cat "$single_log_path"
|
|
215
|
+
[[ -f $single_log_path ]] && rm -f "$single_log_path"
|
|
214
216
|
done
|
|
215
217
|
}
|
|
216
218
|
|
|
@@ -227,7 +229,7 @@ run_designated() {
|
|
|
227
229
|
|
|
228
230
|
if [[ $isJsOrPythonFile == 'false' ]]; then
|
|
229
231
|
local n=0
|
|
230
|
-
for i in ${array_run[@]}; do
|
|
232
|
+
for i in "${array_run[@]}"; do
|
|
231
233
|
array_str[n]=${array[$i - 1]}
|
|
232
234
|
let n++
|
|
233
235
|
done
|
|
@@ -239,9 +241,9 @@ run_designated() {
|
|
|
239
241
|
clear_non_sh_env
|
|
240
242
|
fi
|
|
241
243
|
|
|
242
|
-
enter_script_workdir
|
|
244
|
+
enter_script_workdir || return $?
|
|
243
245
|
|
|
244
|
-
envParam="${env_param}" numParam="${num_param}"
|
|
246
|
+
envParam="${env_param}" numParam="${num_param}" run_task_command ${which_program:+"$which_program"} "$file_param" "${script_params[@]}"
|
|
245
247
|
}
|
|
246
248
|
|
|
247
249
|
## 运行其他命令
|
|
@@ -271,7 +273,7 @@ run_else() {
|
|
|
271
273
|
if [[ -n "$script_for_dir" ]]; then
|
|
272
274
|
local saved_file_param="$file_param"
|
|
273
275
|
file_param="$script_for_dir"
|
|
274
|
-
enter_script_workdir true
|
|
276
|
+
enter_script_workdir true || return $?
|
|
275
277
|
local adjusted_script="$file_param"
|
|
276
278
|
file_param="$saved_file_param"
|
|
277
279
|
|
|
@@ -287,17 +289,17 @@ run_else() {
|
|
|
287
289
|
set -- "${new_args[@]}"
|
|
288
290
|
else
|
|
289
291
|
# 没有找到脚本参数,只 cd 到 scripts 目录
|
|
290
|
-
enter_script_workdir true
|
|
292
|
+
enter_script_workdir true || return $?
|
|
291
293
|
shift
|
|
292
294
|
fi
|
|
293
295
|
else
|
|
294
296
|
# file_param 本身就是脚本,直接用 enter_script_workdir 处理
|
|
295
|
-
enter_script_workdir true
|
|
297
|
+
enter_script_workdir true || return $?
|
|
296
298
|
shift
|
|
297
299
|
fi
|
|
298
300
|
|
|
299
301
|
clear_non_sh_env
|
|
300
|
-
|
|
302
|
+
run_task_command ${which_program:+"$which_program"} "$file_param" "$@"
|
|
301
303
|
}
|
|
302
304
|
|
|
303
305
|
check_file() {
|
|
@@ -311,12 +313,14 @@ check_file() {
|
|
|
311
313
|
export PREV_NODE_OPTIONS="${NODE_OPTIONS:=}"
|
|
312
314
|
export PREV_PYTHONPATH="${PYTHONPATH:=}"
|
|
313
315
|
if [[ $1 == *.js ]] || [[ $1 == *.ts ]] || [[ $1 == *.mjs ]]; then
|
|
314
|
-
|
|
316
|
+
local preload_path=${file_preload_js//\\/\\\\}
|
|
317
|
+
preload_path=${preload_path//\"/\\\"}
|
|
318
|
+
export NODE_OPTIONS="-r \"${preload_path}\" ${NODE_OPTIONS}"
|
|
315
319
|
else
|
|
316
320
|
export PYTHONPATH="${dir_preload}:${dir_config}:${PYTHONPATH}"
|
|
317
321
|
fi
|
|
318
322
|
else
|
|
319
|
-
. $file_env
|
|
323
|
+
. "$file_env"
|
|
320
324
|
fi
|
|
321
325
|
fi
|
|
322
326
|
}
|
|
@@ -334,10 +338,6 @@ check_nounset() {
|
|
|
334
338
|
|
|
335
339
|
main() {
|
|
336
340
|
if [[ $1 == *.js ]] || [[ $1 == *.mjs ]] || [[ $1 == *.py ]] || [[ $1 == *.pyc ]] || [[ $1 == *.sh ]] || [[ $1 == *.ts ]]; then
|
|
337
|
-
if [[ $1 == *.sh ]]; then
|
|
338
|
-
timeoutCmd=""
|
|
339
|
-
fi
|
|
340
|
-
|
|
341
341
|
case $# in
|
|
342
342
|
1)
|
|
343
343
|
run_normal "$1"
|
package/shell/preload/client.js
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const path = require('node:path');
|
|
2
|
+
const fs = require('node:fs');
|
|
3
|
+
|
|
4
|
+
// A reporting failure must never terminate a script or change its send result.
|
|
5
|
+
module.exports = async function reportNotificationAudit(payload) {
|
|
6
|
+
let client;
|
|
7
|
+
try {
|
|
8
|
+
if (!process.env.QL_DIR) return;
|
|
9
|
+
const grpc = require('@grpc/grpc-js');
|
|
10
|
+
const loader = require('@grpc/proto-loader');
|
|
11
|
+
const certDir = path.join(
|
|
12
|
+
process.env.QL_DATA_DIR || path.join(process.env.QL_DIR, 'data'),
|
|
13
|
+
'config/grpc',
|
|
14
|
+
);
|
|
15
|
+
const credentials = grpc.credentials.createSsl(
|
|
16
|
+
fs.readFileSync(path.join(certDir, 'ca.crt')),
|
|
17
|
+
fs.readFileSync(path.join(certDir, 'client.key')),
|
|
18
|
+
fs.readFileSync(path.join(certDir, 'client.crt')),
|
|
19
|
+
);
|
|
20
|
+
const definition = loader.loadSync(
|
|
21
|
+
path.join(process.env.QL_DIR, 'back/protos/api.proto'),
|
|
22
|
+
{ keepCase: true, defaults: true },
|
|
23
|
+
);
|
|
24
|
+
const Api = grpc.loadPackageDefinition(definition).com.ql.api.Api;
|
|
25
|
+
client = new Api(
|
|
26
|
+
`localhost:${process.env.GRPC_PORT || '5500'}`,
|
|
27
|
+
credentials,
|
|
28
|
+
{ 'grpc.enable_http_proxy': 0 },
|
|
29
|
+
);
|
|
30
|
+
// Python sends all channel results together so they share startup and TLS.
|
|
31
|
+
const records = Array.isArray(payload) ? payload : [payload];
|
|
32
|
+
const deadline = new Date(Date.now() + 5000);
|
|
33
|
+
await Promise.all(
|
|
34
|
+
records.map(
|
|
35
|
+
(record) =>
|
|
36
|
+
new Promise((resolve) => {
|
|
37
|
+
client.RecordNotifyLog(
|
|
38
|
+
record,
|
|
39
|
+
new grpc.Metadata(),
|
|
40
|
+
{ deadline },
|
|
41
|
+
() => resolve(),
|
|
42
|
+
);
|
|
43
|
+
}),
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
} catch (_) {
|
|
47
|
+
// Missing certificates, old panels and offline services are best effort.
|
|
48
|
+
} finally {
|
|
49
|
+
if (client) client.close();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
@@ -82,7 +82,7 @@ function run() {
|
|
|
82
82
|
].filter(Boolean);
|
|
83
83
|
|
|
84
84
|
if (task_before) {
|
|
85
|
-
console.log('执行前置命令\n');
|
|
85
|
+
console.log(process.env.QL_LANG === 'en' ? 'Executing before command\n' : '执行前置命令\n');
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
const res = execSync(commands.join(' && '), {
|
|
@@ -122,7 +122,7 @@ function run() {
|
|
|
122
122
|
console.log(output);
|
|
123
123
|
}
|
|
124
124
|
if (task_before) {
|
|
125
|
-
console.log('执行前置命令结束\n');
|
|
125
|
+
console.log(process.env.QL_LANG === 'en' ? 'Before command finished\n' : '执行前置命令结束\n');
|
|
126
126
|
}
|
|
127
127
|
} catch (error) {
|
|
128
128
|
if (!error.message.includes('spawnSync /bin/bash E2BIG')) {
|
|
@@ -131,7 +131,7 @@ function run() {
|
|
|
131
131
|
// environment variable is too large
|
|
132
132
|
}
|
|
133
133
|
if (task_before) {
|
|
134
|
-
console.log('执行前置命令结束\n');
|
|
134
|
+
console.log(process.env.QL_LANG === 'en' ? 'Before command finished\n' : '执行前置命令结束\n');
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -159,9 +159,13 @@ try {
|
|
|
159
159
|
|
|
160
160
|
run();
|
|
161
161
|
|
|
162
|
-
const { sendNotify } = require('./__ql_notify__.js');
|
|
163
162
|
global.QLAPI = {
|
|
164
|
-
notify
|
|
163
|
+
notify(...args) {
|
|
164
|
+
// Keep notification dependencies out of ordinary script startup.
|
|
165
|
+
// require caches the module after the first notification.
|
|
166
|
+
const { sendNotify } = require('./__ql_notify__.js');
|
|
167
|
+
return sendNotify.apply(this, args);
|
|
168
|
+
},
|
|
165
169
|
...client,
|
|
166
170
|
};
|
|
167
171
|
} catch (error) {
|
|
@@ -56,7 +56,7 @@ def run():
|
|
|
56
56
|
if task_before:
|
|
57
57
|
escaped_task_before = task_before.replace('"', '\\"').replace("$", "\\$")
|
|
58
58
|
commands.append(f"eval '{escaped_task_before}'")
|
|
59
|
-
print("执行前置命令\n")
|
|
59
|
+
print("Executing before command\n" if os.environ.get("QL_LANG") == "en" else "执行前置命令\n")
|
|
60
60
|
|
|
61
61
|
commands.append(f"echo -e '{split_str}'")
|
|
62
62
|
|
|
@@ -88,12 +88,12 @@ def run():
|
|
|
88
88
|
if len(output) > 0:
|
|
89
89
|
print(output)
|
|
90
90
|
if task_before:
|
|
91
|
-
print("执行前置命令结束\n")
|
|
91
|
+
print("Before command finished\n" if os.environ.get("QL_LANG") == "en" else "执行前置命令结束\n")
|
|
92
92
|
|
|
93
93
|
except subprocess.CalledProcessError as error:
|
|
94
94
|
print(f"\ue926 run task before error: {error}")
|
|
95
95
|
if task_before:
|
|
96
|
-
print("执行前置命令结束\n")
|
|
96
|
+
print("Before command finished\n" if os.environ.get("QL_LANG") == "en" else "执行前置命令结束\n")
|
|
97
97
|
except OSError as error:
|
|
98
98
|
error_message = str(error)
|
|
99
99
|
if "Argument list too long" not in error_message:
|
|
@@ -101,11 +101,11 @@ def run():
|
|
|
101
101
|
# else:
|
|
102
102
|
# environment variable is too large
|
|
103
103
|
if task_before:
|
|
104
|
-
print("执行前置命令结束\n")
|
|
104
|
+
print("Before command finished\n" if os.environ.get("QL_LANG") == "en" else "执行前置命令结束\n")
|
|
105
105
|
except Exception as error:
|
|
106
106
|
print(f"\ue926 run task before error: {error}")
|
|
107
107
|
if task_before:
|
|
108
|
-
print("执行前置命令结束\n")
|
|
108
|
+
print("Before command finished\n" if os.environ.get("QL_LANG") == "en" else "执行前置命令结束\n")
|
|
109
109
|
|
|
110
110
|
import task_before
|
|
111
111
|
|
|
@@ -129,10 +129,12 @@ try:
|
|
|
129
129
|
|
|
130
130
|
run()
|
|
131
131
|
|
|
132
|
-
from __ql_notify__ import send
|
|
133
|
-
|
|
134
132
|
class BaseApi(Client):
|
|
135
133
|
def notify(self, *args, **kwargs):
|
|
134
|
+
# Most scripts never send a notification. Python caches this
|
|
135
|
+
# module after the first call, including its channel dependencies.
|
|
136
|
+
from __ql_notify__ import send
|
|
137
|
+
|
|
136
138
|
return send(*args, **kwargs)
|
|
137
139
|
|
|
138
140
|
QLAPI = BaseApi()
|
package/shell/rmlog.sh
CHANGED
|
@@ -3,42 +3,47 @@
|
|
|
3
3
|
days=$1
|
|
4
4
|
|
|
5
5
|
remove_js_log() {
|
|
6
|
-
local
|
|
7
|
-
local
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
local log log_date log_timestamp diff_time log_path encoded_path result
|
|
7
|
+
local now
|
|
8
|
+
now=$(date +%s) || return $?
|
|
9
|
+
while IFS= read -r -d '' log; do
|
|
10
|
+
log_date=${log##*/}
|
|
11
|
+
log_date=${log_date:0:10}
|
|
10
12
|
if ! [[ $log_date =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then
|
|
11
13
|
if [[ $is_macos -eq 1 ]]; then
|
|
12
|
-
log_date=$(stat -f %Sm -t "%Y-%m-%d" "$log")
|
|
14
|
+
log_date=$(stat -f %Sm -t "%Y-%m-%d" "$log") || continue
|
|
13
15
|
else
|
|
14
16
|
log_date=$(stat -c %y "$log" | cut -d ' ' -f 1)
|
|
15
17
|
fi
|
|
16
18
|
fi
|
|
17
19
|
if [[ $is_macos -eq 1 ]]; then
|
|
18
|
-
|
|
20
|
+
# BSD date otherwise fills the omitted time from the current clock.
|
|
21
|
+
log_timestamp=$(date -j -f "%Y-%m-%d %H:%M:%S" "$log_date 00:00:00" +%s) || continue
|
|
19
22
|
else
|
|
20
|
-
|
|
23
|
+
log_timestamp=$(date +%s -d "$log_date") || continue
|
|
21
24
|
fi
|
|
25
|
+
diff_time=$((now - log_timestamp))
|
|
22
26
|
if [[ $diff_time -gt $((${days} * 86400)) ]]; then
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
log_path=${log#"$dir_log"/}
|
|
28
|
+
encoded_path=$(printf '%s' "$log_path" | jq -sRr @uri) || continue
|
|
29
|
+
result=$(find_cron_api "log_path=$encoded_path")
|
|
25
30
|
t '查询文件 %s' "$log_path"
|
|
26
31
|
if [[ -z $result ]]; then
|
|
27
32
|
t '删除中~'
|
|
28
|
-
rm -vf $log
|
|
33
|
+
rm -vf -- "$log"
|
|
29
34
|
else
|
|
30
35
|
t '正在被 %s 使用,跳过~' "$result"
|
|
31
36
|
fi
|
|
32
37
|
fi
|
|
33
|
-
done
|
|
38
|
+
done < <(find "$dir_log" -type f -name "*.log" -print0)
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
remove_empty_dir() {
|
|
37
|
-
|
|
38
|
-
for dir in $
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
local dir
|
|
43
|
+
for dir in "$dir_log"/*/ "$dir_log"/.[!.]*/ "$dir_log"/..?*/; do
|
|
44
|
+
[[ -d "$dir" ]] || continue
|
|
45
|
+
# rmdir also protects a directory populated between discovery and removal.
|
|
46
|
+
rmdir -- "$dir" 2>/dev/null || true
|
|
42
47
|
done
|
|
43
48
|
}
|
|
44
49
|
|