underpost 2.8.82 → 2.8.85
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/.env.development +1 -0
- package/.env.production +1 -0
- package/.env.test +1 -0
- package/.github/workflows/{ghpkg.yml → ghpkg.ci.yml} +5 -5
- package/.github/workflows/{npmpkg.yml → npmpkg.ci.yml} +5 -5
- package/.github/workflows/{publish.yml → publish.ci.yml} +1 -1
- package/.github/workflows/{pwa-microservices-template.page.yml → pwa-microservices-template-page.cd.yml} +1 -1
- package/.github/workflows/{pwa-microservices-template.test.yml → pwa-microservices-template-test.ci.yml} +1 -1
- package/.vscode/extensions.json +1 -1
- package/.vscode/settings.json +0 -44
- package/README.md +62 -2
- package/bin/build.js +15 -5
- package/bin/deploy.js +42 -92
- package/bin/file.js +33 -9
- package/bin/vs.js +12 -4
- package/cli.md +90 -42
- package/conf.js +1 -1
- package/docker-compose.yml +1 -1
- package/manifests/deployment/dd-template-development/deployment.yaml +2 -2
- package/manifests/deployment/tensorflow/tf-gpu-test.yaml +65 -0
- package/manifests/maas/device-scan.sh +3 -3
- package/manifests/maas/gpu-diag.sh +19 -0
- package/manifests/maas/maas-setup.sh +10 -10
- package/manifests/maas/snap-clean.sh +26 -0
- package/package.json +4 -6
- package/src/api/user/user.router.js +24 -1
- package/src/api/user/user.service.js +1 -4
- package/src/cli/baremetal.js +105 -73
- package/src/cli/cloud-init.js +21 -12
- package/src/cli/cluster.js +227 -133
- package/src/cli/deploy.js +34 -0
- package/src/cli/index.js +28 -1
- package/src/cli/monitor.js +8 -12
- package/src/cli/repository.js +7 -4
- package/src/cli/run.js +367 -0
- package/src/cli/ssh.js +32 -0
- package/src/cli/test.js +1 -1
- package/src/client/Default.index.js +7 -3
- package/src/client/components/core/Account.js +1 -1
- package/src/client/components/core/Chat.js +1 -1
- package/src/client/components/core/CommonJs.js +24 -22
- package/src/client/components/core/Content.js +1 -5
- package/src/client/components/core/Css.js +258 -18
- package/src/client/components/core/CssCore.js +8 -8
- package/src/client/components/core/Docs.js +14 -61
- package/src/client/components/core/DropDown.js +137 -82
- package/src/client/components/core/EventsUI.js +92 -5
- package/src/client/components/core/LoadingAnimation.js +8 -15
- package/src/client/components/core/Modal.js +597 -136
- package/src/client/components/core/NotificationManager.js +2 -2
- package/src/client/components/core/ObjectLayerEngine.js +638 -0
- package/src/client/components/core/Panel.js +158 -34
- package/src/client/components/core/PanelForm.js +12 -3
- package/src/client/components/core/Recover.js +1 -1
- package/src/client/components/core/Router.js +77 -17
- package/src/client/components/core/SocketIo.js +3 -3
- package/src/client/components/core/Translate.js +6 -2
- package/src/client/components/core/VanillaJs.js +0 -3
- package/src/client/components/core/Worker.js +3 -1
- package/src/client/components/default/CssDefault.js +17 -3
- package/src/client/components/default/MenuDefault.js +264 -45
- package/src/client/components/default/RoutesDefault.js +6 -12
- package/src/client/public/default/android-chrome-144x144.png +0 -0
- package/src/client/public/default/android-chrome-192x192.png +0 -0
- package/src/client/public/default/android-chrome-256x256.png +0 -0
- package/src/client/public/default/android-chrome-36x36.png +0 -0
- package/src/client/public/default/android-chrome-48x48.png +0 -0
- package/src/client/public/default/android-chrome-72x72.png +0 -0
- package/src/client/public/default/android-chrome-96x96.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72.png +0 -0
- package/src/client/public/default/apple-touch-icon-76x76-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-76x76.png +0 -0
- package/src/client/public/default/apple-touch-icon-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon.png +0 -0
- package/src/client/public/default/assets/background/dark.jpg +0 -0
- package/src/client/public/default/assets/background/dark.svg +557 -0
- package/src/client/public/default/assets/logo/base-icon.png +0 -0
- package/src/client/public/default/assets/logo/underpost.gif +0 -0
- package/src/client/public/default/assets/mailer/api-user-check.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-invalid-token.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-recover.png +0 -0
- package/src/client/public/default/favicon-16x16.png +0 -0
- package/src/client/public/default/favicon-32x32.png +0 -0
- package/src/client/public/default/favicon.ico +0 -0
- package/src/client/public/default/mstile-144x144.png +0 -0
- package/src/client/public/default/mstile-150x150.png +0 -0
- package/src/client/public/default/mstile-310x150.png +0 -0
- package/src/client/public/default/mstile-310x310.png +0 -0
- package/src/client/public/default/mstile-70x70.png +0 -0
- package/src/client/public/default/safari-pinned-tab.svg +24 -0
- package/src/client/ssr/body/DefaultSplashScreen.js +2 -2
- package/src/index.js +34 -17
- package/src/monitor.js +24 -0
- package/src/runtime/lampp/Dockerfile +30 -39
- package/src/runtime/lampp/Lampp.js +11 -2
- package/src/server/client-build-docs.js +205 -0
- package/src/server/client-build.js +16 -166
- package/src/server/conf.js +18 -8
- package/src/server/process.js +16 -19
- package/src/server/valkey.js +102 -41
package/.env.development
CHANGED
package/.env.production
CHANGED
package/.env.test
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: CI | Publish github repository package
|
|
2
2
|
on:
|
|
3
3
|
push:
|
|
4
4
|
branches: ['master']
|
|
@@ -58,8 +58,8 @@ jobs:
|
|
|
58
58
|
- name: Set git global credentials
|
|
59
59
|
run: |
|
|
60
60
|
git config --global credential.helper ""
|
|
61
|
-
git config --global user.name '
|
|
62
|
-
git config --global user.email '
|
|
61
|
+
git config --global user.name 'underpostnet'
|
|
62
|
+
git config --global user.email 'fcoverdugoa@underpost.net'
|
|
63
63
|
|
|
64
64
|
- name: Clone and Push to github package repository
|
|
65
65
|
run: |
|
|
@@ -70,8 +70,8 @@ jobs:
|
|
|
70
70
|
git config --global --add safe.directory /__w/pwa-microservices-template/pwa-microservices-template
|
|
71
71
|
git remote set-url origin git@github.com:underpostnet/pwa-microservices-template-ghpkg.git
|
|
72
72
|
git init
|
|
73
|
-
git config user.name '
|
|
74
|
-
git config user.email '
|
|
73
|
+
git config user.name 'underpostnet'
|
|
74
|
+
git config user.email 'fcoverdugoa@underpost.net'
|
|
75
75
|
git add .
|
|
76
76
|
git status
|
|
77
77
|
underpost cmt . ci package-pwa-microservices-template-ghpkg 'Update github repo package'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: CI | Publish npm repository package
|
|
2
2
|
on:
|
|
3
3
|
push:
|
|
4
4
|
branches: ['master']
|
|
@@ -41,8 +41,8 @@ jobs:
|
|
|
41
41
|
- name: Set git global credentials
|
|
42
42
|
run: |
|
|
43
43
|
git config --global credential.helper ""
|
|
44
|
-
git config --global user.name '
|
|
45
|
-
git config --global user.email '
|
|
44
|
+
git config --global user.name 'underpostnet'
|
|
45
|
+
git config --global user.email 'fcoverdugoa@underpost.net'
|
|
46
46
|
|
|
47
47
|
- name: Clone github package repository
|
|
48
48
|
run: |
|
|
@@ -52,8 +52,8 @@ jobs:
|
|
|
52
52
|
cd ../pwa-microservices-template
|
|
53
53
|
git remote set-url origin git@github.com:underpostnet/pwa-microservices-template.git
|
|
54
54
|
git add .
|
|
55
|
-
git config user.name '
|
|
56
|
-
git config user.email '
|
|
55
|
+
git config user.name 'underpostnet'
|
|
56
|
+
git config user.email 'fcoverdugoa@underpost.net'
|
|
57
57
|
underpost cmt . ci package-pwa-microservices-template-ghpkg 'Update npm repo package'
|
|
58
58
|
underpost push . underpostnet/pwa-microservices-template
|
|
59
59
|
# cd ../engine
|
package/.vscode/extensions.json
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
"eamodio.gitlens",
|
|
7
7
|
"esbenp.prettier-vscode",
|
|
8
8
|
"formulahendry.code-runner",
|
|
9
|
-
"foxundermoon.shell-format",
|
|
10
9
|
"github.codespaces",
|
|
11
10
|
"github.vscode-github-actions",
|
|
12
11
|
"golang.go",
|
|
@@ -31,6 +30,7 @@
|
|
|
31
30
|
"scala-lang.scala",
|
|
32
31
|
"scala-lang.scala-snippets",
|
|
33
32
|
"scalameta.metals",
|
|
33
|
+
"shakram02.bash-beautify",
|
|
34
34
|
"shardulm94.trailing-spaces",
|
|
35
35
|
"streetsidesoftware.code-spell-checker",
|
|
36
36
|
"tamasfe.even-better-toml",
|
package/.vscode/settings.json
CHANGED
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"nexodev",
|
|
58
58
|
"pathfinding",
|
|
59
59
|
"Pixi",
|
|
60
|
-
"plantuml",
|
|
61
60
|
"privkey",
|
|
62
61
|
"runas",
|
|
63
62
|
"Scatterplot",
|
|
@@ -81,50 +80,7 @@
|
|
|
81
80
|
"[xml]": {
|
|
82
81
|
"editor.defaultFormatter": "redhat.vscode-xml"
|
|
83
82
|
},
|
|
84
|
-
"docwriter.style": "Auto-detect",
|
|
85
|
-
"docwriter.progress.trackFunctions": false,
|
|
86
|
-
"docwriter.progress.trackMethods": false,
|
|
87
|
-
"files.exclude": {
|
|
88
|
-
"**/.git": true, // this is a default value
|
|
89
|
-
"**/.DS_Store": true, // this is a default value
|
|
90
83
|
|
|
91
|
-
"**/node_modules": true, // this excludes all folders
|
|
92
|
-
// named "node_modules" from
|
|
93
|
-
// the explore tree
|
|
94
|
-
|
|
95
|
-
// alternative version
|
|
96
|
-
"node_modules": true, // this excludes the folder
|
|
97
|
-
// only from the root of
|
|
98
|
-
// your workspace
|
|
99
|
-
"public": true,
|
|
100
|
-
"engine-private": true,
|
|
101
|
-
"conf": true,
|
|
102
|
-
"tmp": true,
|
|
103
|
-
"bkt": true,
|
|
104
|
-
"logs": true,
|
|
105
|
-
"build": true,
|
|
106
|
-
"coverage": true,
|
|
107
|
-
"prometheus_data": true,
|
|
108
|
-
"grafana_data": true,
|
|
109
|
-
".nyc_output": true
|
|
110
|
-
},
|
|
111
|
-
"[solidity]": {
|
|
112
|
-
"editor.defaultFormatter": "JuanBlanco.solidity"
|
|
113
|
-
},
|
|
114
|
-
"[dockerfile]": {
|
|
115
|
-
"editor.defaultFormatter": "foxundermoon.shell-format"
|
|
116
|
-
},
|
|
117
|
-
"[ignore]": {
|
|
118
|
-
"editor.defaultFormatter": "foxundermoon.shell-format"
|
|
119
|
-
},
|
|
120
|
-
"docwriter.progress.trackTypes": true,
|
|
121
|
-
"docwriter.hotkey.mac": "⌘ + .",
|
|
122
|
-
"[dotenv]": {
|
|
123
|
-
"editor.defaultFormatter": "foxundermoon.shell-format"
|
|
124
|
-
},
|
|
125
|
-
"[shellscript]": {
|
|
126
|
-
"editor.defaultFormatter": "foxundermoon.shell-format"
|
|
127
|
-
},
|
|
128
84
|
"files.watcherExclude": {
|
|
129
85
|
"**/target": true
|
|
130
86
|
}
|
package/README.md
CHANGED
|
@@ -22,7 +22,65 @@ template
|
|
|
22
22
|
|
|
23
23
|
<div align="center">
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
<!-- badges -->
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
[](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.85) [](https://coveralls.io/github/underpostnet/engine?branch=master) [](https://www.npmjs.org/package/underpost) [](https://www.npmjs.com/package/underpost)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
<!-- end-badges -->
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
26
84
|
|
|
27
85
|
</div>
|
|
28
86
|
|
|
@@ -68,7 +126,7 @@ Run dev client server
|
|
|
68
126
|
npm run dev
|
|
69
127
|
```
|
|
70
128
|
<!-- -->
|
|
71
|
-
## underpost ci/cd cli v2.8.
|
|
129
|
+
## underpost ci/cd cli v2.8.85
|
|
72
130
|
|
|
73
131
|
### Usage: `underpost [options] [command]`
|
|
74
132
|
```
|
|
@@ -98,6 +156,8 @@ Commands:
|
|
|
98
156
|
fs [options] [path] Manages file storage, defaulting to file upload operations.
|
|
99
157
|
test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
|
|
100
158
|
monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
|
|
159
|
+
ssh [options] Import and start ssh server and client based on current default deployment ID.
|
|
160
|
+
run [options] <runner-id> [path] Runs a script from the specified path.
|
|
101
161
|
lxd [options] Manages LXD containers and virtual machines.
|
|
102
162
|
baremetal [options] [workflow-id] [hostname] [ip-address] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
|
|
103
163
|
help [command] display help for command
|
package/bin/build.js
CHANGED
|
@@ -53,7 +53,9 @@ if (process.argv.includes('conf')) {
|
|
|
53
53
|
fs.removeSync(toPath);
|
|
54
54
|
fs.mkdirSync(toPath, { recursive: true });
|
|
55
55
|
fs.copySync(`./engine-private/conf/${_confName}`, toPath);
|
|
56
|
-
if (fs.existsSync(
|
|
56
|
+
if (process.argv.includes('remove-replica') && fs.existsSync(`../${privateRepoName}/replica`)) {
|
|
57
|
+
fs.removeSync(`../${privateRepoName}/replica`);
|
|
58
|
+
} else if (fs.existsSync(`./engine-private/replica`)) {
|
|
57
59
|
const replicas = await fs.readdir(`./engine-private/replica`);
|
|
58
60
|
for (const replica of replicas)
|
|
59
61
|
if (replica.match(_confName))
|
|
@@ -150,10 +152,6 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
|
|
|
150
152
|
shellExec(`node bin/deploy update-default-conf ${confName}`);
|
|
151
153
|
|
|
152
154
|
fs.copyFileSync(`./conf.${confName}.js`, `${basePath}/conf.js`);
|
|
153
|
-
fs.copyFileSync(
|
|
154
|
-
`./.github/workflows/engine.${confName.split('dd-')[1]}.ci.yml`,
|
|
155
|
-
`${basePath}/.github/workflows/engine.${confName.split('dd-')[1]}.ci.yml`,
|
|
156
|
-
);
|
|
157
155
|
|
|
158
156
|
switch (confName) {
|
|
159
157
|
case 'dd-cyberia':
|
|
@@ -183,4 +181,16 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
|
|
|
183
181
|
fs.copyFileSync(`./manifests/deployment/${confName}-${env}/${file}`, `${basePath}/${file}`);
|
|
184
182
|
}
|
|
185
183
|
}
|
|
184
|
+
|
|
185
|
+
if (!fs.existsSync(`${basePath}/.github/workflows`))
|
|
186
|
+
fs.mkdirSync(`${basePath}/.github/workflows`, {
|
|
187
|
+
recursive: true,
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
fs.copyFileSync(`./.github/workflows/${repoName}.ci.yml`, `${basePath}/.github/workflows/${repoName}.ci.yml`);
|
|
191
|
+
fs.copyFileSync(`./.github/workflows/${repoName}.cd.yml`, `${basePath}/.github/workflows/${repoName}.cd.yml`);
|
|
192
|
+
|
|
193
|
+
if (fs.existsSync(`./src/ws/${confName.split('-')[1]}`)) {
|
|
194
|
+
fs.copySync(`./src/ws/${confName.split('-')[1]}`, `${basePath}/src/ws/${confName.split('-')[1]}`);
|
|
195
|
+
}
|
|
186
196
|
}
|
package/bin/deploy.js
CHANGED
|
@@ -531,74 +531,6 @@ try {
|
|
|
531
531
|
if (!proxyInstance) for (const host of Object.keys(serverConf)) port += Object.keys(serverConf[host]).length;
|
|
532
532
|
}
|
|
533
533
|
break;
|
|
534
|
-
case 'uml':
|
|
535
|
-
{
|
|
536
|
-
shellExec(`node bin/deploy fix-uml ${process.argv.slice(3).join(' ')}`);
|
|
537
|
-
shellExec(`node bin/deploy build-uml ${process.argv.slice(3).join(' ')}`);
|
|
538
|
-
}
|
|
539
|
-
break;
|
|
540
|
-
|
|
541
|
-
case 'fix-uml': {
|
|
542
|
-
// required: java jdk-11.0.1
|
|
543
|
-
|
|
544
|
-
// comment:
|
|
545
|
-
// '--add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.trax="ALL-UNNAMED"'
|
|
546
|
-
// in plantuml.js src
|
|
547
|
-
|
|
548
|
-
// const deployId = process.argv[3];
|
|
549
|
-
// const clientId = process.argv[4];
|
|
550
|
-
// const folder = `./src/client/public/${clientId ? clientId : 'default'}/docs/plantuml`;
|
|
551
|
-
// const privateConfFolder = `./engine-private/conf/${deployId}`;
|
|
552
|
-
// const confData = !deployId
|
|
553
|
-
// ? Config.default
|
|
554
|
-
// : {
|
|
555
|
-
// client: JSON.parse(fs.readFileSync(`${privateConfFolder}/conf.client.json`, 'utf8')),
|
|
556
|
-
// ssr: JSON.parse(fs.readFileSync(`${privateConfFolder}/conf.ssr.json`, 'utf8')),
|
|
557
|
-
// server: JSON.parse(fs.readFileSync(`${privateConfFolder}/conf.server.json`, 'utf8')),
|
|
558
|
-
// cron: JSON.parse(fs.readFileSync(`${privateConfFolder}/conf.cron.json`, 'utf8')),
|
|
559
|
-
// };
|
|
560
|
-
|
|
561
|
-
fs.writeFileSync(
|
|
562
|
-
`./node_modules/plantuml/lib/plantuml.js`,
|
|
563
|
-
fs
|
|
564
|
-
.readFileSync(`./node_modules/plantuml/lib/plantuml.js`, 'utf8')
|
|
565
|
-
.replace(`'--add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.trax="ALL-UNNAMED"'`, `//`),
|
|
566
|
-
);
|
|
567
|
-
}
|
|
568
|
-
case 'build-uml':
|
|
569
|
-
{
|
|
570
|
-
const plantuml = await import('plantuml');
|
|
571
|
-
const folder = process.argv[3] ? process.argv[3] : `./src/client/public/default/plantuml`;
|
|
572
|
-
const confData = Config.default;
|
|
573
|
-
|
|
574
|
-
if (!fs.existsSync(folder)) fs.mkdirSync(folder, { recursive: true });
|
|
575
|
-
|
|
576
|
-
for (const typeConf of Object.keys(confData)) {
|
|
577
|
-
logger.info(`generate ${typeConf} instance`);
|
|
578
|
-
try {
|
|
579
|
-
const svg = await plantuml(`
|
|
580
|
-
@startjson
|
|
581
|
-
${JSON.stringify(confData[typeConf])}
|
|
582
|
-
@endjson
|
|
583
|
-
`);
|
|
584
|
-
fs.writeFileSync(`${folder}/${typeConf}-conf.svg`, svg);
|
|
585
|
-
} catch (error) {
|
|
586
|
-
logger.error(error, error.stack);
|
|
587
|
-
}
|
|
588
|
-
logger.info(`generate ${typeConf} schema`);
|
|
589
|
-
try {
|
|
590
|
-
const svg = await plantuml(`
|
|
591
|
-
@startjson
|
|
592
|
-
${JSON.stringify(ejs(confData[typeConf]))}
|
|
593
|
-
@endjson
|
|
594
|
-
`);
|
|
595
|
-
fs.writeFileSync(`${folder}/${typeConf}-schema.svg`, svg);
|
|
596
|
-
} catch (error) {
|
|
597
|
-
logger.error(error, error.stack);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
break;
|
|
602
534
|
|
|
603
535
|
case 'build-single-replica': {
|
|
604
536
|
const deployId = process.argv[3];
|
|
@@ -682,6 +614,15 @@ try {
|
|
|
682
614
|
}
|
|
683
615
|
|
|
684
616
|
case 'version-build': {
|
|
617
|
+
shellCd(`/home/dd/engine`);
|
|
618
|
+
shellExec(`git reset`);
|
|
619
|
+
shellExec(`git checkout .`);
|
|
620
|
+
shellExec(`git clean -f -d`);
|
|
621
|
+
shellCd(`/home/dd/engine/engine-private`);
|
|
622
|
+
shellExec(`git reset`);
|
|
623
|
+
shellExec(`git checkout .`);
|
|
624
|
+
shellExec(`git clean -f -d`);
|
|
625
|
+
shellCd(`/home/dd/engine`);
|
|
685
626
|
const originPackageJson = JSON.parse(fs.readFileSync(`package.json`, 'utf8'));
|
|
686
627
|
const newVersion = process.argv[3] ?? originPackageJson.version;
|
|
687
628
|
const { version } = originPackageJson;
|
|
@@ -744,7 +685,7 @@ try {
|
|
|
744
685
|
fs.readFileSync(`./src/index.js`, 'utf8').replaceAll(`${version}`, `${newVersion}`),
|
|
745
686
|
'utf8',
|
|
746
687
|
);
|
|
747
|
-
shellExec(`node bin/deploy cli-docs`);
|
|
688
|
+
shellExec(`node bin/deploy cli-docs ${version} ${newVersion}`);
|
|
748
689
|
shellExec(`node bin/deploy update-dependencies`);
|
|
749
690
|
shellExec(`auto-changelog`);
|
|
750
691
|
shellExec(`node bin/build dd`);
|
|
@@ -863,7 +804,7 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
863
804
|
// mongodb-0.mongodb-service
|
|
864
805
|
DefaultConf.server[host][path].db.host = 'mongodb://mongodb-service:27017';
|
|
865
806
|
confName = '';
|
|
866
|
-
} else if (confName) {
|
|
807
|
+
} else if (confName && fs.existsSync(`./engine-private/conf/${confName}`)) {
|
|
867
808
|
DefaultConf.client = JSON.parse(fs.readFileSync(`./engine-private/conf/${confName}/conf.client.json`, 'utf8'));
|
|
868
809
|
DefaultConf.server = JSON.parse(fs.readFileSync(`./engine-private/conf/${confName}/conf.server.json`, 'utf8'));
|
|
869
810
|
DefaultConf.ssr = JSON.parse(fs.readFileSync(`./engine-private/conf/${confName}/conf.ssr.json`, 'utf8'));
|
|
@@ -894,6 +835,12 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
894
835
|
}
|
|
895
836
|
|
|
896
837
|
case 'ssh': {
|
|
838
|
+
// only import + start
|
|
839
|
+
// node bin/deploy ssh root@<host> <password> import
|
|
840
|
+
|
|
841
|
+
// generate + import + start
|
|
842
|
+
// node bin/deploy ssh root@<host> <password>
|
|
843
|
+
|
|
897
844
|
const host = process.argv[3] ?? `root@${await ip.public.ipv4()}`;
|
|
898
845
|
const domain = host.split('@')[1];
|
|
899
846
|
const user = 'root'; // host.split('@')[0];
|
|
@@ -966,7 +913,7 @@ EOF`);
|
|
|
966
913
|
// shellExec(`sudo echo "" > ~/.ssh/known_hosts`);
|
|
967
914
|
|
|
968
915
|
// ssh-copy-id -i ~/.ssh/id_rsa.pub -p <port_number> <username>@<host>
|
|
969
|
-
shellExec(`ssh-copy-id -i ~/.ssh/id_rsa.pub -p ${port} ${host}`);
|
|
916
|
+
// shellExec(`ssh-copy-id -i ~/.ssh/id_rsa.pub -p ${port} ${host}`);
|
|
970
917
|
// debug:
|
|
971
918
|
// shellExec(`ssh -vvv ${host}`);
|
|
972
919
|
|
|
@@ -1014,6 +961,29 @@ EOF`);
|
|
|
1014
961
|
break;
|
|
1015
962
|
}
|
|
1016
963
|
|
|
964
|
+
case 'maas-db': {
|
|
965
|
+
// DROP, ALTER, CREATE, WITH ENCRYPTED
|
|
966
|
+
// sudo -u <user> -h <host> psql <db-name>
|
|
967
|
+
shellExec(`DB_PG_MAAS_NAME=${process.env.DB_PG_MAAS_NAME}`);
|
|
968
|
+
shellExec(`DB_PG_MAAS_PASS=${process.env.DB_PG_MAAS_PASS}`);
|
|
969
|
+
shellExec(`DB_PG_MAAS_USER=${process.env.DB_PG_MAAS_USER}`);
|
|
970
|
+
shellExec(`DB_PG_MAAS_HOST=${process.env.DB_PG_MAAS_HOST}`);
|
|
971
|
+
shellExec(
|
|
972
|
+
`sudo -i -u postgres psql -c "CREATE USER \"$DB_PG_MAAS_USER\" WITH ENCRYPTED PASSWORD '$DB_PG_MAAS_PASS'"`,
|
|
973
|
+
);
|
|
974
|
+
shellExec(
|
|
975
|
+
`sudo -i -u postgres psql -c "ALTER USER \"$DB_PG_MAAS_USER\" WITH ENCRYPTED PASSWORD '$DB_PG_MAAS_PASS'"`,
|
|
976
|
+
);
|
|
977
|
+
const actions = ['LOGIN', 'SUPERUSER', 'INHERIT', 'CREATEDB', 'CREATEROLE', 'REPLICATION'];
|
|
978
|
+
shellExec(`sudo -i -u postgres psql -c "ALTER USER \"$DB_PG_MAAS_USER\" WITH ${actions.join(' ')}"`);
|
|
979
|
+
shellExec(`sudo -i -u postgres psql -c "\\du"`);
|
|
980
|
+
|
|
981
|
+
shellExec(`sudo -i -u postgres createdb -O "$DB_PG_MAAS_USER" "$DB_PG_MAAS_NAME"`);
|
|
982
|
+
|
|
983
|
+
shellExec(`sudo -i -u postgres psql -c "\\l"`);
|
|
984
|
+
break;
|
|
985
|
+
}
|
|
986
|
+
|
|
1017
987
|
case 'valkey': {
|
|
1018
988
|
if (!process.argv.includes('server')) {
|
|
1019
989
|
if (process.argv.includes('rocky')) {
|
|
@@ -1083,19 +1053,7 @@ EOF`);
|
|
|
1083
1053
|
}
|
|
1084
1054
|
|
|
1085
1055
|
case 'cli-docs': {
|
|
1086
|
-
buildCliDoc(program);
|
|
1087
|
-
break;
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
case 'monitor': {
|
|
1091
|
-
shellExec(
|
|
1092
|
-
`node bin monitor ${process.argv[6] === 'sync' ? '--sync ' : ''}--type ${process.argv[3]} ${process.argv[4]} ${
|
|
1093
|
-
process.argv[5]
|
|
1094
|
-
}`,
|
|
1095
|
-
{
|
|
1096
|
-
async: true,
|
|
1097
|
-
},
|
|
1098
|
-
);
|
|
1056
|
+
buildCliDoc(program, process.argv[3], process.argv[4]);
|
|
1099
1057
|
break;
|
|
1100
1058
|
}
|
|
1101
1059
|
|
|
@@ -1692,14 +1650,6 @@ nvidia/gpu-operator \
|
|
|
1692
1650
|
// sudo yum install sbt
|
|
1693
1651
|
break;
|
|
1694
1652
|
}
|
|
1695
|
-
|
|
1696
|
-
case 'chrony': {
|
|
1697
|
-
shellExec(`sudo dnf install chrony -y`);
|
|
1698
|
-
// debian chroot: sudo apt install chrony
|
|
1699
|
-
for (const cmd of chronySetUp(`/etc/chrony.conf`)) shellExec(cmd);
|
|
1700
|
-
|
|
1701
|
-
break;
|
|
1702
|
-
}
|
|
1703
1653
|
}
|
|
1704
1654
|
} catch (error) {
|
|
1705
1655
|
logger.error(error, error.stack);
|
package/bin/file.js
CHANGED
|
@@ -72,20 +72,14 @@ try {
|
|
|
72
72
|
|
|
73
73
|
if (type === 'update-template') {
|
|
74
74
|
fs.copySync(`./.vscode`, `../pwa-microservices-template/.vscode`);
|
|
75
|
-
fs.copySync(`./.github`, `../pwa-microservices-template/.github`);
|
|
75
|
+
// fs.copySync(`./.github`, `../pwa-microservices-template/.github`);
|
|
76
76
|
fs.copySync(`./src/client/public/default`, `../pwa-microservices-template/src/client/public/default`);
|
|
77
77
|
|
|
78
78
|
for (const checkoutPath of ['README.md', 'package-lock.json', 'package.json'])
|
|
79
79
|
shellExec(`cd ../pwa-microservices-template && git checkout ${checkoutPath}`);
|
|
80
80
|
|
|
81
81
|
for (const deletePath of [
|
|
82
|
-
'
|
|
83
|
-
'.github/workflows/docker-image.yml',
|
|
84
|
-
'.github/workflows/deploy.ssh.yml',
|
|
85
|
-
'.github/workflows/deploy.api-rest.yml',
|
|
86
|
-
'.github/workflows/engine.lampp.ci.yml',
|
|
87
|
-
'.github/workflows/engine.core.ci.yml',
|
|
88
|
-
'.github/workflows/engine.cyberia.ci.yml',
|
|
82
|
+
'./.github',
|
|
89
83
|
'./manifests/deployment/dd-lampp-development',
|
|
90
84
|
'./manifests/deployment/dd-cyberia-development',
|
|
91
85
|
'./manifests/deployment/dd-core-development',
|
|
@@ -94,6 +88,19 @@ try {
|
|
|
94
88
|
]) {
|
|
95
89
|
if (fs.existsSync(deletePath)) fs.removeSync('../pwa-microservices-template/' + deletePath);
|
|
96
90
|
}
|
|
91
|
+
|
|
92
|
+
fs.mkdirSync(`../pwa-microservices-template/.github/workflows`, {
|
|
93
|
+
recursive: true,
|
|
94
|
+
});
|
|
95
|
+
for (const _path of [
|
|
96
|
+
`./.github/workflows/pwa-microservices-template-page.cd.yml`,
|
|
97
|
+
`./.github/workflows/pwa-microservices-template-test.ci.yml`,
|
|
98
|
+
`./.github/workflows/npmpkg.ci.yml`,
|
|
99
|
+
`./.github/workflows/ghpkg.ci.yml`,
|
|
100
|
+
`./.github/workflows/publish.ci.yml`,
|
|
101
|
+
])
|
|
102
|
+
fs.copyFileSync(_path, `../pwa-microservices-template/${_path}`);
|
|
103
|
+
|
|
97
104
|
const originPackageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
|
98
105
|
const templatePackageJson = JSON.parse(fs.readFileSync('../pwa-microservices-template/package.json', 'utf8'));
|
|
99
106
|
|
|
@@ -136,10 +143,27 @@ try {
|
|
|
136
143
|
JSON.stringify(templatePackageLockJson, null, 4),
|
|
137
144
|
'utf8',
|
|
138
145
|
);
|
|
146
|
+
const badges = fs
|
|
147
|
+
.readFileSync(`./README.md`, 'utf8')
|
|
148
|
+
.split(`<!-- badges -->`)[1]
|
|
149
|
+
.split(`<!-- end-badges -->`)[0];
|
|
150
|
+
let originMd = fs.readFileSync(`../pwa-microservices-template/README.md`, 'utf8');
|
|
151
|
+
|
|
152
|
+
originMd =
|
|
153
|
+
originMd.split(`<!-- badges -->`)[0] +
|
|
154
|
+
`
|
|
155
|
+
<!-- badges -->
|
|
156
|
+
` +
|
|
157
|
+
badges +
|
|
158
|
+
`
|
|
159
|
+
<!-- end-badges -->
|
|
160
|
+
` +
|
|
161
|
+
originMd.split(`<!-- end-badges -->`)[1];
|
|
162
|
+
|
|
139
163
|
const splitKeyword = '## underpost ci/cd cli';
|
|
140
164
|
fs.writeFileSync(
|
|
141
165
|
`../pwa-microservices-template/README.md`,
|
|
142
|
-
|
|
166
|
+
originMd.split(`<!-- -->`)[0] +
|
|
143
167
|
`<!-- -->
|
|
144
168
|
${splitKeyword + fs.readFileSync(`./README.md`, 'utf8').split(splitKeyword)[1]}`,
|
|
145
169
|
'utf8',
|
package/bin/vs.js
CHANGED
|
@@ -4,7 +4,11 @@ import { loggerFactory } from '../src/server/logger.js';
|
|
|
4
4
|
|
|
5
5
|
const logger = loggerFactory(import.meta);
|
|
6
6
|
|
|
7
|
-
const vsCodeRootPath = '/root/.vscode-root';
|
|
7
|
+
// const vsCodeRootPath = '/root/.vscode-root';
|
|
8
|
+
// const vsProgram = 'code';
|
|
9
|
+
|
|
10
|
+
const vsCodeRootPath = '/root/.windsurf';
|
|
11
|
+
const vsProgram = 'windsurf';
|
|
8
12
|
|
|
9
13
|
switch (process.argv[2]) {
|
|
10
14
|
case 'info': {
|
|
@@ -31,13 +35,17 @@ switch (process.argv[2]) {
|
|
|
31
35
|
const extensions = JSON.parse(fs.readFileSync(`./.vscode/extensions.json`, 'utf8'));
|
|
32
36
|
extensions.recommendations.map((extension) => {
|
|
33
37
|
if (extension)
|
|
34
|
-
shellExec(
|
|
38
|
+
shellExec(
|
|
39
|
+
`sudo ${vsProgram} --user-data-dir="${vsCodeRootPath}" --no-sandbox --install-extension ${extension}`,
|
|
40
|
+
);
|
|
35
41
|
});
|
|
36
42
|
}
|
|
37
43
|
break;
|
|
38
44
|
case 'export':
|
|
39
45
|
{
|
|
40
|
-
shellExec(
|
|
46
|
+
shellExec(
|
|
47
|
+
`sudo ${vsProgram} --user-data-dir="${vsCodeRootPath}" --no-sandbox --list-extensions > vs-extensions.txt`,
|
|
48
|
+
);
|
|
41
49
|
fs.writeFileSync(
|
|
42
50
|
`./.vscode/extensions.json`,
|
|
43
51
|
JSON.stringify(
|
|
@@ -61,6 +69,6 @@ switch (process.argv[2]) {
|
|
|
61
69
|
break;
|
|
62
70
|
}
|
|
63
71
|
default:
|
|
64
|
-
shellExec(`sudo
|
|
72
|
+
shellExec(`sudo ${vsProgram} ${process.argv[2]} --user-data-dir="${vsCodeRootPath}" --no-sandbox`);
|
|
65
73
|
break;
|
|
66
74
|
}
|