underpost 2.8.52 → 2.8.56

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 (40) hide show
  1. package/.github/workflows/ghpkg.yml +1 -1
  2. package/.github/workflows/npmpkg.yml +1 -1
  3. package/.github/workflows/pwa-microservices-template.page.yml +1 -1
  4. package/CHANGELOG.md +24 -0
  5. package/bin/build.js +29 -4
  6. package/bin/deploy.js +64 -52
  7. package/bin/hwt.js +0 -10
  8. package/bin/index.js +38 -16
  9. package/bin/util.js +0 -7
  10. package/conf.js +0 -2
  11. package/docker-compose.yml +1 -1
  12. package/manifests/kind-config-dev.yaml +12 -0
  13. package/manifests/mongodb-4.4/kustomization.yaml +7 -0
  14. package/manifests/mongodb-4.4/service-deployment.yaml +63 -0
  15. package/package.json +9 -7
  16. package/src/cli/cluster.js +71 -45
  17. package/src/cli/cron.js +1 -1
  18. package/src/cli/db.js +6 -4
  19. package/src/cli/deploy.js +43 -30
  20. package/src/cli/fs.js +134 -0
  21. package/src/cli/image.js +1 -18
  22. package/src/cli/repository.js +13 -0
  23. package/src/cli/script.js +25 -1
  24. package/src/cli/test.js +39 -4
  25. package/src/db/mongo/MongooseDB.js +17 -1
  26. package/src/index.js +9 -1
  27. package/src/server/backup.js +2 -2
  28. package/src/server/client-formatted.js +2 -1
  29. package/src/server/conf.js +4 -10
  30. package/src/server/dns.js +39 -46
  31. package/src/server/downloader.js +0 -8
  32. package/test/api.test.js +0 -8
  33. package/manifests/core/kustomization.yaml +0 -11
  34. package/manifests/core/underpost-engine-backup-access.yaml +0 -16
  35. package/manifests/core/underpost-engine-backup-pv-pvc.yaml +0 -22
  36. package/manifests/core/underpost-engine-headless-service.yaml +0 -10
  37. package/manifests/core/underpost-engine-mongodb-backup-cronjob.yaml +0 -40
  38. package/manifests/core/underpost-engine-mongodb-configmap.yaml +0 -26
  39. package/manifests/core/underpost-engine-statefulset.yaml +0 -91
  40. /package/manifests/{core/underpost-engine-pv-pvc.yaml → mongodb-4.4/pv-pvc.yaml} +0 -0
@@ -43,7 +43,7 @@ jobs:
43
43
  run: |
44
44
  npm install -g underpost
45
45
  underpost config set GITHUB_TOKEN ${{ secrets.GIT_AUTH_TOKEN }}
46
- underpost install
46
+ npm install
47
47
  node ./bin/deploy rename-package @underpostnet/underpost
48
48
  node ./bin/deploy set-repo underpostnet/pwa-microservices-template-ghpkg
49
49
 
@@ -28,7 +28,7 @@ jobs:
28
28
  run: |
29
29
  npm install -g underpost
30
30
  underpost config set GITHUB_TOKEN ${{ secrets.GIT_AUTH_TOKEN }}
31
- underpost install
31
+ npm install
32
32
 
33
33
  - name: Set git credentials
34
34
  run: |
@@ -43,7 +43,7 @@ jobs:
43
43
  - name: Build the site
44
44
  run: |
45
45
  npm install -g underpost
46
- underpost install
46
+ npm install
47
47
  node bin/deploy update-default-conf ghpkg
48
48
  env-cmd -f .env.production node bin/deploy build-full-client github-pages underpostnet.github.io /pwa-microservices-template-ghpkg
49
49
  # git lfs install
package/CHANGELOG.md CHANGED
@@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v2.8.521](https://github.com/underpostnet/engine/compare/v2.8.51...v2.8.521)
8
+
9
+ > 4 March 2025
10
+
11
+ - ci(package-pwa-microservices-template): ⚙️ Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) [`5878342`](https://github.com/underpostnet/engine/commit/587834206f07a508b3e12ff5b5727c5979c06499)
12
+ - ci(package-pwa-microservices-template): ⚙️ update version 2.8.521 [`5fada73`](https://github.com/underpostnet/engine/commit/5fada73abf960567f4ecdc01062a987f4d7b4e79)
13
+ - fix(cli): 🐛 run prod img [`94743ef`](https://github.com/underpostnet/engine/commit/94743efe2cf214f0dbcf4db9f0b83ecf50b396f5)
14
+
15
+ #### [v2.8.51](https://github.com/underpostnet/engine/compare/v2.8.46...v2.8.51)
16
+
17
+ > 4 March 2025
18
+
19
+ - ci: ⚙️ add dd-core-development yamls [`a236466`](https://github.com/underpostnet/engine/commit/a2364666f5ddc0e824fa8b68b203bb9e021cca0c)
20
+ - refactor(cli): 📦 cron jobs management refactor [`8c28689`](https://github.com/underpostnet/engine/commit/8c28689cd514ee0e30a38be22ca3dbd292aa3a8a)
21
+ - ci(package-pwa-microservices-template): ⚙️ Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) [`dd3557b`](https://github.com/underpostnet/engine/commit/dd3557bc52724d9231a0a13a320108758b6a84d2)
22
+
23
+ #### [v2.8.46](https://github.com/underpostnet/engine/compare/v2.8.44...v2.8.46)
24
+
25
+ > 28 February 2025
26
+
27
+ - refactor(add cli module directory): 📦 A code change that neither fixes a bug nor adds a feature [`56eea01`](https://github.com/underpostnet/engine/commit/56eea0121489998945c1b2040c3fc53cf6ee295c)
28
+ - refactor(bin): 📦 static API method access [`dcac59e`](https://github.com/underpostnet/engine/commit/dcac59e0cc3fb3e7eeef490d7ded3adb921f4e7a)
29
+ - ci(package-pwa-microservices-template): ⚙️ update version 2.8.45 [`11795eb`](https://github.com/underpostnet/engine/commit/11795eb2b57243530bfd027774005a83edbdee3b)
30
+
7
31
  #### [v2.8.44](https://github.com/underpostnet/engine/compare/v2.8.42...v2.8.44)
8
32
 
9
33
  > 18 February 2025
package/bin/build.js CHANGED
@@ -20,11 +20,15 @@ const logger = loggerFactory(import.meta);
20
20
  const confName = process.argv[2];
21
21
  const basePath = '../pwa-microservices-template';
22
22
  const repoName = `engine-${confName.split('dd-')[1]}`;
23
+ const deployList = (confName === 'dd' ? fs.readFileSync(`./engine-private/deploy/dd.router`, 'utf8') : confName).split(
24
+ ',',
25
+ );
23
26
 
24
27
  logger.info('', {
25
28
  confName,
26
29
  repoName,
27
30
  basePath,
31
+ deployList,
28
32
  });
29
33
 
30
34
  if (process.argv.includes('clean')) {
@@ -35,10 +39,7 @@ if (process.argv.includes('clean')) {
35
39
  }
36
40
 
37
41
  if (process.argv.includes('conf')) {
38
- for (const _confName of (confName === 'dd'
39
- ? fs.readFileSync(`./engine-private/deploy/dd.router`, 'utf8')
40
- : confName
41
- ).split(',')) {
42
+ for (const _confName of deployList) {
42
43
  const _repoName = `engine-${_confName.split('dd-')[1]}`;
43
44
  const privateRepoName = `${_repoName}-private`;
44
45
  const privateGitUri = `${process.env.GITHUB_USERNAME}/${privateRepoName}`;
@@ -58,6 +59,12 @@ if (process.argv.includes('conf')) {
58
59
  if (replica.match(_confName))
59
60
  fs.copySync(`./engine-private/replica/${replica}`, `../${privateRepoName}/replica/${replica}`);
60
61
  }
62
+ if (fs.existsSync(`./engine-private/itc-scripts`)) {
63
+ const itcScripts = await fs.readdir(`./engine-private/itc-scripts`);
64
+ for (const itcScript of itcScripts)
65
+ if (itcScript.match(_confName))
66
+ fs.copySync(`./engine-private/itc-scripts/${itcScript}`, `../${privateRepoName}/itc-scripts/${itcScript}`);
67
+ }
61
68
  shellExec(
62
69
  `cd ../${privateRepoName}` +
63
70
  ` && git add .` +
@@ -68,6 +75,13 @@ if (process.argv.includes('conf')) {
68
75
  process.exit(0);
69
76
  }
70
77
 
78
+ if (confName === 'dd') {
79
+ for (const _confName of deployList) {
80
+ shellExec(`node bin/build ${_confName}`);
81
+ }
82
+ process.exit(0);
83
+ }
84
+
71
85
  const { DefaultConf } = await import(`../conf.${confName}.js`);
72
86
 
73
87
  {
@@ -133,12 +147,23 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
133
147
  }
134
148
  }
135
149
 
150
+ shellExec(`node bin/deploy update-default-conf ${confName}`);
151
+
136
152
  fs.copyFileSync(`./conf.${confName}.js`, `${basePath}/conf.js`);
137
153
  fs.copyFileSync(
138
154
  `./.github/workflows/engine.${confName.split('dd-')[1]}.ci.yml`,
139
155
  `${basePath}/.github/workflows/engine.${confName.split('dd-')[1]}.ci.yml`,
140
156
  );
141
157
 
158
+ switch (confName) {
159
+ case 'dd-cyberia':
160
+ fs.copyFileSync(`./bin/cyberia.js`, `${basePath}/bin/cyberia.js`);
161
+ break;
162
+
163
+ default:
164
+ break;
165
+ }
166
+
142
167
  const packageJson = JSON.parse(fs.readFileSync(`${basePath}/package.json`, 'utf8'));
143
168
  packageJson.name = repoName;
144
169
  fs.writeFileSync(
package/bin/deploy.js CHANGED
@@ -672,68 +672,80 @@ try {
672
672
  break;
673
673
  }
674
674
 
675
- case 'update-version':
676
- {
677
- const newVersion = process.argv[3];
678
- const originPackageJson = JSON.parse(fs.readFileSync(`package.json`, 'utf8'));
679
- const { version } = originPackageJson;
680
- originPackageJson.version = newVersion;
681
- fs.writeFileSync(`package.json`, JSON.stringify(originPackageJson, null, 4), 'utf8');
682
-
683
- const originPackageLockJson = JSON.parse(fs.readFileSync(`package-lock.json`, 'utf8'));
684
- originPackageLockJson.version = newVersion;
685
- originPackageLockJson.packages[''].version = newVersion;
686
- fs.writeFileSync(`package-lock.json`, JSON.stringify(originPackageLockJson, null, 4), 'utf8');
687
-
688
- if (fs.existsSync(`./engine-private/conf`)) {
689
- const files = await fs.readdir(`./engine-private/conf`, { recursive: true });
690
- for (const relativePath of files) {
691
- const filePah = `./engine-private/conf/${relativePath.replaceAll(`\\`, '/')}`;
692
- if (filePah.split('/').pop() === 'package.json') {
693
- const originPackage = JSON.parse(fs.readFileSync(filePah, 'utf8'));
694
- originPackage.version = newVersion;
695
- fs.writeFileSync(filePah, JSON.stringify(originPackage, null, 4), 'utf8');
696
- }
697
- if (filePah.split('/').pop() === 'deployment.yaml') {
698
- fs.writeFileSync(
699
- filePah,
700
- fs
701
- .readFileSync(filePah, 'utf8')
702
- .replaceAll(`v${version}`, `v${newVersion}`)
703
- .replaceAll(`engine.version: ${version}`, `engine.version: ${newVersion}`),
704
- 'utf8',
705
- );
706
- }
675
+ case 'version-build': {
676
+ const newVersion = process.argv[3];
677
+ const originPackageJson = JSON.parse(fs.readFileSync(`package.json`, 'utf8'));
678
+ const { version } = originPackageJson;
679
+ originPackageJson.version = newVersion;
680
+ fs.writeFileSync(`package.json`, JSON.stringify(originPackageJson, null, 4), 'utf8');
681
+
682
+ const originPackageLockJson = JSON.parse(fs.readFileSync(`package-lock.json`, 'utf8'));
683
+ originPackageLockJson.version = newVersion;
684
+ originPackageLockJson.packages[''].version = newVersion;
685
+ fs.writeFileSync(`package-lock.json`, JSON.stringify(originPackageLockJson, null, 4), 'utf8');
686
+
687
+ if (fs.existsSync(`./engine-private/conf`)) {
688
+ const files = await fs.readdir(`./engine-private/conf`, { recursive: true });
689
+ for (const relativePath of files) {
690
+ const filePah = `./engine-private/conf/${relativePath.replaceAll(`\\`, '/')}`;
691
+ if (filePah.split('/').pop() === 'package.json') {
692
+ const originPackage = JSON.parse(fs.readFileSync(filePah, 'utf8'));
693
+ originPackage.version = newVersion;
694
+ fs.writeFileSync(filePah, JSON.stringify(originPackage, null, 4), 'utf8');
695
+ }
696
+ if (filePah.split('/').pop() === 'deployment.yaml') {
697
+ fs.writeFileSync(
698
+ filePah,
699
+ fs
700
+ .readFileSync(filePah, 'utf8')
701
+ .replaceAll(`v${version}`, `v${newVersion}`)
702
+ .replaceAll(`engine.version: ${version}`, `engine.version: ${newVersion}`),
703
+ 'utf8',
704
+ );
707
705
  }
708
706
  }
707
+ }
709
708
 
709
+ fs.writeFileSync(
710
+ `./docker-compose.yml`,
711
+ fs
712
+ .readFileSync(`./docker-compose.yml`, 'utf8')
713
+ .replaceAll(`engine.version: '${version}'`, `engine.version: '${newVersion}'`),
714
+ 'utf8',
715
+ );
716
+
717
+ if (fs.existsSync(`./.github/workflows/docker-image.yml`))
710
718
  fs.writeFileSync(
711
- `./docker-compose.yml`,
719
+ `./.github/workflows/docker-image.yml`,
712
720
  fs
713
- .readFileSync(`./docker-compose.yml`, 'utf8')
714
- .replaceAll(`engine.version: '${version}'`, `engine.version: '${newVersion}'`),
721
+ .readFileSync(`./.github/workflows/docker-image.yml`, 'utf8')
722
+ .replaceAll(`underpost-engine:v${version}`, `underpost-engine:v${newVersion}`),
715
723
  'utf8',
716
724
  );
717
725
 
718
- if (fs.existsSync(`./.github/workflows/docker-image.yml`))
719
- fs.writeFileSync(
720
- `./.github/workflows/docker-image.yml`,
721
- fs
722
- .readFileSync(`./.github/workflows/docker-image.yml`, 'utf8')
723
- .replaceAll(`underpost-engine:v${version}`, `underpost-engine:v${newVersion}`),
724
- 'utf8',
725
- );
726
+ fs.writeFileSync(
727
+ `./src/index.js`,
728
+ fs.readFileSync(`./src/index.js`, 'utf8').replaceAll(`${version}`, `${newVersion}`),
729
+ 'utf8',
730
+ );
726
731
 
727
- fs.writeFileSync(
728
- `./src/index.js`,
729
- fs.readFileSync(`./src/index.js`, 'utf8').replaceAll(`${version}`, `${newVersion}`),
730
- 'utf8',
731
- );
732
+ shellExec(`node bin/deploy update-dependencies`);
733
+ shellExec(`auto-changelog`);
734
+ shellExec(`node bin/build dd`);
735
+ shellExec(`node bin deploy dd --build-manifest --sync --info-router`);
736
+ shellExec(`node bin deploy dd production --build-manifest --sync --info-router`);
737
+ break;
738
+ }
732
739
 
733
- shellExec(`node bin/deploy update-dependencies`);
734
- shellExec(`auto-changelog`);
735
- }
740
+ case 'version-deploy': {
741
+ shellExec(`node bin/build dd conf`);
742
+ shellExec(`git add . && cd ./engine-private && git add .`);
743
+ shellExec(`node bin cmt . ci package-pwa-microservices-template`);
744
+ shellExec(`node bin cmt ./engine-private ci package-pwa-microservices-template`);
745
+ shellExec(`node bin push . underpostnet/engine`);
746
+ shellExec(`cd ./engine-private && node ../bin push . underpostnet/engine-private`);
736
747
  break;
748
+ }
737
749
 
738
750
  case 'update-authors': {
739
751
  // #### Ordered by first contribution.
@@ -826,7 +838,7 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
826
838
  DefaultConf.client = JSON.parse(fs.readFileSync(`./engine-private/conf/${confName}/conf.client.json`, 'utf8'));
827
839
  DefaultConf.server = JSON.parse(fs.readFileSync(`./engine-private/conf/${confName}/conf.server.json`, 'utf8'));
828
840
  DefaultConf.ssr = JSON.parse(fs.readFileSync(`./engine-private/conf/${confName}/conf.ssr.json`, 'utf8'));
829
- DefaultConf.cron = JSON.parse(fs.readFileSync(`./engine-private/conf/${confName}/conf.cron.json`, 'utf8'));
841
+ // DefaultConf.cron = JSON.parse(fs.readFileSync(`./engine-private/conf/${confName}/conf.cron.json`, 'utf8'));
830
842
 
831
843
  for (const host of Object.keys(DefaultConf.server)) {
832
844
  for (const path of Object.keys(DefaultConf.server[host])) {
package/bin/hwt.js CHANGED
@@ -1,19 +1,9 @@
1
1
  import fs from 'fs-extra';
2
- import axios from 'axios';
3
- import https from 'https';
4
2
 
5
- import dotenv from 'dotenv';
6
- import { shellCd, shellExec } from '../src/server/process.js';
7
3
  import { loggerFactory } from '../src/server/logger.js';
8
4
 
9
5
  const logger = loggerFactory(import.meta);
10
6
 
11
- const httpsAgent = new https.Agent({
12
- rejectUnauthorized: false,
13
- });
14
-
15
- axios.defaults.httpsAgent = httpsAgent;
16
-
17
7
  logger.info('argv', process.argv);
18
8
 
19
9
  const [exe, dir, operator, templateId, publicPath] = process.argv;
package/bin/index.js CHANGED
@@ -2,20 +2,18 @@
2
2
 
3
3
  import dotenv from 'dotenv';
4
4
  import { Command } from 'commander';
5
- import { loggerFactory } from '../src/server/logger.js';
6
5
  import Underpost from '../src/index.js';
7
- import { getNpmRootPath, loadConf } from '../src/server/conf.js';
6
+ import { getUnderpostRootPath, loadConf } from '../src/server/conf.js';
8
7
  import fs from 'fs-extra';
9
8
  import { commitData } from '../src/client/components/core/CommonJs.js';
10
9
  import UnderpostScript from '../src/cli/script.js';
11
10
  import UnderpostDB from '../src/cli/db.js';
12
11
  import UnderpostCron from '../src/cli/cron.js';
13
12
 
14
- const npmRoot = getNpmRootPath();
15
- const underpostRoot = `${npmRoot}/underpost/.env`;
16
- fs.existsSync(underpostRoot) ? dotenv.config({ path: underpostRoot, override: true }) : dotenv.config();
17
-
18
- const logger = loggerFactory(import.meta);
13
+ const underpostRootPath = getUnderpostRootPath();
14
+ fs.existsSync(`${underpostRootPath}/.env`)
15
+ ? dotenv.config({ path: `${underpostRootPath}/.env`, override: true })
16
+ : dotenv.config();
19
17
 
20
18
  const program = new Command();
21
19
 
@@ -83,19 +81,20 @@ program
83
81
 
84
82
  program
85
83
  .command('cluster')
84
+ .argument('[pod-name]', 'Optional pod name filter')
86
85
  .option('--reset', `Delete all clusters and prune all data and caches`)
87
86
  .option('--mariadb', 'Init with mariadb statefulset')
88
87
  .option('--mongodb', 'Init with mongodb statefulset')
88
+ .option('--mongodb4', 'Init with mongodb 4.4 service')
89
89
  .option('--valkey', 'Init with valkey service')
90
90
  .option('--contour', 'Init with project contour base HTTPProxy and envoy')
91
91
  .option('--cert-manager', 'Init with letsencrypt-prod ClusterIssuer')
92
92
  .option('--info', 'Get all kinds objects deployed')
93
93
  .option('--full', 'Init with all statefulsets and services available')
94
94
  .option('--ns-use <ns-name>', 'Switches current context to namespace')
95
- .action((...args) => {
96
- if (args[0].reset) return Underpost.cluster.reset();
97
- return Underpost.cluster.init(args[0]);
98
- })
95
+ .option('--dev', 'init with dev cluster')
96
+ .option('--list-pods', 'Display list pods information')
97
+ .action(Underpost.cluster.init)
99
98
  .description('Manage cluster, for default initialization base kind cluster');
100
99
 
101
100
  program
@@ -105,6 +104,8 @@ program
105
104
  .option('--remove', 'Delete deployments and services')
106
105
  .option('--sync', 'Sync deployments env, ports, and replicas')
107
106
  .option('--info-router', 'Display router structure')
107
+ .option('--expose', 'Expose service match deploy-list')
108
+ .option('--info-util', 'Display kubectl util management commands')
108
109
  .option('--build-manifest', 'Build kind yaml manifests: deployments, services, proxy and secrets')
109
110
  .description('Manage deployment, for default deploy development pods')
110
111
  .action(Underpost.deploy.callback);
@@ -151,7 +152,7 @@ program
151
152
  .command('install')
152
153
  .description('Fast import underpost npm dependencies')
153
154
  .action(() => {
154
- fs.copySync(`${npmRoot}/underpost/node_modules`, './node_modules');
155
+ fs.copySync(`${underpostRootPath}/node_modules`, './node_modules');
155
156
  });
156
157
 
157
158
  program
@@ -159,6 +160,8 @@ program
159
160
  .argument('<deploy-list>', 'Deploy id list, e.g. default-a,default-b')
160
161
  .option('--import', 'Import container backups from repositories')
161
162
  .option('--export', 'Export container backups to repositories')
163
+ .option('--pod-name <pod-name>', 'Optional pod context')
164
+ .option('--ns <ns-name>', 'Optional name space context')
162
165
  .description('Manage databases')
163
166
  .action(UnderpostDB.API.callback);
164
167
 
@@ -166,28 +169,47 @@ program
166
169
  .command('script')
167
170
  .argument('operator', `Options: ${Object.keys(UnderpostScript.API)}`)
168
171
  .argument('<script-name>', 'Script name')
169
- .argument('[script-value]', 'Literal command')
172
+ .argument('[script-value]', 'Literal command, or path')
173
+ .option('--itc', 'Inside container execution context')
174
+ .option('--itc-path', 'Inside container path options')
175
+ .option('--ns <ns-name>', 'Options name space context')
176
+ .option('--pod-name <pod-name>')
170
177
  .description(
171
178
  'Supports a number of built-in underpost global scripts and their preset life cycle events as well as arbitrary scripts',
172
179
  )
173
- .action((...args) => Underpost.script[args[0]](args[1], args[2]));
180
+ .action((...args) => Underpost.script[args[0]](args[1], args[2], args[3]));
174
181
 
175
182
  program
176
183
  .command('cron')
177
184
  .argument('[deploy-list]', 'Deploy id list, e.g. default-a,default-b')
178
185
  .argument('[job-list]', `Deploy id list, e.g. ${Object.keys(UnderpostCron.JOB)}, for default all available jobs`)
179
- .option('--disable-kind-cluster', 'Disable kind cluster configuration')
186
+ .option('--itc', 'Inside container execution context')
180
187
  .option('--init', 'Init cron jobs for cron job default deploy id')
181
188
  .description('Cron jobs management')
182
189
  .action(Underpost.cron.callback);
183
190
 
191
+ program
192
+ .command('fs')
193
+ .argument('[path]', 'Absolute or relative directory')
194
+ .option('--rm', 'Remove file')
195
+ .option('--git', 'Current git changes')
196
+ .option('--recursive', 'Upload files recursively')
197
+ .option('--deploy-id <deploy-id>', 'Deploy configuration id')
198
+ .option('--pull', 'Download file')
199
+ .option('--force', 'Force action')
200
+ .description('File storage management, for default upload file')
201
+ .action(Underpost.fs.callback);
202
+
184
203
  program
185
204
  .command('test')
186
205
  .argument('[deploy-list]', 'Deploy id list, e.g. default-a,default-b')
187
206
  .description('Manage Test, for default run current underpost default test')
188
- .option('--inside-container', 'Inside container execution context')
207
+ .option('--itc', 'Inside container execution context')
189
208
  .option('--sh', 'Copy to clipboard, container entrypoint shell command')
190
209
  .option('--logs', 'Display container logs')
210
+ .option('--pod-name <pod-name>')
211
+ .option('--pod-status <pod-status>')
212
+ .option('--kind-type <kind-type>')
191
213
  .action(Underpost.test.callback);
192
214
 
193
215
  program.parse();
package/bin/util.js CHANGED
@@ -2,8 +2,6 @@ import fs from 'fs-extra';
2
2
  import si from 'systeminformation';
3
3
  import * as dir from 'path';
4
4
  import { svg } from 'font-awesome-assets';
5
- import axios from 'axios';
6
- import https from 'https';
7
5
 
8
6
  import { loggerFactory } from '../src/server/logger.js';
9
7
  import { pbcopy, shellExec } from '../src/server/process.js';
@@ -12,11 +10,6 @@ import { FileFactory } from '../src/api/file/file.service.js';
12
10
  import { faBase64Png, getBufferPngText } from '../src/server/client-icons.js';
13
11
  import keyword_extractor from 'keyword-extractor';
14
12
 
15
- const httpsAgent = new https.Agent({
16
- rejectUnauthorized: false,
17
- });
18
- axios.defaults.httpsAgent = httpsAgent;
19
-
20
13
  const logger = loggerFactory(import.meta);
21
14
 
22
15
  logger.info('argv', process.argv);
package/conf.js CHANGED
@@ -179,9 +179,7 @@ const DefaultConf = /**/ {
179
179
  },
180
180
  },
181
181
  cron: {
182
- ipDaemon: { ip: null },
183
182
  records: { A: [{ host: 'example.com', dns: 'dondominio', api_key: '???', user: '???' }] },
184
- backups: [{ deployGroupId: 'default-group' }],
185
183
  jobs: { dns: { expression: '* * * * *', enabled: true }, backups: { expression: '0 1 * * *', enabled: true } },
186
184
  },
187
185
  }; /**/
@@ -58,7 +58,7 @@ services:
58
58
  cpus: '0.25'
59
59
  memory: 20M
60
60
  labels: # labels in Compose file instead of Dockerfile
61
- engine.version: '2.8.52'
61
+ engine.version: '2.8.56'
62
62
  networks:
63
63
  - load-balancer
64
64
 
@@ -0,0 +1,12 @@
1
+ kind: Cluster
2
+ apiVersion: kind.x-k8s.io/v1alpha4
3
+ nodes:
4
+ - role: control-plane
5
+ - role: worker
6
+ # extraPortMappings:
7
+ # - containerPort: 80
8
+ # hostPort: 80
9
+ # listenAddress: '0.0.0.0'
10
+ # - containerPort: 443
11
+ # hostPort: 443
12
+ # listenAddress: '0.0.0.0'
@@ -0,0 +1,7 @@
1
+ ---
2
+ # kubectl apply -k core/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - pv-pvc.yaml
7
+ - service-deployment.yaml
@@ -0,0 +1,63 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: mongodb-deployment
5
+ namespace: default
6
+ spec:
7
+ selector:
8
+ matchLabels:
9
+ app: mongodb
10
+ replicas: 1
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: mongodb
15
+ spec:
16
+ hostname: mongo
17
+ containers:
18
+ - name: mongodb
19
+ image: docker.io/library/mongo:4.4
20
+ command: ['mongod', '--replSet', 'rs0', '--bind_ip_all']
21
+ # -- bash
22
+ # mongo
23
+ # use admin
24
+ # rs.initiate()
25
+ ports:
26
+ - containerPort: 27017
27
+
28
+ volumeMounts:
29
+ - name: mongo-persistent-storage
30
+ mountPath: /data/db
31
+
32
+ # resources:
33
+ # requests:
34
+ # memory: '500Mi'
35
+ # cpu: '500m'
36
+ volumes:
37
+ - name: mongo-persistent-storage
38
+ persistentVolumeClaim:
39
+ claimName: mongodb-pvc
40
+
41
+ ---
42
+ apiVersion: v1
43
+ kind: Service
44
+ metadata:
45
+ name: mongodb-service
46
+ namespace: default
47
+ spec:
48
+ clusterIP: None
49
+ selector:
50
+ app: mongodb
51
+ ports:
52
+ - protocol: TCP
53
+ port: 27017
54
+ # targetPort: 27017
55
+ # type: ClusterIP
56
+
57
+ # rs.initiate();
58
+ # use admin;
59
+ # rs.initiate({ _id: "rs0", members: [ { _id: 0, host: "127.0.0.1:27017" } ] })
60
+ # db.createUser({user: "your_user",pwd: "your_password", roles: [{role: "userAdminAnyDatabase", db: "admin" },{ role: "readWriteAnyDatabase", db: "admin" }]});
61
+ # cfg = rs.conf();
62
+ # cfg.members[0].host = "127.0.0.1:27027";
63
+ # rs.reconfig(cfg);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "main": "src/index.js",
4
4
  "name": "underpost",
5
- "version": "2.8.52",
5
+ "version": "2.8.56",
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",
@@ -10,6 +10,7 @@
10
10
  "pm2": "env-cmd -f .env.production pm2 start src/server.js --node-args=\"--max-old-space-size=8192\" --name engine",
11
11
  "dev": "env-cmd -f .env.development node src/client.dev default",
12
12
  "dev-img": "env-cmd -f .env.development node src/server",
13
+ "prod-img": "env-cmd -f .env.production node src/server",
13
14
  "dev-api": "env-cmd -f .env.development nodemon --watch src --ignore src/client src/api",
14
15
  "dev-client": "env-cmd -f .env.development node src/client.dev",
15
16
  "proxy": "node src/proxy proxy",
@@ -56,9 +57,11 @@
56
57
  "ag-grid-community": "31.0.0",
57
58
  "axios": "^1.5.1",
58
59
  "chai": "^5.1.0",
60
+ "clean-jsdoc-theme": "^4.3.0",
59
61
  "cli-progress": "^3.12.0",
60
62
  "cli-spinners": "^3.0.0",
61
63
  "clipboardy": "^4.0.0",
64
+ "cloudinary": "^2.5.1",
62
65
  "color": "^4.2.3",
63
66
  "colors": "^1.4.0",
64
67
  "commander": "^12.1.0",
@@ -66,6 +69,7 @@
66
69
  "cors": "^2.8.5",
67
70
  "d3": "^7.9.0",
68
71
  "dotenv": "^16.3.1",
72
+ "easy-json-schema": "^0.0.2-beta",
69
73
  "easymde": "^2.18.0",
70
74
  "env-cmd": "^10.1.0",
71
75
  "express": "^4.18.2",
@@ -86,6 +90,7 @@
86
90
  "log-update": "^6.0.0",
87
91
  "mariadb": "^3.2.2",
88
92
  "marked": "^12.0.2",
93
+ "mocha": "^10.8.2",
89
94
  "mongoose": "^8.9.5",
90
95
  "morgan": "^1.10.0",
91
96
  "nodemailer": "^6.9.9",
@@ -94,6 +99,7 @@
94
99
  "peer": "^1.0.2",
95
100
  "peerjs": "^1.5.2",
96
101
  "pixi.js": "7.4.2",
102
+ "plantuml": "^0.0.2",
97
103
  "prom-client": "^15.1.2",
98
104
  "public-ip": "^6.0.1",
99
105
  "read": "^2.1.0",
@@ -105,17 +111,13 @@
105
111
  "socket.io": "^4.8.0",
106
112
  "sortablejs": "^1.15.0",
107
113
  "split-file": "^2.3.0",
114
+ "swagger-autogen": "^2.23.7",
108
115
  "swagger-ui-express": "^5.0.0",
109
116
  "systeminformation": "^5.23.7",
110
117
  "uglify-js": "^3.17.4",
111
118
  "validator": "^13.11.0",
112
119
  "vanilla-jsoneditor": "^2.3.2",
113
- "winston": "^3.11.0",
114
- "clean-jsdoc-theme": "^4.3.0",
115
- "easy-json-schema": "^0.0.2-beta",
116
- "mocha": "^10.8.2",
117
- "plantuml": "^0.0.2",
118
- "swagger-autogen": "^2.23.7"
120
+ "winston": "^3.11.0"
119
121
  },
120
122
  "devDependencies": {
121
123
  "clean-jsdoc-theme": "^4.3.0",