@whyour/qinglong 2.23.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 +53 -10
- package/sample/notify.js +308 -135
- package/sample/notify.py +174 -27
- package/shell/api.sh +18 -7
- 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/otask.sh +38 -36
- package/shell/preload/client.js +1 -0
- package/shell/preload/notificationAudit.js +51 -0
- package/shell/preload/sitecustomize.js +3 -3
- package/shell/preload/sitecustomize.py +5 -5
- package/shell/rmlog.sh +21 -16
- package/shell/share.sh +61 -44
- package/shell/start-simplify.sh +90 -0
- package/shell/start.sh +48 -71
- package/shell/task-timeout.sh +22 -10
- package/shell/task.sh +7 -7
- package/shell/update.sh +52 -38
- package/shell/upgrade-lock.yaml +16122 -0
- package/shell/upgrade.cjs +1 -1
- package/static/build/api/clientIp.js +2 -1
- package/static/build/api/clientIp.js.map +1 -0
- 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.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.map +1 -0
- package/static/build/api/retention.js.map +1 -0
- package/static/build/api/script.js.map +1 -0
- package/static/build/api/subscription.js.map +1 -0
- package/static/build/api/system.js +18 -0
- 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.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.map +1 -0
- package/static/build/config/util.js +178 -79
- 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 +8 -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.map +1 -0
- package/static/build/loaders/initFile.js.map +1 -0
- package/static/build/loaders/initTask.js +1 -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.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.map +1 -0
- package/static/build/protos/health.js.map +1 -0
- package/static/build/schedule/addCron.js +2 -2
- 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.map +1 -0
- package/static/build/schedule/data.js.map +1 -0
- package/static/build/schedule/delCron.js +5 -3
- package/static/build/schedule/delCron.js.map +1 -0
- package/static/build/schedule/health.js.map +1 -0
- package/static/build/schedule/setConcurrency.js.map +1 -0
- package/static/build/services/config.js.map +1 -0
- package/static/build/services/cron.js +7 -7
- 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.map +1 -0
- package/static/build/services/grpc.js +2 -2
- 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.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.map +1 -0
- package/static/build/services/retention.js.map +1 -0
- package/static/build/services/schedule.js +13 -12
- package/static/build/services/schedule.js.map +1 -0
- package/static/build/services/script.js.map +1 -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 +8 -5
- package/static/build/services/sshKey.js.map +1 -0
- package/static/build/services/subscription.js.map +1 -0
- package/static/build/services/system.js +76 -46
- package/static/build/services/system.js.map +1 -0
- package/static/build/services/user.js +2 -2
- 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.map +1 -0
- package/static/build/shared/cronSchedule.js +65 -9
- package/static/build/shared/cronSchedule.js.map +1 -0
- package/static/build/shared/cronScheduler.js +3 -2
- 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 +164 -85
- 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.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.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 +8 -8
- 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 +69 -26
- 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.map +1 -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.map +1 -0
- package/static/build/shared/subscriptionPath.js.map +1 -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.map +1 -0
- package/static/build/token.js.map +1 -0
- package/static/build/validation/schedule.js +19 -1
- 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.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.gz +0 -0
- package/static/dist/src__pages__script__historyDrawer.8c58d958.async.js.gz +0 -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__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 -14
- package/.dockerignore +0 -13
- package/AGENTS.md +0 -43
- package/SECURITY.md +0 -5
- package/back/protos/cron.proto +0 -33
- 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/development/node-cron-migration.md +0 -49
- package/docs/development/task-startup.md +0 -78
- package/docs/releases/2.22.0-validation.md +0 -49
- package/docs/releases/2.22.0.md +0 -62
- package/docs/releases/2.23.0.md +0 -33
- package/docs/script-history.md +0 -53
- package/sample/tool.ts +0 -40
- package/scripts/benchmark-execution.cjs +0 -96
- package/scripts/benchmark-script-history.cjs +0 -39
- package/scripts/publish-static.sh +0 -34
- package/scripts/sync-static.sh +0 -20
- package/scripts/wait-for-mirror.sh +0 -214
- package/scripts/write-build-info.cjs +0 -27
- package/shell/pub.sh +0 -28
- package/static/dist/255.8a80b983.async.js +0 -1
- package/static/dist/2901.2ca95295.async.js +0 -1
- package/static/dist/292.264757f0.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/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/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.01fcd534.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.0fa8b421.async.js +0 -1
- package/static/dist/src__pages__diff__index.b94e5dc5.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.afabf073.async.js +0 -1
- package/static/dist/src__pages__script__index.fc575945.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.30868ba8.async.js +0 -1
- package/static/dist/umi.3a24a9fa.js +0 -1
- package/test/back/advisory-input-security.test.cjs +0 -416
- package/test/back/auth-security.test.cjs +0 -74
- package/test/back/build-provenance.test.cjs +0 -150
- package/test/back/code-scanning-security.test.cjs +0 -189
- package/test/back/cron-log-name.test.cjs +0 -110
- package/test/back/cron-macros.test.cjs +0 -51
- package/test/back/cron-schedule-compatibility.test.cjs +0 -69
- package/test/back/cron-scheduler-routing.test.cjs +0 -59
- 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/draft-path-security.test.cjs +0 -235
- package/test/back/ecosystem.test.cjs +0 -28
- package/test/back/env-import-security.test.cjs +0 -91
- package/test/back/env-name-parsing.test.cjs +0 -96
- package/test/back/execution-lifecycle.test.cjs +0 -236
- package/test/back/file-access-scope.test.cjs +0 -180
- 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/grpc-mtls-security.test.cjs +0 -136
- package/test/back/http-exclusive-listen.test.cjs +0 -31
- package/test/back/http-security.test.cjs +0 -313
- package/test/back/legacy-cron-recovery.test.cjs +0 -76
- package/test/back/linux-mirror-result.test.cjs +0 -176
- package/test/back/listen-security.test.cjs +0 -68
- 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/mirror-status.test.cjs +0 -257
- package/test/back/monitoring.test.cjs +0 -73
- package/test/back/node-cron-migration.test.cjs +0 -65
- package/test/back/node-path-cache.test.cjs +0 -202
- package/test/back/node-path-lock.test.cjs +0 -182
- package/test/back/npm-publication.test.cjs +0 -70
- package/test/back/preload-lazy-notify.test.cjs +0 -168
- 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/queued-cron-invalidation.test.cjs +0 -98
- package/test/back/restart-instance-recovery.test.cjs +0 -116
- 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-bulk-recovery.test.cjs +0 -40
- package/test/back/scheduler-concurrency.test.cjs +0 -411
- 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 -206
- package/test/back/scheduler-rpc-timeout.test.cjs +0 -49
- package/test/back/schema-migrations.test.cjs +0 -127
- package/test/back/script-file-access.test.cjs +0 -210
- package/test/back/script-history-api.test.cjs +0 -551
- package/test/back/script-history.test.cjs +0 -383
- package/test/back/shell-api-parsing.test.cjs +0 -184
- package/test/back/shell-translation-output.test.cjs +0 -16
- package/test/back/shell-upgrade.test.cjs +0 -312
- package/test/back/shellApiToken.test.cjs +0 -151
- package/test/back/sock-polling.test.cjs +0 -297
- package/test/back/sock-security.test.cjs +0 -72
- package/test/back/ssh-config-home.test.cjs +0 -113
- package/test/back/start-env-preservation.test.cjs +0 -53
- package/test/back/static-mirror-trigger.test.cjs +0 -441
- package/test/back/static-mirror.test.cjs +0 -179
- package/test/back/stop-failure-feedback.test.cjs +0 -158
- package/test/back/stop-race.test.cjs +0 -171
- package/test/back/subscription-cleanup.test.cjs +0 -53
- package/test/back/subscription-mutation-lock.test.cjs +0 -83
- package/test/back/subscription-review-regression.test.cjs +0 -607
- package/test/back/subscription-stop-state.test.cjs +0 -66
- package/test/back/subscription-storage-regression.test.cjs +0 -553
- package/test/back/system-dependence-cache.test.cjs +0 -127
- package/test/back/system-export-history.test.cjs +0 -119
- package/test/back/systemTokenRenewal.test.cjs +0 -497
- package/test/back/task-shell-lifecycle.test.cjs +0 -194
- package/test/back/task-time.test.cjs +0 -116
- package/test/back/unique-constraint-error.test.cjs +0 -72
- package/test/back/upgrade-guards.test.cjs +0 -285
- package/test/back/upgrade-lifecycle.test.cjs +0 -288
- package/test/back/upgrade-transaction.test.cjs +0 -133
- package/test/back/user-api.test.cjs +0 -99
- package/test/back/user-security.test.cjs +0 -349
- package/test/back/worker-apm.test.cjs +0 -84
- package/test/back/wpush-grpc.test.cjs +0 -116
- package/test/fixtures/legacy-cron.json +0 -1371
- package/test/front/cron-log-pagination.test.cjs +0 -214
- package/test/front/diff-file-routing.test.cjs +0 -126
- package/test/front/http-auth.test.cjs +0 -152
- package/test/front/http-error.test.cjs +0 -29
- package/test/front/script-history-save.test.cjs +0 -121
- package/test/helpers/load-security-module.cjs +0 -42
- package/test/helpers/upgrade-fixture.cjs +0 -30
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[@]}
|
|
@@ -122,7 +122,7 @@ enter_script_workdir() {
|
|
|
122
122
|
_target_dir="${dir_scripts}/${work_dir}"
|
|
123
123
|
fi
|
|
124
124
|
if [[ -d "${_target_dir}" ]]; then
|
|
125
|
-
cd "${_target_dir}"
|
|
125
|
+
cd "${_target_dir}" || return $?
|
|
126
126
|
if [[ ${file_param} =~ "/" ]]; then
|
|
127
127
|
local script_name="${file_param##*/}"
|
|
128
128
|
if [[ "${use_dot_prefix}" == "true" ]]; then
|
|
@@ -136,13 +136,13 @@ enter_script_workdir() {
|
|
|
136
136
|
t '警告:工作目录不存在 %s' "${_target_dir}"
|
|
137
137
|
fi
|
|
138
138
|
|
|
139
|
-
cd $dir_scripts
|
|
139
|
+
cd "$dir_scripts" || return $?
|
|
140
140
|
if [[ ${file_param} =~ "/" ]]; then
|
|
141
141
|
local script_dir="${file_param%/*}"
|
|
142
142
|
local script_name="${file_param##*/}"
|
|
143
143
|
|
|
144
144
|
if [[ -d ${script_dir} ]]; then
|
|
145
|
-
cd $
|
|
145
|
+
cd "$script_dir" || return $?
|
|
146
146
|
if [[ "${use_dot_prefix}" == "true" ]]; then
|
|
147
147
|
file_param="./${script_name}"
|
|
148
148
|
else
|
|
@@ -159,12 +159,12 @@ run_normal() {
|
|
|
159
159
|
random_delay "$file_param"
|
|
160
160
|
fi
|
|
161
161
|
|
|
162
|
-
enter_script_workdir
|
|
162
|
+
enter_script_workdir || return $?
|
|
163
163
|
|
|
164
164
|
if [[ $isJsOrPythonFile == 'false' ]]; then
|
|
165
165
|
clear_non_sh_env
|
|
166
166
|
fi
|
|
167
|
-
run_task_command $which_program $file_param "${script_params[@]}"
|
|
167
|
+
run_task_command ${which_program:+"$which_program"} "$file_param" "${script_params[@]}"
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
handle_env_split() {
|
|
@@ -175,7 +175,7 @@ handle_env_split() {
|
|
|
175
175
|
env_str_to_array
|
|
176
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")
|
|
177
177
|
local runArr=($(eval echo $tempArr))
|
|
178
|
-
array_run=($(awk -v RS=' ' '!a[$1]++'
|
|
178
|
+
array_run=($(awk -v RS=' ' '!a[$1]++' <<<"${runArr[*]}"))
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
## 并发执行时,设定的 RandomDelay 不会生效,即所有任务立即执行
|
|
@@ -192,10 +192,10 @@ run_concurrent() {
|
|
|
192
192
|
time=$(date "+$mtime_format")
|
|
193
193
|
single_log_time=$(format_log_time "$mtime_format" "$time")
|
|
194
194
|
|
|
195
|
-
enter_script_workdir
|
|
195
|
+
enter_script_workdir || return $?
|
|
196
196
|
|
|
197
197
|
local j=0
|
|
198
|
-
for i in ${array_run[@]}; do
|
|
198
|
+
for i in "${array_run[@]}"; do
|
|
199
199
|
single_log_path="$dir_log/$log_dir/${single_log_time}_$((j + 1)).log"
|
|
200
200
|
let j++
|
|
201
201
|
|
|
@@ -203,16 +203,16 @@ run_concurrent() {
|
|
|
203
203
|
export "${env_param}=${array[$i - 1]}"
|
|
204
204
|
clear_non_sh_env
|
|
205
205
|
fi
|
|
206
|
-
|
|
206
|
+
envParam="${env_param}" numParam="${i}" run_task_command ${which_program:+"$which_program"} "$file_param" "${script_params[@]}" &>"$single_log_path" &
|
|
207
207
|
done
|
|
208
208
|
|
|
209
209
|
wait
|
|
210
210
|
local k=0
|
|
211
|
-
for i in ${array_run[@]}; do
|
|
211
|
+
for i in "${array_run[@]}"; do
|
|
212
212
|
single_log_path="$dir_log/$log_dir/${single_log_time}_$((k + 1)).log"
|
|
213
213
|
let k++
|
|
214
|
-
cat $single_log_path
|
|
215
|
-
[[ -f $single_log_path ]] && rm -f $single_log_path
|
|
214
|
+
cat "$single_log_path"
|
|
215
|
+
[[ -f $single_log_path ]] && rm -f "$single_log_path"
|
|
216
216
|
done
|
|
217
217
|
}
|
|
218
218
|
|
|
@@ -229,7 +229,7 @@ run_designated() {
|
|
|
229
229
|
|
|
230
230
|
if [[ $isJsOrPythonFile == 'false' ]]; then
|
|
231
231
|
local n=0
|
|
232
|
-
for i in ${array_run[@]}; do
|
|
232
|
+
for i in "${array_run[@]}"; do
|
|
233
233
|
array_str[n]=${array[$i - 1]}
|
|
234
234
|
let n++
|
|
235
235
|
done
|
|
@@ -241,9 +241,9 @@ run_designated() {
|
|
|
241
241
|
clear_non_sh_env
|
|
242
242
|
fi
|
|
243
243
|
|
|
244
|
-
enter_script_workdir
|
|
244
|
+
enter_script_workdir || return $?
|
|
245
245
|
|
|
246
|
-
envParam="${env_param}" numParam="${num_param}" run_task_command $which_program $file_param "${script_params[@]}"
|
|
246
|
+
envParam="${env_param}" numParam="${num_param}" run_task_command ${which_program:+"$which_program"} "$file_param" "${script_params[@]}"
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
## 运行其他命令
|
|
@@ -273,7 +273,7 @@ run_else() {
|
|
|
273
273
|
if [[ -n "$script_for_dir" ]]; then
|
|
274
274
|
local saved_file_param="$file_param"
|
|
275
275
|
file_param="$script_for_dir"
|
|
276
|
-
enter_script_workdir true
|
|
276
|
+
enter_script_workdir true || return $?
|
|
277
277
|
local adjusted_script="$file_param"
|
|
278
278
|
file_param="$saved_file_param"
|
|
279
279
|
|
|
@@ -289,17 +289,17 @@ run_else() {
|
|
|
289
289
|
set -- "${new_args[@]}"
|
|
290
290
|
else
|
|
291
291
|
# 没有找到脚本参数,只 cd 到 scripts 目录
|
|
292
|
-
enter_script_workdir true
|
|
292
|
+
enter_script_workdir true || return $?
|
|
293
293
|
shift
|
|
294
294
|
fi
|
|
295
295
|
else
|
|
296
296
|
# file_param 本身就是脚本,直接用 enter_script_workdir 处理
|
|
297
|
-
enter_script_workdir true
|
|
297
|
+
enter_script_workdir true || return $?
|
|
298
298
|
shift
|
|
299
299
|
fi
|
|
300
300
|
|
|
301
301
|
clear_non_sh_env
|
|
302
|
-
run_task_command $which_program $file_param "$@"
|
|
302
|
+
run_task_command ${which_program:+"$which_program"} "$file_param" "$@"
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
check_file() {
|
|
@@ -313,12 +313,14 @@ check_file() {
|
|
|
313
313
|
export PREV_NODE_OPTIONS="${NODE_OPTIONS:=}"
|
|
314
314
|
export PREV_PYTHONPATH="${PYTHONPATH:=}"
|
|
315
315
|
if [[ $1 == *.js ]] || [[ $1 == *.ts ]] || [[ $1 == *.mjs ]]; then
|
|
316
|
-
|
|
316
|
+
local preload_path=${file_preload_js//\\/\\\\}
|
|
317
|
+
preload_path=${preload_path//\"/\\\"}
|
|
318
|
+
export NODE_OPTIONS="-r \"${preload_path}\" ${NODE_OPTIONS}"
|
|
317
319
|
else
|
|
318
320
|
export PYTHONPATH="${dir_preload}:${dir_config}:${PYTHONPATH}"
|
|
319
321
|
fi
|
|
320
322
|
else
|
|
321
|
-
. $file_env
|
|
323
|
+
. "$file_env"
|
|
322
324
|
fi
|
|
323
325
|
fi
|
|
324
326
|
}
|
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
|
|
|
@@ -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
|
|
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
|
|
package/shell/share.sh
CHANGED
|
@@ -77,16 +77,19 @@ load_ql_envs() {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
import_config() {
|
|
80
|
-
[[ -f $file_config_user ]] && . $file_config_user
|
|
81
|
-
[[ -f $dir_preload/lang_env.sh ]] && . $dir_preload/lang_env.sh
|
|
80
|
+
[[ -f $file_config_user ]] && . "$file_config_user"
|
|
81
|
+
[[ -f $dir_preload/lang_env.sh ]] && . "$dir_preload/lang_env.sh"
|
|
82
82
|
|
|
83
|
-
#
|
|
83
|
+
# Language packs need global associative arrays (Bash 4.2+). Probe the
|
|
84
|
+
# capability so Bash 3.2 and 4.0/4.1 retain the Chinese-key fallback.
|
|
84
85
|
local lang=${QL_LANG:-zh}
|
|
85
86
|
local lang_file="$dir_shell/lang/${lang}.sh"
|
|
86
|
-
if
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
if (declare -gA __ql_lang_probe) 2>/dev/null; then
|
|
88
|
+
if [[ -f $lang_file ]]; then
|
|
89
|
+
. "$lang_file"
|
|
90
|
+
elif [[ -f "$dir_shell/lang/zh.sh" ]]; then
|
|
91
|
+
. "$dir_shell/lang/zh.sh"
|
|
92
|
+
fi
|
|
90
93
|
fi
|
|
91
94
|
|
|
92
95
|
load_ql_envs
|
|
@@ -132,7 +135,7 @@ unset_proxy() {
|
|
|
132
135
|
make_dir() {
|
|
133
136
|
local dir=$1
|
|
134
137
|
if [[ ! -d $dir ]]; then
|
|
135
|
-
mkdir -p $dir
|
|
138
|
+
mkdir -p -- "$dir"
|
|
136
139
|
fi
|
|
137
140
|
}
|
|
138
141
|
|
|
@@ -176,57 +179,57 @@ define_cmd() {
|
|
|
176
179
|
}
|
|
177
180
|
|
|
178
181
|
fix_config() {
|
|
179
|
-
make_dir $dir_tmp
|
|
180
|
-
make_dir $dir_static
|
|
181
|
-
make_dir $dir_data
|
|
182
|
-
make_dir $dir_config
|
|
183
|
-
make_dir $dir_log
|
|
184
|
-
make_dir $dir_db
|
|
185
|
-
make_dir $dir_scripts
|
|
186
|
-
make_dir $dir_list_tmp
|
|
187
|
-
make_dir $dir_repo
|
|
188
|
-
make_dir $dir_raw
|
|
189
|
-
make_dir $dir_update_log
|
|
190
|
-
make_dir $dir_dep
|
|
182
|
+
make_dir "$dir_tmp"
|
|
183
|
+
make_dir "$dir_static"
|
|
184
|
+
make_dir "$dir_data"
|
|
185
|
+
make_dir "$dir_config"
|
|
186
|
+
make_dir "$dir_log"
|
|
187
|
+
make_dir "$dir_db"
|
|
188
|
+
make_dir "$dir_scripts"
|
|
189
|
+
make_dir "$dir_list_tmp"
|
|
190
|
+
make_dir "$dir_repo"
|
|
191
|
+
make_dir "$dir_raw"
|
|
192
|
+
make_dir "$dir_update_log"
|
|
193
|
+
make_dir "$dir_dep"
|
|
191
194
|
|
|
192
195
|
if [[ ! -s $file_config_user ]]; then
|
|
193
|
-
cp -f $file_config_sample $file_config_user
|
|
196
|
+
cp -f "$file_config_sample" "$file_config_user"
|
|
194
197
|
fi
|
|
195
198
|
|
|
196
199
|
if [[ ! -f $file_task_before ]]; then
|
|
197
|
-
cp -f $file_task_sample $file_task_before
|
|
200
|
+
cp -f "$file_task_sample" "$file_task_before"
|
|
198
201
|
fi
|
|
199
202
|
|
|
200
203
|
if [[ ! -f $file_task_after ]]; then
|
|
201
|
-
cp -f $file_task_sample $file_task_after
|
|
204
|
+
cp -f "$file_task_sample" "$file_task_after"
|
|
202
205
|
fi
|
|
203
206
|
|
|
204
207
|
if [[ ! -f $file_extra_shell ]]; then
|
|
205
|
-
cp -f $file_extra_sample $file_extra_shell
|
|
208
|
+
cp -f "$file_extra_sample" "$file_extra_shell"
|
|
206
209
|
fi
|
|
207
210
|
|
|
208
211
|
if [[ ! -s $file_notify_py ]]; then
|
|
209
|
-
cp -f $file_notify_py_sample $file_notify_py
|
|
212
|
+
cp -f "$file_notify_py_sample" "$file_notify_py"
|
|
210
213
|
fi
|
|
211
214
|
|
|
212
215
|
if [[ ! -s $file_notify_js ]]; then
|
|
213
|
-
cp -f $file_notify_js_sample $file_notify_js
|
|
216
|
+
cp -f "$file_notify_js_sample" "$file_notify_js"
|
|
214
217
|
fi
|
|
215
218
|
|
|
216
219
|
if [[ ! -s $file_test_js ]]; then
|
|
217
|
-
cp -f $file_test_js_sample $file_test_js
|
|
220
|
+
cp -f "$file_test_js_sample" "$file_test_js"
|
|
218
221
|
fi
|
|
219
222
|
|
|
220
223
|
if [[ ! -s $file_test_py ]]; then
|
|
221
|
-
cp -f $file_test_py_sample $file_test_py
|
|
224
|
+
cp -f "$file_test_py_sample" "$file_test_py"
|
|
222
225
|
fi
|
|
223
226
|
|
|
224
227
|
if [[ ! -s $dep_notify_js ]]; then
|
|
225
|
-
cp -f $file_notify_js_sample $dep_notify_js
|
|
228
|
+
cp -f "$file_notify_js_sample" "$dep_notify_js"
|
|
226
229
|
fi
|
|
227
230
|
|
|
228
231
|
if [[ ! -s $dep_notify_py ]]; then
|
|
229
|
-
cp -f $file_notify_py_sample $dep_notify_py
|
|
232
|
+
cp -f "$file_notify_py_sample" "$dep_notify_py"
|
|
230
233
|
fi
|
|
231
234
|
|
|
232
235
|
}
|
|
@@ -246,17 +249,17 @@ npm_install_2() {
|
|
|
246
249
|
local dir_current=$(pwd)
|
|
247
250
|
local dir_work=$1
|
|
248
251
|
|
|
249
|
-
cd $dir_work
|
|
252
|
+
cd "$dir_work" || return $?
|
|
250
253
|
t '安装 %s 依赖包...\n' "$dir_work"
|
|
251
254
|
npm_install_sub
|
|
252
|
-
cd $dir_current
|
|
255
|
+
cd "$dir_current" || return $?
|
|
253
256
|
}
|
|
254
257
|
|
|
255
258
|
diff_and_copy() {
|
|
256
259
|
local copy_source=$1
|
|
257
260
|
local copy_to=$2
|
|
258
|
-
if [[ ! -s $copy_to ]] || [[ $(diff $copy_source $copy_to) ]]; then
|
|
259
|
-
cp -f $copy_source $copy_to
|
|
261
|
+
if [[ ! -s $copy_to ]] || [[ $(diff "$copy_source" "$copy_to") ]]; then
|
|
262
|
+
cp -f "$copy_source" "$copy_to"
|
|
260
263
|
fi
|
|
261
264
|
}
|
|
262
265
|
|
|
@@ -265,12 +268,13 @@ git_clone_scripts() {
|
|
|
265
268
|
local dir="$2"
|
|
266
269
|
local branch="$3"
|
|
267
270
|
local proxy="$4"
|
|
268
|
-
|
|
271
|
+
local branch_args=()
|
|
272
|
+
[[ $branch ]] && branch_args=(-b "$branch")
|
|
269
273
|
t '开始拉取仓库 %s 到 %s\n' "${uniq_path}" "$dir"
|
|
270
274
|
|
|
271
275
|
set_proxy "$proxy"
|
|
272
276
|
|
|
273
|
-
git clone -q --depth=1 $
|
|
277
|
+
git clone -q --depth=1 "${branch_args[@]}" "$url" "$dir"
|
|
274
278
|
exit_status=$?
|
|
275
279
|
|
|
276
280
|
unset_proxy
|
|
@@ -283,15 +287,27 @@ random_range() {
|
|
|
283
287
|
}
|
|
284
288
|
|
|
285
289
|
delete_pm2() {
|
|
286
|
-
cd $dir_root
|
|
290
|
+
cd "$dir_root" || return $?
|
|
287
291
|
# Try to delete PM2 processes, but don't fail if PM2 is not available
|
|
288
292
|
pm2 delete ecosystem.config.js 2>/dev/null || true
|
|
289
293
|
# Also try to kill any directly spawned node processes
|
|
290
294
|
pkill -f "node.*static/build/app.js" 2>/dev/null || true
|
|
291
295
|
}
|
|
292
296
|
|
|
297
|
+
load_node_runtime_args() {
|
|
298
|
+
ql_node_runtime_args=()
|
|
299
|
+
local runtime_args
|
|
300
|
+
local helper="$dir_root/cli/src/internal/maintenance/nodeRuntime.cjs"
|
|
301
|
+
if [[ -f "$helper" ]]; then
|
|
302
|
+
runtime_args=$(node "$helper") || return $?
|
|
303
|
+
if [[ -n "$runtime_args" ]]; then
|
|
304
|
+
read -r -a ql_node_runtime_args <<<"$runtime_args"
|
|
305
|
+
fi
|
|
306
|
+
fi
|
|
307
|
+
}
|
|
308
|
+
|
|
293
309
|
reload_pm2() {
|
|
294
|
-
cd $dir_root
|
|
310
|
+
cd "$dir_root" || return $?
|
|
295
311
|
restore_env_vars
|
|
296
312
|
|
|
297
313
|
# Try to start PM2, but handle failures gracefully
|
|
@@ -301,6 +317,7 @@ reload_pm2() {
|
|
|
301
317
|
local exit_code=$?
|
|
302
318
|
t '警告: PM2 启动失败 (退出码: %s),可能是由于硬件不兼容' "$exit_code"
|
|
303
319
|
t '正在尝试直接使用 Node.js 启动服务...'
|
|
320
|
+
load_node_runtime_args || return $?
|
|
304
321
|
|
|
305
322
|
# Kill any existing node processes for qinglong
|
|
306
323
|
pkill -f "node.*static/build/app.js" 2>/dev/null || true
|
|
@@ -308,9 +325,9 @@ reload_pm2() {
|
|
|
308
325
|
# Start node directly in the background. In containers, keep application
|
|
309
326
|
# output on the container streams instead of duplicating Winston logs on disk.
|
|
310
327
|
if [[ "$QL_CONTAINER" == "true" ]]; then
|
|
311
|
-
nohup node static/build/app.js >/proc/1/fd/1 2>/proc/1/fd/2 &
|
|
328
|
+
nohup node "${ql_node_runtime_args[@]}" static/build/app.js >/proc/1/fd/1 2>/proc/1/fd/2 &
|
|
312
329
|
else
|
|
313
|
-
nohup node static/build/app.js
|
|
330
|
+
nohup node "${ql_node_runtime_args[@]}" static/build/app.js >"$dir_log/qinglong.log" 2>&1 &
|
|
314
331
|
fi
|
|
315
332
|
local node_pid=$!
|
|
316
333
|
|
|
@@ -391,14 +408,14 @@ handle_task_start() {
|
|
|
391
408
|
if [[ $ID ]]; then
|
|
392
409
|
local error=$(update_cron "\"$ID\"" "0" "$$" "$log_path" "$begin_timestamp")
|
|
393
410
|
if [[ $error ]]; then
|
|
394
|
-
error_message
|
|
411
|
+
error_message=$(t ', 任务状态更新失败(%s)' "$error")
|
|
395
412
|
fi
|
|
396
413
|
fi
|
|
397
414
|
t '## 开始执行... %s\n' "${begin_time}${error_message}"
|
|
398
415
|
}
|
|
399
416
|
|
|
400
417
|
run_task_before() {
|
|
401
|
-
. $file_task_before "$@"
|
|
418
|
+
. "$file_task_before" "$@"
|
|
402
419
|
|
|
403
420
|
if [[ ${task_before:=} ]]; then
|
|
404
421
|
t '执行前置命令\n'
|
|
@@ -408,7 +425,7 @@ run_task_before() {
|
|
|
408
425
|
}
|
|
409
426
|
|
|
410
427
|
run_task_after() {
|
|
411
|
-
. $file_task_after "$@"
|
|
428
|
+
. "$file_task_after" "$@"
|
|
412
429
|
|
|
413
430
|
if [[ ${task_after:=} ]]; then
|
|
414
431
|
t '\n执行后置命令\n'
|
|
@@ -433,7 +450,7 @@ handle_task_end() {
|
|
|
433
450
|
if [[ $ID ]]; then
|
|
434
451
|
local error=$(update_cron "\"$ID\"" "1" "$$" "$log_path" "$begin_timestamp" "$diff_time" "$exit_code")
|
|
435
452
|
if [[ $error ]]; then
|
|
436
|
-
error_message
|
|
453
|
+
error_message=$(t ', 状态更新失败(%s)' "$error")
|
|
437
454
|
fi
|
|
438
455
|
fi
|
|
439
456
|
|