@underpostnet/underpost 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.
Files changed (42) hide show
  1. package/.env.development +1 -0
  2. package/.env.production +1 -0
  3. package/.env.test +1 -0
  4. package/README.md +2 -3
  5. package/bin/deploy.js +1 -1
  6. package/cli.md +113 -110
  7. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  8. package/manifests/deployment/dd-test-development/deployment.yaml +4 -4
  9. package/package.json +1 -2
  10. package/src/api/user/user.router.js +7 -40
  11. package/src/cli/baremetal.js +67 -71
  12. package/src/cli/cloud-init.js +11 -12
  13. package/src/cli/cluster.js +22 -24
  14. package/src/cli/db.js +43 -50
  15. package/src/cli/deploy.js +163 -61
  16. package/src/cli/env.js +20 -5
  17. package/src/cli/fs.js +19 -21
  18. package/src/cli/index.js +38 -32
  19. package/src/cli/lxd.js +5 -5
  20. package/src/cli/monitor.js +83 -88
  21. package/src/cli/repository.js +7 -6
  22. package/src/cli/run.js +498 -288
  23. package/src/cli/secrets.js +3 -3
  24. package/src/cli/ssh.js +80 -32
  25. package/src/cli/static.js +1 -1
  26. package/src/cli/test.js +6 -7
  27. package/src/index.js +49 -32
  28. package/src/runtime/express/Express.js +7 -6
  29. package/src/server/auth.js +6 -1
  30. package/src/server/backup.js +11 -1
  31. package/src/server/conf.js +4 -4
  32. package/src/{cli → server}/cron.js +56 -29
  33. package/src/server/dns.js +39 -31
  34. package/src/server/peer.js +2 -2
  35. package/src/server/process.js +2 -2
  36. package/src/server/proxy.js +8 -7
  37. package/src/server/runtime.js +4 -7
  38. package/src/server/start.js +28 -15
  39. package/src/ws/IoServer.js +2 -3
  40. package/scripts/ssh-cluster-info.sh +0 -15
  41. package/src/cli/script.js +0 -85
  42. package/src/monitor.js +0 -34
package/.env.development CHANGED
@@ -41,5 +41,6 @@ NFS_EXPORT_PATH=changethis
41
41
  NVIDIA_API_KEY=changethis
42
42
  DEFAULT_ADMIN_EMAIL=admin@default.net
43
43
  DEFAULT_ADMIN_PASSWORD=changethis
44
+ DEFAULT_SSH_PORT=22
44
45
  BASE_API=api
45
46
  DEV_PROXY_PORT_OFFSET=200
package/.env.production CHANGED
@@ -50,6 +50,7 @@ NPM_USER=changethis
50
50
  NPM_PASSWORD=changethis
51
51
  POSTMAN_EMAIL=admin@default.net
52
52
  POSTMAN_PASSWORD=changethis
53
+ DEFAULT_SSH_PORT=22
53
54
  BASE_API=api
54
55
  CERTBOT_LIVE_PATH=changethis
55
56
  CERTBOT_LIVE_PATH_WINDOWS=changethis
package/.env.test CHANGED
@@ -41,5 +41,6 @@ NFS_EXPORT_PATH=changethis
41
41
  NVIDIA_API_KEY=changethis
42
42
  DEFAULT_ADMIN_EMAIL=admin@default.net
43
43
  DEFAULT_ADMIN_PASSWORD=changethis
44
+ DEFAULT_SSH_PORT=22
44
45
  BASE_API=api
45
46
  DEV_PROXY_PORT_OFFSET=200
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  <!-- badges -->
20
20
 
21
- [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Socket Badge](https://socket.dev/api/badge/npm/package/underpost/2.98.3)](https://socket.dev/npm/package/underpost/overview/2.98.3) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](https://www.npmjs.com/package/underpost)
21
+ [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Socket Badge](https://socket.dev/api/badge/npm/package/underpost/2.99.1)](https://socket.dev/npm/package/underpost/overview/2.99.1) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](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.98.3
69
+ ## underpost ci/cd cli v2.99.1
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/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/cli.md CHANGED
@@ -1,4 +1,4 @@
1
- ## underpost ci/cd cli v2.98.3
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 The configuration operation to perform. Options: set,
278
- delete, get, list, clean.
279
- key Optional: The specific configuration key to manage.
280
- value Optional: The value to set for the configuration key.
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 Prints the configuration value in plain text.
284
- --filter <keyword> Filters the list by matching key or value (only for list
285
- operation).
286
- -h, --help display help for command
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 A comma-separated list of deployment IDs
421
- (e.g., "default-a,default-b").
422
- env Optional: The environment for deployment
423
- (e.g., "development", "production").
424
- Defaults to "development".
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 Deletes specified deployments and their
428
- associated services.
429
- --sync Synchronizes deployment environment
430
- variables, ports, and replica counts.
431
- --info-router Displays the current router structure and
432
- configuration.
433
- --expose Exposes services matching the provided
434
- deployment ID list.
435
- --cert Resets TLS/SSL certificate secrets for
436
- deployments.
437
- --cert-hosts <hosts> Resets TLS/SSL certificate secrets for
438
- specified hosts.
439
- --node <node> Sets optional node for deployment
440
- operations.
441
- --build-manifest Builds Kubernetes YAML manifests,
442
- including deployments, services, proxies,
443
- and secrets.
444
- --replicas <replicas> Sets a custom number of replicas for
445
- deployments.
446
- --image <image> Sets a custom image for deployments.
447
- --versions <deployment-versions> A comma-separated list of custom
448
- deployment versions.
449
- --traffic <traffic-versions> A comma-separated list of custom
450
- deployment traffic weights.
451
- --disable-update-deployment Disables updates to deployments.
452
- --disable-update-proxy Disables updates to proxies.
453
- --disable-deployment-proxy Disables proxies of deployments.
454
- --disable-update-volume Disables updates to volume mounts during
455
- deployment.
456
- --status Retrieves current network traffic data
457
- from resource deployments and the host
458
- machine network configuration.
459
- --kubeadm Enables the kubeadm context for deployment
460
- operations.
461
- --etc-hosts Enables the etc-hosts context for
462
- deployment operations.
463
- --restore-hosts Restores default `/etc/hosts` entries.
464
- --disable-update-underpost-config Disables updates to Underpost
465
- configuration during deployment.
466
- --namespace <namespace> Kubernetes namespace for deployment
467
- operations (defaults to "default").
468
- --kind-type <kind-type> Specifies the Kind cluster type for
469
- deployment operations.
470
- --port <port> Sets up port forwarding from local to
471
- remote ports.
472
- --cmd <cmd> Custom initialization command for
473
- deployment (comma-separated commands).
474
- -h, --help display help for command
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
- callback, initCronJobs, updatePackageScripts,
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 The deployment configuration ID to monitor.
734
- env Optional: The environment to monitor (e.g.,
735
- "development", "production"). Defaults to
736
- "development".
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> Sets a custom millisecond interval for
740
- monitoring checks.
741
- --now Executes the monitor script immediately.
742
- --single Disables recurrence, running the monitor script
743
- only once.
744
- --replicas <replicas> Sets a custom number of replicas for monitoring.
745
- Defaults to 1.
746
- --type <type> Sets a custom monitor type.
747
- --sync Synchronizes with current proxy deployments and
748
- traffic configurations.
749
- --namespace <namespace> Sets the Kubernetes namespace for the
750
- deployment. Defaults to "default".
751
- -h, --help display help for command
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, 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, 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, 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.
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
  ```
@@ -17,7 +17,7 @@ spec:
17
17
  spec:
18
18
  containers:
19
19
  - name: dd-default-development-blue
20
- image: localhost/rockylinux9-underpost:v2.98.3
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.98.3
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.98.3
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 && node bin secret underpost --create-from-file /etc/config/.env.development && node bin start --build --run dd-test development
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.98.3
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 && node bin secret underpost --create-from-file /etc/config/.env.development && node bin start --build --run dd-test development
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.98.3",
5
+ "version": "2.99.1",
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.auto = false
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
- res.redirect(`${options.path === '/' ? '' : options.path}/u?cid=${req.params.username}`),
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
  };