underpost 2.8.866 → 2.8.871
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 +52 -36
- package/bin/build.js +1 -0
- package/bin/deploy.js +30 -1
- package/bin/file.js +3 -0
- package/bin/util.js +1 -56
- package/cli.md +88 -86
- package/conf.js +1 -1
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/mongo-express/deployment.yaml +12 -12
- package/manifests/maas/nvim.sh +91 -0
- package/package.json +1 -10
- package/src/api/file/file.service.js +28 -8
- package/src/api/user/user.router.js +24 -0
- package/src/api/user/user.service.js +3 -4
- package/src/cli/cluster.js +2 -13
- package/src/cli/cron.js +0 -1
- package/src/cli/db.js +0 -19
- package/src/cli/deploy.js +17 -26
- package/src/cli/fs.js +1 -0
- package/src/cli/index.js +1 -0
- package/src/cli/run.js +9 -2
- package/src/client/components/core/CalendarCore.js +1 -1
- package/src/client/components/core/CssCore.js +12 -0
- package/src/client/components/core/Docs.js +2 -2
- package/src/client/components/core/FullScreen.js +19 -28
- package/src/client/components/core/Input.js +1 -0
- package/src/client/components/core/Modal.js +66 -63
- package/src/client/components/core/ObjectLayerEngine.js +229 -4
- package/src/client/components/core/ObjectLayerEngineModal.js +441 -0
- package/src/client/components/core/Panel.js +4 -1
- package/src/client/components/core/PanelForm.js +1 -1
- package/src/client/components/core/Router.js +29 -25
- package/src/client/components/core/ToggleSwitch.js +15 -1
- package/src/client/components/core/VanillaJs.js +12 -13
- package/src/client/public/default/assets/mailer/api-user-default-avatar.png +0 -0
- package/src/index.js +1 -1
- package/src/server/client-build.js +3 -11
- package/src/server/client-icons.js +6 -78
- package/src/server/conf.js +20 -64
- package/src/server/process.js +2 -1
- package/test/api.test.js +3 -2
- package/bin/cyberia0.js +0 -78
package/README.md
CHANGED
|
@@ -27,12 +27,20 @@
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
30
38
|
|
|
31
39
|
|
|
32
40
|
<!-- badges -->
|
|
33
41
|
|
|
34
42
|
|
|
35
|
-
[](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.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.yml) [](https://www.npmjs.com/package/underpost) [](https://socket.dev/npm/package/underpost/overview/2.8.871) [](https://coveralls.io/github/underpostnet/engine?branch=master) [](https://www.npmjs.org/package/underpost) [](https://www.npmjs.com/package/underpost)
|
|
36
44
|
|
|
37
45
|
|
|
38
46
|
<!-- end-badges -->
|
|
@@ -48,6 +56,14 @@
|
|
|
48
56
|
|
|
49
57
|
|
|
50
58
|
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
51
67
|
|
|
52
68
|
|
|
53
69
|
</div>
|
|
@@ -94,44 +110,44 @@ Run dev client server
|
|
|
94
110
|
npm run dev
|
|
95
111
|
```
|
|
96
112
|
<!-- -->
|
|
97
|
-
## underpost ci/cd cli v2.8.
|
|
113
|
+
## underpost ci/cd cli v2.8.871
|
|
98
114
|
|
|
99
115
|
### Usage: `underpost [options] [command]`
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
Options:
|
|
119
|
+
-V, --version output the version number
|
|
120
|
+
-h, --help display help for command
|
|
104
121
|
|
|
105
122
|
Commands:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
123
|
+
new [options] <app-name> Initializes a new Underpost project with a predefined structure.
|
|
124
|
+
start [options] <deploy-id> [env] Initiates application servers, build pipelines, or other defined services based on the deployment ID.
|
|
125
|
+
clone [options] <uri> Clones a specified GitHub repository into the current directory.
|
|
126
|
+
pull [options] <path> <uri> Pulls the latest changes from a specified GitHub repository.
|
|
127
|
+
cmt [options] <path> <commit-type> [module-tag] [message] Manages commits to a GitHub repository, supporting various commit types and options.
|
|
128
|
+
push [options] <path> <uri> Pushes committed changes from a local repository to a remote GitHub repository.
|
|
129
|
+
env <deploy-id> [env] Sets environment variables and configurations related to a specific deployment ID.
|
|
130
|
+
config [options] <operator> [key] [value] Manages Underpost configurations using various operators.
|
|
131
|
+
root Displays the root path of the npm installation.
|
|
132
|
+
cluster [options] [pod-name] Manages Kubernetes clusters, defaulting to Kind cluster initialization.
|
|
133
|
+
deploy [options] [deploy-list] [env] Manages application deployments, defaulting to deploying development pods.
|
|
134
|
+
secret [options] <platform> Manages secrets for various platforms.
|
|
135
|
+
dockerfile-image-build [options] Builds a Docker image from a specified Dockerfile with various options for naming, saving, and loading.
|
|
136
|
+
dockerfile-pull-base-images [options] Pulls required Underpost Dockerfile base images and optionally loads them into clusters.
|
|
137
|
+
install Quickly imports Underpost npm dependencies by copying them.
|
|
138
|
+
db [options] <deploy-list> Manages database operations, including import, export, and collection management.
|
|
139
|
+
metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
|
|
140
|
+
script [options] <operator> <script-name> [script-value] Supports a variety of built-in Underpost global scripts, their preset lifecycle events, and arbitrary custom scripts.
|
|
141
|
+
cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
|
|
142
|
+
fs [options] [path] Manages file storage, defaulting to file upload operations.
|
|
143
|
+
test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
|
|
144
|
+
monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
|
|
145
|
+
ssh [options] Import and start ssh server and client based on current default deployment ID.
|
|
146
|
+
run [options] <runner-id> [path] Runs a script from the specified path.
|
|
147
|
+
lxd [options] Manages LXD containers and virtual machines.
|
|
148
|
+
baremetal [options] [workflow-id] [hostname] [ip-address] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
|
|
149
|
+
help [command] display help for command
|
|
150
|
+
|
|
134
151
|
```
|
|
135
|
-
|
|
152
|
+
|
|
136
153
|
<a target="_top" href="https://github.com/underpostnet/pwa-microservices-template/blob/master/cli.md">See complete CLI Docs here.</a>
|
|
137
|
-
|
package/bin/build.js
CHANGED
|
@@ -156,6 +156,7 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
|
|
|
156
156
|
switch (confName) {
|
|
157
157
|
case 'dd-cyberia':
|
|
158
158
|
fs.copyFileSync(`./bin/cyberia.js`, `${basePath}/bin/cyberia.js`);
|
|
159
|
+
fs.copyFileSync(`./bin/cyberia.js`, `${basePath}/bin/cyberia0.js`);
|
|
159
160
|
break;
|
|
160
161
|
|
|
161
162
|
default:
|
package/bin/deploy.js
CHANGED
|
@@ -28,6 +28,7 @@ import { DefaultConf } from '../conf.js';
|
|
|
28
28
|
import colors from 'colors';
|
|
29
29
|
import { program } from '../src/cli/index.js';
|
|
30
30
|
import { getLocalIPv4Address, ip } from '../src/server/dns.js';
|
|
31
|
+
import { timer } from '../src/client/components/core/CommonJs.js';
|
|
31
32
|
|
|
32
33
|
colors.enable();
|
|
33
34
|
|
|
@@ -367,6 +368,21 @@ try {
|
|
|
367
368
|
}
|
|
368
369
|
|
|
369
370
|
case 'version-build': {
|
|
371
|
+
shellExec(`node bin run kill 4001`);
|
|
372
|
+
shellExec(`node bin run kill 4002`);
|
|
373
|
+
shellExec(`node bin run kill 4003`);
|
|
374
|
+
shellExec(`npm run update-template`);
|
|
375
|
+
shellExec(`cd ../pwa-microservices-template && npm run build && timeout 5s npm run dev`, {
|
|
376
|
+
async: true,
|
|
377
|
+
});
|
|
378
|
+
await timer(5500);
|
|
379
|
+
const templateRunnerResult = fs.readFileSync(`../pwa-microservices-template/logs/start.js/all.log`, 'utf8');
|
|
380
|
+
logger.info('Test template runner result');
|
|
381
|
+
console.log(templateRunnerResult);
|
|
382
|
+
if (!templateRunnerResult || templateRunnerResult.toLowerCase().match('error')) {
|
|
383
|
+
logger.error('Test template runner result failed');
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
370
386
|
shellExec(`node bin/deploy clean-core-repo`);
|
|
371
387
|
shellCd(`/home/dd/engine`);
|
|
372
388
|
const originPackageJson = JSON.parse(fs.readFileSync(`package.json`, 'utf8'));
|
|
@@ -429,10 +445,23 @@ try {
|
|
|
429
445
|
shellExec(`node bin/deploy update-dependencies`);
|
|
430
446
|
shellExec(`auto-changelog`);
|
|
431
447
|
shellExec(`node bin/build dd`);
|
|
432
|
-
shellExec(`node bin deploy --kubeadm --build-manifest --sync --info-router --replicas 1 --node ${node} dd`);
|
|
433
448
|
shellExec(
|
|
434
449
|
`node bin deploy --kubeadm --build-manifest --sync --info-router --replicas 1 --node ${node} dd production`,
|
|
435
450
|
);
|
|
451
|
+
for (const deployId of fs.readFileSync(`./engine-private/deploy/dd.router`, 'utf8').split(`,`)) {
|
|
452
|
+
fs.copySync(
|
|
453
|
+
`./engine-private/conf/${deployId}/build/development/deployment.yaml`,
|
|
454
|
+
`./manifests/deployment/${deployId}-development/deployment.yaml`,
|
|
455
|
+
);
|
|
456
|
+
fs.copySync(
|
|
457
|
+
`./engine-private/conf/${deployId}/build/development/proxy.yaml`,
|
|
458
|
+
`./manifests/deployment/${deployId}-development/proxy.yaml`,
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
shellExec(`sudo rm -rf ./engine-private/conf/dd-default`);
|
|
462
|
+
shellExec(`node bin new --deploy-id dd-default`);
|
|
463
|
+
console.log(fs.existsSync(`./engine-private/conf/dd-default`));
|
|
464
|
+
shellExec(`sudo rm -rf ./engine-private/conf/dd-default`);
|
|
436
465
|
break;
|
|
437
466
|
}
|
|
438
467
|
|
package/bin/file.js
CHANGED
|
@@ -60,6 +60,8 @@ try {
|
|
|
60
60
|
else {
|
|
61
61
|
shellExec(`cd ${toPath} && git reset && git checkout . && git clean -f -d`);
|
|
62
62
|
shellExec(`underpost pull ${toPath} underpostnet/pwa-microservices-template`);
|
|
63
|
+
shellExec(`sudo rm -rf ${toPath}/engine-private`);
|
|
64
|
+
shellExec(`sudo rm -rf ${toPath}/logs`);
|
|
63
65
|
}
|
|
64
66
|
} else {
|
|
65
67
|
fs.removeSync(toPath);
|
|
@@ -94,6 +96,7 @@ try {
|
|
|
94
96
|
'./manifests/deployment/dd-template-development',
|
|
95
97
|
'bin/web3.js',
|
|
96
98
|
'bin/cyberia.js',
|
|
99
|
+
'bin/cyberia0.js',
|
|
97
100
|
]) {
|
|
98
101
|
if (fs.existsSync(deletePath)) fs.removeSync('../pwa-microservices-template/' + deletePath);
|
|
99
102
|
}
|
package/bin/util.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
import si from 'systeminformation';
|
|
3
3
|
import * as dir from 'path';
|
|
4
|
-
import { svg } from 'font-awesome-assets';
|
|
5
4
|
|
|
6
5
|
import { loggerFactory } from '../src/server/logger.js';
|
|
7
|
-
import { pbcopy
|
|
6
|
+
import { pbcopy } from '../src/server/process.js';
|
|
8
7
|
import { buildKindPorts } from '../src/server/conf.js';
|
|
9
|
-
import { FileFactory } from '../src/api/file/file.service.js';
|
|
10
|
-
import { faBase64Png, getBufferPngText } from '../src/server/client-icons.js';
|
|
11
|
-
import keyword_extractor from 'keyword-extractor';
|
|
12
8
|
|
|
13
9
|
const logger = loggerFactory(import.meta);
|
|
14
10
|
|
|
@@ -73,57 +69,6 @@ try {
|
|
|
73
69
|
cleanEmptyFoldersRecursively('./');
|
|
74
70
|
break;
|
|
75
71
|
|
|
76
|
-
case 'text-to-image': {
|
|
77
|
-
const buffer = await getBufferPngText({
|
|
78
|
-
text: process.argv[3],
|
|
79
|
-
textColor: process.argv[4],
|
|
80
|
-
bgColor: process.argv[5],
|
|
81
|
-
size: process.argv[6],
|
|
82
|
-
debugFilename: process.argv[7],
|
|
83
|
-
});
|
|
84
|
-
fs.writeFileSync(`./text-to-image.png`, buffer);
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
case 'fa-image':
|
|
88
|
-
const faId = process.argv[3] ? process.argv[3] : 'user';
|
|
89
|
-
const color = process.argv[4] ? process.argv[4] : '#5f5f5f';
|
|
90
|
-
const path = process.argv[5] ? process.argv[5] : './';
|
|
91
|
-
|
|
92
|
-
{
|
|
93
|
-
fs.writeFileSync(`./tmp/${faId}.svg`, svg(faId, color), 'utf8');
|
|
94
|
-
const data = fs.readFileSync(`./tmp/${faId}.svg`);
|
|
95
|
-
console.log(FileFactory.svg(data, `${faId}.svg`));
|
|
96
|
-
fs.removeSync(`${path}${faId}.svg`);
|
|
97
|
-
}
|
|
98
|
-
{
|
|
99
|
-
fs.writeFileSync(`${path}${faId}.png`, Buffer.from(faBase64Png(faId, 100, 100, color), 'base64'));
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
break;
|
|
103
|
-
|
|
104
|
-
case 'b64-image':
|
|
105
|
-
fs.writeFileSync('b64-image', `data:image/jpg;base64,${fs.readFileSync(process.argv[3]).toString('base64')}`);
|
|
106
|
-
break;
|
|
107
|
-
|
|
108
|
-
case 'get-keys': {
|
|
109
|
-
const sentence = fs.existsSync('./_')
|
|
110
|
-
? fs.readFileSync('./_', 'utf8')
|
|
111
|
-
: process.argv[3]
|
|
112
|
-
? process.argv[3]
|
|
113
|
-
: 'President Obama woke up Monday facing a Congressional defeat that many in both parties believed could hobble his presidency.';
|
|
114
|
-
|
|
115
|
-
// Extract the keywords
|
|
116
|
-
const extraction_result = keyword_extractor.extract(sentence, {
|
|
117
|
-
language: 'english',
|
|
118
|
-
remove_digits: true,
|
|
119
|
-
// return_changed_case: true,
|
|
120
|
-
// remove_duplicates: false,
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
console.log(extraction_result.join(', '));
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
72
|
case 'build-ports': {
|
|
128
73
|
pbcopy(buildKindPorts(process.argv[3], process.argv[4]));
|
|
129
74
|
}
|