underpost 3.0.3 → 3.1.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.production → .env.example} +20 -2
- package/.github/workflows/ghpkg.ci.yml +1 -1
- package/.github/workflows/gitlab.ci.yml +1 -1
- package/.github/workflows/npmpkg.ci.yml +22 -7
- package/.github/workflows/publish.ci.yml +5 -5
- package/.github/workflows/pwa-microservices-template-page.cd.yml +3 -3
- package/.github/workflows/pwa-microservices-template-test.ci.yml +1 -1
- package/.github/workflows/release.cd.yml +3 -2
- package/.vscode/extensions.json +9 -8
- package/.vscode/settings.json +3 -2
- package/CHANGELOG.md +146 -1
- package/CLI-HELP.md +71 -52
- package/README.md +2 -2
- package/bin/build.js +4 -1
- package/bin/deploy.js +150 -208
- package/bin/file.js +2 -1
- package/bin/vs.js +3 -3
- package/conf.js +30 -13
- package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
- package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +52 -52
- package/manifests/deployment/dd-test-development/proxy.yaml +4 -4
- package/manifests/pv-pvc-dd.yaml +1 -1
- package/package.json +48 -43
- package/scripts/k3s-node-setup.sh +1 -1
- package/src/api/document/document.service.js +1 -1
- package/src/api/file/file.controller.js +3 -1
- package/src/api/file/file.service.js +28 -5
- package/src/api/user/user.router.js +10 -5
- package/src/api/user/user.service.js +7 -7
- package/src/cli/baremetal.js +6 -10
- package/src/cli/cloud-init.js +0 -3
- package/src/cli/db.js +54 -71
- package/src/cli/deploy.js +64 -12
- package/src/cli/env.js +4 -4
- package/src/cli/fs.js +0 -2
- package/src/cli/image.js +0 -3
- package/src/cli/index.js +27 -13
- package/src/cli/monitor.js +5 -6
- package/src/cli/repository.js +322 -35
- package/src/cli/run.js +118 -69
- package/src/cli/secrets.js +0 -3
- package/src/cli/ssh.js +1 -1
- package/src/client/components/core/AgGrid.js +20 -5
- package/src/client/components/core/Content.js +22 -3
- package/src/client/components/core/Docs.js +21 -4
- package/src/client/components/core/FileExplorer.js +71 -4
- package/src/client/components/core/Input.js +1 -1
- package/src/client/components/core/Modal.js +20 -6
- package/src/client/public/default/sitemap +3 -3
- package/src/client/public/test/sitemap +3 -3
- package/src/client.build.js +0 -3
- package/src/client.dev.js +0 -3
- package/src/db/DataBaseProvider.js +17 -2
- package/src/db/mariadb/MariaDB.js +14 -9
- package/src/db/mongo/MongooseDB.js +17 -1
- package/src/index.js +1 -1
- package/src/proxy.js +0 -3
- package/src/runtime/express/Express.js +7 -1
- package/src/runtime/lampp/Lampp.js +6 -13
- package/src/server/auth.js +6 -9
- package/src/server/backup.js +2 -3
- package/src/server/client-build-docs.js +178 -3
- package/src/server/client-build-live.js +9 -18
- package/src/server/client-build.js +175 -38
- package/src/server/client-dev-server.js +14 -13
- package/src/server/conf.js +357 -149
- package/src/server/cron.js +2 -1
- package/src/server/dns.js +28 -12
- package/src/server/downloader.js +0 -2
- package/src/server/logger.js +27 -9
- package/src/server/peer.js +0 -2
- package/src/server/process.js +1 -50
- package/src/server/proxy.js +4 -8
- package/src/server/runtime.js +5 -8
- package/src/server/ssr.js +0 -3
- package/src/server/start.js +5 -5
- package/src/server/tls.js +0 -2
- package/src/server.js +0 -4
- package/.env.development +0 -43
- package/.env.test +0 -43
package/bin/deploy.js
CHANGED
|
@@ -6,24 +6,18 @@ import dotenv from 'dotenv';
|
|
|
6
6
|
import { pbcopy, shellCd, shellExec } from '../src/server/process.js';
|
|
7
7
|
import { loggerFactory } from '../src/server/logger.js';
|
|
8
8
|
import {
|
|
9
|
-
Config,
|
|
10
9
|
addApiConf,
|
|
11
10
|
addClientConf,
|
|
12
11
|
buildApiSrc,
|
|
13
12
|
buildClientSrc,
|
|
14
13
|
cloneConf,
|
|
15
|
-
loadConf,
|
|
16
|
-
loadReplicas,
|
|
17
14
|
addWsConf,
|
|
18
15
|
buildWsSrc,
|
|
19
16
|
cloneSrcComponents,
|
|
20
|
-
getDataDeploy,
|
|
21
|
-
buildReplicaId,
|
|
22
|
-
Cmd,
|
|
23
17
|
writeEnv,
|
|
24
18
|
buildCliDoc,
|
|
19
|
+
loadConf,
|
|
25
20
|
} from '../src/server/conf.js';
|
|
26
|
-
import { buildClient } from '../src/server/client-build.js';
|
|
27
21
|
import colors from 'colors';
|
|
28
22
|
import { program } from '../src/cli/index.js';
|
|
29
23
|
import { timer } from '../src/client/components/core/CommonJs.js';
|
|
@@ -120,19 +114,6 @@ try {
|
|
|
120
114
|
buildWsSrc({ toOptions, fromOptions });
|
|
121
115
|
}
|
|
122
116
|
break;
|
|
123
|
-
case 'conf': {
|
|
124
|
-
let subConf = process.argv[5] ?? '';
|
|
125
|
-
|
|
126
|
-
if (!['current', 'clean', 'root'].includes(process.argv[3])) {
|
|
127
|
-
const path = fs.existsSync(`./engine-private/replica/${process.argv[3]}`)
|
|
128
|
-
? `./engine-private/replica/${process.argv[3]}/.env.${process.argv[4]}`
|
|
129
|
-
: `./engine-private/conf/${process.argv[3]}/.env.${process.argv[4]}`;
|
|
130
|
-
dotenv.config({ path, override: true });
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
loadConf(process.argv[3], subConf);
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
117
|
|
|
137
118
|
case 'new-nodejs-app':
|
|
138
119
|
{
|
|
@@ -143,7 +124,7 @@ try {
|
|
|
143
124
|
|
|
144
125
|
shellExec(`node bin/deploy build-nodejs-src-app ${deployId} ${clientId}`);
|
|
145
126
|
|
|
146
|
-
|
|
127
|
+
await Underpost.repo.client(deployId);
|
|
147
128
|
|
|
148
129
|
shellExec(`npm run dev ${deployId}`);
|
|
149
130
|
}
|
|
@@ -180,8 +161,6 @@ try {
|
|
|
180
161
|
shellExec(`node bin/deploy build-nodejs-conf-api ${apiId} ${deployId} ${clientId}`);
|
|
181
162
|
|
|
182
163
|
shellExec(`node bin/deploy build-nodejs-src-api ${apiId} ${deployId} ${clientId}`);
|
|
183
|
-
|
|
184
|
-
// shellExec(`npm run dev ${deployId}`);
|
|
185
164
|
}
|
|
186
165
|
break;
|
|
187
166
|
case 'new-nodejs-ws':
|
|
@@ -198,42 +177,6 @@ try {
|
|
|
198
177
|
shellExec(`npm run dev ${deployId}`);
|
|
199
178
|
}
|
|
200
179
|
break;
|
|
201
|
-
case 'build-full-client':
|
|
202
|
-
{
|
|
203
|
-
dotenv.config({ override: true });
|
|
204
|
-
if (!process.argv[3]) process.argv[3] = 'dd-default';
|
|
205
|
-
const { deployId } = loadConf(process.argv[3], process.argv[4] ?? '');
|
|
206
|
-
|
|
207
|
-
let argHost = process.argv[5] ? process.argv[5].split(',') : [];
|
|
208
|
-
let argPath = process.argv[6] ? process.argv[6].split(',') : [];
|
|
209
|
-
let deployIdSingleReplicas = [];
|
|
210
|
-
const serverConf = deployId
|
|
211
|
-
? JSON.parse(fs.readFileSync(`./conf/conf.server.json`, 'utf8'))
|
|
212
|
-
: Config.default.server;
|
|
213
|
-
for (const host of Object.keys(serverConf)) {
|
|
214
|
-
for (const path of Object.keys(serverConf[host])) {
|
|
215
|
-
if (argHost.length && argPath.length && (!argHost.includes(host) || !argPath.includes(path))) {
|
|
216
|
-
delete serverConf[host][path];
|
|
217
|
-
} else {
|
|
218
|
-
serverConf[host][path].liteBuild = false;
|
|
219
|
-
serverConf[host][path].minifyBuild = process.env.NODE_ENV === 'production' ? true : false;
|
|
220
|
-
if (serverConf[host][path].singleReplica && serverConf[host][path].replicas) {
|
|
221
|
-
deployIdSingleReplicas = deployIdSingleReplicas.concat(
|
|
222
|
-
serverConf[host][path].replicas.map((replica) => buildReplicaId({ deployId, replica })),
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
fs.writeFileSync(`./conf/conf.server.json`, JSON.stringify(serverConf, null, 4), 'utf-8');
|
|
229
|
-
await buildClient();
|
|
230
|
-
|
|
231
|
-
for (const replicaDeployId of deployIdSingleReplicas) {
|
|
232
|
-
shellExec(Cmd.conf(replicaDeployId, process.env.NODE_ENV));
|
|
233
|
-
shellExec(Cmd.build(replicaDeployId));
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
break;
|
|
237
180
|
|
|
238
181
|
case 'update-dependencies':
|
|
239
182
|
const files = await fs.readdir(`./engine-private/conf`, { recursive: true });
|
|
@@ -249,97 +192,6 @@ try {
|
|
|
249
192
|
}
|
|
250
193
|
break;
|
|
251
194
|
|
|
252
|
-
case 'sync-env-port':
|
|
253
|
-
const dataDeploy = getDataDeploy({ disableSyncEnvPort: true });
|
|
254
|
-
const dataEnv = [
|
|
255
|
-
{ env: 'production', port: 3000 },
|
|
256
|
-
{ env: 'development', port: 4000 },
|
|
257
|
-
{ env: 'test', port: 5000 },
|
|
258
|
-
];
|
|
259
|
-
let portOffset = 0;
|
|
260
|
-
for (const deployIdObj of dataDeploy) {
|
|
261
|
-
const { deployId } = deployIdObj;
|
|
262
|
-
const baseConfPath = fs.existsSync(`./engine-private/replica/${deployId}`)
|
|
263
|
-
? `./engine-private/replica`
|
|
264
|
-
: `./engine-private/conf`;
|
|
265
|
-
for (const envInstanceObj of dataEnv) {
|
|
266
|
-
const envPath = `${baseConfPath}/${deployId}/.env.${envInstanceObj.env}`;
|
|
267
|
-
const envObj = dotenv.parse(fs.readFileSync(envPath, 'utf8'));
|
|
268
|
-
envObj.PORT = `${envInstanceObj.port + portOffset}`;
|
|
269
|
-
|
|
270
|
-
writeEnv(envPath, envObj);
|
|
271
|
-
}
|
|
272
|
-
const serverConf = loadReplicas(
|
|
273
|
-
deployId,
|
|
274
|
-
JSON.parse(fs.readFileSync(`${baseConfPath}/${deployId}/conf.server.json`, 'utf8')),
|
|
275
|
-
);
|
|
276
|
-
for (const host of Object.keys(serverConf)) {
|
|
277
|
-
for (const path of Object.keys(serverConf[host])) {
|
|
278
|
-
if (serverConf[host][path].singleReplica) {
|
|
279
|
-
portOffset--;
|
|
280
|
-
continue;
|
|
281
|
-
}
|
|
282
|
-
portOffset++;
|
|
283
|
-
if (serverConf[host][path].peer) portOffset++;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
break;
|
|
288
|
-
|
|
289
|
-
case 'build-single-replica': {
|
|
290
|
-
const deployId = process.argv[3];
|
|
291
|
-
const host = process.argv[4];
|
|
292
|
-
const path = process.argv[5];
|
|
293
|
-
const serverConf = loadReplicas(
|
|
294
|
-
deployId,
|
|
295
|
-
JSON.parse(fs.readFileSync(`./engine-private/conf/${deployId}/conf.server.json`, 'utf8')),
|
|
296
|
-
);
|
|
297
|
-
|
|
298
|
-
if (serverConf[host][path].replicas) {
|
|
299
|
-
{
|
|
300
|
-
let replicaIndex = -1;
|
|
301
|
-
for (const replica of serverConf[host][path].replicas) {
|
|
302
|
-
replicaIndex++;
|
|
303
|
-
const replicaDeployId = `${deployId}-${serverConf[host][path].replicas[replicaIndex].slice(1)}`;
|
|
304
|
-
// fs.mkdirSync(`./engine-private/replica/${deployId}${replicaIndex}`, { recursive: true });
|
|
305
|
-
await fs.copy(`./engine-private/conf/${deployId}`, `./engine-private/replica/${replicaDeployId}`);
|
|
306
|
-
fs.writeFileSync(
|
|
307
|
-
`./engine-private/replica/${replicaDeployId}/package.json`,
|
|
308
|
-
fs
|
|
309
|
-
.readFileSync(`./engine-private/replica/${replicaDeployId}/package.json`, 'utf8')
|
|
310
|
-
.replaceAll(`${deployId}`, `${replicaDeployId}`),
|
|
311
|
-
'utf8',
|
|
312
|
-
);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
{
|
|
316
|
-
let replicaIndex = -1;
|
|
317
|
-
for (const replica of serverConf[host][path].replicas) {
|
|
318
|
-
replicaIndex++;
|
|
319
|
-
const replicaDeployId = `${deployId}-${serverConf[host][path].replicas[replicaIndex].slice(1)}`;
|
|
320
|
-
let replicaServerConf = JSON.parse(
|
|
321
|
-
fs.readFileSync(`./engine-private/replica/${replicaDeployId}/conf.server.json`, 'utf8'),
|
|
322
|
-
);
|
|
323
|
-
|
|
324
|
-
const singleReplicaConf = replicaServerConf[host][path];
|
|
325
|
-
singleReplicaConf.replicas = undefined;
|
|
326
|
-
singleReplicaConf.singleReplica = undefined;
|
|
327
|
-
|
|
328
|
-
replicaServerConf = {};
|
|
329
|
-
replicaServerConf[host] = {};
|
|
330
|
-
replicaServerConf[host][replica] = singleReplicaConf;
|
|
331
|
-
|
|
332
|
-
fs.writeFileSync(
|
|
333
|
-
`./engine-private/replica/${replicaDeployId}/conf.server.json`,
|
|
334
|
-
JSON.stringify(replicaServerConf, null, 4),
|
|
335
|
-
'utf8',
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
break;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
195
|
case 'rename-package': {
|
|
344
196
|
const name = process.argv[3];
|
|
345
197
|
const originPackage = JSON.parse(fs.readFileSync(`./package.json`, 'utf8'));
|
|
@@ -373,11 +225,10 @@ try {
|
|
|
373
225
|
shellExec(`node bin run kill 4001`);
|
|
374
226
|
shellExec(`node bin run kill 4002`);
|
|
375
227
|
shellExec(`node bin run kill 4003`);
|
|
376
|
-
shellExec(`npm run update
|
|
377
|
-
shellExec(
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
shellExec(`cd ../pwa-microservices-template && npm run build && timeout 5s npm run dev`, {
|
|
228
|
+
shellExec(`npm run update:template`);
|
|
229
|
+
shellExec(`cd ../pwa-microservices-template && npm install && npm run build`);
|
|
230
|
+
console.log(fs.existsSync(`../pwa-microservices-template/engine-private/conf/dd-default`));
|
|
231
|
+
shellExec(`cd ../pwa-microservices-template && ENABLE_FILE_LOGS=true timeout 5s npm run dev`, {
|
|
381
232
|
async: true,
|
|
382
233
|
});
|
|
383
234
|
await timer(5500);
|
|
@@ -392,7 +243,6 @@ try {
|
|
|
392
243
|
Underpost.repo.clean({ paths: ['/home/dd/engine', '/home/dd/engine/engine-private '] });
|
|
393
244
|
const originPackageJson = JSON.parse(fs.readFileSync(`package.json`, 'utf8'));
|
|
394
245
|
const newVersion = process.argv[3] ?? originPackageJson.version;
|
|
395
|
-
const node = process.argv[4] ?? 'kind-control-plane';
|
|
396
246
|
const { version } = originPackageJson;
|
|
397
247
|
originPackageJson.version = newVersion;
|
|
398
248
|
fs.writeFileSync(`package.json`, JSON.stringify(originPackageJson, null, 4), 'utf8');
|
|
@@ -449,30 +299,16 @@ try {
|
|
|
449
299
|
shellExec(`node bin/deploy cli-docs ${version} ${newVersion}`);
|
|
450
300
|
shellExec(`node bin/deploy update-dependencies`);
|
|
451
301
|
shellExec(`node bin/build dd`);
|
|
452
|
-
shellExec(
|
|
453
|
-
|
|
454
|
-
);
|
|
455
|
-
shellExec(
|
|
456
|
-
`node bin deploy --kubeadm --build-manifest --sync --info-router --replicas 1 --node ${node} dd development `,
|
|
457
|
-
);
|
|
458
|
-
for (const deployId of fs.readFileSync(`./engine-private/deploy/dd.router`, 'utf8').split(`,`)) {
|
|
459
|
-
fs.copySync(
|
|
460
|
-
`./engine-private/conf/${deployId}/build/development/deployment.yaml`,
|
|
461
|
-
`./manifests/deployment/${deployId}-development/deployment.yaml`,
|
|
462
|
-
);
|
|
463
|
-
fs.copySync(
|
|
464
|
-
`./engine-private/conf/${deployId}/build/development/proxy.yaml`,
|
|
465
|
-
`./manifests/deployment/${deployId}-development/proxy.yaml`,
|
|
466
|
-
);
|
|
467
|
-
shellExec(`node bin new --dev --default-conf --deploy-id ${deployId}`);
|
|
468
|
-
}
|
|
302
|
+
shellExec(`node bin deploy --build-manifest --sync --info-router --replicas 1 dd production`);
|
|
303
|
+
shellExec(`node bin deploy --build-manifest --sync --info-router --replicas 1 dd development`);
|
|
304
|
+
shellExec(`node bin/deploy build-default-confs`);
|
|
469
305
|
shellExec(`sudo rm -rf ./engine-private/conf/dd-default`);
|
|
470
306
|
shellExec(`node bin new --deploy-id dd-default`);
|
|
471
307
|
console.log(fs.existsSync(`./engine-private/conf/dd-default`));
|
|
472
308
|
shellExec(`sudo rm -rf ./engine-private/conf/dd-default`);
|
|
473
309
|
shellExec(`node bin cron --dev --setup-start`);
|
|
474
|
-
shellExec(`node bin/deploy build-envs`);
|
|
475
310
|
shellExec(`node bin cmt --changelog-build`);
|
|
311
|
+
process.exit(0);
|
|
476
312
|
break;
|
|
477
313
|
}
|
|
478
314
|
|
|
@@ -481,7 +317,6 @@ try {
|
|
|
481
317
|
shellExec(
|
|
482
318
|
`underpost secret underpost --create-from-file /home/dd/engine/engine-private/conf/dd-cron/.env.production`,
|
|
483
319
|
);
|
|
484
|
-
shellExec(`node bin/deploy sync-envs`);
|
|
485
320
|
shellExec(`node bin/build dd conf`);
|
|
486
321
|
shellExec(`git add . && cd ./engine-private && git add .`);
|
|
487
322
|
shellExec(`node bin cmt . ci package-pwa-microservices-template 'New release v:${process.argv[3]}'`);
|
|
@@ -491,6 +326,31 @@ try {
|
|
|
491
326
|
break;
|
|
492
327
|
}
|
|
493
328
|
|
|
329
|
+
case 'build-default-confs': {
|
|
330
|
+
for (const deployId of fs
|
|
331
|
+
.readFileSync(`./engine-private/deploy/dd.router`, 'utf8')
|
|
332
|
+
.split(`,`)
|
|
333
|
+
.concat(['dd-cron'])) {
|
|
334
|
+
if (fs.existsSync(`./engine-private/conf/${deployId}/build/development/deployment.yaml`))
|
|
335
|
+
fs.copySync(
|
|
336
|
+
`./engine-private/conf/${deployId}/build/development/deployment.yaml`,
|
|
337
|
+
`./manifests/deployment/${deployId}-development/deployment.yaml`,
|
|
338
|
+
);
|
|
339
|
+
if (fs.existsSync(`./engine-private/conf/${deployId}/build/development/proxy.yaml`))
|
|
340
|
+
fs.copySync(
|
|
341
|
+
`./engine-private/conf/${deployId}/build/development/proxy.yaml`,
|
|
342
|
+
`./manifests/deployment/${deployId}-development/proxy.yaml`,
|
|
343
|
+
);
|
|
344
|
+
if (fs.existsSync(`./engine-private/conf/${deployId}/build/development/pv-pvc.yaml`))
|
|
345
|
+
fs.copySync(
|
|
346
|
+
`./engine-private/conf/${deployId}/build/development/pv-pvc.yaml`,
|
|
347
|
+
`./manifests/deployment/${deployId}-development/pv-pvc.yaml`,
|
|
348
|
+
);
|
|
349
|
+
shellExec(`node bin new --dev --default-conf --deploy-id ${deployId}`);
|
|
350
|
+
}
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
|
|
494
354
|
case 'update-authors': {
|
|
495
355
|
// #### Ordered by first contribution.
|
|
496
356
|
fs.writeFileSync(
|
|
@@ -507,31 +367,6 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
507
367
|
break;
|
|
508
368
|
}
|
|
509
369
|
|
|
510
|
-
case 'heb': {
|
|
511
|
-
// https://besu.hyperledger.org/
|
|
512
|
-
// https://github.com/hyperledger/besu/archive/refs/tags/24.9.1.tar.gz
|
|
513
|
-
|
|
514
|
-
shellCd(`..`);
|
|
515
|
-
|
|
516
|
-
// Download the Linux binary
|
|
517
|
-
shellExec(`wget https://github.com/hyperledger/besu/releases/download/24.9.1/besu-24.9.1.tar.gz`);
|
|
518
|
-
|
|
519
|
-
// Unzip the file:
|
|
520
|
-
shellExec(`tar -xvzf besu-24.9.1.tar.gz`);
|
|
521
|
-
|
|
522
|
-
shellCd(`besu-24.9.1`);
|
|
523
|
-
|
|
524
|
-
shellExec(`bin/besu --help`);
|
|
525
|
-
|
|
526
|
-
// Set env path
|
|
527
|
-
// export PATH=$PATH:/home/dd/besu-24.9.1/bin
|
|
528
|
-
|
|
529
|
-
// Open src
|
|
530
|
-
// shellExec(`sudo code /home/dd/besu-24.9.1 --user-data-dir="/root/.vscode-root" --no-sandbox`);
|
|
531
|
-
|
|
532
|
-
break;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
370
|
case 'maas-db': {
|
|
536
371
|
// DROP, ALTER, CREATE, WITH ENCRYPTED
|
|
537
372
|
// sudo -u <user> -h <host> psql <db-name>
|
|
@@ -988,12 +823,18 @@ nvidia/gpu-operator \
|
|
|
988
823
|
}
|
|
989
824
|
|
|
990
825
|
case 'sync-start': {
|
|
826
|
+
const targetDeployId = process.argv[3] || 'dd';
|
|
827
|
+
const deployIds =
|
|
828
|
+
targetDeployId === 'dd'
|
|
829
|
+
? fs.readFileSync(`./engine-private/deploy/dd.router`, 'utf8').split(',')
|
|
830
|
+
: [targetDeployId];
|
|
991
831
|
const originPackageJson = JSON.parse(fs.readFileSync(`./package.json`, 'utf8'));
|
|
992
|
-
for (const deployId of
|
|
832
|
+
for (const deployId of deployIds) {
|
|
993
833
|
const packageJsonPath = `./engine-private/conf/${deployId}/package.json`;
|
|
994
834
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
995
|
-
packageJson.scripts
|
|
835
|
+
packageJson.scripts = { start: `${originPackageJson.scripts.start} ${deployId}` };
|
|
996
836
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 4), 'utf8');
|
|
837
|
+
logger.info(`sync-start`, { deployId, start: packageJson.scripts.start });
|
|
997
838
|
}
|
|
998
839
|
break;
|
|
999
840
|
}
|
|
@@ -1013,12 +854,6 @@ nvidia/gpu-operator \
|
|
|
1013
854
|
break;
|
|
1014
855
|
}
|
|
1015
856
|
|
|
1016
|
-
case 'envs': {
|
|
1017
|
-
shellExec(`node bin/deploy sync-envs`);
|
|
1018
|
-
shellExec(`node bin/deploy build-envs`);
|
|
1019
|
-
break;
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
857
|
case 'cyberia': {
|
|
1023
858
|
const { CyberiaDependencies } = await import(`../src/client/components/cyberia-portal/CommonCyberiaPortal.js`);
|
|
1024
859
|
for (const dep of Object.keys(CyberiaDependencies)) {
|
|
@@ -1028,6 +863,43 @@ nvidia/gpu-operator \
|
|
|
1028
863
|
break;
|
|
1029
864
|
}
|
|
1030
865
|
|
|
866
|
+
case 'cyberia-hardhat': {
|
|
867
|
+
shellExec(`cd ./hardhat && npm install --include=dev`);
|
|
868
|
+
break;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
case 'cyberia-docs': {
|
|
872
|
+
// Copy custom cyberia jsdoc to project root for docs build
|
|
873
|
+
const cyberiaJsDocPath = `./jsdoc.dd-cyberia.json`;
|
|
874
|
+
if (fs.existsSync(cyberiaJsDocPath)) {
|
|
875
|
+
logger.info('copying custom cyberia jsdoc.json to project root');
|
|
876
|
+
fs.copySync(cyberiaJsDocPath, `./jsdoc.json`);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// Generate hardhat coverage report for docs inclusion
|
|
880
|
+
if (fs.existsSync(`./hardhat/package.json`)) {
|
|
881
|
+
logger.info('generating hardhat coverage report for cyberia docs');
|
|
882
|
+
try {
|
|
883
|
+
shellExec(`cd ./hardhat && NODE_ENV=development npx hardhat coverage`);
|
|
884
|
+
} catch (e) {
|
|
885
|
+
logger.warn('hardhat coverage generation failed, continuing', e.message);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
// Prepare cyberia docs references directory with hardhat README and WHITE-PAPER
|
|
890
|
+
const cyberiaDocsRefsDir = `./src/client/public/cyberia/docs/references`;
|
|
891
|
+
fs.mkdirSync(cyberiaDocsRefsDir, { recursive: true });
|
|
892
|
+
if (fs.existsSync(`./hardhat/README.md`)) {
|
|
893
|
+
fs.copySync(`./hardhat/README.md`, `${cyberiaDocsRefsDir}/Hardhat Module.md`);
|
|
894
|
+
logger.info('copied hardhat README.md to cyberia docs references');
|
|
895
|
+
}
|
|
896
|
+
if (fs.existsSync(`./hardhat/WHITE-PAPER.md`)) {
|
|
897
|
+
fs.copySync(`./hardhat/WHITE-PAPER.md`, `${cyberiaDocsRefsDir}/White Paper.md`);
|
|
898
|
+
logger.info('copied hardhat WHITE-PAPER.md to cyberia docs references');
|
|
899
|
+
}
|
|
900
|
+
break;
|
|
901
|
+
}
|
|
902
|
+
|
|
1031
903
|
case 'pw': {
|
|
1032
904
|
const help = `node bin/deploy pw <script-path> <from-path-in-pod> [to-path-on-local]`;
|
|
1033
905
|
const scriptPath = process.argv[3];
|
|
@@ -1073,6 +945,76 @@ nvidia/gpu-operator \
|
|
|
1073
945
|
`);
|
|
1074
946
|
break;
|
|
1075
947
|
}
|
|
948
|
+
|
|
949
|
+
case 'dependabot': {
|
|
950
|
+
shellExec(`git fetch origin`);
|
|
951
|
+
|
|
952
|
+
const { stdout: branchOutput } = shellExec(`git branch -r`, { silent: true });
|
|
953
|
+
const dependabotBranches = branchOutput
|
|
954
|
+
.split('\n')
|
|
955
|
+
.map((b) => b.trim())
|
|
956
|
+
.filter((b) => b.startsWith('remotes/origin/dependabot/') || b.startsWith('origin/dependabot/'))
|
|
957
|
+
.map((b) => b.replace(/^remotes\//, '').replace(/^origin\//, ''));
|
|
958
|
+
|
|
959
|
+
if (dependabotBranches.length === 0) {
|
|
960
|
+
logger.info('No remote dependabot branches found');
|
|
961
|
+
break;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
logger.info('Found dependabot branches:', dependabotBranches);
|
|
965
|
+
|
|
966
|
+
for (const branch of dependabotBranches) {
|
|
967
|
+
logger.info(`Checking out branch: ${branch}`);
|
|
968
|
+
shellExec(`git checkout -B ${branch} origin/${branch}`);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
logger.info('Checking out master');
|
|
972
|
+
shellExec(`git checkout master`);
|
|
973
|
+
|
|
974
|
+
for (const branch of dependabotBranches) {
|
|
975
|
+
logger.info(`Merging branch: ${branch}`);
|
|
976
|
+
shellExec(`git merge ${branch}`);
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
logger.info('All dependabot branches merged into master');
|
|
980
|
+
break;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
// Temporal fallback underpost legacy version handling
|
|
984
|
+
|
|
985
|
+
case 'conf': {
|
|
986
|
+
let subConf = process.argv[5] ?? '';
|
|
987
|
+
|
|
988
|
+
if (!['current', 'clean', 'root'].includes(process.argv[3])) {
|
|
989
|
+
const path = fs.existsSync(`./engine-private/replica/${process.argv[3]}`)
|
|
990
|
+
? `./engine-private/replica/${process.argv[3]}/.env.${process.argv[4]}`
|
|
991
|
+
: `./engine-private/conf/${process.argv[3]}/.env.${process.argv[4]}`;
|
|
992
|
+
dotenv.config({ path, override: true });
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
loadConf(process.argv[3], subConf);
|
|
996
|
+
break;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
case 'build-full-client': {
|
|
1000
|
+
await Underpost.repo.client(process.argv[3], process.argv[4], process.argv[5], process.argv[6]);
|
|
1001
|
+
break;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
case 'build-single-replica': {
|
|
1005
|
+
const deployId = process.argv[3];
|
|
1006
|
+
const host = process.argv[4];
|
|
1007
|
+
const path = process.argv[5];
|
|
1008
|
+
await Underpost.repo.client(deployId, '', host, path, {
|
|
1009
|
+
singleReplica: true,
|
|
1010
|
+
});
|
|
1011
|
+
break;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
case 'sync-env-port': {
|
|
1015
|
+
await Underpost.repo.client(undefined, '', '', '', { syncEnvPort: true });
|
|
1016
|
+
break;
|
|
1017
|
+
}
|
|
1076
1018
|
}
|
|
1077
1019
|
} catch (error) {
|
|
1078
1020
|
logger.error(error, error.stack);
|
package/bin/file.js
CHANGED
|
@@ -99,6 +99,7 @@ try {
|
|
|
99
99
|
'./src/server/atlas-sprite-sheet-generator.js',
|
|
100
100
|
'./src/server/shape-generator.js',
|
|
101
101
|
'./src/server/semantic-layer-generator.js',
|
|
102
|
+
'./src/server/besu-genesis-generator.js',
|
|
102
103
|
'./test/shape-generator.test.js',
|
|
103
104
|
'bin/cyberia.js',
|
|
104
105
|
]) {
|
|
@@ -141,7 +142,7 @@ try {
|
|
|
141
142
|
templatePackageJson.keywords = uniqueArray(
|
|
142
143
|
['pwa', 'microservices', 'template', 'builder'].concat(templatePackageJson.keywords),
|
|
143
144
|
);
|
|
144
|
-
delete templatePackageJson.scripts['update
|
|
145
|
+
delete templatePackageJson.scripts['update:template'];
|
|
145
146
|
fs.writeFileSync(
|
|
146
147
|
'../pwa-microservices-template/package.json',
|
|
147
148
|
JSON.stringify(templatePackageJson, null, 4),
|
package/bin/vs.js
CHANGED
|
@@ -5,10 +5,9 @@ import { loggerFactory } from '../src/server/logger.js';
|
|
|
5
5
|
const logger = loggerFactory(import.meta);
|
|
6
6
|
|
|
7
7
|
const vsCodeRootPath = '/root/.vscode-root';
|
|
8
|
-
const
|
|
8
|
+
const vsConfigRootPath = '/root/.config/Code';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
// const vsProgram = 'windsurf';
|
|
10
|
+
const vsProgram = 'code';
|
|
12
11
|
|
|
13
12
|
switch (process.argv[2]) {
|
|
14
13
|
case 'info': {
|
|
@@ -66,6 +65,7 @@ switch (process.argv[2]) {
|
|
|
66
65
|
|
|
67
66
|
case 'clean': {
|
|
68
67
|
shellExec(`sudo rm -rf ${vsCodeRootPath}/*`);
|
|
68
|
+
shellExec(`sudo rn -rf ${vsConfigRootPath}`);
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
71
71
|
default:
|
package/conf.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import dotenv from 'dotenv';
|
|
2
|
-
|
|
3
|
-
dotenv.config();
|
|
4
|
-
|
|
5
1
|
const DefaultConf = /**/ {
|
|
6
2
|
client: {
|
|
7
3
|
default: {
|
|
@@ -184,19 +180,31 @@ const DefaultConf = /**/ {
|
|
|
184
180
|
ws: 'core',
|
|
185
181
|
peer: true,
|
|
186
182
|
proxy: [80, 443],
|
|
187
|
-
db: {
|
|
183
|
+
db: {
|
|
184
|
+
provider: 'env:DB_PROVIDER:mongoose',
|
|
185
|
+
host: 'env:DB_HOST:mongodb://127.0.0.1:27017',
|
|
186
|
+
name: 'env:DB_NAME:default',
|
|
187
|
+
user: 'env:DB_USER:',
|
|
188
|
+
password: 'env:DB_PASSWORD:',
|
|
189
|
+
},
|
|
188
190
|
mailer: {
|
|
189
|
-
sender: {
|
|
191
|
+
sender: {
|
|
192
|
+
email: 'env:MAILER_SENDER_EMAIL:noreply@default.net',
|
|
193
|
+
name: 'env:MAILER_SENDER_NAME:Default',
|
|
194
|
+
},
|
|
190
195
|
transport: {
|
|
191
|
-
host: 'smtp.default.com',
|
|
192
|
-
port: 465,
|
|
193
|
-
secure: true,
|
|
194
|
-
auth: {
|
|
196
|
+
host: 'env:SMTP_HOST:smtp.default.com',
|
|
197
|
+
port: 'env:SMTP_PORT:int:465',
|
|
198
|
+
secure: 'env:SMTP_SECURE:bool:true',
|
|
199
|
+
auth: {
|
|
200
|
+
user: 'env:SMTP_AUTH_USER:',
|
|
201
|
+
pass: 'env:SMTP_AUTH_PASS:',
|
|
202
|
+
},
|
|
195
203
|
},
|
|
196
204
|
},
|
|
197
205
|
valkey: {
|
|
198
|
-
port: 6379,
|
|
199
|
-
host: '127.0.0.1',
|
|
206
|
+
port: 'env:VALKEY_PORT:int:6379',
|
|
207
|
+
host: 'env:VALKEY_HOST:127.0.0.1',
|
|
200
208
|
},
|
|
201
209
|
},
|
|
202
210
|
},
|
|
@@ -213,7 +221,16 @@ const DefaultConf = /**/ {
|
|
|
213
221
|
},
|
|
214
222
|
},
|
|
215
223
|
cron: {
|
|
216
|
-
records: {
|
|
224
|
+
records: {
|
|
225
|
+
A: [
|
|
226
|
+
{
|
|
227
|
+
host: 'env:DDNS_HOST:example.com',
|
|
228
|
+
dns: 'env:DDNS_PROVIDER:dondominio',
|
|
229
|
+
api_key: 'env:DDNS_API_KEY:',
|
|
230
|
+
user: 'env:DDNS_USER:',
|
|
231
|
+
},
|
|
232
|
+
],
|
|
233
|
+
},
|
|
217
234
|
jobs: {
|
|
218
235
|
dns: { expression: '* * * * *', enabled: true, instances: 1 },
|
|
219
236
|
backups: { expression: '0 1 * * *', enabled: true, instances: 1 },
|
|
@@ -17,7 +17,7 @@ spec:
|
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
19
|
- name: dd-default-development-blue
|
|
20
|
-
image: localhost/rockylinux9-underpost:v3.0
|
|
20
|
+
image: localhost/rockylinux9-underpost:v3.1.0
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "124Ki"
|
|
@@ -100,7 +100,7 @@ spec:
|
|
|
100
100
|
spec:
|
|
101
101
|
containers:
|
|
102
102
|
- name: dd-default-development-green
|
|
103
|
-
image: localhost/rockylinux9-underpost:v3.0
|
|
103
|
+
image: localhost/rockylinux9-underpost:v3.1.0
|
|
104
104
|
# resources:
|
|
105
105
|
# requests:
|
|
106
106
|
# memory: "124Ki"
|