nodebbs 0.2.0 → 0.3.0-beta.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/README.md +64 -307
- package/dist/commands/db/import.d.ts +9 -0
- package/dist/commands/db/import.js +115 -0
- package/dist/commands/pack/index.js +60 -45
- package/dist/commands/restart/index.js +13 -7
- package/dist/commands/start/index.js +29 -10
- package/dist/commands/upgrade/index.d.ts +8 -0
- package/dist/commands/upgrade/index.js +39 -0
- package/dist/interactive.js +1 -1
- package/dist/templates/docker-compose.build.yml +10 -0
- package/dist/templates/docker-compose.lowmem.yml +10 -45
- package/dist/templates/docker-compose.prod.yml +11 -42
- package/dist/templates/docker-compose.yml +7 -9
- package/dist/templates/dockerignore +120 -0
- package/dist/templates/env +6 -10
- package/dist/utils/docker.js +45 -12
- package/dist/utils/env.d.ts +5 -0
- package/dist/utils/env.js +90 -16
- package/dist/utils/selection.d.ts +2 -0
- package/dist/utils/selection.js +17 -19
- package/oclif.manifest.json +122 -65
- package/package.json +1 -1
- package/dist/commands/rebuild/index.d.ts +0 -6
- package/dist/commands/rebuild/index.js +0 -11
- package/dist/templates/init-db.sql +0 -14
package/oclif.manifest.json
CHANGED
|
@@ -97,10 +97,10 @@
|
|
|
97
97
|
"backup.js"
|
|
98
98
|
]
|
|
99
99
|
},
|
|
100
|
-
"db:
|
|
100
|
+
"db:import": {
|
|
101
101
|
"aliases": [],
|
|
102
102
|
"args": {},
|
|
103
|
-
"description": "
|
|
103
|
+
"description": "导入数据库 (从 SQL 文件恢复)",
|
|
104
104
|
"flags": {
|
|
105
105
|
"env": {
|
|
106
106
|
"char": "e",
|
|
@@ -114,11 +114,19 @@
|
|
|
114
114
|
"basic"
|
|
115
115
|
],
|
|
116
116
|
"type": "option"
|
|
117
|
+
},
|
|
118
|
+
"input": {
|
|
119
|
+
"char": "i",
|
|
120
|
+
"description": "输入文件路径",
|
|
121
|
+
"name": "input",
|
|
122
|
+
"hasDynamicHelp": false,
|
|
123
|
+
"multiple": false,
|
|
124
|
+
"type": "option"
|
|
117
125
|
}
|
|
118
126
|
},
|
|
119
127
|
"hasDynamicHelp": false,
|
|
120
128
|
"hiddenAliases": [],
|
|
121
|
-
"id": "db:
|
|
129
|
+
"id": "db:import",
|
|
122
130
|
"pluginAlias": "nodebbs",
|
|
123
131
|
"pluginName": "nodebbs",
|
|
124
132
|
"pluginType": "core",
|
|
@@ -129,13 +137,13 @@
|
|
|
129
137
|
"dist",
|
|
130
138
|
"commands",
|
|
131
139
|
"db",
|
|
132
|
-
"
|
|
140
|
+
"import.js"
|
|
133
141
|
]
|
|
134
142
|
},
|
|
135
|
-
"db:
|
|
143
|
+
"db:push": {
|
|
136
144
|
"aliases": [],
|
|
137
145
|
"args": {},
|
|
138
|
-
"description": "
|
|
146
|
+
"description": "推送数据库 schema (db:push)",
|
|
139
147
|
"flags": {
|
|
140
148
|
"env": {
|
|
141
149
|
"char": "e",
|
|
@@ -153,7 +161,7 @@
|
|
|
153
161
|
},
|
|
154
162
|
"hasDynamicHelp": false,
|
|
155
163
|
"hiddenAliases": [],
|
|
156
|
-
"id": "db:
|
|
164
|
+
"id": "db:push",
|
|
157
165
|
"pluginAlias": "nodebbs",
|
|
158
166
|
"pluginName": "nodebbs",
|
|
159
167
|
"pluginType": "core",
|
|
@@ -164,13 +172,13 @@
|
|
|
164
172
|
"dist",
|
|
165
173
|
"commands",
|
|
166
174
|
"db",
|
|
167
|
-
"
|
|
175
|
+
"push.js"
|
|
168
176
|
]
|
|
169
177
|
},
|
|
170
|
-
"db:
|
|
178
|
+
"db:reset": {
|
|
171
179
|
"aliases": [],
|
|
172
180
|
"args": {},
|
|
173
|
-
"description": "
|
|
181
|
+
"description": "重置数据库 (db:reset) - 危险操作!",
|
|
174
182
|
"flags": {
|
|
175
183
|
"env": {
|
|
176
184
|
"char": "e",
|
|
@@ -188,7 +196,7 @@
|
|
|
188
196
|
},
|
|
189
197
|
"hasDynamicHelp": false,
|
|
190
198
|
"hiddenAliases": [],
|
|
191
|
-
"id": "db:
|
|
199
|
+
"id": "db:reset",
|
|
192
200
|
"pluginAlias": "nodebbs",
|
|
193
201
|
"pluginName": "nodebbs",
|
|
194
202
|
"pluginType": "core",
|
|
@@ -199,27 +207,31 @@
|
|
|
199
207
|
"dist",
|
|
200
208
|
"commands",
|
|
201
209
|
"db",
|
|
202
|
-
"
|
|
210
|
+
"reset.js"
|
|
203
211
|
]
|
|
204
212
|
},
|
|
205
|
-
"
|
|
213
|
+
"db:seed": {
|
|
206
214
|
"aliases": [],
|
|
207
215
|
"args": {},
|
|
208
|
-
"description": "
|
|
216
|
+
"description": "填充种子数据 (db:seed)",
|
|
209
217
|
"flags": {
|
|
210
|
-
"
|
|
211
|
-
"char": "
|
|
212
|
-
"description": "
|
|
213
|
-
"name": "
|
|
214
|
-
"default": "nodebbs-offline.tar.gz",
|
|
218
|
+
"env": {
|
|
219
|
+
"char": "e",
|
|
220
|
+
"description": "部署环境 (production, lowmem, basic)",
|
|
221
|
+
"name": "env",
|
|
215
222
|
"hasDynamicHelp": false,
|
|
216
223
|
"multiple": false,
|
|
224
|
+
"options": [
|
|
225
|
+
"production",
|
|
226
|
+
"lowmem",
|
|
227
|
+
"basic"
|
|
228
|
+
],
|
|
217
229
|
"type": "option"
|
|
218
230
|
}
|
|
219
231
|
},
|
|
220
232
|
"hasDynamicHelp": false,
|
|
221
233
|
"hiddenAliases": [],
|
|
222
|
-
"id": "
|
|
234
|
+
"id": "db:seed",
|
|
223
235
|
"pluginAlias": "nodebbs",
|
|
224
236
|
"pluginName": "nodebbs",
|
|
225
237
|
"pluginType": "core",
|
|
@@ -229,8 +241,8 @@
|
|
|
229
241
|
"relativePath": [
|
|
230
242
|
"dist",
|
|
231
243
|
"commands",
|
|
232
|
-
"
|
|
233
|
-
"
|
|
244
|
+
"db",
|
|
245
|
+
"seed.js"
|
|
234
246
|
]
|
|
235
247
|
},
|
|
236
248
|
"logs:all": {
|
|
@@ -408,35 +420,24 @@
|
|
|
408
420
|
"web.js"
|
|
409
421
|
]
|
|
410
422
|
},
|
|
411
|
-
"
|
|
423
|
+
"pack": {
|
|
412
424
|
"aliases": [],
|
|
413
425
|
"args": {},
|
|
414
|
-
"description": "
|
|
426
|
+
"description": "生成离线部署包",
|
|
415
427
|
"flags": {
|
|
416
|
-
"
|
|
417
|
-
"char": "
|
|
418
|
-
"description": "
|
|
419
|
-
"name": "
|
|
428
|
+
"output": {
|
|
429
|
+
"char": "o",
|
|
430
|
+
"description": "输出文件名",
|
|
431
|
+
"name": "output",
|
|
432
|
+
"default": "nodebbs-offline.tar.gz",
|
|
420
433
|
"hasDynamicHelp": false,
|
|
421
434
|
"multiple": false,
|
|
422
|
-
"options": [
|
|
423
|
-
"production",
|
|
424
|
-
"lowmem",
|
|
425
|
-
"basic"
|
|
426
|
-
],
|
|
427
435
|
"type": "option"
|
|
428
|
-
},
|
|
429
|
-
"build": {
|
|
430
|
-
"char": "b",
|
|
431
|
-
"description": "重新构建并启动服务 (跳过健康检查和数据初始化)",
|
|
432
|
-
"name": "build",
|
|
433
|
-
"allowNo": false,
|
|
434
|
-
"type": "boolean"
|
|
435
436
|
}
|
|
436
437
|
},
|
|
437
438
|
"hasDynamicHelp": false,
|
|
438
439
|
"hiddenAliases": [],
|
|
439
|
-
"id": "
|
|
440
|
+
"id": "pack",
|
|
440
441
|
"pluginAlias": "nodebbs",
|
|
441
442
|
"pluginName": "nodebbs",
|
|
442
443
|
"pluginType": "core",
|
|
@@ -446,14 +447,14 @@
|
|
|
446
447
|
"relativePath": [
|
|
447
448
|
"dist",
|
|
448
449
|
"commands",
|
|
449
|
-
"
|
|
450
|
+
"pack",
|
|
450
451
|
"index.js"
|
|
451
452
|
]
|
|
452
453
|
},
|
|
453
454
|
"restart": {
|
|
454
455
|
"aliases": [],
|
|
455
456
|
"args": {},
|
|
456
|
-
"description": "
|
|
457
|
+
"description": "重启服务",
|
|
457
458
|
"flags": {
|
|
458
459
|
"env": {
|
|
459
460
|
"char": "e",
|
|
@@ -485,27 +486,6 @@
|
|
|
485
486
|
"index.js"
|
|
486
487
|
]
|
|
487
488
|
},
|
|
488
|
-
"rebuild": {
|
|
489
|
-
"aliases": [],
|
|
490
|
-
"args": {},
|
|
491
|
-
"description": "重新构建并启动服务 (start --build)",
|
|
492
|
-
"flags": {},
|
|
493
|
-
"hasDynamicHelp": false,
|
|
494
|
-
"hiddenAliases": [],
|
|
495
|
-
"id": "rebuild",
|
|
496
|
-
"pluginAlias": "nodebbs",
|
|
497
|
-
"pluginName": "nodebbs",
|
|
498
|
-
"pluginType": "core",
|
|
499
|
-
"strict": false,
|
|
500
|
-
"enableJsonFlag": false,
|
|
501
|
-
"isESM": true,
|
|
502
|
-
"relativePath": [
|
|
503
|
-
"dist",
|
|
504
|
-
"commands",
|
|
505
|
-
"rebuild",
|
|
506
|
-
"index.js"
|
|
507
|
-
]
|
|
508
|
-
},
|
|
509
489
|
"shell:api": {
|
|
510
490
|
"aliases": [],
|
|
511
491
|
"args": {},
|
|
@@ -646,6 +626,48 @@
|
|
|
646
626
|
"web.js"
|
|
647
627
|
]
|
|
648
628
|
},
|
|
629
|
+
"start": {
|
|
630
|
+
"aliases": [],
|
|
631
|
+
"args": {},
|
|
632
|
+
"description": "启动服务",
|
|
633
|
+
"flags": {
|
|
634
|
+
"env": {
|
|
635
|
+
"char": "e",
|
|
636
|
+
"description": "部署环境 (production, lowmem, basic)",
|
|
637
|
+
"name": "env",
|
|
638
|
+
"hasDynamicHelp": false,
|
|
639
|
+
"multiple": false,
|
|
640
|
+
"options": [
|
|
641
|
+
"production",
|
|
642
|
+
"lowmem",
|
|
643
|
+
"basic"
|
|
644
|
+
],
|
|
645
|
+
"type": "option"
|
|
646
|
+
},
|
|
647
|
+
"build": {
|
|
648
|
+
"char": "b",
|
|
649
|
+
"description": "重新构建并启动服务 (跳过健康检查和数据初始化)",
|
|
650
|
+
"name": "build",
|
|
651
|
+
"allowNo": false,
|
|
652
|
+
"type": "boolean"
|
|
653
|
+
}
|
|
654
|
+
},
|
|
655
|
+
"hasDynamicHelp": false,
|
|
656
|
+
"hiddenAliases": [],
|
|
657
|
+
"id": "start",
|
|
658
|
+
"pluginAlias": "nodebbs",
|
|
659
|
+
"pluginName": "nodebbs",
|
|
660
|
+
"pluginType": "core",
|
|
661
|
+
"strict": true,
|
|
662
|
+
"enableJsonFlag": false,
|
|
663
|
+
"isESM": true,
|
|
664
|
+
"relativePath": [
|
|
665
|
+
"dist",
|
|
666
|
+
"commands",
|
|
667
|
+
"start",
|
|
668
|
+
"index.js"
|
|
669
|
+
]
|
|
670
|
+
},
|
|
649
671
|
"status": {
|
|
650
672
|
"aliases": [],
|
|
651
673
|
"args": {},
|
|
@@ -722,7 +744,42 @@
|
|
|
722
744
|
"stop",
|
|
723
745
|
"index.js"
|
|
724
746
|
]
|
|
747
|
+
},
|
|
748
|
+
"upgrade": {
|
|
749
|
+
"aliases": [],
|
|
750
|
+
"args": {},
|
|
751
|
+
"description": "升级服务",
|
|
752
|
+
"flags": {
|
|
753
|
+
"env": {
|
|
754
|
+
"char": "e",
|
|
755
|
+
"description": "部署环境 (production, lowmem, basic)",
|
|
756
|
+
"name": "env",
|
|
757
|
+
"hasDynamicHelp": false,
|
|
758
|
+
"multiple": false,
|
|
759
|
+
"options": [
|
|
760
|
+
"production",
|
|
761
|
+
"lowmem",
|
|
762
|
+
"basic"
|
|
763
|
+
],
|
|
764
|
+
"type": "option"
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
"hasDynamicHelp": false,
|
|
768
|
+
"hiddenAliases": [],
|
|
769
|
+
"id": "upgrade",
|
|
770
|
+
"pluginAlias": "nodebbs",
|
|
771
|
+
"pluginName": "nodebbs",
|
|
772
|
+
"pluginType": "core",
|
|
773
|
+
"strict": true,
|
|
774
|
+
"enableJsonFlag": false,
|
|
775
|
+
"isESM": true,
|
|
776
|
+
"relativePath": [
|
|
777
|
+
"dist",
|
|
778
|
+
"commands",
|
|
779
|
+
"upgrade",
|
|
780
|
+
"index.js"
|
|
781
|
+
]
|
|
725
782
|
}
|
|
726
783
|
},
|
|
727
|
-
"version": "0.
|
|
784
|
+
"version": "0.3.0-beta.0"
|
|
728
785
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
import Start from '../start/index.js';
|
|
3
|
-
export default class Rebuild extends Command {
|
|
4
|
-
static description = '重新构建并启动服务 (start --build)';
|
|
5
|
-
// Allow passing flags like -e to the underlying start command
|
|
6
|
-
static strict = false;
|
|
7
|
-
async run() {
|
|
8
|
-
// Invoke Start command with --build flag and any other arguments
|
|
9
|
-
await Start.run(['--build', ...this.argv]);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
-- PostgreSQL 初始化脚本
|
|
2
|
-
-- 这个脚本会在数据库首次创建时执行
|
|
3
|
-
|
|
4
|
-
-- 创建扩展(如果需要)
|
|
5
|
-
-- CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
|
6
|
-
-- CREATE EXTENSION IF NOT EXISTS "pg_trgm";
|
|
7
|
-
|
|
8
|
-
-- 设置时区
|
|
9
|
-
SET timezone = 'Asia/Shanghai';
|
|
10
|
-
|
|
11
|
-
-- 数据库已由 POSTGRES_DB 环境变量创建
|
|
12
|
-
-- 这里可以添加其他初始化 SQL
|
|
13
|
-
|
|
14
|
-
\echo '数据库初始化完成'
|