underpost 2.6.2
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/.dockerignore +14 -0
- package/.env.development +8 -0
- package/.env.production +8 -0
- package/.env.test +8 -0
- package/.nycrc +9 -0
- package/.prettierignore +13 -0
- package/.prettierrc +9 -0
- package/.vscode/extensions.json +72 -0
- package/.vscode/settings.json +99 -0
- package/Dockerfile +88 -0
- package/LICENSE +21 -0
- package/README.md +51 -0
- package/bin/db.js +119 -0
- package/bin/deploy.js +600 -0
- package/bin/dns.js +1 -0
- package/bin/file.js +92 -0
- package/bin/help.js +110 -0
- package/bin/index.js +29 -0
- package/bin/install.js +357 -0
- package/bin/shortcut.js +44 -0
- package/bin/ssl.js +61 -0
- package/bin/util.js +182 -0
- package/bin/vs.js +35 -0
- package/conf.js +244 -0
- package/docker-compose.yml +67 -0
- package/jsconfig.json +7 -0
- package/jsdoc.json +32 -0
- package/nodemon.json +6 -0
- package/package.json +128 -0
- package/prometheus.yml +36 -0
- package/setup.sh +25 -0
- package/src/api/core/core.controller.js +69 -0
- package/src/api/core/core.model.js +11 -0
- package/src/api/core/core.router.js +23 -0
- package/src/api/core/core.service.js +29 -0
- package/src/api/crypto/crypto.controller.js +51 -0
- package/src/api/crypto/crypto.model.js +23 -0
- package/src/api/crypto/crypto.router.js +20 -0
- package/src/api/crypto/crypto.service.js +64 -0
- package/src/api/default/default.controller.js +69 -0
- package/src/api/default/default.model.js +20 -0
- package/src/api/default/default.router.js +23 -0
- package/src/api/default/default.service.js +31 -0
- package/src/api/file/file.controller.js +51 -0
- package/src/api/file/file.model.js +19 -0
- package/src/api/file/file.router.js +20 -0
- package/src/api/file/file.service.js +70 -0
- package/src/api/instance/instance.controller.js +69 -0
- package/src/api/instance/instance.model.js +36 -0
- package/src/api/instance/instance.router.js +33 -0
- package/src/api/instance/instance.service.js +48 -0
- package/src/api/test/test.controller.js +59 -0
- package/src/api/test/test.model.js +14 -0
- package/src/api/test/test.router.js +21 -0
- package/src/api/test/test.service.js +35 -0
- package/src/api/user/user.controller.js +70 -0
- package/src/api/user/user.model.js +65 -0
- package/src/api/user/user.router.js +345 -0
- package/src/api/user/user.service.js +479 -0
- package/src/api.js +23 -0
- package/src/client/Default.index.js +40 -0
- package/src/client/components/core/Account.js +290 -0
- package/src/client/components/core/AgGrid.js +160 -0
- package/src/client/components/core/Auth.js +19 -0
- package/src/client/components/core/Badge.js +32 -0
- package/src/client/components/core/BlockChain.js +41 -0
- package/src/client/components/core/Blog.js +9 -0
- package/src/client/components/core/BtnIcon.js +91 -0
- package/src/client/components/core/CalendarCore.js +319 -0
- package/src/client/components/core/Chat.js +64 -0
- package/src/client/components/core/ColorPalette.js +5267 -0
- package/src/client/components/core/CommonJs.js +708 -0
- package/src/client/components/core/Content.js +49 -0
- package/src/client/components/core/Css.js +1027 -0
- package/src/client/components/core/CssCore.js +792 -0
- package/src/client/components/core/D3Chart.js +44 -0
- package/src/client/components/core/Docs.js +130 -0
- package/src/client/components/core/DropDown.js +164 -0
- package/src/client/components/core/EventsUI.js +54 -0
- package/src/client/components/core/FileExplorer.js +624 -0
- package/src/client/components/core/FullScreen.js +45 -0
- package/src/client/components/core/Input.js +259 -0
- package/src/client/components/core/JoyStick.js +77 -0
- package/src/client/components/core/Keyboard.js +73 -0
- package/src/client/components/core/LoadingAnimation.js +157 -0
- package/src/client/components/core/LogIn.js +181 -0
- package/src/client/components/core/LogOut.js +52 -0
- package/src/client/components/core/Logger.js +26 -0
- package/src/client/components/core/Modal.js +1596 -0
- package/src/client/components/core/NotificationManager.js +84 -0
- package/src/client/components/core/Panel.js +413 -0
- package/src/client/components/core/Polyhedron.js +162 -0
- package/src/client/components/core/Recover.js +204 -0
- package/src/client/components/core/Responsive.js +53 -0
- package/src/client/components/core/RichText.js +27 -0
- package/src/client/components/core/Router.js +77 -0
- package/src/client/components/core/SignUp.js +125 -0
- package/src/client/components/core/SocketIo.js +72 -0
- package/src/client/components/core/Stream.js +113 -0
- package/src/client/components/core/ToggleSwitch.js +87 -0
- package/src/client/components/core/ToolTip.js +26 -0
- package/src/client/components/core/Translate.js +408 -0
- package/src/client/components/core/Validator.js +100 -0
- package/src/client/components/core/VanillaJs.js +454 -0
- package/src/client/components/core/Wallet.js +106 -0
- package/src/client/components/core/Webhook.js +25 -0
- package/src/client/components/core/Worker.js +272 -0
- package/src/client/components/default/CommonDefault.js +29 -0
- package/src/client/components/default/CssDefault.js +13 -0
- package/src/client/components/default/ElementsDefault.js +38 -0
- package/src/client/components/default/LogInDefault.js +41 -0
- package/src/client/components/default/LogOutDefault.js +28 -0
- package/src/client/components/default/MenuDefault.js +389 -0
- package/src/client/components/default/RoutesDefault.js +48 -0
- package/src/client/components/default/SettingsDefault.js +16 -0
- package/src/client/components/default/SignUpDefault.js +9 -0
- package/src/client/components/default/SocketIoDefault.js +54 -0
- package/src/client/components/default/TranslateDefault.js +7 -0
- 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-384x384.png +0 -0
- package/src/client/public/default/android-chrome-48x48.png +0 -0
- package/src/client/public/default/android-chrome-512x512.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-1024x1024.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152.png +0 -0
- package/src/client/public/default/apple-touch-icon-167x167.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72.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/apple-touch-startup-image-1125x2436.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1136x640.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1170x2532.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1179x2556.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1242x2208.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1242x2688.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1284x2778.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1290x2796.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1334x750.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1488x2266.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1536x2048.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1620x2160.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1640x2160.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1668x2224.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1668x2388.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1792x828.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2048x1536.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2048x2732.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2160x1620.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2160x1640.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2208x1242.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2224x1668.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2266x1488.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2388x1668.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2436x1125.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2532x1170.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2556x1179.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2688x1242.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2732x2048.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2778x1284.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2796x1290.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-640x1136.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-750x1334.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-828x1792.png +0 -0
- package/src/client/public/default/assets/background/white.jpg +0 -0
- package/src/client/public/default/assets/background/white0-min.jpg +0 -0
- package/src/client/public/default/assets/background/white0.jpg +0 -0
- package/src/client/public/default/assets/logo/base-icon.png +0 -0
- package/src/client/public/default/browserconfig.xml +12 -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-48x48.png +0 -0
- package/src/client/public/default/favicon.ico +0 -0
- package/src/client/public/default/manifest.webmanifest +69 -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/sitemap +148 -0
- package/src/client/public/default/yandex-browser-50x50.png +0 -0
- package/src/client/public/default/yandex-browser-manifest.json +9 -0
- package/src/client/public/doc/favicon.ico +0 -0
- package/src/client/public/doc/sitemap +148 -0
- package/src/client/public/test/favicon.ico +0 -0
- package/src/client/public/test/sitemap +148 -0
- package/src/client/services/core/core.service.js +152 -0
- package/src/client/services/crypto/crypto.service.js +70 -0
- package/src/client/services/default/default.management.js +345 -0
- package/src/client/services/default/default.service.js +89 -0
- package/src/client/services/file/file.service.js +70 -0
- package/src/client/services/instance/instance.management.js +74 -0
- package/src/client/services/instance/instance.service.js +89 -0
- package/src/client/services/test/test.service.js +70 -0
- package/src/client/services/user/user.management.js +50 -0
- package/src/client/services/user/user.service.js +89 -0
- package/src/client/ssr/Render.js +16 -0
- package/src/client/ssr/body-components/CacheControl.js +113 -0
- package/src/client/ssr/body-components/DefaultSplashScreen.js +79 -0
- package/src/client/ssr/email-components/DefaultRecoverEmail.js +21 -0
- package/src/client/ssr/email-components/DefaultVerifyEmail.js +17 -0
- package/src/client/ssr/head-components/Css.js +241 -0
- package/src/client/ssr/head-components/DefaultScripts.js +3 -0
- package/src/client/ssr/head-components/Microdata.js +11 -0
- package/src/client/ssr/head-components/Production.js +1 -0
- package/src/client/ssr/head-components/PwaDefault.js +60 -0
- package/src/client/ssr/head-components/Seo.js +14 -0
- package/src/client/sw/default.sw.js +201 -0
- package/src/client/sw/template.sw.js +84 -0
- package/src/client.build.js +22 -0
- package/src/client.dev.js +21 -0
- package/src/cron.js +25 -0
- package/src/db/DataBaseProvider.js +34 -0
- package/src/db/mariadb/MariaDB.js +33 -0
- package/src/db/mongo/MongooseDB.js +46 -0
- package/src/dns.js +22 -0
- package/src/mailer/EmailRender.js +69 -0
- package/src/mailer/MailerProvider.js +96 -0
- package/src/proxy.js +22 -0
- package/src/runtime/lampp/Lampp.js +44 -0
- package/src/runtime/nginx/Nginx.js +3 -0
- package/src/runtime/xampp/Xampp.js +49 -0
- package/src/server/auth.js +204 -0
- package/src/server/backup.js +83 -0
- package/src/server/client-build-live.js +72 -0
- package/src/server/client-build.js +688 -0
- package/src/server/client-dev-server.js +58 -0
- package/src/server/client-formatted.js +48 -0
- package/src/server/client-icons.js +150 -0
- package/src/server/conf.js +611 -0
- package/src/server/dns.js +87 -0
- package/src/server/downloader.js +42 -0
- package/src/server/logger.js +135 -0
- package/src/server/network.js +122 -0
- package/src/server/peer.js +33 -0
- package/src/server/process.js +66 -0
- package/src/server/proxy.js +118 -0
- package/src/server/runtime.js +393 -0
- package/src/server/ssl.js +107 -0
- package/src/server.js +25 -0
- package/src/ws/IoInterface.js +45 -0
- package/src/ws/IoServer.js +39 -0
- package/src/ws/core/channels/core.ws.chat.js +23 -0
- package/src/ws/core/channels/core.ws.mailer.js +35 -0
- package/src/ws/core/channels/core.ws.stream.js +31 -0
- package/src/ws/core/core.ws.connection.js +28 -0
- package/src/ws/core/core.ws.emit.js +14 -0
- package/src/ws/core/core.ws.server.js +24 -0
- package/src/ws/core/management/core.ws.chat.js +8 -0
- package/src/ws/core/management/core.ws.mailer.js +16 -0
- package/src/ws/core/management/core.ws.stream.js +8 -0
- package/src/ws/default/channels/default.ws.main.js +16 -0
- package/src/ws/default/default.ws.connection.js +22 -0
- package/src/ws/default/default.ws.emit.js +14 -0
- package/src/ws/default/default.ws.server.js +20 -0
- package/src/ws/default/management/default.ws.main.js +8 -0
- package/startup.js +11 -0
- package/supervisord-openssh-server.conf +5 -0
- package/test/api.test.js +60 -0
package/bin/util.js
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import merge from 'deepmerge';
|
|
3
|
+
import si from 'systeminformation';
|
|
4
|
+
import * as dir from 'path';
|
|
5
|
+
import { svg } from 'font-awesome-assets';
|
|
6
|
+
|
|
7
|
+
import { loggerFactory } from '../src/server/logger.js';
|
|
8
|
+
import { shellCd, shellExec } from '../src/server/process.js';
|
|
9
|
+
import { range, s4 } from '../src/client/components/core/CommonJs.js';
|
|
10
|
+
import { network } from '../src/server/network.js';
|
|
11
|
+
import { Config } from '../src/server/conf.js';
|
|
12
|
+
import { FileFactory } from '../src/api/file/file.service.js';
|
|
13
|
+
import { buildTextImg, faBase64Png, getBufferPngText } from '../src/server/client-icons.js';
|
|
14
|
+
|
|
15
|
+
const logger = loggerFactory(import.meta);
|
|
16
|
+
|
|
17
|
+
logger.info('argv', process.argv);
|
|
18
|
+
|
|
19
|
+
const operator = process.argv[2];
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
// let cmd;
|
|
23
|
+
switch (operator) {
|
|
24
|
+
case 'cls':
|
|
25
|
+
fs.removeSync('./public');
|
|
26
|
+
fs.removeSync('./logs');
|
|
27
|
+
fs.removeSync('./conf');
|
|
28
|
+
// fs.removeSync('./engine-private');
|
|
29
|
+
// fs.removeSync('./node_modules');
|
|
30
|
+
break;
|
|
31
|
+
case 'log':
|
|
32
|
+
(() => {
|
|
33
|
+
const logPath = `./logs/${process.argv[3]}/${process.argv[4]}.log`;
|
|
34
|
+
logger.info('Read', logPath);
|
|
35
|
+
console.log(fs.readFileSync(logPath, 'utf8'));
|
|
36
|
+
})();
|
|
37
|
+
break;
|
|
38
|
+
case 'kill-ports':
|
|
39
|
+
if (!process.argv[3]) process.argv[3] = '22,80,443,3000-3020';
|
|
40
|
+
for (const port of process.argv[3].split(',')) {
|
|
41
|
+
const rangePort = port.split('-');
|
|
42
|
+
if (rangePort[1])
|
|
43
|
+
for (const port of range(parseInt(rangePort[0]), parseInt(rangePort[1]))) {
|
|
44
|
+
logger.info('clean port', port);
|
|
45
|
+
await network.port.portClean(port);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
logger.info('clean port', parseInt(port));
|
|
49
|
+
await network.port.portClean(port);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
case 'system-info':
|
|
54
|
+
await (async () => {
|
|
55
|
+
for (const infoKey of Object.keys(si)) {
|
|
56
|
+
if (typeof si[infoKey] === 'function') {
|
|
57
|
+
// 'dockerInfo', 'vboxInfo'
|
|
58
|
+
if (!['osInfo', 'graphics', 'cpu'].includes(infoKey)) continue;
|
|
59
|
+
try {
|
|
60
|
+
const infoInstance = await si[infoKey]();
|
|
61
|
+
logger.info(infoKey, infoInstance);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
logger.info('Not valid info function', infoKey);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
})();
|
|
68
|
+
break;
|
|
69
|
+
case 'export-git-changes':
|
|
70
|
+
{
|
|
71
|
+
const baseFrom = process.argv[3];
|
|
72
|
+
const baseTo = process.argv[4];
|
|
73
|
+
// if (fs.existsSync(baseTo)) fs.removeSync(baseTo);
|
|
74
|
+
shellCd(baseFrom);
|
|
75
|
+
{
|
|
76
|
+
try {
|
|
77
|
+
let output = shellExec('git status', { silent: true, stdout: true });
|
|
78
|
+
console.log('output:', output);
|
|
79
|
+
output = output
|
|
80
|
+
.split(`to discard changes in working directory)`)[1]
|
|
81
|
+
.split(`Untracked files:`)[0]
|
|
82
|
+
.split('modified:')
|
|
83
|
+
.map((c) => c.trim().replaceAll(`\n`, ''));
|
|
84
|
+
output[output.length - 1] = output[output.length - 1].split('no changes added to commit')[0];
|
|
85
|
+
output.shift();
|
|
86
|
+
for (const fromPath of output) {
|
|
87
|
+
const from = `${baseFrom}/${fromPath}`;
|
|
88
|
+
const to = `${baseTo}/${fromPath}`;
|
|
89
|
+
logger.info('Copy path', { from, to });
|
|
90
|
+
fs.copySync(from, to);
|
|
91
|
+
}
|
|
92
|
+
} catch (error) {
|
|
93
|
+
logger.error(error);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
{
|
|
97
|
+
try {
|
|
98
|
+
let output = shellExec('git status', { silent: true, stdout: true });
|
|
99
|
+
console.log('output:', output);
|
|
100
|
+
output = output
|
|
101
|
+
.split(`to include in what will be committed)`)[1]
|
|
102
|
+
.split(`no changes added to commit`)[0]
|
|
103
|
+
.split(`\n`)
|
|
104
|
+
.map((l) => l.trim())
|
|
105
|
+
.filter((l) => l);
|
|
106
|
+
|
|
107
|
+
for (const fromPath of output) {
|
|
108
|
+
const from = `${baseFrom}/${fromPath}`;
|
|
109
|
+
const to = `${baseTo}/${fromPath}`;
|
|
110
|
+
logger.info('Copy path', { from, to });
|
|
111
|
+
fs.copySync(from, to);
|
|
112
|
+
}
|
|
113
|
+
} catch (error) {
|
|
114
|
+
logger.error(error);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
case 'delete-empty-folder':
|
|
120
|
+
function cleanEmptyFoldersRecursively(folder) {
|
|
121
|
+
const isDir = fs.statSync(folder).isDirectory();
|
|
122
|
+
if (!isDir) return;
|
|
123
|
+
|
|
124
|
+
let files = fs.readdirSync(folder);
|
|
125
|
+
if (files.length > 0) {
|
|
126
|
+
files.forEach(function (file) {
|
|
127
|
+
const fullPath = dir.join(folder, file);
|
|
128
|
+
cleanEmptyFoldersRecursively(fullPath);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// re-evaluate files; after deleting subfolder
|
|
132
|
+
// we may have parent folder empty now
|
|
133
|
+
files = fs.readdirSync(folder);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (files.length === 0) {
|
|
137
|
+
console.log('removing: ', folder);
|
|
138
|
+
fs.rmdirSync(folder);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
cleanEmptyFoldersRecursively('./');
|
|
143
|
+
break;
|
|
144
|
+
|
|
145
|
+
case 'text-to-image': {
|
|
146
|
+
const buffer = await getBufferPngText({
|
|
147
|
+
text: process.argv[3],
|
|
148
|
+
textColor: process.argv[4],
|
|
149
|
+
bgColor: process.argv[5],
|
|
150
|
+
size: process.argv[6],
|
|
151
|
+
debugFilename: process.argv[7],
|
|
152
|
+
});
|
|
153
|
+
fs.writeFileSync(`./text-to-image.png`, buffer);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
case 'fa-image':
|
|
157
|
+
const faId = process.argv[3] ? process.argv[3] : 'user';
|
|
158
|
+
const color = process.argv[4] ? process.argv[4] : '#5f5f5f';
|
|
159
|
+
const path = process.argv[5] ? process.argv[5] : './';
|
|
160
|
+
|
|
161
|
+
{
|
|
162
|
+
fs.writeFileSync(`./tmp/${faId}.svg`, svg(faId, color), 'utf8');
|
|
163
|
+
const data = fs.readFileSync(`./tmp/${faId}.svg`);
|
|
164
|
+
console.log(FileFactory.svg(data, `${faId}.svg`));
|
|
165
|
+
fs.removeSync(`${path}${faId}.svg`);
|
|
166
|
+
}
|
|
167
|
+
{
|
|
168
|
+
fs.writeFileSync(`${path}${faId}.png`, Buffer.from(faBase64Png(faId, 100, 100, color), 'base64'));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
break;
|
|
172
|
+
|
|
173
|
+
case 'b64-image':
|
|
174
|
+
fs.writeFileSync('b64-image', `data:image/jpg;base64,${fs.readFileSync(process.argv[3]).toString('base64')}`);
|
|
175
|
+
break;
|
|
176
|
+
|
|
177
|
+
default:
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
} catch (error) {
|
|
181
|
+
logger.error(error, error.stack);
|
|
182
|
+
}
|
package/bin/vs.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import { shellExec } from '../src/server/process.js';
|
|
3
|
+
|
|
4
|
+
switch (process.argv[2]) {
|
|
5
|
+
case 'import':
|
|
6
|
+
{
|
|
7
|
+
const extensions = JSON.parse(fs.readFileSync(`./.vscode/extensions.json`, 'utf8'));
|
|
8
|
+
extensions.recommendations.map((extension) => {
|
|
9
|
+
if (extension) shellExec(`code --install-extension ${extension}`);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
break;
|
|
13
|
+
case 'export':
|
|
14
|
+
{
|
|
15
|
+
shellExec(`code --list-extensions > vs-extensions.txt`);
|
|
16
|
+
fs.writeFileSync(
|
|
17
|
+
`./.vscode/extensions.json`,
|
|
18
|
+
JSON.stringify(
|
|
19
|
+
{
|
|
20
|
+
recommendations: fs
|
|
21
|
+
.readFileSync(`./vs-extensions.txt`, 'utf8')
|
|
22
|
+
.split(`\n`)
|
|
23
|
+
.filter((ext) => ext.trim()),
|
|
24
|
+
},
|
|
25
|
+
null,
|
|
26
|
+
4,
|
|
27
|
+
),
|
|
28
|
+
'utf8',
|
|
29
|
+
);
|
|
30
|
+
fs.removeSync(`./vs-extensions.txt`);
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
default:
|
|
34
|
+
break;
|
|
35
|
+
}
|
package/conf.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
const DefaultConf = {
|
|
2
|
+
client: {
|
|
3
|
+
default: {
|
|
4
|
+
metadata: {
|
|
5
|
+
title: 'Default',
|
|
6
|
+
backgroundImage: './src/client/public/default/assets/background/white0-min.jpg',
|
|
7
|
+
},
|
|
8
|
+
components: {
|
|
9
|
+
core: [
|
|
10
|
+
'CommonJs',
|
|
11
|
+
'VanillaJs',
|
|
12
|
+
'Responsive',
|
|
13
|
+
'Keyboard',
|
|
14
|
+
'Translate',
|
|
15
|
+
'Modal',
|
|
16
|
+
'BtnIcon',
|
|
17
|
+
'Logger',
|
|
18
|
+
'Css',
|
|
19
|
+
'NotificationManager',
|
|
20
|
+
'ToggleSwitch',
|
|
21
|
+
'DropDown',
|
|
22
|
+
'LoadingAnimation',
|
|
23
|
+
'EventsUI',
|
|
24
|
+
'AgGrid',
|
|
25
|
+
'Input',
|
|
26
|
+
'Validator',
|
|
27
|
+
'SignUp',
|
|
28
|
+
'LogIn',
|
|
29
|
+
'LogOut',
|
|
30
|
+
'Router',
|
|
31
|
+
'Account',
|
|
32
|
+
'Auth',
|
|
33
|
+
'FullScreen',
|
|
34
|
+
'RichText',
|
|
35
|
+
'Blog',
|
|
36
|
+
'CalendarCore',
|
|
37
|
+
'D3Chart',
|
|
38
|
+
'Stream',
|
|
39
|
+
'SocketIo',
|
|
40
|
+
'Docs',
|
|
41
|
+
'Content',
|
|
42
|
+
'FileExplorer',
|
|
43
|
+
'Chat',
|
|
44
|
+
'Worker',
|
|
45
|
+
'CssCore',
|
|
46
|
+
'Wallet',
|
|
47
|
+
'Badge',
|
|
48
|
+
'ToolTip',
|
|
49
|
+
'Webhook',
|
|
50
|
+
'Recover',
|
|
51
|
+
],
|
|
52
|
+
default: [
|
|
53
|
+
'MenuDefault',
|
|
54
|
+
'RoutesDefault',
|
|
55
|
+
'ElementsDefault',
|
|
56
|
+
'CommonDefault',
|
|
57
|
+
'CssDefault',
|
|
58
|
+
'LogInDefault',
|
|
59
|
+
'LogOutDefault',
|
|
60
|
+
'SignUpDefault',
|
|
61
|
+
'TranslateDefault',
|
|
62
|
+
'SettingsDefault',
|
|
63
|
+
'SocketIoDefault',
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
views: [
|
|
67
|
+
{
|
|
68
|
+
path: '/',
|
|
69
|
+
title: 'Home',
|
|
70
|
+
client: 'Default',
|
|
71
|
+
ssr: 'Default',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
path: '/home',
|
|
75
|
+
title: 'Home',
|
|
76
|
+
client: 'Default',
|
|
77
|
+
ssr: 'Default',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
path: '/settings',
|
|
81
|
+
client: 'Default',
|
|
82
|
+
ssr: 'Default',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
path: '/log-in',
|
|
86
|
+
client: 'Default',
|
|
87
|
+
ssr: 'Default',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
path: '/sign-up',
|
|
91
|
+
client: 'Default',
|
|
92
|
+
ssr: 'Default',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
path: '/log-out',
|
|
96
|
+
client: 'Default',
|
|
97
|
+
ssr: 'Default',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
path: '/account',
|
|
101
|
+
client: 'Default',
|
|
102
|
+
ssr: 'Default',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
path: '/docs',
|
|
106
|
+
client: 'Default',
|
|
107
|
+
ssr: 'Default',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
path: '/recover',
|
|
111
|
+
client: 'Default',
|
|
112
|
+
ssr: 'Default',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
path: '/default-management',
|
|
116
|
+
client: 'Default',
|
|
117
|
+
ssr: 'Default',
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
dists: [
|
|
121
|
+
{
|
|
122
|
+
folder: './node_modules/@neodrag/vanilla/dist/min',
|
|
123
|
+
public_folder: '/dist/@neodrag-vanilla',
|
|
124
|
+
import_name: '@neodrag/vanilla',
|
|
125
|
+
import_name_build: '/dist/@neodrag-vanilla/index.js',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
folder: './node_modules/@fortawesome/fontawesome-free',
|
|
129
|
+
public_folder: '/dist/fontawesome',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
folder: './node_modules/sortablejs/modular',
|
|
133
|
+
public_folder: '/dist/sortablejs',
|
|
134
|
+
import_name: 'sortablejs',
|
|
135
|
+
import_name_build: '/dist/sortablejs/sortable.complete.esm.js',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
folder: './node_modules/validator',
|
|
139
|
+
public_folder: '/dist/validator',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
folder: './node_modules/@loadingio/css-spinner/entries',
|
|
143
|
+
public_folder: '/dist/loadingio',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
import_name: 'ag-grid-community',
|
|
147
|
+
import_name_build: '/dist/ag-grid-community/ag-grid-community.auto.complete.esm.min.js',
|
|
148
|
+
folder: './node_modules/ag-grid-community/dist',
|
|
149
|
+
public_folder: '/dist/ag-grid-community',
|
|
150
|
+
styles: './node_modules/ag-grid-community/styles',
|
|
151
|
+
public_styles_folder: '/styles/ag-grid-community',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
folder: './node_modules/socket.io/client-dist',
|
|
155
|
+
public_folder: '/dist/socket.io',
|
|
156
|
+
import_name: 'socket.io/client-dist/socket.io.esm.min.js',
|
|
157
|
+
import_name_build: '/dist/socket.io/socket.io.esm.min.js',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
folder: './node_modules/peerjs/dist',
|
|
161
|
+
public_folder: '/dist/peerjs',
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
services: ['default', 'core', 'user', 'test', 'file'],
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
ssr: {
|
|
168
|
+
Default: {
|
|
169
|
+
head: ['PwaDefault', 'Css', 'DefaultScripts'],
|
|
170
|
+
body: ['CacheControl', 'DefaultSplashScreen'],
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
server: {
|
|
174
|
+
'default.net': {
|
|
175
|
+
'/': {
|
|
176
|
+
client: 'default',
|
|
177
|
+
runtime: 'nodejs',
|
|
178
|
+
apis: ['default', 'core', 'user', 'test', 'file'],
|
|
179
|
+
origins: [],
|
|
180
|
+
minifyBuild: false,
|
|
181
|
+
iconsBuild: true,
|
|
182
|
+
lightBuild: false,
|
|
183
|
+
docsBuild: false,
|
|
184
|
+
ws: 'core',
|
|
185
|
+
peer: true,
|
|
186
|
+
proxy: [80, 443],
|
|
187
|
+
db: {
|
|
188
|
+
provider: 'mongoose',
|
|
189
|
+
host: 'mongodb://127.0.0.1:27017',
|
|
190
|
+
name: 'default',
|
|
191
|
+
},
|
|
192
|
+
mailer: {
|
|
193
|
+
sender: {
|
|
194
|
+
email: 'noreply@default.net',
|
|
195
|
+
name: 'Default',
|
|
196
|
+
},
|
|
197
|
+
transport: {
|
|
198
|
+
host: 'smtp.default.com',
|
|
199
|
+
port: 465,
|
|
200
|
+
secure: true,
|
|
201
|
+
auth: {
|
|
202
|
+
user: 'noreply@default.net',
|
|
203
|
+
pass: '',
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
templates: {
|
|
207
|
+
userVerifyEmail: 'DefaultVerifyEmail',
|
|
208
|
+
userRecoverEmail: 'DefaultRecoverEmail',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
'www.default.net': {
|
|
214
|
+
'/': {
|
|
215
|
+
client: null,
|
|
216
|
+
runtime: 'nodejs',
|
|
217
|
+
apis: [],
|
|
218
|
+
origins: [],
|
|
219
|
+
minifyBuild: false,
|
|
220
|
+
lightBuild: true,
|
|
221
|
+
proxy: [80, 443],
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
cron: {
|
|
226
|
+
ipDaemon: {
|
|
227
|
+
ip: null,
|
|
228
|
+
minutesTimeInterval: 3,
|
|
229
|
+
disabled: false,
|
|
230
|
+
},
|
|
231
|
+
records: {
|
|
232
|
+
A: [
|
|
233
|
+
{
|
|
234
|
+
host: 'example.com',
|
|
235
|
+
dns: 'dondominio',
|
|
236
|
+
api_key: '???',
|
|
237
|
+
user: '???',
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export { DefaultConf };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# https://docs.docker.com/compose/compose-file/compose-file-v3
|
|
2
|
+
# https://docs.docker.com/engine/reference/commandline/compose/
|
|
3
|
+
version: '3'
|
|
4
|
+
services:
|
|
5
|
+
prometheus:
|
|
6
|
+
image: prom/prometheus
|
|
7
|
+
ports:
|
|
8
|
+
- 9090:9090
|
|
9
|
+
volumes:
|
|
10
|
+
- ./prometheus_data:/prometheus
|
|
11
|
+
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
|
12
|
+
command:
|
|
13
|
+
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
14
|
+
networks:
|
|
15
|
+
- load-balancer
|
|
16
|
+
|
|
17
|
+
grafana:
|
|
18
|
+
image: grafana/grafana
|
|
19
|
+
ports:
|
|
20
|
+
- 3000:3000
|
|
21
|
+
volumes:
|
|
22
|
+
- ./grafana_data:/var/lib/grafana
|
|
23
|
+
# - ./grafana.ini:/etc/grafana/grafana.ini
|
|
24
|
+
networks:
|
|
25
|
+
- load-balancer
|
|
26
|
+
depends_on:
|
|
27
|
+
- prometheus
|
|
28
|
+
|
|
29
|
+
underpost-engine:
|
|
30
|
+
build:
|
|
31
|
+
dockerfile: ./Dockerfile
|
|
32
|
+
context: . # workdir path
|
|
33
|
+
# image: underpost-engine
|
|
34
|
+
# container_name: <name> ignore for replicas
|
|
35
|
+
ports:
|
|
36
|
+
- '22'
|
|
37
|
+
- '80' # host port allocated dynamically, host ports are unique independent of replicas
|
|
38
|
+
- '443'
|
|
39
|
+
- '3306'
|
|
40
|
+
- '27017'
|
|
41
|
+
- '4001-4002:3001'
|
|
42
|
+
- '3002-3020'
|
|
43
|
+
volumes:
|
|
44
|
+
- ./logs:/code/logs
|
|
45
|
+
deploy:
|
|
46
|
+
mode: replicated
|
|
47
|
+
replicas: 2
|
|
48
|
+
restart_policy:
|
|
49
|
+
condition: on-failure
|
|
50
|
+
delay: 5s
|
|
51
|
+
max_attempts: 3
|
|
52
|
+
window: 120s
|
|
53
|
+
resources:
|
|
54
|
+
limits:
|
|
55
|
+
cpus: '2'
|
|
56
|
+
memory: 400M
|
|
57
|
+
reservations:
|
|
58
|
+
cpus: '0.25'
|
|
59
|
+
memory: 20M
|
|
60
|
+
labels: # labels in Compose file instead of Dockerfile
|
|
61
|
+
engine.version: '2.6.2'
|
|
62
|
+
networks:
|
|
63
|
+
- load-balancer
|
|
64
|
+
|
|
65
|
+
networks:
|
|
66
|
+
load-balancer:
|
|
67
|
+
driver: bridge
|
package/jsconfig.json
ADDED
package/jsdoc.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tags": {
|
|
3
|
+
"allowUnknownTags": true,
|
|
4
|
+
"dictionaries": ["jsdoc"]
|
|
5
|
+
},
|
|
6
|
+
"source": {
|
|
7
|
+
"include": ["./src", "./package.json", "./README.md"],
|
|
8
|
+
"includePattern": ".js$",
|
|
9
|
+
"excludePattern": "(node_modules/|docs)"
|
|
10
|
+
},
|
|
11
|
+
"plugins": ["plugins/markdown", "plugins/summarize", "plugins/shout"],
|
|
12
|
+
"opts": {
|
|
13
|
+
"template": "node_modules/clean-jsdoc-theme",
|
|
14
|
+
"readme": "./README.md",
|
|
15
|
+
"recurse": true,
|
|
16
|
+
"destination": "./public/www.nexodev.org/docs/",
|
|
17
|
+
"encoding": "utf8",
|
|
18
|
+
"verbose": true,
|
|
19
|
+
"theme_opts": {
|
|
20
|
+
"default_theme": "light",
|
|
21
|
+
"search": true,
|
|
22
|
+
"title": "Nexodev - ERP, CRM Development & Cloud DevOps Services",
|
|
23
|
+
"homepageTitle": "Docs",
|
|
24
|
+
"favicon": "./public/www.nexodev.org/"
|
|
25
|
+
},
|
|
26
|
+
"tutorials": "./public/www.nexodev.org/docs/learn"
|
|
27
|
+
},
|
|
28
|
+
"markdown": {
|
|
29
|
+
"hardwrap": false,
|
|
30
|
+
"idInHeadings": true
|
|
31
|
+
}
|
|
32
|
+
}
|