underpost 2.8.85 → 2.8.86
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.development +1 -1
- package/.env.production +1 -1
- package/.env.test +1 -1
- package/.github/workflows/pwa-microservices-template-page.cd.yml +1 -1
- package/.github/workflows/release.cd.yml +37 -0
- package/README.md +7 -44
- package/bin/cyberia0.js +78 -0
- package/bin/db.js +1 -3
- package/bin/deploy.js +13 -350
- package/bin/file.js +11 -1
- package/cli.md +39 -19
- package/manifests/deployment/{dd-template-development → dd-default-development}/deployment.yaml +16 -16
- package/manifests/deployment/{dd-template-development → dd-default-development}/proxy.yaml +3 -3
- package/manifests/grafana/deployment.yaml +57 -0
- package/manifests/grafana/kustomization.yaml +7 -0
- package/manifests/grafana/pvc.yaml +12 -0
- package/manifests/grafana/service.yaml +14 -0
- package/manifests/maas/ssh-cluster-info.sh +14 -0
- package/manifests/prometheus/deployment.yaml +82 -0
- package/package.json +1 -2
- package/src/api/user/user.service.js +8 -34
- package/src/cli/cluster.js +41 -2
- package/src/cli/cron.js +12 -45
- package/src/cli/db.js +149 -0
- package/src/cli/deploy.js +20 -81
- package/src/cli/index.js +20 -6
- package/src/cli/monitor.js +1 -4
- package/src/cli/repository.js +12 -5
- package/src/cli/run.js +77 -14
- package/src/client/Default.index.js +0 -2
- package/src/client/components/core/Account.js +6 -2
- package/src/client/components/core/Content.js +11 -7
- package/src/client/components/core/Css.js +5 -1
- package/src/client/components/core/Input.js +6 -1
- package/src/client/components/core/LogIn.js +3 -0
- package/src/client/components/core/LogOut.js +1 -1
- package/src/client/components/core/Modal.js +7 -4
- package/src/client/components/core/Recover.js +5 -2
- package/src/client/components/core/Scroll.js +65 -120
- package/src/client/components/core/SignUp.js +1 -0
- package/src/client/components/core/VanillaJs.js +48 -2
- package/src/client/components/default/MenuDefault.js +2 -2
- package/src/client/components/default/RoutesDefault.js +3 -3
- package/src/index.js +1 -1
- package/src/mailer/MailerProvider.js +37 -0
- package/src/server/client-build-live.js +1 -1
- package/src/server/client-dev-server.js +1 -1
- package/src/server/conf.js +2 -272
- package/src/server/proxy.js +1 -2
- package/src/server/start.js +3 -3
- package/docker-compose.yml +0 -67
- package/prometheus.yml +0 -36
package/bin/deploy.js
CHANGED
|
@@ -17,31 +17,17 @@ import {
|
|
|
17
17
|
addWsConf,
|
|
18
18
|
buildWsSrc,
|
|
19
19
|
cloneSrcComponents,
|
|
20
|
-
getDeployGroupId,
|
|
21
|
-
deployRun,
|
|
22
20
|
getDataDeploy,
|
|
23
21
|
buildReplicaId,
|
|
24
22
|
Cmd,
|
|
25
|
-
restoreMacroDb,
|
|
26
|
-
fixDependencies,
|
|
27
|
-
setUpProxyMaintenanceServer,
|
|
28
23
|
writeEnv,
|
|
29
|
-
getUnderpostRootPath,
|
|
30
24
|
buildCliDoc,
|
|
31
25
|
} from '../src/server/conf.js';
|
|
32
26
|
import { buildClient } from '../src/server/client-build.js';
|
|
33
|
-
import { range, s4, setPad, timer, uniqueArray } from '../src/client/components/core/CommonJs.js';
|
|
34
|
-
import { MongooseDB } from '../src/db/mongo/MongooseDB.js';
|
|
35
|
-
import { Lampp } from '../src/runtime/lampp/Lampp.js';
|
|
36
27
|
import { DefaultConf } from '../conf.js';
|
|
37
|
-
import { JSONweb } from '../src/server/client-formatted.js';
|
|
38
|
-
|
|
39
|
-
import { Xampp } from '../src/runtime/xampp/Xampp.js';
|
|
40
|
-
import { ejs } from '../src/server/json-schema.js';
|
|
41
|
-
import { getLocalIPv4Address, ip } from '../src/server/dns.js';
|
|
42
|
-
import { Downloader } from '../src/server/downloader.js';
|
|
43
28
|
import colors from 'colors';
|
|
44
29
|
import { program } from '../src/cli/index.js';
|
|
30
|
+
import { getLocalIPv4Address, ip } from '../src/server/dns.js';
|
|
45
31
|
|
|
46
32
|
colors.enable();
|
|
47
33
|
|
|
@@ -55,7 +41,8 @@ try {
|
|
|
55
41
|
switch (operator) {
|
|
56
42
|
case 'save':
|
|
57
43
|
{
|
|
58
|
-
|
|
44
|
+
let deployId = process.argv[3] ?? 'dd-default';
|
|
45
|
+
if (!deployId.startsWith('dd-')) deployId = 'dd-default';
|
|
59
46
|
const folder = `./engine-private/conf/${deployId}`;
|
|
60
47
|
if (fs.existsSync(folder)) fs.removeSync(folder);
|
|
61
48
|
await Config.build({ folder });
|
|
@@ -218,7 +205,7 @@ try {
|
|
|
218
205
|
case 'build-full-client':
|
|
219
206
|
{
|
|
220
207
|
dotenv.config({ override: true });
|
|
221
|
-
if (!process.argv[3]) process.argv[3] = 'default';
|
|
208
|
+
if (!process.argv[3]) process.argv[3] = 'dd-default';
|
|
222
209
|
const { deployId, folder } = loadConf(process.argv[3]);
|
|
223
210
|
|
|
224
211
|
let argHost = process.argv[4] ? process.argv[4].split(',') : [];
|
|
@@ -258,176 +245,6 @@ try {
|
|
|
258
245
|
}
|
|
259
246
|
break;
|
|
260
247
|
|
|
261
|
-
case 'xampp': {
|
|
262
|
-
const directory = 'c:/xampp/htdocs';
|
|
263
|
-
const host = 'localhost';
|
|
264
|
-
const port = 80;
|
|
265
|
-
Xampp.removeRouter();
|
|
266
|
-
Xampp.appendRouter(` Listen ${port}
|
|
267
|
-
<VirtualHost *:${port}>
|
|
268
|
-
DocumentRoot "${directory}"
|
|
269
|
-
ServerName ${host}:${port}
|
|
270
|
-
|
|
271
|
-
<Directory "${directory}">
|
|
272
|
-
Options Indexes FollowSymLinks MultiViews
|
|
273
|
-
AllowOverride All
|
|
274
|
-
Require all granted
|
|
275
|
-
</Directory>
|
|
276
|
-
|
|
277
|
-
</VirtualHost>
|
|
278
|
-
`);
|
|
279
|
-
if (Xampp.enabled() && Xampp.router) Xampp.initService({ daemon: true });
|
|
280
|
-
break;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
case 'adminer': {
|
|
284
|
-
const directory = '/home/dd/engine/public/adminer';
|
|
285
|
-
// const host = '127.0.0.1';
|
|
286
|
-
const host = 'localhost';
|
|
287
|
-
const port = 80;
|
|
288
|
-
if (!process.argv.includes('server')) {
|
|
289
|
-
if (fs.existsSync(directory)) fs.removeSync(directory);
|
|
290
|
-
fs.mkdirSync(directory, { recursive: true });
|
|
291
|
-
shellExec(`cd ${directory} && wget https://www.adminer.org/latest.php -O adminer.php`);
|
|
292
|
-
}
|
|
293
|
-
Lampp.removeRouter();
|
|
294
|
-
Lampp.appendRouter(` Listen ${port}
|
|
295
|
-
<VirtualHost *:${port}>
|
|
296
|
-
DocumentRoot "${directory}"
|
|
297
|
-
ServerName ${host}:${port}
|
|
298
|
-
|
|
299
|
-
<Directory "${directory}">
|
|
300
|
-
Options Indexes FollowSymLinks MultiViews
|
|
301
|
-
AllowOverride All
|
|
302
|
-
Require all granted
|
|
303
|
-
</Directory>
|
|
304
|
-
|
|
305
|
-
</VirtualHost>
|
|
306
|
-
`);
|
|
307
|
-
if (Lampp.enabled() && Lampp.router) Lampp.initService({ daemon: true });
|
|
308
|
-
shellExec(`open /opt/lampp/apache2/conf/httpd.conf`);
|
|
309
|
-
break;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
case 'pma':
|
|
313
|
-
{
|
|
314
|
-
const directory = '/home/dd/engine/public/phpmyadmin';
|
|
315
|
-
// const host = '127.0.0.1';
|
|
316
|
-
const host = 'localhost';
|
|
317
|
-
const port = 80;
|
|
318
|
-
// data config path: /etc/phpmyadmin
|
|
319
|
-
|
|
320
|
-
// The config.inc.php file is not required, and only needed for custom configurations
|
|
321
|
-
|
|
322
|
-
// phpmyadmin will first refer to ./libraries/config.default.php to retrieve the default values.
|
|
323
|
-
|
|
324
|
-
// If for some reason you need to modify the default values, and the ./config.inc.php
|
|
325
|
-
// file doesn't exist, you will need to create one as per the Installation documentation.
|
|
326
|
-
|
|
327
|
-
// You will also need to configure pmadb for some of phpmyadmin's special features such as bookmarks.
|
|
328
|
-
|
|
329
|
-
// CREATE USER 'pma'@'localhost' IDENTIFIED VIA mysql_native_password USING 'pmapass';
|
|
330
|
-
// GRANT SELECT, INSERT, UPDATE, DELETE ON `<pma_db>`.* TO 'pma'@'localhost';
|
|
331
|
-
|
|
332
|
-
if (!process.argv.includes('server')) {
|
|
333
|
-
// if (fs.existsSync(directory)) fs.removeSync(directory);
|
|
334
|
-
shellExec(`sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl`);
|
|
335
|
-
shellExec(`sudo phpenmod mbstring`);
|
|
336
|
-
shellExec(
|
|
337
|
-
`cd /usr/share/phpmyadmin && git init && git add . && git commit -m "Base phpMyAdmin implementation"`,
|
|
338
|
-
);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
// if (!fs.existsSync(directory)) fs.mkdirSync(directory, { recursive: true });
|
|
342
|
-
// if (!fs.existsSync('./public/phpmyadmin/phpmyadmin'))
|
|
343
|
-
// fs.copySync('/usr/share/phpmyadmin', './public/phpmyadmin/phpmyadmin');
|
|
344
|
-
|
|
345
|
-
Lampp.removeRouter();
|
|
346
|
-
Lampp.appendRouter(` Listen ${port} `);
|
|
347
|
-
if (Lampp.enabled() && Lampp.router) Lampp.initService({ daemon: true });
|
|
348
|
-
// shellExec(`open /opt/lampp/apache2/conf/httpd.conf`);
|
|
349
|
-
|
|
350
|
-
// Create a link in /var/www like this:
|
|
351
|
-
|
|
352
|
-
// sudo ln -s /usr/share/phpmyadmin /var/www/
|
|
353
|
-
|
|
354
|
-
// Note: since 14.04 you may want to use /var/www/html/ instead of /var/www/
|
|
355
|
-
|
|
356
|
-
// If that's not working for you, you need to include PHPMyAdmin inside apache configuration.
|
|
357
|
-
|
|
358
|
-
// Open apache.conf using your favorite editor, mine is vim :)
|
|
359
|
-
|
|
360
|
-
// sudo vim /etc/apache2/apache2.conf
|
|
361
|
-
|
|
362
|
-
// Then add the following line:
|
|
363
|
-
|
|
364
|
-
// Include /etc/phpmyadmin/apache.conf
|
|
365
|
-
|
|
366
|
-
// For Ubuntu 15.04 and 16.04
|
|
367
|
-
|
|
368
|
-
// sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
|
|
369
|
-
// sudo a2enconf phpmyadmin.conf
|
|
370
|
-
// sudo service apache2 reload
|
|
371
|
-
break;
|
|
372
|
-
Lampp.appendRouter(` Listen ${port}
|
|
373
|
-
|
|
374
|
-
<VirtualHost *:${port}>
|
|
375
|
-
DocumentRoot "${directory}"
|
|
376
|
-
ServerName ${host}:${port}
|
|
377
|
-
|
|
378
|
-
<Directory "${directory}">
|
|
379
|
-
Options Indexes FollowSymLinks MultiViews
|
|
380
|
-
AllowOverride All
|
|
381
|
-
Require all granted
|
|
382
|
-
</Directory>
|
|
383
|
-
|
|
384
|
-
</VirtualHost>`);
|
|
385
|
-
// phpMyAdmin default Apache configuration:
|
|
386
|
-
Lampp.appendRouter(`
|
|
387
|
-
|
|
388
|
-
Listen ${port}
|
|
389
|
-
|
|
390
|
-
Alias /phpmyadmin /usr/share/phpmyadmin
|
|
391
|
-
|
|
392
|
-
<Directory /usr/share/phpmyadmin>
|
|
393
|
-
Options Indexes FollowSymLinks
|
|
394
|
-
DirectoryIndex index.php
|
|
395
|
-
|
|
396
|
-
<IfModule mod_php5.c>
|
|
397
|
-
AddType application/x-httpd-php .php
|
|
398
|
-
|
|
399
|
-
php_flag magic_quotes_gpc Off
|
|
400
|
-
php_flag track_vars On
|
|
401
|
-
php_flag register_globals Off
|
|
402
|
-
php_value include_path .
|
|
403
|
-
</IfModule>
|
|
404
|
-
|
|
405
|
-
</Directory>
|
|
406
|
-
|
|
407
|
-
# Authorize for setup
|
|
408
|
-
<Directory /usr/share/phpmyadmin/setup>
|
|
409
|
-
<IfModule mod_authn_file.c>
|
|
410
|
-
AuthType Basic
|
|
411
|
-
AuthName "phpMyAdmin Setup"
|
|
412
|
-
AuthUserFile /etc/phpmyadmin/htpasswd.setup
|
|
413
|
-
</IfModule>
|
|
414
|
-
Require valid-user
|
|
415
|
-
</Directory>
|
|
416
|
-
|
|
417
|
-
# Disallow web access to directories that don't need it
|
|
418
|
-
<Directory /usr/share/phpmyadmin/libraries>
|
|
419
|
-
Order Deny,Allow
|
|
420
|
-
Deny from All
|
|
421
|
-
</Directory>
|
|
422
|
-
<Directory /usr/share/phpmyadmin/setup/lib>
|
|
423
|
-
Order Deny,Allow
|
|
424
|
-
Deny from All
|
|
425
|
-
</Directory>
|
|
426
|
-
|
|
427
|
-
`);
|
|
428
|
-
}
|
|
429
|
-
break;
|
|
430
|
-
|
|
431
248
|
case 'update-dependencies':
|
|
432
249
|
const files = await fs.readdir(`./engine-private/conf`, { recursive: true });
|
|
433
250
|
const originPackage = JSON.parse(fs.readFileSync(`./package.json`, 'utf8'));
|
|
@@ -442,64 +259,6 @@ try {
|
|
|
442
259
|
}
|
|
443
260
|
break;
|
|
444
261
|
|
|
445
|
-
case 'run-macro':
|
|
446
|
-
{
|
|
447
|
-
if (fs.existsSync(`./tmp/await-deploy`)) fs.remove(`./tmp/await-deploy`);
|
|
448
|
-
const dataDeploy = getDataDeploy({
|
|
449
|
-
deployGroupId: process.argv[3],
|
|
450
|
-
buildSingleReplica: true,
|
|
451
|
-
deployIdConcat: ['dd-proxy', 'dd-cron'],
|
|
452
|
-
});
|
|
453
|
-
if (!process.argv[4]) await setUpProxyMaintenanceServer({ deployGroupId: process.argv[3] });
|
|
454
|
-
await deployRun(process.argv[4] ? dataDeploy.filter((d) => d.deployId.match(process.argv[4])) : dataDeploy);
|
|
455
|
-
}
|
|
456
|
-
break;
|
|
457
|
-
|
|
458
|
-
case 'build-macro':
|
|
459
|
-
{
|
|
460
|
-
const dataDeploy = getDataDeploy({ deployGroupId: process.argv[3], buildSingleReplica: true });
|
|
461
|
-
for (const deploy of dataDeploy) {
|
|
462
|
-
if (!process.argv[4] || (process.argv[4] && process.argv[4] === deploy.deployId)) {
|
|
463
|
-
shellExec(Cmd.conf(deploy.deployId));
|
|
464
|
-
shellExec(Cmd.build(deploy.deployId));
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
break;
|
|
469
|
-
case 'macro': {
|
|
470
|
-
shellExec(`git checkout .`);
|
|
471
|
-
shellExec(`node bin/deploy build-macro ${process.argv.slice(3).join(' ')}`);
|
|
472
|
-
shellExec(`git checkout .`);
|
|
473
|
-
shellExec(`node bin/deploy run-macro ${process.argv.slice(3).join(' ')}`);
|
|
474
|
-
break;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
case 'keep-server': {
|
|
478
|
-
await setUpProxyMaintenanceServer({ deployGroupId: process.argv[3] });
|
|
479
|
-
break;
|
|
480
|
-
}
|
|
481
|
-
case 'prometheus':
|
|
482
|
-
case 'prom':
|
|
483
|
-
{
|
|
484
|
-
const rangePort = [1, 20];
|
|
485
|
-
const promConfigPath = `./engine-private/prometheus/prometheus-service-config.yml`;
|
|
486
|
-
const rawConfig = fs
|
|
487
|
-
.readFileSync(promConfigPath, 'utf8')
|
|
488
|
-
.replaceAll(
|
|
489
|
-
`['']`,
|
|
490
|
-
JSON.stringify(range(...rangePort).map((i) => `host.docker.internal:30${setPad(i, '0', 2)}`)).replaceAll(
|
|
491
|
-
`"`,
|
|
492
|
-
`'`,
|
|
493
|
-
),
|
|
494
|
-
);
|
|
495
|
-
console.log(rawConfig);
|
|
496
|
-
|
|
497
|
-
fs.writeFileSync(promConfigPath, rawConfig, 'utf8');
|
|
498
|
-
|
|
499
|
-
shellExec(`docker-compose -f engine-private/prometheus/prometheus-service.yml up -d`);
|
|
500
|
-
}
|
|
501
|
-
break;
|
|
502
|
-
|
|
503
262
|
case 'sync-env-port':
|
|
504
263
|
const dataDeploy = getDataDeploy({ deployGroupId: process.argv[3], disableSyncEnvPort: true });
|
|
505
264
|
const dataEnv = [
|
|
@@ -584,9 +343,6 @@ try {
|
|
|
584
343
|
}
|
|
585
344
|
break;
|
|
586
345
|
}
|
|
587
|
-
case 'build-macro-replica':
|
|
588
|
-
getDataDeploy({ deployGroupId: process.argv[3], buildSingleReplica: true });
|
|
589
|
-
break;
|
|
590
346
|
|
|
591
347
|
case 'rename-package': {
|
|
592
348
|
const name = process.argv[3];
|
|
@@ -613,7 +369,7 @@ try {
|
|
|
613
369
|
break;
|
|
614
370
|
}
|
|
615
371
|
|
|
616
|
-
case '
|
|
372
|
+
case 'clean-core-repo': {
|
|
617
373
|
shellCd(`/home/dd/engine`);
|
|
618
374
|
shellExec(`git reset`);
|
|
619
375
|
shellExec(`git checkout .`);
|
|
@@ -623,6 +379,12 @@ try {
|
|
|
623
379
|
shellExec(`git checkout .`);
|
|
624
380
|
shellExec(`git clean -f -d`);
|
|
625
381
|
shellCd(`/home/dd/engine`);
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
case 'version-build': {
|
|
386
|
+
shellExec(`node bin/deploy clean-core-repo`);
|
|
387
|
+
shellCd(`/home/dd/engine`);
|
|
626
388
|
const originPackageJson = JSON.parse(fs.readFileSync(`package.json`, 'utf8'));
|
|
627
389
|
const newVersion = process.argv[3] ?? originPackageJson.version;
|
|
628
390
|
const { version } = originPackageJson;
|
|
@@ -657,16 +419,9 @@ try {
|
|
|
657
419
|
}
|
|
658
420
|
|
|
659
421
|
fs.writeFileSync(
|
|
660
|
-
`./
|
|
661
|
-
fs
|
|
662
|
-
.readFileSync(`./docker-compose.yml`, 'utf8')
|
|
663
|
-
.replaceAll(`engine.version: '${version}'`, `engine.version: '${newVersion}'`),
|
|
664
|
-
'utf8',
|
|
665
|
-
);
|
|
666
|
-
fs.writeFileSync(
|
|
667
|
-
`./manifests/deployment/dd-template-development/deployment.yaml`,
|
|
422
|
+
`./manifests/deployment/dd-default-development/deployment.yaml`,
|
|
668
423
|
fs
|
|
669
|
-
.readFileSync(`./manifests/deployment/dd-
|
|
424
|
+
.readFileSync(`./manifests/deployment/dd-default-development/deployment.yaml`, 'utf8')
|
|
670
425
|
.replaceAll(`underpost:v${version}`, `underpost:v${newVersion}`),
|
|
671
426
|
'utf8',
|
|
672
427
|
);
|
|
@@ -723,25 +478,6 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
723
478
|
break;
|
|
724
479
|
}
|
|
725
480
|
|
|
726
|
-
case 'restore-macro-db':
|
|
727
|
-
{
|
|
728
|
-
const deployGroupId = process.argv[3];
|
|
729
|
-
const deployId = process.argv[4];
|
|
730
|
-
await restoreMacroDb(deployGroupId, deployId);
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
break;
|
|
734
|
-
|
|
735
|
-
case 'mongo': {
|
|
736
|
-
await MongooseDB.server();
|
|
737
|
-
break;
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
case 'lampp': {
|
|
741
|
-
await Lampp.install();
|
|
742
|
-
break;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
481
|
case 'heb': {
|
|
746
482
|
// https://besu.hyperledger.org/
|
|
747
483
|
// https://github.com/hyperledger/besu/archive/refs/tags/24.9.1.tar.gz
|
|
@@ -777,11 +513,6 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
777
513
|
break;
|
|
778
514
|
}
|
|
779
515
|
|
|
780
|
-
case 'fix-deps': {
|
|
781
|
-
await fixDependencies();
|
|
782
|
-
break;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
516
|
case 'update-default-conf': {
|
|
786
517
|
const defaultServer = DefaultConf.server['default.net']['/'];
|
|
787
518
|
let confName = process.argv[3];
|
|
@@ -984,74 +715,6 @@ EOF`);
|
|
|
984
715
|
break;
|
|
985
716
|
}
|
|
986
717
|
|
|
987
|
-
case 'valkey': {
|
|
988
|
-
if (!process.argv.includes('server')) {
|
|
989
|
-
if (process.argv.includes('rocky')) {
|
|
990
|
-
// shellExec(`yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm`);
|
|
991
|
-
// shellExec(`sudo percona-release enable valkey experimental`);
|
|
992
|
-
shellExec(`sudo dnf install valkey`);
|
|
993
|
-
shellExec(`chown -R valkey:valkey /etc/valkey`);
|
|
994
|
-
shellExec(`chown -R valkey:valkey /var/lib/valkey`);
|
|
995
|
-
shellExec(`chown -R valkey:valkey /var/log/valkey`);
|
|
996
|
-
shellExec(`sudo systemctl enable valkey.service`);
|
|
997
|
-
shellExec(`sudo systemctl start valkey`);
|
|
998
|
-
shellExec(`valkey-cli ping`);
|
|
999
|
-
} else {
|
|
1000
|
-
shellExec(`cd /home/dd && git clone https://github.com/valkey-io/valkey.git`);
|
|
1001
|
-
shellExec(`cd /home/dd/valkey && make`);
|
|
1002
|
-
shellExec(`apt install valkey-tools`); // valkey-cli
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
if (process.argv.includes('rocky')) {
|
|
1006
|
-
shellExec(`sudo systemctl stop valkey`);
|
|
1007
|
-
shellExec(`sudo systemctl start valkey`);
|
|
1008
|
-
} else shellExec(`cd /home/dd/valkey && ./src/valkey-server`);
|
|
1009
|
-
|
|
1010
|
-
break;
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
case 'valkey-service': {
|
|
1014
|
-
shellExec(`pm2 start bin/deploy.js --node-args=\"--max-old-space-size=8192\" --name valkey -- valkey server`);
|
|
1015
|
-
break;
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
case 'update-instances': {
|
|
1019
|
-
shellExec(`node bin deploy dd production --sync --build-manifest --info-router --dashboard-update`);
|
|
1020
|
-
shellExec(`node bin cron --dashboard-update --init`);
|
|
1021
|
-
const deployId = 'dd-core';
|
|
1022
|
-
const host = 'www.nexodev.org';
|
|
1023
|
-
const path = '/';
|
|
1024
|
-
|
|
1025
|
-
{
|
|
1026
|
-
const outputPath = './engine-private/instances';
|
|
1027
|
-
if (fs.existsSync(outputPath)) fs.mkdirSync(outputPath, { recursive: true });
|
|
1028
|
-
const collection = 'instances';
|
|
1029
|
-
if (process.argv.includes('export'))
|
|
1030
|
-
shellExec(
|
|
1031
|
-
`node bin db --export --collections ${collection} --out-path ${outputPath} --hosts ${host} --paths '${path}' ${deployId}`,
|
|
1032
|
-
);
|
|
1033
|
-
if (process.argv.includes('import'))
|
|
1034
|
-
shellExec(
|
|
1035
|
-
`node bin db --import --drop --preserveUUID --out-path ${outputPath} --hosts ${host} --paths '${path}' ${deployId}`,
|
|
1036
|
-
);
|
|
1037
|
-
}
|
|
1038
|
-
{
|
|
1039
|
-
const outputPath = './engine-private/crons';
|
|
1040
|
-
if (fs.existsSync(outputPath)) fs.mkdirSync(outputPath, { recursive: true });
|
|
1041
|
-
const collection = 'crons';
|
|
1042
|
-
if (process.argv.includes('export'))
|
|
1043
|
-
shellExec(
|
|
1044
|
-
`node bin db --export --collections ${collection} --out-path ${outputPath} --hosts ${host} --paths '${path}' ${deployId}`,
|
|
1045
|
-
);
|
|
1046
|
-
if (process.argv.includes('import'))
|
|
1047
|
-
shellExec(
|
|
1048
|
-
`node bin db --import --drop --preserveUUID --out-path ${outputPath} --hosts ${host} --paths '${path}' ${deployId}`,
|
|
1049
|
-
);
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
break;
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
718
|
case 'cli-docs': {
|
|
1056
719
|
buildCliDoc(program, process.argv[3], process.argv[4]);
|
|
1057
720
|
break;
|
package/bin/file.js
CHANGED
|
@@ -55,7 +55,15 @@ try {
|
|
|
55
55
|
|
|
56
56
|
console.log('copy paths', result);
|
|
57
57
|
|
|
58
|
-
if (type
|
|
58
|
+
if (type === 'update-template') {
|
|
59
|
+
if (!fs.existsSync(toPath)) shellExec(`cd .. && underpost clone underpostnet/pwa-microservices-template`);
|
|
60
|
+
else {
|
|
61
|
+
shellExec(`cd ${toPath} && git reset && git checkout . && git clean -f -d`);
|
|
62
|
+
shellExec(`underpost pull ${toPath} underpostnet/pwa-microservices-template`);
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
fs.removeSync(toPath);
|
|
66
|
+
}
|
|
59
67
|
|
|
60
68
|
for (const copyPath of result) {
|
|
61
69
|
const folder = getDirname(`${toPath}/${copyPath}`);
|
|
@@ -83,6 +91,7 @@ try {
|
|
|
83
91
|
'./manifests/deployment/dd-lampp-development',
|
|
84
92
|
'./manifests/deployment/dd-cyberia-development',
|
|
85
93
|
'./manifests/deployment/dd-core-development',
|
|
94
|
+
'./manifests/deployment/dd-template-development',
|
|
86
95
|
'bin/web3.js',
|
|
87
96
|
'bin/cyberia.js',
|
|
88
97
|
]) {
|
|
@@ -98,6 +107,7 @@ try {
|
|
|
98
107
|
`./.github/workflows/npmpkg.ci.yml`,
|
|
99
108
|
`./.github/workflows/ghpkg.ci.yml`,
|
|
100
109
|
`./.github/workflows/publish.ci.yml`,
|
|
110
|
+
`./.github/workflows/release.cd.yml`,
|
|
101
111
|
])
|
|
102
112
|
fs.copyFileSync(_path, `../pwa-microservices-template/${_path}`);
|
|
103
113
|
|
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.8.
|
|
1
|
+
## underpost ci/cd cli v2.8.86
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
-h, --help display help for command
|
|
8
8
|
|
|
9
9
|
Commands:
|
|
10
|
-
new <app-name>
|
|
10
|
+
new [options] <app-name> Initializes a new Underpost project with a predefined structure.
|
|
11
11
|
start [options] <deploy-id> [env] Initiates application servers, build pipelines, or other defined services based on the deployment ID.
|
|
12
12
|
clone [options] <uri> Clones a specified GitHub repository into the current directory.
|
|
13
13
|
pull [options] <path> <uri> Pulls the latest changes from a specified GitHub repository.
|
|
@@ -23,6 +23,7 @@ Commands:
|
|
|
23
23
|
dockerfile-pull-base-images [options] Pulls required Underpost Dockerfile base images and optionally loads them into clusters.
|
|
24
24
|
install Quickly imports Underpost npm dependencies by copying them.
|
|
25
25
|
db [options] <deploy-list> Manages database operations, including import, export, and collection management.
|
|
26
|
+
metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
|
|
26
27
|
script [options] <operator> <script-name> [script-value] Supports a variety of built-in Underpost global scripts, their preset lifecycle events, and arbitrary custom scripts.
|
|
27
28
|
cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
|
|
28
29
|
fs [options] [path] Manages file storage, defaulting to file upload operations.
|
|
@@ -49,6 +50,7 @@ Arguments:
|
|
|
49
50
|
app-name The name of the application to create.
|
|
50
51
|
|
|
51
52
|
Options:
|
|
53
|
+
--dev Sets the development cli context
|
|
52
54
|
-h, --help display help for command
|
|
53
55
|
|
|
54
56
|
```
|
|
@@ -235,6 +237,9 @@ Options:
|
|
|
235
237
|
specified namespace.
|
|
236
238
|
--kubeadm Initializes the cluster using kubeadm for control
|
|
237
239
|
plane management.
|
|
240
|
+
--grafana Initializes the cluster with a Grafana deployment.
|
|
241
|
+
--prom [hosts] Initializes the cluster with a Prometheus Operator
|
|
242
|
+
deployment and monitor scrap for specified hosts.
|
|
238
243
|
--dev Initializes a development-specific cluster
|
|
239
244
|
configuration.
|
|
240
245
|
--list-pods Displays detailed information about all pods.
|
|
@@ -288,8 +293,6 @@ Options:
|
|
|
288
293
|
--build-manifest Builds Kubernetes YAML manifests, including
|
|
289
294
|
deployments, services, proxies, and
|
|
290
295
|
secrets.
|
|
291
|
-
--dashboard-update Updates dashboard instance data with the
|
|
292
|
-
current router configuration.
|
|
293
296
|
--replicas <replicas> Sets a custom number of replicas for
|
|
294
297
|
deployments.
|
|
295
298
|
--versions <deployment-versions> A comma-separated list of custom deployment
|
|
@@ -302,9 +305,6 @@ Options:
|
|
|
302
305
|
--kubeadm Enables the kubeadm context for deployment
|
|
303
306
|
operations.
|
|
304
307
|
--restore-hosts Restores default `/etc/hosts` entries.
|
|
305
|
-
--rebuild-clients-bundle Inside the container, rebuilds client
|
|
306
|
-
bundles (only static public or storage
|
|
307
|
-
client files).
|
|
308
308
|
-h, --help display help for command
|
|
309
309
|
|
|
310
310
|
```
|
|
@@ -427,6 +427,29 @@ Options:
|
|
|
427
427
|
```
|
|
428
428
|
|
|
429
429
|
|
|
430
|
+
### `metadata` :
|
|
431
|
+
```
|
|
432
|
+
Usage: underpost metadata [options] [deploy-id] [host] [path]
|
|
433
|
+
|
|
434
|
+
Manages cluster metadata operations, including import and export.
|
|
435
|
+
|
|
436
|
+
Arguments:
|
|
437
|
+
deploy-id The deployment ID to manage metadata.
|
|
438
|
+
host The host to manage metadata.
|
|
439
|
+
path The path to manage metadata.
|
|
440
|
+
|
|
441
|
+
Options:
|
|
442
|
+
--import Imports from local storage.
|
|
443
|
+
--export Exports to local storage.
|
|
444
|
+
--crons Apply to cron data collection
|
|
445
|
+
--instances Apply to instance data collection
|
|
446
|
+
--generate Generate cluster metadata
|
|
447
|
+
--itc Apply under container execution context
|
|
448
|
+
-h, --help display help for command
|
|
449
|
+
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
|
|
430
453
|
### `script` :
|
|
431
454
|
```
|
|
432
455
|
Usage: underpost script [options] <operator> <script-name> [script-value]
|
|
@@ -461,19 +484,16 @@ Manages cron jobs, including initialization, execution, and configuration
|
|
|
461
484
|
updates.
|
|
462
485
|
|
|
463
486
|
Arguments:
|
|
464
|
-
deploy-list
|
|
465
|
-
|
|
466
|
-
job-list
|
|
467
|
-
|
|
487
|
+
deploy-list A comma-separated list of deployment IDs (e.g.,
|
|
488
|
+
"default-a,default-b").
|
|
489
|
+
job-list A comma-separated list of job IDs. Options: callback,
|
|
490
|
+
getRelatedDeployId. Defaults to all available jobs.
|
|
468
491
|
|
|
469
492
|
Options:
|
|
470
|
-
--itc
|
|
471
|
-
|
|
472
|
-
--
|
|
473
|
-
--
|
|
474
|
-
--dashboard-update Updates dashboard cron data with the current job
|
|
475
|
-
configurations.
|
|
476
|
-
-h, --help display help for command
|
|
493
|
+
--itc Executes cron jobs within the container execution context.
|
|
494
|
+
--init Initializes cron jobs for the default deployment ID.
|
|
495
|
+
--git Uploads cron job configurations to GitHub.
|
|
496
|
+
-h, --help display help for command
|
|
477
497
|
|
|
478
498
|
```
|
|
479
499
|
|
|
@@ -574,7 +594,7 @@ Options:
|
|
|
574
594
|
Runs a script from the specified path.
|
|
575
595
|
|
|
576
596
|
Arguments:
|
|
577
|
-
runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, gpu-env, tf-gpu-test, dev-cluster, cyberia-ide, engine-ide, template-deploy, ssh-deploy, ide, monitor, db-client, cluster, deploy, tf-vae-test, deploy-job.
|
|
597
|
+
runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, dev-cluster, ssh-cluster-info, cyberia-ide, engine-ide, template-deploy, clean, pull, release-deploy, ssh-deploy, ide, dev-client, dev-api, monitor, db-client, promote, metrics, cluster, deploy, tf-vae-test, deploy-job.
|
|
578
598
|
path The absolute or relative directory path where the script is located.
|
|
579
599
|
|
|
580
600
|
Options:
|
package/manifests/deployment/{dd-template-development → dd-default-development}/deployment.yaml
RENAMED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
apiVersion: apps/v1
|
|
3
3
|
kind: Deployment
|
|
4
4
|
metadata:
|
|
5
|
-
name: dd-
|
|
5
|
+
name: dd-default-development-blue
|
|
6
6
|
labels:
|
|
7
|
-
app: dd-
|
|
7
|
+
app: dd-default-development-blue
|
|
8
8
|
spec:
|
|
9
9
|
replicas: 1
|
|
10
10
|
selector:
|
|
11
11
|
matchLabels:
|
|
12
|
-
app: dd-
|
|
12
|
+
app: dd-default-development-blue
|
|
13
13
|
template:
|
|
14
14
|
metadata:
|
|
15
15
|
labels:
|
|
16
|
-
app: dd-
|
|
16
|
+
app: dd-default-development-blue
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
|
-
- name: dd-
|
|
20
|
-
image: localhost/rockylinux9-underpost:v2.8.
|
|
19
|
+
- name: dd-default-development-blue
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.8.86
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "124Ki"
|
|
@@ -40,10 +40,10 @@ spec:
|
|
|
40
40
|
apiVersion: v1
|
|
41
41
|
kind: Service
|
|
42
42
|
metadata:
|
|
43
|
-
name: dd-
|
|
43
|
+
name: dd-default-development-blue-service
|
|
44
44
|
spec:
|
|
45
45
|
selector:
|
|
46
|
-
app: dd-
|
|
46
|
+
app: dd-default-development-blue
|
|
47
47
|
ports:
|
|
48
48
|
- name: 'tcp-4001'
|
|
49
49
|
protocol: TCP
|
|
@@ -85,22 +85,22 @@ spec:
|
|
|
85
85
|
apiVersion: apps/v1
|
|
86
86
|
kind: Deployment
|
|
87
87
|
metadata:
|
|
88
|
-
name: dd-
|
|
88
|
+
name: dd-default-development-green
|
|
89
89
|
labels:
|
|
90
|
-
app: dd-
|
|
90
|
+
app: dd-default-development-green
|
|
91
91
|
spec:
|
|
92
92
|
replicas: 1
|
|
93
93
|
selector:
|
|
94
94
|
matchLabels:
|
|
95
|
-
app: dd-
|
|
95
|
+
app: dd-default-development-green
|
|
96
96
|
template:
|
|
97
97
|
metadata:
|
|
98
98
|
labels:
|
|
99
|
-
app: dd-
|
|
99
|
+
app: dd-default-development-green
|
|
100
100
|
spec:
|
|
101
101
|
containers:
|
|
102
|
-
- name: dd-
|
|
103
|
-
image: localhost/rockylinux9-underpost:v2.8.
|
|
102
|
+
- name: dd-default-development-green
|
|
103
|
+
image: localhost/rockylinux9-underpost:v2.8.86
|
|
104
104
|
# resources:
|
|
105
105
|
# requests:
|
|
106
106
|
# memory: "124Ki"
|
|
@@ -124,10 +124,10 @@ spec:
|
|
|
124
124
|
apiVersion: v1
|
|
125
125
|
kind: Service
|
|
126
126
|
metadata:
|
|
127
|
-
name: dd-
|
|
127
|
+
name: dd-default-development-green-service
|
|
128
128
|
spec:
|
|
129
129
|
selector:
|
|
130
|
-
app: dd-
|
|
130
|
+
app: dd-default-development-green
|
|
131
131
|
ports:
|
|
132
132
|
- name: 'tcp-4001'
|
|
133
133
|
protocol: TCP
|