@whyour/qinglong 2.23.0 → 2.25.0-rc.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 +251 -56
- 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 +52 -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 +0 -1
- 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 -2
- 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 +0 -11
- 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 +0 -2
- 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 +67 -29
- 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 +2 -1
- 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 +101 -22
- package/static/build/services/dependence.js.map +1 -0
- package/static/build/services/env.js +13 -3
- 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 +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 +10 -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 +4 -1
- package/static/build/shared/fileAccess.js.map +1 -0
- package/static/build/shared/i18n.js +165 -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 +7 -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/taskEnvName.js +79 -0
- package/static/build/shared/taskEnvName.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 +757 -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/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.e056fb2d.async.js +1 -0
- package/static/dist/6212.e056fb2d.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/{1967.3f3945d0.async.js → 6636.fed84003.async.js} +1 -1
- package/static/dist/6636.fed84003.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.a71416e6.js +1 -0
- package/static/dist/src__pages__404.3fd8332e.async.js +1 -0
- package/static/dist/src__pages__config__index.088ddd9d.async.js +1 -0
- package/static/dist/src__pages__config__index.088ddd9d.async.js.gz +0 -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.b0ae0f99.async.js +1 -0
- package/static/dist/src__pages__crontab__index.b0ae0f99.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.edad6a53.async.js +1 -0
- package/static/dist/src__pages__dependence__index.edad6a53.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.c236a754.async.js +1 -0
- package/static/dist/src__pages__env__index.c236a754.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.d4d89bf9.async.js +1 -0
- package/static/dist/src__pages__initialization__index.d4d89bf9.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.785f8431.async.js +1 -0
- package/static/dist/src__pages__script__editModal.785f8431.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.3e142045.async.js +1 -0
- package/static/dist/src__pages__script__index.3e142045.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.7cf46d4a.chunk.css → src__pages__setting__index.46315660.chunk.css} +1 -1
- package/static/dist/src__pages__setting__index.c5615182.async.js +1 -0
- package/static/dist/src__pages__setting__index.c5615182.async.js.gz +0 -0
- 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.a4d14b92.css.gz +0 -0
- package/static/dist/umi.cf08844a.js +1 -0
- package/static/dist/umi.cf08844a.js.gz +0 -0
- package/version.yaml +9 -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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
: "${QL_DIR:?Please set QL_DIR}"
|
|
5
|
+
: "${QL_DATA_DIR:?Please set QL_DATA_DIR}"
|
|
6
|
+
[[ "$QL_DIR" = /* && "$QL_DATA_DIR" = /*/data ]] || { echo "QL_DIR and QL_DATA_DIR must be absolute paths (data directory ends in /data)" >&2; exit 1; }
|
|
7
|
+
command="$1"
|
|
8
|
+
|
|
9
|
+
export PNPM_HOME="${PNPM_HOME:-${QL_DATA_DIR}/dep_cache/node}"
|
|
10
|
+
if [[ -n "${PYTHON_VENV_DIR:-}" ]]; then
|
|
11
|
+
[[ "$PYTHON_VENV_DIR" = /* ]] || PYTHON_VENV_DIR="${QL_DIR}/${PYTHON_VENV_DIR}"
|
|
12
|
+
export PYTHON_VENV_DIR
|
|
13
|
+
if [[ ! -x "$PYTHON_VENV_DIR/bin/python3" ]]; then
|
|
14
|
+
python3 -m venv "$PYTHON_VENV_DIR"
|
|
15
|
+
fi
|
|
16
|
+
[[ -x "$PYTHON_VENV_DIR/bin/python3" ]] || { echo "Invalid Python venv" >&2; exit 1; }
|
|
17
|
+
unset PYTHON_HOME PYTHONUSERBASE PYTHONPATH
|
|
18
|
+
export PATH="${PYTHON_VENV_DIR}/bin:${PATH}:${PNPM_HOME}"
|
|
19
|
+
export PIP_CACHE_DIR="${PYTHON_VENV_DIR}/pip"
|
|
20
|
+
else
|
|
21
|
+
export PYTHON_SHORT_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
|
|
22
|
+
export PYTHON_HOME="${PYTHON_HOME:-${QL_DATA_DIR}/dep_cache/python3}"
|
|
23
|
+
export PYTHONUSERBASE="$PYTHON_HOME"
|
|
24
|
+
export PATH="${PATH}:${PNPM_HOME}:${PYTHON_HOME}/bin"
|
|
25
|
+
export PIP_CACHE_DIR="${PYTHON_HOME}/pip"
|
|
26
|
+
export PYTHONPATH="${PYTHON_HOME}:${PYTHON_HOME}/lib/python${PYTHON_SHORT_VERSION}:${PYTHON_HOME}/lib/python${PYTHON_SHORT_VERSION}/site-packages"
|
|
27
|
+
fi
|
|
28
|
+
export NODE_PATH="${NODE_PATH:-/usr/local/bin:/usr/local/lib/node_modules:${PNPM_HOME}/global/5/node_modules}"
|
|
29
|
+
mkdir -p "$PIP_CACHE_DIR"
|
|
30
|
+
|
|
31
|
+
cd "${QL_DIR}"
|
|
32
|
+
if [[ ! -e .env ]]; then
|
|
33
|
+
# Preserve user configuration, including a file created concurrently.
|
|
34
|
+
(umask 077; set -C; cat .env.example > .env)
|
|
35
|
+
fi
|
|
36
|
+
chmod u+x "${QL_DIR}"/shell/*.sh
|
|
37
|
+
|
|
38
|
+
. "${QL_DIR}/shell/share.sh"
|
|
39
|
+
. "${QL_DIR}/shell/env.sh"
|
|
40
|
+
|
|
41
|
+
log_with_style() {
|
|
42
|
+
local level="$1"
|
|
43
|
+
local message="$2"
|
|
44
|
+
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
|
45
|
+
|
|
46
|
+
printf "\n[%s] [%7s] %s\n" "${timestamp}" "${level}" "${message}"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
import_config "$@"
|
|
50
|
+
log_with_style "INFO" "$(t '🚀 1. 检测配置文件...')"
|
|
51
|
+
make_dir /etc/nginx/conf.d
|
|
52
|
+
make_dir /run/nginx
|
|
53
|
+
fix_config
|
|
54
|
+
|
|
55
|
+
# Slow devices may need more than the worker's readiness window to generate
|
|
56
|
+
# first-boot certificates. Reuse the regular initializer before starting workers.
|
|
57
|
+
load_node_runtime_args
|
|
58
|
+
node "${ql_node_runtime_args[@]}" <<'QL_PREPARE_GRPC_CERTS'
|
|
59
|
+
require(require('node:path').join(process.env.QL_DIR, 'static/build/config/grpcCerts.js'))
|
|
60
|
+
.initGrpcCerts()
|
|
61
|
+
.catch((error) => {
|
|
62
|
+
console.error(error);
|
|
63
|
+
process.exitCode = 1;
|
|
64
|
+
});
|
|
65
|
+
QL_PREPARE_GRPC_CERTS
|
|
66
|
+
|
|
67
|
+
pm2 l &>/dev/null || true
|
|
68
|
+
|
|
69
|
+
log_with_style "INFO" "$(t '🔄 2. 启动 nginx...')"
|
|
70
|
+
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
|
71
|
+
|
|
72
|
+
log_with_style "INFO" "$(t '⚙️ 3. 启动 pm2 服务...')"
|
|
73
|
+
reload_pm2
|
|
74
|
+
|
|
75
|
+
if [[ $command != "reload" ]]; then
|
|
76
|
+
if [[ $AutoStartBot == true ]]; then
|
|
77
|
+
log_with_style "INFO" "$(t '🤖 4. 启动 bot...')"
|
|
78
|
+
nohup ql bot >"$dir_log/bot.log" 2>&1 &
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
if [[ $EnableExtraShell == true ]]; then
|
|
82
|
+
log_with_style "INFO" "$(t '🛠️ 5. 执行自定义脚本...')"
|
|
83
|
+
nohup ql extra >"$dir_log/extra.log" 2>&1 &
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
pm2 startup
|
|
87
|
+
pm2 save
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
log_with_style "SUCCESS" "$(t '🎉 启动成功!')"
|
package/shell/start.sh
CHANGED
|
@@ -4,31 +4,56 @@
|
|
|
4
4
|
set -e
|
|
5
5
|
set -x
|
|
6
6
|
|
|
7
|
+
# Configuration and language helpers are not loaded during bootstrap errors.
|
|
8
|
+
startup_message() {
|
|
9
|
+
local format="$1"
|
|
10
|
+
shift
|
|
11
|
+
if [[ ${QL_LANG:-zh} == en ]]; then
|
|
12
|
+
case "$format" in
|
|
13
|
+
'未找到 qinglong 模块,请先执行 npm i -g @whyour/qinglong 安装') format='Module not found. Run: npm i -g @whyour/qinglong' ;;
|
|
14
|
+
'请先手动设置 export QL_DIR=%s,环境变量,并手动添加到系统环境变量,然后再次执行命令 qinglong 启动服务') format='Set export QL_DIR=%s in your system environment, then run qinglong to start the service' ;;
|
|
15
|
+
'QL_DIR 必须为绝对路径,例如 /ql') format='QL_DIR must be an absolute path, e.g. /ql' ;;
|
|
16
|
+
'请先手动设置数据存储目录 export QL_DATA_DIR 环境变量,目录必须以斜杠开头的绝对路径,并且以 /data 结尾,例如 /ql/data 并手动添加到系统环境变量') format='Set QL_DATA_DIR to an absolute path ending in /data, e.g. /ql/data, in your system environment' ;;
|
|
17
|
+
'QL_DATA_DIR 必须为以 /data 结尾的绝对路径,例如 /ql/data,如果有历史数据,请新建 data 目录,把历史数据放到 data 目录中') format='QL_DATA_DIR must be an absolute path ending in /data, e.g. /ql/data. Move existing data into that directory' ;;
|
|
18
|
+
'暂不支持此系统部署 %s') format='Unsupported system for deployment: %s' ;;
|
|
19
|
+
esac
|
|
20
|
+
fi
|
|
21
|
+
printf -- "$format\n" "$@" >&2
|
|
22
|
+
}
|
|
23
|
+
|
|
7
24
|
if [[ ! $QL_DIR ]]; then
|
|
8
|
-
npm_dir=$(npm root -g)
|
|
9
|
-
pnpm_dir
|
|
10
|
-
if
|
|
25
|
+
npm_dir=$(npm root -g 2>/dev/null) || npm_dir=""
|
|
26
|
+
pnpm_dir=""
|
|
27
|
+
if command -v pnpm >/dev/null 2>&1; then
|
|
28
|
+
pnpm_dir=$(pnpm root -g 2>/dev/null) || pnpm_dir=""
|
|
29
|
+
fi
|
|
30
|
+
if [[ -n "$npm_dir" && -d "$npm_dir/@whyour/qinglong" ]]; then
|
|
11
31
|
QL_DIR="$npm_dir/@whyour/qinglong"
|
|
12
|
-
elif [[ -d "$pnpm_dir/@whyour/qinglong" ]]; then
|
|
32
|
+
elif [[ -n "$pnpm_dir" && -d "$pnpm_dir/@whyour/qinglong" ]]; then
|
|
13
33
|
QL_DIR="$pnpm_dir/@whyour/qinglong"
|
|
14
34
|
else
|
|
15
|
-
|
|
35
|
+
startup_message '未找到 qinglong 模块,请先执行 npm i -g @whyour/qinglong 安装'
|
|
16
36
|
fi
|
|
17
37
|
|
|
18
38
|
if [[ $QL_DIR ]]; then
|
|
19
|
-
|
|
39
|
+
startup_message '请先手动设置 export QL_DIR=%s,环境变量,并手动添加到系统环境变量,然后再次执行命令 qinglong 启动服务' "$QL_DIR"
|
|
20
40
|
fi
|
|
21
41
|
|
|
22
42
|
exit 1
|
|
23
43
|
fi
|
|
24
44
|
|
|
45
|
+
if [[ $QL_DIR != /* ]]; then
|
|
46
|
+
startup_message 'QL_DIR 必须为绝对路径,例如 /ql'
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
|
|
25
50
|
if [[ ! $QL_DATA_DIR ]]; then
|
|
26
|
-
|
|
51
|
+
startup_message '请先手动设置数据存储目录 export QL_DATA_DIR 环境变量,目录必须以斜杠开头的绝对路径,并且以 /data 结尾,例如 /ql/data 并手动添加到系统环境变量'
|
|
27
52
|
exit 1
|
|
28
53
|
fi
|
|
29
54
|
|
|
30
|
-
if [[ $QL_DATA_DIR !=
|
|
31
|
-
|
|
55
|
+
if [[ $QL_DATA_DIR != /*/data ]]; then
|
|
56
|
+
startup_message 'QL_DATA_DIR 必须为以 /data 结尾的绝对路径,例如 /ql/data,如果有历史数据,请新建 data 目录,把历史数据放到 data 目录中'
|
|
32
57
|
exit 1
|
|
33
58
|
fi
|
|
34
59
|
|
|
@@ -38,7 +63,11 @@ if [[ $command != "reload" ]]; then
|
|
|
38
63
|
# 安装依赖
|
|
39
64
|
os_name="${QL_OS_TYPE:-}"
|
|
40
65
|
if [ -z "$os_name" ]; then
|
|
41
|
-
|
|
66
|
+
if [[ -r /etc/os-release ]]; then
|
|
67
|
+
os_name=$(source /etc/os-release && echo "$ID")
|
|
68
|
+
else
|
|
69
|
+
os_name=$(uname -s)
|
|
70
|
+
fi
|
|
42
71
|
fi
|
|
43
72
|
|
|
44
73
|
# 非 root 用户使用 sudo
|
|
@@ -69,7 +98,7 @@ if [[ $command != "reload" ]]; then
|
|
|
69
98
|
$SUDO apt-get install -y git curl wget tzdata perl openssl jq nginx procps netcat-openbsd openssh-client
|
|
70
99
|
;;
|
|
71
100
|
*)
|
|
72
|
-
|
|
101
|
+
startup_message '暂不支持此系统部署 %s' "$os_name"
|
|
73
102
|
exit 1
|
|
74
103
|
;;
|
|
75
104
|
esac
|
|
@@ -77,65 +106,13 @@ if [[ $command != "reload" ]]; then
|
|
|
77
106
|
npm install -g pnpm@8.3.1 pm2 ts-node typescript@5
|
|
78
107
|
fi
|
|
79
108
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
export
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
export PIP_CACHE_DIR=${PYTHON_HOME}/pip
|
|
88
|
-
export PYTHONPATH=${PYTHON_HOME}:${PYTHON_HOME}/lib/python${PYTHON_SHORT_VERSION}:${PYTHON_HOME}/lib/python${PYTHON_SHORT_VERSION}/site-packages
|
|
89
|
-
|
|
90
|
-
if [[ $command != "reload" ]]; then
|
|
91
|
-
pip3 install --prefix ${PYTHON_HOME} requests
|
|
92
|
-
fi
|
|
93
|
-
|
|
94
|
-
cd "${QL_DIR}"
|
|
95
|
-
if [[ ! -e .env ]]; then
|
|
96
|
-
# Preserve user configuration, including a file created concurrently.
|
|
97
|
-
(umask 077; set -C; cat .env.example > .env)
|
|
98
|
-
fi
|
|
99
|
-
chmod 777 ${QL_DIR}/shell/*.sh
|
|
100
|
-
|
|
101
|
-
. ${QL_DIR}/shell/share.sh
|
|
102
|
-
. ${QL_DIR}/shell/env.sh
|
|
103
|
-
|
|
104
|
-
log_with_style() {
|
|
105
|
-
local level="$1"
|
|
106
|
-
local message="$2"
|
|
107
|
-
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
|
108
|
-
|
|
109
|
-
printf "\n[%s] [%7s] %s\n" "${timestamp}" "${level}" "${message}"
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
log_with_style "INFO" "🚀 1. 检测配置文件..."
|
|
113
|
-
import_config "$@"
|
|
114
|
-
make_dir /etc/nginx/conf.d
|
|
115
|
-
make_dir /run/nginx
|
|
116
|
-
fix_config
|
|
117
|
-
|
|
118
|
-
pm2 l &>/dev/null
|
|
119
|
-
|
|
120
|
-
log_with_style "INFO" "🔄 2. 启动 nginx..."
|
|
121
|
-
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
|
122
|
-
|
|
123
|
-
log_with_style "INFO" "⚙️ 3. 启动 pm2 服务..."
|
|
124
|
-
reload_pm2
|
|
125
|
-
|
|
126
|
-
if [[ $command != "reload" ]]; then
|
|
127
|
-
if [[ $AutoStartBot == true ]]; then
|
|
128
|
-
log_with_style "INFO" "🤖 4. 启动 bot..."
|
|
129
|
-
nohup ql bot >$dir_log/bot.log 2>&1 &
|
|
130
|
-
fi
|
|
131
|
-
|
|
132
|
-
if [[ $EnableExtraShell == true ]]; then
|
|
133
|
-
log_with_style "INFO" "🛠️ 5. 执行自定义脚本..."
|
|
134
|
-
nohup ql extra >$dir_log/extra.log 2>&1 &
|
|
109
|
+
if [[ "$command" != "reload" ]]; then
|
|
110
|
+
if [[ -n "${PYTHON_VENV_DIR:-}" ]]; then
|
|
111
|
+
[[ "$PYTHON_VENV_DIR" = /* ]] || export PYTHON_VENV_DIR="${QL_DIR}/${PYTHON_VENV_DIR}"
|
|
112
|
+
[[ -x "$PYTHON_VENV_DIR/bin/python3" ]] || python3 -m venv "$PYTHON_VENV_DIR"
|
|
113
|
+
"$PYTHON_VENV_DIR/bin/python3" -m pip install requests
|
|
114
|
+
else
|
|
115
|
+
pip3 install --prefix "${PYTHON_HOME:-${QL_DATA_DIR}/dep_cache/python3}" requests
|
|
135
116
|
fi
|
|
136
|
-
|
|
137
|
-
pm2 startup
|
|
138
|
-
pm2 save
|
|
139
117
|
fi
|
|
140
|
-
|
|
141
|
-
log_with_style "SUCCESS" "🎉 启动成功!"
|
|
118
|
+
exec /bin/bash "${QL_DIR}/shell/start-simplify.sh" "$@"
|
package/shell/task-timeout.sh
CHANGED
|
@@ -36,19 +36,31 @@ run_task_command() {
|
|
|
36
36
|
) &
|
|
37
37
|
timeout_watcher=$!
|
|
38
38
|
set +m
|
|
39
|
-
|
|
39
|
+
finish_task_timeout() {
|
|
40
|
+
local code="$1"
|
|
41
|
+
trap - EXIT
|
|
42
|
+
{
|
|
43
|
+
# Bash can report a killed job between any two cleanup commands.
|
|
44
|
+
# Keep redirection active until the watchdog is fully reaped.
|
|
45
|
+
kill -KILL -- "-$timeout_watcher" || :
|
|
46
|
+
wait "$timeout_watcher" || :
|
|
47
|
+
} 2>/dev/null
|
|
40
48
|
if kill -TERM -- "-$timeout_worker" 2>/dev/null; then sleep 0.1; fi
|
|
41
49
|
kill -KILL -- "-$timeout_worker" 2>/dev/null || :
|
|
42
50
|
wait "$timeout_worker" 2>/dev/null || :
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
trap '
|
|
51
|
+
rm -rf -- "$timeout_dir"
|
|
52
|
+
exit "$code"
|
|
53
|
+
}
|
|
54
|
+
# Older Bash can omit a subshell's EXIT trap in sourced pipelines. Call
|
|
55
|
+
# cleanup explicitly on completion/signals, retaining EXIT as a fallback.
|
|
56
|
+
trap 'finish_task_timeout "$?"' EXIT
|
|
57
|
+
trap 'finish_task_timeout 130' INT
|
|
58
|
+
trap 'finish_task_timeout 143' TERM
|
|
59
|
+
trap 'finish_task_timeout 129' HUP
|
|
60
|
+
trap 'finish_task_timeout 131' QUIT
|
|
49
61
|
# Do not clean up a timer whose process group has not initialized yet.
|
|
50
62
|
while [[ ! -f "$timeout_dir/ready" ]]; do
|
|
51
|
-
kill -0 "$timeout_watcher" 2>/dev/null ||
|
|
63
|
+
kill -0 "$timeout_watcher" 2>/dev/null || finish_task_timeout 125
|
|
52
64
|
sleep 0.001
|
|
53
65
|
done
|
|
54
66
|
wait "$timeout_worker"
|
|
@@ -56,8 +68,8 @@ run_task_command() {
|
|
|
56
68
|
if [[ -f "$timeout_dir/expired" ]]; then
|
|
57
69
|
# Let the timer finish escalation even if the task leader exited first.
|
|
58
70
|
wait "$timeout_watcher" 2>/dev/null || :
|
|
59
|
-
|
|
71
|
+
finish_task_timeout 124
|
|
60
72
|
fi
|
|
61
|
-
|
|
73
|
+
finish_task_timeout "$timeout_code"
|
|
62
74
|
)
|
|
63
75
|
}
|
package/shell/task.sh
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
dir_shell=$QL_DIR/shell
|
|
4
|
-
. $dir_shell/share.sh
|
|
5
|
-
. $dir_shell/api.sh
|
|
6
|
-
. $dir_shell/task-timeout.sh
|
|
4
|
+
. "$dir_shell/share.sh"
|
|
5
|
+
. "$dir_shell/api.sh"
|
|
6
|
+
. "$dir_shell/task-timeout.sh"
|
|
7
7
|
|
|
8
8
|
trap 'single_hanle SIGINT' INT
|
|
9
9
|
trap 'single_hanle SIGTERM' TERM
|
|
@@ -48,7 +48,7 @@ handle_log_path() {
|
|
|
48
48
|
fi
|
|
49
49
|
|
|
50
50
|
if [[ -z ${ID:=} ]]; then
|
|
51
|
-
ID=$(cat $list_crontab_user | grep -E "$cmd_task.* $file_param" | perl -pe "s|.*ID=(.*) $cmd_task.* $file_param\.*|\1|" | head -1 | awk -F " " '{print $1}')
|
|
51
|
+
ID=$(cat "$list_crontab_user" | grep -E "$cmd_task.* $file_param" | perl -pe "s|.*ID=(.*) $cmd_task.* $file_param\.*|\1|" | head -1 | awk -F " " '{print $1}')
|
|
52
52
|
fi
|
|
53
53
|
local suffix=""
|
|
54
54
|
if [[ ! -z $ID ]]; then
|
|
@@ -89,10 +89,10 @@ handle_log_path() {
|
|
|
89
89
|
log_path="$real_log_path"
|
|
90
90
|
fi
|
|
91
91
|
|
|
92
|
-
cmd
|
|
92
|
+
printf -v cmd '2>&1 | tee -a %q' "$dir_log/$log_path"
|
|
93
93
|
make_dir "$dir_log/$log_dir"
|
|
94
94
|
if [[ "${no_tee:=}" == "true" ]]; then
|
|
95
|
-
cmd
|
|
95
|
+
printf -v cmd '>> %q 2>&1' "$dir_log/$log_path"
|
|
96
96
|
fi
|
|
97
97
|
|
|
98
98
|
if [[ "${real_time:=}" == "true" ]]; then
|
|
@@ -162,5 +162,5 @@ define_program "${task_shell_params[@]}"
|
|
|
162
162
|
handle_log_path "${task_shell_params[@]}"
|
|
163
163
|
init_begin_time
|
|
164
164
|
|
|
165
|
-
eval . $dir_shell/otask.sh "$cmd"
|
|
165
|
+
eval '. "$dir_shell/otask.sh"' "$cmd"
|
|
166
166
|
exit 0
|
package/shell/update.sh
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
dir_shell=$QL_DIR/shell
|
|
4
|
-
. $dir_shell/share.sh
|
|
5
|
-
. $dir_shell/api.sh
|
|
4
|
+
. "$dir_shell/share.sh"
|
|
5
|
+
. "$dir_shell/api.sh"
|
|
6
6
|
load_ql_envs
|
|
7
|
-
. $dir_shell/env.sh
|
|
7
|
+
. "$dir_shell/env.sh"
|
|
8
8
|
|
|
9
9
|
send_mark=$dir_shell/send_mark
|
|
10
10
|
|
|
@@ -31,7 +31,7 @@ diff_cron() {
|
|
|
31
31
|
## 输出是否有新的或失效的定时任务,$1:新的或失效的任务清单文件路径,$2:新/失效
|
|
32
32
|
output_list_add_drop() {
|
|
33
33
|
local list=$1
|
|
34
|
-
local type=$2
|
|
34
|
+
local type=$(t "$2")
|
|
35
35
|
if [[ -s $list ]]; then
|
|
36
36
|
t '检测到有%s的定时任务:' "$type"
|
|
37
37
|
cat $list
|
|
@@ -67,7 +67,7 @@ del_cron() {
|
|
|
67
67
|
done
|
|
68
68
|
if [[ $ids ]]; then
|
|
69
69
|
result=$(del_cron_api "$ids")
|
|
70
|
-
notify_api "$path
|
|
70
|
+
notify_api "$(t '%s 删除任务%s' "$path" "$result")" "$detail"
|
|
71
71
|
fi
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -99,7 +99,9 @@ add_cron() {
|
|
|
99
99
|
cron_name=$(grep "new Env" $file | awk -F "\(" '{print $2}' | awk -F "\)" '{print $1}' | sed 's:.*\('\''\|"\)\([^"'\'']*\)\('\''\|"\).*:\2:' | sed 's:"::g' | sed "s:'::g" | head -1)
|
|
100
100
|
[[ -z $cron_name ]] && cron_name=$(grep "name:" $file | awk -F ":" '{print $2}' | head -1 | xargs)
|
|
101
101
|
[[ -z $cron_name ]] && cron_name=$(basename "$file_name")
|
|
102
|
-
|
|
102
|
+
cron_name=${cron_name//$'\r'/}
|
|
103
|
+
cron_line=${cron_line//$'\r'/}
|
|
104
|
+
result=$(add_cron_api "$cron_line" "${cmd_task} ${file}" "$cron_name" "$SUB_ID")
|
|
103
105
|
echo -e "$result"
|
|
104
106
|
if [[ $detail ]]; then
|
|
105
107
|
detail="${detail}${result}\n"
|
|
@@ -108,7 +110,7 @@ add_cron() {
|
|
|
108
110
|
fi
|
|
109
111
|
fi
|
|
110
112
|
done
|
|
111
|
-
notify_api "$
|
|
113
|
+
notify_api "$(t '%s 新增任务' "$path")" "$detail"
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
## 更新仓库
|
|
@@ -163,17 +165,20 @@ update_raw() {
|
|
|
163
165
|
t '开始下载:%s 保存路径:%s\n' "${raw_url}" "$dir_raw/${raw_file_name}"
|
|
164
166
|
|
|
165
167
|
set_proxy "$proxy"
|
|
166
|
-
wget -q --no-check-certificate -O "$dir_raw/${raw_file_name}.new" $
|
|
167
|
-
|
|
168
|
+
if wget -q --no-check-certificate -O "$dir_raw/${raw_file_name}.new" "$raw_url"; then
|
|
169
|
+
exit_status=0
|
|
170
|
+
else
|
|
171
|
+
exit_status=$?
|
|
172
|
+
fi
|
|
168
173
|
unset_proxy
|
|
169
174
|
|
|
170
|
-
if [[
|
|
171
|
-
mv "$dir_raw/${raw_file_name}.new" "$dir_raw/${raw_file_name}"
|
|
175
|
+
if [[ $exit_status -eq 0 ]]; then
|
|
176
|
+
mv "$dir_raw/${raw_file_name}.new" "$dir_raw/${raw_file_name}" || return $?
|
|
172
177
|
t '下载 %s 成功...\n' "${raw_file_name}"
|
|
173
|
-
cd $dir_raw
|
|
178
|
+
cd "$dir_raw" || return $?
|
|
174
179
|
local filename="raw_${raw_file_name}"
|
|
175
|
-
local cron_id=$(cat $list_crontab_user | grep -E "$cmd_task.* $filename" | perl -pe "s|.*ID=(.*) $cmd_task.* $filename\.*|\1|" | head -1 | awk -F " " '{print $1}')
|
|
176
|
-
cp -f $raw_file_name $dir_scripts/${filename}
|
|
180
|
+
local cron_id=$(cat "$list_crontab_user" | grep -E "$cmd_task.* $filename" | perl -pe "s|.*ID=(.*) $cmd_task.* $filename\.*|\1|" | head -1 | awk -F " " '{print $1}')
|
|
181
|
+
cp -f "$raw_file_name" "$dir_scripts/${filename}" || return $?
|
|
177
182
|
if [[ -z $cron_id ]] && [[ ${autoAddCron} == true ]]; then
|
|
178
183
|
cron_line=$(
|
|
179
184
|
perl -ne "{
|
|
@@ -190,14 +195,17 @@ update_raw() {
|
|
|
190
195
|
[[ -z $cron_line ]] && cron_line=$(grep "cron:" $raw_file_name | awk -F ":" '{print $2}' | head -1 | xargs)
|
|
191
196
|
[[ -z $cron_line ]] && cron_line=$(grep "cron " $raw_file_name | awk -F "cron \"" '{print $2}' | awk -F "\" " '{print $1}' | head -1 | xargs)
|
|
192
197
|
[[ -z $cron_line ]] && cron_line="$default_cron"
|
|
193
|
-
|
|
198
|
+
cron_name=${cron_name//$'\r'/}
|
|
199
|
+
cron_line=${cron_line//$'\r'/}
|
|
200
|
+
result=$(add_cron_api "$cron_line" "${cmd_task} ${filename}" "$cron_name" "$SUB_ID")
|
|
194
201
|
echo -e "$result\n"
|
|
195
|
-
notify_api "新增任务通知" "\n$result"
|
|
202
|
+
notify_api "$(t '新增任务通知')" "\n$result"
|
|
196
203
|
# update_cron_api "$cron_line:$cmd_task $filename:$cron_name:$cron_id"
|
|
197
204
|
fi
|
|
198
205
|
else
|
|
199
206
|
t '下载 %s 失败,保留之前正常下载的版本...\n' "${raw_file_name}"
|
|
200
207
|
[[ -f "$dir_raw/${raw_file_name}.new" ]] && rm -f "$dir_raw/${raw_file_name}.new"
|
|
208
|
+
return "$exit_status"
|
|
201
209
|
fi
|
|
202
210
|
|
|
203
211
|
}
|
|
@@ -205,7 +213,7 @@ update_raw() {
|
|
|
205
213
|
## 调用用户自定义的extra.sh
|
|
206
214
|
run_extra_shell() {
|
|
207
215
|
if [[ -f $file_extra_shell ]]; then
|
|
208
|
-
. $file_extra_shell
|
|
216
|
+
. "$file_extra_shell"
|
|
209
217
|
else
|
|
210
218
|
t '%s文件不存在,跳过执行...\n' "$file_extra_shell"
|
|
211
219
|
fi
|
|
@@ -262,24 +270,25 @@ show_service_logs() {
|
|
|
262
270
|
# Winston writes the active runtime log by date. Follow the filename so
|
|
263
271
|
# size-based rotations are handled without involving the PM2 log files.
|
|
264
272
|
local current_system_log="$system_log_dir/$(date +%F).log"
|
|
265
|
-
tail -
|
|
273
|
+
# GNU and BSD tail both support -F; --retry is GNU-only and implied by -F.
|
|
274
|
+
tail -n 0 -F "$current_system_log"
|
|
266
275
|
}
|
|
267
276
|
|
|
268
277
|
## 脚本用法
|
|
269
278
|
usage() {
|
|
270
|
-
t "$cmd_update
|
|
271
|
-
echo -e "1. $cmd_update update # 更新并重启青龙"
|
|
272
|
-
echo -e "2. $cmd_update extra # 运行自定义脚本"
|
|
273
|
-
echo -e "3. $cmd_update raw <fileurl> # 更新单个脚本文件"
|
|
274
|
-
echo -e "4. $cmd_update repo <repourl> <path> <blacklist> <dependence> <branch> <extensions> # 更新单个仓库的脚本"
|
|
275
|
-
echo -e "5. $cmd_update rmlog <days> # 删除旧日志"
|
|
276
|
-
echo -e "6. $cmd_update bot # 启动tg-bot"
|
|
277
|
-
echo -e "7. $cmd_update check # 检测青龙环境并修复"
|
|
278
|
-
echo -e "8. $cmd_update log [--lines <n>] [--nostream] # 查看青龙运行日志"
|
|
279
|
-
echo -e "9. $cmd_update resetlet # 重置登录错误次数"
|
|
280
|
-
echo -e "10. $cmd_update resettfa # 禁用两步登录"
|
|
281
|
-
echo -e "11. $cmd_update resetpwd # 修改登录密码"
|
|
282
|
-
echo -e "12. $cmd_update resetname # 修改登录用户名"
|
|
279
|
+
t '%s 命令使用方法:' "$cmd_update"
|
|
280
|
+
echo -e "1. $cmd_update update # $(t '更新并重启青龙')"
|
|
281
|
+
echo -e "2. $cmd_update extra # $(t '运行自定义脚本')"
|
|
282
|
+
echo -e "3. $cmd_update raw <fileurl> # $(t '更新单个脚本文件')"
|
|
283
|
+
echo -e "4. $cmd_update repo <repourl> <path> <blacklist> <dependence> <branch> <extensions> # $(t '更新单个仓库的脚本')"
|
|
284
|
+
echo -e "5. $cmd_update rmlog <days> # $(t '删除旧日志')"
|
|
285
|
+
echo -e "6. $cmd_update bot # $(t '启动tg-bot')"
|
|
286
|
+
echo -e "7. $cmd_update check # $(t '检测青龙环境并修复')"
|
|
287
|
+
echo -e "8. $cmd_update log [--lines <n>] [--nostream] # $(t '查看青龙运行日志')"
|
|
288
|
+
echo -e "9. $cmd_update resetlet # $(t '重置登录错误次数')"
|
|
289
|
+
echo -e "10. $cmd_update resettfa # $(t '禁用两步登录')"
|
|
290
|
+
echo -e "11. $cmd_update resetpwd # $(t '修改登录密码')"
|
|
291
|
+
echo -e "12. $cmd_update resetname # $(t '修改登录用户名')"
|
|
283
292
|
}
|
|
284
293
|
|
|
285
294
|
reload_qinglong() {
|
|
@@ -480,9 +489,9 @@ main() {
|
|
|
480
489
|
local log_path="${log_dir}/${log_time}.log"
|
|
481
490
|
local file_path="$dir_log/$log_path"
|
|
482
491
|
|
|
483
|
-
cmd
|
|
492
|
+
printf -v cmd '2>&1 | tee -a %q' "$file_path"
|
|
484
493
|
if [[ "$no_tee" == "true" ]]; then
|
|
485
|
-
cmd
|
|
494
|
+
printf -v cmd '>> %q 2>&1' "$file_path"
|
|
486
495
|
fi
|
|
487
496
|
if [[ "$real_time" == "true" ]]; then
|
|
488
497
|
cmd=""
|
|
@@ -495,7 +504,9 @@ main() {
|
|
|
495
504
|
local begin_time=$(format_time "$time_format" "$time")
|
|
496
505
|
|
|
497
506
|
if [[ "$p1" != "repo" ]] && [[ "$p1" != "raw" ]]; then
|
|
498
|
-
|
|
507
|
+
local start_message
|
|
508
|
+
printf -v start_message '%q' "$(t '## 开始执行... %s\n' "$begin_time")"
|
|
509
|
+
eval "printf '%s\n' $start_message $cmd"
|
|
499
510
|
fi
|
|
500
511
|
|
|
501
512
|
[[ $ID ]] && update_cron "\"$ID\"" "0" "$$" "$log_path" "$begin_timestamp"
|
|
@@ -528,19 +539,20 @@ main() {
|
|
|
528
539
|
get_uniq_path "$p2"
|
|
529
540
|
if [[ -n $p2 ]]; then
|
|
530
541
|
update_raw "$p2" "$p3" "$p4" "$p5"
|
|
542
|
+
command_status=$?
|
|
531
543
|
else
|
|
532
544
|
t '命令输入错误...\n'
|
|
533
545
|
eval usage $cmd
|
|
534
546
|
fi
|
|
535
547
|
;;
|
|
536
548
|
rmlog)
|
|
537
|
-
eval . $dir_shell/rmlog.sh "$p2" $cmd
|
|
549
|
+
eval '. "$dir_shell/rmlog.sh" "$p2"' "$cmd"
|
|
538
550
|
;;
|
|
539
551
|
bot)
|
|
540
|
-
eval . $dir_shell/bot.sh $cmd
|
|
552
|
+
eval '. "$dir_shell/bot.sh"' "$cmd"
|
|
541
553
|
;;
|
|
542
554
|
check)
|
|
543
|
-
eval . $dir_shell/check.sh $cmd
|
|
555
|
+
eval '. "$dir_shell/check.sh"' "$cmd"
|
|
544
556
|
;;
|
|
545
557
|
resetlet)
|
|
546
558
|
eval update_auth_config "\\\"retries\\\":0" "重置登录错误次数" $cmd
|
|
@@ -567,7 +579,9 @@ main() {
|
|
|
567
579
|
[[ $ID ]] && update_cron "\"$ID\"" "1" "$$" "$log_path" "$begin_timestamp" "$diff_time"
|
|
568
580
|
|
|
569
581
|
if [[ "$p1" != "repo" ]] && [[ "$p1" != "raw" ]]; then
|
|
570
|
-
|
|
582
|
+
local end_message
|
|
583
|
+
printf -v end_message '%q' "$(t '\n## 执行结束... %s 耗时 %s 秒' "$end_time" "$diff_time") "
|
|
584
|
+
eval "printf '%s\n' $end_message $cmd"
|
|
571
585
|
fi
|
|
572
586
|
return "$command_status"
|
|
573
587
|
}
|