underpost 2.8.84 → 2.8.86
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} +1 -1
- package/.github/workflows/{npmpkg.yml → npmpkg.ci.yml} +1 -1
- package/.github/workflows/{publish.yml → publish.ci.yml} +1 -1
- package/.github/workflows/{pwa-microservices-template.page.yml → pwa-microservices-template-page.cd.yml} +2 -2
- package/.github/workflows/{pwa-microservices-template.test.yml → pwa-microservices-template-test.ci.yml} +1 -1
- package/.github/workflows/release.cd.yml +37 -0
- package/.vscode/settings.json +0 -1
- package/README.md +16 -10
- package/bin/build.js +15 -5
- package/bin/cyberia0.js +78 -0
- package/bin/db.js +1 -3
- package/bin/deploy.js +29 -431
- package/bin/file.js +26 -9
- package/cli.md +102 -61
- package/conf.js +1 -1
- package/manifests/deployment/{dd-template-development → dd-default-development}/deployment.yaml +16 -16
- package/manifests/deployment/{dd-template-development → dd-default-development}/proxy.yaml +3 -3
- package/manifests/grafana/deployment.yaml +57 -0
- package/manifests/grafana/kustomization.yaml +7 -0
- package/manifests/grafana/pvc.yaml +12 -0
- package/manifests/grafana/service.yaml +14 -0
- package/manifests/maas/gpu-diag.sh +1 -1
- package/manifests/maas/ssh-cluster-info.sh +14 -0
- package/manifests/prometheus/deployment.yaml +82 -0
- package/package.json +4 -7
- package/src/api/user/user.router.js +24 -1
- package/src/api/user/user.service.js +9 -38
- package/src/cli/cluster.js +83 -29
- package/src/cli/cron.js +12 -45
- package/src/cli/db.js +149 -0
- package/src/cli/deploy.js +40 -81
- package/src/cli/index.js +29 -6
- package/src/cli/monitor.js +9 -16
- package/src/cli/repository.js +12 -5
- package/src/cli/run.js +175 -7
- package/src/cli/ssh.js +32 -0
- package/src/client/Default.index.js +7 -5
- package/src/client/components/core/Account.js +7 -3
- 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 +12 -12
- package/src/client/components/core/Css.js +262 -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/Input.js +6 -1
- package/src/client/components/core/LoadingAnimation.js +8 -15
- package/src/client/components/core/LogIn.js +3 -0
- package/src/client/components/core/LogOut.js +1 -1
- package/src/client/components/core/Modal.js +601 -137
- 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 +6 -3
- package/src/client/components/core/Router.js +77 -17
- package/src/client/components/core/Scroll.js +65 -120
- package/src/client/components/core/SignUp.js +1 -0
- 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 +48 -5
- 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 +266 -47
- package/src/client/components/default/RoutesDefault.js +8 -14
- 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 +9 -1
- package/src/mailer/MailerProvider.js +37 -0
- 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-live.js +1 -1
- package/src/server/client-build.js +16 -166
- package/src/server/client-dev-server.js +1 -1
- package/src/server/conf.js +14 -277
- package/src/server/proxy.js +1 -2
- package/src/server/start.js +3 -3
- package/src/server/valkey.js +102 -41
- package/docker-compose.yml +0 -67
- package/prometheus.yml +0 -36
package/.env.development
CHANGED
package/.env.production
CHANGED
package/.env.test
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Simple workflow for deploying static content to GitHub Pages
|
|
2
|
-
name:
|
|
2
|
+
name: CD | Gihub page | PWA Microservices Template
|
|
3
3
|
|
|
4
4
|
on:
|
|
5
5
|
# Runs on pushes targeting the default branch
|
|
@@ -54,7 +54,7 @@ jobs:
|
|
|
54
54
|
npm install -g underpost
|
|
55
55
|
npm install
|
|
56
56
|
node bin/deploy update-default-conf ghpkg
|
|
57
|
-
env-cmd -f .env.production node bin/deploy build-full-client github-pages underpostnet.github.io /pwa-microservices-template-ghpkg
|
|
57
|
+
env-cmd -f .env.production node bin/deploy build-full-client dd-github-pages underpostnet.github.io /pwa-microservices-template-ghpkg
|
|
58
58
|
# git lfs install
|
|
59
59
|
# git lfs track
|
|
60
60
|
# git lfs ls-files
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: CD | Release deployment | remote ssh
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ['CI | Publish npm package']
|
|
6
|
+
types:
|
|
7
|
+
- completed
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
after-publish:
|
|
11
|
+
if: github.repository == 'underpostnet/pwa-microservices-template' || startsWith(github.event.head_commit.message, 'cd(ssh-release)')
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Run remote deploy via SSH
|
|
15
|
+
uses: appleboy/ssh-action@v1.2.2
|
|
16
|
+
with:
|
|
17
|
+
# Remote host (secret)
|
|
18
|
+
host: ${{ secrets.SSH_HOST }}
|
|
19
|
+
# Remote user (secret)
|
|
20
|
+
username: ${{ secrets.SSH_USERNAME }}
|
|
21
|
+
# Private key (secret) — the PEM contents (not a path)
|
|
22
|
+
key: ${{ secrets.SSH_PRIV_KEY }}
|
|
23
|
+
# Remote port (optional)
|
|
24
|
+
port: ${{ secrets.SSH_PORT }}
|
|
25
|
+
# Optional: if your private key has a passphrase, add:
|
|
26
|
+
# passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }}
|
|
27
|
+
# Commands to run on the remote VM
|
|
28
|
+
script: |
|
|
29
|
+
set -e
|
|
30
|
+
echo "Starting remote release deploy"
|
|
31
|
+
cd /home/dd/engine
|
|
32
|
+
npm install -g underpost
|
|
33
|
+
underpost config set GITHUB_TOKEN ${{ secrets.GITHUB_TOKEN }}
|
|
34
|
+
node bin run --dev pull
|
|
35
|
+
underpost run secret
|
|
36
|
+
underpost run underpost-config
|
|
37
|
+
underpost run release-deploy
|
package/.vscode/settings.json
CHANGED
package/README.md
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://underpost.net/assets/splash/apple-touch-icon-precomposed.png" alt="underpost
|
|
2
|
+
<img src="https://underpost.net/assets/splash/apple-touch-icon-precomposed.png" alt="underpost engine core server"/>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<h1>underpost</h1>
|
|
8
8
|
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<div align="center">
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
<a target="_top" href='https://rockylinux.org/download'><img alt='rockylinux' src='https://img.shields.io/badge/Rocky Linux v9.6-100000?style=flat&logo=rockylinux&logoColor=white&labelColor=10b981&color=727273'/></a> <a target="_top" href='https://www.npmjs.com/package/npm/v/11.1.0' ><img alt='npm' src='https://img.shields.io/badge/npm v11.1.0-100000?style=flat&logo=npm&logoColor=white&labelColor=CB3837&color=727273'/></a> <a target="_top" href='https://nodejs.org/download/release/v22.9.0/' ><img alt='nodedotjs' src='https://img.shields.io/badge/node v23.8.0-100000?style=flat&logo=nodedotjs&logoColor=white&labelColor=5FA04E&color=727273'/></a> <a target="_top" href='https://pgp.mongodb.com/' ><img alt='mongodb' src='https://img.shields.io/badge/mongodb_server v7.0-100000?style=flat&logo=mongodb&logoColor=white&labelColor=47A248&color=727273'/></a>
|
|
14
14
|
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
17
|
<div align="center">
|
|
18
18
|
|
|
19
|
-
<a target="_top" href='https://rockylinux.org/download'><img alt='rockylinux' src='https://img.shields.io/badge/Rocky Linux v9.6-100000?style=flat&logo=rockylinux&logoColor=white&labelColor=10b981&color=727273'/></a> <a target="_top" href='https://www.npmjs.com/package/npm/v/11.1.0' ><img alt='npm' src='https://img.shields.io/badge/npm v11.1.0-100000?style=flat&logo=npm&logoColor=white&labelColor=CB3837&color=727273'/></a> <a target="_top" href='https://nodejs.org/download/release/v22.9.0/' ><img alt='nodedotjs' src='https://img.shields.io/badge/node v23.8.0-100000?style=flat&logo=nodedotjs&logoColor=white&labelColor=5FA04E&color=727273'/></a> <a target="_top" href='https://pgp.mongodb.com/' ><img alt='mongodb' src='https://img.shields.io/badge/mongodb_server v7.0-100000?style=flat&logo=mongodb&logoColor=white&labelColor=47A248&color=727273'/></a>
|
|
20
19
|
|
|
21
|
-
</div>
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
|
|
22
|
+
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
|
|
@@ -30,7 +29,7 @@ template
|
|
|
30
29
|
<!-- badges -->
|
|
31
30
|
|
|
32
31
|
|
|
33
|
-
[](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.86) [](https://coveralls.io/github/underpostnet/engine?branch=master) [](https://www.npmjs.org/package/underpost) [](https://www.npmjs.com/package/underpost)
|
|
34
33
|
|
|
35
34
|
|
|
36
35
|
<!-- end-badges -->
|
|
@@ -40,13 +39,18 @@ template
|
|
|
40
39
|
|
|
41
40
|
|
|
42
41
|
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
43
47
|
</div>
|
|
44
48
|
|
|
45
49
|
<div align="center">
|
|
46
50
|
|
|
47
51
|
#### Base template for pwa/api-rest projects.
|
|
48
52
|
|
|
49
|
-
Develop, build, deploy, test, monitor, and manage multiple runtime applications on virtual machines or container instances
|
|
53
|
+
<div style="font-size: 20px;"><em>End2end</em> continuous integration and continuous deployment cloud to applications federation tools. Develop, build, deploy, test, monitor, and manage multiple runtime applications on virtual machines or container instances.</div>
|
|
50
54
|
|
|
51
55
|
</div>
|
|
52
56
|
|
|
@@ -84,7 +88,7 @@ Run dev client server
|
|
|
84
88
|
npm run dev
|
|
85
89
|
```
|
|
86
90
|
<!-- -->
|
|
87
|
-
## underpost ci/cd cli v2.8.
|
|
91
|
+
## underpost ci/cd cli v2.8.86
|
|
88
92
|
|
|
89
93
|
### Usage: `underpost [options] [command]`
|
|
90
94
|
```
|
|
@@ -93,7 +97,7 @@ npm run dev
|
|
|
93
97
|
-h, --help display help for command
|
|
94
98
|
|
|
95
99
|
Commands:
|
|
96
|
-
new <app-name>
|
|
100
|
+
new [options] <app-name> Initializes a new Underpost project with a predefined structure.
|
|
97
101
|
start [options] <deploy-id> [env] Initiates application servers, build pipelines, or other defined services based on the deployment ID.
|
|
98
102
|
clone [options] <uri> Clones a specified GitHub repository into the current directory.
|
|
99
103
|
pull [options] <path> <uri> Pulls the latest changes from a specified GitHub repository.
|
|
@@ -109,11 +113,13 @@ Commands:
|
|
|
109
113
|
dockerfile-pull-base-images [options] Pulls required Underpost Dockerfile base images and optionally loads them into clusters.
|
|
110
114
|
install Quickly imports Underpost npm dependencies by copying them.
|
|
111
115
|
db [options] <deploy-list> Manages database operations, including import, export, and collection management.
|
|
116
|
+
metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
|
|
112
117
|
script [options] <operator> <script-name> [script-value] Supports a variety of built-in Underpost global scripts, their preset lifecycle events, and arbitrary custom scripts.
|
|
113
118
|
cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
|
|
114
119
|
fs [options] [path] Manages file storage, defaulting to file upload operations.
|
|
115
120
|
test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
|
|
116
121
|
monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
|
|
122
|
+
ssh [options] Import and start ssh server and client based on current default deployment ID.
|
|
117
123
|
run [options] <runner-id> [path] Runs a script from the specified path.
|
|
118
124
|
lxd [options] Manages LXD containers and virtual machines.
|
|
119
125
|
baremetal [options] [workflow-id] [hostname] [ip-address] Manages baremetal server operations, including installation, database setup, commissioning, and user management.
|
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/cyberia0.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#! /usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import dotenv from 'dotenv';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import fs from 'fs-extra';
|
|
6
|
+
import { pbcopy, shellExec } from '../src/server/process.js';
|
|
7
|
+
import Jimp from 'jimp';
|
|
8
|
+
import Underpost from '../src/index.js';
|
|
9
|
+
import { loggerFactory } from '../src/server/logger.js';
|
|
10
|
+
import { DataBaseProvider } from '../src/db/DataBaseProvider.js';
|
|
11
|
+
|
|
12
|
+
dotenv.config();
|
|
13
|
+
|
|
14
|
+
const logger = loggerFactory(import.meta);
|
|
15
|
+
|
|
16
|
+
const deployId = process.env.DEFAULT_DEPLOY_ID;
|
|
17
|
+
const host = process.env.DEFAULT_DEPLOY_HOST;
|
|
18
|
+
const path = process.env.DEFAULT_DEPLOY_PATH;
|
|
19
|
+
|
|
20
|
+
const confServerPath = `./engine-private/conf/${deployId}/conf.server.json`;
|
|
21
|
+
const confServer = JSON.parse(fs.readFileSync(confServerPath, 'utf8'));
|
|
22
|
+
const { db } = confServer[host][path];
|
|
23
|
+
|
|
24
|
+
logger.info('env', {
|
|
25
|
+
deployId,
|
|
26
|
+
host,
|
|
27
|
+
path,
|
|
28
|
+
db,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
await DataBaseProvider.load({
|
|
32
|
+
apis: ['object-layer'],
|
|
33
|
+
host,
|
|
34
|
+
path,
|
|
35
|
+
db,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const ObjectLayer = DataBaseProvider.instance[`${host}${path}`].mongoose.models.ObjectLayer;
|
|
39
|
+
|
|
40
|
+
const program = new Command();
|
|
41
|
+
|
|
42
|
+
program.name('cyberia').description(`content generator cli ${Underpost.version}`).version(Underpost.version);
|
|
43
|
+
|
|
44
|
+
const pngDirectoryIteratorByObjectLayerType = async (
|
|
45
|
+
objectLayerType = 'skin',
|
|
46
|
+
callback = ({ path, objectLayerType, objectLayerId, direction, frame }) => {},
|
|
47
|
+
) => {
|
|
48
|
+
for (const objectLayerId of await fs.readdir(`./src/client/public/cyberia/assets/${objectLayerType}`)) {
|
|
49
|
+
for (const direction of await fs.readdir(
|
|
50
|
+
`./src/client/public/cyberia/assets/${objectLayerType}/${objectLayerId}`,
|
|
51
|
+
)) {
|
|
52
|
+
const dirFolder = `./src/client/public/cyberia/assets/${objectLayerType}/${objectLayerId}/${direction}`;
|
|
53
|
+
if (!fs.statSync(dirFolder).isDirectory()) continue;
|
|
54
|
+
for (const frame of await fs.readdir(dirFolder)) {
|
|
55
|
+
const imageFilePath = `./src/client/public/cyberia/assets/${objectLayerType}/${objectLayerId}/${direction}/${frame}`;
|
|
56
|
+
await callback({ path: imageFilePath, objectLayerType, objectLayerId, direction, frame });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
program
|
|
63
|
+
.command('ol')
|
|
64
|
+
.option('--import [object-layer-type]', 'Import object layer from type storage png image')
|
|
65
|
+
.action(async (options = { import: false }) => {
|
|
66
|
+
if (options.import) {
|
|
67
|
+
await pngDirectoryIteratorByObjectLayerType(
|
|
68
|
+
options.import,
|
|
69
|
+
async ({ path, objectLayerType, objectLayerId, direction, frame }) => {
|
|
70
|
+
console.log(path, { objectLayerType, objectLayerId, direction, frame });
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
await DataBaseProvider.instance[`${host}${path}`].mongoose.close();
|
|
75
|
+
})
|
|
76
|
+
.description('Object layer management');
|
|
77
|
+
|
|
78
|
+
program.parse();
|
package/bin/db.js
CHANGED
|
@@ -4,7 +4,7 @@ import { loggerFactory } from '../src/server/logger.js';
|
|
|
4
4
|
import { MariaDB } from '../src/db/mariadb/MariaDB.js';
|
|
5
5
|
import { Xampp } from '../src/runtime/xampp/Xampp.js';
|
|
6
6
|
import { Lampp } from '../src/runtime/lampp/Lampp.js';
|
|
7
|
-
import { getCapVariableName,
|
|
7
|
+
import { getCapVariableName, loadConf, splitFileFactory } from '../src/server/conf.js';
|
|
8
8
|
import { DataBaseProvider } from '../src/db/DataBaseProvider.js';
|
|
9
9
|
import { hashPassword } from '../src/server/auth.js';
|
|
10
10
|
|
|
@@ -104,7 +104,6 @@ try {
|
|
|
104
104
|
}
|
|
105
105
|
break;
|
|
106
106
|
case 'import':
|
|
107
|
-
shellExec(await getRestoreCronCmd({ host, path, conf: confServer, deployId }));
|
|
108
107
|
break;
|
|
109
108
|
case 'init-xampp-service':
|
|
110
109
|
await Xampp.initService();
|
|
@@ -182,7 +181,6 @@ try {
|
|
|
182
181
|
break;
|
|
183
182
|
case 'import':
|
|
184
183
|
// mongorestore -d <database_name> <directory_backup>
|
|
185
|
-
shellExec(await getRestoreCronCmd({ host, path, conf: confServer, deployId }));
|
|
186
184
|
break;
|
|
187
185
|
case 'init-service':
|
|
188
186
|
break;
|