underpost 2.8.0 → 2.8.31
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 +1 -0
- package/.github/workflows/ghpkg.yml +4 -4
- package/.vscode/extensions.json +8 -71
- package/.vscode/settings.json +2 -1
- package/CHANGELOG.md +55 -3
- package/Dockerfile +22 -36
- package/README.md +0 -27
- package/bin/deploy.js +54 -28
- package/bin/file.js +30 -2
- package/bin/index.js +6 -18
- package/bin/ssl.js +19 -11
- package/bin/util.js +18 -0
- package/bin/vs.js +3 -2
- package/conf.js +17 -1
- package/docker-compose.yml +1 -1
- package/manifests/mariadb/config.yaml +10 -0
- package/manifests/mariadb/kustomization.yaml +9 -0
- package/manifests/mariadb/pv.yaml +12 -0
- package/manifests/mariadb/pvc.yaml +10 -0
- package/manifests/mariadb/secret.yaml +8 -0
- package/manifests/mariadb/service.yaml +10 -0
- package/manifests/mariadb/statefulset.yaml +55 -0
- package/manifests/test/mongo-express.yaml +60 -0
- package/manifests/test/phpmyadmin.yaml +54 -0
- package/manifests/test/underpost-engine-mongodb-configmap.yaml +26 -0
- package/manifests/test/underpost-engine-pod.yaml +108 -0
- package/manifests/underpost-engine-backup-access.yaml +16 -0
- package/manifests/underpost-engine-backup-pv-pvc.yaml +22 -0
- package/manifests/underpost-engine-headless-service.yaml +10 -0
- package/manifests/underpost-engine-mongodb-backup-cronjob.yaml +40 -0
- package/manifests/underpost-engine-pv-pvc.yaml +23 -0
- package/manifests/underpost-engine-statefulset.yaml +91 -0
- package/manifests/valkey/kustomization.yaml +7 -0
- package/manifests/valkey/underpost-engine-valkey-service.yaml +17 -0
- package/manifests/valkey/underpost-engine-valkey-statefulset.yaml +39 -0
- package/package.json +144 -134
- package/src/api/user/user.model.js +9 -1
- package/src/api/user/user.service.js +1 -1
- package/src/client/components/core/Account.js +4 -2
- package/src/client/components/core/Auth.js +2 -2
- package/src/client/components/core/CalendarCore.js +112 -49
- package/src/client/components/core/CommonJs.js +125 -19
- package/src/client/components/core/Css.js +1 -1
- package/src/client/components/core/CssCore.js +6 -0
- package/src/client/components/core/Docs.js +2 -1
- package/src/client/components/core/DropDown.js +5 -1
- package/src/client/components/core/Input.js +17 -3
- package/src/client/components/core/JoyStick.js +8 -5
- package/src/client/components/core/Modal.js +12 -6
- package/src/client/components/core/Panel.js +82 -24
- package/src/client/components/core/PanelForm.js +11 -19
- package/src/client/components/core/SignUp.js +4 -1
- package/src/client/components/core/Translate.js +44 -8
- package/src/client/public/default/plantuml/client-conf.svg +1 -1
- package/src/client/public/default/plantuml/server-conf.svg +1 -1
- package/src/client/public/default/plantuml/server-schema.svg +1 -1
- package/src/client/public/default/plantuml/ssr-conf.svg +1 -1
- package/src/client/public/default/plantuml/ssr-schema.svg +1 -1
- package/src/client/services/core/core.service.js +2 -0
- package/src/client/ssr/body/CacheControl.js +2 -1
- package/src/client/ssr/body/DefaultSplashScreen.js +3 -3
- package/src/client/ssr/offline/Maintenance.js +63 -0
- package/src/client/sw/default.sw.js +23 -3
- package/src/db/mongo/MongooseDB.js +13 -1
- package/src/index.js +8 -0
- package/src/server/client-build.js +5 -4
- package/src/server/client-icons.js +1 -1
- package/src/server/conf.js +5 -5
- package/src/server/logger.js +8 -6
- package/src/server/process.js +25 -2
- package/src/server/ssl.js +1 -1
- package/src/server/valkey.js +3 -0
- package/startup.cjs +12 -0
- package/startup.js +0 -11
package/.dockerignore
CHANGED
|
@@ -10,7 +10,7 @@ permissions:
|
|
|
10
10
|
id-token: write
|
|
11
11
|
jobs:
|
|
12
12
|
pwa-microservices-template:
|
|
13
|
-
if: github.repository == 'underpostnet/engine' && startsWith(github.event.head_commit.message, '
|
|
13
|
+
if: github.repository == 'underpostnet/engine' && startsWith(github.event.head_commit.message, 'ci(package-pwa-microservices-template)')
|
|
14
14
|
name: Update github repo package Jobs
|
|
15
15
|
runs-on: ubuntu-latest
|
|
16
16
|
permissions:
|
|
@@ -46,11 +46,11 @@ jobs:
|
|
|
46
46
|
cd ../pwa-microservices-template
|
|
47
47
|
git remote set-url origin git@github.com:underpostnet/pwa-microservices-template.git
|
|
48
48
|
git add .
|
|
49
|
-
git commit -m "Update github repo package"
|
|
49
|
+
git commit -m "ci(package-pwa-microservices-template-ghpkg): ⚙️ Update github repo package"
|
|
50
50
|
git push https://${{ secrets.GIT_AUTH_TOKEN }}@github.com/underpostnet/pwa-microservices-template.git
|
|
51
51
|
|
|
52
52
|
pwa-microservices-template-ghpk:
|
|
53
|
-
if: github.repository == 'underpostnet/pwa-microservices-template'
|
|
53
|
+
if: github.repository == 'underpostnet/pwa-microservices-template' && startsWith(github.event.head_commit.message, 'ci(package-pwa-microservices-template-ghpkg)')
|
|
54
54
|
name: Update github repo package Jobs
|
|
55
55
|
runs-on: ubuntu-latest
|
|
56
56
|
permissions:
|
|
@@ -108,7 +108,7 @@ jobs:
|
|
|
108
108
|
git status
|
|
109
109
|
git remote set-url origin git@github.com:underpostnet/pwa-microservices-template-ghpkg.git
|
|
110
110
|
git add .
|
|
111
|
-
git commit -m "Update github repo package"
|
|
111
|
+
git commit -m "ci(package-pwa-microservices-template-ghpkg): ⚙️ Update github repo package"
|
|
112
112
|
git push https://${{ secrets.GIT_AUTH_TOKEN }}@github.com/underpostnet/pwa-microservices-template-ghpkg.git
|
|
113
113
|
|
|
114
114
|
# git push -u origin https://${{ secrets.GIT_AUTH_TOKEN }}@github.com/underpostnet/pwa-microservices-template-ghpkg.git
|
package/.vscode/extensions.json
CHANGED
|
@@ -1,72 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"danielehrhardt.ionic3-vs-ionview-snippets",
|
|
11
|
-
"dbaeumer.vscode-eslint",
|
|
12
|
-
"eamodio.gitlens",
|
|
13
|
-
"esbenp.prettier-vscode",
|
|
14
|
-
"fivethree.vscode-ionic-snippets",
|
|
15
|
-
"formulahendry.auto-rename-tag",
|
|
16
|
-
"golang.go",
|
|
17
|
-
"ipedrazas.kubernetes-snippets",
|
|
18
|
-
"jannisx11.batch-rename-extension",
|
|
19
|
-
"jeff-hykin.better-cpp-syntax",
|
|
20
|
-
"jinxdash.prettier-rust",
|
|
21
|
-
"johnpapa.vscode-peacock",
|
|
22
|
-
"juanblanco.solidity",
|
|
23
|
-
"julialang.language-julia",
|
|
24
|
-
"kevinrose.vsc-python-indent",
|
|
25
|
-
"mechatroner.rainbow-csv",
|
|
26
|
-
"mintlify.document",
|
|
27
|
-
"ms-azuretools.vscode-docker",
|
|
28
|
-
"ms-dotnettools.vscode-dotnet-runtime",
|
|
29
|
-
"ms-kubernetes-tools.vscode-kubernetes-tools",
|
|
30
|
-
"ms-python.black-formatter",
|
|
31
|
-
"ms-python.debugpy",
|
|
32
|
-
"ms-python.isort",
|
|
33
|
-
"ms-python.python",
|
|
34
|
-
"ms-python.vscode-pylance",
|
|
35
|
-
"ms-toolsai.jupyter",
|
|
36
|
-
"ms-toolsai.jupyter-keymap",
|
|
37
|
-
"ms-toolsai.jupyter-renderers",
|
|
38
|
-
"ms-toolsai.vscode-jupyter-cell-tags",
|
|
39
|
-
"ms-toolsai.vscode-jupyter-slideshow",
|
|
40
|
-
"ms-vscode-remote.remote-containers",
|
|
41
|
-
"ms-vscode-remote.remote-wsl",
|
|
42
|
-
"ms-vscode.cmake-tools",
|
|
43
|
-
"ms-vscode.cpptools",
|
|
44
|
-
"ms-vscode.cpptools-extension-pack",
|
|
45
|
-
"ms-vscode.cpptools-themes",
|
|
46
|
-
"ms-vscode.makefile-tools",
|
|
47
|
-
"msjsdiag.cordova-tools",
|
|
48
|
-
"nicolasvuillamy.vscode-groovy-lint",
|
|
49
|
-
"nucllear.vscode-extension-auto-import",
|
|
50
|
-
"pinkpotato.ionic-essentials",
|
|
51
|
-
"redhat.java",
|
|
52
|
-
"redhat.vscode-xml",
|
|
53
|
-
"redhat.vscode-yaml",
|
|
54
|
-
"rust-lang.rust-analyzer",
|
|
55
|
-
"steoates.autoimport",
|
|
56
|
-
"streetsidesoftware.code-spell-checker",
|
|
57
|
-
"tabnine.tabnine-vscode",
|
|
58
|
-
"tamasfe.even-better-toml",
|
|
59
|
-
"tobermory.es6-string-html",
|
|
60
|
-
"twxs.cmake",
|
|
61
|
-
"visualstudioexptteam.intellicode-api-usage-examples",
|
|
62
|
-
"visualstudioexptteam.vscodeintellicode",
|
|
63
|
-
"vscjava.vscode-gradle",
|
|
64
|
-
"vscjava.vscode-java-debug",
|
|
65
|
-
"vscjava.vscode-java-dependency",
|
|
66
|
-
"vscjava.vscode-java-pack",
|
|
67
|
-
"vscjava.vscode-java-test",
|
|
68
|
-
"vscjava.vscode-maven",
|
|
69
|
-
"vscode-icons-team.vscode-icons",
|
|
70
|
-
"xabikos.javascriptsnippets"
|
|
71
|
-
]
|
|
72
|
-
}
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"antiantisepticeye.vscode-color-picker",
|
|
4
|
+
"bashmish.es6-string-css",
|
|
5
|
+
"esbenp.prettier-vscode",
|
|
6
|
+
"tabnine.tabnine-vscode",
|
|
7
|
+
"tobermory.es6-string-html"
|
|
8
|
+
]
|
|
9
|
+
}
|
package/.vscode/settings.json
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"cSpell.words": [
|
|
13
13
|
"ANAME",
|
|
14
14
|
"browserconfig",
|
|
15
|
+
"Bymyelectrics",
|
|
15
16
|
"certbot",
|
|
16
17
|
"certonly",
|
|
17
18
|
"changefreq",
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
"[xml]": {
|
|
78
79
|
"editor.defaultFormatter": "redhat.vscode-xml"
|
|
79
80
|
},
|
|
80
|
-
"docwriter.style": "
|
|
81
|
+
"docwriter.style": "Auto-detect",
|
|
81
82
|
"docwriter.progress.trackFunctions": false,
|
|
82
83
|
"docwriter.progress.trackMethods": false,
|
|
83
84
|
"files.exclude": {
|
package/CHANGELOG.md
CHANGED
|
@@ -4,13 +4,65 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
#### [v2.
|
|
7
|
+
#### [v2.8.1](https://github.com/underpostnet/engine/compare/v2.8.0...v2.8.1)
|
|
8
|
+
|
|
9
|
+
> 20 January 2025
|
|
10
|
+
|
|
11
|
+
- [ci][docker-image][engine] v2.8.1 [`1c44f4c`](https://github.com/underpostnet/engine/commit/1c44f4cb53d1e197866e6ef768287f618fbe79b4)
|
|
12
|
+
- version refactor [`1aeaca2`](https://github.com/underpostnet/engine/commit/1aeaca200c8003915d3ef422f2bb2818e7438b8d)
|
|
13
|
+
- add bymyelectrics client components [`f2d3e8c`](https://github.com/underpostnet/engine/commit/f2d3e8c888b2b8573b25965b549fcb8e6b2e86e7)
|
|
14
|
+
|
|
15
|
+
#### [v2.8.0](https://github.com/underpostnet/engine/compare/v2.7.94...v2.8.0)
|
|
16
|
+
|
|
17
|
+
> 31 December 2024
|
|
18
|
+
|
|
19
|
+
- add vectorized lore cyberia [`166e021`](https://github.com/underpostnet/engine/commit/166e0210470e6a0fbaf755320c56105932138e28)
|
|
20
|
+
- cyberia biome engine advance [`e8bbce7`](https://github.com/underpostnet/engine/commit/e8bbce7cf2154c6de67840132cebc50349b1ab67)
|
|
21
|
+
- update src v2.8.0 [`3fa3aa1`](https://github.com/underpostnet/engine/commit/3fa3aa12db3609bd14ac526626707a152d69bd32)
|
|
22
|
+
|
|
23
|
+
#### [v2.7.94](https://github.com/underpostnet/engine/compare/v2.7.93...v2.7.94)
|
|
24
|
+
|
|
25
|
+
> 17 December 2024
|
|
26
|
+
|
|
27
|
+
- cyberia server character server transport refactor [`d302a5a`](https://github.com/underpostnet/engine/commit/d302a5ab02d789226d9ef84bf00c19358f83b5cb)
|
|
28
|
+
- healthcare nutrition-tips advance [`f97ca58`](https://github.com/underpostnet/engine/commit/f97ca58344d9d9da656155deaaac54c621e927f8)
|
|
29
|
+
- scroll top refresh refactor [`b9fc99f`](https://github.com/underpostnet/engine/commit/b9fc99f413b8a177242c9e6538eb70c73f97747e)
|
|
30
|
+
|
|
31
|
+
#### [v2.7.93](https://github.com/underpostnet/engine/compare/v2.7.92...v2.7.93)
|
|
32
|
+
|
|
33
|
+
> 12 December 2024
|
|
34
|
+
|
|
35
|
+
- [ci][docker-image][engine] [`0d209f7`](https://github.com/underpostnet/engine/commit/0d209f7336b33d56db290e6816152a29194f224f)
|
|
36
|
+
- add pul refresh reload [`93c2929`](https://github.com/underpostnet/engine/commit/93c29298e322181ef320644a97731b90efed1811)
|
|
37
|
+
- update get lang function [`895df49`](https://github.com/underpostnet/engine/commit/895df49c150c09f3f2c0d96921f3529a097f5f83)
|
|
38
|
+
|
|
39
|
+
#### [v2.7.92](https://github.com/underpostnet/engine/compare/v2.7.91...v2.7.92)
|
|
40
|
+
|
|
41
|
+
> 12 December 2024
|
|
42
|
+
|
|
43
|
+
- ssr refactor advance [`9c1be61`](https://github.com/underpostnet/engine/commit/9c1be61a48c7fe343c38008fc81854713c239388)
|
|
44
|
+
- [ci][docker-image][engine] v2.7.92 [`719efb7`](https://github.com/underpostnet/engine/commit/719efb7486c2651450ad698f9d5770042ed4c060)
|
|
45
|
+
- cyberia biome instance refactor [`44e56ed`](https://github.com/underpostnet/engine/commit/44e56ed7cebccacbf7439ffb6857f12afa52edeb)
|
|
46
|
+
|
|
47
|
+
#### [v2.7.91](https://github.com/underpostnet/engine/compare/v2.7.83...v2.7.91)
|
|
48
|
+
|
|
49
|
+
> 7 December 2024
|
|
50
|
+
|
|
51
|
+
- [ci][docker-image][engine] v2.7.91 [`9616635`](https://github.com/underpostnet/engine/commit/9616635c12d4eba7e7597a81f6ff6760fc9fb937)
|
|
52
|
+
- add gemini creator quest [`5f1bbec`](https://github.com/underpostnet/engine/commit/5f1bbeca4698879043c7d4abb1341c8ac08b859c)
|
|
53
|
+
- update to version 2.7.9 [`41b96b6`](https://github.com/underpostnet/engine/commit/41b96b63e48759a3bb8ab54c0573536db8ef4143)
|
|
54
|
+
|
|
55
|
+
#### [v2.7.83](https://github.com/underpostnet/engine/compare/v2.7.9...v2.7.83)
|
|
8
56
|
|
|
9
57
|
> 28 October 2024
|
|
10
58
|
|
|
59
|
+
#### [v2.7.9](https://github.com/underpostnet/engine/compare/v2.7.7...v2.7.9)
|
|
60
|
+
|
|
61
|
+
> 14 November 2024
|
|
62
|
+
|
|
11
63
|
- update version 2.7.83 [`3d22671`](https://github.com/underpostnet/engine/commit/3d22671a23f25767cc01c244090e237ab3a300da)
|
|
12
|
-
-
|
|
13
|
-
-
|
|
64
|
+
- remove unnecesary packages [`4c0e029`](https://github.com/underpostnet/engine/commit/4c0e029509331fb718554d595d7de9e042eb2b54)
|
|
65
|
+
- add item-skin-08 tile engine logic [`b72c64f`](https://github.com/underpostnet/engine/commit/b72c64f218d013653c1c800473f768dc38fe5607)
|
|
14
66
|
|
|
15
67
|
#### [v2.7.7](https://github.com/underpostnet/engine/compare/v2.7.6...v2.7.7)
|
|
16
68
|
|
package/Dockerfile
CHANGED
|
@@ -2,7 +2,7 @@ ARG BASE_DEBIAN=buster
|
|
|
2
2
|
|
|
3
3
|
FROM debian:${BASE_DEBIAN}
|
|
4
4
|
|
|
5
|
-
ENV DEBIAN_FRONTEND
|
|
5
|
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
6
6
|
|
|
7
7
|
WORKDIR /code
|
|
8
8
|
|
|
@@ -43,48 +43,34 @@ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
|
|
|
43
43
|
node --version && \
|
|
44
44
|
npm --version
|
|
45
45
|
|
|
46
|
+
# local test
|
|
46
47
|
|
|
47
|
-
# install lampp
|
|
48
|
-
RUN curl -Lo xampp-linux-installer.run https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/7.4.30/xampp-linux-x64-7.4.30-1-installer.run?from_af=true && \
|
|
49
|
-
chmod +x xampp-linux-installer.run && \
|
|
50
|
-
bash -c './xampp-linux-installer.run' && \
|
|
51
|
-
ln -sf /opt/lampp/lampp /usr/bin/lampp && \
|
|
52
|
-
# Enable XAMPP web interface(remove security checks)
|
|
53
|
-
sed -i.bak s'/Require local/Require all granted/g' /opt/lampp/etc/extra/httpd-xampp.conf && \
|
|
54
|
-
# Enable error display in php
|
|
55
|
-
sed -i.bak s'/display_errors=Off/display_errors=On/g' /opt/lampp/etc/php.ini && \
|
|
56
|
-
# Enable includes of several configuration files
|
|
57
|
-
mkdir /opt/lampp/apache2/conf.d && \
|
|
58
|
-
echo "IncludeOptional /opt/lampp/apache2/conf.d/*.conf" >> /opt/lampp/etc/httpd.conf && \
|
|
59
|
-
# Create a /www folder and a symbolic link to it in /opt/lampp/htdocs. It'll be accessible via http://localhost:[port]/www/
|
|
60
|
-
# This is convenient because it doesn't interfere with xampp, phpmyadmin or other tools in /opt/lampp/htdocs
|
|
61
|
-
# /opt/lampp/etc/httpd.conf
|
|
62
|
-
mkdir /www && \
|
|
63
|
-
ln -s /www /opt/lampp/htdocs
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
# Install mongodb necessary libs
|
|
67
|
-
RUN apt-get update && apt-get install -y apt-utils wget gnupg gnupg2 curl
|
|
68
|
-
|
|
69
|
-
# Install mongodb
|
|
70
|
-
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add -
|
|
71
|
-
RUN echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.2.list
|
|
72
|
-
RUN apt-get update
|
|
73
|
-
RUN apt-get install -y mongodb-org
|
|
74
|
-
|
|
75
|
-
# BIND TO ALL ADAPTERS IN CONTAINER
|
|
76
|
-
RUN sed -i "s,\\(^[[:blank:]]*bindIp:\\) .*,\\1 0.0.0.0," /etc/mongod.conf
|
|
77
|
-
|
|
78
|
-
# Bundle app source
|
|
79
48
|
# COPY . .
|
|
80
49
|
|
|
50
|
+
# RUN npm install
|
|
51
|
+
|
|
52
|
+
# VOLUME [ "/code/logs" ]
|
|
53
|
+
# EXPOSE 22
|
|
54
|
+
|
|
55
|
+
# EXPOSE 4000-4004
|
|
56
|
+
# CMD [ "npm", "run", "dev" ]
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# EXPOSE 3000-3004
|
|
60
|
+
# CMD [ "npm", "start" ]
|
|
61
|
+
|
|
62
|
+
# package
|
|
63
|
+
|
|
81
64
|
# Install underpost cli
|
|
82
|
-
RUN npm install -g underpost
|
|
83
65
|
|
|
66
|
+
RUN npm install -g underpost
|
|
67
|
+
RUN npm install shelljs
|
|
68
|
+
COPY startup.cjs /code/startup.cjs
|
|
84
69
|
|
|
85
70
|
VOLUME [ "/code/app/logs" ]
|
|
86
71
|
|
|
87
72
|
EXPOSE 22 80 443 3306 27017
|
|
88
|
-
EXPOSE
|
|
73
|
+
# EXPOSE 22
|
|
74
|
+
EXPOSE 4000-4004
|
|
89
75
|
|
|
90
|
-
CMD [ "node", "startup" ]
|
|
76
|
+
CMD [ "node", "./startup.cjs" ]
|
package/README.md
CHANGED
|
@@ -67,30 +67,3 @@ Run dev client server
|
|
|
67
67
|
```bash
|
|
68
68
|
npm run dev
|
|
69
69
|
```
|
|
70
|
-
|
|
71
|
-
Run dev api server
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
npm run dev-api
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Run on `pm2`
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
npm run pm2
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Run on `docker-compose`
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
npm run start:docker
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Run on `docker`
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
# build image
|
|
93
|
-
docker build . -t app-name
|
|
94
|
-
# run image
|
|
95
|
-
docker run --name app-name-instance -p 41061:3001 -p 41062:3002 app-name
|
|
96
|
-
```
|
package/bin/deploy.js
CHANGED
|
@@ -454,14 +454,16 @@ try {
|
|
|
454
454
|
}
|
|
455
455
|
break;
|
|
456
456
|
|
|
457
|
-
case 'update-
|
|
457
|
+
case 'update-dependencies':
|
|
458
458
|
const files = await fs.readdir(`./engine-private/conf`, { recursive: true });
|
|
459
459
|
const originPackage = JSON.parse(fs.readFileSync(`./package.json`, 'utf8'));
|
|
460
460
|
for (const relativePath of files) {
|
|
461
461
|
const filePah = `./engine-private/conf/${relativePath.replaceAll(`\\`, '/')}`;
|
|
462
462
|
if (filePah.split('/').pop() === 'package.json') {
|
|
463
|
-
|
|
464
|
-
|
|
463
|
+
const deployPackage = JSON.parse(fs.readFileSync(filePah), 'utf8');
|
|
464
|
+
deployPackage.dependencies = originPackage.dependencies;
|
|
465
|
+
deployPackage.devDependencies = originPackage.devDependencies;
|
|
466
|
+
fs.writeFileSync(filePah, JSON.stringify(deployPackage, null, 4), 'utf8');
|
|
465
467
|
}
|
|
466
468
|
}
|
|
467
469
|
break;
|
|
@@ -752,26 +754,20 @@ try {
|
|
|
752
754
|
);
|
|
753
755
|
|
|
754
756
|
fs.writeFileSync(
|
|
755
|
-
`./
|
|
757
|
+
`./manifests/test/underpost-engine-pod.yaml`,
|
|
756
758
|
fs
|
|
757
|
-
.readFileSync(`./
|
|
758
|
-
.replaceAll(
|
|
759
|
+
.readFileSync(`./manifests/test/underpost-engine-pod.yaml`, 'utf8')
|
|
760
|
+
.replaceAll(`underpost-engine:v${version}`, `underpost-engine:v${newVersion}`),
|
|
759
761
|
'utf8',
|
|
760
762
|
);
|
|
761
763
|
|
|
762
764
|
fs.writeFileSync(
|
|
763
|
-
`./src/
|
|
764
|
-
fs.readFileSync(`./src/
|
|
765
|
+
`./src/index.js`,
|
|
766
|
+
fs.readFileSync(`./src/index.js`, 'utf8').replaceAll(`${version}`, `${newVersion}`),
|
|
765
767
|
'utf8',
|
|
766
768
|
);
|
|
767
769
|
|
|
768
|
-
|
|
769
|
-
`./bin/index.js`,
|
|
770
|
-
fs.readFileSync(`./bin/index.js`, 'utf8').replaceAll(`${version}`, `${newVersion}`),
|
|
771
|
-
'utf8',
|
|
772
|
-
);
|
|
773
|
-
|
|
774
|
-
shellExec(`node bin/deploy update-package`);
|
|
770
|
+
shellExec(`node bin/deploy update-dependencies`);
|
|
775
771
|
shellExec(`auto-changelog`);
|
|
776
772
|
}
|
|
777
773
|
break;
|
|
@@ -805,7 +801,8 @@ ${uniqueArray(logs.all.map((log) => `- ${log.author_name} ([${log.author_email}]
|
|
|
805
801
|
case 'restore-macro-db':
|
|
806
802
|
{
|
|
807
803
|
const deployGroupId = process.argv[3];
|
|
808
|
-
|
|
804
|
+
const deployId = process.argv[4];
|
|
805
|
+
await restoreMacroDb(deployGroupId, deployId);
|
|
809
806
|
}
|
|
810
807
|
|
|
811
808
|
break;
|
|
@@ -893,7 +890,11 @@ ${uniqueArray(logs.all.map((log) => `- ${log.author_name} ([${log.author_email}]
|
|
|
893
890
|
}
|
|
894
891
|
case 'ssh-import-client-keys': {
|
|
895
892
|
const host = process.argv[3];
|
|
896
|
-
shellExec(
|
|
893
|
+
shellExec(
|
|
894
|
+
`node bin/deploy set-ssh-keys ./engine-private/deploy/ssh_host_rsa_key ${host ? ` ${host}` : ``} ${
|
|
895
|
+
process.argv.includes('clean') ? 'clean' : ''
|
|
896
|
+
}`,
|
|
897
|
+
);
|
|
897
898
|
break;
|
|
898
899
|
}
|
|
899
900
|
case 'ssh-keys': {
|
|
@@ -958,14 +959,24 @@ ${uniqueArray(logs.all.map((log) => `- ${log.author_name} ([${log.author_email}]
|
|
|
958
959
|
}
|
|
959
960
|
|
|
960
961
|
case 'ssh': {
|
|
961
|
-
if (
|
|
962
|
-
shellExec(`sudo
|
|
963
|
-
|
|
964
|
-
shellExec(`sudo
|
|
962
|
+
if (process.argv.includes('rocky')) {
|
|
963
|
+
shellExec(`sudo systemctl enable sshd`);
|
|
964
|
+
|
|
965
|
+
shellExec(`sudo systemctl start sshd`);
|
|
966
|
+
|
|
967
|
+
shellExec(`sudo systemctl status sshd`);
|
|
968
|
+
|
|
969
|
+
shellExec(`sudo ss -lt`);
|
|
970
|
+
} else {
|
|
971
|
+
if (!process.argv.includes('server')) {
|
|
972
|
+
shellExec(`sudo apt update`);
|
|
973
|
+
shellExec(`sudo apt install openssh-server -y`);
|
|
974
|
+
shellExec(`sudo apt install ssh-askpass`);
|
|
975
|
+
}
|
|
976
|
+
shellExec(`sudo systemctl enable ssh`);
|
|
977
|
+
shellExec(`sudo systemctl restart ssh`);
|
|
978
|
+
shellExec(`sudo systemctl status ssh`);
|
|
965
979
|
}
|
|
966
|
-
shellExec(`sudo systemctl enable ssh`);
|
|
967
|
-
shellExec(`sudo systemctl restart ssh`);
|
|
968
|
-
shellExec(`sudo systemctl status ssh`);
|
|
969
980
|
// sudo service ssh restart
|
|
970
981
|
shellExec(`ip a`);
|
|
971
982
|
|
|
@@ -1023,11 +1034,26 @@ ${uniqueArray(logs.all.map((log) => `- ${log.author_name} ([${log.author_email}]
|
|
|
1023
1034
|
|
|
1024
1035
|
case 'valkey': {
|
|
1025
1036
|
if (!process.argv.includes('server')) {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1037
|
+
if (process.argv.includes('rocky')) {
|
|
1038
|
+
// shellExec(`yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm`);
|
|
1039
|
+
// shellExec(`sudo percona-release enable valkey experimental`);
|
|
1040
|
+
shellExec(`sudo dnf install valkey`);
|
|
1041
|
+
shellExec(`chown -R valkey:valkey /etc/valkey`);
|
|
1042
|
+
shellExec(`chown -R valkey:valkey /var/lib/valkey`);
|
|
1043
|
+
shellExec(`chown -R valkey:valkey /var/log/valkey`);
|
|
1044
|
+
shellExec(`sudo systemctl enable valkey.service`);
|
|
1045
|
+
shellExec(`sudo systemctl start valkey`);
|
|
1046
|
+
shellExec(`valkey-cli ping`);
|
|
1047
|
+
} else {
|
|
1048
|
+
shellExec(`cd /dd && git clone https://github.com/valkey-io/valkey.git`);
|
|
1049
|
+
shellExec(`cd /dd/valkey && make`);
|
|
1050
|
+
shellExec(`apt install valkey-tools`); // valkey-cli
|
|
1051
|
+
}
|
|
1029
1052
|
}
|
|
1030
|
-
|
|
1053
|
+
if (process.argv.includes('rocky')) {
|
|
1054
|
+
shellExec(`sudo systemctl stop valkey`);
|
|
1055
|
+
shellExec(`sudo systemctl start valkey`);
|
|
1056
|
+
} else shellExec(`cd /dd/valkey && ./src/valkey-server`);
|
|
1031
1057
|
|
|
1032
1058
|
break;
|
|
1033
1059
|
}
|
package/bin/file.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
|
|
3
3
|
import { loggerFactory } from '../src/server/logger.js';
|
|
4
|
-
import { cap, getCapVariableName, getDirname } from '../src/client/components/core/CommonJs.js';
|
|
4
|
+
import { cap, getCapVariableName, getDirname, newInstance } from '../src/client/components/core/CommonJs.js';
|
|
5
5
|
import { shellCd, shellExec } from '../src/server/process.js';
|
|
6
6
|
import walk from 'ignore-walk';
|
|
7
7
|
import { validateTemplatePath } from '../src/server/conf.js';
|
|
@@ -78,7 +78,7 @@ try {
|
|
|
78
78
|
fs.copySync(`./src/client/public/default`, `../pwa-microservices-template/src/client/public/default`);
|
|
79
79
|
|
|
80
80
|
shellCd('../pwa-microservices-template');
|
|
81
|
-
for (const deletePath of ['
|
|
81
|
+
for (const deletePath of ['README.md', 'package-lock.json', 'package.json']) {
|
|
82
82
|
shellExec(`git checkout ${deletePath}`);
|
|
83
83
|
}
|
|
84
84
|
for (const deletePath of [
|
|
@@ -93,6 +93,34 @@ try {
|
|
|
93
93
|
]) {
|
|
94
94
|
fs.removeSync('../pwa-microservices-template/' + deletePath);
|
|
95
95
|
}
|
|
96
|
+
shellCd('../engine');
|
|
97
|
+
const originPackageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
|
98
|
+
const templatePackageJson = JSON.parse(fs.readFileSync('../pwa-microservices-template/package.json', 'utf8'));
|
|
99
|
+
templatePackageJson.dependencies = originPackageJson.dependencies;
|
|
100
|
+
templatePackageJson.devDependencies = originPackageJson.devDependencies;
|
|
101
|
+
templatePackageJson.version = originPackageJson.version;
|
|
102
|
+
fs.writeFileSync(
|
|
103
|
+
'../pwa-microservices-template/package.json',
|
|
104
|
+
JSON.stringify(templatePackageJson, null, 4),
|
|
105
|
+
'utf8',
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const originPackageLockJson = JSON.parse(fs.readFileSync('./package-lock.json', 'utf8'));
|
|
109
|
+
const templatePackageLockJson = JSON.parse(
|
|
110
|
+
fs.readFileSync('../pwa-microservices-template/package-lock.json', 'utf8'),
|
|
111
|
+
);
|
|
112
|
+
const originBasePackageLock = newInstance(templatePackageLockJson.packages['']);
|
|
113
|
+
templatePackageLockJson.version = originPackageLockJson.version;
|
|
114
|
+
templatePackageLockJson.packages = originPackageLockJson.packages;
|
|
115
|
+
templatePackageLockJson.packages[''].name = originBasePackageLock.name;
|
|
116
|
+
templatePackageLockJson.packages[''].version = originPackageLockJson.version;
|
|
117
|
+
templatePackageLockJson.packages[''].hasInstallScript = originBasePackageLock.hasInstallScript;
|
|
118
|
+
templatePackageLockJson.packages[''].license = originBasePackageLock.license;
|
|
119
|
+
fs.writeFileSync(
|
|
120
|
+
'../pwa-microservices-template/package-lock.json',
|
|
121
|
+
JSON.stringify(templatePackageLockJson, null, 4),
|
|
122
|
+
'utf8',
|
|
123
|
+
);
|
|
96
124
|
}
|
|
97
125
|
|
|
98
126
|
break;
|
package/bin/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import fs from 'fs-extra';
|
|
|
6
6
|
import { Command } from 'commander';
|
|
7
7
|
import { MongooseDB } from '../src/db/mongo/MongooseDB.js';
|
|
8
8
|
import { loggerFactory, underpostASCI } from '../src/server/logger.js';
|
|
9
|
+
import Underpost from '../src/index.js';
|
|
9
10
|
|
|
10
11
|
dotenv.config();
|
|
11
12
|
|
|
@@ -19,9 +20,7 @@ const globalBinFolder = `${shellExec(`npm root -g`, {
|
|
|
19
20
|
|
|
20
21
|
const program = new Command();
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
program.name('underpost').description(`underpost.net ci/cd cli ${version}`).version(version);
|
|
23
|
+
program.name('underpost').description(`underpost.net ci/cd cli ${Underpost.version}`).version(Underpost.version);
|
|
25
24
|
|
|
26
25
|
program
|
|
27
26
|
.command('new <app-name>')
|
|
@@ -30,7 +29,7 @@ program
|
|
|
30
29
|
console.log(
|
|
31
30
|
underpostASCI() +
|
|
32
31
|
`
|
|
33
|
-
|
|
32
|
+
${Underpost.version} https://www.nexodev.org/docs
|
|
34
33
|
`,
|
|
35
34
|
);
|
|
36
35
|
await logger.setUpInfo();
|
|
@@ -42,19 +41,8 @@ program
|
|
|
42
41
|
fs.writeFileSync(`${destFolder}/.gitignore`, fs.readFileSync(`${globalBinFolder}/.dockerignore`, 'utf8'), 'utf8');
|
|
43
42
|
shellCd(`${destFolder}`);
|
|
44
43
|
shellExec(`git init && git add . && git commit -m "Base template implementation"`);
|
|
45
|
-
shellExec(`npm
|
|
46
|
-
|
|
47
|
-
case 'linux':
|
|
48
|
-
try {
|
|
49
|
-
await MongooseDB.server();
|
|
50
|
-
} catch (error) {
|
|
51
|
-
logger.error(error, 'failed to start mongodb server');
|
|
52
|
-
}
|
|
53
|
-
break;
|
|
54
|
-
|
|
55
|
-
default:
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
44
|
+
shellExec(`npm install`);
|
|
45
|
+
shellExec(`npm run build`);
|
|
58
46
|
shellExec(`npm run dev`);
|
|
59
47
|
});
|
|
60
48
|
|
|
@@ -65,7 +53,7 @@ program
|
|
|
65
53
|
console.log(
|
|
66
54
|
underpostASCI() +
|
|
67
55
|
`
|
|
68
|
-
|
|
56
|
+
${Underpost.version} https://www.nexodev.org/docs
|
|
69
57
|
`,
|
|
70
58
|
);
|
|
71
59
|
shellCd(`${globalBinFolder}`);
|
package/bin/ssl.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import read from 'read';
|
|
3
|
-
import ncp from 'copy-paste';
|
|
4
3
|
import dotenv from 'dotenv';
|
|
5
|
-
|
|
6
|
-
import { getRootDirectory, shellExec } from '../src/server/process.js';
|
|
4
|
+
import { getRootDirectory, pbcopy, shellExec } from '../src/server/process.js';
|
|
7
5
|
import { loggerFactory } from '../src/server/logger.js';
|
|
8
6
|
import { Cmd, loadConf } from '../src/server/conf.js';
|
|
9
7
|
import { buildSSL } from '../src/server/ssl.js';
|
|
@@ -24,9 +22,9 @@ try {
|
|
|
24
22
|
for (const host of hosts.split(',')) {
|
|
25
23
|
if (host in confServer) {
|
|
26
24
|
const directory = confServer[host]['/']?.['directory'] ? confServer[host]['/']['directory'] : undefined;
|
|
27
|
-
cmd = `certbot certonly --webroot --webroot-path ${
|
|
25
|
+
cmd = `sudo certbot certonly --webroot --webroot-path ${
|
|
28
26
|
directory ? directory : `${getRootDirectory()}/public/${host}`
|
|
29
|
-
} -d ${host}`;
|
|
27
|
+
} --cert-name ${host} -d ${host}`;
|
|
30
28
|
// directory ? directory : `${getRootDirectory()}/public/${host}`
|
|
31
29
|
// directory ? directory : `${getRootDirectory()}/public/www.${host.split('.').slice(-2).join('.')}`
|
|
32
30
|
|
|
@@ -38,16 +36,26 @@ try {
|
|
|
38
36
|
// certbot delete --cert-name <domain>
|
|
39
37
|
|
|
40
38
|
logger.info(`Run the following command`, cmd);
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
try {
|
|
40
|
+
await pbcopy(cmd);
|
|
41
|
+
await read({ prompt: 'Command copy to clipboard, press enter to continue.\n' });
|
|
42
|
+
} catch (error) {
|
|
43
|
+
logger.error(error);
|
|
44
|
+
}
|
|
43
45
|
// Certificate
|
|
44
|
-
await buildSSL(host);
|
|
46
|
+
if (process.argv.includes('build')) await buildSSL(host);
|
|
45
47
|
logger.info('Certificate saved', host);
|
|
46
48
|
} else throw new Error(`host not found: ${host}`);
|
|
47
49
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
// check for renewal conf:
|
|
51
|
+
// /etc/letsencrypt/renewal
|
|
52
|
+
// /etc/letsencrypt/live
|
|
53
|
+
cmd = `sudo certbot renew --dry-run`;
|
|
54
|
+
try {
|
|
55
|
+
await pbcopy(cmd);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
logger.error(error);
|
|
58
|
+
}
|
|
51
59
|
logger.info(`run the following command for renewal. Command copy to clipboard`, cmd);
|
|
52
60
|
logger.info(`success install SLL`, hosts);
|
|
53
61
|
} catch (error) {
|
package/bin/util.js
CHANGED
|
@@ -13,6 +13,7 @@ import { network } from '../src/server/network.js';
|
|
|
13
13
|
import { Config } from '../src/server/conf.js';
|
|
14
14
|
import { FileFactory } from '../src/api/file/file.service.js';
|
|
15
15
|
import { buildTextImg, faBase64Png, getBufferPngText } from '../src/server/client-icons.js';
|
|
16
|
+
import keyword_extractor from 'keyword-extractor';
|
|
16
17
|
|
|
17
18
|
const httpsAgent = new https.Agent({
|
|
18
19
|
rejectUnauthorized: false,
|
|
@@ -203,7 +204,24 @@ try {
|
|
|
203
204
|
shellExec(`git checkout jsdoc.json`);
|
|
204
205
|
break;
|
|
205
206
|
}
|
|
207
|
+
case 'get-keys': {
|
|
208
|
+
const sentence = fs.existsSync('./_')
|
|
209
|
+
? fs.readFileSync('./_', 'utf8')
|
|
210
|
+
: process.argv[3]
|
|
211
|
+
? process.argv[3]
|
|
212
|
+
: 'President Obama woke up Monday facing a Congressional defeat that many in both parties believed could hobble his presidency.';
|
|
213
|
+
|
|
214
|
+
// Extract the keywords
|
|
215
|
+
const extraction_result = keyword_extractor.extract(sentence, {
|
|
216
|
+
language: 'english',
|
|
217
|
+
remove_digits: true,
|
|
218
|
+
// return_changed_case: true,
|
|
219
|
+
// remove_duplicates: false,
|
|
220
|
+
});
|
|
206
221
|
|
|
222
|
+
console.log(extraction_result.join(', '));
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
207
225
|
default:
|
|
208
226
|
break;
|
|
209
227
|
}
|