@underpostnet/cyberia 3.3.76 → 3.4.0

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 (132) hide show
  1. package/.env.example +1 -0
  2. package/.github/workflows/coverall.cyberia.ci.yml +17 -3
  3. package/.github/workflows/cyberia-client.cd.yml +2 -1
  4. package/.github/workflows/cyberia-server.cd.yml +2 -1
  5. package/.github/workflows/docker-image.cyberia-client.ci.yml +1 -1
  6. package/.github/workflows/docker-image.cyberia-client.dev.ci.yml +1 -1
  7. package/.github/workflows/docker-image.cyberia-server.ci.yml +1 -1
  8. package/.github/workflows/docker-image.cyberia-server.dev.ci.yml +1 -1
  9. package/.github/workflows/docker-image.engine-cyberia.ci.yml +1 -1
  10. package/.github/workflows/docker-image.engine-cyberia.dev.ci.yml +1 -1
  11. package/.github/workflows/engine-cyberia.ci.yml +7 -1
  12. package/.github/workflows/ghpkg.ci.yml +19 -2
  13. package/.github/workflows/gitlab.ci.yml +8 -6
  14. package/.github/workflows/hardhat.ci.yml +4 -1
  15. package/.github/workflows/npmpkg.ci.yml +9 -5
  16. package/.github/workflows/publish.ci.yml +21 -12
  17. package/.github/workflows/publish.cyberia.ci.yml +25 -14
  18. package/.github/workflows/pwa-microservices-template-page.cd.yml +4 -2
  19. package/CHANGELOG.md +110 -262
  20. package/CLI-HELP.md +29 -2
  21. package/Dockerfile +1 -1
  22. package/Dockerfile.dev +1 -1
  23. package/Dockerfile.test +1 -1
  24. package/README.md +1 -1
  25. package/bin/build.js +67 -14
  26. package/bin/cyberia.js +4 -4
  27. package/bin/index.js +4 -4
  28. package/compose.env +1 -0
  29. package/conf.js +1 -1043
  30. package/deploy/cyberia-client/deploy.sh +13 -11
  31. package/deploy/cyberia-server/deploy.sh +13 -11
  32. package/deploy/dd-cyberia/sync-deploy.sh +7 -28
  33. package/deploy/lib/config.sh +1 -1
  34. package/deploy/lib/github-actions-logging.sh +3 -2
  35. package/deploy/lib/host.sh +1 -1
  36. package/deploy/pwa-microservices-template/deploy.sh +7 -1
  37. package/deployment.yaml +1 -1
  38. package/docker-compose.yml +7 -7
  39. package/docs/coverage/cyberia/api/cyberia-instance/cyberia-fallback-capture.js.html +1591 -0
  40. package/docs/coverage/cyberia/api/cyberia-instance/index.html +116 -0
  41. package/docs/coverage/cyberia/api/cyberia-server-defaults/cyberia-server-defaults.js.html +4138 -0
  42. package/docs/coverage/cyberia/api/cyberia-server-defaults/index.html +116 -0
  43. package/docs/coverage/cyberia/api/object-layer/index.html +116 -0
  44. package/docs/coverage/cyberia/api/object-layer/object-layer.model.js.html +1393 -0
  45. package/docs/coverage/cyberia/base.css +362 -0
  46. package/docs/coverage/cyberia/block-navigation.js +82 -0
  47. package/docs/coverage/cyberia/favicon.png +0 -0
  48. package/docs/coverage/cyberia/index.html +161 -0
  49. package/docs/coverage/cyberia/prettify.css +101 -0
  50. package/docs/coverage/cyberia/prettify.js +937 -0
  51. package/docs/coverage/cyberia/projects/cyberia/atlas-sprite-sheet-generator.js.html +1315 -0
  52. package/docs/coverage/cyberia/projects/cyberia/index.html +176 -0
  53. package/docs/coverage/cyberia/projects/cyberia/instance-backup.js.html +715 -0
  54. package/docs/coverage/cyberia/projects/cyberia/instance-data.js.html +2182 -0
  55. package/docs/coverage/cyberia/projects/cyberia/shape-generator.js.html +3265 -0
  56. package/docs/coverage/cyberia/projects/cyberia/stat-balance.js.html +328 -0
  57. package/docs/coverage/cyberia/sort-arrow-sprite.png +0 -0
  58. package/docs/coverage/cyberia/sorter.js +205 -0
  59. package/hardhat/package-lock.json +6 -6
  60. package/hardhat/package.json +2 -2
  61. package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
  62. package/manifests/cronjobs/dd-cron/dd-cron-vultr.yaml +1 -1
  63. package/manifests/deployment/dd-cyberia-development/deployment.yaml +1 -1
  64. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  65. package/package.json +19 -17
  66. package/scripts/test-monitor.sh +1 -1
  67. package/src/api/file/file.router.js +7 -1
  68. package/src/cli/baremetal.js +1 -1
  69. package/src/cli/cluster.js +73 -18
  70. package/src/cli/deploy.js +211 -30
  71. package/src/cli/docker-compose.js +1 -1
  72. package/src/cli/index.js +36 -0
  73. package/src/cli/kubectl.js +4 -3
  74. package/src/cli/release.js +5 -1
  75. package/src/cli/repository.js +14 -11
  76. package/src/cli/run.js +10 -3
  77. package/src/cli/secrets.js +393 -200
  78. package/src/cli/socketsecurity.js +260 -0
  79. package/src/client/components/core/Badge.js +0 -1
  80. package/src/client/components/core/CssCore.js +11 -1
  81. package/src/client/components/core/Modal.js +189 -66
  82. package/src/client/components/core/SearchBox.js +0 -1
  83. package/src/client/components/core/ToolTip.js +15 -0
  84. package/src/client/components/cryptokoyn/AppShellCryptokoyn.js +0 -2
  85. package/src/client/components/cyberia-portal/RouterCyberiaPortal.js +0 -4
  86. package/src/client/components/default/AppShellDefault.js +1 -4
  87. package/src/client/components/itemledger/AppShellItemledger.js +0 -2
  88. package/src/client/components/underpost/AppShellUnderpost.js +12 -0
  89. package/src/client/components/underpost/CssUnderpost.js +15 -2
  90. package/src/client/public/cyberia-docs/CYBERIA-CLIENT.md +8 -0
  91. package/src/client/public/cyberia-docs/CYBERIA.md +1 -1
  92. package/src/client/public/cyberia-docs/OFF-CHAIN-ECONOMY.md +54 -56
  93. package/src/client/public/cyberia-docs/ROADMAP.md +1 -1
  94. package/src/client/public/cyberia-docs/UNDERPOST-PLATFORM.md +30 -29
  95. package/src/client/public/cyberia-docs/WHITE-PAPER.md +1 -1
  96. package/src/client/ssr/body/UnderpostDefaultSplashScreen.js +54 -25
  97. package/src/client/ssr/head/Css.js +12 -10
  98. package/src/client/ssr/views/Cyberia404.js +9 -13
  99. package/src/client/ssr/views/NotFound.js +75 -0
  100. package/src/client-builder/client-bundle.js +2 -2
  101. package/src/index.js +13 -1
  102. package/src/runtime/engine-cyberia/Dockerfile +1 -1
  103. package/src/runtime/engine-cyberia/Dockerfile.dev +1 -1
  104. package/src/runtime/engine-cyberia/Dockerfile.test +1 -1
  105. package/src/runtime/engine-cyberia/compose.env +1 -0
  106. package/src/runtime/engine-cyberia/docker-compose.yml +7 -7
  107. package/src/server/build/catalog.js +1 -0
  108. package/src/server/build/execution.js +19 -5
  109. package/src/server/build/package.js +166 -3
  110. package/src/server/build/testing.js +2 -1
  111. package/src/server/network/underpost-gateway.js +113 -14
  112. package/src/server/runtime/conf.js +57 -7
  113. package/src/server/runtime/config-scope.js +2 -0
  114. package/src/server/runtime/process.js +4 -3
  115. package/src/server/runtime/start.js +11 -2
  116. package/src/server/security/socketsecurity.js +1735 -0
  117. package/test/integration/infra/1-security/config-scope.test.js +3 -0
  118. package/test/integration/infra/1-security/socketsecurity.test.js +1041 -0
  119. package/test/integration/infra/1-security/sops-secret-store.test.js +201 -71
  120. package/test/integration/infra/4-ingress/underpost-ingress.test.js +1 -1
  121. package/test/unit/build-template.test.js +24 -0
  122. package/test/unit/catalog.test.js +13 -2
  123. package/test/unit/conf-resolution.test.js +41 -7
  124. package/test/unit/cyberia/instance-data.test.js +314 -0
  125. package/test/unit/deploy-legacy-gateway-sweep.test.js +63 -0
  126. package/test/unit/deploy-log-table.test.js +38 -0
  127. package/test/unit/execution-profiles.test.js +1 -0
  128. package/test/unit/gateway-pod-fetch.test.js +95 -0
  129. package/test/unit/letsencrypt-issuer.test.js +101 -0
  130. package/test/unit/package.test.js +118 -0
  131. package/test/unit/release-bump.test.js +3 -1
  132. package/test/unit/start-options.test.js +12 -0
package/bin/build.js CHANGED
@@ -8,12 +8,18 @@ import {
8
8
  getPathsSSR,
9
9
  syncPrivateConf,
10
10
  syncDeployIdSources,
11
+ syncDeployIdSourcesBack,
11
12
  buildTemplate,
13
+ templateGitignoreFactory,
12
14
  updatePrivateEngineTestRepo,
13
15
  } from '../src/server/runtime/conf.js';
14
16
  import { resolveDeployList } from '../src/server/network/router.js';
15
17
  import { loadDeployCatalog } from '../src/server/build/catalog.js';
16
- import { buildProductPackageJson, productPackageOptionsFactory } from '../src/server/build/package.js';
18
+ import {
19
+ buildProductPackageJson,
20
+ installDeployDependencies,
21
+ productPackageOptionsFactory,
22
+ } from '../src/server/build/package.js';
17
23
  import {
18
24
  COVERAGE_BUNDLE_DIRECTORY,
19
25
  bundleCoverageReports,
@@ -38,13 +44,16 @@ const basePath = '../pwa-microservices-template';
38
44
  * SSR assets, manifests, and packaging declared by its conf into the template repo.
39
45
  * @param {string} confName - A concrete deploy id (e.g. `dd-prototype`).
40
46
  */
41
- const buildDeployTemplate = async (confName) => {
47
+ const buildDeployTemplate = async (confName, { force = false } = {}) => {
42
48
  const repoName = Underpost.repo.engineRepoFactory(confName);
43
49
  const catalog = await loadDeployCatalog(confName);
44
50
 
45
51
  if (catalog.sourceMoves.length) {
46
52
  Underpost.repo.sparseCheckoutDirectory(`conf/${confName}`);
47
- if (catalog.sourceMoves.some(([src]) => !fs.existsSync(src))) Underpost.repo.pullSourceRepo(repoName);
53
+ // Only a path neither tree holds needs the repo: one the engine holds is mirrored out.
54
+ // --force pulls regardless, to bring the repo up to date before the mirror.
55
+ if (force || catalog.sourceMoves.some(([src, dest]) => !fs.existsSync(src) && !fs.existsSync(dest)))
56
+ Underpost.repo.pullSourceRepo(repoName);
48
57
  }
49
58
  syncDeployIdSources(catalog.sourceMoves);
50
59
 
@@ -199,10 +208,7 @@ const buildDeployTemplate = async (confName) => {
199
208
  if (fs.existsSync(`./src/ws/${confName.split('-')[1]}`)) {
200
209
  fs.copySync(`./src/ws/${confName.split('-')[1]}`, `${basePath}/src/ws/${confName.split('-')[1]}`);
201
210
  }
202
- fs.writeFileSync(
203
- `${basePath}/.gitignore`,
204
- fs.readFileSync(`.gitignore`, 'utf8').split('# Ignore ERP / CRM custom prototypes src')[0],
205
- );
211
+ fs.writeFileSync(`${basePath}/.gitignore`, templateGitignoreFactory());
206
212
 
207
213
  // Process catalog copies — each [src, dest] pair is copied from engine root to the template target.
208
214
  if (catalog.copies && catalog.copies.length) {
@@ -227,11 +233,32 @@ const buildDeployTemplate = async (confName) => {
227
233
 
228
234
  /**
229
235
  * The coverage reports a deploy id's conf declares, as {@link deployCoverageReports} reads them.
236
+ * The conf is fetched when this checkout does not carry it yet: a CI runner builds from a bare
237
+ * engine tree, and a deploy without source moves never pulls its conf through the assembly.
230
238
  * @param {string} deployId - A concrete deploy id.
231
239
  * @returns {Array<{id: string, suite?: string, path?: string}>}
232
240
  */
233
- const deployReports = (deployId) =>
234
- deployCoverageReports(JSON.parse(fs.readFileSync(`./engine-private/conf/${deployId}/conf.server.json`, 'utf8')));
241
+ const deployReports = (deployId) => {
242
+ Underpost.repo.sparseCheckoutDirectory(`conf/${deployId}`);
243
+ return deployCoverageReports(
244
+ JSON.parse(fs.readFileSync(`./engine-private/conf/${deployId}/conf.server.json`, 'utf8')),
245
+ );
246
+ };
247
+
248
+ /**
249
+ * Runs, once each, the test suites the deploy ids' coverage reports name. A product suite
250
+ * imports the modules its catalog pins, so those dependencies are installed into this
251
+ * checkout first — the same install a product deploy performs before it builds.
252
+ * @param {string[]} deployIds - Concrete deploy ids.
253
+ */
254
+ const runDeployCoverage = async (deployIds) => {
255
+ const suites = new Set();
256
+ for (const deployId of deployIds) {
257
+ await installDeployDependencies(deployId);
258
+ for (const { suite } of deployReports(deployId)) if (suite) suites.add(suite);
259
+ }
260
+ for (const suite of suites) shellExec(coverageReportCommand({ suite }));
261
+ };
235
262
 
236
263
  /**
237
264
  * Carries this build stage's coverage HTML reports into the assembled template, so every
@@ -272,6 +299,16 @@ program
272
299
  'After assembling each deploy id, publish it to its private test source repo (underpostnet/engine-test-<id>) for isolated test deploys.',
273
300
  false,
274
301
  )
302
+ .option(
303
+ '--force',
304
+ 'Always pull each deploy id source repo (e.g. ../engine-prototype) before syncing its sourceMoves, instead of only when a path is missing from both trees.',
305
+ false,
306
+ )
307
+ .option(
308
+ '--sync-sources',
309
+ 'Copy each deploy id catalog sourceMoves path from this tree back to its source repo (e.g. ../engine-prototype) and exit (no template assembly). The engine ignores these paths, so the change is reviewed and committed there.',
310
+ false,
311
+ )
275
312
  .action(async (confName, env, options) => {
276
313
  const deployList = resolveDeployList(confName);
277
314
  logger.info('Build repository', { confName, basePath, deployList, conf: !!options.conf });
@@ -284,20 +321,36 @@ program
284
321
  return;
285
322
  }
286
323
 
324
+ if (options.syncSources) {
325
+ for (const deployId of deployList) {
326
+ const { sourceMoves } = await loadDeployCatalog(deployId);
327
+ if (!sourceMoves.length) {
328
+ logger.warn('No sourceMoves declared; nothing to sync back', { deployId });
329
+ continue;
330
+ }
331
+ const mirrored = syncDeployIdSourcesBack(sourceMoves);
332
+ for (const src of mirrored) logger.info('Build sync source', src);
333
+ if (mirrored.length !== sourceMoves.length)
334
+ logger.warn('Some declared sources are not in this tree and were left as they are in the source repo', {
335
+ deployId,
336
+ hint: `node bin/build ${deployId}`,
337
+ skipped: sourceMoves.length - mirrored.length,
338
+ });
339
+ }
340
+ return;
341
+ }
342
+
287
343
  // Tests run here, in the build stage, and once per declared suite: the artifact carries
288
344
  // each report so no container ever has to produce its own. Refreshing is opt-in because
289
345
  // a template assembly is not otherwise a test run.
290
- if (options.coverage) {
291
- const suites = new Set(deployList.flatMap(deployReports).flatMap(({ suite }) => (suite ? [suite] : [])));
292
- for (const suite of suites) shellExec(coverageReportCommand({ suite }));
293
- }
346
+ if (options.coverage) await runDeployCoverage(deployList);
294
347
 
295
348
  for (const deployId of deployList) {
296
349
  // Reconstruct the base template from 0 before each deploy id so neither a previous
297
350
  // build run nor the deploy id assembled before this one leaks into it. Opt out with
298
351
  // --no-template-rebuild.
299
352
  if (options.templateRebuild) await buildTemplate({ toPath: basePath });
300
- await buildDeployTemplate(deployId);
353
+ await buildDeployTemplate(deployId, { force: options.force });
301
354
  bundleDeployCoverage(deployId);
302
355
  // Publish the just-assembled tree to the deploy id's private test repo so a
303
356
  // pod started with `--private-test-repo` clones this work-in-progress source.
package/bin/cyberia.js CHANGED
@@ -5100,7 +5100,7 @@ node bin test cyberia --grep 'Cyberia load'`);
5100
5100
  // no funca
5101
5101
  if (options.loadTar) {
5102
5102
  for (const imageId of dockerImageIds)
5103
- if (imageId === id || id === '.') shellExec(`docker load -i ./${imageId}-dev_v3.3.76.tar`);
5103
+ if (imageId === id || id === '.') shellExec(`docker load -i ./${imageId}-dev_v3.4.0.tar`);
5104
5104
  return;
5105
5105
  }
5106
5106
  switch (id) {
@@ -5112,7 +5112,7 @@ node bin/build dd-cyberia --update-private
5112
5112
  node bin image --path src/runtime/engine-cyberia \
5113
5113
  --docker-compose --pull-base --build \
5114
5114
  --dockerfile-name Dockerfile.dev \
5115
- --image-name engine-cyberia-dev:v3.3.76 \
5115
+ --image-name engine-cyberia-dev:v3.4.0 \
5116
5116
  --image-out-path .
5117
5117
  `);
5118
5118
  break;
@@ -5124,7 +5124,7 @@ cp -f src/runtime/cyberia-server/Dockerfile.dev cyberia-server/Dockerfile.dev
5124
5124
  node bin image --path cyberia-server \
5125
5125
  --docker-compose --pull-base --build \
5126
5126
  --dockerfile-name Dockerfile.dev \
5127
- --image-name cyberia-server-dev:v3.3.76 \
5127
+ --image-name cyberia-server-dev:v3.4.0 \
5128
5128
  --image-out-path .
5129
5129
  `);
5130
5130
  break;
@@ -5135,7 +5135,7 @@ cp -f src/runtime/cyberia-client/Dockerfile.dev cyberia-client/Dockerfile.dev
5135
5135
  node bin image --path cyberia-client \
5136
5136
  --docker-compose --pull-base --build \
5137
5137
  --dockerfile-name Dockerfile.dev \
5138
- --image-name cyberia-client-dev:v3.3.76 \
5138
+ --image-name cyberia-client-dev:v3.4.0 \
5139
5139
  --image-out-path .
5140
5140
  `);
5141
5141
  break;
package/bin/index.js CHANGED
@@ -5100,7 +5100,7 @@ node bin test cyberia --grep 'Cyberia load'`);
5100
5100
  // no funca
5101
5101
  if (options.loadTar) {
5102
5102
  for (const imageId of dockerImageIds)
5103
- if (imageId === id || id === '.') shellExec(`docker load -i ./${imageId}-dev_v3.3.76.tar`);
5103
+ if (imageId === id || id === '.') shellExec(`docker load -i ./${imageId}-dev_v3.4.0.tar`);
5104
5104
  return;
5105
5105
  }
5106
5106
  switch (id) {
@@ -5112,7 +5112,7 @@ node bin/build dd-cyberia --update-private
5112
5112
  node bin image --path src/runtime/engine-cyberia \
5113
5113
  --docker-compose --pull-base --build \
5114
5114
  --dockerfile-name Dockerfile.dev \
5115
- --image-name engine-cyberia-dev:v3.3.76 \
5115
+ --image-name engine-cyberia-dev:v3.4.0 \
5116
5116
  --image-out-path .
5117
5117
  `);
5118
5118
  break;
@@ -5124,7 +5124,7 @@ cp -f src/runtime/cyberia-server/Dockerfile.dev cyberia-server/Dockerfile.dev
5124
5124
  node bin image --path cyberia-server \
5125
5125
  --docker-compose --pull-base --build \
5126
5126
  --dockerfile-name Dockerfile.dev \
5127
- --image-name cyberia-server-dev:v3.3.76 \
5127
+ --image-name cyberia-server-dev:v3.4.0 \
5128
5128
  --image-out-path .
5129
5129
  `);
5130
5130
  break;
@@ -5135,7 +5135,7 @@ cp -f src/runtime/cyberia-client/Dockerfile.dev cyberia-client/Dockerfile.dev
5135
5135
  node bin image --path cyberia-client \
5136
5136
  --docker-compose --pull-base --build \
5137
5137
  --dockerfile-name Dockerfile.dev \
5138
- --image-name cyberia-client-dev:v3.3.76 \
5138
+ --image-name cyberia-client-dev:v3.4.0 \
5139
5139
  --image-out-path .
5140
5140
  `);
5141
5141
  break;
package/compose.env CHANGED
@@ -24,6 +24,7 @@ IPFS_CLUSTER_IMAGE=ipfs/ipfs-cluster:latest
24
24
  # The engine-cyberia image ships only the underpost CLI; at start it runs the
25
25
  # `underpost start --build` bootstrap, which clones ${GITHUB_USERNAME}/engine-cyberia.
26
26
  GITHUB_USERNAME=underpostnet
27
+ GITHUB_ORG_NAME=underpost
27
28
  GITHUB_TOKEN=change_me_private_repo_token
28
29
 
29
30
  # --- MongoDB (translation of Secret mongodb-secret) --------------------------