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.
Files changed (60) hide show
  1. package/.github/workflows/release.cd.yml +3 -1
  2. package/README.md +26 -2
  3. package/bin/build.js +1 -0
  4. package/bin/deploy.js +4 -0
  5. package/bin/util.js +1 -56
  6. package/cli.md +3 -1
  7. package/conf.js +3 -2
  8. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  9. package/manifests/deployment/mongo-express/deployment.yaml +12 -12
  10. package/manifests/maas/nvim.sh +91 -0
  11. package/package.json +2 -12
  12. package/src/api/file/file.service.js +28 -8
  13. package/src/api/user/user.router.js +24 -0
  14. package/src/api/user/user.service.js +3 -4
  15. package/src/cli/cluster.js +2 -13
  16. package/src/cli/cron.js +0 -1
  17. package/src/cli/db.js +0 -19
  18. package/src/cli/deploy.js +17 -26
  19. package/src/cli/fs.js +1 -0
  20. package/src/cli/index.js +1 -0
  21. package/src/cli/repository.js +1 -0
  22. package/src/cli/run.js +10 -2
  23. package/src/client/components/core/Account.js +2 -1
  24. package/src/client/components/core/AgGrid.js +2 -2
  25. package/src/client/components/core/CalendarCore.js +2 -3
  26. package/src/client/components/core/CommonJs.js +1 -2
  27. package/src/client/components/core/Content.js +2 -1
  28. package/src/client/components/core/Css.js +2 -1
  29. package/src/client/components/core/CssCore.js +14 -1
  30. package/src/client/components/core/Docs.js +5 -5
  31. package/src/client/components/core/FileExplorer.js +3 -3
  32. package/src/client/components/core/FullScreen.js +19 -28
  33. package/src/client/components/core/Input.js +1 -0
  34. package/src/client/components/core/JoyStick.js +2 -2
  35. package/src/client/components/core/LoadingAnimation.js +2 -2
  36. package/src/client/components/core/Logger.js +4 -1
  37. package/src/client/components/core/Modal.js +54 -47
  38. package/src/client/components/core/ObjectLayerEngine.js +229 -4
  39. package/src/client/components/core/ObjectLayerEngineModal.js +442 -0
  40. package/src/client/components/core/Pagination.js +14 -0
  41. package/src/client/components/core/Panel.js +3 -8
  42. package/src/client/components/core/PanelForm.js +5 -14
  43. package/src/client/components/core/Recover.js +2 -2
  44. package/src/client/components/core/Router.js +183 -34
  45. package/src/client/components/core/Stream.js +1 -1
  46. package/src/client/components/core/ToggleSwitch.js +15 -1
  47. package/src/client/components/core/VanillaJs.js +0 -84
  48. package/src/client/components/core/Worker.js +2 -2
  49. package/src/client/components/default/MenuDefault.js +4 -3
  50. package/src/client/components/default/RoutesDefault.js +3 -2
  51. package/src/client/public/default/assets/mailer/api-user-default-avatar.png +0 -0
  52. package/src/client/services/core/core.service.js +1 -1
  53. package/src/client/ssr/head/DefaultScripts.js +1 -0
  54. package/src/index.js +1 -1
  55. package/src/server/client-build.js +3 -11
  56. package/src/server/client-icons.js +6 -78
  57. package/src/server/conf.js +4 -56
  58. package/src/server/process.js +2 -1
  59. package/src/server/runtime.js +7 -0
  60. package/src/server/ssl.js +1 -2
@@ -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 axios from 'axios';
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
- fs.writeFileSync(`./tmp/await-deploy`, '', 'utf8');
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) fs.writeFileSync(`./tmp/await-deploy`, '', 'utf8');
730
+ if (init) UnderpostRootEnv.API.set('await-deploy', new Date().toISOString());
781
731
  await timer(deltaMs);
782
- if (fs.existsSync(`./tmp/await-deploy`)) return await awaitDeployMonitor();
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,
@@ -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
- if (fs.existsSync(`./tmp/await-deploy`)) fs.remove(`./tmp/await-deploy`);
51
+ UnderpostRootEnv.API.delete('await-deploy');
51
52
  },
52
53
  };
53
54
 
@@ -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
- // TODO: no repeat folderHost match
54
- // fs.removeSync(`${sslPath}/${folderHost}`);
53
+
55
54
  return true;
56
55
  }
57
56
  }