cyberia 2.99.8 → 3.0.2

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 (81) hide show
  1. package/.env.production +1 -0
  2. package/.github/workflows/engine-cyberia.cd.yml +1 -0
  3. package/.github/workflows/gitlab.ci.yml +20 -0
  4. package/.github/workflows/publish.ci.yml +18 -38
  5. package/.github/workflows/publish.cyberia.ci.yml +18 -38
  6. package/.vscode/extensions.json +8 -50
  7. package/.vscode/settings.json +0 -77
  8. package/CHANGELOG.md +171 -1
  9. package/{cli.md → CLI-HELP.md} +49 -44
  10. package/README.md +139 -0
  11. package/bin/build.js +7 -15
  12. package/bin/cyberia.js +385 -71
  13. package/bin/deploy.js +14 -151
  14. package/bin/file.js +13 -8
  15. package/bin/index.js +385 -71
  16. package/bin/zed.js +63 -2
  17. package/conf.js +32 -3
  18. package/deployment.yaml +2 -2
  19. package/jsdoc.json +1 -2
  20. package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
  21. package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
  22. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  23. package/manifests/deployment/dd-test-development/deployment.yaml +2 -2
  24. package/manifests/deployment/fastapi/initial_data.sh +4 -52
  25. package/manifests/ipfs/configmap.yaml +64 -0
  26. package/manifests/ipfs/headless-service.yaml +35 -0
  27. package/manifests/ipfs/kustomization.yaml +8 -0
  28. package/manifests/ipfs/statefulset.yaml +149 -0
  29. package/manifests/ipfs/storage-class.yaml +9 -0
  30. package/package.json +15 -11
  31. package/scripts/k3s-node-setup.sh +89 -0
  32. package/scripts/lxd-vm-setup.sh +23 -0
  33. package/scripts/rocky-setup.sh +1 -13
  34. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.controller.js +2 -0
  35. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.model.js +7 -0
  36. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +93 -2
  37. package/src/api/file/file.controller.js +3 -13
  38. package/src/api/file/file.ref.json +0 -21
  39. package/src/api/ipfs/ipfs.controller.js +104 -0
  40. package/src/api/ipfs/ipfs.model.js +71 -0
  41. package/src/api/ipfs/ipfs.router.js +31 -0
  42. package/src/api/ipfs/ipfs.service.js +193 -0
  43. package/src/api/object-layer/README.md +139 -0
  44. package/src/api/object-layer/object-layer.controller.js +3 -0
  45. package/src/api/object-layer/object-layer.model.js +15 -1
  46. package/src/api/object-layer/object-layer.router.js +6 -10
  47. package/src/api/object-layer/object-layer.service.js +311 -182
  48. package/src/api/user/user.router.js +0 -47
  49. package/src/cli/baremetal.js +7 -9
  50. package/src/cli/cluster.js +95 -152
  51. package/src/cli/deploy.js +8 -5
  52. package/src/cli/index.js +31 -31
  53. package/src/cli/ipfs.js +184 -0
  54. package/src/cli/lxd.js +192 -237
  55. package/src/cli/repository.js +4 -1
  56. package/src/cli/run.js +17 -2
  57. package/src/client/components/core/Docs.js +92 -6
  58. package/src/client/components/core/LoadingAnimation.js +2 -3
  59. package/src/client/components/core/Modal.js +1 -1
  60. package/src/client/components/core/VanillaJs.js +36 -25
  61. package/src/client/components/cyberia/ObjectLayerEngineModal.js +4 -5
  62. package/src/client/components/cyberia/ObjectLayerEngineViewer.js +280 -29
  63. package/src/client/services/ipfs/ipfs.service.js +144 -0
  64. package/src/client/services/object-layer/object-layer.management.js +161 -8
  65. package/src/client/services/user/user.management.js +0 -5
  66. package/src/client/services/user/user.service.js +1 -1
  67. package/src/index.js +12 -1
  68. package/src/runtime/express/Express.js +4 -3
  69. package/src/server/auth.js +18 -18
  70. package/src/server/client-build-docs.js +178 -41
  71. package/src/server/conf.js +1 -1
  72. package/src/server/ipfs-client.js +433 -0
  73. package/src/server/logger.js +22 -10
  74. package/src/server/object-layer.js +649 -18
  75. package/src/server/semantic-layer-generator.js +1083 -0
  76. package/src/server/shape-generator.js +952 -0
  77. package/test/shape-generator.test.js +457 -0
  78. package/.vscode/zed.keymap.json +0 -39
  79. package/.vscode/zed.settings.json +0 -20
  80. package/bin/ssl.js +0 -63
  81. package/manifests/lxd/underpost-setup.sh +0 -163
package/conf.js CHANGED
@@ -130,6 +130,8 @@ const DefaultConf = /**/ {
130
130
  public_folder: '/dist/vanilla-jsoneditor/standalone.js',
131
131
  import_name: 'vanilla-jsoneditor',
132
132
  import_name_build: '/dist/vanilla-jsoneditor/standalone.js',
133
+ styles: './node_modules/vanilla-jsoneditor/themes',
134
+ public_styles_folder: '/styles/vanilla-jsoneditor',
133
135
  },
134
136
  ],
135
137
  services: [
@@ -408,10 +410,15 @@ const DefaultConf = /**/ {
408
410
  'object-layer',
409
411
  'object-layer-render-frames',
410
412
  'atlas-sprite-sheet',
413
+ 'ipfs',
411
414
  ],
412
415
  ws: 'core',
413
416
  peer: true,
414
- origins: [],
417
+ origins: [
418
+ 'https://www.cyberiaonline.com',
419
+ 'https://server.cyberiaonline.com',
420
+ 'https://client.cyberiaonline.com',
421
+ ],
415
422
  minifyBuild: false,
416
423
  liteBuild: true,
417
424
  docsBuild: false,
@@ -456,7 +463,18 @@ const DefaultConf = /**/ {
456
463
  '/': {
457
464
  client: 'cryptokoyn',
458
465
  runtime: 'nodejs',
459
- apis: ['user', 'file', 'crypto'],
466
+ apis: [
467
+ 'core',
468
+ 'file',
469
+ 'user',
470
+ 'crypto',
471
+ 'document',
472
+ 'instance',
473
+ 'object-layer',
474
+ 'object-layer-render-frames',
475
+ 'atlas-sprite-sheet',
476
+ 'ipfs',
477
+ ],
460
478
  origins: [],
461
479
  minifyBuild: false,
462
480
  liteBuild: true,
@@ -504,7 +522,18 @@ const DefaultConf = /**/ {
504
522
  '/': {
505
523
  client: 'itemledger',
506
524
  runtime: 'nodejs',
507
- apis: ['user', 'file', 'crypto'],
525
+ apis: [
526
+ 'core',
527
+ 'file',
528
+ 'user',
529
+ 'crypto',
530
+ 'document',
531
+ 'instance',
532
+ 'object-layer',
533
+ 'object-layer-render-frames',
534
+ 'atlas-sprite-sheet',
535
+ 'ipfs',
536
+ ],
508
537
  origins: [],
509
538
  minifyBuild: false,
510
539
  liteBuild: true,
package/deployment.yaml CHANGED
@@ -18,7 +18,7 @@ spec:
18
18
  spec:
19
19
  containers:
20
20
  - name: dd-cyberia-development-blue
21
- image: localhost/rockylinux9-underpost:v2.99.8
21
+ image: localhost/rockylinux9-underpost:v3.0.2
22
22
 
23
23
  command:
24
24
  - /bin/sh
@@ -156,7 +156,7 @@ spec:
156
156
  spec:
157
157
  containers:
158
158
  - name: dd-cyberia-development-green
159
- image: localhost/rockylinux9-underpost:v2.99.8
159
+ image: localhost/rockylinux9-underpost:v3.0.2
160
160
 
161
161
  command:
162
162
  - /bin/sh
package/jsdoc.json CHANGED
@@ -3,7 +3,6 @@
3
3
  "allowUnknownTags": true,
4
4
  "dictionaries": ["jsdoc"]
5
5
  },
6
- "categoryfile": "./jsdoc-categories.json",
7
6
  "source": {
8
7
  "include": ["./src", "./package.json", "./README.md", "./CHANGELOG.md"],
9
8
  "includePattern": ".js$",
@@ -26,7 +25,7 @@
26
25
  "favicon": "./public/www.nexodev.org/",
27
26
  "displayModuleHeader": true,
28
27
  "includeFilesListInHomepage": true,
29
- "sections": ["Modules", "Classes", "Namespaces", "Tutorials", "Events", "Interfaces", "Global"],
28
+ "sections": ["Namespaces", "Tutorials"],
30
29
  "meta": [
31
30
  {
32
31
  "name": "author",
@@ -23,7 +23,7 @@ spec:
23
23
  spec:
24
24
  containers:
25
25
  - name: dd-cron-backup
26
- image: underpost/underpost-engine:v2.99.8
26
+ image: underpost/underpost-engine:v3.0.2
27
27
  command:
28
28
  - /bin/sh
29
29
  - -c
@@ -23,7 +23,7 @@ spec:
23
23
  spec:
24
24
  containers:
25
25
  - name: dd-cron-dns
26
- image: underpost/underpost-engine:v2.99.8
26
+ image: underpost/underpost-engine:v3.0.2
27
27
  command:
28
28
  - /bin/sh
29
29
  - -c
@@ -17,7 +17,7 @@ spec:
17
17
  spec:
18
18
  containers:
19
19
  - name: dd-default-development-blue
20
- image: localhost/rockylinux9-underpost:v2.99.8
20
+ image: localhost/rockylinux9-underpost:v3.0.2
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.99.8
103
+ image: localhost/rockylinux9-underpost:v3.0.2
104
104
  # resources:
105
105
  # requests:
106
106
  # memory: "124Ki"
@@ -18,7 +18,7 @@ spec:
18
18
  spec:
19
19
  containers:
20
20
  - name: dd-test-development-blue
21
- image: localhost/rockylinux9-underpost:v2.99.8
21
+ image: localhost/rockylinux9-underpost:v3.0.2
22
22
 
23
23
  command:
24
24
  - /bin/sh
@@ -103,7 +103,7 @@ spec:
103
103
  spec:
104
104
  containers:
105
105
  - name: dd-test-development-green
106
- image: localhost/rockylinux9-underpost:v2.99.8
106
+ image: localhost/rockylinux9-underpost:v3.0.2
107
107
 
108
108
  command:
109
109
  - /bin/sh
@@ -1,56 +1,8 @@
1
1
  #!/bin/bash
2
+ # FastAPI initial data script
2
3
 
3
- # IMPORTANT: For non-interactive scripts, 'conda activate' can be problematic
4
- # because it relies on the shell's initialization.
5
- # A more robust and recommended way to run commands within a Conda environment
6
- # from a script is to use 'conda run'. This command directly executes a process
7
- # in the specified environment without needing to manually source 'conda.sh'.
4
+ # Dynamically determine the directory of the script and change to that directory
5
+ cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
6
 
9
- # Navigate to the application's root directory for module discovery.
10
- # This is crucial for Python to correctly find your 'app' module using 'python -m'.
11
- #
12
- # Let's assume a common project structure:
13
- # full-stack-fastapi-template/
14
- # ├── backend/
15
- # │ ├── app/
16
- # │ │ └── initial_data.py (the Python script you want to run)
17
- # │ └── initial_data.sh (this shell script)
18
- # └── ...
19
- #
20
- # If `initial_data.sh` is located in `full-stack-fastapi-template/backend/`,
21
- # and `app` is a subdirectory of `backend/`, then the Python command
22
- # `python -m app.initial_data` needs to be executed from the `backend/` directory.
23
- #
24
- # If you are running this shell script from a different directory (e.g., `engine/`),
25
- # Python's module import system won't automatically find 'app' unless the parent
26
- # directory of 'app' is in the `PYTHONPATH` or you change the current working directory.
27
- #
28
- # The safest way is to change the current working directory to the script's location.
29
-
30
- # Store the current directory to return to it later if needed (good practice for multi-step scripts).
31
- CURRENT_DIR=$(pwd)
32
-
33
- # Get the absolute path of the directory where this script is located.
34
- # This is a robust way to ensure we always navigate to the correct 'backend' directory.
35
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
36
- cd "$SCRIPT_DIR"
37
-
38
- # Execute your Python script within the specified Conda environment using 'conda run'.
39
- # -n fastapi_env specifies the Conda environment to use.
40
- # This completely avoids the 'source conda.sh' issue and is generally more reliable.
7
+ # Run the initial data script using the conda environment
41
8
  conda run -n fastapi_env python -m app.initial_data
42
-
43
- # Important Note: The 'ModuleNotFoundError: No module named 'sqlmodel'' indicates that
44
- # the 'sqlmodel' package is not installed in your 'fastapi_env' Conda environment.
45
- # After running this script, if you still get the 'sqlmodel' error,
46
- # you will need to activate your environment manually and install it:
47
- #
48
- # conda activate fastapi_env
49
- # pip install sqlmodel
50
- # # or if it's a conda package:
51
- # # conda install sqlmodel
52
- #
53
- # Then try running this script again.
54
-
55
- # Optional Good Practice: Return to the original directory if the script is part of a larger workflow.
56
- cd "$CURRENT_DIR"
@@ -0,0 +1,64 @@
1
+ apiVersion: v1
2
+ kind: ConfigMap
3
+ metadata:
4
+ name: ipfs-cluster-set-bootstrap-conf
5
+ data:
6
+ entrypoint.sh: |
7
+ #!/bin/sh
8
+ set -e
9
+
10
+ user=ipfs
11
+
12
+ # Custom entrypoint for k8s: connects non-bootstrap pods to the bootstrap peer
13
+ # ipfs-cluster-0 acts as the bootstrap node using the pre-generated identity.
14
+
15
+ if [ ! -f /data/ipfs-cluster/service.json ]; then
16
+ ipfs-cluster-service init
17
+ fi
18
+
19
+ # Bind cluster APIs to 0.0.0.0 so they are reachable from other pods.
20
+ # By default ipfs-cluster listens on 127.0.0.1 for REST (9094),
21
+ # Proxy (9095) and Pinning Service (9097).
22
+ sed -i 's|/ip4/127\.0\.0\.1/tcp/9094|/ip4/0.0.0.0/tcp/9094|g' /data/ipfs-cluster/service.json
23
+ sed -i 's|/ip4/127\.0\.0\.1/tcp/9095|/ip4/0.0.0.0/tcp/9095|g' /data/ipfs-cluster/service.json
24
+ sed -i 's|/ip4/127\.0\.0\.1/tcp/9097|/ip4/0.0.0.0/tcp/9097|g' /data/ipfs-cluster/service.json
25
+
26
+ PEER_HOSTNAME=$(cat /proc/sys/kernel/hostname)
27
+
28
+ if echo "${PEER_HOSTNAME}" | grep -q "^ipfs-cluster-0"; then
29
+ # Bootstrap node: use the pre-seeded identity and secret
30
+ exec ipfs-cluster-service daemon --upgrade
31
+ else
32
+ BOOTSTRAP_ADDR="/dns4/${SVC_NAME}-0/tcp/9096/ipfs/${BOOTSTRAP_PEER_ID}"
33
+
34
+ if [ -z "${BOOTSTRAP_ADDR}" ]; then
35
+ echo "ERROR: BOOTSTRAP_ADDR could not be constructed." >&2
36
+ exit 1
37
+ fi
38
+
39
+ exec ipfs-cluster-service daemon --upgrade --bootstrap "${BOOTSTRAP_ADDR}" --leave
40
+ fi
41
+
42
+ configure-ipfs.sh: |
43
+ #!/bin/sh
44
+ set -e
45
+ set -x
46
+
47
+ # Custom init script: prepares the IPFS data directory and sets production config.
48
+
49
+ mkdir -p /data/ipfs
50
+ chown -R 1000:100 /data/ipfs
51
+
52
+ if [ -f /data/ipfs/config ]; then
53
+ # Remove stale repo lock if present
54
+ rm -f /data/ipfs/repo.lock
55
+ exit 0
56
+ fi
57
+
58
+ ipfs init --profile=pebbleds,server
59
+ ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
60
+ ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
61
+ ipfs config --json Swarm.ConnMgr.HighWater 2000
62
+ ipfs config --json Datastore.BloomFilterSize 1048576
63
+ ipfs config Datastore.StorageMax 100GB
64
+ chown -R 1000:100 /data/ipfs
@@ -0,0 +1,35 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: ipfs-cluster
5
+ labels:
6
+ app: ipfs-cluster
7
+ spec:
8
+ clusterIP: None
9
+ selector:
10
+ app: ipfs-cluster
11
+ ports:
12
+ - name: swarm
13
+ port: 4001
14
+ protocol: TCP
15
+ - name: swarm-udp
16
+ port: 4001
17
+ protocol: UDP
18
+ - name: api
19
+ port: 5001
20
+ protocol: TCP
21
+ - name: ws
22
+ port: 8081
23
+ protocol: TCP
24
+ - name: http
25
+ port: 8080
26
+ protocol: TCP
27
+ - name: api-http
28
+ port: 9094
29
+ protocol: TCP
30
+ - name: proxy-http
31
+ port: 9095
32
+ protocol: TCP
33
+ - name: cluster-swarm
34
+ port: 9096
35
+ protocol: TCP
@@ -0,0 +1,8 @@
1
+ ---
2
+ # kubectl apply -k ipfs/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - headless-service.yaml
7
+ - configmap.yaml
8
+ - statefulset.yaml
@@ -0,0 +1,149 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: ipfs-cluster
5
+ spec:
6
+ serviceName: ipfs-cluster
7
+ replicas: 1
8
+ selector:
9
+ matchLabels:
10
+ app: ipfs-cluster
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: ipfs-cluster
15
+ spec:
16
+ initContainers:
17
+ - name: configure-ipfs
18
+ image: ipfs/kubo:latest
19
+ imagePullPolicy: IfNotPresent
20
+ securityContext:
21
+ runAsUser: 0
22
+ command: ['sh', '/custom/configure-ipfs.sh']
23
+ volumeMounts:
24
+ - name: ipfs-storage
25
+ mountPath: /data/ipfs
26
+ - name: configure-script
27
+ mountPath: /custom
28
+
29
+ containers:
30
+ - name: ipfs
31
+ image: ipfs/kubo:latest
32
+ imagePullPolicy: IfNotPresent
33
+ env:
34
+ - name: IPFS_FD_MAX
35
+ value: '4096'
36
+ ports:
37
+ - name: swarm
38
+ protocol: TCP
39
+ containerPort: 4001
40
+ - name: swarm-udp
41
+ protocol: UDP
42
+ containerPort: 4001
43
+ - name: api
44
+ protocol: TCP
45
+ containerPort: 5001
46
+ - name: ws
47
+ protocol: TCP
48
+ containerPort: 8081
49
+ - name: http
50
+ protocol: TCP
51
+ containerPort: 8080
52
+ livenessProbe:
53
+ tcpSocket:
54
+ port: swarm
55
+ initialDelaySeconds: 30
56
+ timeoutSeconds: 5
57
+ periodSeconds: 15
58
+ volumeMounts:
59
+ - name: ipfs-storage
60
+ mountPath: /data/ipfs
61
+ - name: configure-script
62
+ mountPath: /custom
63
+ resources:
64
+ requests:
65
+ cpu: '100m'
66
+ memory: '256Mi'
67
+ limits:
68
+ cpu: '500m'
69
+ memory: '512Mi'
70
+
71
+ - name: ipfs-cluster
72
+ image: ipfs/ipfs-cluster:latest
73
+ imagePullPolicy: IfNotPresent
74
+ command: ['sh', '/custom/entrypoint.sh']
75
+ env:
76
+ - name: BOOTSTRAP_PEER_ID
77
+ valueFrom:
78
+ configMapKeyRef:
79
+ name: env-config
80
+ key: bootstrap-peer-id
81
+ - name: BOOTSTRAP_PEER_PRIV_KEY
82
+ valueFrom:
83
+ secretKeyRef:
84
+ name: ipfs-cluster-secret
85
+ key: bootstrap-peer-priv-key
86
+ - name: CLUSTER_SECRET
87
+ valueFrom:
88
+ secretKeyRef:
89
+ name: ipfs-cluster-secret
90
+ key: cluster-secret
91
+ - name: CLUSTER_MONITOR_PING_INTERVAL
92
+ value: '3m'
93
+ - name: SVC_NAME
94
+ valueFrom:
95
+ configMapKeyRef:
96
+ name: env-config
97
+ key: CLUSTER_SVC_NAME
98
+ ports:
99
+ - name: api-http
100
+ containerPort: 9094
101
+ protocol: TCP
102
+ - name: proxy-http
103
+ containerPort: 9095
104
+ protocol: TCP
105
+ - name: cluster-swarm
106
+ containerPort: 9096
107
+ protocol: TCP
108
+ livenessProbe:
109
+ tcpSocket:
110
+ port: cluster-swarm
111
+ initialDelaySeconds: 5
112
+ timeoutSeconds: 5
113
+ periodSeconds: 10
114
+ volumeMounts:
115
+ - name: cluster-storage
116
+ mountPath: /data/ipfs-cluster
117
+ - name: configure-script
118
+ mountPath: /custom
119
+ resources:
120
+ requests:
121
+ cpu: '100m'
122
+ memory: '128Mi'
123
+ limits:
124
+ cpu: '500m'
125
+ memory: '512Mi'
126
+
127
+ volumes:
128
+ - name: configure-script
129
+ configMap:
130
+ name: ipfs-cluster-set-bootstrap-conf
131
+ defaultMode: 0755
132
+
133
+ volumeClaimTemplates:
134
+ - metadata:
135
+ name: cluster-storage
136
+ spec:
137
+ storageClassName: ipfs-storage-class
138
+ accessModes: ['ReadWriteOnce']
139
+ resources:
140
+ requests:
141
+ storage: 1Gi
142
+ - metadata:
143
+ name: ipfs-storage
144
+ spec:
145
+ storageClassName: ipfs-storage-class
146
+ accessModes: ['ReadWriteOnce']
147
+ resources:
148
+ requests:
149
+ storage: 5Gi
@@ -0,0 +1,9 @@
1
+ apiVersion: storage.k8s.io/v1
2
+ kind: StorageClass
3
+ metadata:
4
+ name: ipfs-storage-class
5
+ annotations:
6
+ storageclass.kubernetes.io/is-default-class: "false"
7
+ provisioner: rancher.io/local-path
8
+ reclaimPolicy: Retain
9
+ volumeBindingMode: WaitForFirstConsumer
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.99.8",
5
+ "version": "3.0.2",
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",
@@ -74,41 +74,45 @@
74
74
  "helmet": "^8.1.0",
75
75
  "html-minifier-terser": "^7.2.0",
76
76
  "http-proxy-middleware": "^2.0.6",
77
- "ignore-walk": "^6.0.4",
77
+ "ignore-walk": "^8.0.0",
78
78
  "iovalkey": "^0.2.1",
79
+ "jimp": "^1.6.0",
79
80
  "json-colorizer": "^2.2.2",
80
81
  "jsonwebtoken": "^9.0.2",
81
82
  "mariadb": "^3.2.2",
82
83
  "marked": "^12.0.2",
83
- "mocha": "^10.8.2",
84
+ "maxrects-packer": "^2.7.3",
85
+ "mocha": "^7.2.0",
84
86
  "mongoose": "^8.9.5",
85
87
  "morgan": "^1.10.0",
86
88
  "nodemailer": "^7.0.9",
87
89
  "nodemon": "^3.0.1",
88
90
  "peer": "^1.0.2",
89
91
  "peerjs": "^1.5.2",
92
+ "pngjs": "^7.0.0",
90
93
  "prom-client": "^15.1.2",
91
94
  "read": "^2.1.0",
92
95
  "rrule": "^2.8.1",
93
- "shelljs": "^0.8.5",
96
+ "sharp": "^0.32.5",
97
+ "shelljs": "^0.10.0",
94
98
  "sitemap": "^7.1.1",
95
99
  "socket.io": "^4.8.0",
96
100
  "sortablejs": "^1.15.0",
97
101
  "split-file": "^2.3.0",
98
- "swagger-autogen": "^2.23.7",
102
+ "swagger-autogen": "^2.9.2",
99
103
  "swagger-ui-express": "^5.0.0",
100
104
  "uglify-js": "^3.17.4",
101
105
  "validator": "^13.11.0",
102
106
  "vanilla-jsoneditor": "^2.3.2",
103
- "winston": "^3.11.0",
104
- "maxrects-packer": "^2.7.3",
105
- "pngjs": "^7.0.0",
106
- "jimp": "^1.6.0",
107
- "sharp": "^0.32.5"
107
+ "winston": "^3.11.0"
108
108
  },
109
109
  "publishConfig": {
110
110
  "provenance": true,
111
111
  "access": "public",
112
112
  "registry": "https://registry.npmjs.org/"
113
+ },
114
+ "overrides": {
115
+ "minimatch": "^10.2.2",
116
+ "glob": "^11.0.0"
113
117
  }
114
- }
118
+ }
@@ -0,0 +1,89 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # ---------------------------------------------------------------------------
5
+ # Underpost K3s Node Setup
6
+ # Usage:
7
+ # --control Initialize as K3s control plane node (default)
8
+ # --worker Initialize as K3s worker node
9
+ # --control-ip=<ip> Control plane IP (required for --worker)
10
+ # --token=<token> K3s node token (required for --worker)
11
+ # ---------------------------------------------------------------------------
12
+
13
+ ROLE="control"
14
+ CONTROL_IP=""
15
+ K3S_TOKEN=""
16
+
17
+ for arg in "$@"; do
18
+ case $arg in
19
+ --worker) ROLE="worker" ;;
20
+ --control) ROLE="control" ;;
21
+ --control-ip=*) CONTROL_IP="${arg#*=}" ;;
22
+ --token=*) K3S_TOKEN="${arg#*=}" ;;
23
+ esac
24
+ done
25
+ # ---------------------------------------------------------------------------
26
+ # NVM and Node.js
27
+ # ---------------------------------------------------------------------------
28
+ echo "Installing NVM and Node.js v24.10.0..."
29
+
30
+ curl -o- https://cdn.jsdelivr.net/gh/nvm-sh/nvm@v0.40.1/install.sh | bash
31
+
32
+ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
33
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
34
+
35
+ nvm install 24.10.0
36
+ nvm use 24.10.0
37
+
38
+ echo "
39
+ ██╗░░░██╗███╗░░██╗██████╗░███████╗██████╗░██████╗░░█████╗░░██████╗████████╗
40
+ ██║░░░██║████╗░██║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝
41
+ ██║░░░██║██╔██╗██║██║░░██║█████╗░░██████╔╝██████╔╝██║░░██║╚█████╗░░░░██║░░░
42
+ ██║░░░██║██║╚████║██║░░██║██╔══╝░░██╔══██╗██╔═══╝░██║░░██║░╚═══██╗░░░██║░░░
43
+ ╚██████╔╝██║░╚███║██████╔╝███████╗██║░░██║██║░░░░░╚█████╔╝██████╔╝░░░██║░░░
44
+ ░╚═════╝░╚═╝░░╚══╝╚═════╝░╚══════╝╚═╝░░╚═╝╚═╝░░░░░░╚════╝░╚═════╝░░░░╚═╝░░░
45
+
46
+ Installing underpost VM node...
47
+ "
48
+
49
+ npm install -g underpost
50
+
51
+ cd /home/dd/engine
52
+
53
+ echo "Applying host configuration..."
54
+
55
+ underpost install
56
+
57
+ node bin run secret
58
+
59
+ node bin cluster --dev --config
60
+
61
+ if [ "$ROLE" = "control" ]; then
62
+ echo "Initializing K3s control plane..."
63
+ node bin cluster --dev --k3s
64
+
65
+ echo ""
66
+ echo "K3s control plane is ready."
67
+ echo "Node token (share with workers to join this cluster):"
68
+ sudo cat /var/lib/rancher/k3s/server/node-token
69
+ echo ""
70
+ echo "Control plane IP addresses:"
71
+ ip -4 addr show scope global | grep inet | awk '{print $2}' | cut -d/ -f1
72
+
73
+ elif [ "$ROLE" = "worker" ]; then
74
+ if [ -z "$CONTROL_IP" ] || [ -z "$K3S_TOKEN" ]; then
75
+ echo "ERROR: --control-ip and --token are required for worker role."
76
+ echo "Usage: bash k3s-node-setup.sh --worker --control-ip=<ip> --token=<token>"
77
+ exit 1
78
+ fi
79
+
80
+ echo "Joining K3s cluster at https://${CONTROL_IP}:6443..."
81
+ curl -sfL https://get.k3s.io | \
82
+ K3S_URL="https://${CONTROL_IP}:6443" \
83
+ K3S_TOKEN="${K3S_TOKEN}" \
84
+ sh -s - agent
85
+
86
+ echo ""
87
+ echo "K3s worker node joined the cluster at https://${CONTROL_IP}:6443 successfully."
88
+ sudo systemctl status k3s-agent --no-pager
89
+ fi
@@ -0,0 +1,23 @@
1
+
2
+ echo "Expanding /dev/sda2 and resizing filesystem..."
3
+
4
+ if ! command -v parted &>/dev/null; then
5
+ sudo dnf install -y parted
6
+ fi
7
+
8
+ sudo parted /dev/sda ---pretend-input-tty <<EOF
9
+ unit s
10
+ resizepart 2 100%
11
+ Yes
12
+ quit
13
+ EOF
14
+
15
+ sudo resize2fs /dev/sda2
16
+ echo "Disk resized."
17
+
18
+ echo "Installing essential packages..."
19
+ sudo dnf install -y tar bzip2 git curl jq epel-release
20
+ sudo dnf -y update
21
+
22
+ echo "Loading br_netfilter module..."
23
+ sudo modprobe br_netfilter