nodebbs 0.3.3 → 0.4.2
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/README.md +22 -17
- package/dist/commands/backup/all.d.ts +9 -0
- package/dist/commands/backup/all.js +71 -0
- package/dist/commands/{db/backup.d.ts → backup/db.d.ts} +1 -1
- package/dist/commands/{db/backup.js → backup/db.js} +8 -8
- package/dist/commands/backup/uploads.d.ts +13 -0
- package/dist/commands/backup/uploads.js +116 -0
- package/dist/commands/clean/index.d.ts +1 -1
- package/dist/commands/clean/index.js +12 -12
- package/dist/commands/db/reset.js +4 -4
- package/dist/commands/import/all.d.ts +9 -0
- package/dist/commands/import/all.js +123 -0
- package/dist/commands/{db/import.d.ts → import/db.d.ts} +1 -1
- package/dist/commands/{db/import.js → import/db.js} +16 -22
- package/dist/commands/import/uploads.d.ts +13 -0
- package/dist/commands/import/uploads.js +141 -0
- package/dist/commands/logs/all.js +2 -2
- package/dist/commands/logs/api.js +2 -2
- package/dist/commands/logs/db.js +1 -1
- package/dist/commands/logs/redis.js +1 -1
- package/dist/commands/logs/web.js +1 -1
- package/dist/commands/pack/index.js +30 -27
- package/dist/commands/restart/index.js +6 -8
- package/dist/commands/shell/api.js +1 -1
- package/dist/commands/shell/db.js +2 -2
- package/dist/commands/shell/redis.js +2 -2
- package/dist/commands/shell/web.js +1 -1
- package/dist/commands/start/index.d.ts +1 -1
- package/dist/commands/start/index.js +12 -22
- package/dist/commands/status/index.js +2 -2
- package/dist/commands/stop/index.d.ts +1 -1
- package/dist/commands/stop/index.js +7 -7
- package/dist/commands/upgrade/index.js +5 -5
- package/dist/interactive.js +28 -28
- package/dist/templates/config.yml +22 -0
- package/dist/templates/docker-compose.yml +3 -13
- package/dist/templates/env +1 -2
- package/dist/utils/docker.js +28 -20
- package/dist/utils/env.d.ts +1 -1
- package/dist/utils/env.js +40 -42
- package/dist/utils/logger.d.ts +2 -2
- package/dist/utils/logger.js +8 -8
- package/dist/utils/selection.d.ts +2 -2
- package/dist/utils/selection.js +7 -10
- package/oclif.manifest.json +213 -67
- package/package.json +9 -3
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,121 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
+
"backup:all": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "一键备份全部数据",
|
|
7
|
+
"flags": {
|
|
8
|
+
"env": {
|
|
9
|
+
"char": "e",
|
|
10
|
+
"description": "运行环境 (production, lowmem, default)",
|
|
11
|
+
"name": "env",
|
|
12
|
+
"hasDynamicHelp": false,
|
|
13
|
+
"multiple": false,
|
|
14
|
+
"options": [
|
|
15
|
+
"production",
|
|
16
|
+
"lowmem",
|
|
17
|
+
"default"
|
|
18
|
+
],
|
|
19
|
+
"type": "option"
|
|
20
|
+
},
|
|
21
|
+
"output": {
|
|
22
|
+
"char": "o",
|
|
23
|
+
"description": "输出目录路径",
|
|
24
|
+
"name": "output",
|
|
25
|
+
"hasDynamicHelp": false,
|
|
26
|
+
"multiple": false,
|
|
27
|
+
"type": "option"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"hasDynamicHelp": false,
|
|
31
|
+
"hiddenAliases": [],
|
|
32
|
+
"id": "backup:all",
|
|
33
|
+
"pluginAlias": "nodebbs",
|
|
34
|
+
"pluginName": "nodebbs",
|
|
35
|
+
"pluginType": "core",
|
|
36
|
+
"strict": true,
|
|
37
|
+
"enableJsonFlag": false,
|
|
38
|
+
"isESM": true,
|
|
39
|
+
"relativePath": [
|
|
40
|
+
"dist",
|
|
41
|
+
"commands",
|
|
42
|
+
"backup",
|
|
43
|
+
"all.js"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"backup:db": {
|
|
47
|
+
"aliases": [],
|
|
48
|
+
"args": {},
|
|
49
|
+
"description": "备份数据库",
|
|
50
|
+
"flags": {
|
|
51
|
+
"env": {
|
|
52
|
+
"char": "e",
|
|
53
|
+
"description": "部署环境 (production, lowmem, default)",
|
|
54
|
+
"name": "env",
|
|
55
|
+
"hasDynamicHelp": false,
|
|
56
|
+
"multiple": false,
|
|
57
|
+
"options": [
|
|
58
|
+
"production",
|
|
59
|
+
"lowmem",
|
|
60
|
+
"default"
|
|
61
|
+
],
|
|
62
|
+
"type": "option"
|
|
63
|
+
},
|
|
64
|
+
"output": {
|
|
65
|
+
"char": "o",
|
|
66
|
+
"description": "输出文件路径",
|
|
67
|
+
"name": "output",
|
|
68
|
+
"hasDynamicHelp": false,
|
|
69
|
+
"multiple": false,
|
|
70
|
+
"type": "option"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"hasDynamicHelp": false,
|
|
74
|
+
"hiddenAliases": [],
|
|
75
|
+
"id": "backup:db",
|
|
76
|
+
"pluginAlias": "nodebbs",
|
|
77
|
+
"pluginName": "nodebbs",
|
|
78
|
+
"pluginType": "core",
|
|
79
|
+
"strict": true,
|
|
80
|
+
"enableJsonFlag": false,
|
|
81
|
+
"isESM": true,
|
|
82
|
+
"relativePath": [
|
|
83
|
+
"dist",
|
|
84
|
+
"commands",
|
|
85
|
+
"backup",
|
|
86
|
+
"db.js"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"backup:uploads": {
|
|
90
|
+
"aliases": [],
|
|
91
|
+
"args": {},
|
|
92
|
+
"description": "备份上传文件",
|
|
93
|
+
"flags": {
|
|
94
|
+
"output": {
|
|
95
|
+
"char": "o",
|
|
96
|
+
"description": "输出文件路径 (.tar.gz)",
|
|
97
|
+
"name": "output",
|
|
98
|
+
"hasDynamicHelp": false,
|
|
99
|
+
"multiple": false,
|
|
100
|
+
"type": "option"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"hasDynamicHelp": false,
|
|
104
|
+
"hiddenAliases": [],
|
|
105
|
+
"id": "backup:uploads",
|
|
106
|
+
"pluginAlias": "nodebbs",
|
|
107
|
+
"pluginName": "nodebbs",
|
|
108
|
+
"pluginType": "core",
|
|
109
|
+
"strict": true,
|
|
110
|
+
"enableJsonFlag": false,
|
|
111
|
+
"isESM": true,
|
|
112
|
+
"relativePath": [
|
|
113
|
+
"dist",
|
|
114
|
+
"commands",
|
|
115
|
+
"backup",
|
|
116
|
+
"uploads.js"
|
|
117
|
+
]
|
|
118
|
+
},
|
|
3
119
|
"clean": {
|
|
4
120
|
"aliases": [],
|
|
5
121
|
"args": {},
|
|
@@ -18,12 +134,6 @@
|
|
|
18
134
|
"allowNo": false,
|
|
19
135
|
"type": "boolean"
|
|
20
136
|
},
|
|
21
|
-
"images": {
|
|
22
|
-
"description": "清理无用镜像 (dangling)",
|
|
23
|
-
"name": "images",
|
|
24
|
-
"allowNo": false,
|
|
25
|
-
"type": "boolean"
|
|
26
|
-
},
|
|
27
137
|
"env": {
|
|
28
138
|
"description": "清理环境锁定 (Environment Lock)",
|
|
29
139
|
"name": "env",
|
|
@@ -36,6 +146,12 @@
|
|
|
36
146
|
"name": "force",
|
|
37
147
|
"allowNo": false,
|
|
38
148
|
"type": "boolean"
|
|
149
|
+
},
|
|
150
|
+
"images": {
|
|
151
|
+
"description": "清理无用镜像 (dangling)",
|
|
152
|
+
"name": "images",
|
|
153
|
+
"allowNo": false,
|
|
154
|
+
"type": "boolean"
|
|
39
155
|
}
|
|
40
156
|
},
|
|
41
157
|
"hasDynamicHelp": false,
|
|
@@ -54,10 +170,10 @@
|
|
|
54
170
|
"index.js"
|
|
55
171
|
]
|
|
56
172
|
},
|
|
57
|
-
"db:
|
|
173
|
+
"db:push": {
|
|
58
174
|
"aliases": [],
|
|
59
175
|
"args": {},
|
|
60
|
-
"description": "
|
|
176
|
+
"description": "推送数据库 schema (db:push)",
|
|
61
177
|
"flags": {
|
|
62
178
|
"env": {
|
|
63
179
|
"char": "e",
|
|
@@ -71,19 +187,11 @@
|
|
|
71
187
|
"default"
|
|
72
188
|
],
|
|
73
189
|
"type": "option"
|
|
74
|
-
},
|
|
75
|
-
"output": {
|
|
76
|
-
"char": "o",
|
|
77
|
-
"description": "输出文件路径",
|
|
78
|
-
"name": "output",
|
|
79
|
-
"hasDynamicHelp": false,
|
|
80
|
-
"multiple": false,
|
|
81
|
-
"type": "option"
|
|
82
190
|
}
|
|
83
191
|
},
|
|
84
192
|
"hasDynamicHelp": false,
|
|
85
193
|
"hiddenAliases": [],
|
|
86
|
-
"id": "db:
|
|
194
|
+
"id": "db:push",
|
|
87
195
|
"pluginAlias": "nodebbs",
|
|
88
196
|
"pluginName": "nodebbs",
|
|
89
197
|
"pluginType": "core",
|
|
@@ -94,13 +202,13 @@
|
|
|
94
202
|
"dist",
|
|
95
203
|
"commands",
|
|
96
204
|
"db",
|
|
97
|
-
"
|
|
205
|
+
"push.js"
|
|
98
206
|
]
|
|
99
207
|
},
|
|
100
|
-
"db:
|
|
208
|
+
"db:reset": {
|
|
101
209
|
"aliases": [],
|
|
102
210
|
"args": {},
|
|
103
|
-
"description": "
|
|
211
|
+
"description": "重置数据库 (db:reset) - 危险操作!",
|
|
104
212
|
"flags": {
|
|
105
213
|
"env": {
|
|
106
214
|
"char": "e",
|
|
@@ -114,19 +222,11 @@
|
|
|
114
222
|
"default"
|
|
115
223
|
],
|
|
116
224
|
"type": "option"
|
|
117
|
-
},
|
|
118
|
-
"input": {
|
|
119
|
-
"char": "i",
|
|
120
|
-
"description": "输入文件路径",
|
|
121
|
-
"name": "input",
|
|
122
|
-
"hasDynamicHelp": false,
|
|
123
|
-
"multiple": false,
|
|
124
|
-
"type": "option"
|
|
125
225
|
}
|
|
126
226
|
},
|
|
127
227
|
"hasDynamicHelp": false,
|
|
128
228
|
"hiddenAliases": [],
|
|
129
|
-
"id": "db:
|
|
229
|
+
"id": "db:reset",
|
|
130
230
|
"pluginAlias": "nodebbs",
|
|
131
231
|
"pluginName": "nodebbs",
|
|
132
232
|
"pluginType": "core",
|
|
@@ -137,13 +237,13 @@
|
|
|
137
237
|
"dist",
|
|
138
238
|
"commands",
|
|
139
239
|
"db",
|
|
140
|
-
"
|
|
240
|
+
"reset.js"
|
|
141
241
|
]
|
|
142
242
|
},
|
|
143
|
-
"db:
|
|
243
|
+
"db:seed": {
|
|
144
244
|
"aliases": [],
|
|
145
245
|
"args": {},
|
|
146
|
-
"description": "
|
|
246
|
+
"description": "填充种子数据 (db:seed)",
|
|
147
247
|
"flags": {
|
|
148
248
|
"env": {
|
|
149
249
|
"char": "e",
|
|
@@ -161,7 +261,7 @@
|
|
|
161
261
|
},
|
|
162
262
|
"hasDynamicHelp": false,
|
|
163
263
|
"hiddenAliases": [],
|
|
164
|
-
"id": "db:
|
|
264
|
+
"id": "db:seed",
|
|
165
265
|
"pluginAlias": "nodebbs",
|
|
166
266
|
"pluginName": "nodebbs",
|
|
167
267
|
"pluginType": "core",
|
|
@@ -172,17 +272,25 @@
|
|
|
172
272
|
"dist",
|
|
173
273
|
"commands",
|
|
174
274
|
"db",
|
|
175
|
-
"
|
|
275
|
+
"seed.js"
|
|
176
276
|
]
|
|
177
277
|
},
|
|
178
|
-
"
|
|
278
|
+
"import:all": {
|
|
179
279
|
"aliases": [],
|
|
180
280
|
"args": {},
|
|
181
|
-
"description": "
|
|
281
|
+
"description": "一键恢复全部数据",
|
|
182
282
|
"flags": {
|
|
283
|
+
"dir": {
|
|
284
|
+
"char": "d",
|
|
285
|
+
"description": "备份目录路径 (包含 .sql 和 .tar.gz 文件)",
|
|
286
|
+
"name": "dir",
|
|
287
|
+
"hasDynamicHelp": false,
|
|
288
|
+
"multiple": false,
|
|
289
|
+
"type": "option"
|
|
290
|
+
},
|
|
183
291
|
"env": {
|
|
184
292
|
"char": "e",
|
|
185
|
-
"description": "
|
|
293
|
+
"description": "运行环境 (production, lowmem, default)",
|
|
186
294
|
"name": "env",
|
|
187
295
|
"hasDynamicHelp": false,
|
|
188
296
|
"multiple": false,
|
|
@@ -196,7 +304,7 @@
|
|
|
196
304
|
},
|
|
197
305
|
"hasDynamicHelp": false,
|
|
198
306
|
"hiddenAliases": [],
|
|
199
|
-
"id": "
|
|
307
|
+
"id": "import:all",
|
|
200
308
|
"pluginAlias": "nodebbs",
|
|
201
309
|
"pluginName": "nodebbs",
|
|
202
310
|
"pluginType": "core",
|
|
@@ -206,14 +314,14 @@
|
|
|
206
314
|
"relativePath": [
|
|
207
315
|
"dist",
|
|
208
316
|
"commands",
|
|
209
|
-
"
|
|
210
|
-
"
|
|
317
|
+
"import",
|
|
318
|
+
"all.js"
|
|
211
319
|
]
|
|
212
320
|
},
|
|
213
|
-
"db
|
|
321
|
+
"import:db": {
|
|
214
322
|
"aliases": [],
|
|
215
323
|
"args": {},
|
|
216
|
-
"description": "
|
|
324
|
+
"description": "导入数据库",
|
|
217
325
|
"flags": {
|
|
218
326
|
"env": {
|
|
219
327
|
"char": "e",
|
|
@@ -227,11 +335,19 @@
|
|
|
227
335
|
"default"
|
|
228
336
|
],
|
|
229
337
|
"type": "option"
|
|
338
|
+
},
|
|
339
|
+
"input": {
|
|
340
|
+
"char": "i",
|
|
341
|
+
"description": "输入文件路径",
|
|
342
|
+
"name": "input",
|
|
343
|
+
"hasDynamicHelp": false,
|
|
344
|
+
"multiple": false,
|
|
345
|
+
"type": "option"
|
|
230
346
|
}
|
|
231
347
|
},
|
|
232
348
|
"hasDynamicHelp": false,
|
|
233
349
|
"hiddenAliases": [],
|
|
234
|
-
"id": "db
|
|
350
|
+
"id": "import:db",
|
|
235
351
|
"pluginAlias": "nodebbs",
|
|
236
352
|
"pluginName": "nodebbs",
|
|
237
353
|
"pluginType": "core",
|
|
@@ -241,14 +357,44 @@
|
|
|
241
357
|
"relativePath": [
|
|
242
358
|
"dist",
|
|
243
359
|
"commands",
|
|
244
|
-
"
|
|
245
|
-
"
|
|
360
|
+
"import",
|
|
361
|
+
"db.js"
|
|
362
|
+
]
|
|
363
|
+
},
|
|
364
|
+
"import:uploads": {
|
|
365
|
+
"aliases": [],
|
|
366
|
+
"args": {},
|
|
367
|
+
"description": "恢复上传文件",
|
|
368
|
+
"flags": {
|
|
369
|
+
"input": {
|
|
370
|
+
"char": "i",
|
|
371
|
+
"description": "输入文件路径 (.tar.gz)",
|
|
372
|
+
"name": "input",
|
|
373
|
+
"hasDynamicHelp": false,
|
|
374
|
+
"multiple": false,
|
|
375
|
+
"type": "option"
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
"hasDynamicHelp": false,
|
|
379
|
+
"hiddenAliases": [],
|
|
380
|
+
"id": "import:uploads",
|
|
381
|
+
"pluginAlias": "nodebbs",
|
|
382
|
+
"pluginName": "nodebbs",
|
|
383
|
+
"pluginType": "core",
|
|
384
|
+
"strict": true,
|
|
385
|
+
"enableJsonFlag": false,
|
|
386
|
+
"isESM": true,
|
|
387
|
+
"relativePath": [
|
|
388
|
+
"dist",
|
|
389
|
+
"commands",
|
|
390
|
+
"import",
|
|
391
|
+
"uploads.js"
|
|
246
392
|
]
|
|
247
393
|
},
|
|
248
394
|
"logs:all": {
|
|
249
395
|
"aliases": [],
|
|
250
396
|
"args": {},
|
|
251
|
-
"description": "
|
|
397
|
+
"description": "查看日志",
|
|
252
398
|
"flags": {
|
|
253
399
|
"env": {
|
|
254
400
|
"char": "e",
|
|
@@ -283,7 +429,7 @@
|
|
|
283
429
|
"logs:api": {
|
|
284
430
|
"aliases": [],
|
|
285
431
|
"args": {},
|
|
286
|
-
"description": "查看 API
|
|
432
|
+
"description": "查看 API 日志",
|
|
287
433
|
"flags": {
|
|
288
434
|
"env": {
|
|
289
435
|
"char": "e",
|
|
@@ -454,7 +600,7 @@
|
|
|
454
600
|
"restart": {
|
|
455
601
|
"aliases": [],
|
|
456
602
|
"args": {},
|
|
457
|
-
"description": "
|
|
603
|
+
"description": "重启",
|
|
458
604
|
"flags": {
|
|
459
605
|
"env": {
|
|
460
606
|
"char": "e",
|
|
@@ -629,8 +775,15 @@
|
|
|
629
775
|
"start": {
|
|
630
776
|
"aliases": [],
|
|
631
777
|
"args": {},
|
|
632
|
-
"description": "
|
|
778
|
+
"description": "启动",
|
|
633
779
|
"flags": {
|
|
780
|
+
"build": {
|
|
781
|
+
"char": "b",
|
|
782
|
+
"description": "重新构建并启动服务 (跳过健康检查和数据初始化)",
|
|
783
|
+
"name": "build",
|
|
784
|
+
"allowNo": false,
|
|
785
|
+
"type": "boolean"
|
|
786
|
+
},
|
|
634
787
|
"env": {
|
|
635
788
|
"char": "e",
|
|
636
789
|
"description": "部署环境 (production, lowmem, default)",
|
|
@@ -643,13 +796,6 @@
|
|
|
643
796
|
"default"
|
|
644
797
|
],
|
|
645
798
|
"type": "option"
|
|
646
|
-
},
|
|
647
|
-
"build": {
|
|
648
|
-
"char": "b",
|
|
649
|
-
"description": "重新构建并启动服务 (跳过健康检查和数据初始化)",
|
|
650
|
-
"name": "build",
|
|
651
|
-
"allowNo": false,
|
|
652
|
-
"type": "boolean"
|
|
653
799
|
}
|
|
654
800
|
},
|
|
655
801
|
"hasDynamicHelp": false,
|
|
@@ -671,7 +817,7 @@
|
|
|
671
817
|
"status": {
|
|
672
818
|
"aliases": [],
|
|
673
819
|
"args": {},
|
|
674
|
-
"description": "
|
|
820
|
+
"description": "查看状态",
|
|
675
821
|
"flags": {
|
|
676
822
|
"env": {
|
|
677
823
|
"char": "e",
|
|
@@ -706,15 +852,8 @@
|
|
|
706
852
|
"stop": {
|
|
707
853
|
"aliases": [],
|
|
708
854
|
"args": {},
|
|
709
|
-
"description": "
|
|
855
|
+
"description": "停止",
|
|
710
856
|
"flags": {
|
|
711
|
-
"volumes": {
|
|
712
|
-
"char": "v",
|
|
713
|
-
"description": "同时删除数据卷(危险!)",
|
|
714
|
-
"name": "volumes",
|
|
715
|
-
"allowNo": false,
|
|
716
|
-
"type": "boolean"
|
|
717
|
-
},
|
|
718
857
|
"env": {
|
|
719
858
|
"char": "e",
|
|
720
859
|
"description": "部署环境 (production, lowmem, default)",
|
|
@@ -727,6 +866,13 @@
|
|
|
727
866
|
"default"
|
|
728
867
|
],
|
|
729
868
|
"type": "option"
|
|
869
|
+
},
|
|
870
|
+
"volumes": {
|
|
871
|
+
"char": "v",
|
|
872
|
+
"description": "同时删除数据卷(危险!)",
|
|
873
|
+
"name": "volumes",
|
|
874
|
+
"allowNo": false,
|
|
875
|
+
"type": "boolean"
|
|
730
876
|
}
|
|
731
877
|
},
|
|
732
878
|
"hasDynamicHelp": false,
|
|
@@ -748,7 +894,7 @@
|
|
|
748
894
|
"upgrade": {
|
|
749
895
|
"aliases": [],
|
|
750
896
|
"args": {},
|
|
751
|
-
"description": "
|
|
897
|
+
"description": "升级",
|
|
752
898
|
"flags": {
|
|
753
899
|
"env": {
|
|
754
900
|
"char": "e",
|
|
@@ -781,5 +927,5 @@
|
|
|
781
927
|
]
|
|
782
928
|
}
|
|
783
929
|
},
|
|
784
|
-
"version": "0.
|
|
930
|
+
"version": "0.4.2"
|
|
785
931
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebbs",
|
|
3
3
|
"description": "NodeBBS 论坛系统专业运维工具",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.2",
|
|
5
5
|
"author": "wengqianshan",
|
|
6
6
|
"bin": {
|
|
7
7
|
"nodebbs": "./bin/run.js"
|
|
@@ -59,10 +59,16 @@
|
|
|
59
59
|
"topicSeparator": " ",
|
|
60
60
|
"topics": {
|
|
61
61
|
"logs": {
|
|
62
|
-
"description": "
|
|
62
|
+
"description": "查看日志"
|
|
63
63
|
},
|
|
64
64
|
"db": {
|
|
65
|
-
"description": "数据库操作 (
|
|
65
|
+
"description": "数据库操作 (种子数据, 重置等)"
|
|
66
|
+
},
|
|
67
|
+
"backup": {
|
|
68
|
+
"description": "备份数据 (数据库, 上传文件等)"
|
|
69
|
+
},
|
|
70
|
+
"import": {
|
|
71
|
+
"description": "导入/恢复数据"
|
|
66
72
|
},
|
|
67
73
|
"shell": {
|
|
68
74
|
"description": "进入容器终端"
|