underpost 2.8.877 → 2.8.881

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 (54) hide show
  1. package/.env.development +35 -3
  2. package/.env.production +40 -3
  3. package/.env.test +35 -3
  4. package/.github/workflows/release.cd.yml +3 -3
  5. package/README.md +48 -36
  6. package/bin/deploy.js +40 -0
  7. package/cli.md +89 -86
  8. package/conf.js +28 -3
  9. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  10. package/manifests/deployment/dd-test-development/deployment.yaml +2 -2
  11. package/package.json +1 -2
  12. package/src/api/document/document.controller.js +66 -0
  13. package/src/api/document/document.model.js +51 -0
  14. package/src/api/document/document.router.js +24 -0
  15. package/src/api/document/document.service.js +125 -0
  16. package/src/api/file/file.controller.js +15 -1
  17. package/src/api/user/user.router.js +4 -3
  18. package/src/cli/deploy.js +1 -1
  19. package/src/cli/index.js +3 -0
  20. package/src/cli/repository.js +2 -2
  21. package/src/cli/run.js +29 -1
  22. package/src/client/Default.index.js +42 -1
  23. package/src/client/components/core/Account.js +8 -1
  24. package/src/client/components/core/AgGrid.js +18 -9
  25. package/src/client/components/core/BtnIcon.js +3 -2
  26. package/src/client/components/core/Content.js +13 -11
  27. package/src/client/components/core/CssCore.js +4 -0
  28. package/src/client/components/core/Docs.js +0 -3
  29. package/src/client/components/core/Input.js +34 -19
  30. package/src/client/components/core/Modal.js +29 -7
  31. package/src/client/components/core/ObjectLayerEngine.js +370 -0
  32. package/src/client/components/core/ObjectLayerEngineModal.js +1 -0
  33. package/src/client/components/core/Panel.js +7 -2
  34. package/src/client/components/core/PanelForm.js +187 -63
  35. package/src/client/components/core/VanillaJs.js +3 -0
  36. package/src/client/components/default/MenuDefault.js +94 -41
  37. package/src/client/components/default/RoutesDefault.js +2 -0
  38. package/src/client/services/default/default.management.js +1 -0
  39. package/src/client/services/document/document.service.js +97 -0
  40. package/src/client/services/file/file.service.js +2 -0
  41. package/src/client/services/user/user.service.js +1 -0
  42. package/src/client/ssr/Render.js +1 -1
  43. package/src/client/ssr/head/DefaultScripts.js +2 -0
  44. package/src/client/ssr/head/Seo.js +1 -0
  45. package/src/index.js +1 -1
  46. package/src/mailer/EmailRender.js +1 -1
  47. package/src/server/auth.js +4 -3
  48. package/src/server/client-build.js +2 -3
  49. package/src/server/client-formatted.js +40 -12
  50. package/src/server/conf.js +42 -3
  51. package/src/server/object-layer.js +196 -0
  52. package/src/server/runtime.js +18 -21
  53. package/src/server/ssr.js +52 -10
  54. package/src/server/valkey.js +89 -1
package/.env.development CHANGED
@@ -1,13 +1,45 @@
1
1
  DEPLOY_ID=dd-default
2
- DEFAULT_DEPLOY_ID=dd-default
3
2
  NODE_ENV=development
4
3
  PORT=4000
5
4
  JWT_SECRET=test
6
5
  REFRESH_EXPIRE_MINUTES=5
7
6
  ACCESS_EXPIRE_MINUTES=1440
8
7
  NODE_OPTIONS=--max-old-space-size=8192
9
- BASE_API=api
8
+ TIME_ZONE=changethis
9
+ GITHUB_TOKEN=changethis
10
+ GITHUB_USERNAME=changethis
11
+ GITHUB_BACKUP_REPO=changethis
12
+ GITHUB_DNS_REPO=changethis
13
+ DEFAULT_DEPLOY_ID=dd-default
10
14
  DEFAULT_DEPLOY_HOST=default.net
11
15
  DEFAULT_DEPLOY_PATH=/
16
+ MARIADB_HOST=changethis
17
+ MARIADB_USER=changethis
18
+ MARIADB_PASSWORD=changethis
19
+ DD_LAMPP_TEST_DB_0=changethis
20
+ WIFI=changethis
21
+ ROUTER=changethis
22
+ CLOUDINARY_CLOUD_NAME=changethis
23
+ CLOUDINARY_API_KEY=changethis
24
+ CLOUDINARY_API_SECRET=changethis
25
+ DB_PG_MAAS_NAME=changethis
26
+ DB_PG_MAAS_PASS=changethis
27
+ DB_PG_MAAS_USER=changethis
28
+ DB_PG_MAAS_HOST=127.0.0.1
29
+ DB_PG_MAAS_PORT=5432
30
+ MAAS_ADMIN_USERNAME=changethis
31
+ MAAS_API_KEY=changethis
32
+ MAAS_ADMIN_EMAIL=admin@default.net
33
+ MAAS_ADMIN_PASS=changethis
34
+ TFTP_ROOT=changethis
35
+ NETMASK=255.255.255.0
36
+ RPI4_INTERFACE_NAME=changethis
37
+ RPI4_IP=192.168.1.192
38
+ MAAS_DNS=8.8.8.8
39
+ MAAS_NTP_SERVER=changethis
40
+ NFS_EXPORT_PATH=changethis
41
+ RPI4_MAC_ADDRESS=changethis
42
+ NVIDIA_API_KEY=changethis
12
43
  DEFAULT_ADMIN_EMAIL=admin@default.net
13
- DEFAULT_ADMIN_PASSWORD=changethis
44
+ DEFAULT_ADMIN_PASSWORD=changethis
45
+ BASE_API=api
package/.env.production CHANGED
@@ -1,13 +1,50 @@
1
1
  DEPLOY_ID=dd-default
2
- DEFAULT_DEPLOY_ID=dd-default
3
2
  NODE_ENV=production
4
3
  PORT=3000
5
4
  JWT_SECRET=test
6
5
  REFRESH_EXPIRE_MINUTES=5
7
6
  ACCESS_EXPIRE_MINUTES=1440
8
7
  NODE_OPTIONS=--max-old-space-size=8192
9
- BASE_API=api
8
+ TIME_ZONE=changethis
9
+ GITHUB_TOKEN=changethis
10
+ GITHUB_USERNAME=changethis
11
+ GITHUB_BACKUP_REPO=changethis
12
+ GITHUB_DNS_REPO=changethis
13
+ DEFAULT_DEPLOY_ID=dd-default
10
14
  DEFAULT_DEPLOY_HOST=default.net
11
15
  DEFAULT_DEPLOY_PATH=/
16
+ MARIADB_HOST=changethis
17
+ MARIADB_USER=changethis
18
+ MARIADB_PASSWORD=changethis
19
+ DD_LAMPP_TEST_DB_0=changethis
20
+ WIFI=changethis
21
+ ROUTER=changethis
22
+ CLOUDINARY_CLOUD_NAME=changethis
23
+ CLOUDINARY_API_KEY=changethis
24
+ CLOUDINARY_API_SECRET=changethis
25
+ DB_PG_MAAS_NAME=changethis
26
+ DB_PG_MAAS_PASS=changethis
27
+ DB_PG_MAAS_USER=changethis
28
+ DB_PG_MAAS_HOST=127.0.0.1
29
+ DB_PG_MAAS_PORT=5432
30
+ MAAS_ADMIN_USERNAME=changethis
31
+ MAAS_API_KEY=changethis
32
+ MAAS_ADMIN_EMAIL=admin@default.net
33
+ MAAS_ADMIN_PASS=changethis
34
+ TFTP_ROOT=changethis
35
+ NETMASK=255.255.255.0
36
+ RPI4_INTERFACE_NAME=changethis
37
+ RPI4_IP=192.168.1.192
38
+ MAAS_DNS=8.8.8.8
39
+ MAAS_NTP_SERVER=changethis
40
+ NFS_EXPORT_PATH=changethis
41
+ RPI4_MAC_ADDRESS=changethis
42
+ NVIDIA_API_KEY=changethis
12
43
  DEFAULT_ADMIN_EMAIL=admin@default.net
13
- DEFAULT_ADMIN_PASSWORD=changethis
44
+ DEFAULT_ADMIN_PASSWORD=changethis
45
+ DEFAULT_SSH_USER=changethis
46
+ DEFAULT_SSH_HOST=changethis
47
+ DEFAULT_SSH_KEY_PATH=changethis
48
+ BASE_API=api
49
+ CERTBOT_LIVE_PATH=changethis
50
+ CERTBOT_LIVE_PATH_WINDOWS=changethis
package/.env.test CHANGED
@@ -1,13 +1,45 @@
1
1
  DEPLOY_ID=dd-default
2
- DEFAULT_DEPLOY_ID=dd-default
3
2
  NODE_ENV=test
4
3
  PORT=5000
5
4
  JWT_SECRET=test
6
5
  REFRESH_EXPIRE_MINUTES=5
7
6
  ACCESS_EXPIRE_MINUTES=1440
8
7
  NODE_OPTIONS=--max-old-space-size=8192
9
- BASE_API=api
8
+ TIME_ZONE=changethis
9
+ GITHUB_TOKEN=changethis
10
+ GITHUB_USERNAME=changethis
11
+ GITHUB_BACKUP_REPO=changethis
12
+ GITHUB_DNS_REPO=changethis
13
+ DEFAULT_DEPLOY_ID=dd-default
10
14
  DEFAULT_DEPLOY_HOST=default.net
11
15
  DEFAULT_DEPLOY_PATH=/
16
+ MARIADB_HOST=changethis
17
+ MARIADB_USER=changethis
18
+ MARIADB_PASSWORD=changethis
19
+ DD_LAMPP_TEST_DB_0=changethis
20
+ WIFI=changethis
21
+ ROUTER=changethis
22
+ CLOUDINARY_CLOUD_NAME=changethis
23
+ CLOUDINARY_API_KEY=changethis
24
+ CLOUDINARY_API_SECRET=changethis
25
+ DB_PG_MAAS_NAME=changethis
26
+ DB_PG_MAAS_PASS=changethis
27
+ DB_PG_MAAS_USER=changethis
28
+ DB_PG_MAAS_HOST=127.0.0.1
29
+ DB_PG_MAAS_PORT=5432
30
+ MAAS_ADMIN_USERNAME=changethis
31
+ MAAS_API_KEY=changethis
32
+ MAAS_ADMIN_EMAIL=admin@default.net
33
+ MAAS_ADMIN_PASS=changethis
34
+ TFTP_ROOT=changethis
35
+ NETMASK=255.255.255.0
36
+ RPI4_INTERFACE_NAME=changethis
37
+ RPI4_IP=192.168.1.192
38
+ MAAS_DNS=8.8.8.8
39
+ MAAS_NTP_SERVER=changethis
40
+ NFS_EXPORT_PATH=changethis
41
+ RPI4_MAC_ADDRESS=changethis
42
+ NVIDIA_API_KEY=changethis
12
43
  DEFAULT_ADMIN_EMAIL=admin@default.net
13
- DEFAULT_ADMIN_PASSWORD=changethis
44
+ DEFAULT_ADMIN_PASSWORD=changethis
45
+ BASE_API=api
@@ -30,9 +30,9 @@ jobs:
30
30
  echo "Starting remote release deploy"
31
31
  cd /home/dd/engine
32
32
  npm install -g underpost
33
- underpost config set GITHUB_TOKEN ${{ secrets.GITHUB_TOKEN }}
34
- node bin run --dev pull
35
33
  underpost run secret
34
+ underpost run pull
35
+ underpost run secret
36
+ underpost cmt . --empty ci docker-image-engine
36
37
  underpost run underpost-config
37
- node bin run --dev pull
38
38
  underpost run ssh-deploy engine-test
package/README.md CHANGED
@@ -51,6 +51,12 @@
51
51
 
52
52
 
53
53
 
54
+
55
+
56
+
57
+
58
+
59
+
54
60
 
55
61
 
56
62
 
@@ -61,7 +67,7 @@
61
67
  <!-- badges -->
62
68
 
63
69
 
64
- [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Socket Badge](https://socket.dev/api/badge/npm/package/underpost/2.8.877)](https://socket.dev/npm/package/underpost/overview/2.8.877) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](https://www.npmjs.com/package/underpost)
70
+ [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Socket Badge](https://socket.dev/api/badge/npm/package/underpost/2.8.881)](https://socket.dev/npm/package/underpost/overview/2.8.881) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](https://www.npmjs.com/package/underpost)
65
71
 
66
72
 
67
73
  <!-- end-badges -->
@@ -101,6 +107,12 @@
101
107
 
102
108
 
103
109
 
110
+
111
+
112
+
113
+
114
+
115
+
104
116
 
105
117
 
106
118
 
@@ -152,44 +164,44 @@ Run dev client server
152
164
  npm run dev
153
165
  ```
154
166
  <!-- -->
155
- ## underpost ci/cd cli v2.8.877
167
+ ## underpost ci/cd cli v2.8.881
156
168
 
157
169
  ### Usage: `underpost [options] [command]`
158
- ```
159
- Options:
160
- -V, --version output the version number
161
- -h, --help display help for command
170
+
171
+ ```
172
+ Options:
173
+ -V, --version output the version number
174
+ -h, --help display help for command
162
175
 
163
176
  Commands:
164
- new [options] <app-name> Initializes a new Underpost project with a predefined structure.
165
- start [options] <deploy-id> [env] Initiates application servers, build pipelines, or other defined services based on the deployment ID.
166
- clone [options] <uri> Clones a specified GitHub repository into the current directory.
167
- pull [options] <path> <uri> Pulls the latest changes from a specified GitHub repository.
168
- cmt [options] <path> <commit-type> [module-tag] [message] Manages commits to a GitHub repository, supporting various commit types and options.
169
- push [options] <path> <uri> Pushes committed changes from a local repository to a remote GitHub repository.
170
- env <deploy-id> [env] Sets environment variables and configurations related to a specific deployment ID.
171
- config [options] <operator> [key] [value] Manages Underpost configurations using various operators.
172
- root Displays the root path of the npm installation.
173
- cluster [options] [pod-name] Manages Kubernetes clusters, defaulting to Kind cluster initialization.
174
- deploy [options] [deploy-list] [env] Manages application deployments, defaulting to deploying development pods.
175
- secret [options] <platform> Manages secrets for various platforms.
176
- dockerfile-image-build [options] Builds a Docker image from a specified Dockerfile with various options for naming, saving, and loading.
177
- dockerfile-pull-base-images [options] Pulls required Underpost Dockerfile base images and optionally loads them into clusters.
178
- install Quickly imports Underpost npm dependencies by copying them.
179
- db [options] <deploy-list> Manages database operations, including import, export, and collection management.
180
- metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
181
- script [options] <operator> <script-name> [script-value] Supports a variety of built-in Underpost global scripts, their preset lifecycle events, and arbitrary custom scripts.
182
- cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
183
- fs [options] [path] Manages file storage, defaulting to file upload operations.
184
- test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
185
- monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
186
- ssh [options] Import and start ssh server and client based on current default deployment ID.
187
- run [options] <runner-id> [path] Runs a script from the specified path.
188
- lxd [options] Manages LXD containers and virtual machines.
189
- baremetal [options] [workflow-id] [hostname] [ip-address] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
190
- help [command] display help for command
191
-
177
+ new [options] <app-name> Initializes a new Underpost project with a predefined structure.
178
+ start [options] <deploy-id> [env] Initiates application servers, build pipelines, or other defined services based on the deployment ID.
179
+ clone [options] <uri> Clones a specified GitHub repository into the current directory.
180
+ pull [options] <path> <uri> Pulls the latest changes from a specified GitHub repository.
181
+ cmt [options] <path> <commit-type> [module-tag] [message] Manages commits to a GitHub repository, supporting various commit types and options.
182
+ push [options] <path> <uri> Pushes committed changes from a local repository to a remote GitHub repository.
183
+ env <deploy-id> [env] Sets environment variables and configurations related to a specific deployment ID.
184
+ config [options] <operator> [key] [value] Manages Underpost configurations using various operators.
185
+ root Displays the root path of the npm installation.
186
+ cluster [options] [pod-name] Manages Kubernetes clusters, defaulting to Kind cluster initialization.
187
+ deploy [options] [deploy-list] [env] Manages application deployments, defaulting to deploying development pods.
188
+ secret [options] <platform> Manages secrets for various platforms.
189
+ dockerfile-image-build [options] Builds a Docker image from a specified Dockerfile with various options for naming, saving, and loading.
190
+ dockerfile-pull-base-images [options] Pulls required Underpost Dockerfile base images and optionally loads them into clusters.
191
+ install Quickly imports Underpost npm dependencies by copying them.
192
+ db [options] <deploy-list> Manages database operations, including import, export, and collection management.
193
+ metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
194
+ script [options] <operator> <script-name> [script-value] Supports a variety of built-in Underpost global scripts, their preset lifecycle events, and arbitrary custom scripts.
195
+ cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
196
+ fs [options] [path] Manages file storage, defaulting to file upload operations.
197
+ test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
198
+ monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
199
+ ssh [options] Import and start ssh server and client based on current default deployment ID.
200
+ run [options] <runner-id> [path] Runs a script from the specified path.
201
+ lxd [options] Manages LXD containers and virtual machines.
202
+ baremetal [options] [workflow-id] [hostname] [ip-address] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
203
+ help [command] display help for command
204
+
192
205
  ```
193
-
206
+
194
207
  <a target="_top" href="https://github.com/underpostnet/pwa-microservices-template/blob/master/cli.md">See complete CLI Docs here.</a>
195
-
package/bin/deploy.js CHANGED
@@ -469,6 +469,7 @@ try {
469
469
  shellExec(`node bin new --deploy-id dd-default`);
470
470
  console.log(fs.existsSync(`./engine-private/conf/dd-default`));
471
471
  shellExec(`sudo rm -rf ./engine-private/conf/dd-default`);
472
+ shellExec(`node bin/deploy build-env`);
472
473
  break;
473
474
  }
474
475
 
@@ -535,6 +536,45 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
535
536
 
536
537
  break;
537
538
  }
539
+ case 'build-env': {
540
+ const buildEnv = (privateEnvPath, originEnv, env) => {
541
+ const privateEnv = dotenv.parse(fs.readFileSync(privateEnvPath, 'utf8'));
542
+ for (const key of Object.keys(privateEnv)) {
543
+ if (key in env) {
544
+ console.warn(`Key ${key} already exists in origin env`);
545
+ continue;
546
+ }
547
+ if (key in originEnv) {
548
+ console.warn(`Key ${key} already exists in origin env`);
549
+ env[key] = originEnv[key];
550
+ continue;
551
+ }
552
+ env[key] =
553
+ `${key}`.toUpperCase().match('API') ||
554
+ `${key}`.toUpperCase().match('KEY') ||
555
+ `${key}`.toUpperCase().match('SECRET') ||
556
+ `${key}`.toUpperCase().match('TOKEN') ||
557
+ `${key}`.toUpperCase().match('PASSWORD') ||
558
+ `${key}`.toUpperCase().match('MAC')
559
+ ? 'changethis'
560
+ : isNaN(parseFloat(privateEnv[key]))
561
+ ? `${privateEnv[key]}`.match(`@`)
562
+ ? 'admin@default.net'
563
+ : 'changethis'
564
+ : privateEnv[key];
565
+ }
566
+ return env;
567
+ };
568
+ for (let envPath of ['.env.development', '.env.production', '.env.test']) {
569
+ const originEnv = dotenv.parse(fs.readFileSync(`./${envPath}`, 'utf8'));
570
+
571
+ let env = {};
572
+ env = buildEnv(`./engine-private/conf/dd-cron/${envPath}`, originEnv, env);
573
+ env = buildEnv(`./engine-private/conf/dd-core/${envPath}`, originEnv, env);
574
+ writeEnv(envPath, env);
575
+ }
576
+ break;
577
+ }
538
578
 
539
579
  case 'update-default-conf': {
540
580
  const defaultServer = DefaultConf.server['default.net']['/'];