underpost 2.8.85 → 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 -1
- package/.env.production +1 -1
- package/.env.test +1 -1
- package/.github/workflows/pwa-microservices-template-page.cd.yml +1 -1
- package/.github/workflows/release.cd.yml +37 -0
- package/README.md +7 -44
- package/bin/cyberia0.js +78 -0
- package/bin/db.js +1 -3
- package/bin/deploy.js +13 -350
- package/bin/file.js +11 -1
- package/cli.md +39 -19
- 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/ssh-cluster-info.sh +14 -0
- package/manifests/prometheus/deployment.yaml +82 -0
- package/package.json +1 -2
- package/src/api/user/user.service.js +8 -34
- package/src/cli/cluster.js +41 -2
- package/src/cli/cron.js +12 -45
- package/src/cli/db.js +149 -0
- package/src/cli/deploy.js +20 -81
- package/src/cli/index.js +20 -6
- package/src/cli/monitor.js +1 -4
- package/src/cli/repository.js +12 -5
- package/src/cli/run.js +77 -14
- package/src/client/Default.index.js +0 -2
- package/src/client/components/core/Account.js +6 -2
- package/src/client/components/core/Content.js +11 -7
- package/src/client/components/core/Css.js +5 -1
- package/src/client/components/core/Input.js +6 -1
- 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 +7 -4
- package/src/client/components/core/Recover.js +5 -2
- package/src/client/components/core/Scroll.js +65 -120
- package/src/client/components/core/SignUp.js +1 -0
- package/src/client/components/core/VanillaJs.js +48 -2
- package/src/client/components/default/MenuDefault.js +2 -2
- package/src/client/components/default/RoutesDefault.js +3 -3
- package/src/index.js +1 -1
- package/src/mailer/MailerProvider.js +37 -0
- package/src/server/client-build-live.js +1 -1
- package/src/server/client-dev-server.js +1 -1
- package/src/server/conf.js +2 -272
- package/src/server/proxy.js +1 -2
- package/src/server/start.js +3 -3
- package/docker-compose.yml +0 -67
- package/prometheus.yml +0 -36
package/.env.development
CHANGED
package/.env.production
CHANGED
package/.env.test
CHANGED
|
@@ -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/README.md
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
<div align="center">
|
|
12
|
-
|
|
13
|
-
template
|
|
7
|
+
<h1>underpost</h1>
|
|
14
8
|
|
|
15
9
|
</div>
|
|
16
10
|
|
|
@@ -27,22 +21,6 @@ template
|
|
|
27
21
|
|
|
28
22
|
|
|
29
23
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
24
|
|
|
47
25
|
|
|
48
26
|
|
|
@@ -51,7 +29,7 @@ template
|
|
|
51
29
|
<!-- badges -->
|
|
52
30
|
|
|
53
31
|
|
|
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://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)
|
|
55
33
|
|
|
56
34
|
|
|
57
35
|
<!-- end-badges -->
|
|
@@ -61,22 +39,6 @@ template
|
|
|
61
39
|
|
|
62
40
|
|
|
63
41
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
42
|
|
|
81
43
|
|
|
82
44
|
|
|
@@ -88,7 +50,7 @@ template
|
|
|
88
50
|
|
|
89
51
|
#### Base template for pwa/api-rest projects.
|
|
90
52
|
|
|
91
|
-
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>
|
|
92
54
|
|
|
93
55
|
</div>
|
|
94
56
|
|
|
@@ -126,7 +88,7 @@ Run dev client server
|
|
|
126
88
|
npm run dev
|
|
127
89
|
```
|
|
128
90
|
<!-- -->
|
|
129
|
-
## underpost ci/cd cli v2.8.
|
|
91
|
+
## underpost ci/cd cli v2.8.86
|
|
130
92
|
|
|
131
93
|
### Usage: `underpost [options] [command]`
|
|
132
94
|
```
|
|
@@ -135,7 +97,7 @@ npm run dev
|
|
|
135
97
|
-h, --help display help for command
|
|
136
98
|
|
|
137
99
|
Commands:
|
|
138
|
-
new <app-name>
|
|
100
|
+
new [options] <app-name> Initializes a new Underpost project with a predefined structure.
|
|
139
101
|
start [options] <deploy-id> [env] Initiates application servers, build pipelines, or other defined services based on the deployment ID.
|
|
140
102
|
clone [options] <uri> Clones a specified GitHub repository into the current directory.
|
|
141
103
|
pull [options] <path> <uri> Pulls the latest changes from a specified GitHub repository.
|
|
@@ -151,6 +113,7 @@ Commands:
|
|
|
151
113
|
dockerfile-pull-base-images [options] Pulls required Underpost Dockerfile base images and optionally loads them into clusters.
|
|
152
114
|
install Quickly imports Underpost npm dependencies by copying them.
|
|
153
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.
|
|
154
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.
|
|
155
118
|
cron [options] [deploy-list] [job-list] Manages cron jobs, including initialization, execution, and configuration updates.
|
|
156
119
|
fs [options] [path] Manages file storage, defaulting to file upload operations.
|
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;
|