underpost 2.90.0 → 2.90.1

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 CHANGED
@@ -51,6 +51,8 @@ DEFAULT_SSH_KEY_PATH=changethis
51
51
  NPM_TOKEN=changethis
52
52
  NPM_USER=changethis
53
53
  NPM_PASSWORD=changethis
54
+ POSTMAN_EMAIL=admin@default.net
55
+ POSTMAN_PASSWORD=changethis
54
56
  BASE_API=api
55
57
  CERTBOT_LIVE_PATH=changethis
56
58
  CERTBOT_LIVE_PATH_WINDOWS=changethis
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  <!-- badges -->
20
20
 
21
- [![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.ci.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.90.0)](https://socket.dev/npm/package/underpost/overview/2.90.0) [![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)
21
+ [![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.ci.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.90.1)](https://socket.dev/npm/package/underpost/overview/2.90.1) [![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)
22
22
 
23
23
  <!-- end-badges -->
24
24
 
@@ -66,7 +66,7 @@ Run dev client server
66
66
  npm run dev
67
67
  ```
68
68
  <!-- -->
69
- ## underpost ci/cd cli v2.90.0
69
+ ## underpost ci/cd cli v2.90.1
70
70
 
71
71
  ### Usage: `underpost [options] [command]`
72
72
  ```
@@ -82,6 +82,7 @@ Commands:
82
82
  cmt [options] [path] [commit-type] [module-tag] [message] Manages commits to a GitHub repository, supporting various commit types and options.
83
83
  push [options] <path> <uri> Pushes committed changes from a local repository to a remote GitHub repository.
84
84
  env [deploy-id] [env] [subConf] Sets environment variables and configurations related to a specific deployment ID.
85
+ static [options] Manages static build of page, bundles, and documentation.
85
86
  config [options] <operator> [key] [value] Manages Underpost configurations using various operators.
86
87
  root Displays the root path of the npm installation.
87
88
  ip [options] Displays the current public machine IP addresses.
package/bin/build.js CHANGED
@@ -172,6 +172,10 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
172
172
  fs.copyFileSync(`./src/api/object-layer/README.md`, `${basePath}/README.md`);
173
173
  fs.copySync(`./hardhat`, `${basePath}/hardhat`);
174
174
  fs.copySync(`./hardhat/white-paper.md`, `${basePath}/white-paper.md`);
175
+ fs.copySync(
176
+ `./src/client/ssr/pages/CyberiaServerMetrics.js`,
177
+ `${basePath}/src/client/ssr/pages/CyberiaServerMetrics.js`,
178
+ );
175
179
  default:
176
180
  break;
177
181
  }
package/cli.md CHANGED
@@ -1,4 +1,4 @@
1
- ## underpost ci/cd cli v2.90.0
1
+ ## underpost ci/cd cli v2.90.1
2
2
 
3
3
  ### Usage: `underpost [options] [command]`
4
4
  ```
@@ -14,6 +14,7 @@ Commands:
14
14
  cmt [options] [path] [commit-type] [module-tag] [message] Manages commits to a GitHub repository, supporting various commit types and options.
15
15
  push [options] <path> <uri> Pushes committed changes from a local repository to a remote GitHub repository.
16
16
  env [deploy-id] [env] [subConf] Sets environment variables and configurations related to a specific deployment ID.
17
+ static [options] Manages static build of page, bundles, and documentation.
17
18
  config [options] <operator> [key] [value] Manages Underpost configurations using various operators.
18
19
  root Displays the root path of the npm installation.
19
20
  ip [options] Displays the current public machine IP addresses.
@@ -194,6 +195,33 @@ Options:
194
195
  ```
195
196
 
196
197
 
198
+ ### `static` :
199
+ ```
200
+ Usage: underpost static [options]
201
+
202
+ Manages static build of page, bundles, and documentation.
203
+
204
+ Options:
205
+ --page <ssr-component-path> Build custom static pages.
206
+ --title <title> Sets a custom title for the static page.
207
+ --output-path <output-path> Sets the output path for the generated static
208
+ page.
209
+ --deploy-id <deploy-id> Build static assets for a specific deployment
210
+ ID.
211
+ --build Triggers the static build process for the
212
+ specified deployment ID.
213
+ --build-host <build-host> Sets a custom build host for static documents or
214
+ assets.
215
+ --build-path <build-path> Sets a custom build path for static documents or
216
+ assets.
217
+ --env <env> Sets the environment for the static build (e.g.,
218
+ "development", "production").
219
+ --dev Sets the development cli context
220
+ -h, --help display help for command
221
+
222
+ ```
223
+
224
+
197
225
  ### `config` :
198
226
  ```
199
227
  Usage: underpost config [options] <operator> [key] [value]
@@ -17,7 +17,7 @@ spec:
17
17
  spec:
18
18
  containers:
19
19
  - name: dd-default-development-blue
20
- image: localhost/rockylinux9-underpost:v2.90.0
20
+ image: localhost/rockylinux9-underpost:v2.90.1
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:v2.90.0
103
+ image: localhost/rockylinux9-underpost:v2.90.1
104
104
  # resources:
105
105
  # requests:
106
106
  # memory: "124Ki"
@@ -18,7 +18,7 @@ spec:
18
18
  spec:
19
19
  containers:
20
20
  - name: dd-test-development-blue
21
- image: localhost/rockylinux9-underpost:v2.90.0
21
+ image: localhost/rockylinux9-underpost:v2.90.1
22
22
 
23
23
  command:
24
24
  - /bin/sh
@@ -103,7 +103,7 @@ spec:
103
103
  spec:
104
104
  containers:
105
105
  - name: dd-test-development-green
106
- image: localhost/rockylinux9-underpost:v2.90.0
106
+ image: localhost/rockylinux9-underpost:v2.90.1
107
107
 
108
108
  command:
109
109
  - /bin/sh
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "main": "src/index.js",
4
4
  "name": "underpost",
5
- "version": "2.90.0",
5
+ "version": "2.90.1",
6
6
  "description": "pwa api rest template",
7
7
  "scripts": {
8
8
  "start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
package/src/cli/index.js CHANGED
@@ -9,6 +9,7 @@ import UnderpostBaremetal from './baremetal.js';
9
9
  import UnderpostRun from './run.js';
10
10
  import Dns from '../server/dns.js';
11
11
  import { pbcopy } from '../server/process.js';
12
+ import UnderpostStatic from './static.js';
12
13
 
13
14
  // Load environment variables from .env file
14
15
  const underpostRootPath = getUnderpostRootPath();
@@ -115,6 +116,22 @@ program
115
116
  loadConf(deployId, subConf);
116
117
  });
117
118
 
119
+ // 'static' command: Manage static configurations
120
+ program
121
+ .command('static')
122
+ .option('--page <ssr-component-path>', 'Build custom static pages.')
123
+ .option('--title <title>', 'Sets a custom title for the static page.')
124
+ .option('--output-path <output-path>', 'Sets the output path for the generated static page.')
125
+
126
+ .option('--deploy-id <deploy-id>', 'Build static assets for a specific deployment ID.')
127
+ .option('--build', 'Triggers the static build process for the specified deployment ID.')
128
+ .option('--build-host <build-host>', 'Sets a custom build host for static documents or assets.')
129
+ .option('--build-path <build-path>', 'Sets a custom build path for static documents or assets.')
130
+ .option('--env <env>', 'Sets the environment for the static build (e.g., "development", "production").')
131
+ .option('--dev', 'Sets the development cli context')
132
+ .description(`Manages static build of page, bundles, and documentation.`)
133
+ .action(UnderpostStatic.API.callback);
134
+
118
135
  // 'config' command: Manage Underpost configurations
119
136
  program
120
137
  .command('config')
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Static site generation module
3
+ * @module src/cli/static.js
4
+ * @namespace UnderpostStatic
5
+ */
6
+
7
+ import fs from 'fs-extra';
8
+ import { ssrFactory } from '../server/ssr.js';
9
+ import { shellExec } from '../server/process.js';
10
+ import Underpost from '../index.js';
11
+ import { JSONweb } from '../server/client-formatted.js';
12
+
13
+ /**
14
+ * @class UnderpostStatic
15
+ * @description Static site generation class
16
+ * @memberof UnderpostStatic
17
+ */
18
+ class UnderpostStatic {
19
+ static API = {
20
+ /**
21
+ * Generate static HTML file
22
+ * @param {Object} options - Options for static generation
23
+ * @param {string} options.page - Page identifier
24
+ * @param {string} options.title - Page title
25
+ * @param {string} options.outputPath - Output file path
26
+ * @param {string} options.deployId - Deployment identifier
27
+ * @param {string} options.buildHost - Build host
28
+ * @param {string} options.buildPath - Build path
29
+ * @param {string} options.env - Environment (development/production)
30
+ * @param {boolean} options.build - Whether to trigger build
31
+ * @param {boolean} options.dev - Development mode flag
32
+ * @memberof UnderpostStatic
33
+ * @returns {Promise<void>}
34
+ */
35
+ async callback(
36
+ options = {
37
+ page: '',
38
+ title: '',
39
+ outputPath: '',
40
+ deployId: '',
41
+ buildHost: '',
42
+ buildPath: '',
43
+ env: '',
44
+ build: false,
45
+ dev: false,
46
+ },
47
+ ) {
48
+ if (!options.outputPath) options.outputPath = '.';
49
+ if (!options.buildPath) options.buildPath = '/';
50
+ if (!options.env) options.env = 'production';
51
+
52
+ if (options.page) {
53
+ const Render = await ssrFactory();
54
+ const SsrComponent = await ssrFactory(options.page);
55
+ const htmlSrc = Render({
56
+ title: options.title || 'Home',
57
+ ssrPath: '/',
58
+ ssrHeadComponents: '',
59
+ ssrBodyComponents: SsrComponent(),
60
+ // buildId: options.deployId || 'local',
61
+ renderPayload: {
62
+ // apiBaseProxyPath,
63
+ // apiBaseHost,
64
+ // apiBasePath: process.env.BASE_API,
65
+ version: Underpost.version,
66
+ ...(options.env === 'development' ? { dev: true } : undefined),
67
+ },
68
+ renderApi: {
69
+ JSONweb,
70
+ },
71
+ });
72
+ fs.writeFileSync(options.outputPath, htmlSrc, 'utf8');
73
+ }
74
+ if (options.deployId && options.build) {
75
+ shellExec(`underpost env ${options.deployId} ${options.env}`);
76
+ shellExec(
77
+ `npm run build ${options.deployId}${options.buildHost ? ` ${options.buildHost} ${options.buildPath}` : ``}`,
78
+ );
79
+ }
80
+ },
81
+ };
82
+ }
83
+
84
+ export default UnderpostStatic;
package/src/index.js CHANGED
@@ -20,6 +20,7 @@ import UnderpostRun from './cli/run.js';
20
20
  import UnderpostScript from './cli/script.js';
21
21
  import UnderpostSecret from './cli/secrets.js';
22
22
  import UnderpostSSH from './cli/ssh.js';
23
+ import UnderpostStatic from './cli/static.js';
23
24
  import UnderpostTest from './cli/test.js';
24
25
  import UnderpostStartUp from './server/start.js';
25
26
 
@@ -35,7 +36,7 @@ class Underpost {
35
36
  * @type {String}
36
37
  * @memberof Underpost
37
38
  */
38
- static version = 'v2.90.0';
39
+ static version = 'v2.90.1';
39
40
  /**
40
41
  * Repository cli API
41
42
  * @static
@@ -64,6 +65,14 @@ class Underpost {
64
65
  * @memberof Underpost
65
66
  */
66
67
  static start = UnderpostStartUp.API;
68
+ /**
69
+ * Static cli API
70
+ * @static
71
+ * @type {UnderpostStatic.API}
72
+ * @memberof Underpost
73
+ */
74
+ static static = UnderpostStatic.API;
75
+
67
76
  /**
68
77
  * Cluster cli API
69
78
  * @static
@@ -519,21 +519,15 @@ const buildClient = async (options = { liveClientBuildPaths: [], instances: [],
519
519
 
520
520
  for (const ssrBodyComponent of confSSR[view.ssr].body) {
521
521
  const SrrComponent = await ssrFactory(`./src/client/ssr/body/${ssrBodyComponent}.js`);
522
- if (ssrBodyComponent.match('SplashScreen')) {
523
- if (backgroundImage)
524
- ssrBodyComponents += SrrComponent({
525
- ...metadata,
526
- backgroundImage: (path === '/' ? path : `${path}/`) + backgroundImage,
527
- });
528
- else ssrBodyComponents += SrrComponent({ metadata });
529
- } else
530
- ssrBodyComponents += SrrComponent({
531
- ssrPath,
532
- host,
533
- path,
534
- ttiLoadTimeLimit,
535
- version: Underpost.version,
536
- });
522
+ ssrBodyComponents += SrrComponent({
523
+ ...metadata,
524
+ ssrPath,
525
+ host,
526
+ path,
527
+ ttiLoadTimeLimit,
528
+ version: Underpost.version,
529
+ backgroundImage: backgroundImage ? (path === '/' ? path : `${path}/`) + backgroundImage : undefined,
530
+ });
537
531
  }
538
532
  }
539
533