cyberia 3.2.12 → 3.2.22

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 (55) hide show
  1. package/.github/workflows/engine-cyberia.cd.yml +1 -0
  2. package/.github/workflows/engine-cyberia.ci.yml +14 -2
  3. package/.github/workflows/ghpkg.ci.yml +1 -0
  4. package/.github/workflows/npmpkg.ci.yml +9 -5
  5. package/CHANGELOG.md +151 -1
  6. package/CLI-HELP.md +975 -1130
  7. package/bin/build.js +97 -136
  8. package/bin/build.template.js +25 -179
  9. package/bin/cyberia.js +11 -6
  10. package/bin/deploy.js +4 -1
  11. package/bin/index.js +11 -6
  12. package/conf.js +1 -0
  13. package/deployment.yaml +74 -2
  14. package/hardhat/package-lock.json +4 -4
  15. package/hardhat/package.json +1 -1
  16. package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +2 -2
  17. package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
  18. package/manifests/deployment/dd-cyberia-development/deployment.yaml +74 -2
  19. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  20. package/package.json +7 -7
  21. package/scripts/link-local-underpost-cli.sh +6 -0
  22. package/scripts/test-monitor.sh +250 -0
  23. package/src/api/cyberia-server-defaults/cyberia-server-defaults.js +7 -0
  24. package/src/cli/deploy.js +200 -282
  25. package/src/cli/env.js +1 -4
  26. package/src/cli/image.js +58 -4
  27. package/src/cli/index.js +47 -0
  28. package/src/cli/monitor.js +387 -6
  29. package/src/cli/release.js +26 -11
  30. package/src/cli/repository.js +101 -7
  31. package/src/cli/run.js +159 -73
  32. package/src/client/components/core/PanelForm.js +44 -44
  33. package/src/client/components/cyberia/SharedDefaultsCyberia.js +1 -1
  34. package/src/client/public/cyberia-docs/ACTION-SYSTEM.md +55 -1
  35. package/src/client/public/cyberia-docs/ARCHITECTURE.md +272 -50
  36. package/src/client/public/cyberia-docs/CYBERIA-SERVER.md +20 -11
  37. package/src/client/public/cyberia-docs/QUEST-SYSTEM.md +23 -1
  38. package/src/client/public/cyberia-docs/ROADMAP.md +1 -1
  39. package/src/client/public/cyberia-docs/WHITE-PAPER.md +1 -1
  40. package/src/db/mongo/MongooseDB.js +2 -1
  41. package/src/index.js +1 -1
  42. package/src/runtime/cyberia-client/Dockerfile +4 -22
  43. package/src/runtime/cyberia-client/Dockerfile.dev +3 -18
  44. package/src/runtime/cyberia-server/Dockerfile +3 -23
  45. package/src/runtime/cyberia-server/Dockerfile.dev +3 -27
  46. package/src/runtime/wp/Dockerfile +3 -3
  47. package/src/server/catalog-underpost.js +61 -0
  48. package/src/server/catalog.js +77 -0
  49. package/src/server/conf.js +414 -56
  50. package/src/server/ipfs-client.js +5 -3
  51. package/src/server/runtime-status.js +235 -0
  52. package/src/server/start.js +32 -11
  53. package/test/deploy-monitor.test.js +251 -0
  54. package/manifests/deployment/dd-test-development/deployment.yaml +0 -256
  55. package/manifests/deployment/dd-test-development/proxy.yaml +0 -102
@@ -1,23 +1,6 @@
1
1
  # cyberia-server DEV runtime image.
2
- #
3
- # Differences vs the production Dockerfile in this same directory:
4
- # - Builds the Go binary WITHOUT `-trimpath -ldflags="-s -w"` so symbols
5
- # and source paths survive into the binary for stack traces and pprof.
6
- # - Keeps -race (CGO-free race detector is not available; we still pass
7
- # `-gcflags="all=-N -l"` to disable inlining + optimisations so the
8
- # dlv debugger and live profilers can attach predictably).
9
- # - Keeps `git`, `procps-ng`, `strace`, `lsof`, `vim`, `curl` in the
10
- # runtime image so the operator can attach and inspect a misbehaving
11
- # pod without re-baking the image. Production keeps the runtime
12
- # layer minimal.
13
- # - Does NOT strip the npm cache after `npm install -g underpost@…` so
14
- # `npm upgrade -g underpost` works in a running container.
15
- #
16
- # Selected automatically by `node bin run instance-build-manifest`
17
- # whenever the `--dev` flag is set; the production Dockerfile in the
18
- # same directory is used otherwise.
19
2
 
20
- # --- Build Image
3
+ # --- Build Image ---
21
4
  FROM rockylinux/rockylinux:9 AS builder
22
5
 
23
6
  RUN dnf -y update && \
@@ -30,18 +13,16 @@ RUN dnf -y update && \
30
13
 
31
14
  WORKDIR /build
32
15
 
33
- # Build context is the cyberia-server project repo root (see the
34
- # production Dockerfile in this directory for the rationale).
35
16
  COPY go.mod go.sum ./
36
17
  RUN go mod download
37
18
 
38
19
  COPY . ./
39
- # Dev build: keep source paths, disable inlining + optimisations.
20
+
40
21
  RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
41
22
  go build -gcflags="all=-N -l" -o server ./cmd/cyberia-server/ && \
42
23
  echo "DEV build complete: $(pwd)/server"
43
24
 
44
- # --- Runtime Image
25
+ # --- Runtime Image ---
45
26
  FROM rockylinux/rockylinux:9 AS runtime
46
27
 
47
28
  ARG UNDERPOST_VERSION=3.2.9
@@ -59,11 +40,6 @@ WORKDIR /home/dd/engine/cyberia-server
59
40
 
60
41
  COPY --from=builder /build/server ./server
61
42
 
62
- # Static SSR dashboard — required by the Go server's findPublicDir() at boot.
63
- # See the production Dockerfile in this directory for the full rationale.
64
- # The same `node bin/cyberia run-workflow build-server-dashboard --dev
65
- # --output-path <project-root>/public/index.html` command is executed by
66
- # the CI workflow before docker build.
67
43
  COPY public/ ./public/
68
44
 
69
45
  EXPOSE 8081
@@ -3,7 +3,7 @@ FROM rockylinux:9
3
3
  # System packages
4
4
  RUN dnf -y update && \
5
5
  dnf -y install epel-release && \
6
- dnf -y install --allowerasing \
6
+ dnf -y install --allowerasing --nobest \
7
7
  bzip2 \
8
8
  sudo \
9
9
  curl \
@@ -20,8 +20,8 @@ RUN dnf -y update && \
20
20
  perl && \
21
21
  dnf clean all
22
22
 
23
- # Download and install XAMPP (PHP 8.2)
24
- RUN curl -L -o /tmp/xampp-linux-installer.run "https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/8.2.12/xampp-linux-x64-8.2.12-0-installer.run" && \
23
+ # Download and install XAMPP (PHP 8.2) with retry logic for flaky SourceForge transfers
24
+ RUN curl -L --retry 5 --retry-delay 10 --retry-max-time 180 -o /tmp/xampp-linux-installer.run "https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/8.2.12/xampp-linux-x64-8.2.12-0-installer.run" && \
25
25
  chmod +x /tmp/xampp-linux-installer.run && \
26
26
  bash -c "/tmp/xampp-linux-installer.run --mode unattended" && \
27
27
  ln -sf /opt/lampp/lampp /usr/bin/lampp
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Underpost platform content catalog — the base `pwa-microservices-template`.
3
+ *
4
+ * @module src/server/catalog-underpost.js
5
+ * @namespace UnderpostCatalog
6
+ */
7
+
8
+ /**
9
+ * Workflow + service files re-added to the template after the engine-only strip.
10
+ * @constant {string[]}
11
+ * @memberof UnderpostCatalog
12
+ */
13
+ const TEMPLATE_RESTORE_PATHS = [
14
+ `./src/server/catalog-underpost.js`,
15
+ `./.github/workflows/pwa-microservices-template-page.cd.yml`,
16
+ `./.github/workflows/pwa-microservices-template-test.ci.yml`,
17
+ `./.github/workflows/npmpkg.ci.yml`,
18
+ `./.github/workflows/ghpkg.ci.yml`,
19
+ `./.github/workflows/gitlab.ci.yml`,
20
+ `./.github/workflows/publish.ci.yml`,
21
+ `./.github/workflows/release.cd.yml`,
22
+ `./src/client/services/user/guest.service.js`,
23
+ './src/api/user/guest.service.js',
24
+ './src/ws/IoInterface.js',
25
+ './src/ws/IoServer.js',
26
+ './manifests/deployment/dd-default-development',
27
+ ];
28
+
29
+ /**
30
+ * npm keywords for the standalone Underpost platform / template package.
31
+ * @constant {string[]}
32
+ * @memberof UnderpostCatalog
33
+ */
34
+ const TEMPLATE_KEYWORDS = [
35
+ 'underpost',
36
+ 'underpost-platform',
37
+ 'cli',
38
+ 'toolchain',
39
+ 'ci-cd',
40
+ 'devops',
41
+ 'kubernetes',
42
+ 'k3s',
43
+ 'kubeadm',
44
+ 'lxd',
45
+ 'baremetal',
46
+ 'container-orchestration',
47
+ 'image-management',
48
+ 'pwa',
49
+ 'workbox',
50
+ 'microservices',
51
+ ];
52
+
53
+ /**
54
+ * npm description for the standalone Underpost platform / template package.
55
+ * @constant {string}
56
+ * @memberof UnderpostCatalog
57
+ */
58
+ const TEMPLATE_DESCRIPTION =
59
+ 'Underpost Platform — end-to-end CI/CD and application-delivery toolchain CLI. Covers bare metal, Kubernetes, K3s, kubeadm, LXD, container/image orchestration, secrets, databases, cron jobs, monitoring, SSH, runners, PWA + Workbox delivery, and release orchestration. Extensible via downstream CLIs.';
60
+
61
+ export { TEMPLATE_RESTORE_PATHS, TEMPLATE_KEYWORDS, TEMPLATE_DESCRIPTION };
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Dynamic product-catalog resolver.
3
+ *
4
+ * Product catalogs (`catalog-<suffix>.js`, e.g. `catalog-cyberia`, `catalog-prototype`)
5
+ * are loaded lazily by deploy id via ES dynamic `import()` so the base build
6
+ * (`bin/build`) and template assembly (`bin/build.template`) never statically
7
+ * depend on any product module. Removing a product catalog simply makes its
8
+ * deploy id resolve to the empty catalog — nothing else breaks.
9
+ *
10
+ * Each product catalog default-exports the uniform shape documented in
11
+ * {@link module:src/server/catalog-cyberia}.
12
+ *
13
+ * @module src/server/catalog.js
14
+ * @namespace Catalog
15
+ */
16
+
17
+ import fs from 'fs-extra';
18
+ import { fileURLToPath } from 'node:url';
19
+ import * as path from 'node:path';
20
+
21
+ const catalogDir = path.dirname(fileURLToPath(import.meta.url));
22
+
23
+ /** Empty product catalog returned for deploy ids without a dedicated module. */
24
+ const EMPTY_CATALOG = {
25
+ sourceMoves: [],
26
+ privateConfPaths: [],
27
+ templatePaths: [],
28
+ stripPaths: [],
29
+ keywords: [],
30
+ description: '',
31
+ };
32
+
33
+ /**
34
+ * Loads a single deploy id's product catalog. The suffix after `dd-` selects the
35
+ * module (`dd-cyberia` → `catalog-cyberia.js`). Returns {@link EMPTY_CATALOG} when
36
+ * the deploy id has no dedicated catalog or the module cannot be loaded.
37
+ *
38
+ * @method loadDeployCatalog
39
+ * @param {string} deployId - A concrete deploy id (e.g. `dd-cyberia`).
40
+ * @returns {Promise<object>} The product catalog (uniform shape).
41
+ * @memberof Catalog
42
+ */
43
+ const loadDeployCatalog = async (deployId) => {
44
+ const suffix = (deployId ?? '').split('dd-')[1];
45
+ if (!suffix) return EMPTY_CATALOG;
46
+ try {
47
+ const mod = await import(`./catalog-${suffix}.js`);
48
+ return { ...EMPTY_CATALOG, ...(mod.default ?? {}) };
49
+ } catch {
50
+ return EMPTY_CATALOG;
51
+ }
52
+ };
53
+
54
+ /**
55
+ * Loads every product catalog present alongside this module (`catalog-*.js`,
56
+ * excluding the base `catalog-underpost` and this resolver). Used to aggregate
57
+ * product `stripPaths` for the base template without naming any product.
58
+ *
59
+ * @method loadProductCatalogs
60
+ * @returns {Promise<object[]>} Loaded product catalogs (uniform shape).
61
+ * @memberof Catalog
62
+ */
63
+ const loadProductCatalogs = async () => {
64
+ const catalogs = [];
65
+ for (const file of fs.readdirSync(catalogDir)) {
66
+ if (!/^catalog-.+\.js$/.test(file) || file === 'catalog-underpost.js') continue;
67
+ try {
68
+ const mod = await import(`./${file}`);
69
+ if (mod.default) catalogs.push({ ...EMPTY_CATALOG, ...mod.default });
70
+ } catch {
71
+ /* a malformed/removed product catalog must not break the base build */
72
+ }
73
+ }
74
+ return catalogs;
75
+ };
76
+
77
+ export { loadDeployCatalog, loadProductCatalogs, EMPTY_CATALOG };