underpost 2.7.83 → 2.7.92

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 (85) hide show
  1. package/.github/workflows/ghpkg.yml +41 -1
  2. package/.github/workflows/pwa-microservices-template.page.yml +54 -0
  3. package/.vscode/settings.json +7 -0
  4. package/CHANGELOG.md +64 -16
  5. package/bin/cron.js +47 -0
  6. package/bin/db.js +60 -7
  7. package/bin/deploy.js +358 -26
  8. package/bin/file.js +18 -1
  9. package/bin/hwt.js +59 -0
  10. package/bin/index.js +1 -1
  11. package/bin/util.js +31 -1
  12. package/conf.js +46 -8
  13. package/docker-compose.yml +1 -1
  14. package/package.json +133 -133
  15. package/src/api/core/core.router.js +9 -9
  16. package/src/api/core/core.service.js +12 -4
  17. package/src/api/default/default.service.js +4 -4
  18. package/src/api/file/file.service.js +3 -3
  19. package/src/api/user/user.service.js +10 -8
  20. package/src/client/components/core/404.js +20 -0
  21. package/src/client/components/core/500.js +20 -0
  22. package/src/client/{ssr/common → components/core}/Alert.js +13 -11
  23. package/src/client/components/core/CommonJs.js +3 -0
  24. package/src/client/components/core/CssCore.js +30 -3
  25. package/src/client/components/core/Docs.js +110 -10
  26. package/src/client/components/core/LoadingAnimation.js +4 -2
  27. package/src/client/components/core/Modal.js +223 -22
  28. package/src/client/components/core/Panel.js +1 -1
  29. package/src/client/components/core/PanelForm.js +2 -1
  30. package/src/client/components/core/Responsive.js +34 -5
  31. package/src/client/components/core/RichText.js +4 -2
  32. package/src/client/components/core/Translate.js +21 -5
  33. package/src/client/components/core/VanillaJs.js +2 -1
  34. package/src/client/components/core/WebComponent.js +44 -0
  35. package/src/client/components/core/Worker.js +15 -18
  36. package/src/client/components/default/MenuDefault.js +68 -0
  37. package/src/client/components/default/RoutesDefault.js +2 -0
  38. package/src/client/public/default/plantuml/client-conf.svg +1 -1
  39. package/src/client/public/default/plantuml/client-schema.svg +1 -1
  40. package/src/client/public/default/plantuml/cron-conf.svg +1 -1
  41. package/src/client/public/default/plantuml/cron-schema.svg +1 -1
  42. package/src/client/public/default/plantuml/server-conf.svg +1 -1
  43. package/src/client/public/default/plantuml/server-schema.svg +1 -1
  44. package/src/client/public/default/plantuml/ssr-conf.svg +1 -1
  45. package/src/client/public/default/plantuml/ssr-schema.svg +1 -1
  46. package/src/client/public/default/site.webmanifest +69 -0
  47. package/src/client/ssr/Render.js +1 -6
  48. package/src/client/ssr/{components/body → body}/CacheControl.js +1 -1
  49. package/src/client/ssr/head/Production.js +1 -0
  50. package/src/client/ssr/head/Pwa.js +146 -0
  51. package/src/client/ssr/head/Seo.js +14 -0
  52. package/src/client/ssr/mailer/DefaultRecoverEmail.js +21 -0
  53. package/src/client/ssr/mailer/DefaultVerifyEmail.js +17 -0
  54. package/src/client/ssr/offline/NoNetworkConnection.js +65 -0
  55. package/src/client/ssr/pages/Test.js +196 -0
  56. package/src/client/ssr/pages/maintenance.js +14 -0
  57. package/src/client/ssr/pages/offline.js +21 -0
  58. package/src/client/sw/default.sw.js +44 -165
  59. package/src/db/DataBaseProvider.js +12 -1
  60. package/src/db/mongo/MongooseDB.js +0 -1
  61. package/src/mailer/EmailRender.js +2 -4
  62. package/src/mailer/MailerProvider.js +4 -1
  63. package/src/runtime/lampp/Lampp.js +9 -9
  64. package/src/server/backup.js +82 -70
  65. package/src/server/client-build.js +133 -155
  66. package/src/server/client-formatted.js +2 -4
  67. package/src/server/conf.js +114 -23
  68. package/src/server/crypto.js +91 -0
  69. package/src/server/dns.js +48 -16
  70. package/src/server/network.js +94 -7
  71. package/src/server/proxy.js +26 -28
  72. package/src/server/runtime.js +42 -12
  73. package/src/server/ssl.js +2 -2
  74. package/src/client/ssr/common/SsrCore.js +0 -91
  75. package/src/client/ssr/common/Translate.js +0 -26
  76. package/src/client/ssr/common/Worker.js +0 -28
  77. package/src/client/ssr/components/head/PwaDefault.js +0 -60
  78. package/src/client/ssr/offline/default.index.js +0 -31
  79. package/src/cron.js +0 -30
  80. package/src/server/cron.js +0 -35
  81. /package/src/client/ssr/{components/body → body}/DefaultSplashScreen.js +0 -0
  82. /package/src/client/ssr/{components/email → email}/DefaultRecoverEmail.js +0 -0
  83. /package/src/client/ssr/{components/email → email}/DefaultVerifyEmail.js +0 -0
  84. /package/src/client/ssr/{components/head → head}/Css.js +0 -0
  85. /package/src/client/ssr/{components/head → head}/DefaultScripts.js +0 -0
@@ -9,7 +9,47 @@ permissions:
9
9
  packages: write
10
10
  id-token: write
11
11
  jobs:
12
- test:
12
+ pwa-microservices-template:
13
+ if: github.repository == 'underpostnet/engine' && startsWith(github.event.head_commit.message, '[ci][package][pwa-microservices-template]')
14
+ name: Update github repo package Jobs
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ contents: write
18
+ packages: write
19
+ id-token: write
20
+ steps:
21
+ - uses: actions/checkout@v3
22
+ - uses: actions/setup-node@v4
23
+ with:
24
+ node-version: '22.x'
25
+
26
+ - name: Install dependencies
27
+ run: |
28
+ npm install
29
+
30
+ - name: Set git credentials
31
+ run: |
32
+ git config --global credential.helper ""
33
+ git config credential.helper ""
34
+ git config --global user.name 'underpostnet'
35
+ git config --global user.email 'fcoverdugoa@underpost.net'
36
+ git config --global credential.interactive always
37
+ git config user.name 'underpostnet'
38
+ git config user.email 'fcoverdugoa@underpost.net'
39
+ git config credential.interactive always
40
+
41
+ - name: Clone github package repository
42
+ run: |
43
+ cd .. && git clone https://github.com/underpostnet/pwa-microservices-template.git
44
+ cd engine
45
+ npm run update-template
46
+ cd ../pwa-microservices-template
47
+ git remote set-url origin git@github.com:underpostnet/pwa-microservices-template.git
48
+ git add .
49
+ git commit -m "Update github repo package"
50
+ git push https://${{ secrets.GIT_AUTH_TOKEN }}@github.com/underpostnet/pwa-microservices-template.git
51
+
52
+ pwa-microservices-template-ghpk:
13
53
  if: github.repository == 'underpostnet/pwa-microservices-template'
14
54
  name: Update github repo package Jobs
15
55
  runs-on: ubuntu-latest
@@ -0,0 +1,54 @@
1
+ # Simple workflow for deploying static content to GitHub Pages
2
+ name: Deploy static content to Pages
3
+
4
+ on:
5
+ # Runs on pushes targeting the default branch
6
+ push:
7
+ branches: ['main']
8
+
9
+ # Allows you to run this workflow manually from the Actions tab
10
+ workflow_dispatch:
11
+
12
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13
+ permissions:
14
+ contents: read
15
+ pages: write
16
+ id-token: write
17
+
18
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20
+ concurrency:
21
+ group: 'pages'
22
+ cancel-in-progress: false
23
+
24
+ jobs:
25
+ # Single deploy job since we're just deploying
26
+ deploy:
27
+ if: github.repository == 'underpostnet/pwa-microservices-template-ghpkg'
28
+ environment:
29
+ name: github-pages
30
+ url: ${{ steps.deployment.outputs.page_url }}
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - name: Checkout
34
+ uses: actions/checkout@v4
35
+ - uses: actions/setup-node@v4
36
+ with:
37
+ node-version: '22.x'
38
+
39
+ - name: Build the site
40
+ run: |
41
+ npm install
42
+ node bin/deploy update-default-conf
43
+ npm run build-production github-pages underpostnet.github.io /pwa-microservices-template-ghpkg
44
+
45
+ - name: Setup Pages
46
+ uses: actions/configure-pages@v5
47
+ - name: Upload artifact
48
+ uses: actions/upload-pages-artifact@v3
49
+ with:
50
+ # Upload entire repository
51
+ path: './public/underpostnet.github.io/pwa-microservices-template-ghpkg/'
52
+ - name: Deploy to GitHub Pages
53
+ id: deployment
54
+ uses: actions/deploy-pages@v4
@@ -30,12 +30,15 @@
30
30
  "fileupload",
31
31
  "fontawesome",
32
32
  "fortawesome",
33
+ "gameplay",
33
34
  "googlebot",
34
35
  "Hexa",
35
36
  "htdocs",
36
37
  "htmls",
38
+ "inet",
37
39
  "inlt",
38
40
  "ipfs",
41
+ "Itemledger",
39
42
  "jsonld",
40
43
  "lampp",
41
44
  "loadingio",
@@ -54,6 +57,7 @@
54
57
  "Scatterplot",
55
58
  "sortablejs",
56
59
  "supervisord",
60
+ "Tokenomics",
57
61
  "underpost",
58
62
  "Unequip",
59
63
  "webroot",
@@ -96,5 +100,8 @@
96
100
  "prometheus_data": true,
97
101
  "grafana_data": true,
98
102
  ".nyc_output": true
103
+ },
104
+ "[solidity]": {
105
+ "editor.defaultFormatter": "JuanBlanco.solidity"
99
106
  }
100
107
  }
package/CHANGELOG.md CHANGED
@@ -4,34 +4,82 @@ 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.7.2](https://github.com/underpostnet/pwa-microservices-template/compare/v2.7.1...v2.7.2)
7
+ #### [v2.7.83](https://github.com/underpostnet/engine/compare/v2.7.7...v2.7.83)
8
+
9
+ > 28 October 2024
10
+
11
+ - update version 2.7.83 [`3d22671`](https://github.com/underpostnet/engine/commit/3d22671a23f25767cc01c244090e237ab3a300da)
12
+ - ssr refactor [`836b848`](https://github.com/underpostnet/engine/commit/836b8488b8b5156c4c5d376fefd592e25071a212)
13
+ - fix pixi js render [`93aaee3`](https://github.com/underpostnet/engine/commit/93aaee3683b070874b65ca2c00d27f2a787a0a5d)
14
+
15
+ #### [v2.7.7](https://github.com/underpostnet/engine/compare/v2.7.6...v2.7.7)
16
+
17
+ > 25 October 2024
18
+
19
+ - update version 2.7.7 [`df31617`](https://github.com/underpostnet/engine/commit/df316174ca563251fbaca62a6717771f3056e59b)
20
+ - cyberia ssr lore advance [`ad1f214`](https://github.com/underpostnet/engine/commit/ad1f2144bdd2f3b5b1f2ebc4b9f6b83716df800a)
21
+ - advance ssr lore cyberia [`03b2292`](https://github.com/underpostnet/engine/commit/03b2292f6e092fc9b98cfb6aba9eee6eb0f21a06)
22
+
23
+ #### [v2.7.6](https://github.com/underpostnet/engine/compare/v2.7.5...v2.7.6)
24
+
25
+ > 17 October 2024
26
+
27
+ - update version v2.7.6 [`ddbc2c4`](https://github.com/underpostnet/engine/commit/ddbc2c4bd366e75b580be288c28c68830ed390d5)
28
+ - update node version 22.9.0 and hardhat refactor [`8ba9281`](https://github.com/underpostnet/engine/commit/8ba92818cd67438359dd1aa0938fd33bb932e718)
29
+ - remove pinata [`e231b00`](https://github.com/underpostnet/engine/commit/e231b00919d9d0e31c9718d4dc512384779cf2bb)
30
+
31
+ #### [v2.7.5](https://github.com/underpostnet/engine/compare/v2.7.2...v2.7.5)
32
+
33
+ > 10 October 2024
34
+
35
+ - remove os switchs [`78f7c17`](https://github.com/underpostnet/engine/commit/78f7c17bdaa1789101bf3038544d105b51f25309)
36
+ - update version 2.7.5 [`ca059d9`](https://github.com/underpostnet/engine/commit/ca059d99f95121cbd51f4582c60458734e21b70d)
37
+ - add mondo db server daemon [`b3bab7e`](https://github.com/underpostnet/engine/commit/b3bab7e8ba4204da459660d5fdba25c076c6cd33)
38
+
39
+ #### [v2.7.2](https://github.com/underpostnet/engine/compare/v2.7.1...v2.7.2)
8
40
 
9
41
  > 8 October 2024
10
42
 
11
- - update src v2.7.2 [`12f3b14`](https://github.com/underpostnet/pwa-microservices-template/commit/12f3b14af0170f3a9e1ae1d341a586a2852f6056)
12
- - add npm publish workflow [`843623a`](https://github.com/underpostnet/pwa-microservices-template/commit/843623a582bb00bf16ef167b420f325540fc5327)
13
- - publish yml update [`dc5593b`](https://github.com/underpostnet/pwa-microservices-template/commit/dc5593bb4f480d24b81cf24045c24626542bfee9)
43
+ - underpost panel advance [`60087d5`](https://github.com/underpostnet/engine/commit/60087d55920ae9ddf7d7a3396606088d028cc996)
44
+ - file explorer content ui ux refactor [`38e87a0`](https://github.com/underpostnet/engine/commit/38e87a0f0bd222e1d8c9d76904d086aa9d2125ea)
45
+ - add macro db restore logic [`9cfd41c`](https://github.com/underpostnet/engine/commit/9cfd41c5d7adcd309976e7d327af800ffcf92dac)
14
46
 
15
- #### [v2.7.1](https://github.com/underpostnet/pwa-microservices-template/compare/v2.6.3...v2.7.1)
47
+ #### [v2.7.1](https://github.com/underpostnet/engine/compare/v2.6.3...v2.7.1)
16
48
 
17
49
  > 19 September 2024
18
50
 
19
- - add backup, dns and prompt-optimizer base [`507669e`](https://github.com/underpostnet/pwa-microservices-template/commit/507669e2f1c9b4145643cbac583762eb91b1d18d)
20
- - update version 2.6.8 [`3d765bf`](https://github.com/underpostnet/pwa-microservices-template/commit/3d765bfa6f06866ce46260d2e4af4432c91f072f)
21
- - update version batch 2.6.4 [`fd4fed5`](https://github.com/underpostnet/pwa-microservices-template/commit/fd4fed55f2bbac1a9d4760e804ed6b7f4cde1272)
51
+ - update version 2.7.0 [`03c5c35`](https://github.com/underpostnet/engine/commit/03c5c35a71e7ffb35203a668bfa2f8e2f86125e0)
52
+ - update [`d410da6`](https://github.com/underpostnet/engine/commit/d410da62fadbbb841eb9dcfa5922f105d35ad81d)
53
+ - add changelog generator [`28b3256`](https://github.com/underpostnet/engine/commit/28b3256ab9cebaa9caf2b52426e48f0b3105c8b7)
22
54
 
23
- #### [v2.6.3](https://github.com/underpostnet/pwa-microservices-template/compare/v2.6.2...v2.6.3)
55
+ #### [v2.6.3](https://github.com/underpostnet/engine/compare/v2.6.2...v2.6.3)
24
56
 
25
57
  > 14 September 2024
26
58
 
27
- - update version 2.6.3 [`c8f6f8e`](https://github.com/underpostnet/pwa-microservices-template/commit/c8f6f8ec31470eff977163c5b31be37a05ff96ba)
28
- - update [`7214fbb`](https://github.com/underpostnet/pwa-microservices-template/commit/7214fbb608f7f59c6bf8e189093fd9c7e9a5a80a)
29
- - update [`b99c869`](https://github.com/underpostnet/pwa-microservices-template/commit/b99c8697e96a5141b15f0d28386ba29871746825)
59
+ - update version 2.6.3 [`85c585d`](https://github.com/underpostnet/engine/commit/85c585d1cce30de4389772605cf56e774e2b7d3c)
60
+ - update refactor docs and coverage [`b455016`](https://github.com/underpostnet/engine/commit/b455016f5f2b2bdc142aacb4dfd66ab890125662)
61
+ - update [`b8f01f2`](https://github.com/underpostnet/engine/commit/b8f01f258999c9ebc1173b0616f0f7b8f7171048)
30
62
 
31
- #### v2.6.2
63
+ #### [v2.6.2](https://github.com/underpostnet/engine/compare/v2.5.1...v2.6.2)
32
64
 
33
65
  > 13 September 2024
34
66
 
35
- - add Base project [`4124a60`](https://github.com/underpostnet/pwa-microservices-template/commit/4124a601a8226587bb09db942a8e33b1486828ea)
36
- - set 0.0.1 env template version [`e38a062`](https://github.com/underpostnet/pwa-microservices-template/commit/e38a06281599a2138d3564ae4ed70f61dad55f88)
37
- - update dependabot security [`b6f221a`](https://github.com/underpostnet/pwa-microservices-template/commit/b6f221aecae1e00723c15f726ac1bff60199b10b)
67
+ - update version 2.6.2 [`0895afb`](https://github.com/underpostnet/engine/commit/0895afbde42dd5a573507ccfcb07c328648b4eb0)
68
+ - update version 2.5.6 [`ca57b87`](https://github.com/underpostnet/engine/commit/ca57b87c56a544e7b7e53baa5a6e15415e16b99b)
69
+ - update [`eec4943`](https://github.com/underpostnet/engine/commit/eec49433f50b4dfa7b7bbff48891a60f5be25545)
70
+
71
+ #### [v2.5.1](https://github.com/underpostnet/engine/compare/v2.0.0...v2.5.1)
72
+
73
+ > 27 August 2024
74
+
75
+ - css refactor [`49b1904`](https://github.com/underpostnet/engine/commit/49b1904e83162f9066fbf843ced37d4e87db5581)
76
+ - refactor [`dad4f95`](https://github.com/underpostnet/engine/commit/dad4f9567629b737254702ce8be6b243e68fb01e)
77
+ - add sitemap builder [`53d05a6`](https://github.com/underpostnet/engine/commit/53d05a62d03ea327df3d37181a4b5c272d417289)
78
+
79
+ #### v2.0.0
80
+
81
+ > 30 March 2024
82
+
83
+ - seed-city assets [`6d9decb`](https://github.com/underpostnet/engine/commit/6d9decbae96b828aa001777f96dd75aab3fc71d1)
84
+ - update [`1069fc5`](https://github.com/underpostnet/engine/commit/1069fc5268aa5ef7c101695393de59edfc14daf8)
85
+ - update [`41ae7d4`](https://github.com/underpostnet/engine/commit/41ae7d4c969cce0608171c820e05ebab42610a7f)
package/bin/cron.js ADDED
@@ -0,0 +1,47 @@
1
+ import { BackUpManagement } from '../src/server/backup.js';
2
+ import { Cmd } from '../src/server/conf.js';
3
+ import { Dns } from '../src/server/dns.js';
4
+ import { loggerFactory } from '../src/server/logger.js';
5
+ import { netWorkCron, saveRuntimeCron } from '../src/server/network.js';
6
+ import { shellExec } from '../src/server/process.js';
7
+ import fs from 'fs-extra';
8
+
9
+ const logger = loggerFactory(import.meta);
10
+
11
+ await logger.setUpInfo();
12
+
13
+ switch (process.argv[2]) {
14
+ case 'backups':
15
+ {
16
+ await BackUpManagement.Init({ deployId: process.argv[3] });
17
+ }
18
+ break;
19
+ case 'dns':
20
+ {
21
+ await Dns.InitIpDaemon({ deployId: process.argv[3] });
22
+ }
23
+ break;
24
+
25
+ case 'run': {
26
+ const confCronConfig = JSON.parse(fs.readFileSync(`./engine-private/conf/${process.argv[3]}/conf.cron.json`));
27
+ if (confCronConfig.jobs && Object.keys(confCronConfig.jobs).length > 0) {
28
+ shellExec(`node bin/deploy conf ${process.argv[3]} production`);
29
+ for (const job of Object.keys(confCronConfig.jobs)) {
30
+ if (confCronConfig.jobs[job].enabled) {
31
+ shellExec(Cmd.cron(process.argv[3], job, confCronConfig.jobs[job].expression));
32
+ netWorkCron.push({
33
+ deployId: process.argv[3],
34
+ jobId: job,
35
+ expression: confCronConfig.jobs[job].expression,
36
+ });
37
+ }
38
+ }
39
+ }
40
+ await saveRuntimeCron();
41
+ if (fs.existsSync(`./tmp/await-deploy`)) fs.remove(`./tmp/await-deploy`);
42
+ break;
43
+ }
44
+
45
+ default:
46
+ break;
47
+ }
package/bin/db.js CHANGED
@@ -26,14 +26,11 @@ try {
26
26
  // logger.info('database', confServer[host][`/${path}`].db);
27
27
  switch (provider) {
28
28
  case 'mariadb':
29
- // https://www.cyberciti.biz/faq/how-to-show-list-users-in-a-mysql-mariadb-database/
30
-
31
29
  // Login:
32
- // mysql -u root -p
33
- // mysql -u root -h localhost -p mysql
30
+ // mysql -u root -h localhost -p
34
31
 
35
32
  // Get Users:
36
- // SELECT host, user, password FROM mysql.user;
33
+ // SELECT user,authentication_string,plugin,host FROM mysql.user;
37
34
 
38
35
  // Get DB User:
39
36
  // SELECT User, Db, Host from mysql.db;
@@ -46,6 +43,27 @@ try {
46
43
  // Get all user privileges:
47
44
  // select * from information_schema.user_privileges;
48
45
 
46
+ // Expose public server:
47
+ // '/etc/mysql/my.cnf' Change lines:
48
+ // bind-address = 127.0.0.1 -> bind-address = 0.0.0.0
49
+ // skip-networking -> #skip-networking
50
+
51
+ // Create user:
52
+ // DROP USER 'username'@'%';
53
+ // CREATE USER 'username'@'%' IDENTIFIED BY 'password';
54
+
55
+ // Set DB user:
56
+ // FLUSH PRIVILEGES;
57
+ // ON databasename.*
58
+ // TO 'username'@'%'
59
+ // IDENTIFIED BY 'newpassword';
60
+ // FLUSH PRIVILEGES;
61
+
62
+ // Set admin:
63
+ // FLUSH PRIVILEGES;
64
+ // GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
65
+ // FLUSH PRIVILEGES;
66
+
49
67
  switch (operator) {
50
68
  case 'show-all':
51
69
  await MariaDB.query({ user, password, query: `SHOW DATABASES` });
@@ -60,8 +78,23 @@ try {
60
78
  await MariaDB.query({ user, password, query: `DROP DATABASE IF EXISTS ${name}` });
61
79
  break;
62
80
  case 'select':
63
- await MariaDB.query({ user, password, query: `SELECT ${arg0} FROM ${name}.${arg1}` });
81
+ {
82
+ const pageSize = 10;
83
+ const pageNumber = 1;
84
+ await MariaDB.query({
85
+ user,
86
+ password,
87
+ query: `SELECT ${arg0} FROM ${name}.${arg1} LIMIT ${pageSize} OFFSET ${(pageNumber - 1) * pageSize}`,
88
+ });
89
+ }
64
90
  break;
91
+ case 'count': {
92
+ await MariaDB.query({
93
+ user,
94
+ password,
95
+ query: `SELECT COUNT(*) AS total FROM ${name}.${arg0}`,
96
+ });
97
+ }
65
98
  case 'export':
66
99
  {
67
100
  const cmdBackupPath = `${arg0 ? `${arg0}/${name}.sql` : backupPath}`;
@@ -101,6 +134,18 @@ try {
101
134
  case 'init-lampp-service':
102
135
  await Lampp.initService();
103
136
  break;
137
+ case 'remote-client-access':
138
+ {
139
+ // https://docs.anaconda.com/miniconda/install/#quick-command-line-install
140
+ // https://mariadb.com/kb/en/configuring-mariadb-for-remote-client-access/
141
+ // conf: /opt/lampp/etc
142
+ // conf: /etc/mysql/my.cnf
143
+ // conf: /etc/mysql/mariadb.conf.d/50-server.cnf
144
+ // cli: /opt/lampp/bin/mysql
145
+ // cli: mysql -h 127.0.0.1
146
+ // select db: use db0;
147
+ }
148
+ break;
104
149
  default:
105
150
  break;
106
151
  }
@@ -113,7 +158,7 @@ try {
113
158
  case 'update':
114
159
  {
115
160
  await DataBaseProvider.load({ apis: [arg0], host, path, db });
116
- const models = DataBaseProvider.instance[`${host}${path}`].mongoose[getCapVariableName(arg0)];
161
+ const models = DataBaseProvider.instance[`${host}${path}`].mongoose.models[getCapVariableName(arg0)];
117
162
 
118
163
  const select = JSON.parse(arg1.replaceAll("'", `"`));
119
164
  const update = JSON.parse(arg2.replaceAll("'", `"`));
@@ -133,6 +178,7 @@ try {
133
178
  runValidators: true,
134
179
  });
135
180
  logger.info(`successfully updated doc`, doc._doc);
181
+ await DataBaseProvider.instance[`${host}${path}`].mongoose.close();
136
182
  } else throw new Error(`no doc found`);
137
183
  }
138
184
  break;
@@ -143,6 +189,13 @@ try {
143
189
  case 'create':
144
190
  break;
145
191
  case 'delete':
192
+ {
193
+ await DataBaseProvider.load({ apis: [arg0], host, path, db });
194
+ const models = DataBaseProvider.instance[`${host}${path}`].mongoose.models[getCapVariableName(arg0)];
195
+ await models.collection.drop();
196
+ logger.info(`successfully drop collection`, arg0);
197
+ await DataBaseProvider.instance[`${host}${path}`].mongoose.close();
198
+ }
146
199
  break;
147
200
  case 'export':
148
201
  // mongodump -d <database_name> -o <directory_backup>