@underpostnet/underpost 2.98.1 → 2.99.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.
- package/README.md +2 -3
- package/bin/build.js +5 -5
- package/bin/deploy.js +10 -1
- package/cli.md +109 -110
- 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/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 +162 -60
- package/src/cli/env.js +20 -5
- package/src/cli/fs.js +19 -21
- package/src/cli/index.js +35 -32
- package/src/cli/lxd.js +5 -5
- package/src/cli/monitor.js +66 -88
- package/src/cli/repository.js +7 -6
- package/src/cli/run.js +369 -261
- package/src/cli/secrets.js +3 -3
- package/src/cli/ssh.js +31 -32
- package/src/cli/static.js +1 -1
- package/src/cli/test.js +6 -7
- package/src/client/components/core/Content.js +42 -40
- package/src/client/components/core/FullScreen.js +202 -9
- package/src/client/components/core/PanelForm.js +4 -2
- package/src/client/components/core/VanillaJs.js +80 -29
- 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/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/src/cli/script.js +0 -85
- package/src/monitor.js +0 -34
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
<!-- badges -->
|
|
20
20
|
|
|
21
|
-
[](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://socket.dev/npm/package/underpost/overview/2.99.0) [](https://coveralls.io/github/underpostnet/engine?branch=master) [](https://www.npmjs.org/package/underpost) [](https://www.npmjs.com/package/underpost)
|
|
22
22
|
|
|
23
23
|
<!-- end-badges -->
|
|
24
24
|
|
|
@@ -66,7 +66,7 @@ Run dev client server
|
|
|
66
66
|
npm run dev
|
|
67
67
|
```
|
|
68
68
|
<!-- -->
|
|
69
|
-
## underpost ci/cd cli v2.
|
|
69
|
+
## underpost ci/cd cli v2.99.0
|
|
70
70
|
|
|
71
71
|
### Usage: `underpost [options] [command]`
|
|
72
72
|
```
|
|
@@ -93,7 +93,6 @@ Commands:
|
|
|
93
93
|
install Quickly imports Underpost npm dependencies by copying them.
|
|
94
94
|
db [options] [deploy-list] Manages database operations with support for MariaDB and MongoDB, including import/export, multi-pod targeting, and Git integration.
|
|
95
95
|
metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
|
|
96
|
-
script [options] <operator> <script-name> [script-value] Supports a variety of built-in Underpost global scripts, their preset lifecycle events, and arbitrary custom scripts.
|
|
97
96
|
cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
|
|
98
97
|
fs [options] [path] Manages file storage, defaulting to file upload operations.
|
|
99
98
|
test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
|
package/bin/build.js
CHANGED
|
@@ -181,11 +181,11 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
|
|
|
181
181
|
'atlas-sprite-sheet',
|
|
182
182
|
];
|
|
183
183
|
packageJson.description = 'Cyberia Engine - Object Layer and Assets Management Microservice';
|
|
184
|
-
|
|
185
|
-
packageJson.dependencies
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
184
|
+
const { CyberiaDependencies } = await import(`../src/client/components/cyberia-portal/CommonCyberiaPortal.js`);
|
|
185
|
+
packageJson.dependencies = {
|
|
186
|
+
...packageJson.dependencies,
|
|
187
|
+
...CyberiaDependencies,
|
|
188
|
+
};
|
|
189
189
|
fs.writeFileSync(`${basePath}/bin/index.js`, fs.readFileSync(`./bin/cyberia.js`, 'utf8'), 'utf8');
|
|
190
190
|
fs.copyFileSync(`./src/api/object-layer/README.md`, `${basePath}/README.md`);
|
|
191
191
|
fs.copySync(`./hardhat`, `${basePath}/hardhat`);
|
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}`);
|
|
@@ -1134,6 +1134,15 @@ nvidia/gpu-operator \
|
|
|
1134
1134
|
}
|
|
1135
1135
|
break;
|
|
1136
1136
|
}
|
|
1137
|
+
|
|
1138
|
+
case 'cyberia': {
|
|
1139
|
+
const { CyberiaDependencies } = await import(`../src/client/components/cyberia-portal/CommonCyberiaPortal.js`);
|
|
1140
|
+
for (const dep of Object.keys(CyberiaDependencies)) {
|
|
1141
|
+
const ver = CyberiaDependencies[dep];
|
|
1142
|
+
shellExec(`npm install ${dep}@${ver}`);
|
|
1143
|
+
}
|
|
1144
|
+
break;
|
|
1145
|
+
}
|
|
1137
1146
|
}
|
|
1138
1147
|
} catch (error) {
|
|
1139
1148
|
logger.error(error, error.stack);
|
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.
|
|
1
|
+
## underpost ci/cd cli v2.99.0
|
|
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,36 @@ 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
|
+
-h, --help display help for command
|
|
752
746
|
|
|
753
747
|
```
|
|
754
748
|
|
|
@@ -802,7 +796,7 @@ Options:
|
|
|
802
796
|
Runs specified scripts using various runners.
|
|
803
797
|
|
|
804
798
|
Arguments:
|
|
805
|
-
runner-id The runner ID to run. Options: dev-cluster,
|
|
799
|
+
runner-id The runner ID to run. Options: dev-cluster,metadata,svc-ls,svc-rm,ssh-cluster-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,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
800
|
path The input value, identifier, or path for the operation.
|
|
807
801
|
|
|
808
802
|
Options:
|
|
@@ -855,6 +849,11 @@ Options:
|
|
|
855
849
|
--hosts <hosts> Comma-separated list of hosts for the runner execution.
|
|
856
850
|
--instance-id <instance-id> Sets instance id context for the runner execution.
|
|
857
851
|
--pid <process-id> Sets process id context for the runner execution.
|
|
852
|
+
--timeout-response <duration> Sets HTTPProxy per-route response timeout (e.g., "1s", "300ms", "infinity").
|
|
853
|
+
--timeout-idle <duration> Sets HTTPProxy per-route idle timeout (e.g., "10s", "infinity").
|
|
854
|
+
--retry-count <count> Sets HTTPProxy per-route retry count (e.g., 3).
|
|
855
|
+
--retry-per-try-timeout <duration> Sets HTTPProxy retry per-try timeout (e.g., "150ms").
|
|
856
|
+
--disable-private-conf-update Disables updates to private configuration during execution.
|
|
858
857
|
-h, --help display help for command
|
|
859
858
|
|
|
860
859
|
```
|
|
@@ -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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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": "@underpostnet/underpost",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.99.0",
|
|
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",
|
|
@@ -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",
|
|
@@ -198,43 +198,7 @@ const UserRouter = (options) => {
|
|
|
198
198
|
|
|
199
199
|
router.get(`/u/:username`, async (req, res) => {
|
|
200
200
|
/*
|
|
201
|
-
#swagger.
|
|
202
|
-
#swagger.tags = ['user']
|
|
203
|
-
#swagger.summary = 'Get public user profile'
|
|
204
|
-
#swagger.description = 'This endpoint gets public user profile data by username (no auth required)'
|
|
205
|
-
#swagger.path = '/user/u/{username}'
|
|
206
|
-
#swagger.method = 'get'
|
|
207
|
-
#swagger.produces = ['application/json']
|
|
208
|
-
#swagger.consumes = ['application/json']
|
|
209
|
-
|
|
210
|
-
#swagger.parameters['username'] = {
|
|
211
|
-
in: 'path',
|
|
212
|
-
description: 'User username',
|
|
213
|
-
required: true,
|
|
214
|
-
type: 'string'
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
#swagger.responses[200] = {
|
|
218
|
-
description: 'get public user profile successfully',
|
|
219
|
-
content: {
|
|
220
|
-
'application/json': {
|
|
221
|
-
schema: {
|
|
222
|
-
$ref: '#/components/schemas/userPublicResponse'
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
#swagger.responses[400] = {
|
|
229
|
-
description: 'Bad request. Please check the input data',
|
|
230
|
-
content: {
|
|
231
|
-
'application/json': {
|
|
232
|
-
schema: {
|
|
233
|
-
$ref: '#/components/schemas/userBadRequestResponse'
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
201
|
+
#swagger.ignore = true
|
|
238
202
|
*/
|
|
239
203
|
return await UserController.get(req, res, options);
|
|
240
204
|
});
|
|
@@ -421,9 +385,12 @@ const UserRouter = (options) => {
|
|
|
421
385
|
});
|
|
422
386
|
|
|
423
387
|
// Username public profile redirect
|
|
424
|
-
options.app.get(`${options.path === '/' ? '' : options.path}/u/:username`, async (req, res, next) =>
|
|
425
|
-
|
|
426
|
-
|
|
388
|
+
options.app.get(`${options.path === '/' ? '' : options.path}/u/:username`, async (req, res, next) => {
|
|
389
|
+
/*
|
|
390
|
+
#swagger.ignore = true
|
|
391
|
+
*/
|
|
392
|
+
return res.redirect(`${options.path === '/' ? '' : options.path}/u?cid=${req.params.username}`);
|
|
393
|
+
});
|
|
427
394
|
|
|
428
395
|
return router;
|
|
429
396
|
};
|