@underpostnet/cyberia 3.3.73 → 3.3.77

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 (269) hide show
  1. package/.env.example +17 -5
  2. package/.github/workflows/coverall.cyberia.ci.yml +10 -0
  3. package/.github/workflows/docker-image.cyberia-client.ci.yml +1 -1
  4. package/.github/workflows/docker-image.cyberia-client.dev.ci.yml +1 -1
  5. package/.github/workflows/docker-image.cyberia-server.ci.yml +1 -1
  6. package/.github/workflows/docker-image.cyberia-server.dev.ci.yml +1 -1
  7. package/.github/workflows/docker-image.engine-cyberia.ci.yml +1 -1
  8. package/.github/workflows/docker-image.engine-cyberia.dev.ci.yml +1 -1
  9. package/.github/workflows/engine-cyberia.ci.yml +1 -1
  10. package/.github/workflows/publish.cyberia.ci.yml +44 -0
  11. package/AGENTS.md +61 -12
  12. package/CHANGELOG.md +159 -161
  13. package/CLI-HELP.md +20 -13
  14. package/Dockerfile +1 -1
  15. package/Dockerfile.dev +1 -1
  16. package/Dockerfile.test +2 -2
  17. package/README.md +28 -28
  18. package/bin/build.js +96 -21
  19. package/bin/cyberia.js +1247 -1373
  20. package/bin/index.js +1247 -1373
  21. package/compose.env +17 -5
  22. package/conf.js +7 -4
  23. package/deploy/cyberia-client/deploy.sh +10 -11
  24. package/deploy/cyberia-client/package.sh +0 -1
  25. package/deploy/cyberia-client/state.sh +3 -2
  26. package/deploy/cyberia-server/deploy.sh +10 -11
  27. package/deploy/cyberia-server/package.sh +0 -1
  28. package/deploy/cyberia-server/state.sh +3 -2
  29. package/deploy/dd-cyberia/deploy.sh +5 -5
  30. package/deploy/dd-cyberia/init.sh +15 -14
  31. package/deploy/dd-cyberia/package.sh +0 -1
  32. package/deploy/dd-cyberia/state.sh +2 -2
  33. package/deploy/dd-cyberia/sync-deploy.sh +139 -75
  34. package/deploy/lib/config.sh +29 -0
  35. package/deploy/lib/github-actions-logging.sh +92 -76
  36. package/deploy/lib/host.sh +28 -19
  37. package/deploy/lib/state.sh +4 -1
  38. package/deploy/pwa-microservices-template/deploy.sh +10 -8
  39. package/deploy/release/deploy.sh +0 -2
  40. package/deployment.yaml +1 -1
  41. package/docker-compose.yml +23 -17
  42. package/docs/coverage/cyberia/api/cyberia-instance/cyberia-fallback-capture.js.html +1591 -0
  43. package/docs/coverage/cyberia/api/cyberia-instance/index.html +116 -0
  44. package/docs/coverage/cyberia/api/cyberia-server-defaults/cyberia-server-defaults.js.html +4138 -0
  45. package/docs/coverage/cyberia/api/cyberia-server-defaults/index.html +116 -0
  46. package/docs/coverage/cyberia/api/object-layer/index.html +116 -0
  47. package/docs/coverage/cyberia/api/object-layer/object-layer.model.js.html +1393 -0
  48. package/docs/coverage/cyberia/base.css +362 -0
  49. package/docs/coverage/cyberia/block-navigation.js +82 -0
  50. package/docs/coverage/cyberia/favicon.png +0 -0
  51. package/docs/coverage/cyberia/index.html +161 -0
  52. package/docs/coverage/cyberia/prettify.css +101 -0
  53. package/docs/coverage/cyberia/prettify.js +937 -0
  54. package/docs/coverage/cyberia/projects/cyberia/atlas-sprite-sheet-generator.js.html +1315 -0
  55. package/docs/coverage/cyberia/projects/cyberia/index.html +176 -0
  56. package/docs/coverage/cyberia/projects/cyberia/instance-backup.js.html +715 -0
  57. package/docs/coverage/cyberia/projects/cyberia/instance-data.js.html +2182 -0
  58. package/docs/coverage/cyberia/projects/cyberia/shape-generator.js.html +3265 -0
  59. package/docs/coverage/cyberia/projects/cyberia/stat-balance.js.html +328 -0
  60. package/docs/coverage/cyberia/sort-arrow-sprite.png +0 -0
  61. package/docs/coverage/cyberia/sorter.js +205 -0
  62. package/hardhat/package-lock.json +2 -2
  63. package/hardhat/package.json +1 -1
  64. package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
  65. package/manifests/cronjobs/dd-cron/dd-cron-vultr.yaml +1 -1
  66. package/manifests/deployment/dd-cyberia-development/deployment.yaml +1 -1
  67. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  68. package/manifests/deployment/mongo-express/deployment.yaml +46 -27
  69. package/manifests/deployment/mongo-express/kustomization.yaml +9 -0
  70. package/manifests/deployment/mongo-express/mongo-express-nodeport.yaml +18 -0
  71. package/manifests/deployment/mongo-express/service.yaml +16 -0
  72. package/manifests/deployment/mongo-express-no-auth/disable-mongodb-auth.yaml +16 -0
  73. package/manifests/deployment/mongo-express-no-auth/kustomization.yaml +16 -0
  74. package/package.json +19 -17
  75. package/scripts/test-monitor.sh +3 -3
  76. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.controller.js +14 -9
  77. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.model.js +36 -5
  78. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.router.js +5 -0
  79. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +88 -184
  80. package/src/api/cyberia-action/cyberia-action.router.js +2 -2
  81. package/src/api/cyberia-action/cyberia-action.service.js +3 -4
  82. package/src/api/cyberia-audio/cyberia-audio.controller.js +6 -0
  83. package/src/api/cyberia-audio/cyberia-audio.model.js +61 -0
  84. package/src/api/cyberia-audio/cyberia-audio.router.js +21 -0
  85. package/src/api/cyberia-audio/cyberia-audio.service.js +220 -0
  86. package/src/api/cyberia-client-hints/cyberia-client-hints.controller.js +1 -3
  87. package/src/api/cyberia-client-hints/cyberia-client-hints.model.js +10 -19
  88. package/src/api/cyberia-client-hints/cyberia-client-hints.router.js +12 -34
  89. package/src/api/cyberia-client-hints/cyberia-client-hints.service.js +15 -32
  90. package/src/api/cyberia-dialogue/cyberia-dialogue.model.js +1 -1
  91. package/src/api/cyberia-dialogue/cyberia-dialogue.router.js +1 -1
  92. package/src/api/cyberia-entity/cyberia-entity.model.js +2 -0
  93. package/src/api/cyberia-entity/cyberia-entity.service.js +1 -1
  94. package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.controller.js +8 -2
  95. package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.model.js +31 -20
  96. package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.router.js +16 -1
  97. package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.service.js +466 -3
  98. package/src/api/cyberia-instance/cyberia-fallback-capture.js +87 -51
  99. package/src/api/cyberia-instance/cyberia-fallback-world.js +21 -40
  100. package/src/api/cyberia-instance/cyberia-instance-boot.service.js +5 -5
  101. package/src/api/cyberia-instance/cyberia-instance-items.js +98 -0
  102. package/src/api/cyberia-instance/cyberia-instance-map.service.js +34 -141
  103. package/src/api/cyberia-instance/cyberia-instance.controller.js +1 -4
  104. package/src/api/cyberia-instance/cyberia-instance.model.js +0 -14
  105. package/src/api/cyberia-instance/cyberia-instance.router.js +3 -16
  106. package/src/api/cyberia-instance/cyberia-instance.service.js +3 -43
  107. package/src/api/cyberia-instance/cyberia-world-generator.js +8 -13
  108. package/src/api/cyberia-instance-conf/cyberia-instance-conf.model.js +49 -75
  109. package/src/api/cyberia-instance-conf/cyberia-instance-conf.service.js +74 -1
  110. package/src/api/cyberia-map/cyberia-map.service.js +6 -2
  111. package/src/api/cyberia-map-audio-conf/cyberia-map-audio-conf.controller.js +31 -0
  112. package/src/api/cyberia-map-audio-conf/cyberia-map-audio-conf.model.js +56 -0
  113. package/src/api/cyberia-map-audio-conf/cyberia-map-audio-conf.router.js +33 -0
  114. package/src/api/cyberia-map-audio-conf/cyberia-map-audio-conf.service.js +189 -0
  115. package/src/api/cyberia-quest/cyberia-quest.router.js +3 -3
  116. package/src/api/cyberia-quest/cyberia-quest.service.js +3 -3
  117. package/src/api/cyberia-quest-progress/cyberia-quest-progress.model.js +1 -1
  118. package/src/api/cyberia-server-defaults/cyberia-server-defaults.js +403 -188
  119. package/src/api/cyberia-skill/cyberia-skill.model.js +6 -6
  120. package/src/api/file/file.ref.js +153 -0
  121. package/src/api/file/file.ref.json +11 -2
  122. package/src/api/object-layer/object-layer.model.js +47 -12
  123. package/src/api/object-layer/object-layer.router.js +10 -3
  124. package/src/api/object-layer/object-layer.service.js +113 -120
  125. package/src/cli/app.js +12 -1
  126. package/src/cli/client.js +2 -2
  127. package/src/cli/cluster.js +80 -18
  128. package/src/cli/deploy.js +215 -34
  129. package/src/cli/docker-compose.js +1 -1
  130. package/src/cli/fs-selection.js +115 -0
  131. package/src/cli/fs.js +158 -342
  132. package/src/cli/index.js +22 -10
  133. package/src/cli/release.js +3 -1
  134. package/src/cli/repository.js +35 -9
  135. package/src/cli/run.js +80 -199
  136. package/src/cli/test.js +4 -0
  137. package/src/cli/wireguard.js +32 -31
  138. package/src/client/components/core/Badge.js +0 -1
  139. package/src/client/components/core/CssCore.js +8 -1
  140. package/src/client/components/core/Docs.js +77 -100
  141. package/src/client/components/core/Modal.js +77 -23
  142. package/src/client/components/core/ToolTip.js +15 -0
  143. package/src/client/components/cryptokoyn/AppShellCryptokoyn.js +0 -2
  144. package/src/client/components/cyberia/ActionEngineCyberia.js +12 -36
  145. package/src/client/components/cyberia/EntityEngineCyberia.js +492 -121
  146. package/src/client/components/cyberia/InstanceEngineCyberia.js +129 -160
  147. package/src/client/components/cyberia/InstanceSelectionView.js +7 -1
  148. package/src/client/components/cyberia/MapEngineCyberia.js +175 -69
  149. package/src/client/components/cyberia/ObjectLayerEngine.js +1011 -97
  150. package/src/client/components/cyberia/ObjectLayerEngineModal.js +81 -155
  151. package/src/client/components/cyberia/ObjectLayerEngineViewer.js +113 -98
  152. package/src/client/components/cyberia/SharedDefaultsCyberia.js +215 -56
  153. package/src/client/components/cyberia-portal/AppShellCyberiaPortal.js +0 -34
  154. package/src/client/components/cyberia-portal/CssCyberiaPortal.js +1 -1
  155. package/src/client/components/cyberia-portal/MainBodyCyberiaPortal.js +712 -76
  156. package/src/client/components/cyberia-portal/RouterCyberiaPortal.js +0 -4
  157. package/src/client/components/cyberia-portal/TranslateCyberiaPortal.js +0 -4
  158. package/src/client/components/default/AppShellDefault.js +1 -4
  159. package/src/client/components/itemledger/AppShellItemledger.js +0 -2
  160. package/src/client/components/underpost/AppShellUnderpost.js +1 -1
  161. package/src/client/public/cyberia-docs/ARCHITECTURE.md +15 -15
  162. package/src/client/public/cyberia-docs/CYBERIA-CLI.md +280 -24
  163. package/src/client/public/cyberia-docs/CYBERIA-CLIENT.md +51 -29
  164. package/src/client/public/cyberia-docs/CYBERIA-SAGA.md +52 -53
  165. package/src/client/public/cyberia-docs/CYBERIA-SERVER.md +16 -11
  166. package/src/client/public/cyberia-docs/CYBERIA.md +28 -28
  167. package/src/client/public/cyberia-docs/ENTITY-PROFILE.md +11 -5
  168. package/src/client/public/cyberia-docs/ROADMAP.md +1 -1
  169. package/src/client/public/cyberia-docs/STATS-PROGRESSION.md +217 -0
  170. package/src/client/public/cyberia-docs/WHITE-PAPER.md +20 -12
  171. package/src/client/services/cyberia-audio/cyberia-audio.service.js +99 -0
  172. package/src/client/services/cyberia-entity-type-default/cyberia-entity-type-default.service.js +38 -0
  173. package/src/client/services/cyberia-instance/cyberia-instance.management.js +5 -4
  174. package/src/client/services/cyberia-instance/cyberia-instance.service.js +0 -40
  175. package/src/client/services/cyberia-map/cyberia-map.management.js +5 -4
  176. package/src/client/services/cyberia-map-audio-conf/cyberia-map-audio-conf.service.js +138 -0
  177. package/src/client/services/object-layer/object-layer.management.js +6 -10
  178. package/src/client/services/object-layer/object-layer.service.js +3 -1
  179. package/src/client/ssr/views/Cyberia404.js +3 -3
  180. package/src/client-builder/client-build-docs.js +52 -52
  181. package/src/client-builder/client-build.js +67 -44
  182. package/src/client-builder/client-bundle.js +347 -0
  183. package/src/db/mongo/MongoExpress.js +187 -0
  184. package/src/grpc/cyberia/grpc-server.js +5 -7
  185. package/src/index.js +1 -1
  186. package/src/projects/cyberia/atlas-sprite-sheet-generator.js +143 -146
  187. package/src/projects/cyberia/atlas-sprite-sheet-store.js +391 -0
  188. package/src/projects/cyberia/besu-genesis-generator.js +5 -14
  189. package/src/projects/cyberia/boot-contract-fixtures.js +32 -0
  190. package/src/projects/cyberia/catalog-cyberia.js +3 -2
  191. package/src/projects/cyberia/gemini-client.js +3 -3
  192. package/src/projects/cyberia/generate-saga.js +4 -11
  193. package/src/projects/cyberia/hot-reload-trigger.js +17 -28
  194. package/src/projects/cyberia/instance-backup.js +210 -0
  195. package/src/projects/cyberia/instance-data.js +177 -257
  196. package/src/projects/cyberia/map-preview-generator.js +32 -68
  197. package/src/projects/cyberia/object-layer.js +152 -319
  198. package/src/projects/cyberia/seed-audio.js +139 -0
  199. package/src/projects/cyberia/semantic-layer-generator-skin.js +2 -8
  200. package/src/projects/cyberia/semantic-layer-generator.js +2 -18
  201. package/src/projects/cyberia/stat-balance.js +81 -0
  202. package/src/projects/cyberia/stat-commands.js +23 -0
  203. package/src/projects/cyberia/stat-contract-generator.js +101 -0
  204. package/src/runtime/cyberia-client/Dockerfile +8 -4
  205. package/src/runtime/cyberia-client/Dockerfile.dev +5 -2
  206. package/src/runtime/cyberia-server/Dockerfile +9 -2
  207. package/src/runtime/cyberia-server/Dockerfile.dev +8 -1
  208. package/src/runtime/engine-cyberia/Dockerfile +1 -1
  209. package/src/runtime/engine-cyberia/Dockerfile.dev +1 -1
  210. package/src/runtime/engine-cyberia/Dockerfile.test +2 -2
  211. package/src/runtime/engine-cyberia/compose.env +17 -5
  212. package/src/runtime/engine-cyberia/docker-compose.yml +23 -17
  213. package/src/server/build/coverage.js +113 -42
  214. package/src/server/build/package.js +55 -12
  215. package/src/server/build/testing.js +59 -9
  216. package/src/server/network/middlewares.js +8 -2
  217. package/src/server/network/underpost-gateway.js +113 -14
  218. package/src/server/ops/logger.js +70 -35
  219. package/src/server/runtime/conf.js +40 -9
  220. package/src/server/runtime/start.js +11 -2
  221. package/src/server/storage/data-query.js +16 -0
  222. package/src/server/storage/downloader.js +62 -14
  223. package/src/server/storage/zip.js +153 -0
  224. package/test/integration/app/cyberia/atlas-sprite-sheet-store.test.js +402 -0
  225. package/test/integration/app/cyberia/atlas-sprite-sheet.test.js +86 -0
  226. package/test/integration/app/cyberia/cyberia-cli-plain-reads.test.js +34 -0
  227. package/test/integration/app/cyberia/cyberia-entity-type-default.test.js +842 -0
  228. package/test/integration/app/cyberia/cyberia-instance-conf-coerce.test.js +53 -0
  229. package/test/integration/app/cyberia/cyberia-instance-conf-defaults.test.js +16 -22
  230. package/test/integration/app/cyberia/cyberia-instance-items.test.js +90 -0
  231. package/test/integration/app/cyberia/cyberia-load.test.js +6 -7
  232. package/test/integration/app/cyberia/cyberia-map-audio-conf.test.js +256 -0
  233. package/test/integration/app/cyberia/cyberia-stats.test.js +150 -0
  234. package/test/integration/app/cyberia/fallback-world-capture.test.js +87 -2
  235. package/test/integration/app/cyberia/object-layer-item-selection.test.js +56 -0
  236. package/test/integration/app/cyberia/object-layer-natural-key.test.js +32 -0
  237. package/test/integration/app/cyberia/seed-audio.test.js +275 -0
  238. package/test/integration/infra/2-network/wireguard-cli.test.js +33 -9
  239. package/test/integration/infra/2-network/wireguard-edge.test.js +58 -18
  240. package/test/integration/infra/3-cluster/mongo-express-deploy.test.js +156 -0
  241. package/test/integration/infra/4-ingress/api-cross-origin.test.js +79 -0
  242. package/test/integration/infra/4-ingress/underpost-ingress.test.js +1 -1
  243. package/test/unit/catalog.test.js +13 -2
  244. package/test/unit/client-build-docs.test.js +97 -70
  245. package/test/unit/client-bundle.test.js +313 -0
  246. package/test/unit/conf-resolution.test.js +58 -7
  247. package/test/unit/coverage-artifact.test.js +120 -29
  248. package/test/unit/cyberia/instance-backup.test.js +183 -0
  249. package/test/unit/cyberia/instance-data.test.js +314 -0
  250. package/test/unit/cyberia/instance-object-layer-items.test.js +46 -0
  251. package/test/unit/cyberia/publish-workflow.test.js +22 -0
  252. package/test/unit/cyberia/stat-balance.test.js +69 -0
  253. package/test/unit/deploy-legacy-gateway-sweep.test.js +63 -0
  254. package/test/unit/deploy-log-table.test.js +76 -5
  255. package/test/unit/downloader-integrity.test.js +98 -0
  256. package/test/unit/file-reference-registry.test.js +141 -0
  257. package/test/unit/fs-storage-paths.test.js +596 -0
  258. package/test/unit/gateway-pod-fetch.test.js +95 -0
  259. package/test/unit/letsencrypt-issuer.test.js +101 -0
  260. package/test/unit/logger-redaction.test.js +29 -0
  261. package/test/unit/package.test.js +70 -16
  262. package/test/unit/prepare-host.test.js +84 -1
  263. package/test/unit/release-bump.test.js +3 -1
  264. package/test/unit/start-options.test.js +12 -0
  265. package/test/unit/test-tiers.test.js +27 -0
  266. package/test/unit/zip-archive.test.js +142 -0
  267. package/vitest.config.js +11 -3
  268. package/src/api/cyberia-instance/cyberia-fallback-default-items.js +0 -63
  269. package/src/client/components/cyberia/FallbackWorldEngineCyberia.js +0 -368
package/compose.env CHANGED
@@ -43,25 +43,37 @@ VALKEY_PORT=6379
43
43
  # cyberia-server-* -> stable engine gateway for HTTP and the raw engine runtime
44
44
  # for gRPC. The public engine-cyberia name belongs to nginx, avoiding ambiguous
45
45
  # Docker DNS while keeping one stable HTTP endpoint for every module.
46
- ENGINE_API_BASE_URL=http://engine-cyberia
47
- ENGINE_GRPC_ADDRESS=engine-cyberia-runtime:50051
46
+ CYBERIA_DATA_SERVER_URL=http://engine-cyberia
47
+ CYBERIA_DATA_SERVER_GRPC=engine-cyberia-runtime:50051
48
48
 
49
49
  # Client-visible Content Authority origin, forwarded to browser/Raylib clients
50
50
  # for every engine-cyberia content/asset/metadata request. Host-reachable
51
51
  # (Docker publishes the raw engine runtime on host :4005). Unlike the internal
52
- # ENGINE_API_BASE_URL, this value is consumed outside the Compose network:
52
+ # CYBERIA_DATA_SERVER_URL, this value is consumed outside the Compose network:
53
53
  # the two responsibilities must never overwrite each other.
54
54
  ENGINE_PUBLIC_URL=http://localhost:4005
55
55
  ENGINE_GRPC_RELOAD_INTERVAL_SEC=300
56
56
 
57
- # --- Browser-facing client runtime config (injected by docker-driver.py) -----
57
+ # Shared secret between the engine and every game server. It guards the server
58
+ # registry report (server -> engine) and the hot-reload trigger (engine ->
59
+ # server). Unset disables both: a server then stays out of the public list.
60
+ CYBERIA_SERVER_API_KEY=change_me_dev_server_api_key
61
+
62
+ # Public origin of the server gateway. Each server reports this origin plus its
63
+ # own sub-path, which is the URL a client dials.
64
+ CYBERIA_SERVER_PUBLIC_ORIGIN=http://localhost:8081
65
+
66
+ # --- Browser-facing client runtime config (injected by wasm-driver.py) -----
58
67
  # The single WASM bundle resolves its instance from the URL sub-path and builds
59
68
  # its endpoints from these origins. HTTP client/API traffic uses nginx on :80;
60
69
  # WebSocket traffic uses the dedicated multi-path server gateway on :8081.
61
70
  # http://localhost/ -> default, ws://localhost:8081/ws
62
71
  # http://localhost/FOREST -> FOREST, ws://localhost:8081/FOREST/ws
63
72
  CYBERIA_WS_ORIGIN=ws://localhost:8081
64
- CYBERIA_ENGINE_API_ORIGIN=http://localhost
73
+ # The browser's own route to the Data Server, through nginx on :80. Distinct from the internal
74
+ # CYBERIA_DATA_SERVER_URL above: both name a Data Server origin, but from opposite sides of the
75
+ # Compose network, and one file cannot hold two values under one name.
76
+ CYBERIA_CLIENT_DATA_SERVER_URL=http://localhost
65
77
  CYBERIA_DEFAULT_INSTANCE=amethyst-strata-expansion
66
78
 
67
79
  # cyberia-server logging. This is the dev stack, so default to DEBUG. Set
package/conf.js CHANGED
@@ -180,7 +180,6 @@ const DefaultConf = /**/ {
180
180
  'InstanceEngineCyberia',
181
181
  'ActionEngineCyberia',
182
182
  'EntityEngineCyberia',
183
- 'FallbackWorldEngineCyberia',
184
183
  'InstanceSelectionView',
185
184
  ],
186
185
  core: [
@@ -267,7 +266,6 @@ const DefaultConf = /**/ {
267
266
  { path: '/docs', client: 'CyberiaPortal', ssr: 'CyberiaPortal' },
268
267
  { path: '/cyberia-action-engine', client: 'CyberiaPortal', ssr: 'CyberiaPortal' },
269
268
  { path: '/cyberia-entity-engine', client: 'CyberiaPortal', ssr: 'CyberiaPortal' },
270
- { path: '/fallback-world-engine', client: 'CyberiaPortal', ssr: 'CyberiaPortal' },
271
269
  { path: '/instance-selection', title: 'Select World', client: 'CyberiaPortal', ssr: 'CyberiaPortal' },
272
270
  ],
273
271
  dists: [
@@ -765,13 +763,17 @@ const DefaultConf = /**/ {
765
763
  'cyberia-entity-type-default',
766
764
  'cyberia-client-hints',
767
765
  'cyberia-saga',
766
+ 'cyberia-audio',
767
+ 'cyberia-map-audio-conf',
768
768
  ],
769
769
  ws: 'core',
770
770
  peer: true,
771
771
  docs: {
772
- coveragePath: './hardhat',
773
772
  jsJsonPath: './typedoc.dd-cyberia.json',
774
- coverageOutputDir: 'hardhat-coverage',
773
+ coverage: [
774
+ { id: 'cyberia', label: 'Cyberia coverage', suite: 'cyberia' },
775
+ { id: 'hardhat', label: 'Hardhat coverage', path: './hardhat' },
776
+ ],
775
777
  references: [
776
778
  './src/client/public/cyberia-docs/CYBERIA.md',
777
779
  './src/client/public/cyberia-docs/WHITE-PAPER.md',
@@ -779,6 +781,7 @@ const DefaultConf = /**/ {
779
781
  './src/client/public/cyberia-docs/QUEST-SYSTEM.md',
780
782
  './src/client/public/cyberia-docs/ACTION-SYSTEM.md',
781
783
  './src/client/public/cyberia-docs/ENTITY-PROFILE.md',
784
+ './src/client/public/cyberia-docs/STATS-PROGRESSION.md',
782
785
  './src/client/public/cyberia-docs/OFF-CHAIN-ECONOMY.md',
783
786
  './src/client/public/cyberia-docs/HARDHAT-MODULE.md',
784
787
  './src/client/public/cyberia-docs/CYBERIA-SERVER.md',
@@ -5,18 +5,18 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  source "$SCRIPT_DIR/../lib/github-actions-logging.sh"
6
6
  source "$SCRIPT_DIR/../lib/host.sh"
7
7
 
8
- ENGINE_ROOT=/home/dd/engine
9
- TARGET_NODE=hp-envy-iso-ram-rocky9
10
- INGRESS_NODE=localhost.localdomain
8
+ DEPLOY_ID=dd-cyberia
9
+ INSTANCE_ID=mmo-client
10
+ TARGET_NODE="${TARGET_NODE:-$WORKER_NODE}"
11
11
 
12
12
  main() {
13
13
  deploy_start "Starting remote deploy"
14
14
 
15
15
  prepare_host "$ENGINE_ROOT"
16
16
 
17
- deploy_step "Build dd-cyberia configuration" \
17
+ deploy_step "Build $DEPLOY_ID configuration" \
18
18
  sudo -n -- /bin/bash -lc \
19
- "cd $ENGINE_ROOT && node bin/build dd-cyberia --conf"
19
+ "cd $ENGINE_ROOT && node bin/build $DEPLOY_ID --conf"
20
20
 
21
21
  deploy_step "Wait for target node readiness" \
22
22
  sudo -n -- /bin/bash -lc \
@@ -30,18 +30,17 @@ main() {
30
30
  sudo -n -- /bin/bash -lc \
31
31
  "cd $ENGINE_ROOT && kubectl rollout status deployment/underpost-gateway -n default --timeout=5m"
32
32
 
33
- deploy_step "Deploy cyberia mmo client instance" \
33
+ deploy_step "Deploy $DEPLOY_ID $INSTANCE_ID instance" \
34
34
  sudo -n -- /bin/bash -lc \
35
35
  "cd $ENGINE_ROOT && node bin run instance \
36
36
  --kubeadm \
37
+ ${TARGET_NODE:+--node-name ${TARGET_NODE}} \
37
38
  --gateway-api \
38
39
  --image-pull-policy Always \
39
- --node-name ${TARGET_NODE} \
40
40
  --ingress-node ${INGRESS_NODE} \
41
- --ssh-key-path /home/dd/tmp/897as9dxhaskd9 \
42
- --deploy-id dd-cyberia \
43
- --instance-id mmo-client"
44
-
41
+ --ssh-key-path ${DEPLOY_SSH_KEY_PATH} \
42
+ --deploy-id $DEPLOY_ID \
43
+ --instance-id $INSTANCE_ID"
45
44
  }
46
45
 
47
46
  main "$@"
@@ -5,7 +5,6 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  source "$SCRIPT_DIR/../lib/github-actions-logging.sh"
6
6
  source "$SCRIPT_DIR/../lib/host.sh"
7
7
 
8
- ENGINE_ROOT=/home/dd/engine
9
8
  # This runtime is an instance of its parent deployment, and installs that deployment's manifest.
10
9
  DEPLOY_ID=dd-cyberia
11
10
 
@@ -5,10 +5,11 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  source "$SCRIPT_DIR/../lib/github-actions-logging.sh"
6
6
  source "$SCRIPT_DIR/../lib/state.sh"
7
7
 
8
- ENGINE_ROOT=/home/dd/engine
8
+ DEPLOY_ID=dd-cyberia
9
+ INSTANCE_ID=mmo-client
9
10
 
10
11
  main() {
11
- stream_state "$ENGINE_ROOT" dd-cyberia mmo-client
12
+ stream_state "$ENGINE_ROOT" "$DEPLOY_ID" "$INSTANCE_ID"
12
13
  }
13
14
 
14
15
  main "$@"
@@ -5,18 +5,18 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  source "$SCRIPT_DIR/../lib/github-actions-logging.sh"
6
6
  source "$SCRIPT_DIR/../lib/host.sh"
7
7
 
8
- ENGINE_ROOT=/home/dd/engine
9
- TARGET_NODE=hp-envy-iso-ram-rocky9
10
- INGRESS_NODE=localhost.localdomain
8
+ DEPLOY_ID=dd-cyberia
9
+ INSTANCE_ID=mmo-server
10
+ TARGET_NODE="${TARGET_NODE:-$WORKER_NODE}"
11
11
 
12
12
  main() {
13
13
  deploy_start "Starting remote deploy"
14
14
 
15
15
  prepare_host "$ENGINE_ROOT"
16
16
 
17
- deploy_step "Build dd-cyberia configuration" \
17
+ deploy_step "Build $DEPLOY_ID configuration" \
18
18
  sudo -n -- /bin/bash -lc \
19
- "cd $ENGINE_ROOT && node bin/build dd-cyberia --conf"
19
+ "cd $ENGINE_ROOT && node bin/build $DEPLOY_ID --conf"
20
20
 
21
21
  deploy_step "Wait for target node readiness" \
22
22
  sudo -n -- /bin/bash -lc \
@@ -30,18 +30,17 @@ main() {
30
30
  sudo -n -- /bin/bash -lc \
31
31
  "cd $ENGINE_ROOT && kubectl rollout status deployment/underpost-gateway -n default --timeout=5m"
32
32
 
33
- deploy_step "Deploy cyberia mmo server instance" \
33
+ deploy_step "Deploy $DEPLOY_ID $INSTANCE_ID instance" \
34
34
  sudo -n -- /bin/bash -lc \
35
35
  "cd $ENGINE_ROOT && node bin run instance \
36
36
  --kubeadm \
37
+ ${TARGET_NODE:+--node-name ${TARGET_NODE}} \
37
38
  --gateway-api \
38
39
  --image-pull-policy Always \
39
- --node-name ${TARGET_NODE} \
40
40
  --ingress-node ${INGRESS_NODE} \
41
- --ssh-key-path /home/dd/tmp/897as9dxhaskd9 \
42
- --deploy-id dd-cyberia \
43
- --instance-id mmo-server"
44
-
41
+ --ssh-key-path ${DEPLOY_SSH_KEY_PATH} \
42
+ --deploy-id $DEPLOY_ID \
43
+ --instance-id $INSTANCE_ID"
45
44
  }
46
45
 
47
46
  main "$@"
@@ -5,7 +5,6 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  source "$SCRIPT_DIR/../lib/github-actions-logging.sh"
6
6
  source "$SCRIPT_DIR/../lib/host.sh"
7
7
 
8
- ENGINE_ROOT=/home/dd/engine
9
8
  # This runtime is an instance of its parent deployment, and installs that deployment's manifest.
10
9
  DEPLOY_ID=dd-cyberia
11
10
 
@@ -5,10 +5,11 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  source "$SCRIPT_DIR/../lib/github-actions-logging.sh"
6
6
  source "$SCRIPT_DIR/../lib/state.sh"
7
7
 
8
- ENGINE_ROOT=/home/dd/engine
8
+ DEPLOY_ID=dd-cyberia
9
+ INSTANCE_ID=mmo-server
9
10
 
10
11
  main() {
11
- stream_state "$ENGINE_ROOT" dd-cyberia mmo-server
12
+ stream_state "$ENGINE_ROOT" "$DEPLOY_ID" "$INSTANCE_ID"
12
13
  }
13
14
 
14
15
  main "$@"
@@ -5,18 +5,18 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  source "$SCRIPT_DIR/../lib/github-actions-logging.sh"
6
6
  source "$SCRIPT_DIR/../lib/host.sh"
7
7
 
8
- ENGINE_ROOT=/home/dd/engine
9
- INGRESS_NODE=localhost.localdomain
8
+ DEPLOY_ID=dd-cyberia
10
9
 
11
10
  main() {
12
11
  deploy_start "Starting remote deploy"
13
12
 
14
13
  prepare_host "$ENGINE_ROOT"
15
14
 
16
- deploy_step "Deploy dd-cyberia" \
15
+ deploy_step "Deploy $DEPLOY_ID" \
17
16
  sudo -n -- /bin/bash -lc \
18
- "cd $ENGINE_ROOT && node bin run deploy dd-cyberia --gateway-api --ingress-node ${INGRESS_NODE}"
19
-
17
+ "cd $ENGINE_ROOT && node bin run deploy $DEPLOY_ID \
18
+ --gateway-api \
19
+ --ingress-node ${INGRESS_NODE}"
20
20
  }
21
21
 
22
22
  main "$@"
@@ -5,49 +5,50 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  source "$SCRIPT_DIR/../lib/github-actions-logging.sh"
6
6
  source "$SCRIPT_DIR/../lib/host.sh"
7
7
 
8
- ENGINE_ROOT=/home/dd/engine
9
- INGRESS_NODE=localhost.localdomain
8
+ DEPLOY_ID=dd-cyberia
9
+ DEPLOY_ENV="${DEPLOY_ENV:-production}"
10
10
 
11
11
  main() {
12
- deploy_start "Starting init deploy"
12
+ deploy_start "Starting remote init deploy"
13
13
 
14
14
  prepare_host "$ENGINE_ROOT"
15
15
 
16
- deploy_step "Build dd-cyberia configuration" \
16
+ deploy_step "Build $DEPLOY_ID configuration" \
17
17
  sudo -n -- /bin/bash -lc \
18
- "cd $ENGINE_ROOT && node bin/build dd-cyberia --conf"
18
+ "cd $ENGINE_ROOT && node bin/build $DEPLOY_ID --conf"
19
19
 
20
20
  local pod_cmd
21
- pod_cmd="$(pod_bootstrap_cmd dd-cyberia production), underpost start dd-cyberia production --build --run --skip-pull-repo-base"
21
+ pod_cmd="$(pod_bootstrap_cmd $DEPLOY_ID $DEPLOY_ENV), \
22
+ underpost start $DEPLOY_ID $DEPLOY_ENV --build --run --skip-pull-repo-base"
22
23
 
23
- deploy_step "Deploy dd-cyberia production" \
24
+ deploy_step "Deploy $DEPLOY_ID $DEPLOY_ENV" \
24
25
  sudo -n -- /bin/bash -lc \
25
- "cd $ENGINE_ROOT && node bin deploy dd-cyberia production \
26
+ "cd $ENGINE_ROOT && node bin deploy $DEPLOY_ID $DEPLOY_ENV \
26
27
  --versions green \
27
28
  --replicas 1 \
28
29
  --kubeadm \
29
- --timeout-response 300000ms \
30
+ --timeout-response 10000ms \
30
31
  --gateway-api \
31
32
  --ingress-node ${INGRESS_NODE} \
32
33
  --sync \
33
34
  --build-manifest \
34
35
  --cmd '${pod_cmd}'"
35
36
 
36
- deploy_step "Clean dd-cyberia working tree" \
37
+ deploy_step "Clean $DEPLOY_ID working tree" \
37
38
  sudo -n -- /bin/bash -lc \
38
- "cd $ENGINE_ROOT && node bin deploy dd-cyberia production \
39
+ "cd $ENGINE_ROOT && node bin deploy $DEPLOY_ID $DEPLOY_ENV \
39
40
  --kubeadm \
40
41
  --gateway-api \
41
42
  --ingress-node ${INGRESS_NODE} \
42
43
  --disable-update-proxy \
43
44
  --git-clean"
44
45
 
45
- deploy_step "Promote dd-cyberia deployment" \
46
+ deploy_step "Promote $DEPLOY_ID deployment" \
46
47
  sudo -n -- /bin/bash -lc \
47
- "cd $ENGINE_ROOT && node bin monitor dd-cyberia production \
48
+ "cd $ENGINE_ROOT && node bin monitor $DEPLOY_ID $DEPLOY_ENV \
48
49
  --ready-deployment \
49
50
  --promote \
50
- --timeout-response 300000ms \
51
+ --timeout-response 10000ms \
51
52
  --versions green \
52
53
  --replicas 1"
53
54
  }
@@ -5,7 +5,6 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  source "$SCRIPT_DIR/../lib/github-actions-logging.sh"
6
6
  source "$SCRIPT_DIR/../lib/host.sh"
7
7
 
8
- ENGINE_ROOT=/home/dd/engine
9
8
  DEPLOY_ID=dd-cyberia
10
9
 
11
10
  main() {
@@ -5,10 +5,10 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  source "$SCRIPT_DIR/../lib/github-actions-logging.sh"
6
6
  source "$SCRIPT_DIR/../lib/state.sh"
7
7
 
8
- ENGINE_ROOT=/home/dd/engine
8
+ DEPLOY_ID=dd-cyberia
9
9
 
10
10
  main() {
11
- stream_state "$ENGINE_ROOT"
11
+ stream_state "$ENGINE_ROOT" "$DEPLOY_ID"
12
12
  }
13
13
 
14
14
  main "$@"
@@ -5,112 +5,176 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  source "$SCRIPT_DIR/../lib/github-actions-logging.sh"
6
6
  source "$SCRIPT_DIR/../lib/host.sh"
7
7
 
8
- ENGINE_ROOT=/home/dd/engine
9
- TARGET_NODE=localhost.localdomain
10
- INGRESS_NODE=localhost.localdomain
8
+ DEPLOY_ID=dd-cyberia
9
+ DEPLOY_ENV="${DEPLOY_ENV:-production}"
10
+ TARGET_NODE="${TARGET_NODE:-$HOST_NODE}"
11
+ DEPLOY_IMAGE="${DEPLOY_IMAGE:-underpost/engine-cyberia:latest}"
12
+ # The source the pod bootstraps from, and the private configuration each side reads: the host
13
+ # takes the monorepo conf, the pod takes this deploy's own conf repository.
14
+ ENGINE_SRC_REPO="${ENGINE_SRC_REPO:-underpostnet/engine-test-cyberia}"
15
+ ENGINE_SRC_PRIVATE_REPO="${ENGINE_SRC_PRIVATE_REPO:-underpostnet/engine-private}"
16
+ POD_SRC_PRIVATE_REPO="${POD_SRC_PRIVATE_REPO:-underpostnet/engine-cyberia-private}"
11
17
 
12
- # Base source the pod bootstraps from. The private configuration repository is not named here:
13
- # `underpost start --build` derives it from the deploy id and clones it into ./engine-private.
14
- POD_SRC_REPO="${POD_SRC_REPO:-underpostnet/engine-test-cyberia}"
18
+ CYBERIA_ASSETS=src/client/public/cyberia
19
+ UNDERPOST_ASSETS=src/client/public/underpost
20
+
21
+ # Bundle mode: the host builds the client once and uploads the zip parts, and the pod restores
22
+ # that artifact instead of compiling the client itself. Set BUNDLE_MODE=0 to have the pod build
23
+ # from source, which is the behaviour this script had before bundle mode existed.
24
+ BUNDLE_MODE="${BUNDLE_MODE:-1}"
25
+ BUNDLE_SPLIT="${BUNDLE_SPLIT:-8}"
26
+ # Where push-bundle records the uploaded keys, relative to a conf checkout root.
27
+ BUNDLE_MANIFEST_PATH="conf/$DEPLOY_ID/storage.bundle.json"
28
+ # `mv` into a directory that already exists nests the checkout inside it rather than replacing
29
+ # it, and the pod would then load whatever conf the image carried.
30
+ POD_SRC_PRIVATE_DIR="${POD_SRC_PRIVATE_REPO##*/}"
31
+ # Sibling of the engine checkout, so the publish work tree is never part of it.
32
+ POD_PRIVATE_CHECKOUT="../$POD_SRC_PRIVATE_DIR"
15
33
 
16
34
  main() {
17
35
  deploy_start "Starting remote sync and deploy"
18
-
36
+
19
37
  prepare_host "$ENGINE_ROOT"
20
-
21
- # deploy_step "Run tests" \
22
- # sudo -n -- /bin/bash -lc \
23
- # "cd $ENGINE_ROOT && npm run test"
24
-
38
+
25
39
  deploy_step "Clean cyberia public assets" \
26
- sudo -n -- /bin/bash -lc \
27
- "cd $ENGINE_ROOT && node bin run clean src/client/public/cyberia"
28
-
40
+ sudo -n -- /bin/bash -lc \
41
+ "cd $ENGINE_ROOT && node bin run clean $CYBERIA_ASSETS"
42
+
29
43
  deploy_step "Clean underpost public assets" \
30
- sudo -n -- /bin/bash -lc \
31
- "cd $ENGINE_ROOT && node bin run clean src/client/public/underpost"
32
-
44
+ sudo -n -- /bin/bash -lc \
45
+ "cd $ENGINE_ROOT && node bin run clean $UNDERPOST_ASSETS"
46
+
33
47
  deploy_step "Initialize cyberia assets repository" \
34
- sudo -n -- /bin/bash -lc \
35
- "cd $ENGINE_ROOT && node bin cmt src/client/public/cyberia --init-repo"
36
-
48
+ sudo -n -- /bin/bash -lc \
49
+ "cd $ENGINE_ROOT && node bin cmt $CYBERIA_ASSETS --init-repo"
50
+
37
51
  deploy_step "Initialize underpost assets repository" \
38
- sudo -n -- /bin/bash -lc \
39
- "cd $ENGINE_ROOT && node bin cmt src/client/public/underpost --init-repo"
40
-
52
+ sudo -n -- /bin/bash -lc \
53
+ "cd $ENGINE_ROOT && node bin cmt $UNDERPOST_ASSETS --init-repo"
54
+
41
55
  deploy_step "Pull cyberia public assets" \
42
- sudo -n -- /bin/bash -lc \
43
- "cd $ENGINE_ROOT && node bin fs src/client/public/cyberia --pull --recursive --deploy-id dd-cyberia"
44
-
56
+ sudo -n -- /bin/bash -lc \
57
+ "cd $ENGINE_ROOT && node bin fs $CYBERIA_ASSETS \
58
+ --deploy-id $DEPLOY_ID \
59
+ --pull \
60
+ --tracked"
61
+
45
62
  deploy_step "Pull underpost public assets" \
46
- sudo -n -- /bin/bash -lc \
47
- "cd $ENGINE_ROOT && node bin fs src/client/public/underpost \
48
- --deploy-id dd-cyberia \
63
+ sudo -n -- /bin/bash -lc \
64
+ "cd $ENGINE_ROOT && node bin fs $UNDERPOST_ASSETS \
65
+ --deploy-id $DEPLOY_ID \
49
66
  --pull \
50
- --recursive \
51
- --storage-file-path './engine-private/conf/dd-cyberia/storage.underpost.json'"
52
-
53
- if [ "$(has_changes src/client/public/cyberia "$ENGINE_ROOT")" = "1" ]; then
67
+ --tracked \
68
+ --storage-id underpost"
69
+
70
+ if [ "$(has_changes $CYBERIA_ASSETS "$ENGINE_ROOT")" = "1" ]; then
54
71
  deploy_step "Commit cyberia public assets" \
55
- sudo -n -- /bin/bash -lc \
56
- "cd $ENGINE_ROOT && node bin cmt src/client/public/cyberia feat 'Update cyberia public assets'"
72
+ sudo -n -- /bin/bash -lc \
73
+ "cd $ENGINE_ROOT && git -C $CYBERIA_ASSETS add . && node bin cmt $CYBERIA_ASSETS feat 'Update cyberia public assets'"
57
74
  fi
58
-
59
- if [ "$(has_changes src/client/public/underpost "$ENGINE_ROOT")" = "1" ]; then
75
+
76
+ if [ "$(has_changes $UNDERPOST_ASSETS "$ENGINE_ROOT")" = "1" ]; then
60
77
  deploy_step "Commit underpost public assets" \
61
- sudo -n -- /bin/bash -lc \
62
- "cd $ENGINE_ROOT && node bin cmt src/client/public/underpost feat 'Update underpost public assets'"
78
+ sudo -n -- /bin/bash -lc \
79
+ "cd $ENGINE_ROOT && git -C $UNDERPOST_ASSETS add . && node bin cmt $UNDERPOST_ASSETS feat 'Update underpost public assets'"
63
80
  fi
64
-
65
- deploy_step "Apply format fixes" \
66
- sudo -n -- /bin/bash -lc \
67
- "cd $ENGINE_ROOT && npm run fix"
68
-
81
+
82
+
69
83
  deploy_step "Reinstall dependencies" \
70
- sudo -n -- /bin/bash -lc \
71
- "cd $ENGINE_ROOT && npm install"
72
-
73
- deploy_step "Install dd-cyberia catalog dependencies" \
74
- sudo -n -- /bin/bash -lc \
75
- "cd $ENGINE_ROOT && node bin package dd-cyberia --install"
76
-
84
+ sudo -n -- /bin/bash -lc \
85
+ "cd $ENGINE_ROOT && npm install"
86
+
87
+ deploy_step "Install $DEPLOY_ID catalog dependencies" \
88
+ sudo -n -- /bin/bash -lc \
89
+ "cd $ENGINE_ROOT && node bin package $DEPLOY_ID --install"
90
+
77
91
  deploy_step "Clean build artifacts" \
78
- sudo -n -- /bin/bash -lc \
79
- "cd $ENGINE_ROOT && underpost run clean"
80
-
81
- deploy_step "Load dd-cyberia production environment" \
82
- sudo -n -- /bin/bash -lc \
83
- "cd $ENGINE_ROOT && node bin app load --env production --args deploy-id=dd-cyberia"
84
-
92
+ sudo -n -- /bin/bash -lc \
93
+ "cd $ENGINE_ROOT && node bin run clean"
94
+
95
+ deploy_step "Load $DEPLOY_ID $DEPLOY_ENV environment" \
96
+ sudo -n -- /bin/bash -lc \
97
+ "cd $ENGINE_ROOT && node bin app load --env $DEPLOY_ENV --args deploy-id=$DEPLOY_ID"
98
+
85
99
  deploy_step "Build cyberia manifests" \
86
- sudo -n -- /bin/bash -lc \
87
- "cd $ENGINE_ROOT && node bin/cyberia run-workflow build-manifest"
88
-
100
+ sudo -n -- /bin/bash -lc \
101
+ "cd $ENGINE_ROOT && node bin/cyberia run-workflow build-manifest"
102
+
103
+ # Follows the manifest step: the client renders from the conf.ssr.json that build-manifest
104
+ # writes, so a bundle pushed before it would ship the previous SSR views. The uploaded keys
105
+ # are recorded in engine-private/conf/$DEPLOY_ID/storage.bundle.json, which the pod reads
106
+ # back through its own conf repository.
107
+ if [ "$BUNDLE_MODE" = "1" ]; then
108
+ deploy_step "Push $DEPLOY_ID client bundle" \
109
+ sudo -n -- /bin/bash -lc \
110
+ "cd $ENGINE_ROOT && node bin run push-bundle \
111
+ --deploy-id $DEPLOY_ID \
112
+ --split $BUNDLE_SPLIT"
113
+
114
+ # push-bundle records the keys in the host's own conf checkout, but the pod replaces
115
+ # ./engine-private with a clone of its conf repository — so the manifest is published
116
+ # there too, or the pod reads an empty one and restores nothing. Cloning from the engine
117
+ # root keeps `underpost clone` reading this checkout's credentials, and the work tree is
118
+ # then moved out so it is never part of the engine checkout.
119
+ deploy_step "Stage $DEPLOY_ID bundle manifest" \
120
+ sudo -n -- /bin/bash -lc \
121
+ "cd $ENGINE_ROOT && rm -rf $POD_PRIVATE_CHECKOUT \
122
+ && node bin clone $POD_SRC_PRIVATE_REPO \
123
+ && mv ./$POD_SRC_PRIVATE_DIR $POD_PRIVATE_CHECKOUT \
124
+ && mkdir -p $POD_PRIVATE_CHECKOUT/conf/$DEPLOY_ID \
125
+ && cp ./engine-private/$BUNDLE_MANIFEST_PATH $POD_PRIVATE_CHECKOUT/$BUNDLE_MANIFEST_PATH"
126
+
127
+ # A rerun that uploads the same keys leaves the manifest byte-identical, and committing
128
+ # nothing fails the step.
129
+ if [ "$(has_changes $POD_PRIVATE_CHECKOUT "$ENGINE_ROOT")" = "1" ]; then
130
+ deploy_step "Publish $DEPLOY_ID bundle manifest" \
131
+ sudo -n -- /bin/bash -lc \
132
+ "cd $ENGINE_ROOT && node bin cmt $POD_PRIVATE_CHECKOUT feat 'Update $DEPLOY_ID bundle manifest' \
133
+ && node bin push $POD_PRIVATE_CHECKOUT $POD_SRC_PRIVATE_REPO"
134
+ fi
135
+ fi
136
+
89
137
  # Two commands, one bootstrap: `pod_bootstrap_cmd` replaces the image's engine with this
90
138
  # deploy's source and repoints the global bin at it — without that, the first step needing
91
139
  # the current CLI answered `unknown command 'app'`. `start --build` then owns the rest
92
- # (private conf clone, dependencies, `app load`, client bundle) and `--skip-pull-repo-base` tells
93
- # it the source is already in place, so the checkout is pulled exactly once.
140
+ # (dependencies, `app load`, client bundle), while `--skip-pull-repo-base` and
141
+ # `--skip-pull-private-repo` tell it the source and the conf are already in place, so each is
142
+ # fetched exactly once. The conf is cloned here rather than left to `--build` because the
143
+ # steps below it — `app load` and every `bin/cyberia` import — read that conf first.
94
144
  local pod_cmd
95
- pod_cmd="$(pod_bootstrap_cmd dd-cyberia production "$POD_SRC_REPO"), \
96
- node bin start dd-cyberia production --build --run --skip-pull-repo-base"
145
+ # In bundle mode `--pull-bundle` replaces the pod's client build with a download of the
146
+ # artifact the host just pushed; without it `--build` compiles the client in the pod.
147
+ local start_flags="--build --run --skip-pull-repo-base --skip-pull-private-repo"
148
+ if [ "$BUNDLE_MODE" = "1" ]; then
149
+ start_flags="$start_flags --pull-bundle"
150
+ fi
151
+ pod_cmd="$(pod_bootstrap_cmd $DEPLOY_ID $DEPLOY_ENV "$ENGINE_SRC_REPO"), \
152
+ underpost clone ${POD_SRC_PRIVATE_REPO}, \
153
+ sudo rm -rf ./engine-private, \
154
+ sudo mv ./${POD_SRC_PRIVATE_DIR} ./engine-private, \
155
+ underpost app load --env $DEPLOY_ENV --args deploy-id=$DEPLOY_ID, \
156
+ node bin/cyberia ol --drop --env-path .env, \
157
+ node bin/cyberia run-workflow drop-db --env-path .env, \
158
+ node bin/cyberia instance amethyst-strata-expansion --import --env-path .env, \
159
+ node bin/cyberia instance FOREST --import --env-path .env, \
160
+ node bin/cyberia instance TEST --import --env-path .env, \
161
+ underpost start $DEPLOY_ID $DEPLOY_ENV $start_flags"
97
162
 
98
- deploy_step "Sync dd-cyberia cluster" \
99
- sudo -n -- /bin/bash -lc \
100
- "cd $ENGINE_ROOT && node bin run sync \
101
- --deploy-id dd-cyberia \
163
+ deploy_step "Sync $DEPLOY_ID cluster" \
164
+ sudo -n -- /bin/bash -lc \
165
+ "cd $ENGINE_ROOT && node bin run sync \
166
+ --deploy-id $DEPLOY_ID \
102
167
  --replicas 1 \
103
- --image underpost/engine-cyberia:latest \
168
+ --image '${DEPLOY_IMAGE}' \
104
169
  --kubeadm \
105
170
  --deploy-id-cron-jobs none \
106
- --timeout-response 300000ms \
107
- --node-name ${TARGET_NODE} \
171
+ --timeout-response 10000ms \
172
+ ${TARGET_NODE:+--node-name ${TARGET_NODE}} \
108
173
  --gateway-api \
109
174
  --ingress-node ${INGRESS_NODE} \
110
- --ssh-key-path /home/dd/tmp/897as9dxhaskd9 \
175
+ --ssh-key-path ${DEPLOY_SSH_KEY_PATH} \
111
176
  --image-pull-policy Always \
112
177
  --cmd '${pod_cmd}'"
113
-
114
178
  }
115
179
 
116
180
  main "$@"
@@ -0,0 +1,29 @@
1
+ # Shared deploy constants for deploy/<deploy-id>/*.sh. Sourced by lib/host.sh and lib/state.sh,
2
+ # never executed directly.
3
+ #
4
+ # One home for every value more than one deploy script needs, so renaming a node or moving a
5
+ # checkout is a single edit instead of a sweep. Every name here resolves from the environment
6
+ # first, which is how a run is retargeted without editing a script.
7
+
8
+ # The engine checkout every step runs in. The library helpers take it as an argument and fall
9
+ # back to this, so a caller driving a second checkout passes that one explicitly.
10
+ ENGINE_ROOT="${ENGINE_ROOT:-/home/dd/engine}"
11
+
12
+ # The fleet's nodes, named once. A deploy pins its own placement in TARGET_NODE, declared beside
13
+ # its deploy id and left empty where the CLI resolves the node itself.
14
+ #
15
+ # `node bin deploy` publishes that flag as `--node` while `run sync` and `run instance` publish
16
+ # it as `--node-name`. Both are public option names, so a script holds the value once and spells
17
+ # the flag the way the command it drives publishes it.
18
+ HOST_NODE="${HOST_NODE:-localhost.localdomain}"
19
+ WORKER_NODE="${WORKER_NODE:-hp-envy-iso-ram-rocky9}"
20
+
21
+ # The node carrying the shared host-network ingress.
22
+ INGRESS_NODE="${INGRESS_NODE:-$HOST_NODE}"
23
+
24
+ # The key the sync and instance steps ship volume data with.
25
+ DEPLOY_SSH_KEY_PATH="${DEPLOY_SSH_KEY_PATH:-/home/dd/tmp/897as9dxhaskd9}"
26
+
27
+ # The published image the WordPress deploys run. Pinned rather than derived from the checkout's
28
+ # version: a tag is only deployable once the release workflow has published it.
29
+ DEPLOY_WP_IMAGE="${DEPLOY_WP_IMAGE:-underpost/wp:v3.3.77}"