underpost 2.8.84 → 2.8.86
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/{ghpkg.yml → ghpkg.ci.yml} +1 -1
- package/.github/workflows/{npmpkg.yml → npmpkg.ci.yml} +1 -1
- package/.github/workflows/{publish.yml → publish.ci.yml} +1 -1
- package/.github/workflows/{pwa-microservices-template.page.yml → pwa-microservices-template-page.cd.yml} +2 -2
- package/.github/workflows/{pwa-microservices-template.test.yml → pwa-microservices-template-test.ci.yml} +1 -1
- package/.github/workflows/release.cd.yml +37 -0
- package/.vscode/settings.json +0 -1
- package/README.md +16 -10
- package/bin/build.js +15 -5
- package/bin/cyberia0.js +78 -0
- package/bin/db.js +1 -3
- package/bin/deploy.js +29 -431
- package/bin/file.js +26 -9
- package/cli.md +102 -61
- package/conf.js +1 -1
- package/manifests/deployment/{dd-template-development → dd-default-development}/deployment.yaml +16 -16
- package/manifests/deployment/{dd-template-development → dd-default-development}/proxy.yaml +3 -3
- package/manifests/grafana/deployment.yaml +57 -0
- package/manifests/grafana/kustomization.yaml +7 -0
- package/manifests/grafana/pvc.yaml +12 -0
- package/manifests/grafana/service.yaml +14 -0
- package/manifests/maas/gpu-diag.sh +1 -1
- package/manifests/maas/ssh-cluster-info.sh +14 -0
- package/manifests/prometheus/deployment.yaml +82 -0
- package/package.json +4 -7
- package/src/api/user/user.router.js +24 -1
- package/src/api/user/user.service.js +9 -38
- package/src/cli/cluster.js +83 -29
- package/src/cli/cron.js +12 -45
- package/src/cli/db.js +149 -0
- package/src/cli/deploy.js +40 -81
- package/src/cli/index.js +29 -6
- package/src/cli/monitor.js +9 -16
- package/src/cli/repository.js +12 -5
- package/src/cli/run.js +175 -7
- package/src/cli/ssh.js +32 -0
- package/src/client/Default.index.js +7 -5
- package/src/client/components/core/Account.js +7 -3
- package/src/client/components/core/Chat.js +1 -1
- package/src/client/components/core/CommonJs.js +24 -22
- package/src/client/components/core/Content.js +12 -12
- package/src/client/components/core/Css.js +262 -18
- package/src/client/components/core/CssCore.js +8 -8
- package/src/client/components/core/Docs.js +14 -61
- package/src/client/components/core/DropDown.js +137 -82
- package/src/client/components/core/EventsUI.js +92 -5
- package/src/client/components/core/Input.js +6 -1
- package/src/client/components/core/LoadingAnimation.js +8 -15
- package/src/client/components/core/LogIn.js +3 -0
- package/src/client/components/core/LogOut.js +1 -1
- package/src/client/components/core/Modal.js +601 -137
- package/src/client/components/core/NotificationManager.js +2 -2
- package/src/client/components/core/ObjectLayerEngine.js +638 -0
- package/src/client/components/core/Panel.js +158 -34
- package/src/client/components/core/PanelForm.js +12 -3
- package/src/client/components/core/Recover.js +6 -3
- package/src/client/components/core/Router.js +77 -17
- package/src/client/components/core/Scroll.js +65 -120
- package/src/client/components/core/SignUp.js +1 -0
- package/src/client/components/core/SocketIo.js +3 -3
- package/src/client/components/core/Translate.js +6 -2
- package/src/client/components/core/VanillaJs.js +48 -5
- package/src/client/components/core/Worker.js +3 -1
- package/src/client/components/default/CssDefault.js +17 -3
- package/src/client/components/default/MenuDefault.js +266 -47
- package/src/client/components/default/RoutesDefault.js +8 -14
- package/src/client/public/default/android-chrome-144x144.png +0 -0
- package/src/client/public/default/android-chrome-192x192.png +0 -0
- package/src/client/public/default/android-chrome-256x256.png +0 -0
- package/src/client/public/default/android-chrome-36x36.png +0 -0
- package/src/client/public/default/android-chrome-48x48.png +0 -0
- package/src/client/public/default/android-chrome-72x72.png +0 -0
- package/src/client/public/default/android-chrome-96x96.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72.png +0 -0
- package/src/client/public/default/apple-touch-icon-76x76-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-76x76.png +0 -0
- package/src/client/public/default/apple-touch-icon-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon.png +0 -0
- package/src/client/public/default/assets/background/dark.jpg +0 -0
- package/src/client/public/default/assets/background/dark.svg +557 -0
- package/src/client/public/default/assets/logo/base-icon.png +0 -0
- package/src/client/public/default/assets/logo/underpost.gif +0 -0
- package/src/client/public/default/assets/mailer/api-user-check.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-invalid-token.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-recover.png +0 -0
- package/src/client/public/default/favicon-16x16.png +0 -0
- package/src/client/public/default/favicon-32x32.png +0 -0
- package/src/client/public/default/favicon.ico +0 -0
- package/src/client/public/default/mstile-144x144.png +0 -0
- package/src/client/public/default/mstile-150x150.png +0 -0
- package/src/client/public/default/mstile-310x150.png +0 -0
- package/src/client/public/default/mstile-310x310.png +0 -0
- package/src/client/public/default/mstile-70x70.png +0 -0
- package/src/client/public/default/safari-pinned-tab.svg +24 -0
- package/src/client/ssr/body/DefaultSplashScreen.js +2 -2
- package/src/index.js +9 -1
- package/src/mailer/MailerProvider.js +37 -0
- package/src/monitor.js +24 -0
- package/src/runtime/lampp/Dockerfile +30 -39
- package/src/runtime/lampp/Lampp.js +11 -2
- package/src/server/client-build-docs.js +205 -0
- package/src/server/client-build-live.js +1 -1
- package/src/server/client-build.js +16 -166
- package/src/server/client-dev-server.js +1 -1
- package/src/server/conf.js +14 -277
- package/src/server/proxy.js +1 -2
- package/src/server/start.js +3 -3
- package/src/server/valkey.js +102 -41
- package/docker-compose.yml +0 -67
- package/prometheus.yml +0 -36
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.8.
|
|
1
|
+
## underpost ci/cd cli v2.8.86
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
-h, --help display help for command
|
|
8
8
|
|
|
9
9
|
Commands:
|
|
10
|
-
new <app-name>
|
|
10
|
+
new [options] <app-name> Initializes a new Underpost project with a predefined structure.
|
|
11
11
|
start [options] <deploy-id> [env] Initiates application servers, build pipelines, or other defined services based on the deployment ID.
|
|
12
12
|
clone [options] <uri> Clones a specified GitHub repository into the current directory.
|
|
13
13
|
pull [options] <path> <uri> Pulls the latest changes from a specified GitHub repository.
|
|
@@ -23,11 +23,13 @@ Commands:
|
|
|
23
23
|
dockerfile-pull-base-images [options] Pulls required Underpost Dockerfile base images and optionally loads them into clusters.
|
|
24
24
|
install Quickly imports Underpost npm dependencies by copying them.
|
|
25
25
|
db [options] <deploy-list> Manages database operations, including import, export, and collection management.
|
|
26
|
+
metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
|
|
26
27
|
script [options] <operator> <script-name> [script-value] Supports a variety of built-in Underpost global scripts, their preset lifecycle events, and arbitrary custom scripts.
|
|
27
28
|
cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
|
|
28
29
|
fs [options] [path] Manages file storage, defaulting to file upload operations.
|
|
29
30
|
test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
|
|
30
31
|
monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
|
|
32
|
+
ssh [options] Import and start ssh server and client based on current default deployment ID.
|
|
31
33
|
run [options] <runner-id> [path] Runs a script from the specified path.
|
|
32
34
|
lxd [options] Manages LXD containers and virtual machines.
|
|
33
35
|
baremetal [options] [workflow-id] [hostname] [ip-address] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
|
|
@@ -48,6 +50,7 @@ Arguments:
|
|
|
48
50
|
app-name The name of the application to create.
|
|
49
51
|
|
|
50
52
|
Options:
|
|
53
|
+
--dev Sets the development cli context
|
|
51
54
|
-h, --help display help for command
|
|
52
55
|
|
|
53
56
|
```
|
|
@@ -118,7 +121,8 @@ options.
|
|
|
118
121
|
Arguments:
|
|
119
122
|
path The absolute or relative directory path of the repository.
|
|
120
123
|
commit-type The type of commit to perform. Options: feat, fix, docs, style,
|
|
121
|
-
refactor, perf, cd,
|
|
124
|
+
refactor, perf, ci, cd, infra, build, test, chore, revert,
|
|
125
|
+
backup.
|
|
122
126
|
module-tag Optional: Sets a specific module tag for the commit.
|
|
123
127
|
message Optional: Provides an additional custom message for the commit.
|
|
124
128
|
|
|
@@ -206,49 +210,56 @@ Options:
|
|
|
206
210
|
Manages Kubernetes clusters, defaulting to Kind cluster initialization.
|
|
207
211
|
|
|
208
212
|
Arguments:
|
|
209
|
-
pod-name
|
|
213
|
+
pod-name Optional: Filters information by a specific pod name.
|
|
210
214
|
|
|
211
215
|
Options:
|
|
212
|
-
--reset
|
|
213
|
-
|
|
214
|
-
--mariadb
|
|
215
|
-
--mysql
|
|
216
|
-
--mongodb
|
|
217
|
-
--
|
|
218
|
-
--
|
|
219
|
-
|
|
220
|
-
--
|
|
221
|
-
|
|
222
|
-
--
|
|
223
|
-
|
|
224
|
-
--
|
|
225
|
-
|
|
226
|
-
--
|
|
227
|
-
|
|
228
|
-
--
|
|
229
|
-
|
|
230
|
-
--
|
|
231
|
-
|
|
232
|
-
--
|
|
233
|
-
|
|
234
|
-
--
|
|
235
|
-
|
|
236
|
-
--
|
|
237
|
-
--
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
--
|
|
243
|
-
|
|
244
|
-
--
|
|
245
|
-
|
|
246
|
-
--
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
216
|
+
--reset Deletes all clusters and prunes all related data and
|
|
217
|
+
caches.
|
|
218
|
+
--mariadb Initializes the cluster with a MariaDB statefulset.
|
|
219
|
+
--mysql Initializes the cluster with a MySQL statefulset.
|
|
220
|
+
--mongodb Initializes the cluster with a MongoDB statefulset.
|
|
221
|
+
--mongo-db-host <host> Set custom mongo db host
|
|
222
|
+
--postgresql Initializes the cluster with a PostgreSQL
|
|
223
|
+
statefulset.
|
|
224
|
+
--mongodb4 Initializes the cluster with a MongoDB 4.4 service.
|
|
225
|
+
--valkey Initializes the cluster with a Valkey service.
|
|
226
|
+
--contour Initializes the cluster with Project Contour base
|
|
227
|
+
HTTPProxy and Envoy.
|
|
228
|
+
--cert-manager Initializes the cluster with a Let's Encrypt
|
|
229
|
+
production ClusterIssuer.
|
|
230
|
+
--dedicated-gpu Initializes the cluster with dedicated GPU base
|
|
231
|
+
resources and environment settings.
|
|
232
|
+
--info Retrieves information about all deployed Kubernetes
|
|
233
|
+
objects.
|
|
234
|
+
--full Initializes the cluster with all available
|
|
235
|
+
statefulsets and services.
|
|
236
|
+
--ns-use <ns-name> Switches the current Kubernetes context to the
|
|
237
|
+
specified namespace.
|
|
238
|
+
--kubeadm Initializes the cluster using kubeadm for control
|
|
239
|
+
plane management.
|
|
240
|
+
--grafana Initializes the cluster with a Grafana deployment.
|
|
241
|
+
--prom [hosts] Initializes the cluster with a Prometheus Operator
|
|
242
|
+
deployment and monitor scrap for specified hosts.
|
|
243
|
+
--dev Initializes a development-specific cluster
|
|
244
|
+
configuration.
|
|
245
|
+
--list-pods Displays detailed information about all pods.
|
|
246
|
+
--info-capacity Displays the current total machine capacity
|
|
247
|
+
information.
|
|
248
|
+
--info-capacity-pod Displays the current machine capacity information per
|
|
249
|
+
pod.
|
|
250
|
+
--pull-image Sets an optional associated image to pull during
|
|
251
|
+
initialization.
|
|
252
|
+
--init-host Installs necessary Kubernetes node CLI tools (e.g.,
|
|
253
|
+
kind, kubeadm, docker, podman, helm).
|
|
254
|
+
--uninstall-host Uninstalls all host components installed by
|
|
255
|
+
init-host.
|
|
256
|
+
--config Sets the base Kubernetes node configuration.
|
|
257
|
+
--worker Sets the context for a worker node.
|
|
258
|
+
--chown Sets the appropriate ownership for Kubernetes
|
|
259
|
+
kubeconfig files.
|
|
260
|
+
--k3s Initializes the cluster using K3s (Lightweight
|
|
261
|
+
Kubernetes).
|
|
262
|
+
-h, --help display help for command
|
|
252
263
|
|
|
253
264
|
```
|
|
254
265
|
|
|
@@ -282,8 +293,6 @@ Options:
|
|
|
282
293
|
--build-manifest Builds Kubernetes YAML manifests, including
|
|
283
294
|
deployments, services, proxies, and
|
|
284
295
|
secrets.
|
|
285
|
-
--dashboard-update Updates dashboard instance data with the
|
|
286
|
-
current router configuration.
|
|
287
296
|
--replicas <replicas> Sets a custom number of replicas for
|
|
288
297
|
deployments.
|
|
289
298
|
--versions <deployment-versions> A comma-separated list of custom deployment
|
|
@@ -296,9 +305,6 @@ Options:
|
|
|
296
305
|
--kubeadm Enables the kubeadm context for deployment
|
|
297
306
|
operations.
|
|
298
307
|
--restore-hosts Restores default `/etc/hosts` entries.
|
|
299
|
-
--rebuild-clients-bundle Inside the container, rebuilds client
|
|
300
|
-
bundles (only static public or storage
|
|
301
|
-
client files).
|
|
302
308
|
-h, --help display help for command
|
|
303
309
|
|
|
304
310
|
```
|
|
@@ -421,6 +427,29 @@ Options:
|
|
|
421
427
|
```
|
|
422
428
|
|
|
423
429
|
|
|
430
|
+
### `metadata` :
|
|
431
|
+
```
|
|
432
|
+
Usage: underpost metadata [options] [deploy-id] [host] [path]
|
|
433
|
+
|
|
434
|
+
Manages cluster metadata operations, including import and export.
|
|
435
|
+
|
|
436
|
+
Arguments:
|
|
437
|
+
deploy-id The deployment ID to manage metadata.
|
|
438
|
+
host The host to manage metadata.
|
|
439
|
+
path The path to manage metadata.
|
|
440
|
+
|
|
441
|
+
Options:
|
|
442
|
+
--import Imports from local storage.
|
|
443
|
+
--export Exports to local storage.
|
|
444
|
+
--crons Apply to cron data collection
|
|
445
|
+
--instances Apply to instance data collection
|
|
446
|
+
--generate Generate cluster metadata
|
|
447
|
+
--itc Apply under container execution context
|
|
448
|
+
-h, --help display help for command
|
|
449
|
+
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
|
|
424
453
|
### `script` :
|
|
425
454
|
```
|
|
426
455
|
Usage: underpost script [options] <operator> <script-name> [script-value]
|
|
@@ -455,19 +484,16 @@ Manages cron jobs, including initialization, execution, and configuration
|
|
|
455
484
|
updates.
|
|
456
485
|
|
|
457
486
|
Arguments:
|
|
458
|
-
deploy-list
|
|
459
|
-
|
|
460
|
-
job-list
|
|
461
|
-
|
|
487
|
+
deploy-list A comma-separated list of deployment IDs (e.g.,
|
|
488
|
+
"default-a,default-b").
|
|
489
|
+
job-list A comma-separated list of job IDs. Options: callback,
|
|
490
|
+
getRelatedDeployId. Defaults to all available jobs.
|
|
462
491
|
|
|
463
492
|
Options:
|
|
464
|
-
--itc
|
|
465
|
-
|
|
466
|
-
--
|
|
467
|
-
--
|
|
468
|
-
--dashboard-update Updates dashboard cron data with the current job
|
|
469
|
-
configurations.
|
|
470
|
-
-h, --help display help for command
|
|
493
|
+
--itc Executes cron jobs within the container execution context.
|
|
494
|
+
--init Initializes cron jobs for the default deployment ID.
|
|
495
|
+
--git Uploads cron job configurations to GitHub.
|
|
496
|
+
-h, --help display help for command
|
|
471
497
|
|
|
472
498
|
```
|
|
473
499
|
|
|
@@ -547,6 +573,20 @@ Options:
|
|
|
547
573
|
```
|
|
548
574
|
|
|
549
575
|
|
|
576
|
+
### `ssh` :
|
|
577
|
+
```
|
|
578
|
+
Usage: underpost ssh [options]
|
|
579
|
+
|
|
580
|
+
Import and start ssh server and client based on current default deployment ID.
|
|
581
|
+
|
|
582
|
+
Options:
|
|
583
|
+
--generate Generates new ssh credential and stores it in current private
|
|
584
|
+
keys file storage.
|
|
585
|
+
-h, --help display help for command
|
|
586
|
+
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
|
|
550
590
|
### `run` :
|
|
551
591
|
```
|
|
552
592
|
Usage: underpost run [options] <runner-id> [path]
|
|
@@ -554,7 +594,7 @@ Options:
|
|
|
554
594
|
Runs a script from the specified path.
|
|
555
595
|
|
|
556
596
|
Arguments:
|
|
557
|
-
runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, gpu-env, tf-gpu-test, ide, monitor, tf-vae-test, deploy-job.
|
|
597
|
+
runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, dev-cluster, ssh-cluster-info, cyberia-ide, engine-ide, template-deploy, clean, pull, release-deploy, ssh-deploy, ide, dev-client, dev-api, monitor, db-client, promote, metrics, cluster, deploy, tf-vae-test, deploy-job.
|
|
558
598
|
path The absolute or relative directory path where the script is located.
|
|
559
599
|
|
|
560
600
|
Options:
|
|
@@ -564,6 +604,7 @@ Options:
|
|
|
564
604
|
--pod-name <pod-name> Optional: Specifies the pod name for test execution.
|
|
565
605
|
--volume-host-path <volume-host-path> Optional: Specifies the volume host path for test execution.
|
|
566
606
|
--volume-mount-path <volume-mount-path> Optional: Specifies the volume mount path for test execution.
|
|
607
|
+
--volume-type <volume-type> Optional: Specifies the volume type for test execution.
|
|
567
608
|
--image-name <image-name> Optional: Specifies the image name for test execution.
|
|
568
609
|
--container-name <container-name> Optional: Specifies the container name for test execution.
|
|
569
610
|
--namespace <namespace> Optional: Specifies the namespace for test execution.
|
package/conf.js
CHANGED
package/manifests/deployment/{dd-template-development → dd-default-development}/deployment.yaml
RENAMED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
apiVersion: apps/v1
|
|
3
3
|
kind: Deployment
|
|
4
4
|
metadata:
|
|
5
|
-
name: dd-
|
|
5
|
+
name: dd-default-development-blue
|
|
6
6
|
labels:
|
|
7
|
-
app: dd-
|
|
7
|
+
app: dd-default-development-blue
|
|
8
8
|
spec:
|
|
9
9
|
replicas: 1
|
|
10
10
|
selector:
|
|
11
11
|
matchLabels:
|
|
12
|
-
app: dd-
|
|
12
|
+
app: dd-default-development-blue
|
|
13
13
|
template:
|
|
14
14
|
metadata:
|
|
15
15
|
labels:
|
|
16
|
-
app: dd-
|
|
16
|
+
app: dd-default-development-blue
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
|
-
- name: dd-
|
|
20
|
-
image: localhost/rockylinux9-underpost:v2.8.
|
|
19
|
+
- name: dd-default-development-blue
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.8.86
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "124Ki"
|
|
@@ -40,10 +40,10 @@ spec:
|
|
|
40
40
|
apiVersion: v1
|
|
41
41
|
kind: Service
|
|
42
42
|
metadata:
|
|
43
|
-
name: dd-
|
|
43
|
+
name: dd-default-development-blue-service
|
|
44
44
|
spec:
|
|
45
45
|
selector:
|
|
46
|
-
app: dd-
|
|
46
|
+
app: dd-default-development-blue
|
|
47
47
|
ports:
|
|
48
48
|
- name: 'tcp-4001'
|
|
49
49
|
protocol: TCP
|
|
@@ -85,22 +85,22 @@ spec:
|
|
|
85
85
|
apiVersion: apps/v1
|
|
86
86
|
kind: Deployment
|
|
87
87
|
metadata:
|
|
88
|
-
name: dd-
|
|
88
|
+
name: dd-default-development-green
|
|
89
89
|
labels:
|
|
90
|
-
app: dd-
|
|
90
|
+
app: dd-default-development-green
|
|
91
91
|
spec:
|
|
92
92
|
replicas: 1
|
|
93
93
|
selector:
|
|
94
94
|
matchLabels:
|
|
95
|
-
app: dd-
|
|
95
|
+
app: dd-default-development-green
|
|
96
96
|
template:
|
|
97
97
|
metadata:
|
|
98
98
|
labels:
|
|
99
|
-
app: dd-
|
|
99
|
+
app: dd-default-development-green
|
|
100
100
|
spec:
|
|
101
101
|
containers:
|
|
102
|
-
- name: dd-
|
|
103
|
-
image: localhost/rockylinux9-underpost:v2.8.
|
|
102
|
+
- name: dd-default-development-green
|
|
103
|
+
image: localhost/rockylinux9-underpost:v2.8.86
|
|
104
104
|
# resources:
|
|
105
105
|
# requests:
|
|
106
106
|
# memory: "124Ki"
|
|
@@ -124,10 +124,10 @@ spec:
|
|
|
124
124
|
apiVersion: v1
|
|
125
125
|
kind: Service
|
|
126
126
|
metadata:
|
|
127
|
-
name: dd-
|
|
127
|
+
name: dd-default-development-green-service
|
|
128
128
|
spec:
|
|
129
129
|
selector:
|
|
130
|
-
app: dd-
|
|
130
|
+
app: dd-default-development-green
|
|
131
131
|
ports:
|
|
132
132
|
- name: 'tcp-4001'
|
|
133
133
|
protocol: TCP
|
|
@@ -16,7 +16,7 @@ spec:
|
|
|
16
16
|
- prefix: /
|
|
17
17
|
enableWebsockets: true
|
|
18
18
|
services:
|
|
19
|
-
- name: dd-
|
|
19
|
+
- name: dd-default-development-blue-service
|
|
20
20
|
port: 4001
|
|
21
21
|
weight: 100
|
|
22
22
|
|
|
@@ -24,7 +24,7 @@ spec:
|
|
|
24
24
|
- prefix: /peer
|
|
25
25
|
enableWebsockets: true
|
|
26
26
|
services:
|
|
27
|
-
- name: dd-
|
|
27
|
+
- name: dd-default-development-blue-service
|
|
28
28
|
port: 4002
|
|
29
29
|
weight: 100
|
|
30
30
|
|
|
@@ -41,6 +41,6 @@ spec:
|
|
|
41
41
|
- prefix: /
|
|
42
42
|
enableWebsockets: true
|
|
43
43
|
services:
|
|
44
|
-
- name: dd-
|
|
44
|
+
- name: dd-default-development-blue-service
|
|
45
45
|
port: 4003
|
|
46
46
|
weight: 100
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
apiVersion: apps/v1
|
|
3
|
+
kind: Deployment
|
|
4
|
+
metadata:
|
|
5
|
+
labels:
|
|
6
|
+
app: grafana
|
|
7
|
+
name: grafana
|
|
8
|
+
spec:
|
|
9
|
+
selector:
|
|
10
|
+
matchLabels:
|
|
11
|
+
app: grafana
|
|
12
|
+
template:
|
|
13
|
+
metadata:
|
|
14
|
+
labels:
|
|
15
|
+
app: grafana
|
|
16
|
+
spec:
|
|
17
|
+
securityContext:
|
|
18
|
+
fsGroup: 472
|
|
19
|
+
supplementalGroups:
|
|
20
|
+
- 0
|
|
21
|
+
containers:
|
|
22
|
+
- name: grafana
|
|
23
|
+
image: grafana/grafana:latest
|
|
24
|
+
imagePullPolicy: IfNotPresent
|
|
25
|
+
ports:
|
|
26
|
+
- containerPort: 3000
|
|
27
|
+
name: http-grafana
|
|
28
|
+
protocol: TCP
|
|
29
|
+
readinessProbe:
|
|
30
|
+
failureThreshold: 3
|
|
31
|
+
httpGet:
|
|
32
|
+
path: /robots.txt
|
|
33
|
+
port: 3000
|
|
34
|
+
scheme: HTTP
|
|
35
|
+
initialDelaySeconds: 10
|
|
36
|
+
periodSeconds: 30
|
|
37
|
+
successThreshold: 1
|
|
38
|
+
timeoutSeconds: 2
|
|
39
|
+
livenessProbe:
|
|
40
|
+
failureThreshold: 3
|
|
41
|
+
initialDelaySeconds: 30
|
|
42
|
+
periodSeconds: 10
|
|
43
|
+
successThreshold: 1
|
|
44
|
+
tcpSocket:
|
|
45
|
+
port: 3000
|
|
46
|
+
timeoutSeconds: 1
|
|
47
|
+
resources:
|
|
48
|
+
requests:
|
|
49
|
+
cpu: 250m
|
|
50
|
+
memory: 750Mi
|
|
51
|
+
volumeMounts:
|
|
52
|
+
- mountPath: /var/lib/grafana
|
|
53
|
+
name: grafana-pv
|
|
54
|
+
volumes:
|
|
55
|
+
- name: grafana-pv
|
|
56
|
+
persistentVolumeClaim:
|
|
57
|
+
claimName: grafana-pvc
|
|
@@ -5,7 +5,7 @@ sudo lspci -nnk | egrep -i 'vga|3d' -A3
|
|
|
5
5
|
lsmod | egrep 'nvidia|nouveau|amdgpu' || true
|
|
6
6
|
|
|
7
7
|
# if exists nvidia tool
|
|
8
|
-
nvidia-smi 2>/dev/null || echo "nvidia-smi
|
|
8
|
+
nvidia-smi 2>/dev/null || echo "nvidia-smi not found"
|
|
9
9
|
|
|
10
10
|
# kernel related errors
|
|
11
11
|
sudo dmesg | egrep -i 'nvidia|nouveau|amdgpu' --color=auto
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REMOTE_USER=$(node bin config get --plain DEFAULT_SSH_USER)
|
|
5
|
+
REMOTE_HOST=$(node bin config get --plain DEFAULT_SSH_HOST)
|
|
6
|
+
SSH_KEY=$(node bin config get --plain DEFAULT_SSH_KEY_PATH)
|
|
7
|
+
|
|
8
|
+
chmod 600 "$SSH_KEY"
|
|
9
|
+
|
|
10
|
+
ssh -i "$SSH_KEY" -o BatchMode=yes "${REMOTE_USER}@${REMOTE_HOST}" sh <<EOF
|
|
11
|
+
cd /home/dd/engine
|
|
12
|
+
node bin deploy dd production --info-traffic
|
|
13
|
+
kubectl get pods -A
|
|
14
|
+
EOF
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
apiVersion: v1
|
|
3
|
+
kind: ConfigMap
|
|
4
|
+
metadata:
|
|
5
|
+
name: prometheus-config
|
|
6
|
+
labels:
|
|
7
|
+
app: prometheus
|
|
8
|
+
data:
|
|
9
|
+
prometheus.yml: |
|
|
10
|
+
global:
|
|
11
|
+
scrape_interval: 30s
|
|
12
|
+
evaluation_interval: 30s
|
|
13
|
+
|
|
14
|
+
scrape_configs:
|
|
15
|
+
- job_name: 'scraper'
|
|
16
|
+
metrics_path: /metrics
|
|
17
|
+
scheme: https
|
|
18
|
+
static_configs:
|
|
19
|
+
- targets: []
|
|
20
|
+
# tls_config:
|
|
21
|
+
# insecure_skip_verify: true
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
apiVersion: apps/v1
|
|
25
|
+
kind: Deployment
|
|
26
|
+
metadata:
|
|
27
|
+
name: prometheus
|
|
28
|
+
labels:
|
|
29
|
+
app: prometheus
|
|
30
|
+
spec:
|
|
31
|
+
replicas: 1
|
|
32
|
+
selector:
|
|
33
|
+
matchLabels:
|
|
34
|
+
app: prometheus
|
|
35
|
+
template:
|
|
36
|
+
metadata:
|
|
37
|
+
labels:
|
|
38
|
+
app: prometheus
|
|
39
|
+
spec:
|
|
40
|
+
containers:
|
|
41
|
+
- name: prometheus
|
|
42
|
+
image: prom/prometheus:latest
|
|
43
|
+
args:
|
|
44
|
+
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
45
|
+
- '--storage.tsdb.path=/prometheus'
|
|
46
|
+
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
|
|
47
|
+
- '--web.console.templates=/usr/share/prometheus/consoles'
|
|
48
|
+
ports:
|
|
49
|
+
- containerPort: 9090
|
|
50
|
+
name: web
|
|
51
|
+
volumeMounts:
|
|
52
|
+
- name: prometheus-config
|
|
53
|
+
mountPath: /etc/prometheus/
|
|
54
|
+
- name: prometheus-data
|
|
55
|
+
mountPath: /prometheus
|
|
56
|
+
resources:
|
|
57
|
+
requests:
|
|
58
|
+
memory: '200Mi'
|
|
59
|
+
cpu: '100m'
|
|
60
|
+
volumes:
|
|
61
|
+
- name: prometheus-config
|
|
62
|
+
configMap:
|
|
63
|
+
name: prometheus-config
|
|
64
|
+
- name: prometheus-data
|
|
65
|
+
emptyDir: {}
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
apiVersion: v1
|
|
69
|
+
kind: Service
|
|
70
|
+
metadata:
|
|
71
|
+
name: prometheus
|
|
72
|
+
labels:
|
|
73
|
+
app: prometheus
|
|
74
|
+
spec:
|
|
75
|
+
ports:
|
|
76
|
+
- port: 9090
|
|
77
|
+
targetPort: 9090
|
|
78
|
+
protocol: TCP
|
|
79
|
+
name: web
|
|
80
|
+
selector:
|
|
81
|
+
app: prometheus
|
|
82
|
+
type: ClusterIP
|
package/package.json
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"main": "src/index.js",
|
|
4
4
|
"name": "underpost",
|
|
5
|
-
"version": "2.8.
|
|
5
|
+
"version": "2.8.86",
|
|
6
6
|
"description": "pwa api rest template",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
|
|
9
|
+
"build": "node bin/deploy build-full-client",
|
|
9
10
|
"test": "env-cmd -f .env.test c8 mocha",
|
|
10
11
|
"pm2": "env-cmd -f .env.production pm2 start src/server.js --node-args=\"--max-old-space-size=8192\" --name engine",
|
|
11
12
|
"dev": "env-cmd -f .env.development node src/client.dev default",
|
|
12
13
|
"dev-img": "env-cmd -f .env.development node src/server",
|
|
13
14
|
"prod-img": "env-cmd -f .env.production node src/server",
|
|
14
|
-
"monitor": "pm2 start
|
|
15
|
+
"monitor": "pm2 start src/monitor.js --name monitor -- dd production",
|
|
15
16
|
"dev-api": "env-cmd -f .env.development nodemon --watch src --ignore src/client src/api",
|
|
16
17
|
"dev-client": "env-cmd -f .env.development node src/client.dev",
|
|
17
18
|
"proxy": "node src/proxy proxy",
|
|
@@ -20,11 +21,9 @@
|
|
|
20
21
|
"install-test": "npm install -g mocha && npm install -g c8 && npm install -g nyc && npm install -g coveralls",
|
|
21
22
|
"install-underpost": "cp -a $(npm root -g)/underpost/node_modules ./node_modules && npm install --only=dev --ignore-scripts",
|
|
22
23
|
"install": "npm run install-global && npm run install-test",
|
|
23
|
-
"docker:start": "docker-compose up",
|
|
24
24
|
"prettier": "prettier --write .",
|
|
25
25
|
"fix": "npm audit fix --force && npm audit",
|
|
26
|
-
"changelog": "auto-changelog"
|
|
27
|
-
"build": "node bin/deploy build-full-client"
|
|
26
|
+
"changelog": "auto-changelog"
|
|
28
27
|
},
|
|
29
28
|
"bin": {
|
|
30
29
|
"underpost": "bin/index.js"
|
|
@@ -99,14 +98,12 @@
|
|
|
99
98
|
"peer": "^1.0.2",
|
|
100
99
|
"peerjs": "^1.5.2",
|
|
101
100
|
"pixi.js": "7.4.2",
|
|
102
|
-
"plantuml": "^0.0.2",
|
|
103
101
|
"prom-client": "^15.1.2",
|
|
104
102
|
"public-ip": "^6.0.1",
|
|
105
103
|
"read": "^2.1.0",
|
|
106
104
|
"rrule": "^2.8.1",
|
|
107
105
|
"sharp": "^0.32.5",
|
|
108
106
|
"shelljs": "^0.8.5",
|
|
109
|
-
"simple-icons": "^13.9.0",
|
|
110
107
|
"sitemap": "^7.1.1",
|
|
111
108
|
"socket.io": "^4.8.0",
|
|
112
109
|
"sortablejs": "^1.15.0",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { authMiddleware } from '../../server/auth.js';
|
|
1
|
+
import { authMiddleware, hashPassword } from '../../server/auth.js';
|
|
2
2
|
import fs from 'fs-extra';
|
|
3
3
|
import { loggerFactory } from '../../server/logger.js';
|
|
4
4
|
import { UserController } from './user.controller.js';
|
|
5
5
|
import express from 'express';
|
|
6
|
+
import { DataBaseProvider } from '../../db/DataBaseProvider.js';
|
|
6
7
|
|
|
7
8
|
const logger = loggerFactory(import.meta);
|
|
8
9
|
|
|
@@ -10,6 +11,28 @@ const UserRouter = (options) => {
|
|
|
10
11
|
const router = express.Router();
|
|
11
12
|
|
|
12
13
|
(async () => {
|
|
14
|
+
const models = DataBaseProvider.instance[`${options.host}${options.path}`].mongoose.models;
|
|
15
|
+
if (models.User) {
|
|
16
|
+
try {
|
|
17
|
+
const adminUser = await models.User.findOne({ role: 'admin' });
|
|
18
|
+
if (!adminUser) {
|
|
19
|
+
const defaultPassword = process.env.DEFAULT_ADMIN_PASSWORD || 'changethis';
|
|
20
|
+
const hashedPassword = hashPassword(defaultPassword);
|
|
21
|
+
|
|
22
|
+
const result = await models.User.create({
|
|
23
|
+
username: 'admin',
|
|
24
|
+
email: process.env.DEFAULT_ADMIN_EMAIL || 'admin@' + options.host,
|
|
25
|
+
password: hashedPassword,
|
|
26
|
+
role: 'admin',
|
|
27
|
+
emailConfirmed: true,
|
|
28
|
+
publicKey: [],
|
|
29
|
+
});
|
|
30
|
+
logger.warn('Default admin user created. Please change the default password immediately!', result._doc);
|
|
31
|
+
}
|
|
32
|
+
} catch (error) {
|
|
33
|
+
logger.error('Error checking/creating admin user:', error);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
13
36
|
options.png = {
|
|
14
37
|
buffer: {
|
|
15
38
|
'invalid-token': fs.readFileSync(`./src/client/public/default/assets/mailer/api-user-invalid-token.png`),
|