underpost 2.8.31 → 2.8.42

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 (53) hide show
  1. package/.github/workflows/ghpkg.yml +10 -7
  2. package/.github/workflows/pwa-microservices-template.page.yml +10 -3
  3. package/.vscode/extensions.json +9 -0
  4. package/.vscode/settings.json +10 -4
  5. package/AUTHORS.md +16 -5
  6. package/CHANGELOG.md +8 -0
  7. package/Dockerfile +19 -26
  8. package/README.md +1 -1
  9. package/bin/build.js +283 -0
  10. package/bin/db.js +2 -24
  11. package/bin/deploy.js +59 -49
  12. package/bin/file.js +3 -2
  13. package/bin/index.js +34 -41
  14. package/bin/util.js +9 -89
  15. package/bin/vs.js +22 -0
  16. package/conf.js +27 -143
  17. package/docker-compose.yml +1 -1
  18. package/manifests/core/kustomization.yaml +11 -0
  19. package/manifests/kind-config.yaml +12 -0
  20. package/manifests/letsencrypt-prod.yaml +15 -0
  21. package/package.json +4 -33
  22. package/src/api/user/user.model.js +7 -2
  23. package/src/client/components/core/CalendarCore.js +3 -0
  24. package/src/client/components/core/CommonJs.js +25 -0
  25. package/src/client/components/core/Modal.js +5 -5
  26. package/src/client/components/core/Panel.js +3 -1
  27. package/src/client/components/core/Translate.js +16 -4
  28. package/src/client/components/core/Validator.js +9 -1
  29. package/src/client/services/default/default.management.js +4 -2
  30. package/src/index.js +8 -1
  31. package/src/runtime/lampp/Lampp.js +1 -13
  32. package/src/runtime/xampp/Xampp.js +0 -13
  33. package/src/server/auth.js +3 -3
  34. package/src/server/client-build.js +3 -13
  35. package/src/server/conf.js +294 -27
  36. package/src/server/dns.js +2 -3
  37. package/src/server/logger.js +10 -5
  38. package/src/server/network.js +0 -36
  39. package/src/server/process.js +1 -1
  40. package/src/server/project.js +39 -0
  41. package/src/server/proxy.js +4 -26
  42. package/src/server/runtime.js +6 -7
  43. package/manifests/test/underpost-engine-pod.yaml +0 -108
  44. package/src/server/prompt-optimizer.js +0 -28
  45. /package/manifests/{underpost-engine-backup-access.yaml → core/underpost-engine-backup-access.yaml} +0 -0
  46. /package/manifests/{underpost-engine-backup-pv-pvc.yaml → core/underpost-engine-backup-pv-pvc.yaml} +0 -0
  47. /package/manifests/{underpost-engine-headless-service.yaml → core/underpost-engine-headless-service.yaml} +0 -0
  48. /package/manifests/{underpost-engine-mongodb-backup-cronjob.yaml → core/underpost-engine-mongodb-backup-cronjob.yaml} +0 -0
  49. /package/manifests/{test → core}/underpost-engine-mongodb-configmap.yaml +0 -0
  50. /package/manifests/{underpost-engine-pv-pvc.yaml → core/underpost-engine-pv-pvc.yaml} +0 -0
  51. /package/manifests/{underpost-engine-statefulset.yaml → core/underpost-engine-statefulset.yaml} +0 -0
  52. /package/manifests/{test → deployment}/mongo-express.yaml +0 -0
  53. /package/manifests/{test → deployment}/phpmyadmin.yaml +0 -0
@@ -0,0 +1,39 @@
1
+ import { loadConf, newProject, repoClone, repoCommit, repoPull, repoPush } from './conf.js';
2
+
3
+ class Project {
4
+ constructor(repositoryName, version) {
5
+ return newProject(repositoryName, version);
6
+ }
7
+
8
+ static clone(gitUri = 'underpostnet/pwa-microservices-template') {
9
+ return repoClone(gitUri);
10
+ }
11
+
12
+ static useEnv(deployId = 'default', env = 'production') {
13
+ return loadConf(deployId, env);
14
+ }
15
+
16
+ static pull(repoPath = './', gitUri = 'underpostnet/pwa-microservices-template') {
17
+ return repoPull(repoPath, gitUri);
18
+ }
19
+
20
+ static commit(
21
+ repoPath = './',
22
+ commitType = 'feat',
23
+ subModule = '',
24
+ message = '',
25
+ options = {
26
+ copy: false,
27
+ info: false,
28
+ empty: false,
29
+ },
30
+ ) {
31
+ return repoCommit(repoPath, commitType, subModule, message, options);
32
+ }
33
+
34
+ static push(repoPath = './', gitUri = 'underpostnet/pwa-microservices-template') {
35
+ return repoPush(repoPath, gitUri);
36
+ }
37
+ }
38
+
39
+ export default Project;
@@ -5,10 +5,9 @@ import dotenv from 'dotenv';
5
5
 
6
6
  import { createProxyMiddleware } from 'http-proxy-middleware';
7
7
  import { loggerFactory, loggerMiddleware } from './logger.js';
8
- import { listenPortController, network } from './network.js';
9
- import { orderArrayFromAttrInt } from '../client/components/core/CommonJs.js';
8
+ import { listenPortController } from './network.js';
10
9
  import { createSslServer, sslRedirectMiddleware } from './ssl.js';
11
- import { buildProxyRouter, maintenanceMiddleware } from './conf.js';
10
+ import { buildPortProxyRouter, buildProxyRouter, maintenanceMiddleware } from './conf.js';
12
11
 
13
12
  dotenv.config();
14
13
 
@@ -16,7 +15,7 @@ const logger = loggerFactory(import.meta);
16
15
 
17
16
  const buildProxy = async () => {
18
17
  // default target
19
- await network.port.portClean(process.env.PORT);
18
+
20
19
  express().listen(process.env.PORT);
21
20
 
22
21
  const proxyRouter = buildProxyRouter();
@@ -57,27 +56,7 @@ const buildProxy = async () => {
57
56
  // '^/target-path': '/',
58
57
  },
59
58
  };
60
- if (!process.argv.includes('maintenance')) {
61
- // build router
62
- Object.keys(hosts).map((hostKey) => {
63
- let { host, path, target, proxy, peer } = hosts[hostKey];
64
- if (process.env.NODE_ENV === 'development') host = `localhost`;
65
-
66
- if (!proxy.includes(port)) return;
67
- const absoluteHost = [80, 443].includes(port)
68
- ? `${host}${path === '/' ? '' : path}`
69
- : `${host}:${port}${path === '/' ? '' : path}`;
70
-
71
- if (!(absoluteHost in options.router)) options.router[absoluteHost] = target;
72
- });
73
- if (Object.keys(options.router).length === 0) continue;
74
-
75
- // order router
76
- const router = {};
77
- for (const absoluteHostKey of orderArrayFromAttrInt(Object.keys(options.router), 'length'))
78
- router[absoluteHostKey] = options.router[absoluteHostKey];
79
- options.router = router;
80
- }
59
+ if (!process.argv.includes('maintenance')) options.router = buildPortProxyRouter(port, proxyRouter);
81
60
 
82
61
  const filter = false
83
62
  ? (pathname, req) => {
@@ -86,7 +65,6 @@ const buildProxy = async () => {
86
65
  }
87
66
  : proxyPath;
88
67
  app.use(proxyPath, createProxyMiddleware(filter, options));
89
- await network.port.portClean(port);
90
68
 
91
69
  switch (process.env.NODE_ENV) {
92
70
  case 'production':
@@ -9,7 +9,7 @@ import compression from 'compression';
9
9
 
10
10
  import { createServer } from 'http';
11
11
  import { getRootDirectory } from './process.js';
12
- import { network, listenPortController, saveRuntimeRouter, logRuntimeRouter, listenServerFactory } from './network.js';
12
+ import { listenPortController, saveRuntimeRouter, logRuntimeRouter, listenServerFactory } from './network.js';
13
13
  import { loggerFactory, loggerMiddleware } from './logger.js';
14
14
  import { getCapVariableName, newInstance } from '../client/components/core/CommonJs.js';
15
15
  import { Xampp } from '../runtime/xampp/Xampp.js';
@@ -295,7 +295,7 @@ export PATH=$PATH:/opt/lampp/bin`,
295
295
  logger.info('Build static server runtime', `${host}${path}`);
296
296
  currentPort += 2;
297
297
  const staticPort = newInstance(currentPort);
298
- await network.port.portClean(staticPort);
298
+
299
299
  await listenPortController(app, staticPort, runningData);
300
300
  currentPort++;
301
301
  continue;
@@ -346,7 +346,7 @@ export PATH=$PATH:/opt/lampp/bin`,
346
346
  // changeOrigin: true,
347
347
  // }),
348
348
  // );
349
- await network.port.portClean(port);
349
+
350
350
  await listenPortController(app, port, runningData);
351
351
  break;
352
352
  }
@@ -460,7 +460,7 @@ export PATH=$PATH:/opt/lampp/bin`,
460
460
  host,
461
461
  path,
462
462
  });
463
- await network.port.portClean(peerPort);
463
+
464
464
  await listenPortController(peerServer, peerPort, {
465
465
  runtime: 'nodejs',
466
466
  client: null,
@@ -470,7 +470,6 @@ export PATH=$PATH:/opt/lampp/bin`,
470
470
  });
471
471
  }
472
472
 
473
- await network.port.portClean(port);
474
473
  await listenPortController(server, port, runningData);
475
474
 
476
475
  break;
@@ -481,8 +480,8 @@ export PATH=$PATH:/opt/lampp/bin`,
481
480
  }
482
481
  }
483
482
 
484
- if (Xampp.enabled() && Xampp.router) await Xampp.initService({ daemon: true });
485
- if (Lampp.enabled() && Lampp.router) await Lampp.initService({ daemon: true });
483
+ if (Xampp.enabled() && Xampp.router) Xampp.initService();
484
+ if (Lampp.enabled() && Lampp.router) Lampp.initService();
486
485
 
487
486
  saveRuntimeRouter();
488
487
  logRuntimeRouter();
@@ -1,108 +0,0 @@
1
- apiVersion: v1
2
- kind: Pod
3
- metadata:
4
- annotations:
5
- engine.version: 2.8.1
6
- kompose.cmd: kompose convert
7
- kompose.version: 1.35.0 (9532ceef3)
8
- labels:
9
- io.kompose.service: underpost-engine
10
- name: underpost-engine
11
- spec:
12
- containers:
13
- - image: localhost/underpost-engine:v2.8.31
14
- imagePullPolicy: Never
15
- name: underpost-engine
16
- ports:
17
- - containerPort: 22
18
- protocol: TCP
19
- - containerPort: 22
20
- protocol: UDP
21
- - containerPort: 4013
22
- protocol: TCP
23
- - containerPort: 4013
24
- protocol: UDP
25
- - containerPort: 4014
26
- protocol: TCP
27
- - containerPort: 4014
28
- protocol: UDP
29
- - containerPort: 4015
30
- protocol: TCP
31
- - containerPort: 4015
32
- protocol: UDP
33
- - containerPort: 4016
34
- protocol: TCP
35
- - containerPort: 4016
36
- protocol: UDP
37
- - containerPort: 4017
38
- protocol: TCP
39
- - containerPort: 4017
40
- protocol: UDP
41
- - containerPort: 4018
42
- protocol: TCP
43
- - containerPort: 4018
44
- protocol: UDP
45
- - containerPort: 4019
46
- protocol: TCP
47
- - containerPort: 4019
48
- protocol: UDP
49
- - containerPort: 4020
50
- protocol: TCP
51
- - containerPort: 4020
52
- protocol: UDP
53
- - containerPort: 4021
54
- protocol: TCP
55
- - containerPort: 4021
56
- protocol: UDP
57
- - containerPort: 4022
58
- protocol: TCP
59
- - containerPort: 4022
60
- protocol: UDP
61
- - containerPort: 4023
62
- protocol: TCP
63
- - containerPort: 4023
64
- protocol: UDP
65
- - containerPort: 4024
66
- protocol: TCP
67
- - containerPort: 4024
68
- protocol: UDP
69
- - containerPort: 4025
70
- protocol: TCP
71
- - containerPort: 4025
72
- protocol: UDP
73
- - containerPort: 4026
74
- protocol: TCP
75
- - containerPort: 4026
76
- protocol: UDP
77
- - containerPort: 4027
78
- protocol: TCP
79
- - containerPort: 4027
80
- protocol: UDP
81
- - containerPort: 4028
82
- protocol: TCP
83
- - containerPort: 4028
84
- protocol: UDP
85
- - containerPort: 4029
86
- protocol: TCP
87
- - containerPort: 4029
88
- protocol: UDP
89
- - containerPort: 4030
90
- protocol: TCP
91
- - containerPort: 4030
92
- protocol: UDP
93
- - containerPort: 4031
94
- protocol: TCP
95
- - containerPort: 4031
96
- protocol: UDP
97
- - containerPort: 4032
98
- protocol: TCP
99
- - containerPort: 4032
100
- protocol: UDP
101
- resources:
102
- limits:
103
- cpu: '2'
104
- memory: '419430300'
105
- requests:
106
- cpu: 250m
107
- memory: '20971520'
108
- restartPolicy: OnFailure
@@ -1,28 +0,0 @@
1
- // https://github.com/xenova/transformers.js/blob/f43d3dd348fd7b293008802590bb3a1afa218dc7/src/models.js#L10
2
-
3
- import { AutoModelForSeq2SeqLM, AutoTokenizer } from '@xenova/transformers';
4
- import { loggerFactory } from './logger.js';
5
- import dotenv from 'dotenv';
6
-
7
- dotenv.config();
8
-
9
- const logger = loggerFactory(import.meta);
10
-
11
- const tokenizer = await AutoTokenizer.from_pretrained('Xenova/t5-small');
12
-
13
- const model = await AutoModelForSeq2SeqLM.from_pretrained('Xenova/t5-small');
14
-
15
- const prompt = 'translate English to German: I love transformers!';
16
-
17
- logger.info('input', { prompt });
18
-
19
- const tokenizerData = await tokenizer(prompt);
20
-
21
- const { input_ids } = tokenizerData;
22
-
23
- const outputs = await model.generate(input_ids);
24
-
25
- for (const output of outputs) {
26
- const decoded = tokenizer.decode(output, { skip_special_tokens: true });
27
- logger.info('decoded', { decoded });
28
- }
File without changes