cyberia 2.98.3 → 2.99.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.development +1 -0
- package/.env.production +1 -0
- package/.env.test +1 -0
- package/.github/workflows/engine-cyberia.cd.yml +30 -1
- package/bin/cyberia.js +1 -0
- package/bin/deploy.js +1 -1
- package/bin/index.js +1 -0
- package/cli.md +113 -110
- package/deployment.yaml +4 -4
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +4 -4
- package/package.json +1 -2
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.controller.js +30 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.model.js +15 -1
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.router.js +16 -6
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +94 -2
- package/src/api/object-layer/object-layer.service.js +116 -7
- package/src/api/user/user.router.js +7 -40
- package/src/cli/baremetal.js +67 -71
- package/src/cli/cloud-init.js +11 -12
- package/src/cli/cluster.js +22 -24
- package/src/cli/db.js +43 -50
- package/src/cli/deploy.js +163 -61
- package/src/cli/env.js +20 -5
- package/src/cli/fs.js +19 -21
- package/src/cli/index.js +38 -32
- package/src/cli/lxd.js +5 -5
- package/src/cli/monitor.js +83 -88
- package/src/cli/repository.js +7 -6
- package/src/cli/run.js +498 -288
- package/src/cli/secrets.js +3 -3
- package/src/cli/ssh.js +80 -32
- package/src/cli/static.js +1 -1
- package/src/cli/test.js +6 -7
- package/src/client/components/cyberia/ObjectLayerEngine.js +4 -2
- package/src/client/components/cyberia/ObjectLayerEngineModal.js +6 -1
- package/src/client/components/cyberia/ObjectLayerEngineViewer.js +585 -233
- package/src/client/services/atlas-sprite-sheet/atlas-sprite-sheet.service.js +38 -0
- package/src/index.js +49 -32
- package/src/runtime/express/Express.js +7 -6
- package/src/server/auth.js +6 -1
- package/src/server/backup.js +11 -1
- package/src/server/conf.js +4 -4
- package/src/{cli → server}/cron.js +56 -29
- package/src/server/dns.js +39 -31
- package/src/server/object-layer.js +1 -8
- package/src/server/peer.js +2 -2
- package/src/server/process.js +2 -2
- package/src/server/proxy.js +8 -7
- package/src/server/runtime.js +4 -7
- package/src/server/start.js +28 -15
- package/src/ws/IoServer.js +2 -3
- package/scripts/ssh-cluster-info.sh +0 -15
- package/src/cli/script.js +0 -85
- package/src/monitor.js +0 -34
package/.env.development
CHANGED
package/.env.production
CHANGED
package/.env.test
CHANGED
|
@@ -59,4 +59,33 @@ jobs:
|
|
|
59
59
|
echo "Starting remote sync and deploy"
|
|
60
60
|
cd /home/dd/engine
|
|
61
61
|
sudo -n -- /bin/bash -lc "node bin run pull"
|
|
62
|
-
sudo -n -- /bin/bash -lc "node bin run sync --cron-jobs none dd-cyberia,1,,localhost/rockylinux9-underpost:v2.
|
|
62
|
+
sudo -n -- /bin/bash -lc "node bin run sync --cron-jobs none --timeout-response 300000ms dd-cyberia,1,,localhost/rockylinux9-underpost:v2.98.3 --cmd 'npm install -g npm@11.2.0,npm install -g underpost,underpost secret underpost --create-from-file /etc/config/.env.production,underpost start --build --run dd-cyberia production'"
|
|
63
|
+
init:
|
|
64
|
+
if: github.repository == 'underpostnet/engine' && startsWith(github.event.head_commit.message, 'cd(ssh-init-engine-cyberia)')
|
|
65
|
+
name: Remote SSH init deployment
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
- name: Run remote deploy via SSH
|
|
69
|
+
uses: appleboy/ssh-action@v1.2.2
|
|
70
|
+
with:
|
|
71
|
+
# Remote host (secret)
|
|
72
|
+
host: ${{ secrets.SSH_HOST }}
|
|
73
|
+
# Remote user (secret)
|
|
74
|
+
username: ${{ secrets.SSH_USERNAME }}
|
|
75
|
+
# Private key (secret) — the PEM contents (not a path)
|
|
76
|
+
key: ${{ secrets.SSH_PRIV_KEY }}
|
|
77
|
+
# Remote port (optional)
|
|
78
|
+
port: ${{ secrets.SSH_PORT }}
|
|
79
|
+
# Optional: increase timeout for long-running commands
|
|
80
|
+
command_timeout: 60m
|
|
81
|
+
# Optional: if your private key has a passphrase, add:
|
|
82
|
+
# passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }}
|
|
83
|
+
# Commands to run on the remote VM
|
|
84
|
+
script: |
|
|
85
|
+
set -e
|
|
86
|
+
echo "Starting init deploy"
|
|
87
|
+
cd /home/dd/engine
|
|
88
|
+
sudo -n -- /bin/bash -lc "node bin run pull"
|
|
89
|
+
sudo -n -- /bin/bash -lc "node bin deploy dd-cyberia production --kubeadm --sync --build-manifest --image 'localhost/rockylinux9-underpost:v2.98.3' --timeout-response 300000ms --versions green --replicas 1 --cmd 'npm install -g npm@11.2.0,npm install -g underpost,underpost secret underpost --create-from-file /etc/config/.env.production,underpost start --build --run dd-cyberia production'"
|
|
90
|
+
sudo -n -- /bin/bash -lc "node bin deploy dd-cyberia production --kubeadm --disable-update-proxy"
|
|
91
|
+
sudo -n -- /bin/bash -lc "node bin monitor dd-cyberia production --ready-deployment --promote --timeout-response 300000ms --versions green --replicas 1"
|
package/bin/cyberia.js
CHANGED
|
@@ -96,6 +96,7 @@ try {
|
|
|
96
96
|
if (options.drop) {
|
|
97
97
|
await ObjectLayer.deleteMany();
|
|
98
98
|
await ObjectLayerRenderFrames.deleteMany();
|
|
99
|
+
shellExec(`cd src/client/public/cyberia && underpost run clean .`);
|
|
99
100
|
}
|
|
100
101
|
|
|
101
102
|
const storage = options.storageFilePath ? JSON.parse(fs.readFileSync(options.storageFilePath, 'utf8')) : null;
|
package/bin/deploy.js
CHANGED
|
@@ -754,7 +754,7 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
754
754
|
|
|
755
755
|
case 'create-ports': {
|
|
756
756
|
const cmd = [];
|
|
757
|
-
const commissioningDeviceIp = getLocalIPv4Address();
|
|
757
|
+
const commissioningDeviceIp = Underpost.dns.getLocalIPv4Address();
|
|
758
758
|
for (const port of ['5240']) {
|
|
759
759
|
const name = 'maas';
|
|
760
760
|
cmd.push(`${name}:${port}-${port}:${commissioningDeviceIp}`);
|
package/bin/index.js
CHANGED
|
@@ -96,6 +96,7 @@ try {
|
|
|
96
96
|
if (options.drop) {
|
|
97
97
|
await ObjectLayer.deleteMany();
|
|
98
98
|
await ObjectLayerRenderFrames.deleteMany();
|
|
99
|
+
shellExec(`cd src/client/public/cyberia && underpost run clean .`);
|
|
99
100
|
}
|
|
100
101
|
|
|
101
102
|
const storage = options.storageFilePath ? JSON.parse(fs.readFileSync(options.storageFilePath, 'utf8')) : null;
|
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.
|
|
1
|
+
## underpost ci/cd cli v2.99.1
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -25,7 +25,6 @@ Commands:
|
|
|
25
25
|
install Quickly imports Underpost npm dependencies by copying them.
|
|
26
26
|
db [options] [deploy-list] Manages database operations with support for MariaDB and MongoDB, including import/export, multi-pod targeting, and Git integration.
|
|
27
27
|
metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
|
|
28
|
-
script [options] <operator> <script-name> [script-value] Supports a variety of built-in Underpost global scripts, their preset lifecycle events, and arbitrary custom scripts.
|
|
29
28
|
cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
|
|
30
29
|
fs [options] [path] Manages file storage, defaulting to file upload operations.
|
|
31
30
|
test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
|
|
@@ -274,16 +273,20 @@ Options:
|
|
|
274
273
|
Manages Underpost configurations using various operators.
|
|
275
274
|
|
|
276
275
|
Arguments:
|
|
277
|
-
operator
|
|
278
|
-
|
|
279
|
-
key
|
|
280
|
-
value
|
|
276
|
+
operator The configuration operation to perform. Options:
|
|
277
|
+
set, delete, get, list, clean.
|
|
278
|
+
key Optional: The specific configuration key to manage.
|
|
279
|
+
value Optional: The value to set for the configuration
|
|
280
|
+
key.
|
|
281
281
|
|
|
282
282
|
Options:
|
|
283
|
-
--plain
|
|
284
|
-
--filter <keyword>
|
|
285
|
-
|
|
286
|
-
-
|
|
283
|
+
--plain Prints the configuration value in plain text.
|
|
284
|
+
--filter <keyword> Filters the list by matching key or value (only for
|
|
285
|
+
list operation).
|
|
286
|
+
--deploy-id <deploy-id> Sets the deployment configuration ID for the
|
|
287
|
+
operation context.
|
|
288
|
+
--build Sets the build context for the operation.
|
|
289
|
+
-h, --help display help for command
|
|
287
290
|
|
|
288
291
|
```
|
|
289
292
|
|
|
@@ -417,61 +420,69 @@ Options:
|
|
|
417
420
|
Manages application deployments, defaulting to deploying development pods.
|
|
418
421
|
|
|
419
422
|
Arguments:
|
|
420
|
-
deploy-list
|
|
421
|
-
|
|
422
|
-
env
|
|
423
|
-
|
|
424
|
-
|
|
423
|
+
deploy-list A comma-separated list of deployment IDs
|
|
424
|
+
(e.g., "default-a,default-b").
|
|
425
|
+
env Optional: The environment for deployment
|
|
426
|
+
(e.g., "development", "production").
|
|
427
|
+
Defaults to "development".
|
|
425
428
|
|
|
426
429
|
Options:
|
|
427
|
-
--remove
|
|
428
|
-
|
|
429
|
-
--sync
|
|
430
|
-
|
|
431
|
-
--info-router
|
|
432
|
-
|
|
433
|
-
--expose
|
|
434
|
-
|
|
435
|
-
--cert
|
|
436
|
-
|
|
437
|
-
--cert-hosts <hosts>
|
|
438
|
-
|
|
439
|
-
--node <node>
|
|
440
|
-
|
|
441
|
-
--build-manifest
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
--replicas <replicas>
|
|
445
|
-
|
|
446
|
-
--image <image>
|
|
447
|
-
--versions <deployment-versions>
|
|
448
|
-
|
|
449
|
-
--traffic <traffic-versions>
|
|
450
|
-
|
|
451
|
-
--
|
|
452
|
-
|
|
453
|
-
--
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
--
|
|
460
|
-
|
|
461
|
-
--
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
--
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
--
|
|
473
|
-
|
|
474
|
-
|
|
430
|
+
--remove Deletes specified deployments and their
|
|
431
|
+
associated services.
|
|
432
|
+
--sync Synchronizes deployment environment
|
|
433
|
+
variables, ports, and replica counts.
|
|
434
|
+
--info-router Displays the current router structure and
|
|
435
|
+
configuration.
|
|
436
|
+
--expose Exposes services matching the provided
|
|
437
|
+
deployment ID list.
|
|
438
|
+
--cert Resets TLS/SSL certificate secrets for
|
|
439
|
+
deployments.
|
|
440
|
+
--cert-hosts <hosts> Resets TLS/SSL certificate secrets for
|
|
441
|
+
specified hosts.
|
|
442
|
+
--node <node> Sets optional node for deployment
|
|
443
|
+
operations.
|
|
444
|
+
--build-manifest Builds Kubernetes YAML manifests,
|
|
445
|
+
including deployments, services, proxies,
|
|
446
|
+
and secrets.
|
|
447
|
+
--replicas <replicas> Sets a custom number of replicas for
|
|
448
|
+
deployments.
|
|
449
|
+
--image <image> Sets a custom image for deployments.
|
|
450
|
+
--versions <deployment-versions> A comma-separated list of custom
|
|
451
|
+
deployment versions.
|
|
452
|
+
--traffic <traffic-versions> A comma-separated list of custom
|
|
453
|
+
deployment traffic weights.
|
|
454
|
+
--timeout-response <duration> Sets HTTPProxy per-route response timeout
|
|
455
|
+
(e.g., "1s", "300ms", "infinity").
|
|
456
|
+
--timeout-idle <duration> Sets HTTPProxy per-route idle timeout
|
|
457
|
+
(e.g., "10s", "infinity").
|
|
458
|
+
--retry-count <count> Sets HTTPProxy per-route retry count
|
|
459
|
+
(e.g., 3).
|
|
460
|
+
--retry-per-try-timeout <duration> Sets HTTPProxy retry per-try timeout
|
|
461
|
+
(e.g., "150ms").
|
|
462
|
+
--disable-update-deployment Disables updates to deployments.
|
|
463
|
+
--disable-update-proxy Disables updates to proxies.
|
|
464
|
+
--disable-deployment-proxy Disables proxies of deployments.
|
|
465
|
+
--disable-update-volume Disables updates to volume mounts during
|
|
466
|
+
deployment.
|
|
467
|
+
--status Retrieves current network traffic data
|
|
468
|
+
from resource deployments and the host
|
|
469
|
+
machine network configuration.
|
|
470
|
+
--kubeadm Enables the kubeadm context for
|
|
471
|
+
deployment operations.
|
|
472
|
+
--etc-hosts Enables the etc-hosts context for
|
|
473
|
+
deployment operations.
|
|
474
|
+
--restore-hosts Restores default `/etc/hosts` entries.
|
|
475
|
+
--disable-update-underpost-config Disables updates to Underpost
|
|
476
|
+
configuration during deployment.
|
|
477
|
+
--namespace <namespace> Kubernetes namespace for deployment
|
|
478
|
+
operations (defaults to "default").
|
|
479
|
+
--kind-type <kind-type> Specifies the Kind cluster type for
|
|
480
|
+
deployment operations.
|
|
481
|
+
--port <port> Sets up port forwarding from local to
|
|
482
|
+
remote ports.
|
|
483
|
+
--cmd <cmd> Custom initialization command for
|
|
484
|
+
deployment (comma-separated commands).
|
|
485
|
+
-h, --help display help for command
|
|
475
486
|
|
|
476
487
|
```
|
|
477
488
|
|
|
@@ -623,32 +634,6 @@ Options:
|
|
|
623
634
|
```
|
|
624
635
|
|
|
625
636
|
|
|
626
|
-
### `script` :
|
|
627
|
-
```
|
|
628
|
-
Usage: underpost script [options] <operator> <script-name> [script-value]
|
|
629
|
-
|
|
630
|
-
Supports a variety of built-in Underpost global scripts, their preset lifecycle
|
|
631
|
-
events, and arbitrary custom scripts.
|
|
632
|
-
|
|
633
|
-
Arguments:
|
|
634
|
-
operator The script operation to perform. Options: set, run,
|
|
635
|
-
get.
|
|
636
|
-
script-name The name of the script to execute.
|
|
637
|
-
script-value Optional: A literal command or a path to a script
|
|
638
|
-
file.
|
|
639
|
-
|
|
640
|
-
Options:
|
|
641
|
-
--itc Executes the script within the container execution
|
|
642
|
-
context.
|
|
643
|
-
--itc-path Specifies container path options for script execution.
|
|
644
|
-
--ns <ns-name> Optional: Specifies the namespace context for script
|
|
645
|
-
execution.
|
|
646
|
-
--pod-name <pod-name> Optional: Specifies the pod name for script execution.
|
|
647
|
-
-h, --help display help for command
|
|
648
|
-
|
|
649
|
-
```
|
|
650
|
-
|
|
651
|
-
|
|
652
637
|
### `cron` :
|
|
653
638
|
```
|
|
654
639
|
Usage: underpost cron [options] [deploy-list] [job-list]
|
|
@@ -660,9 +645,7 @@ Arguments:
|
|
|
660
645
|
deploy-list A comma-separated list of deployment IDs (e.g.,
|
|
661
646
|
"default-a,default-b").
|
|
662
647
|
job-list A comma-separated list of job IDs. Options:
|
|
663
|
-
|
|
664
|
-
getRelatedDeployIdList. Defaults to all available
|
|
665
|
-
jobs.
|
|
648
|
+
dns,backup. Defaults to all available jobs.
|
|
666
649
|
|
|
667
650
|
Options:
|
|
668
651
|
--init-pm2-cronjobs Initializes PM2 cron jobs from configuration for
|
|
@@ -730,25 +713,40 @@ Options:
|
|
|
730
713
|
Manages health server monitoring for specified deployments.
|
|
731
714
|
|
|
732
715
|
Arguments:
|
|
733
|
-
deploy-id
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
716
|
+
deploy-id The deployment configuration ID to
|
|
717
|
+
monitor.
|
|
718
|
+
env Optional: The environment to monitor
|
|
719
|
+
(e.g., "development", "production").
|
|
720
|
+
Defaults to "development".
|
|
737
721
|
|
|
738
722
|
Options:
|
|
739
|
-
--ms-interval <ms-interval>
|
|
740
|
-
|
|
741
|
-
--now
|
|
742
|
-
--single
|
|
743
|
-
|
|
744
|
-
--replicas <replicas>
|
|
745
|
-
|
|
746
|
-
--type <type>
|
|
747
|
-
--sync
|
|
748
|
-
|
|
749
|
-
--namespace <namespace>
|
|
750
|
-
|
|
751
|
-
-
|
|
723
|
+
--ms-interval <ms-interval> Sets a custom millisecond interval for
|
|
724
|
+
monitoring checks.
|
|
725
|
+
--now Executes the monitor script immediately.
|
|
726
|
+
--single Disables recurrence, running the monitor
|
|
727
|
+
script only once.
|
|
728
|
+
--replicas <replicas> Sets a custom number of replicas for
|
|
729
|
+
monitoring. Defaults to 1.
|
|
730
|
+
--type <type> Sets a custom monitor type.
|
|
731
|
+
--sync Synchronizes with current proxy
|
|
732
|
+
deployments and traffic configurations.
|
|
733
|
+
--namespace <namespace> Sets the Kubernetes namespace for the
|
|
734
|
+
deployment. Defaults to "default".
|
|
735
|
+
--timeout-response <duration> Sets HTTPProxy per-route response timeout
|
|
736
|
+
(e.g., "5s").
|
|
737
|
+
--timeout-idle <duration> Sets HTTPProxy per-route idle timeout
|
|
738
|
+
(e.g., "10s", "infinity").
|
|
739
|
+
--retry-count <count> Sets HTTPProxy per-route retry count
|
|
740
|
+
(e.g., 3).
|
|
741
|
+
--retry-per-try-timeout <duration> Sets HTTPProxy retry per-try timeout
|
|
742
|
+
(e.g., "150ms").
|
|
743
|
+
--disable-private-conf-update Disables updates to private configuration
|
|
744
|
+
during execution.
|
|
745
|
+
--versions <deployment-versions> Specifies the deployment versions to
|
|
746
|
+
monitor. eg. "blue,green", "green"
|
|
747
|
+
--ready-deployment Run in ready deployment monitor mode.
|
|
748
|
+
--promote Promotes the deployment after monitoring.
|
|
749
|
+
-h, --help display help for command
|
|
752
750
|
|
|
753
751
|
```
|
|
754
752
|
|
|
@@ -802,7 +800,7 @@ Options:
|
|
|
802
800
|
Runs specified scripts using various runners.
|
|
803
801
|
|
|
804
802
|
Arguments:
|
|
805
|
-
runner-id The runner ID to run. Options: dev-cluster,
|
|
803
|
+
runner-id The runner ID to run. Options: dev-cluster,metadata,svc-ls,svc-rm,ssh-deploy-info,dev-hosts-expose,dev-hosts-restore,cluster-build,template-deploy,template-deploy-image,clean,pull,release-deploy,ssh-deploy,ide,crypto-policy,sync,stop,ssh-deploy-stop,ssh-deploy-db-rollback,ssh-deploy-db,ssh-deploy-db-status,tz,cron,get-proxy,instance-promote,instance,ls-deployments,host-update,dd-container,ip-info,monitor,db-client,git-conf,promote,metrics,cluster,deploy,disk-clean,disk-usage,dev,service,etc-hosts,sh,log,ps,ptls,release-cmt,deploy-test,sync-replica,tf-vae-test,spark-template,rmi,kill,secret,underpost-config,gpu-env,tf-gpu-test,deploy-job.
|
|
806
804
|
path The input value, identifier, or path for the operation.
|
|
807
805
|
|
|
808
806
|
Options:
|
|
@@ -855,6 +853,11 @@ Options:
|
|
|
855
853
|
--hosts <hosts> Comma-separated list of hosts for the runner execution.
|
|
856
854
|
--instance-id <instance-id> Sets instance id context for the runner execution.
|
|
857
855
|
--pid <process-id> Sets process id context for the runner execution.
|
|
856
|
+
--timeout-response <duration> Sets HTTPProxy per-route response timeout (e.g., "1s", "300ms", "infinity").
|
|
857
|
+
--timeout-idle <duration> Sets HTTPProxy per-route idle timeout (e.g., "10s", "infinity").
|
|
858
|
+
--retry-count <count> Sets HTTPProxy per-route retry count (e.g., 3).
|
|
859
|
+
--retry-per-try-timeout <duration> Sets HTTPProxy retry per-try timeout (e.g., "150ms").
|
|
860
|
+
--disable-private-conf-update Disables updates to private configuration during execution.
|
|
858
861
|
-h, --help display help for command
|
|
859
862
|
|
|
860
863
|
```
|
package/deployment.yaml
CHANGED
|
@@ -18,13 +18,13 @@ spec:
|
|
|
18
18
|
spec:
|
|
19
19
|
containers:
|
|
20
20
|
- name: dd-cyberia-development-blue
|
|
21
|
-
image: localhost/rockylinux9-underpost:v2.
|
|
21
|
+
image: localhost/rockylinux9-underpost:v2.99.1
|
|
22
22
|
|
|
23
23
|
command:
|
|
24
24
|
- /bin/sh
|
|
25
25
|
- -c
|
|
26
26
|
- >
|
|
27
|
-
npm install -g npm@11.2.0 && npm install -g underpost &&
|
|
27
|
+
npm install -g npm@11.2.0 && npm install -g underpost && underpost secret underpost --create-from-file /etc/config/.env.development && underpost start --build --run --underpost-quickly-install dd-cyberia development
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
volumeMounts:
|
|
@@ -156,13 +156,13 @@ spec:
|
|
|
156
156
|
spec:
|
|
157
157
|
containers:
|
|
158
158
|
- name: dd-cyberia-development-green
|
|
159
|
-
image: localhost/rockylinux9-underpost:v2.
|
|
159
|
+
image: localhost/rockylinux9-underpost:v2.99.1
|
|
160
160
|
|
|
161
161
|
command:
|
|
162
162
|
- /bin/sh
|
|
163
163
|
- -c
|
|
164
164
|
- >
|
|
165
|
-
npm install -g npm@11.2.0 && npm install -g underpost &&
|
|
165
|
+
npm install -g npm@11.2.0 && npm install -g underpost && underpost secret underpost --create-from-file /etc/config/.env.development && underpost start --build --run --underpost-quickly-install dd-cyberia development
|
|
166
166
|
|
|
167
167
|
|
|
168
168
|
volumeMounts:
|
|
@@ -17,7 +17,7 @@ spec:
|
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
19
|
- name: dd-default-development-blue
|
|
20
|
-
image: localhost/rockylinux9-underpost:v2.
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.99.1
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "124Ki"
|
|
@@ -100,7 +100,7 @@ spec:
|
|
|
100
100
|
spec:
|
|
101
101
|
containers:
|
|
102
102
|
- name: dd-default-development-green
|
|
103
|
-
image: localhost/rockylinux9-underpost:v2.
|
|
103
|
+
image: localhost/rockylinux9-underpost:v2.99.1
|
|
104
104
|
# resources:
|
|
105
105
|
# requests:
|
|
106
106
|
# memory: "124Ki"
|
|
@@ -18,13 +18,13 @@ spec:
|
|
|
18
18
|
spec:
|
|
19
19
|
containers:
|
|
20
20
|
- name: dd-test-development-blue
|
|
21
|
-
image: localhost/rockylinux9-underpost:v2.
|
|
21
|
+
image: localhost/rockylinux9-underpost:v2.99.1
|
|
22
22
|
|
|
23
23
|
command:
|
|
24
24
|
- /bin/sh
|
|
25
25
|
- -c
|
|
26
26
|
- >
|
|
27
|
-
npm install -g npm@11.2.0 && npm install -g underpost &&
|
|
27
|
+
npm install -g npm@11.2.0 && npm install -g underpost && underpost secret underpost --create-from-file /etc/config/.env.development && underpost start --build --run --underpost-quickly-install dd-test development
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
volumeMounts:
|
|
@@ -103,13 +103,13 @@ spec:
|
|
|
103
103
|
spec:
|
|
104
104
|
containers:
|
|
105
105
|
- name: dd-test-development-green
|
|
106
|
-
image: localhost/rockylinux9-underpost:v2.
|
|
106
|
+
image: localhost/rockylinux9-underpost:v2.99.1
|
|
107
107
|
|
|
108
108
|
command:
|
|
109
109
|
- /bin/sh
|
|
110
110
|
- -c
|
|
111
111
|
- >
|
|
112
|
-
npm install -g npm@11.2.0 && npm install -g underpost &&
|
|
112
|
+
npm install -g npm@11.2.0 && npm install -g underpost && underpost secret underpost --create-from-file /etc/config/.env.development && underpost start --build --run --underpost-quickly-install dd-test development
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
volumeMounts:
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"main": "src/index.js",
|
|
4
4
|
"name": "cyberia",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.99.1",
|
|
6
6
|
"description": "Cyberia Engine - Object Layer and Assets Management Microservice",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"dev": "env-cmd -f .env.development nodemon src/server",
|
|
13
13
|
"dev-img": "env-cmd -f .env.development node src/server",
|
|
14
14
|
"prod-img": "env-cmd -f .env.production node src/server",
|
|
15
|
-
"monitor": "pm2 start src/monitor.js --name monitor -- dd production",
|
|
16
15
|
"dev-api": "env-cmd -f .env.development nodemon --watch src --ignore src/client src/api",
|
|
17
16
|
"dev-client": "env-cmd -f .env.development node src/client.dev",
|
|
18
17
|
"dev-proxy": "env-cmd -f .env.development node src/proxy proxy",
|
|
@@ -4,6 +4,36 @@ import { AtlasSpriteSheetService } from './atlas-sprite-sheet.service.js';
|
|
|
4
4
|
const logger = loggerFactory(import.meta);
|
|
5
5
|
|
|
6
6
|
const AtlasSpriteSheetController = {
|
|
7
|
+
generate: async (req, res, options) => {
|
|
8
|
+
try {
|
|
9
|
+
const result = await AtlasSpriteSheetService.generate(req, res, options);
|
|
10
|
+
return res.status(200).json({
|
|
11
|
+
status: 'success',
|
|
12
|
+
data: result,
|
|
13
|
+
});
|
|
14
|
+
} catch (error) {
|
|
15
|
+
logger.error('AtlasSpriteSheetController.generate error:', error);
|
|
16
|
+
return res.status(500).json({
|
|
17
|
+
status: 'error',
|
|
18
|
+
message: error.message,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
deleteByObjectLayerId: async (req, res, options) => {
|
|
23
|
+
try {
|
|
24
|
+
const result = await AtlasSpriteSheetService.deleteByObjectLayerId(req, res, options);
|
|
25
|
+
return res.status(200).json({
|
|
26
|
+
status: 'success',
|
|
27
|
+
data: result,
|
|
28
|
+
});
|
|
29
|
+
} catch (error) {
|
|
30
|
+
logger.error('AtlasSpriteSheetController.deleteByObjectLayerId error:', error);
|
|
31
|
+
return res.status(500).json({
|
|
32
|
+
status: 'error',
|
|
33
|
+
message: error.message,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
},
|
|
7
37
|
post: async (req, res, options) => {
|
|
8
38
|
try {
|
|
9
39
|
const result = await AtlasSpriteSheetService.post(req, res, options);
|
|
@@ -123,4 +123,18 @@ const AtlasSpriteSheetModel = model('AtlasSpriteSheet', AtlasSpriteSheetSchema);
|
|
|
123
123
|
|
|
124
124
|
const ProviderSchema = AtlasSpriteSheetSchema;
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
const AtlasSpriteSheetDto = {
|
|
127
|
+
select: {
|
|
128
|
+
get: () => {
|
|
129
|
+
return {
|
|
130
|
+
_id: 1,
|
|
131
|
+
fileId: 1,
|
|
132
|
+
metadata: 1,
|
|
133
|
+
createdAt: 1,
|
|
134
|
+
updatedAt: 1,
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export { AtlasSpriteSheetSchema, AtlasSpriteSheetModel, ProviderSchema, AtlasSpriteSheetDto };
|
|
@@ -7,18 +7,28 @@ const logger = loggerFactory(import.meta);
|
|
|
7
7
|
const AtlasSpriteSheetRouter = (options) => {
|
|
8
8
|
const router = express.Router();
|
|
9
9
|
const authMiddleware = options.authMiddleware;
|
|
10
|
-
router.post(
|
|
11
|
-
|
|
10
|
+
router.post(
|
|
11
|
+
`/generate/:id`,
|
|
12
|
+
authMiddleware,
|
|
13
|
+
async (req, res) => await AtlasSpriteSheetController.generate(req, res, options),
|
|
14
|
+
);
|
|
15
|
+
router.delete(
|
|
16
|
+
`/object-layer/:id`,
|
|
17
|
+
authMiddleware,
|
|
18
|
+
async (req, res) => await AtlasSpriteSheetController.deleteByObjectLayerId(req, res, options),
|
|
19
|
+
);
|
|
20
|
+
router.post(`/:id`, authMiddleware, async (req, res) => await AtlasSpriteSheetController.post(req, res, options));
|
|
21
|
+
router.post(`/`, authMiddleware, async (req, res) => await AtlasSpriteSheetController.post(req, res, options));
|
|
12
22
|
router.get(
|
|
13
23
|
`/:id`,
|
|
14
24
|
// authMiddleware,
|
|
15
25
|
async (req, res) => await AtlasSpriteSheetController.get(req, res, options),
|
|
16
26
|
);
|
|
17
27
|
router.get(`/`, async (req, res) => await AtlasSpriteSheetController.get(req, res, options));
|
|
18
|
-
router.put(`/:id`, async (req, res) => await AtlasSpriteSheetController.put(req, res, options));
|
|
19
|
-
router.put(`/`, async (req, res) => await AtlasSpriteSheetController.put(req, res, options));
|
|
20
|
-
router.delete(`/:id`, async (req, res) => await AtlasSpriteSheetController.delete(req, res, options));
|
|
21
|
-
router.delete(`/`, async (req, res) => await AtlasSpriteSheetController.delete(req, res, options));
|
|
28
|
+
router.put(`/:id`, authMiddleware, async (req, res) => await AtlasSpriteSheetController.put(req, res, options));
|
|
29
|
+
router.put(`/`, authMiddleware, async (req, res) => await AtlasSpriteSheetController.put(req, res, options));
|
|
30
|
+
router.delete(`/:id`, authMiddleware, async (req, res) => await AtlasSpriteSheetController.delete(req, res, options));
|
|
31
|
+
router.delete(`/`, authMiddleware, async (req, res) => await AtlasSpriteSheetController.delete(req, res, options));
|
|
22
32
|
return router;
|
|
23
33
|
};
|
|
24
34
|
|