underpost 2.8.867 → 2.8.872
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/.github/workflows/release.cd.yml +3 -1
- package/README.md +26 -2
- package/bin/build.js +1 -0
- package/bin/deploy.js +4 -0
- package/bin/util.js +1 -56
- package/cli.md +3 -1
- package/conf.js +3 -2
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/mongo-express/deployment.yaml +12 -12
- package/manifests/maas/nvim.sh +91 -0
- package/package.json +2 -12
- package/src/api/file/file.service.js +28 -8
- package/src/api/user/user.router.js +24 -0
- package/src/api/user/user.service.js +3 -4
- package/src/cli/cluster.js +2 -13
- package/src/cli/cron.js +0 -1
- package/src/cli/db.js +0 -19
- package/src/cli/deploy.js +17 -26
- package/src/cli/fs.js +1 -0
- package/src/cli/index.js +1 -0
- package/src/cli/repository.js +1 -0
- package/src/cli/run.js +10 -2
- package/src/client/components/core/Account.js +2 -1
- package/src/client/components/core/AgGrid.js +2 -2
- package/src/client/components/core/CalendarCore.js +2 -3
- package/src/client/components/core/CommonJs.js +1 -2
- package/src/client/components/core/Content.js +2 -1
- package/src/client/components/core/Css.js +2 -1
- package/src/client/components/core/CssCore.js +14 -1
- package/src/client/components/core/Docs.js +5 -5
- package/src/client/components/core/FileExplorer.js +3 -3
- package/src/client/components/core/FullScreen.js +19 -28
- package/src/client/components/core/Input.js +1 -0
- package/src/client/components/core/JoyStick.js +2 -2
- package/src/client/components/core/LoadingAnimation.js +2 -2
- package/src/client/components/core/Logger.js +4 -1
- package/src/client/components/core/Modal.js +54 -47
- package/src/client/components/core/ObjectLayerEngine.js +229 -4
- package/src/client/components/core/ObjectLayerEngineModal.js +442 -0
- package/src/client/components/core/Pagination.js +14 -0
- package/src/client/components/core/Panel.js +3 -8
- package/src/client/components/core/PanelForm.js +5 -14
- package/src/client/components/core/Recover.js +2 -2
- package/src/client/components/core/Router.js +183 -34
- package/src/client/components/core/Stream.js +1 -1
- package/src/client/components/core/ToggleSwitch.js +15 -1
- package/src/client/components/core/VanillaJs.js +0 -84
- package/src/client/components/core/Worker.js +2 -2
- package/src/client/components/default/MenuDefault.js +4 -3
- package/src/client/components/default/RoutesDefault.js +3 -2
- package/src/client/public/default/assets/mailer/api-user-default-avatar.png +0 -0
- package/src/client/services/core/core.service.js +1 -1
- package/src/client/ssr/head/DefaultScripts.js +1 -0
- package/src/index.js +1 -1
- package/src/server/client-build.js +3 -11
- package/src/server/client-icons.js +6 -78
- package/src/server/conf.js +4 -56
- package/src/server/process.js +2 -1
- package/src/server/runtime.js +7 -0
- package/src/server/ssl.js +1 -2
package/src/server/conf.js
CHANGED
|
@@ -9,17 +9,12 @@ import {
|
|
|
9
9
|
timer,
|
|
10
10
|
} from '../client/components/core/CommonJs.js';
|
|
11
11
|
import * as dir from 'path';
|
|
12
|
-
import cliProgress from 'cli-progress';
|
|
13
|
-
import cliSpinners from 'cli-spinners';
|
|
14
|
-
import logUpdate from 'log-update';
|
|
15
12
|
import colors from 'colors';
|
|
16
13
|
import { loggerFactory } from './logger.js';
|
|
17
14
|
import { shellExec } from './process.js';
|
|
18
15
|
import { DefaultConf } from '../../conf.js';
|
|
19
|
-
import read from 'read';
|
|
20
16
|
import splitFile from 'split-file';
|
|
21
|
-
import
|
|
22
|
-
import { ssrFactory } from './client-formatted.js';
|
|
17
|
+
import UnderpostRootEnv from '../cli/env.js';
|
|
23
18
|
|
|
24
19
|
colors.enable();
|
|
25
20
|
|
|
@@ -32,7 +27,7 @@ const Config = {
|
|
|
32
27
|
build: async function (deployContext = 'dd-default', deployList, subConf) {
|
|
33
28
|
if (typeof process.argv[2] === 'string' && process.argv[2].startsWith('dd-')) deployContext = process.argv[2];
|
|
34
29
|
if (!fs.existsSync(`./tmp`)) fs.mkdirSync(`./tmp`, { recursive: true });
|
|
35
|
-
|
|
30
|
+
UnderpostRootEnv.API.set('await-deploy', new Date().toISOString());
|
|
36
31
|
if (fs.existsSync(`./engine-private/replica/${deployContext}`))
|
|
37
32
|
return loadConf(deployContext, process.env.NODE_ENV, subConf);
|
|
38
33
|
else if (deployContext.startsWith('dd-')) return loadConf(deployContext, process.env.NODE_ENV, subConf);
|
|
@@ -591,51 +586,6 @@ const buildPortProxyRouter = (port, proxyRouter) => {
|
|
|
591
586
|
return reOrderRouter;
|
|
592
587
|
};
|
|
593
588
|
|
|
594
|
-
const cliBar = async (time = 5000) => {
|
|
595
|
-
// create new progress bar
|
|
596
|
-
const b = new cliProgress.SingleBar({
|
|
597
|
-
format: 'Delay | {bar} | {percentage}% || {value}/{total} Chunks || Speed: {speed}',
|
|
598
|
-
barCompleteChar: '\u2588',
|
|
599
|
-
barIncompleteChar: '\u2591',
|
|
600
|
-
hideCursor: true,
|
|
601
|
-
});
|
|
602
|
-
|
|
603
|
-
const maxValueDisplay = 200;
|
|
604
|
-
const minValueDisplay = 0;
|
|
605
|
-
const steps = 10;
|
|
606
|
-
const incrementValue = 200 / steps;
|
|
607
|
-
const delayTime = time / steps;
|
|
608
|
-
// initialize the bar - defining payload token "speed" with the default value "N/A"
|
|
609
|
-
b.start(maxValueDisplay, minValueDisplay, {
|
|
610
|
-
speed: 'N/A',
|
|
611
|
-
});
|
|
612
|
-
|
|
613
|
-
// update values
|
|
614
|
-
// b1.increment();
|
|
615
|
-
// b1.update(20);
|
|
616
|
-
|
|
617
|
-
for (const step of range(1, steps)) {
|
|
618
|
-
b.increment(incrementValue);
|
|
619
|
-
await timer(delayTime);
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
// stop the bar
|
|
623
|
-
b.stop();
|
|
624
|
-
};
|
|
625
|
-
|
|
626
|
-
const cliSpinner = async (time = 5000, message0, message1, color, type = 'dots') => {
|
|
627
|
-
const { frames, interval } = cliSpinners[type];
|
|
628
|
-
const steps = parseInt(time / interval);
|
|
629
|
-
let index = 0;
|
|
630
|
-
for (const step of range(1, steps)) {
|
|
631
|
-
const msg = `${message0 ? message0 : ''}${frames[index]}${message1 ? message1 : ''}`;
|
|
632
|
-
logUpdate(color ? msg[color] : msg);
|
|
633
|
-
await timer(interval);
|
|
634
|
-
index++;
|
|
635
|
-
if (index === frames.length) index = 0;
|
|
636
|
-
}
|
|
637
|
-
};
|
|
638
|
-
|
|
639
589
|
const buildReplicaId = ({ deployId, replica }) => `${deployId}-${replica.slice(1)}`;
|
|
640
590
|
|
|
641
591
|
const getDataDeploy = (
|
|
@@ -777,9 +727,9 @@ const validateTemplatePath = (absolutePath = '') => {
|
|
|
777
727
|
};
|
|
778
728
|
|
|
779
729
|
const awaitDeployMonitor = async (init = false, deltaMs = 1000) => {
|
|
780
|
-
if (init)
|
|
730
|
+
if (init) UnderpostRootEnv.API.set('await-deploy', new Date().toISOString());
|
|
781
731
|
await timer(deltaMs);
|
|
782
|
-
if (
|
|
732
|
+
if (UnderpostRootEnv.API.get('await-deploy')) return await awaitDeployMonitor();
|
|
783
733
|
};
|
|
784
734
|
|
|
785
735
|
const getCronBackUpFolder = (host = '', path = '') => {
|
|
@@ -991,8 +941,6 @@ export {
|
|
|
991
941
|
buildWsSrc,
|
|
992
942
|
cloneSrcComponents,
|
|
993
943
|
buildProxyRouter,
|
|
994
|
-
cliBar,
|
|
995
|
-
cliSpinner,
|
|
996
944
|
getDataDeploy,
|
|
997
945
|
validateTemplatePath,
|
|
998
946
|
buildReplicaId,
|
package/src/server/process.js
CHANGED
|
@@ -5,6 +5,7 @@ import dotenv from 'dotenv';
|
|
|
5
5
|
import fs from 'fs-extra';
|
|
6
6
|
import { loggerFactory } from './logger.js';
|
|
7
7
|
import clipboard from 'clipboardy';
|
|
8
|
+
import UnderpostRootEnv from '../cli/env.js';
|
|
8
9
|
|
|
9
10
|
dotenv.config();
|
|
10
11
|
|
|
@@ -47,7 +48,7 @@ const ProcessController = {
|
|
|
47
48
|
this.logger.info(`process on exit`, args);
|
|
48
49
|
});
|
|
49
50
|
this.onSigListen();
|
|
50
|
-
|
|
51
|
+
UnderpostRootEnv.API.delete('await-deploy');
|
|
51
52
|
},
|
|
52
53
|
};
|
|
53
54
|
|
package/src/server/runtime.js
CHANGED
|
@@ -404,6 +404,13 @@ const buildRuntime = async () => {
|
|
|
404
404
|
const path404 = `${directory ? directory : `${getRootDirectory()}${rootHostPath}`}/404/index.html`;
|
|
405
405
|
const page404 = fs.existsSync(path404) ? `${path === '/' ? '' : path}/404` : undefined;
|
|
406
406
|
app.use(function (req, res, next) {
|
|
407
|
+
// if /<path>/home redirect to /<path>
|
|
408
|
+
const homeRedirectPath = `${path === '/' ? '' : path}/home`;
|
|
409
|
+
if (req.url.startsWith(homeRedirectPath)) {
|
|
410
|
+
const redirectUrl = req.url.replace('/home', '');
|
|
411
|
+
return res.redirect(redirectUrl.startsWith('/') ? redirectUrl : `/${redirectUrl}`);
|
|
412
|
+
}
|
|
413
|
+
|
|
407
414
|
if (page404) return res.status(404).redirect(page404);
|
|
408
415
|
else {
|
|
409
416
|
res.set('Content-Type', 'text/html');
|
package/src/server/ssl.js
CHANGED
|
@@ -50,8 +50,7 @@ const buildSSL = async (host) => {
|
|
|
50
50
|
|
|
51
51
|
fs.writeFileSync(`./engine-private/ssl/${host}/_ca_bundle.crt`, ca, 'utf8');
|
|
52
52
|
fs.writeFileSync(`./engine-private/ssl/${host}/_ca_full_bundle.crt`, caFull, 'utf8');
|
|
53
|
-
|
|
54
|
-
// fs.removeSync(`${sslPath}/${folderHost}`);
|
|
53
|
+
|
|
55
54
|
return true;
|
|
56
55
|
}
|
|
57
56
|
}
|