@whyour/qinglong 2.22.0 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (553) hide show
  1. package/.env.example +3 -0
  2. package/README-NODE.md +10 -0
  3. package/back/protos/api.proto +10 -0
  4. package/cli/README.en.md +156 -0
  5. package/cli/README.md +156 -0
  6. package/cli/src/internal/maintenance/nodeRuntime.cjs +18 -0
  7. package/cli/src/internal/maintenance/panelUpgrade.cjs +577 -0
  8. package/cli/src/internal/maintenance/platformBundle.cjs +582 -0
  9. package/cli/src/internal/maintenance/upgradeArtifacts.cjs +979 -0
  10. package/cli/src/internal/maintenance/upgradePrestart.cjs +396 -0
  11. package/ecosystem.config.js +3 -0
  12. package/package.json +59 -15
  13. package/sample/notify.js +308 -135
  14. package/sample/notify.py +174 -27
  15. package/shell/api.sh +71 -74
  16. package/shell/install-bundle.cjs +320 -0
  17. package/shell/install-package.cjs +74 -0
  18. package/shell/lang/en.sh +38 -0
  19. package/shell/node-runtime-probe.cjs +62 -0
  20. package/shell/node_path_cache.sh +10 -2
  21. package/shell/otask.sh +41 -41
  22. package/shell/preload/client.js +1 -0
  23. package/shell/preload/notificationAudit.js +51 -0
  24. package/shell/preload/sitecustomize.js +9 -5
  25. package/shell/preload/sitecustomize.py +9 -7
  26. package/shell/rmlog.sh +21 -16
  27. package/shell/share.sh +62 -45
  28. package/shell/start-simplify.sh +90 -0
  29. package/shell/start.sh +48 -71
  30. package/shell/task-timeout.sh +75 -0
  31. package/shell/task.sh +14 -12
  32. package/shell/update.sh +92 -133
  33. package/shell/upgrade-lock.yaml +16122 -0
  34. package/shell/upgrade.cjs +8 -0
  35. package/static/build/api/clientIp.js +2 -1
  36. package/static/build/api/clientIp.js.map +1 -0
  37. package/static/build/api/config.js +2 -6
  38. package/static/build/api/config.js.map +1 -0
  39. package/static/build/api/cron.js.map +1 -0
  40. package/static/build/api/dashboard.js.map +1 -0
  41. package/static/build/api/dependence.js.map +1 -0
  42. package/static/build/api/env.js +15 -14
  43. package/static/build/api/env.js.map +1 -0
  44. package/static/build/api/health.js.map +1 -0
  45. package/static/build/api/index.js.map +1 -0
  46. package/static/build/api/log.js.map +1 -0
  47. package/static/build/api/open.js +2 -1
  48. package/static/build/api/open.js.map +1 -0
  49. package/static/build/api/retention.js.map +1 -0
  50. package/static/build/api/script.js +155 -9
  51. package/static/build/api/script.js.map +1 -0
  52. package/static/build/api/subscription.js +3 -6
  53. package/static/build/api/subscription.js.map +1 -0
  54. package/static/build/api/system.js +53 -3
  55. package/static/build/api/system.js.map +1 -0
  56. package/static/build/api/update.js.map +1 -0
  57. package/static/build/api/user.js.map +1 -0
  58. package/static/build/app.js +10 -23
  59. package/static/build/app.js.map +1 -0
  60. package/static/build/bootstrap/database.js.map +1 -0
  61. package/static/build/bootstrap/upgradeProbe.js +154 -0
  62. package/static/build/bootstrap/upgradeProbe.js.map +1 -0
  63. package/static/build/config/const.js +2 -1
  64. package/static/build/config/const.js.map +1 -0
  65. package/static/build/config/container.js.map +1 -0
  66. package/static/build/config/grpcCerts.js +89 -40
  67. package/static/build/config/grpcCerts.js.map +1 -0
  68. package/static/build/config/http.js.map +1 -0
  69. package/static/build/config/index.js.map +1 -0
  70. package/static/build/config/serverEnv.js.map +1 -0
  71. package/static/build/config/share.js.map +1 -0
  72. package/static/build/config/subscription.js +19 -11
  73. package/static/build/config/subscription.js.map +1 -0
  74. package/static/build/config/util.js +178 -77
  75. package/static/build/config/util.js.map +1 -0
  76. package/static/build/data/cron.js.map +1 -0
  77. package/static/build/data/cronStats.js.map +1 -0
  78. package/static/build/data/cronView.js.map +1 -0
  79. package/static/build/data/dependence.js.map +1 -0
  80. package/static/build/data/env.js.map +1 -0
  81. package/static/build/data/index.js.map +1 -0
  82. package/static/build/data/notify.js.map +1 -0
  83. package/static/build/data/open.js.map +1 -0
  84. package/static/build/data/runningInstance.js.map +1 -0
  85. package/static/build/data/sock.js.map +1 -0
  86. package/static/build/data/subscription.js.map +1 -0
  87. package/static/build/data/system.js +3 -1
  88. package/static/build/data/system.js.map +1 -0
  89. package/static/build/interface/schedule.js.map +1 -0
  90. package/static/build/loaders/app.js.map +1 -0
  91. package/static/build/loaders/bootAfter.js.map +1 -0
  92. package/static/build/loaders/db.js.map +1 -0
  93. package/static/build/loaders/depInjector.js.map +1 -0
  94. package/static/build/loaders/deps.js.map +1 -0
  95. package/static/build/loaders/express.js +10 -3
  96. package/static/build/loaders/express.js.map +1 -0
  97. package/static/build/loaders/httpApplication.js +55 -0
  98. package/static/build/loaders/httpApplication.js.map +1 -0
  99. package/static/build/loaders/initData.js +20 -30
  100. package/static/build/loaders/initData.js.map +1 -0
  101. package/static/build/loaders/initFile.js.map +1 -0
  102. package/static/build/loaders/initTask.js +11 -1
  103. package/static/build/loaders/initTask.js.map +1 -0
  104. package/static/build/loaders/logger.js.map +1 -0
  105. package/static/build/loaders/server.js.map +1 -0
  106. package/static/build/loaders/sock.js.map +1 -0
  107. package/static/build/middlewares/monitoring.js.map +1 -0
  108. package/static/build/middlewares/protectedPathCase.js.map +1 -0
  109. package/static/build/middlewares/uniqueConstraintError.js +15 -0
  110. package/static/build/middlewares/uniqueConstraintError.js.map +1 -0
  111. package/static/build/middlewares/validationErrors.js +17 -0
  112. package/static/build/middlewares/validationErrors.js.map +1 -0
  113. package/static/build/protos/api.js +140 -2
  114. package/static/build/protos/api.js.map +1 -0
  115. package/static/build/protos/cron.js +63 -2
  116. package/static/build/protos/cron.js.map +1 -0
  117. package/static/build/protos/health.js.map +1 -0
  118. package/static/build/schedule/addCron.js +45 -63
  119. package/static/build/schedule/addCron.js.map +1 -0
  120. package/static/build/schedule/api.js +21 -2
  121. package/static/build/schedule/api.js.map +1 -0
  122. package/static/build/schedule/client.js +19 -1
  123. package/static/build/schedule/client.js.map +1 -0
  124. package/static/build/schedule/data.js.map +1 -0
  125. package/static/build/schedule/delCron.js +6 -4
  126. package/static/build/schedule/delCron.js.map +1 -0
  127. package/static/build/schedule/health.js.map +1 -0
  128. package/static/build/schedule/setConcurrency.js +27 -0
  129. package/static/build/schedule/setConcurrency.js.map +1 -0
  130. package/static/build/services/config.js +2 -3
  131. package/static/build/services/config.js.map +1 -0
  132. package/static/build/services/cron.js +43 -17
  133. package/static/build/services/cron.js.map +1 -0
  134. package/static/build/services/cronView.js.map +1 -0
  135. package/static/build/services/dependence.js +48 -13
  136. package/static/build/services/dependence.js.map +1 -0
  137. package/static/build/services/env.js +1 -1
  138. package/static/build/services/env.js.map +1 -0
  139. package/static/build/services/grpc.js +4 -3
  140. package/static/build/services/grpc.js.map +1 -0
  141. package/static/build/services/health.js +2 -0
  142. package/static/build/services/health.js.map +1 -0
  143. package/static/build/services/http.js.map +1 -0
  144. package/static/build/services/log.js +1 -1
  145. package/static/build/services/log.js.map +1 -0
  146. package/static/build/services/metrics.js +2 -1
  147. package/static/build/services/metrics.js.map +1 -0
  148. package/static/build/services/notify.js +45 -24
  149. package/static/build/services/notify.js.map +1 -0
  150. package/static/build/services/open.js +106 -31
  151. package/static/build/services/open.js.map +1 -0
  152. package/static/build/services/retention.js.map +1 -0
  153. package/static/build/services/schedule.js +32 -21
  154. package/static/build/services/schedule.js.map +1 -0
  155. package/static/build/services/script.js +1 -1
  156. package/static/build/services/script.js.map +1 -0
  157. package/static/build/services/scriptHistory.js +30 -0
  158. package/static/build/services/scriptHistory.js.map +1 -0
  159. package/static/build/services/sock.js.map +1 -0
  160. package/static/build/services/sshKey.js +45 -17
  161. package/static/build/services/sshKey.js.map +1 -0
  162. package/static/build/services/subscription.js +104 -53
  163. package/static/build/services/subscription.js.map +1 -0
  164. package/static/build/services/system.js +139 -74
  165. package/static/build/services/system.js.map +1 -0
  166. package/static/build/services/user.js +17 -12
  167. package/static/build/services/user.js.map +1 -0
  168. package/static/build/shared/auth.js.map +1 -0
  169. package/static/build/shared/authMutation.js.map +1 -0
  170. package/static/build/shared/childProcess.js.map +1 -0
  171. package/static/build/shared/clientIp.js.map +1 -0
  172. package/static/build/shared/cronCommand.js +17 -0
  173. package/static/build/shared/cronCommand.js.map +1 -0
  174. package/static/build/shared/cronSchedule.js +157 -0
  175. package/static/build/shared/cronSchedule.js.map +1 -0
  176. package/static/build/shared/cronScheduler.js +74 -0
  177. package/static/build/shared/cronScheduler.js.map +1 -0
  178. package/static/build/shared/errors.js.map +1 -0
  179. package/static/build/shared/fileAccess.js.map +1 -0
  180. package/static/build/shared/i18n.js +167 -87
  181. package/static/build/shared/i18n.js.map +1 -0
  182. package/static/build/shared/interface.js.map +1 -0
  183. package/static/build/shared/languageSync.js +61 -0
  184. package/static/build/shared/languageSync.js.map +1 -0
  185. package/static/build/shared/linuxMirror.js +96 -0
  186. package/static/build/shared/linuxMirror.js.map +1 -0
  187. package/static/build/shared/logPath.js +15 -0
  188. package/static/build/shared/logPath.js.map +1 -0
  189. package/static/build/shared/logReader.js.map +1 -0
  190. package/static/build/shared/logStreamManager.js.map +1 -0
  191. package/static/build/shared/loginThrottle.js +45 -0
  192. package/static/build/shared/loginThrottle.js.map +1 -0
  193. package/static/build/shared/notificationAudit.js +46 -0
  194. package/static/build/shared/notificationAudit.js.map +1 -0
  195. package/static/build/shared/pLimit.js +27 -14
  196. package/static/build/shared/pLimit.js.map +1 -0
  197. package/static/build/shared/password.js.map +1 -0
  198. package/static/build/shared/retention.js.map +1 -0
  199. package/static/build/shared/runCron.js +81 -29
  200. package/static/build/shared/runCron.js.map +1 -0
  201. package/static/build/shared/runtimeBuild.js +44 -0
  202. package/static/build/shared/runtimeBuild.js.map +1 -0
  203. package/static/build/shared/schedulerMutationLock.js.map +1 -0
  204. package/static/build/shared/schedulerReadiness.js.map +1 -0
  205. package/static/build/shared/schemaMigrations.js.map +1 -0
  206. package/static/build/shared/scriptHistory.js +445 -0
  207. package/static/build/shared/scriptHistory.js.map +1 -0
  208. package/static/build/shared/shellQuote.js +11 -0
  209. package/static/build/shared/shellQuote.js.map +1 -0
  210. package/static/build/shared/startupProcess.js.map +1 -0
  211. package/static/build/shared/store.js.map +1 -0
  212. package/static/build/shared/subscriptionMutationLock.js +34 -0
  213. package/static/build/shared/subscriptionMutationLock.js.map +1 -0
  214. package/static/build/shared/subscriptionPath.js +41 -0
  215. package/static/build/shared/subscriptionPath.js.map +1 -0
  216. package/static/build/shared/subscriptionStorage.js +98 -0
  217. package/static/build/shared/subscriptionStorage.js.map +1 -0
  218. package/static/build/shared/trustProxy.js +5 -4
  219. package/static/build/shared/trustProxy.js.map +1 -0
  220. package/static/build/shared/utils.js +2 -1
  221. package/static/build/shared/utils.js.map +1 -0
  222. package/static/build/token.js +3 -14
  223. package/static/build/token.js.map +1 -0
  224. package/static/build/validation/schedule.js +22 -19
  225. package/static/build/validation/schedule.js.map +1 -0
  226. package/static/build-info.json +754 -0
  227. package/static/dist/1089.0ecc5383.async.js.gz +0 -0
  228. package/static/dist/1174.41a43fee.async.js.gz +0 -0
  229. package/static/dist/119.89e2d610.async.js.gz +0 -0
  230. package/static/dist/1212.f87fd07a.async.js.gz +0 -0
  231. package/static/dist/1352.96a77e1d.async.js.gz +0 -0
  232. package/static/dist/1379.f91563a1.async.js.gz +0 -0
  233. package/static/dist/1571.94ddca13.async.js.gz +0 -0
  234. package/static/dist/1706.ac98cb3f.async.js.gz +0 -0
  235. package/static/dist/1765.5ac01a93.async.js.gz +0 -0
  236. package/static/dist/1836.f0b74cf1.async.js.gz +0 -0
  237. package/static/dist/1883.675b6a18.chunk.css.gz +0 -0
  238. package/static/dist/1885.b8f427bf.async.js.gz +0 -0
  239. package/static/dist/1887.9e0d3da8.async.js.gz +0 -0
  240. package/static/dist/1967.3f3945d0.async.js.gz +0 -0
  241. package/static/dist/198.db47fc1a.async.js.gz +0 -0
  242. package/static/dist/2325.dfa32834.async.js.gz +0 -0
  243. package/static/dist/2338.d678967d.async.js.gz +0 -0
  244. package/static/dist/2372.b5a50ee7.async.js +1 -0
  245. package/static/dist/2372.b5a50ee7.async.js.gz +0 -0
  246. package/static/dist/2476.4e9b0992.async.js.gz +0 -0
  247. package/static/dist/2537.2b262ee0.async.js.gz +0 -0
  248. package/static/dist/2577.aa8fe709.async.js.gz +0 -0
  249. package/static/dist/2635.d4c59d23.async.js.gz +0 -0
  250. package/static/dist/2664.e69530fb.async.js +1 -0
  251. package/static/dist/2664.e69530fb.async.js.gz +0 -0
  252. package/static/dist/2693.51c2636b.async.js.gz +0 -0
  253. package/static/dist/2808.cdc0995c.async.js.gz +0 -0
  254. package/static/dist/2821.651f31e5.async.js.gz +0 -0
  255. package/static/dist/2890.add55e85.async.js.gz +0 -0
  256. package/static/dist/2901.6d0de54e.async.js +1 -0
  257. package/static/dist/2901.6d0de54e.async.js.gz +0 -0
  258. package/static/dist/292.1b962b29.chunk.css.gz +0 -0
  259. package/static/dist/292.27ce781f.async.js +1 -0
  260. package/static/dist/292.27ce781f.async.js.gz +0 -0
  261. package/static/dist/300.08ac9875.async.js.gz +0 -0
  262. package/static/dist/3191.3b7e4b42.async.js +1 -0
  263. package/static/dist/3191.3b7e4b42.async.js.gz +0 -0
  264. package/static/dist/3382.a584a111.async.js.gz +0 -0
  265. package/static/dist/3383.041eee73.async.js.gz +0 -0
  266. package/static/dist/3512.95e41255.async.js +1 -0
  267. package/static/dist/3512.95e41255.async.js.gz +0 -0
  268. package/static/dist/3714.8d6dba9e.async.js.gz +0 -0
  269. package/static/dist/3906.a5eee612.async.js.gz +0 -0
  270. package/static/dist/3948.4fe809fd.async.js.gz +0 -0
  271. package/static/dist/4324.5a5887d1.async.js.gz +0 -0
  272. package/static/dist/4559.faab3673.async.js.gz +0 -0
  273. package/static/dist/4573.16f19278.async.js.gz +0 -0
  274. package/static/dist/{4736.1d2b5cb6.async.js → 4736.7c4c489b.async.js} +1 -1
  275. package/static/dist/4736.7c4c489b.async.js.gz +0 -0
  276. package/static/dist/4887.8e3ae573.async.js.gz +0 -0
  277. package/static/dist/4934.f3539d08.async.js.gz +0 -0
  278. package/static/dist/5077.cbd111cd.async.js.gz +0 -0
  279. package/static/dist/{5481.624d0e07.async.js → 5481.e2945a63.async.js} +1 -1
  280. package/static/dist/5481.e2945a63.async.js.gz +0 -0
  281. package/static/dist/5662.678b0cfb.async.js.gz +0 -0
  282. package/static/dist/5970.5862e59e.async.js +1 -0
  283. package/static/dist/5970.5862e59e.async.js.gz +0 -0
  284. package/static/dist/6013.db535339.async.js.gz +0 -0
  285. package/static/dist/6035.32ebfad9.async.js.gz +0 -0
  286. package/static/dist/6212.30a9c190.async.js +1 -0
  287. package/static/dist/6212.30a9c190.async.js.gz +0 -0
  288. package/static/dist/6341.673fb65c.async.js.gz +0 -0
  289. package/static/dist/6367.8b0e838c.async.js.gz +0 -0
  290. package/static/dist/6431.c50479be.async.js +1 -0
  291. package/static/dist/6569.55177f6a.async.js.gz +0 -0
  292. package/static/dist/6610.c111af7e.async.js.gz +0 -0
  293. package/static/dist/6638.87a163d2.async.js.gz +0 -0
  294. package/static/dist/6646.95e92533.async.js.gz +0 -0
  295. package/static/dist/{6872.a503ef55.async.js → 6872.fcc9ce17.async.js} +1 -1
  296. package/static/dist/6872.fcc9ce17.async.js.gz +0 -0
  297. package/static/dist/691.187a388c.async.js.gz +0 -0
  298. package/static/dist/7146.4dc150b1.async.js +1 -0
  299. package/static/dist/7146.4dc150b1.async.js.gz +0 -0
  300. package/static/dist/7231.f7e5b668.async.js.gz +0 -0
  301. package/static/dist/7253.4b9bf133.async.js.gz +0 -0
  302. package/static/dist/7278.96bf439f.async.js.gz +0 -0
  303. package/static/dist/7355.fca746f5.async.js.gz +0 -0
  304. package/static/dist/7384.1bb449d5.async.js.gz +0 -0
  305. package/static/dist/7508.3fffed15.chunk.css.gz +0 -0
  306. package/static/dist/7508.d90eac63.async.js.gz +0 -0
  307. package/static/dist/7802.34255805.async.js.gz +0 -0
  308. package/static/dist/7984.eaac7402.async.js.gz +0 -0
  309. package/static/dist/8033.5cb31493.async.js.gz +0 -0
  310. package/static/dist/8078.8586c875.async.js.gz +0 -0
  311. package/static/dist/8147.2fb55202.async.js.gz +0 -0
  312. package/static/dist/8187.48c130d6.async.js.gz +0 -0
  313. package/static/dist/8495.d53e15ca.async.js.gz +0 -0
  314. package/static/dist/8844.a0fef08e.async.js.gz +0 -0
  315. package/static/dist/9308.3202ac13.async.js.gz +0 -0
  316. package/static/dist/9323.a33f47da.async.js.gz +0 -0
  317. package/static/dist/965.8d9b1fbd.async.js +1 -0
  318. package/static/dist/965.8d9b1fbd.async.js.gz +0 -0
  319. package/static/dist/9761.360a19d8.async.js.gz +0 -0
  320. package/static/dist/index.html +2 -2
  321. package/static/dist/layouts__index.86b6bcbe.chunk.css +1 -0
  322. package/static/dist/layouts__index.86b6bcbe.chunk.css.gz +0 -0
  323. package/static/dist/layouts__index.c8e9788e.async.js +1 -0
  324. package/static/dist/layouts__index.c8e9788e.async.js.gz +0 -0
  325. package/static/dist/monaco-editor/min/vs/base/worker/workerMain.js.gz +0 -0
  326. package/static/dist/monaco-editor/min/vs/basic-languages/abap/abap.js.gz +0 -0
  327. package/static/dist/monaco-editor/min/vs/basic-languages/clojure/clojure.js.gz +0 -0
  328. package/static/dist/monaco-editor/min/vs/basic-languages/elixir/elixir.js.gz +0 -0
  329. package/static/dist/monaco-editor/min/vs/basic-languages/freemarker2/freemarker2.js.gz +0 -0
  330. package/static/dist/monaco-editor/min/vs/basic-languages/mysql/mysql.js.gz +0 -0
  331. package/static/dist/monaco-editor/min/vs/basic-languages/pgsql/pgsql.js.gz +0 -0
  332. package/static/dist/monaco-editor/min/vs/basic-languages/powerquery/powerquery.js.gz +0 -0
  333. package/static/dist/monaco-editor/min/vs/basic-languages/redshift/redshift.js.gz +0 -0
  334. package/static/dist/monaco-editor/min/vs/basic-languages/solidity/solidity.js.gz +0 -0
  335. package/static/dist/monaco-editor/min/vs/basic-languages/sql/sql.js.gz +0 -0
  336. package/static/dist/monaco-editor/min/vs/editor/editor.main.css.gz +0 -0
  337. package/static/dist/monaco-editor/min/vs/editor/editor.main.js.gz +0 -0
  338. package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.de.js.gz +0 -0
  339. package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.es.js.gz +0 -0
  340. package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.fr.js.gz +0 -0
  341. package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.it.js.gz +0 -0
  342. package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.ja.js.gz +0 -0
  343. package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.js.gz +0 -0
  344. package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.ko.js.gz +0 -0
  345. package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.ru.js.gz +0 -0
  346. package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.zh-cn.js.gz +0 -0
  347. package/static/dist/monaco-editor/min/vs/editor/editor.main.nls.zh-tw.js.gz +0 -0
  348. package/static/dist/monaco-editor/min/vs/language/css/cssMode.js.gz +0 -0
  349. package/static/dist/monaco-editor/min/vs/language/css/cssWorker.js.gz +0 -0
  350. package/static/dist/monaco-editor/min/vs/language/html/htmlMode.js.gz +0 -0
  351. package/static/dist/monaco-editor/min/vs/language/html/htmlWorker.js.gz +0 -0
  352. package/static/dist/monaco-editor/min/vs/language/json/jsonMode.js.gz +0 -0
  353. package/static/dist/monaco-editor/min/vs/language/json/jsonWorker.js.gz +0 -0
  354. package/static/dist/monaco-editor/min/vs/language/typescript/tsMode.js.gz +0 -0
  355. package/static/dist/monaco-editor/min/vs/language/typescript/tsWorker.js.gz +0 -0
  356. package/static/dist/monaco-editor/min/vs/loader.js.gz +0 -0
  357. package/static/dist/preload_helper.8b8f6581.js +1 -0
  358. package/static/dist/src__pages__404.3fd8332e.async.js +1 -0
  359. package/static/dist/src__pages__config__index.d18d8f95.async.js +1 -0
  360. package/static/dist/src__pages__crontab__detail.88729e8f.async.js +1 -0
  361. package/static/dist/src__pages__crontab__detail.88729e8f.async.js.gz +0 -0
  362. package/static/dist/src__pages__crontab__index.8aa9d297.async.js +1 -0
  363. package/static/dist/src__pages__crontab__index.8aa9d297.async.js.gz +0 -0
  364. package/static/dist/src__pages__crontab__logModal.930535e2.async.js.gz +0 -0
  365. package/static/dist/src__pages__crontab__modal.a2c8fdcc.async.js.gz +0 -0
  366. package/static/dist/src__pages__crontab__viewCreateModal.7b4f9cbe.async.js.gz +0 -0
  367. package/static/dist/src__pages__crontab__viewManageModal.cd454ea0.async.js.gz +0 -0
  368. package/static/dist/src__pages__dashboard__index.c05ce904.async.js +1 -0
  369. package/static/dist/src__pages__dashboard__index.c05ce904.async.js.gz +0 -0
  370. package/static/dist/src__pages__dependence__index.5b7fd97d.async.js +1 -0
  371. package/static/dist/src__pages__dependence__index.5b7fd97d.async.js.gz +0 -0
  372. package/static/dist/{src__pages__dependence__logModal.154efe7a.async.js → src__pages__dependence__logModal.01729f63.async.js} +1 -1
  373. package/static/dist/src__pages__dependence__logModal.01729f63.async.js.gz +0 -0
  374. package/static/dist/src__pages__dependence__modal.ef7ae53b.async.js +1 -0
  375. package/static/dist/src__pages__dependence__modal.ef7ae53b.async.js.gz +0 -0
  376. package/static/dist/src__pages__diff__index.4233ea93.async.js +1 -0
  377. package/static/dist/src__pages__diff__index.4233ea93.async.js.gz +0 -0
  378. package/static/dist/src__pages__env__index.eddb35bf.async.js +1 -0
  379. package/static/dist/src__pages__env__index.eddb35bf.async.js.gz +0 -0
  380. package/static/dist/src__pages__env__modal.4d71adb3.async.js.gz +0 -0
  381. package/static/dist/src__pages__error__index.66605c72.async.js +1 -0
  382. package/static/dist/src__pages__initialization__index.9c1c5b76.async.js +1 -0
  383. package/static/dist/src__pages__initialization__index.9c1c5b76.async.js.gz +0 -0
  384. package/static/dist/src__pages__log__index.71250e0d.async.js.gz +0 -0
  385. package/static/dist/src__pages__login__index.58bb4b38.async.js +1 -0
  386. package/static/dist/src__pages__login__index.58bb4b38.async.js.gz +0 -0
  387. package/static/dist/src__pages__script__components__UnsupportedFilePreview__index.c347a13a.async.js.gz +0 -0
  388. package/static/dist/src__pages__script__editModal.d15f8d78.async.js +1 -0
  389. package/static/dist/src__pages__script__editModal.d15f8d78.async.js.gz +0 -0
  390. package/static/dist/src__pages__script__editNameModal.789ad87b.async.js +1 -0
  391. package/static/dist/src__pages__script__editNameModal.789ad87b.async.js.gz +0 -0
  392. package/static/dist/src__pages__script__historyDrawer.8c58d958.async.js +1 -0
  393. package/static/dist/src__pages__script__historyDrawer.8c58d958.async.js.gz +0 -0
  394. package/static/dist/src__pages__script__historyDrawer.a449193a.chunk.css +1 -0
  395. package/static/dist/src__pages__script__index.96a6d30f.async.js +1 -0
  396. package/static/dist/src__pages__script__index.96a6d30f.async.js.gz +0 -0
  397. package/static/dist/src__pages__script__index.ab360776.chunk.css +1 -0
  398. package/static/dist/src__pages__script__saveModal.8fca1a22.async.js +1 -0
  399. package/static/dist/src__pages__script__saveWithHistory.99ece830.async.js +1 -0
  400. package/static/dist/{src__pages__setting__about.e6db5090.chunk.css → src__pages__setting__about.0d6ea255.chunk.css} +1 -1
  401. package/static/dist/src__pages__setting__about.3d3c019f.async.js.gz +0 -0
  402. package/static/dist/src__pages__setting__checkUpdate.429a42f3.async.js +1 -0
  403. package/static/dist/src__pages__setting__checkUpdate.429a42f3.async.js.gz +0 -0
  404. package/static/dist/src__pages__setting__clientIp.3a8711ed.async.js.gz +0 -0
  405. package/static/dist/{src__pages__setting__dependence.28ecea01.chunk.css → src__pages__setting__dependence.80b183a5.chunk.css} +1 -1
  406. package/static/dist/src__pages__setting__dependence.c227c0f5.async.js +1 -0
  407. package/static/dist/src__pages__setting__dependence.c227c0f5.async.js.gz +0 -0
  408. package/static/dist/src__pages__setting__index.274ad415.async.js +1 -0
  409. package/static/dist/src__pages__setting__index.274ad415.async.js.gz +0 -0
  410. package/static/dist/{src__pages__setting__index.7cf46d4a.chunk.css → src__pages__setting__index.46315660.chunk.css} +1 -1
  411. package/static/dist/src__pages__setting__loginLog.ef135f19.async.js +1 -0
  412. package/static/dist/src__pages__setting__loginLog.ef135f19.async.js.gz +0 -0
  413. package/static/dist/src__pages__setting__notifyLog.5ef5b578.async.js +1 -0
  414. package/static/dist/src__pages__setting__notifyLog.5ef5b578.async.js.gz +0 -0
  415. package/static/dist/{src__pages__setting__other.28ecea01.chunk.css → src__pages__setting__notifyLog.80b183a5.chunk.css} +1 -1
  416. package/static/dist/src__pages__setting__other.80b183a5.chunk.css +1 -0
  417. package/static/dist/src__pages__setting__other.e744c0d1.async.js +1 -0
  418. package/static/dist/src__pages__setting__other.e744c0d1.async.js.gz +0 -0
  419. package/static/dist/src__pages__setting__security.e2d71ebb.async.js.gz +0 -0
  420. package/static/dist/src__pages__setting__systemLog.000bcb5e.async.js +1 -0
  421. package/static/dist/src__pages__setting__systemLog.000bcb5e.async.js.gz +0 -0
  422. package/static/dist/src__pages__subscription__index.f556ae4c.async.js +1 -0
  423. package/static/dist/src__pages__subscription__index.f556ae4c.async.js.gz +0 -0
  424. package/static/dist/src__pages__subscription__logModal.cdba5139.async.js.gz +0 -0
  425. package/static/dist/src__pages__subscription__modal.8f04f506.async.js +1 -0
  426. package/static/dist/umi.73936e34.js +1 -0
  427. package/static/dist/umi.73936e34.js.gz +0 -0
  428. package/static/dist/umi.a4d14b92.css.gz +0 -0
  429. package/version.yaml +11 -19
  430. package/.dockerignore +0 -13
  431. package/AGENTS.md +0 -43
  432. package/SECURITY.md +0 -5
  433. package/back/protos/cron.proto +0 -29
  434. package/back/protos/health.proto +0 -22
  435. package/deploy/kubernetes/README.md +0 -81
  436. package/deploy/kubernetes/base/kustomization.yaml +0 -5
  437. package/deploy/kubernetes/base/qinglong.yaml +0 -95
  438. package/deploy/kubernetes/overlays/example/kustomization.yaml +0 -10
  439. package/docker/Dockerfile +0 -113
  440. package/docker/Dockerfile.310 +0 -113
  441. package/docker/Dockerfile.debian +0 -128
  442. package/docker/Dockerfile.debian310 +0 -130
  443. package/docker/build-manifest.cjs +0 -28
  444. package/docker/docker-compose.yml +0 -10
  445. package/docker/docker-entrypoint.sh +0 -147
  446. package/docker/verify-build.cjs +0 -49
  447. package/docs/PROJECT_ARCHITECTURE.md +0 -550
  448. package/docs/releases/2.22.0-validation.md +0 -49
  449. package/docs/releases/2.22.0.md +0 -54
  450. package/sample/tool.ts +0 -40
  451. package/scripts/benchmark-execution.cjs +0 -96
  452. package/scripts/write-build-info.cjs +0 -27
  453. package/shell/pub.sh +0 -28
  454. package/static/dist/2096.6d98fd12.async.js +0 -1
  455. package/static/dist/255.8a80b983.async.js +0 -1
  456. package/static/dist/2901.2ca95295.async.js +0 -1
  457. package/static/dist/3600.7637c822.async.js +0 -1
  458. package/static/dist/445.a65ff63b.async.js +0 -1
  459. package/static/dist/4859.97d6653c.async.js +0 -1
  460. package/static/dist/5970.d3a6e7bd.async.js +0 -1
  461. package/static/dist/6212.9e6d9913.async.js +0 -1
  462. package/static/dist/6431.4603ad0e.async.js +0 -1
  463. package/static/dist/6707.801b886b.async.js +0 -1
  464. package/static/dist/9066.605168f8.async.js +0 -1
  465. package/static/dist/9313.37acaf13.async.js +0 -1
  466. package/static/dist/layouts__index.633d3553.async.js +0 -1
  467. package/static/dist/layouts__index.adf0692f.chunk.css +0 -1
  468. package/static/dist/preload_helper.cf7de3fa.js +0 -1
  469. package/static/dist/src__pages__404.771168fc.async.js +0 -1
  470. package/static/dist/src__pages__config__index.9aba4054.async.js +0 -1
  471. package/static/dist/src__pages__crontab__detail.86b2eebb.async.js +0 -1
  472. package/static/dist/src__pages__crontab__index.ae4e06f2.async.js +0 -1
  473. package/static/dist/src__pages__dashboard__index.243c5a35.async.js +0 -1
  474. package/static/dist/src__pages__dependence__index.874d501f.async.js +0 -1
  475. package/static/dist/src__pages__dependence__modal.a29c1a0f.async.js +0 -1
  476. package/static/dist/src__pages__diff__index.1714b941.async.js +0 -1
  477. package/static/dist/src__pages__env__index.fd6fd2b0.async.js +0 -1
  478. package/static/dist/src__pages__error__index.aae50c94.async.js +0 -1
  479. package/static/dist/src__pages__initialization__index.82a2e967.async.js +0 -1
  480. package/static/dist/src__pages__login__index.a0fd5ed8.async.js +0 -1
  481. package/static/dist/src__pages__script__editModal.22acdf7c.async.js +0 -1
  482. package/static/dist/src__pages__script__editNameModal.1a521cc0.async.js +0 -1
  483. package/static/dist/src__pages__script__index.60b6f827.chunk.css +0 -1
  484. package/static/dist/src__pages__script__index.a18b2692.async.js +0 -1
  485. package/static/dist/src__pages__script__saveModal.8965b74c.async.js +0 -1
  486. package/static/dist/src__pages__setting__checkUpdate.d175b154.async.js +0 -1
  487. package/static/dist/src__pages__setting__dependence.9c0f749b.async.js +0 -1
  488. package/static/dist/src__pages__setting__index.cb397741.async.js +0 -1
  489. package/static/dist/src__pages__setting__loginLog.e0a1f54d.async.js +0 -1
  490. package/static/dist/src__pages__setting__other.3d0b8492.async.js +0 -1
  491. package/static/dist/src__pages__setting__systemLog.b3046955.async.js +0 -1
  492. package/static/dist/src__pages__subscription__index.43086a06.async.js +0 -1
  493. package/static/dist/src__pages__subscription__modal.38991e1e.async.js +0 -1
  494. package/static/dist/umi.fc019050.js +0 -1
  495. package/test/back/auth-security.test.cjs +0 -74
  496. package/test/back/build-provenance.test.cjs +0 -150
  497. package/test/back/cron-log-name.test.cjs +0 -110
  498. package/test/back/cron-validation.test.cjs +0 -45
  499. package/test/back/dashboard-failures.test.cjs +0 -173
  500. package/test/back/database-bootstrap.test.cjs +0 -193
  501. package/test/back/dependence-cache-status.test.cjs +0 -125
  502. package/test/back/deprecated-file-routes.test.cjs +0 -82
  503. package/test/back/ecosystem.test.cjs +0 -28
  504. package/test/back/env-name-parsing.test.cjs +0 -96
  505. package/test/back/execution-lifecycle.test.cjs +0 -236
  506. package/test/back/file-access-security.test.cjs +0 -47
  507. package/test/back/fileTreeListing.test.cjs +0 -57
  508. package/test/back/grpc-cron-response.test.cjs +0 -60
  509. package/test/back/http-exclusive-listen.test.cjs +0 -31
  510. package/test/back/http-security.test.cjs +0 -213
  511. package/test/back/listen-security.test.cjs +0 -67
  512. package/test/back/log-path-security.test.cjs +0 -158
  513. package/test/back/logReader.test.cjs +0 -72
  514. package/test/back/manual-execution.test.cjs +0 -85
  515. package/test/back/manual-stop-claim.test.cjs +0 -220
  516. package/test/back/metrics.test.cjs +0 -34
  517. package/test/back/monitoring.test.cjs +0 -73
  518. package/test/back/node-path-cache.test.cjs +0 -173
  519. package/test/back/node-path-lock.test.cjs +0 -178
  520. package/test/back/npm-publication.test.cjs +0 -70
  521. package/test/back/primary-apm.test.cjs +0 -24
  522. package/test/back/process-exit-state.test.cjs +0 -81
  523. package/test/back/process-stop-signal.test.cjs +0 -77
  524. package/test/back/protected-path-case.test.cjs +0 -58
  525. package/test/back/qlServiceLogCommand.test.cjs +0 -128
  526. package/test/back/retention.test.cjs +0 -131
  527. package/test/back/role-loading.test.cjs +0 -118
  528. package/test/back/schedule-health.test.cjs +0 -86
  529. package/test/back/scheduler-file-lock.test.cjs +0 -51
  530. package/test/back/scheduler-mutation.test.cjs +0 -312
  531. package/test/back/scheduler-readiness.test.cjs +0 -85
  532. package/test/back/scheduler-reconciliation.test.cjs +0 -152
  533. package/test/back/scheduler-rpc-timeout.test.cjs +0 -49
  534. package/test/back/schema-migrations.test.cjs +0 -127
  535. package/test/back/shell-api-parsing.test.cjs +0 -184
  536. package/test/back/sock-polling.test.cjs +0 -297
  537. package/test/back/sock-security.test.cjs +0 -72
  538. package/test/back/start-env-preservation.test.cjs +0 -53
  539. package/test/back/stop-failure-feedback.test.cjs +0 -158
  540. package/test/back/stop-race.test.cjs +0 -167
  541. package/test/back/subscription-cleanup.test.cjs +0 -53
  542. package/test/back/subscription-stop-state.test.cjs +0 -66
  543. package/test/back/system-dependence-cache.test.cjs +0 -126
  544. package/test/back/task-time.test.cjs +0 -116
  545. package/test/back/user-api.test.cjs +0 -99
  546. package/test/back/user-security.test.cjs +0 -248
  547. package/test/back/worker-apm.test.cjs +0 -84
  548. package/test/back/wpush-grpc.test.cjs +0 -115
  549. package/test/front/cron-log-pagination.test.cjs +0 -214
  550. package/test/front/http-auth.test.cjs +0 -152
  551. package/test/front/http-error.test.cjs +0 -29
  552. package/test/helpers/load-security-module.cjs +0 -42
  553. /package/static/dist/{4859.1b962b29.chunk.css → 292.1b962b29.chunk.css} +0 -0
package/.env.example CHANGED
@@ -21,3 +21,6 @@ JWT_EXPIRES_IN=
21
21
  QINIU_AK=
22
22
  QINIU_SK=
23
23
  QINIU_SCOPE=
24
+
25
+ # Python 虚拟环境路径,留空则使用系统 Python
26
+ # PYTHON_VENV_DIR=./.venv
package/README-NODE.md ADDED
@@ -0,0 +1,10 @@
1
+ # Node.js 原生部署与 Python venv
2
+
3
+ 设置 `QL_DIR` 为安装目录,`QL_DATA_DIR` 为以 `/data` 结尾的绝对持久化数据路径。
4
+ 如需隔离 Python,请在启动进程的环境中显式设置 `PYTHON_VENV_DIR`(绝对路径或相对 `QL_DIR` 的路径),例如 `export PYTHON_VENV_DIR=/srv/qinglong/.venv`。未设置时保留现有 Python prefix 行为。
5
+
6
+ - `qinglong`(`shell/start.sh`)安装系统依赖和 Node 工具,并安装 Python requests,然后调用公共启动脚本。
7
+ - `npm run start:simple`(`shell/start-simplify.sh`)使用已准备的 Node、pm2、nginx、jq 等依赖,不安装系统包、全局 npm 包或 requests;显式指定的 venv 不存在时仍会创建。请先在 venv 中安装 requests 和任务所需依赖。
8
+ - 两种启动方式均保留已有 `.env`;使用 venv 时清除继承的 `PYTHONPATH`/`PYTHONUSERBASE`,依赖查询、安装和卸载使用该 venv 的 Python。
9
+
10
+ 该模式需具备现有启动流程所要求的 nginx 配置和 pm2 服务权限。生产环境设置变量应通过 systemd 的 `Environment` 或相应进程配置完成。已有系统 Python 依赖不自动迁移至 venv,需在 venv 中重新安装。
@@ -260,6 +260,15 @@ message SystemNotifyRequest {
260
260
  optional NotificationInfo notificationInfo = 3;
261
261
  }
262
262
 
263
+ message RecordNotifyLogRequest {
264
+ string title = 1;
265
+ string content = 2;
266
+ bool success = 3;
267
+ string notifyType = 4;
268
+ string scriptName = 5;
269
+ string taskId = 6;
270
+ }
271
+
263
272
  service Api {
264
273
  rpc GetEnvs(GetEnvsRequest) returns (EnvsResponse) {}
265
274
  rpc CreateEnv(CreateEnvRequest) returns (EnvsResponse) {}
@@ -271,6 +280,7 @@ service Api {
271
280
  rpc UpdateEnvNames(UpdateEnvNamesRequest) returns (Response) {}
272
281
  rpc GetEnvById(GetEnvByIdRequest) returns (EnvResponse) {}
273
282
  rpc SystemNotify(SystemNotifyRequest) returns (Response) {}
283
+ rpc RecordNotifyLog(RecordNotifyLogRequest) returns (Response) {}
274
284
  rpc GetCronDetail(CronDetailRequest) returns (CronDetailResponse) {}
275
285
  rpc CreateCron(CreateCronRequest) returns (CronResponse) {}
276
286
  rpc UpdateCron(UpdateCronRequest) returns (CronResponse) {}
@@ -0,0 +1,156 @@
1
+ # QingLong 2.x remote management CLI
2
+
3
+ [简体中文](README.md) | **English**
4
+
5
+
6
+ The npm and panel-internal entries both use the name `ql`, but have separate Commander command trees. The npm entry only calls remote APIs; the internal entry only runs local tools. Verify the absolute executable path and `--help` before use. Installing the npm package does not migrate the built-in Shell commands.
7
+
8
+ `@whyour/qinglong-cli` is a standalone npm client for the panel's open API. It registers only `ql`, for the currently supported OpenAPI resources. Local execution, repo/raw workers, reload/update/account recovery belong to the panel's internal tools and are excluded from npm. Development publishing is outside both command sets.
9
+
10
+ ## Installation and commands
11
+
12
+ Requires Node >=22.12; Node 24 is recommended. Commander is bundled with no additional runtime npm dependencies. There is no standalone CLI image.
13
+
14
+ ```sh
15
+ npm install -g @whyour/qinglong-cli
16
+ ql --help
17
+ # Temporary use without replacing an existing panel ql
18
+ npm exec --package=@whyour/qinglong-cli -- ql --help
19
+ ```
20
+
21
+ To build from source, use `npm ci --prefix cli` and `npm run build:cli`, then run `npm pack` in cli and install the local tgz. Global installation occupies the `ql` name. On a panel host use a separate npm prefix or `node /absolute/path/to/cli/dist/npm/ql.js`.
22
+
23
+ ```sh
24
+ ql login --url https://ql.example.com
25
+ ql auth status --json
26
+ ql task list --search example --page 1 --size 50 --json
27
+ ql task get 12 --json
28
+ ql task logs 12 --tail 200 --json
29
+ ql task run 12 --json
30
+ ql task stop 12 --json
31
+ ql auth status --scope subscriptions --json
32
+ ql subscription list --json
33
+ ql subscription get 5 --json
34
+ ql subscription run 5 --json
35
+ ql subscription stop 5 --json
36
+ ql subscription logs 5 --tail 200 --json
37
+ ql subscription enable 5 --json
38
+ ql subscription disable 5 --json
39
+ ql auth logout --json
40
+ ```
41
+
42
+ Use command `--help` and `QL_LANG=en` for English. Command names and JSON fields do not change with language. The npm CLI never interprets unknown task actions as local scripts and does not register a separate `task` executable.
43
+
44
+ ## Complete OpenAPI management
45
+
46
+ The CLI also supports task/subscription CRUD, application and secret management, environment variables, configuration, scripts, logs, dependencies, system, dashboard and user APIs. `ql api routes --json` lists all 143 active routes; three retired file-reading endpoints are excluded. CI compares the catalogue against backend routes. See the [complete bilingual reference](skills/qinglong-cli/references/openapi.md) for every command and payload.
47
+
48
+ ```sh
49
+ ql task create --name demo --command 'task demo.js' --schedule '0 0 * * *' --json
50
+ ql subscription create --type public-repo --url https://example.com/repo.git --alias demo --schedule-type crontab --schedule '0 0 * * *' --json
51
+ ql app create --name agent --scopes crons,subscriptions --show-secrets --json
52
+ ql env create --data @envs.json --json
53
+ ql api request PUT /open/crons/run --data '[12,13]' --json
54
+ ```
55
+
56
+ Use --data JSON/@file/- for bodies, --query for query objects, --file for uploads and --output for downloads. New commands support --timeout seconds. Existing command contracts remain; raw API requests expose all fields and batch operations. Downloads do not overwrite files. App secrets require --show-secrets; other raw resources may contain sensitive data.
57
+
58
+ Remote ql system commands call the target panel API. Local reload/reset tools remain excluded from npm.
59
+
60
+ ## Authentication
61
+
62
+ Protected requests use `Authorization: Bearer <token>`. Two credential sources are supported:
63
+
64
+ | Mode | Supply credentials | Persistence and refresh |
65
+ | --- | --- | --- |
66
+ | Application login | `ql login --url <panel-url>` prompts for Client ID / Client Secret; automation injects `QL_CLIENT_ID` and `QL_CLIENT_SECRET` | Exchanges credentials at `/open/auth/token`, saves credentials/token locally and refreshes expired tokens |
67
+ | Direct access token | Set `QL_URL` and `QL_ACCESS_TOKEN` together; accepts a valid application token or panel session token | Overrides saved configuration, is not persisted and is not refreshed |
68
+
69
+ ### Application login
70
+
71
+ Create a dedicated panel application with the required scopes, such as crons, subscriptions or envs. `login` and `auth login` are equivalent. Interactive login hides the Client Secret; secret command-line arguments are not supported.
72
+
73
+ ```sh
74
+ ql login --url https://ql.example.com
75
+ ql auth status --scope crons --json
76
+ # For automation, inject QL_CLIENT_ID and QL_CLIENT_SECRET before the same login command
77
+ ```
78
+
79
+ Credentials/token are stored in `~/.config/qinglong/cli.json`, a plaintext file owned by the current user with mode 0600. `QL_CLI_CONFIG` selects another file. Login validates application credentials, not every resource permission.
80
+
81
+ ### Direct access token
82
+
83
+ Inject QL_URL and QL_ACCESS_TOKEN through your terminal or CI credential settings, then invoke commands without login:
84
+
85
+ ```sh
86
+ ql auth status --scope apps --json
87
+ ql app list --json
88
+ ```
89
+
90
+ Both variables are required for protected commands; providing only one is a usage error. They take precedence over the file selected by QL_CLI_CONFIG. Running login still writes application configuration, but subsequent requests continue using the environment token. Run `unset QL_URL QL_ACCESS_TOKEN` in your own terminal to return to saved application credentials.
91
+
92
+ Application management requires apps permission or an authorized panel session. The current UI does not list every backend scope; the CLI never escalates automatically. Anonymous user login requires only QL_URL and accepts --data @credentials.json or --data -; the returned session is not automatically saved. A two-factor challenge (server 420) exits 3 and directs you to user two-factor-login with username/password/code in its JSON body. Do not put credentials in command arguments or chat.
93
+
94
+ ### Permissions, logout and failures
95
+
96
+ Auth status checks crons read permission by default. Use --scope subscriptions, --scope apps or another supported scope for that resource. A representative read does not prove permission for every write. The crons scope covers reads and execution.
97
+
98
+ Auth logout deletes only saved application configuration. It neither revokes server tokens nor clears QL_ACCESS_TOKEN from the parent environment, so direct-token access may continue. Revoke access through the panel's application/session management. Resetting an application secret invalidates its old tokens; login again with the new secret.
99
+
100
+ Use the panel root URL with any proxy prefix, without /open. Remote connections require HTTPS; loopback HTTP is allowed. Requests never follow redirects. The 2.x application token endpoint carries credentials in query parameters; avoid logging that query at the proxy. Operations are not replayed after 401/403. An expired direct token must be replaced; the CLI does not fall back to saved application credentials.
101
+
102
+ ## Tasks, subscriptions and output
103
+
104
+ Subscription commands include create/update/delete/list/get/run/stop/logs/enable/disable/status/log-files. Subscription lists return `{code:200,data:[...]}`, without task pagination. The subscription list/get commands omit repository URLs, fetch credentials, proxies and executable hooks; raw API responses and create/update results may contain sensitive fields. Logs are not automatically redacted.
105
+
106
+ Commands output pretty-printed JSON by default; `--json` produces a single line. Success goes to stdout and errors to stderr. Help with `--json` returns `{code:200,data:{help:"..."}}`.
107
+
108
+ - Task list: `{code:200,data:{data:[...tasks],total:123}}`. Default page size: 50; maximum: 200. Task fields retain server content.
109
+ - Task get: `{code:200,data:{id:12,...}}`.
110
+ - Logs: `{code:200,data:"log tail",logStatus:"completed",truncated:true}`. Default tail: 200 lines; maximum: 10000. `logStatus` is omitted when absent from the older API.
111
+ - Task run/stop: `{code:200,data:{taskId:12,action:"run",accepted:true}}`. Subscription run/stop/enable/disable use `subscriptionId`; CRUD and raw API operations retain their server response instead. Acceptance does not mean execution succeeded.
112
+ - Errors: `{code:1,message:"..."}`. Exit codes: 0 success, 1 API/network/configuration failure, 2 invalid arguments, 3 missing authentication, HTTP/API 401/403 or a two-factor challenge.
113
+
114
+ IDs must be positive integers. Each task run/stop request addresses one task. The 2.x API provides no separate run ID or idempotency key: an error may leave the outcome unknown. Inspect status before retrying. The CLI does not automatically retry HTTP requests.
115
+
116
+ Logs may belong to an earlier run; `completed` does not imply success. `--tail` truncates on the client and does not reduce server reads or network traffic. Neither task fields nor logs are automatically redacted.
117
+
118
+ ## Skill, build and validation
119
+
120
+ The package includes `skills/qinglong-cli`, covering all remote commands. Copy it to your agent's skill directory and verify the remote npm entry. It contains no credentials and does not replace server permissions.
121
+
122
+ Strict TypeScript and Commander provide shared parsing/output with separate remote and internal entries. `dist/npm/ql.js` is a self-contained remote bundle; its build graph rejects local operational modules. The npm file allowlist includes only the remote bundle/map, licenses, bilingual documentation and remote skill. The full dist tree is panel-internal and is not published to npm.
123
+
124
+ ```sh
125
+ npm ci --prefix cli
126
+ npm run check:cli
127
+ npm run test:cli
128
+ node cli/scripts/verify-package.cjs
129
+ ```
130
+
131
+ Tests cover requests, token refresh, output, errors, no automatic retries, permissions and isolated installation. Package verification installs the archive offline, verifies the sole ql executable and rejects local commands.
132
+
133
+ The CLI package workflow checks, builds and tests Node 22.12/24 on relevant PRs, develop/master pushes and manual runs. Node 24 uploads the archive verified by offline installation as `qinglong-cli-<commit>`. After both matrix jobs succeed, master pushes publish that exact archive to npm as latest, using GitHub Actions OIDC trusted publishing without an NPM_TOKEN secret. Manual runs publish only when run on master with publish enabled; PRs, develop and forks never publish. Configure the npm Trusted Publisher for repository `whyour/qinglong`, workflow `cli-package.yml`, with `npm publish` allowed. The panel package `@whyour/qinglong` separately trusts `build-docker-image.yml`. Publishing uses Node 24 with `id-token: write` granted only to the publish job. New packages need an initial publication before configuring their trusted publisher.
134
+
135
+ The CLI has an independent stable version in cli/package.json and cli/package-lock.json. Before releasing changes, run `npm version patch --prefix cli --no-git-tag-version` (or minor/major) and commit both files. Existing versions are skipped with a notice; registry failures stop publication. Only stable X.Y.Z versions are published by this workflow. Publication does not rebuild the verified archive or run package lifecycle scripts.
136
+
137
+ ## Panel-internal tools
138
+
139
+ Local execution, subscription synchronization and maintenance ship with panel source/builds, using the full internal dist tree and a separate `qinglong-local` skill. See `cli/LOCAL.md` and `cli/LOCAL.en.md` in the source checkout. An npm installation is not a valid QL_CLI_ROOT. Recovery/reload must run on the actual panel host or inside its container, using docker exec for Docker installations.
140
+
141
+ API task run returns acceptance; a local runner waits for script completion. Their elapsed times are different measurements. Compare the internal TS runner against Shell using identical configuration/scripts; remote API management has no equivalent old Shell management command.
142
+
143
+ ## Source layout
144
+
145
+ ```text
146
+ src/
147
+ entrypoints/ # Executable composition
148
+ remote/ # commands / api / auth
149
+ internal/ # commands / execution / subscription / maintenance / runtime / integration
150
+ compatibility/ # Legacy entry and argument adapters
151
+ shared/ # cli / i18n / response types and errors
152
+ ```
153
+
154
+ Shared code cannot import business modules. Remote and internal modules may only import their own area and shared code; integration tests enforce these boundaries. Each surface owns its command registry, passed into the shared Commander parser.
155
+
156
+ Tests follow the same areas under test/. `npm run test:cli` (repository root) or `npm test` (cli/) discovers the standard suites; test/linux remains an explicitly invoked container integration suite. scripts/entrypoints.cjs preserves existing dist executable paths and dist/local/entrypoints.js and cronEntrypoint.js. Moving sources does not require changing QL_CLI_ROOT or cron commands.
package/cli/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # QingLong 2.x 远程管理 CLI
2
+
3
+ **简体中文** | [English](README.en.md)
4
+
5
+
6
+ npm 与面板内部入口都叫 `ql`,但使用独立的 Commander 命令树:npm 入口只调用远程 API,内部入口只运行本机工具。使用前确认可执行文件的绝对路径和 `--help`;安装 npm 包不会迁移内置 Shell 命令。
7
+
8
+ `@whyour/qinglong-cli` 是独立 npm 包,覆盖当前 develop 的有效 OpenAPI,只注册一个 `ql` 命令。它不包含脚本执行器或本机运维实现;`task exec`、`repo/raw`、`reload/update/reset*` 等属于面板内部工具,不随 npm 包分发。开发发布也不属于 CLI 范围。
9
+
10
+ ## 安装与使用
11
+
12
+ 要求 Node >=22.12,推荐 Node 24。Commander 在构建时打包,无额外运行时 npm 依赖,不单独发布 CLI 镜像。
13
+
14
+ ```sh
15
+ npm install -g @whyour/qinglong-cli
16
+ ql --help
17
+ # 临时使用,不覆盖面板已有的 ql
18
+ npm exec --package=@whyour/qinglong-cli -- ql --help
19
+ ```
20
+
21
+ 也可以从源码构建:执行 `npm ci --prefix cli`、`npm run build:cli`,在 cli 目录执行 `npm pack`,然后安装本地 tgz。全局安装会占用 `ql` 名称;已有面板的机器建议使用独立 npm prefix 或直接执行 `node /absolute/path/to/cli/dist/npm/ql.js`。
22
+
23
+ ```sh
24
+ ql login --url https://ql.example.com
25
+ ql auth status --json
26
+ ql task list --search 示例 --page 1 --size 50 --json
27
+ ql task get 12 --json
28
+ ql task logs 12 --tail 200 --json
29
+ ql task run 12 --json
30
+ ql task stop 12 --json
31
+ ql auth status --scope subscriptions --json
32
+ ql subscription list --json
33
+ ql subscription get 5 --json
34
+ ql subscription run 5 --json
35
+ ql subscription stop 5 --json
36
+ ql subscription logs 5 --tail 200 --json
37
+ ql subscription enable 5 --json
38
+ ql subscription disable 5 --json
39
+ ql auth logout --json
40
+ ```
41
+
42
+ 各命令支持 `--help`,`QL_LANG=en` 切换英文帮助;命令和 JSON 字段不随语言变化。`ql task` 中只包含 API 操作,不会把无效命令解释为本机脚本,也不提供独立 `task` npm 入口。
43
+
44
+ ## 全量 OpenAPI 管理
45
+
46
+ 现在还支持任务/订阅创建、修改、删除,应用管理与密钥重置,以及环境变量、配置、脚本、日志、依赖、系统、仪表盘和用户管理。`ql api routes --json` 列出全部 143 条有效路由;3 条已下线文件读取接口不包含在内。新增命令在 [完整双语参考](skills/qinglong-cli/references/openapi.md) 中逐项列出,路由覆盖由 CI 与后端代码核对。
47
+
48
+ ```sh
49
+ ql task create --name demo --command 'task demo.js' --schedule '0 0 * * *' --json
50
+ ql subscription create --type public-repo --url https://example.com/repo.git --alias demo --schedule-type crontab --schedule '0 0 * * *' --json
51
+ ql app create --name agent --scopes crons,subscriptions --show-secrets --json
52
+ ql env create --data @envs.json --json
53
+ ql api request PUT /open/crons/run --data '[12,13]' --json
54
+ ```
55
+
56
+ 请求体使用 --data JSON/@file/-,查询使用 --query,上传 --file,下载 --output。新命令支持 --timeout 秒数;旧命令行为保留,完整参数可用 api request。下载不覆盖现有文件,应用密钥默认隐藏,明确加 --show-secrets 才输出。新增资源通常保留原始返回字段,注意环境、配置和会话信息可能敏感。
57
+
58
+ 远程 `ql system ...` 调用面板 API;本机 reload/reset 等仍不在 npm 包中。不要将远程 API 覆盖理解为本机运维重新混入包。
59
+
60
+ ## 认证
61
+
62
+ 受保护的请求均使用 `Authorization: Bearer <token>`,支持以下两种凭据来源:
63
+
64
+ | 方式 | 提供方式 | 保存与刷新 |
65
+ | --- | --- | --- |
66
+ | 应用凭据登录 | `ql login --url <面板地址>`,输入 Client ID / Client Secret;自动化通过 `QL_CLIENT_ID`、`QL_CLIENT_SECRET` 注入 | 通过 `/open/auth/token` 换取 token,凭据和 token 保存到本机,过期自动刷新 |
67
+ | 直接访问令牌 | 环境中同时设置 `QL_URL`、`QL_ACCESS_TOKEN`,支持有效应用 token 或面板会话 token | 优先于保存的配置,不落盘、不自动刷新 |
68
+
69
+ ### 应用凭据登录
70
+
71
+ 在面板创建专用应用,按需授予 crons、subscriptions、envs 等权限。`login` 与 `auth login` 等价;交互输入 Client ID 和不回显的 Client Secret,密钥不支持命令行参数。
72
+
73
+ ```sh
74
+ ql login --url https://ql.example.com
75
+ ql auth status --scope crons --json
76
+ # 自动化环境事先注入 QL_CLIENT_ID 和 QL_CLIENT_SECRET,再运行同一 login 命令
77
+ ```
78
+
79
+ 凭据和 token 保存到 `~/.config/qinglong/cli.json`,为当前用户所有的 0600 明文文件。`QL_CLI_CONFIG` 可选择其他配置文件。登录只验证应用凭据,不意味着具备所有资源权限。
80
+
81
+ ### 直接使用访问令牌
82
+
83
+ 在终端或 CI 的凭据配置中注入 `QL_URL` 与 `QL_ACCESS_TOKEN` 后,直接调用命令,无需再执行 login:
84
+
85
+ ```sh
86
+ ql auth status --scope apps --json
87
+ ql app list --json
88
+ ```
89
+
90
+ 两个变量必须同时提供给受保护命令;只提供一个会报参数错误。此方式优先于 `QL_CLI_CONFIG` 指定的配置。即使重新执行 login 写入了应用配置,后续请求仍使用环境令牌;切回保存的应用配置时,在自己的终端执行 `unset QL_URL QL_ACCESS_TOKEN`。
91
+
92
+ 应用管理需要 apps 权限或有效的授权面板会话;当前面板 UI 没有列出所有后端 scope,CLI 不自动提权。匿名 `user login` 可在仅设置 QL_URL 时使用 `--data @credentials.json` 或 `--data -` 提交凭据;返回的会话不会自动保存。启用双因素认证时,服务端 420 对应 CLI 退出码 3,随后使用 `user two-factor-login`,请求体包含 username/password/code。不要将凭据写入命令参数或聊天。
93
+
94
+ ### 权限检查、退出与失败
95
+
96
+ `auth status` 默认检查 crons 读取权限,可用 `--scope subscriptions`、`--scope apps` 等检查对应资源。它只验证代表性读取,不代表所有写操作都获授权。2.x 的 crons scope 同时覆盖读取和执行。
97
+
98
+ `auth logout` 仅删除本机应用配置,不撤销服务端 token,也不清除父进程中的 QL_ACCESS_TOKEN。令牌模式仍可能继续访问;如需撤销访问,使用面板提供的应用或会话管理。重置应用密钥会使旧应用 token 失效,需要使用新密钥重新 login。
99
+
100
+ URL 使用面板根地址,可包含代理路径前缀,不附加 `/open`。远程连接要求 HTTPS,回环地址允许 HTTP;不跟随重定向。2.x 应用 token 接口以查询参数传递凭据,代理应避免记录该查询字符串。401/403 不自动重放操作;直接令牌失效时需更换,CLI 不会转而使用保存的应用凭据。
101
+
102
+ ## 输出契约
103
+
104
+ 订阅支持 create/update/delete/list/get/run/stop/logs/enable/disable/status/log-files。`subscription list/get` 保留管理字段投影;run/stop/enable/disable 返回 subscriptionId/action/accepted。创建、修改、删除及通用 API 请求保留服务端响应,可能包含敏感字段;不能将所有变更都解释为 accepted。
105
+
106
+ 命令默认输出缩进 JSON,`--json` 输出单行 JSON;成功写 stdout,错误写 stderr,互不混用。帮助在 `--json` 下也使用 `{code:200,data:{help:"..."}}`。
107
+
108
+ - `task list`:`{code:200,data:{data:[...tasks],total:123}}`,默认每页 50,最多 200;任务字段保留服务端内容。
109
+ - `task get`:`{code:200,data:{id:12,...}}`。
110
+ - `task logs`:`{code:200,data:"日志尾部",logStatus:"completed",truncated:true}`。默认 200 行,最多 10000;旧接口若不返回 logStatus,该字段省略。
111
+ - `task run/stop`:`{code:200,data:{taskId:12,action:"run",accepted:true}}`。仅表示请求被接受,不表示任务成功完成。
112
+ - 错误:`{code:1,message:"..."}`;退出码 1 为 API/网络/配置错误,2 为参数错误,3 为未登录、HTTP/API 401/403 或需要双因素验证;成功退出码 0。
113
+
114
+ ID 必须为正整数,运行/停止一次操作一个任务。2.x 没有为此提供独立运行 ID 或幂等键,失败响应可能意味着执行结果未知,应先查询状态,禁止盲目重试。CLI 不自动重试 HTTP 请求。
115
+
116
+ 日志是该任务最新日志,可能属于先前运行;`completed` 不代表成功。`--tail` 在客户端截取,不减少服务端读取量或网络传输量。日志与任务字段不自动脱敏,应按需读取并避免向聊天中暴露敏感信息。
117
+
118
+ ## Skill、构建与验证
119
+
120
+ npm 包附带 `skills/qinglong-cli`,覆盖全部远程命令。复制到所用 Agent 的 skills 目录,并确认使用 npm 远程入口。Skill 不存放凭据,也不替代服务端权限。
121
+
122
+ 源码使用 TypeScript 严格检查和 Commander 解析;共用参数/输出逻辑,分别构建远程入口和面板内部入口。`dist/npm/ql.js` 是可独立运行的远程 bundle,构建依赖图会拒绝引入本机运维模块;npm 文件白名单仅包含该 bundle、source map、许可证、中英文说明和远程 Skill。完整 `dist` 用于面板内部构建,不随 npm 发布。
123
+
124
+ ```sh
125
+ npm ci --prefix cli
126
+ npm run check:cli
127
+ npm run test:cli
128
+ node cli/scripts/verify-package.cjs
129
+ ```
130
+
131
+ 测试覆盖请求格式、认证刷新、输出、错误、禁止自动重试、权限和独立安装。打包验证会离线安装 tgz,并确认唯一入口是 `ql`,本机命令不可调用。
132
+
133
+ CLI package 工作流在相关 PR、develop/master 推送和手动触发时执行 Node 22.12/24 类型检查、构建及测试。Node 24 上传通过离线安装验证的 `qinglong-cli-<commit>` artifact。两个矩阵任务成功后,master 推送会将这份已验证的 tgz 发布到 npm 的 latest 标签,通过 GitHub Actions OIDC 可信发布,无需 `NPM_TOKEN` Secret。手动运行需选择 master 并勾选 publish;PR、develop 和 fork 不发布。npm 的 Trusted Publisher 需绑定仓库 `whyour/qinglong` 和工作流 `cli-package.yml`,允许 `npm publish`;面板包 `@whyour/qinglong` 单独绑定 `build-docker-image.yml`。发布 job 使用 Node 24,并仅在该 job 授予 `id-token: write`。新包需先完成首次发布,再配置对应包的可信发布关系。
134
+
135
+ CLI 版本独立维护在 cli/package.json 和 cli/package-lock.json。发布改动前执行 `npm version patch --prefix cli --no-git-tag-version`(也可用 minor/major),提交这两个文件。已发布的版本会提示并跳过;registry 查询失败则停止发布。该流程仅发布 X.Y.Z 稳定版本,不重新构建产物或执行包生命周期脚本。
136
+
137
+ ## 面板内部工具
138
+
139
+ 本机执行、订阅同步和运维随面板源码/构建交付,使用完整内部 `dist` 与独立 `qinglong-local` Skill;源码说明见 `cli/LOCAL.md` 和 `cli/LOCAL.en.md`。npm 包不能用作 `QL_CLI_ROOT`。账号恢复、服务重载必须在实际面板宿主机或容器中执行;Docker 使用 `docker exec` 调用容器内选定入口。
140
+
141
+ API `task run` 返回请求接受,本机执行器等待脚本结束,二者耗时不能直接对比。Shell 迁移性能应比较相同配置和脚本下的内部 TS 执行器与原 Shell;远程 API 操作没有对应的旧 Shell 管理命令。
142
+
143
+ ## 源码结构
144
+
145
+ ```text
146
+ src/
147
+ entrypoints/ # 可执行入口组装
148
+ remote/ # commands / api / auth
149
+ internal/ # commands / execution / subscription / maintenance / runtime / integration
150
+ compatibility/ # 旧入口和参数适配
151
+ shared/ # cli / i18n / 响应类型与错误
152
+ ```
153
+
154
+ shared 不能引用业务模块;remote 与 internal 只能引用各自区域及 shared,集成测试检查这些依赖边界。两套业务注册表分别注入共享 Commander 解析器。
155
+
156
+ 测试按同样的区域分组。仓库根目录 `npm run test:cli` 或 cli/ 下 `npm test` 自动发现标准测试;test/linux 保持为显式执行的容器集成测试。scripts/entrypoints.cjs 保留现有 dist 可执行入口,以及 dist/local/entrypoints.js、cronEntrypoint.js;移动源码不要求修改 QL_CLI_ROOT 或 cron 命令。
@@ -0,0 +1,18 @@
1
+ // Node 24's ARMv6 JS compiler tiers can trap on ARM1176. Keep WebAssembly
2
+ // enabled for fetch/undici; --jitless disables their HTTP parser as well.
3
+ const armv6ServerArgs = Object.freeze([
4
+ '--no-opt',
5
+ '--no-sparkplug',
6
+ '--no-maglev',
7
+ ]);
8
+ function serverRuntimeArgs(runtime = process) {
9
+ return runtime.arch === 'arm' &&
10
+ Number(runtime.config.variables.arm_version) === 6 &&
11
+ Number(runtime.versions.node.split('.')[0]) >= 24
12
+ ? [...armv6ServerArgs]
13
+ : [];
14
+ }
15
+
16
+ module.exports = { serverRuntimeArgs, armv6ServerArgs };
17
+ if (require.main === module)
18
+ process.stdout.write(serverRuntimeArgs().join(' '));