@underpostnet/cyberia 3.2.80 → 3.3.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 (162) hide show
  1. package/.env.example +50 -15
  2. package/.github/workflows/coverall.cyberia.ci.yml +87 -0
  3. package/.github/workflows/cyberia-client.cd.yml +2 -7
  4. package/.github/workflows/cyberia-server.cd.yml +2 -7
  5. package/.github/workflows/docker-image.cyberia-client.ci.yml +4 -4
  6. package/.github/workflows/docker-image.cyberia-client.dev.ci.yml +4 -4
  7. package/.github/workflows/docker-image.cyberia-server.ci.yml +4 -4
  8. package/.github/workflows/docker-image.cyberia-server.dev.ci.yml +4 -4
  9. package/.github/workflows/docker-image.engine-cyberia.ci.yml +3 -3
  10. package/.github/workflows/docker-image.engine-cyberia.dev.ci.yml +3 -3
  11. package/.github/workflows/engine-cyberia.cd.yml +3 -67
  12. package/.github/workflows/ghpkg.ci.yml +7 -1
  13. package/.github/workflows/pwa-microservices-template-page.cd.yml +1 -16
  14. package/.github/workflows/pwa-microservices-template-test.ci.yml +1 -1
  15. package/.github/workflows/release.cd.yml +1 -9
  16. package/CHANGELOG.md +291 -1
  17. package/CLI-HELP.md +174 -23
  18. package/Dockerfile +1 -1
  19. package/Dockerfile.dev +1 -1
  20. package/Dockerfile.test +1 -1
  21. package/bin/build.js +7 -5
  22. package/bin/cyberia.js +272 -98
  23. package/bin/deploy.js +19 -17
  24. package/bin/index.js +272 -98
  25. package/compose.env +50 -15
  26. package/conf.js +2 -0
  27. package/deploy/dd-cyberia/deploy.sh +42 -0
  28. package/deploy/dd-cyberia/init.sh +63 -0
  29. package/deploy/dd-cyberia/sync-deploy.sh +194 -0
  30. package/deploy/lib/logging.sh +96 -0
  31. package/deploy/pwa-microservices-template/deploy.sh +72 -0
  32. package/deploy/release/deploy.sh +62 -0
  33. package/deployment.yaml +1 -210
  34. package/docker-compose.yml +90 -85
  35. package/hardhat/package-lock.json +139 -131
  36. package/hardhat/package.json +4 -4
  37. package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +5 -1
  38. package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
  39. package/manifests/cronjobs/dd-cron/dd-cron-vultr.yaml +52 -0
  40. package/manifests/deployment/dd-cyberia-development/deployment.yaml +1 -210
  41. package/manifests/deployment/dd-cyberia-development/gateway.yaml +80 -0
  42. package/manifests/deployment/dd-cyberia-development/httproute.yaml +504 -0
  43. package/manifests/deployment/dd-cyberia-development/proxy.yaml +12 -12
  44. package/manifests/deployment/dd-cyberia-development/pv-pvc.yaml +0 -82
  45. package/manifests/deployment/dd-cyberia-development/traffic-service.yaml +121 -0
  46. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  47. package/manifests/deployment/playwright/deployment.yaml +1 -1
  48. package/manifests/mongodb/kustomization.yaml +4 -1
  49. package/manifests/mongodb/statefulset.yaml +4 -0
  50. package/manifests/mongodb/storage-class.yaml +9 -2
  51. package/nginx.conf +86 -16
  52. package/package.json +2 -2
  53. package/proxy.yaml +12 -12
  54. package/pv-pvc.yaml +0 -82
  55. package/scripts/audit-selinux.sh +64 -0
  56. package/scripts/coverall-test-cyberia.sh +24 -0
  57. package/scripts/coverall-test.sh +24 -0
  58. package/scripts/gpu-diag.sh +0 -0
  59. package/scripts/ip-info.sh +0 -0
  60. package/scripts/k3s-node-setup.sh +18 -15
  61. package/scripts/kubeadm-node-setup.sh +12 -23
  62. package/scripts/link-local-underpost-cli.sh +0 -0
  63. package/scripts/lxd-vm-setup.sh +0 -0
  64. package/scripts/maas-nat-firewalld.sh +0 -0
  65. package/scripts/nat-iptables.sh +12 -4
  66. package/scripts/rhel-grpc-setup.sh +0 -0
  67. package/scripts/rocky-kickstart.sh +25 -9
  68. package/scripts/test-monitor.sh +4 -3
  69. package/src/api/cyberia-action/cyberia-action.model.js +1 -0
  70. package/src/api/cyberia-instance/cyberia-fallback-default-items.js +63 -0
  71. package/src/api/cyberia-instance/cyberia-fallback-world.js +49 -15
  72. package/src/api/cyberia-instance/cyberia-instance-map.service.js +8 -12
  73. package/src/api/cyberia-instance/cyberia-instance.controller.js +3 -0
  74. package/src/api/cyberia-instance/cyberia-instance.router.js +13 -0
  75. package/src/api/cyberia-instance/cyberia-instance.service.js +43 -0
  76. package/src/api/cyberia-instance/cyberia-portal-connector.js +7 -5
  77. package/src/api/cyberia-instance/cyberia-random-source.js +80 -0
  78. package/src/api/cyberia-instance/cyberia-world-generator.js +4 -3
  79. package/src/api/cyberia-instance-conf/cyberia-instance-conf.model.js +1 -0
  80. package/src/api/cyberia-server-defaults/cyberia-server-defaults.js +87 -1
  81. package/src/api/object-layer/object-layer.model.js +204 -3
  82. package/src/api/object-layer/object-layer.service.js +1 -14
  83. package/src/cli/baremetal.js +1 -2
  84. package/src/cli/cloud-init.js +1 -1
  85. package/src/cli/cluster.js +786 -96
  86. package/src/cli/db.js +11 -4
  87. package/src/cli/deploy.js +1698 -177
  88. package/src/cli/docker-compose.js +19 -178
  89. package/src/cli/env.js +1 -1
  90. package/src/cli/image.js +15 -7
  91. package/src/cli/index.js +245 -44
  92. package/src/cli/ipfs.js +82 -11
  93. package/src/cli/lxd.js +1 -1
  94. package/src/cli/monitor.js +2 -2
  95. package/src/cli/release.js +57 -22
  96. package/src/cli/repository.js +12 -10
  97. package/src/cli/run.js +2195 -427
  98. package/src/cli/secrets.js +969 -0
  99. package/src/cli/ssh.js +206 -105
  100. package/src/cli/system.js +26 -13
  101. package/src/cli/test.js +1 -1
  102. package/src/cli/vultr.js +583 -0
  103. package/src/cli/wireguard.js +2125 -0
  104. package/src/client/components/cyberia/FallbackWorldEngineCyberia.js +368 -0
  105. package/src/client/components/cyberia/InstanceSelectionView.js +11 -8
  106. package/src/client/components/cyberia/SharedDefaultsCyberia.js +5 -0
  107. package/src/client/components/cyberia-portal/AppShellCyberiaPortal.js +33 -0
  108. package/src/client/components/cyberia-portal/RouterCyberiaPortal.js +4 -0
  109. package/src/client/components/cyberia-portal/TranslateCyberiaPortal.js +4 -0
  110. package/src/client/public/cyberia-docs/ACTION-SYSTEM.md +106 -39
  111. package/src/client/public/cyberia-docs/ARCHITECTURE.md +35 -3
  112. package/src/client/public/cyberia-docs/CYBERIA-CLI.md +44 -7
  113. package/src/client/public/cyberia-docs/CYBERIA-SERVER.md +1 -1
  114. package/src/client/public/cyberia-docs/ROADMAP.md +1 -1
  115. package/src/client/public/cyberia-docs/WHITE-PAPER.md +1 -1
  116. package/src/client/services/cyberia-instance/cyberia-instance.service.js +40 -0
  117. package/src/client/services/object-layer/object-layer.management.js +4 -4
  118. package/src/client-builder/client-build.js +102 -13
  119. package/src/client-builder/ssr.js +27 -73
  120. package/src/db/mongo/MongoBootstrap.js +295 -54
  121. package/src/db/mongo/MongooseDB.js +51 -32
  122. package/src/index.js +25 -1
  123. package/src/projects/cyberia/besu-genesis-generator.js +3 -2
  124. package/src/projects/cyberia/catalog-cyberia.js +5 -0
  125. package/src/projects/cyberia/generate-saga.js +14 -23
  126. package/src/projects/cyberia/hot-reload-trigger.js +3 -3
  127. package/src/projects/cyberia/instance-data.js +63 -3
  128. package/src/projects/cyberia/object-layer.js +11 -21
  129. package/src/projects/underpost/catalog-underpost.js +4 -1
  130. package/src/runtime/cyberia-client/Dockerfile +1 -1
  131. package/src/runtime/cyberia-client/Dockerfile.dev +1 -1
  132. package/src/runtime/cyberia-server/Dockerfile +1 -1
  133. package/src/runtime/cyberia-server/Dockerfile.dev +1 -1
  134. package/src/runtime/engine-cyberia/Dockerfile +1 -1
  135. package/src/runtime/engine-cyberia/Dockerfile.dev +1 -1
  136. package/src/runtime/engine-cyberia/Dockerfile.test +1 -1
  137. package/src/runtime/engine-cyberia/compose.env +50 -15
  138. package/src/runtime/engine-cyberia/docker-compose.yml +90 -85
  139. package/src/runtime/engine-cyberia/nginx.conf +86 -16
  140. package/src/server/backup.js +1 -1
  141. package/src/server/conf.js +1216 -168
  142. package/src/server/cri.js +70 -0
  143. package/src/server/cron.js +249 -51
  144. package/src/server/dns.js +100 -6
  145. package/src/server/environment.js +98 -0
  146. package/src/server/forward-proxy.js +549 -0
  147. package/src/server/middlewares.js +56 -1
  148. package/src/server/process.js +0 -1
  149. package/src/server/selinux.js +185 -0
  150. package/src/server/systemd.js +205 -0
  151. package/src/server/underpost-compression.js +186 -0
  152. package/src/server/underpost-gateway.js +1083 -0
  153. package/src/server/underpost-ingress.js +380 -0
  154. package/test/cluster-instances.test.js +435 -0
  155. package/test/cyberia-instance-conf-defaults.test.js +1 -0
  156. package/test/deploy-node-placement.test.js +45 -0
  157. package/test/instance-traffic-plan.test.js +710 -0
  158. package/test/selinux.test.js +71 -0
  159. package/test/sops-secret-store.test.js +612 -0
  160. package/test/underpost-gateway.test.js +510 -0
  161. package/test/underpost-ingress.test.js +305 -0
  162. package/test/wireguard-edge.test.js +1177 -0
@@ -4,36 +4,6 @@
4
4
  # (MongoDB + Valkey + IPFS), then the Cyberia content-authority engine and its
5
5
  # per-instance server/client tiers, fronted by an nginx reverse proxy.
6
6
  #
7
- # Canonical location (custom docker-compose workflow):
8
- # engine-private/conf/dd-cyberia/docker-compose/cyberia/
9
- # ├── docker-compose.yml (this file — the ENTIRE stack, single source)
10
- # ├── compose.env (working env-file, used as-is — not generated)
11
- # ├── nginx.conf (GENERATED: per-variant sub-path routing)
12
- # └── mongodb/entrypoint.sh (GENERATED infra: replica-set bootstrap)
13
- # All bind mounts below are relative to this directory: the CLI runs compose with
14
- # `--project-directory` pinned here (see src/cli/docker-compose.js).
15
- #
16
- # Multi-instance: one engine-cyberia (content + asset authority) feeds three
17
- # cyberia-server + three cyberia-client tiers, one per conf.instances.json
18
- # multiInstance variant (amethyst-strata-expansion "/", FOREST "/FOREST",
19
- # TEST "/TEST"). nginx.conf routes each host sub-path to its tier and is
20
- # generated from that same topology; keep the services below in sync with it.
21
- #
22
- # Startup is a strict health-gated chain — each tier waits for the previous to
23
- # be healthy:
24
- # mongodb + valkey -> engine-cyberia -> 3x cyberia-server -> 3x cyberia-client -> proxy
25
- #
26
- # Architecture boundaries (see CLAUDE.md "Cyberia architecture boundaries"):
27
- # engine-cyberia — content, validation, persistence, gRPC(:50051)+REST(:4005)
28
- # data services, asset metadata. The authority layer.
29
- # cyberia-server — authoritative real-time simulation / tick processing (Go).
30
- # cyberia-client — rendering, input, prediction, presentation (WASM bundle).
31
- #
32
- # Usage:
33
- # underpost docker-compose --up --deploy-id dd-cyberia --docker-compose-id cyberia
34
- # (or the docker:cyberia:* npm scripts). The engine-cyberia image bakes the
35
- # dd-cyberia build at image-build time, so no private-repo credentials are
36
- # required at container start.
37
7
 
38
8
  name: dd-cyberia
39
9
 
@@ -42,8 +12,8 @@ services:
42
12
 
43
13
  # --- MongoDB -------------------------------------------------------------
44
14
  # replSet rs0, keyFile cluster auth, replica-set + root-user init over the
45
- # loopback localhost exception. Uses ./mongodb/entrypoint.sh, generated into
46
- # this dir by `underpost docker-compose --generate --docker-compose-id cyberia`.
15
+ # loopback localhost exception. This custom workflow owns the mounted
16
+ # ./mongodb/entrypoint.sh bootstrap script.
47
17
  mongodb:
48
18
  image: ${MONGO_IMAGE:-mongo:latest}
49
19
  container_name: dd-cyberia-mongodb
@@ -164,8 +134,8 @@ services:
164
134
  # variant that has local content (amethyst + FOREST; TEST has none yet, so its
165
135
  # server starts but rejects connections until seeded). Serves REST/WS on 4005
166
136
  # and the engine gRPC data service on 50051.
167
- engine-cyberia:
168
- image: ${ENGINE_CYBERIA_IMAGE:-underpost/engine-cyberia-dev}:${ENGINE_CYBERIA_TAG:-v3.2.80}
137
+ engine-cyberia-runtime:
138
+ image: ${ENGINE_CYBERIA_IMAGE:-underpost/engine-cyberia-dev}:${ENGINE_CYBERIA_TAG:-v3.3.0}
169
139
  container_name: dd-cyberia-engine
170
140
  command:
171
141
  - /bin/sh
@@ -213,147 +183,172 @@ services:
213
183
  restart: unless-stopped
214
184
 
215
185
  # === Tier 3: authoritative simulation, one per variant ===================
216
- # All three share engine-cyberia (content + gRPC) and differ only by
217
- # INSTANCE_CODE the world each loads. Each waits for engine-cyberia healthy.
218
- # The default variant publishes host port 8081; the rest are internal-only
219
- # (reached through nginx sub-path routing).
186
+ # All three share engine-cyberia (content + gRPC) and differ by INSTANCE_CODE
187
+ # and CYBERIA_BASE_PATH. Each server owns its public path and waits for the
188
+ # stable gateway, which itself waits for the engine runtime to be healthy.
189
+ # All variants are internal-only. The proxy publishes a dedicated server
190
+ # gateway on host port 8081, so one port can route every instance path.
220
191
 
221
- cyberia-server:
222
- image: ${CYBERIA_SERVER_IMAGE:-underpost/cyberia-server-dev}:${CYBERIA_SERVER_TAG:-v3.2.80}
192
+ cyberia-server-runtime:
193
+ image: ${CYBERIA_SERVER_IMAGE:-underpost/cyberia-server-dev}:${CYBERIA_SERVER_TAG:-v3.3.0}
223
194
  container_name: dd-cyberia-server
224
195
  environment:
225
196
  INSTANCE_CODE: amethyst-strata-expansion
226
- ENGINE_API_BASE_URL: ${ENGINE_API_BASE_URL:-http://engine-cyberia:4005}
197
+ CYBERIA_BASE_PATH: /
198
+ ENGINE_API_BASE_URL: ${ENGINE_API_BASE_URL:-http://engine-cyberia}
227
199
  ENGINE_PUBLIC_URL: ${ENGINE_PUBLIC_URL:-http://localhost:4005}
228
- ENGINE_GRPC_ADDRESS: ${ENGINE_GRPC_ADDRESS:-engine-cyberia:50051}
200
+ ENGINE_GRPC_ADDRESS: ${ENGINE_GRPC_ADDRESS:-engine-cyberia-runtime:50051}
229
201
  ENGINE_GRPC_RELOAD_INTERVAL_SEC: ${ENGINE_GRPC_RELOAD_INTERVAL_SEC:-300}
230
202
  STATIC_DIR: ${CYBERIA_SERVER_STATIC_DIR:-/home/dd/engine/cyberia-server/public}
231
203
  APP_ENV: ${CYBERIA_SERVER_APP_ENV:-development}
232
204
  LOG_LEVEL: ${CYBERIA_SERVER_LOG_LEVEL:-}
205
+ CYBERIA_DISABLE_CONNECTION_LIMITS: ${CYBERIA_DISABLE_CONNECTION_LIMITS:-}
206
+ CYBERIA_MAX_CONNECTIONS: ${CYBERIA_MAX_CONNECTIONS:-}
207
+ CYBERIA_MAX_CONNECTIONS_PER_IP: ${CYBERIA_MAX_CONNECTIONS_PER_IP:-}
208
+ CYBERIA_CONNECT_RATE_PER_IP: ${CYBERIA_CONNECT_RATE_PER_IP:-}
209
+ CYBERIA_CONNECT_BURST_PER_IP: ${CYBERIA_CONNECT_BURST_PER_IP:-}
210
+ CYBERIA_MESSAGE_RATE: ${CYBERIA_MESSAGE_RATE:-}
211
+ CYBERIA_MESSAGE_BURST: ${CYBERIA_MESSAGE_BURST:-}
212
+ CYBERIA_MAX_STRIKES: ${CYBERIA_MAX_STRIKES:-}
233
213
  networks:
234
214
  - dd-cyberia-internal
235
215
  expose:
236
216
  - '8081'
237
- ports:
238
- - '${CYBERIA_SERVER_PORT:-8081}:8081'
239
217
  healthcheck:
240
- test: ['CMD-SHELL', "timeout 2 bash -c '</dev/tcp/127.0.0.1/8081' || exit 1"]
218
+ test: ['CMD-SHELL', 'curl -fsS http://127.0.0.1:8081/api/v1/health/ready >/dev/null || exit 1']
241
219
  interval: 15s
242
220
  timeout: 5s
243
221
  retries: 5
244
222
  start_period: 30s
245
223
  depends_on:
246
- engine-cyberia:
224
+ proxy:
247
225
  condition: service_healthy
248
226
  restart: unless-stopped
249
227
 
250
228
  cyberia-server-forest:
251
- image: ${CYBERIA_SERVER_IMAGE:-underpost/cyberia-server-dev}:${CYBERIA_SERVER_TAG:-v3.2.80}
229
+ image: ${CYBERIA_SERVER_IMAGE:-underpost/cyberia-server-dev}:${CYBERIA_SERVER_TAG:-v3.3.0}
252
230
  container_name: dd-cyberia-server-forest
253
231
  environment:
254
232
  INSTANCE_CODE: FOREST
255
- ENGINE_API_BASE_URL: ${ENGINE_API_BASE_URL:-http://engine-cyberia:4005}
233
+ CYBERIA_BASE_PATH: /FOREST
234
+ ENGINE_API_BASE_URL: ${ENGINE_API_BASE_URL:-http://engine-cyberia}
256
235
  ENGINE_PUBLIC_URL: ${ENGINE_PUBLIC_URL:-http://localhost:4005}
257
- ENGINE_GRPC_ADDRESS: ${ENGINE_GRPC_ADDRESS:-engine-cyberia:50051}
236
+ ENGINE_GRPC_ADDRESS: ${ENGINE_GRPC_ADDRESS:-engine-cyberia-runtime:50051}
258
237
  ENGINE_GRPC_RELOAD_INTERVAL_SEC: ${ENGINE_GRPC_RELOAD_INTERVAL_SEC:-300}
259
238
  STATIC_DIR: ${CYBERIA_SERVER_STATIC_DIR:-/home/dd/engine/cyberia-server/public}
260
239
  APP_ENV: ${CYBERIA_SERVER_APP_ENV:-development}
261
240
  LOG_LEVEL: ${CYBERIA_SERVER_LOG_LEVEL:-}
241
+ CYBERIA_DISABLE_CONNECTION_LIMITS: ${CYBERIA_DISABLE_CONNECTION_LIMITS:-}
242
+ CYBERIA_MAX_CONNECTIONS: ${CYBERIA_MAX_CONNECTIONS:-}
243
+ CYBERIA_MAX_CONNECTIONS_PER_IP: ${CYBERIA_MAX_CONNECTIONS_PER_IP:-}
244
+ CYBERIA_CONNECT_RATE_PER_IP: ${CYBERIA_CONNECT_RATE_PER_IP:-}
245
+ CYBERIA_CONNECT_BURST_PER_IP: ${CYBERIA_CONNECT_BURST_PER_IP:-}
246
+ CYBERIA_MESSAGE_RATE: ${CYBERIA_MESSAGE_RATE:-}
247
+ CYBERIA_MESSAGE_BURST: ${CYBERIA_MESSAGE_BURST:-}
248
+ CYBERIA_MAX_STRIKES: ${CYBERIA_MAX_STRIKES:-}
262
249
  networks:
263
250
  - dd-cyberia-internal
264
251
  expose:
265
252
  - '8081'
266
253
  healthcheck:
267
- test: ['CMD-SHELL', "timeout 2 bash -c '</dev/tcp/127.0.0.1/8081' || exit 1"]
254
+ test: ['CMD-SHELL', 'curl -fsS http://127.0.0.1:8081/FOREST/api/v1/health/ready >/dev/null || exit 1']
268
255
  interval: 15s
269
256
  timeout: 5s
270
257
  retries: 5
271
258
  start_period: 30s
272
259
  depends_on:
273
- engine-cyberia:
260
+ proxy:
274
261
  condition: service_healthy
275
262
  restart: unless-stopped
276
263
 
277
264
  cyberia-server-test:
278
- image: ${CYBERIA_SERVER_IMAGE:-underpost/cyberia-server-dev}:${CYBERIA_SERVER_TAG:-v3.2.80}
265
+ image: ${CYBERIA_SERVER_IMAGE:-underpost/cyberia-server-dev}:${CYBERIA_SERVER_TAG:-v3.3.0}
279
266
  container_name: dd-cyberia-server-test
280
267
  environment:
281
268
  INSTANCE_CODE: TEST
282
- ENGINE_API_BASE_URL: ${ENGINE_API_BASE_URL:-http://engine-cyberia:4005}
269
+ CYBERIA_BASE_PATH: /TEST
270
+ ENGINE_API_BASE_URL: ${ENGINE_API_BASE_URL:-http://engine-cyberia}
283
271
  ENGINE_PUBLIC_URL: ${ENGINE_PUBLIC_URL:-http://localhost:4005}
284
- ENGINE_GRPC_ADDRESS: ${ENGINE_GRPC_ADDRESS:-engine-cyberia:50051}
272
+ ENGINE_GRPC_ADDRESS: ${ENGINE_GRPC_ADDRESS:-engine-cyberia-runtime:50051}
285
273
  ENGINE_GRPC_RELOAD_INTERVAL_SEC: ${ENGINE_GRPC_RELOAD_INTERVAL_SEC:-300}
286
274
  STATIC_DIR: ${CYBERIA_SERVER_STATIC_DIR:-/home/dd/engine/cyberia-server/public}
287
275
  APP_ENV: ${CYBERIA_SERVER_APP_ENV:-development}
288
276
  LOG_LEVEL: ${CYBERIA_SERVER_LOG_LEVEL:-}
277
+ CYBERIA_DISABLE_CONNECTION_LIMITS: ${CYBERIA_DISABLE_CONNECTION_LIMITS:-}
278
+ CYBERIA_MAX_CONNECTIONS: ${CYBERIA_MAX_CONNECTIONS:-}
279
+ CYBERIA_MAX_CONNECTIONS_PER_IP: ${CYBERIA_MAX_CONNECTIONS_PER_IP:-}
280
+ CYBERIA_CONNECT_RATE_PER_IP: ${CYBERIA_CONNECT_RATE_PER_IP:-}
281
+ CYBERIA_CONNECT_BURST_PER_IP: ${CYBERIA_CONNECT_BURST_PER_IP:-}
282
+ CYBERIA_MESSAGE_RATE: ${CYBERIA_MESSAGE_RATE:-}
283
+ CYBERIA_MESSAGE_BURST: ${CYBERIA_MESSAGE_BURST:-}
284
+ CYBERIA_MAX_STRIKES: ${CYBERIA_MAX_STRIKES:-}
289
285
  networks:
290
286
  - dd-cyberia-internal
291
287
  expose:
292
288
  - '8081'
293
289
  healthcheck:
294
- test: ['CMD-SHELL', "timeout 2 bash -c '</dev/tcp/127.0.0.1/8081' || exit 1"]
290
+ test: ['CMD-SHELL', 'curl -fsS http://127.0.0.1:8081/TEST/api/v1/health/ready >/dev/null || exit 1']
295
291
  interval: 15s
296
292
  timeout: 5s
297
293
  retries: 5
298
294
  start_period: 30s
299
295
  depends_on:
300
- engine-cyberia:
296
+ proxy:
301
297
  condition: service_healthy
302
298
  restart: unless-stopped
303
299
 
304
300
  # === Tier 4: presentation, one per variant ===============================
305
301
  # One WASM bundle serves every variant; the instance is resolved from the URL
306
- # sub-path (docker-driver injects CYBERIA_WS_ORIGIN / _ENGINE_API_ORIGIN /
307
- # _DEFAULT_INSTANCE). Each client waits ONLY for its own server, so the three
302
+ # sub-path (docker-driver injects CYBERIA_BASE_PATH / _WS_ORIGIN /
303
+ # _ENGINE_API_ORIGIN / _DEFAULT_INSTANCE). Each client waits ONLY for its own
304
+ # server, so the three
308
305
  # server->client pipelines advance independently (in parallel) once the shared
309
306
  # engine-cyberia is healthy:
310
307
  # cyberia-server -> cyberia-client
311
308
  # cyberia-server-forest -> cyberia-client-forest
312
309
  # cyberia-server-test -> cyberia-client-test
313
310
 
314
- cyberia-client:
315
- image: ${CYBERIA_CLIENT_IMAGE:-underpost/cyberia-client-dev}:${CYBERIA_CLIENT_TAG:-v3.2.80}
311
+ cyberia-client-runtime:
312
+ image: ${CYBERIA_CLIENT_IMAGE:-underpost/cyberia-client-dev}:${CYBERIA_CLIENT_TAG:-v3.3.0}
316
313
  container_name: dd-cyberia-client
317
314
  environment:
318
315
  CYBERIA_PORT: '8081'
319
316
  CYBERIA_INSTANCE_CODE: amethyst-strata-expansion
320
317
  CYBERIA_BASE_PATH: /
321
318
  CYBERIA_DEFAULT_INSTANCE: ${CYBERIA_DEFAULT_INSTANCE:-amethyst-strata-expansion}
322
- CYBERIA_WS_ORIGIN: ${CYBERIA_WS_ORIGIN:-ws://server.cyberiaonline.com}
323
- CYBERIA_ENGINE_API_ORIGIN: ${CYBERIA_ENGINE_API_ORIGIN:-http://www.cyberiaonline.com}
319
+ CYBERIA_WS_ORIGIN: ${CYBERIA_WS_ORIGIN:-ws://localhost:8081}
320
+ CYBERIA_ENGINE_API_ORIGIN: ${CYBERIA_ENGINE_API_ORIGIN:-http://localhost}
324
321
  networks:
325
322
  - dd-cyberia-internal
326
323
  expose:
327
324
  - '8081'
328
- ports:
329
- - '${CYBERIA_CLIENT_PORT:-8082}:8081'
330
325
  healthcheck:
331
- test: ['CMD-SHELL', "timeout 2 bash -c '</dev/tcp/127.0.0.1/8081' || exit 1"]
326
+ test: ['CMD-SHELL', 'curl -fsS http://127.0.0.1:8081/ >/dev/null || exit 1']
332
327
  interval: 15s
333
328
  timeout: 5s
334
329
  retries: 5
335
330
  start_period: 20s
336
331
  depends_on:
337
- cyberia-server:
332
+ cyberia-server-runtime:
338
333
  condition: service_healthy
339
334
  restart: unless-stopped
340
335
 
341
336
  cyberia-client-forest:
342
- image: ${CYBERIA_CLIENT_IMAGE:-underpost/cyberia-client-dev}:${CYBERIA_CLIENT_TAG:-v3.2.80}
337
+ image: ${CYBERIA_CLIENT_IMAGE:-underpost/cyberia-client-dev}:${CYBERIA_CLIENT_TAG:-v3.3.0}
343
338
  container_name: dd-cyberia-client-forest
344
339
  environment:
345
340
  CYBERIA_PORT: '8081'
346
341
  CYBERIA_INSTANCE_CODE: FOREST
347
342
  CYBERIA_BASE_PATH: /FOREST
348
343
  CYBERIA_DEFAULT_INSTANCE: ${CYBERIA_DEFAULT_INSTANCE:-amethyst-strata-expansion}
349
- CYBERIA_WS_ORIGIN: ${CYBERIA_WS_ORIGIN:-ws://server.cyberiaonline.com}
350
- CYBERIA_ENGINE_API_ORIGIN: ${CYBERIA_ENGINE_API_ORIGIN:-http://www.cyberiaonline.com}
344
+ CYBERIA_WS_ORIGIN: ${CYBERIA_WS_ORIGIN:-ws://localhost:8081}
345
+ CYBERIA_ENGINE_API_ORIGIN: ${CYBERIA_ENGINE_API_ORIGIN:-http://localhost}
351
346
  networks:
352
347
  - dd-cyberia-internal
353
348
  expose:
354
349
  - '8081'
355
350
  healthcheck:
356
- test: ['CMD-SHELL', "timeout 2 bash -c '</dev/tcp/127.0.0.1/8081' || exit 1"]
351
+ test: ['CMD-SHELL', 'curl -fsS http://127.0.0.1:8081/FOREST/ >/dev/null || exit 1']
357
352
  interval: 15s
358
353
  timeout: 5s
359
354
  retries: 5
@@ -364,21 +359,21 @@ services:
364
359
  restart: unless-stopped
365
360
 
366
361
  cyberia-client-test:
367
- image: ${CYBERIA_CLIENT_IMAGE:-underpost/cyberia-client-dev}:${CYBERIA_CLIENT_TAG:-v3.2.80}
362
+ image: ${CYBERIA_CLIENT_IMAGE:-underpost/cyberia-client-dev}:${CYBERIA_CLIENT_TAG:-v3.3.0}
368
363
  container_name: dd-cyberia-client-test
369
364
  environment:
370
365
  CYBERIA_PORT: '8081'
371
366
  CYBERIA_INSTANCE_CODE: TEST
372
367
  CYBERIA_BASE_PATH: /TEST
373
368
  CYBERIA_DEFAULT_INSTANCE: ${CYBERIA_DEFAULT_INSTANCE:-amethyst-strata-expansion}
374
- CYBERIA_WS_ORIGIN: ${CYBERIA_WS_ORIGIN:-ws://server.cyberiaonline.com}
375
- CYBERIA_ENGINE_API_ORIGIN: ${CYBERIA_ENGINE_API_ORIGIN:-http://www.cyberiaonline.com}
369
+ CYBERIA_WS_ORIGIN: ${CYBERIA_WS_ORIGIN:-ws://localhost:8081}
370
+ CYBERIA_ENGINE_API_ORIGIN: ${CYBERIA_ENGINE_API_ORIGIN:-http://localhost}
376
371
  networks:
377
372
  - dd-cyberia-internal
378
373
  expose:
379
374
  - '8081'
380
375
  healthcheck:
381
- test: ['CMD-SHELL', "timeout 2 bash -c '</dev/tcp/127.0.0.1/8081' || exit 1"]
376
+ test: ['CMD-SHELL', 'curl -fsS http://127.0.0.1:8081/TEST/ >/dev/null || exit 1']
382
377
  interval: 15s
383
378
  timeout: 5s
384
379
  retries: 5
@@ -388,31 +383,41 @@ services:
388
383
  condition: service_healthy
389
384
  restart: unless-stopped
390
385
 
391
- # === Tier 5: reverse proxy (waits for all clients) =======================
392
- # Routes the three cyberiaonline.com hosts to their per-variant upstreams with
393
- # websocket upgrade. Config source of truth: ./nginx.conf (generated from the
394
- # multiInstance topology). Fronts the stack only once every tier is healthy.
386
+ # === Stable HTTP gateway =================================================
387
+ # Routes stable Docker DNS names and localhost paths to their per-variant
388
+ # upstreams with websocket upgrade. Config source of truth: ./nginx.conf,
389
+ # maintained by this custom workflow. Ports 80 and 8082 serve the multi-path
390
+ # client gateway; port 8081 is the multi-path server gateway. It starts as
391
+ # soon as the engine is healthy so server startup can safely use the stable
392
+ # engine-cyberia HTTP alias. Client/server upstreams resolve lazily as their
393
+ # independently health-gated pipelines become available.
395
394
  proxy:
396
395
  image: ${PROXY_IMAGE:-nginx:stable-alpine}
397
396
  container_name: dd-cyberia-proxy
398
397
  volumes:
399
398
  - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
400
399
  networks:
401
- - dd-cyberia-internal
400
+ dd-cyberia-internal:
401
+ aliases:
402
+ - cyberia-client
403
+ - cyberia-server
404
+ - engine-cyberia
402
405
  ports:
403
406
  - '${PROXY_HTTP_PORT:-80}:80'
407
+ - '${CYBERIA_SERVER_PORT:-8081}:8081'
408
+ - '${CYBERIA_CLIENT_PORT:-8082}:80'
404
409
  healthcheck:
405
- test: ['CMD', 'wget', '-q', '-O', '-', 'http://127.0.0.1/healthz']
410
+ test:
411
+ - CMD-SHELL
412
+ - >-
413
+ wget -q -O /dev/null http://127.0.0.1/healthz &&
414
+ wget -q -O /dev/null http://127.0.0.1:8081/healthz
406
415
  interval: 15s
407
416
  timeout: 5s
408
417
  retries: 5
409
418
  start_period: 10s
410
419
  depends_on:
411
- cyberia-client:
412
- condition: service_healthy
413
- cyberia-client-forest:
414
- condition: service_healthy
415
- cyberia-client-test:
420
+ engine-cyberia-runtime:
416
421
  condition: service_healthy
417
422
  restart: unless-stopped
418
423
 
@@ -1,8 +1,9 @@
1
- # Generated by 'underpost docker-compose --generate --deploy-id dd-cyberia --docker-compose-id cyberia' do not hand-edit.
2
- # Source of truth: engine-private/conf/dd-cyberia/conf.instances.json (multiInstance).
3
- # Single localhost gateway (dev compose). Access http://localhost/ (default),
4
- # http://localhost/<PATH> per variant. Client origins point back here
5
- # (compose.env CYBERIA_WS_ORIGIN=ws://localhost, CYBERIA_ENGINE_API_ORIGIN=http://localhost).
1
+ # Canonical routing for the dd-cyberia custom Compose workflow. This file is
2
+ # maintained here and is used as-is by the generic Docker Compose CLI.
3
+ # Docker DNS: http://cyberia-client, http://cyberia-server, http://engine-cyberia.
4
+ # Host access: client on http://localhost[:8082]/<PATH>, server on
5
+ # http://localhost:8081/<PATH>, and engine on http://localhost:4005.
6
+ # Optional *.cyberia.localhost aliases remain available.
6
7
 
7
8
  map $http_upgrade $connection_upgrade {
8
9
  default upgrade;
@@ -17,7 +18,7 @@ proxy_http_version 1.1;
17
18
 
18
19
  server {
19
20
  listen 80 default_server;
20
- server_name localhost 127.0.0.1 _;
21
+ server_name localhost 127.0.0.1 cyberia-client cyberia.localhost client.cyberia.localhost _;
21
22
 
22
23
  location = /healthz {
23
24
  access_log off;
@@ -27,7 +28,7 @@ server {
27
28
 
28
29
  # Shared content authority: REST API + engine-served assets (fonts, ui-icons).
29
30
  location /api/ {
30
- set $up_engine engine-cyberia:4005;
31
+ set $up_engine engine-cyberia-runtime:4005;
31
32
  proxy_pass http://$up_engine;
32
33
  proxy_set_header Host $host;
33
34
  proxy_set_header X-Real-IP $remote_addr;
@@ -39,7 +40,7 @@ server {
39
40
  }
40
41
 
41
42
  location /assets/ {
42
- set $up_engine engine-cyberia:4005;
43
+ set $up_engine engine-cyberia-runtime:4005;
43
44
  proxy_pass http://$up_engine;
44
45
  proxy_set_header Host $host;
45
46
  proxy_set_header X-Real-IP $remote_addr;
@@ -51,7 +52,7 @@ server {
51
52
  }
52
53
 
53
54
  location = /ws {
54
- set $up_server_default cyberia-server:8081;
55
+ set $up_server_default cyberia-server-runtime:8081;
55
56
  proxy_pass http://$up_server_default;
56
57
  proxy_set_header Host $host;
57
58
  proxy_set_header X-Real-IP $remote_addr;
@@ -62,9 +63,8 @@ server {
62
63
  proxy_read_timeout 3600s;
63
64
  }
64
65
 
65
- location /FOREST/ws {
66
+ location = /FOREST/ws {
66
67
  set $up_server_forest cyberia-server-forest:8081;
67
- rewrite ^/FOREST/(.*)$ /$1 break;
68
68
  proxy_pass http://$up_server_forest;
69
69
  proxy_set_header Host $host;
70
70
  proxy_set_header X-Real-IP $remote_addr;
@@ -75,9 +75,8 @@ server {
75
75
  proxy_read_timeout 3600s;
76
76
  }
77
77
 
78
- location /TEST/ws {
78
+ location = /TEST/ws {
79
79
  set $up_server_test cyberia-server-test:8081;
80
- rewrite ^/TEST/(.*)$ /$1 break;
81
80
  proxy_pass http://$up_server_test;
82
81
  proxy_set_header Host $host;
83
82
  proxy_set_header X-Real-IP $remote_addr;
@@ -89,7 +88,7 @@ server {
89
88
  }
90
89
 
91
90
  location / {
92
- set $up_client_default cyberia-client:8081;
91
+ set $up_client_default cyberia-client-runtime:8081;
93
92
  proxy_pass http://$up_client_default;
94
93
  proxy_set_header Host $host;
95
94
  proxy_set_header X-Real-IP $remote_addr;
@@ -101,7 +100,7 @@ server {
101
100
  }
102
101
 
103
102
  location = /FOREST { return 301 /FOREST/; }
104
- location /FOREST {
103
+ location ^~ /FOREST/ {
105
104
  set $up_client_forest cyberia-client-forest:8081;
106
105
  proxy_pass http://$up_client_forest;
107
106
  proxy_set_header Host $host;
@@ -114,7 +113,7 @@ server {
114
113
  }
115
114
 
116
115
  location = /TEST { return 301 /TEST/; }
117
- location /TEST {
116
+ location ^~ /TEST/ {
118
117
  set $up_client_test cyberia-client-test:8081;
119
118
  proxy_pass http://$up_client_test;
120
119
  proxy_set_header Host $host;
@@ -126,3 +125,74 @@ server {
126
125
  proxy_read_timeout 3600s;
127
126
  }
128
127
  }
128
+
129
+ # Dedicated Cyberia server gateway. Port 8081 makes all instance paths available
130
+ # from localhost; the stable Docker DNS alias exposes the same routes on :80.
131
+ server {
132
+ listen 80;
133
+ listen 8081 default_server;
134
+ server_name cyberia-server server.cyberia.localhost;
135
+
136
+ location = /healthz {
137
+ access_log off;
138
+ return 200 "ok\n";
139
+ add_header Content-Type text/plain;
140
+ }
141
+
142
+ location = /FOREST { return 301 /FOREST/; }
143
+ location ^~ /FOREST/ {
144
+ set $up_http_server_forest cyberia-server-forest:8081;
145
+ proxy_pass http://$up_http_server_forest;
146
+ proxy_set_header Host $host;
147
+ proxy_set_header X-Real-IP $remote_addr;
148
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
149
+ proxy_set_header X-Forwarded-Proto $scheme;
150
+ proxy_set_header Upgrade $http_upgrade;
151
+ proxy_set_header Connection $connection_upgrade;
152
+ proxy_read_timeout 3600s;
153
+ }
154
+
155
+ location = /TEST { return 301 /TEST/; }
156
+ location ^~ /TEST/ {
157
+ set $up_http_server_test cyberia-server-test:8081;
158
+ proxy_pass http://$up_http_server_test;
159
+ proxy_set_header Host $host;
160
+ proxy_set_header X-Real-IP $remote_addr;
161
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
162
+ proxy_set_header X-Forwarded-Proto $scheme;
163
+ proxy_set_header Upgrade $http_upgrade;
164
+ proxy_set_header Connection $connection_upgrade;
165
+ proxy_read_timeout 3600s;
166
+ }
167
+
168
+ location / {
169
+ set $up_http_server_default cyberia-server-runtime:8081;
170
+ proxy_pass http://$up_http_server_default;
171
+ proxy_set_header Host $host;
172
+ proxy_set_header X-Real-IP $remote_addr;
173
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
174
+ proxy_set_header X-Forwarded-Proto $scheme;
175
+ proxy_set_header Upgrade $http_upgrade;
176
+ proxy_set_header Connection $connection_upgrade;
177
+ proxy_read_timeout 3600s;
178
+ }
179
+ }
180
+
181
+ # The engine remains a single shared authority. Its direct :4005 publication is
182
+ # canonical for debugging; this alias is convenient for browser parity.
183
+ server {
184
+ listen 80;
185
+ server_name engine-cyberia engine.cyberia.localhost;
186
+
187
+ location / {
188
+ set $up_engine_authority engine-cyberia-runtime:4005;
189
+ proxy_pass http://$up_engine_authority;
190
+ proxy_set_header Host $host;
191
+ proxy_set_header X-Real-IP $remote_addr;
192
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
193
+ proxy_set_header X-Forwarded-Proto $scheme;
194
+ proxy_set_header Upgrade $http_upgrade;
195
+ proxy_set_header Connection $connection_upgrade;
196
+ proxy_read_timeout 3600s;
197
+ }
198
+ }
@@ -7,7 +7,7 @@
7
7
  import fs from 'fs-extra';
8
8
  import { loggerFactory } from './logger.js';
9
9
  import Underpost from '../index.js';
10
- import { loadCronDeployEnv } from './conf.js';
10
+ import { loadCronDeployEnv } from './cron.js';
11
11
 
12
12
  const logger = loggerFactory(import.meta);
13
13