underpost 2.8.1 → 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/CHANGELOG.md +55 -3
- package/Dockerfile +22 -36
- package/README.md +0 -27
- package/bin/deploy.js +57 -17
- package/bin/file.js +30 -2
- package/bin/index.js +2 -13
- package/bin/ssl.js +19 -11
- package/bin/vs.js +3 -2
- package/conf.js +9 -0
- 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 -136
- package/src/api/user/user.model.js +9 -1
- package/src/api/user/user.service.js +1 -1
- package/src/client/components/core/CalendarCore.js +112 -49
- package/src/client/components/core/CommonJs.js +125 -19
- package/src/client/components/core/CssCore.js +6 -0
- package/src/client/components/core/DropDown.js +5 -1
- package/src/client/components/core/Input.js +17 -3
- package/src/client/components/core/Modal.js +5 -0
- package/src/client/components/core/Panel.js +81 -24
- package/src/client/components/core/PanelForm.js +4 -18
- package/src/client/components/core/Translate.js +30 -8
- package/src/db/mongo/MongooseDB.js +13 -1
- package/src/index.js +1 -1
- package/src/server/conf.js +2 -2
- package/src/server/process.js +25 -2
- package/src/server/ssl.js +1 -1
- package/src/server/valkey.js +2 -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/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;
|
|
@@ -751,13 +753,21 @@ try {
|
|
|
751
753
|
'utf8',
|
|
752
754
|
);
|
|
753
755
|
|
|
756
|
+
fs.writeFileSync(
|
|
757
|
+
`./manifests/test/underpost-engine-pod.yaml`,
|
|
758
|
+
fs
|
|
759
|
+
.readFileSync(`./manifests/test/underpost-engine-pod.yaml`, 'utf8')
|
|
760
|
+
.replaceAll(`underpost-engine:v${version}`, `underpost-engine:v${newVersion}`),
|
|
761
|
+
'utf8',
|
|
762
|
+
);
|
|
763
|
+
|
|
754
764
|
fs.writeFileSync(
|
|
755
765
|
`./src/index.js`,
|
|
756
766
|
fs.readFileSync(`./src/index.js`, 'utf8').replaceAll(`${version}`, `${newVersion}`),
|
|
757
767
|
'utf8',
|
|
758
768
|
);
|
|
759
769
|
|
|
760
|
-
shellExec(`node bin/deploy update-
|
|
770
|
+
shellExec(`node bin/deploy update-dependencies`);
|
|
761
771
|
shellExec(`auto-changelog`);
|
|
762
772
|
}
|
|
763
773
|
break;
|
|
@@ -791,7 +801,8 @@ ${uniqueArray(logs.all.map((log) => `- ${log.author_name} ([${log.author_email}]
|
|
|
791
801
|
case 'restore-macro-db':
|
|
792
802
|
{
|
|
793
803
|
const deployGroupId = process.argv[3];
|
|
794
|
-
|
|
804
|
+
const deployId = process.argv[4];
|
|
805
|
+
await restoreMacroDb(deployGroupId, deployId);
|
|
795
806
|
}
|
|
796
807
|
|
|
797
808
|
break;
|
|
@@ -879,7 +890,11 @@ ${uniqueArray(logs.all.map((log) => `- ${log.author_name} ([${log.author_email}]
|
|
|
879
890
|
}
|
|
880
891
|
case 'ssh-import-client-keys': {
|
|
881
892
|
const host = process.argv[3];
|
|
882
|
-
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
|
+
);
|
|
883
898
|
break;
|
|
884
899
|
}
|
|
885
900
|
case 'ssh-keys': {
|
|
@@ -944,14 +959,24 @@ ${uniqueArray(logs.all.map((log) => `- ${log.author_name} ([${log.author_email}]
|
|
|
944
959
|
}
|
|
945
960
|
|
|
946
961
|
case 'ssh': {
|
|
947
|
-
if (
|
|
948
|
-
shellExec(`sudo
|
|
949
|
-
|
|
950
|
-
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`);
|
|
951
979
|
}
|
|
952
|
-
shellExec(`sudo systemctl enable ssh`);
|
|
953
|
-
shellExec(`sudo systemctl restart ssh`);
|
|
954
|
-
shellExec(`sudo systemctl status ssh`);
|
|
955
980
|
// sudo service ssh restart
|
|
956
981
|
shellExec(`ip a`);
|
|
957
982
|
|
|
@@ -1009,11 +1034,26 @@ ${uniqueArray(logs.all.map((log) => `- ${log.author_name} ([${log.author_email}]
|
|
|
1009
1034
|
|
|
1010
1035
|
case 'valkey': {
|
|
1011
1036
|
if (!process.argv.includes('server')) {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
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
|
+
}
|
|
1015
1052
|
}
|
|
1016
|
-
|
|
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`);
|
|
1017
1057
|
|
|
1018
1058
|
break;
|
|
1019
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
|
@@ -41,19 +41,8 @@ program
|
|
|
41
41
|
fs.writeFileSync(`${destFolder}/.gitignore`, fs.readFileSync(`${globalBinFolder}/.dockerignore`, 'utf8'), 'utf8');
|
|
42
42
|
shellCd(`${destFolder}`);
|
|
43
43
|
shellExec(`git init && git add . && git commit -m "Base template implementation"`);
|
|
44
|
-
shellExec(`npm
|
|
45
|
-
|
|
46
|
-
case 'linux':
|
|
47
|
-
try {
|
|
48
|
-
await MongooseDB.server();
|
|
49
|
-
} catch (error) {
|
|
50
|
-
logger.error(error, 'failed to start mongodb server');
|
|
51
|
-
}
|
|
52
|
-
break;
|
|
53
|
-
|
|
54
|
-
default:
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
44
|
+
shellExec(`npm install`);
|
|
45
|
+
shellExec(`npm run build`);
|
|
57
46
|
shellExec(`npm run dev`);
|
|
58
47
|
});
|
|
59
48
|
|
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/vs.js
CHANGED
|
@@ -6,13 +6,14 @@ switch (process.argv[2]) {
|
|
|
6
6
|
{
|
|
7
7
|
const extensions = JSON.parse(fs.readFileSync(`./.vscode/extensions.json`, 'utf8'));
|
|
8
8
|
extensions.recommendations.map((extension) => {
|
|
9
|
-
if (extension)
|
|
9
|
+
if (extension)
|
|
10
|
+
shellExec(`sudo code --user-data-dir="/root/.vscode-root" --no-sandbox --install-extension ${extension}`);
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
13
|
break;
|
|
13
14
|
case 'export':
|
|
14
15
|
{
|
|
15
|
-
shellExec(`code --list-extensions > vs-extensions.txt`);
|
|
16
|
+
shellExec(`sudo code --user-data-dir="/root/.vscode-root" --no-sandbox --list-extensions > vs-extensions.txt`);
|
|
16
17
|
fs.writeFileSync(
|
|
17
18
|
`./.vscode/extensions.json`,
|
|
18
19
|
JSON.stringify(
|
package/conf.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import dotenv from 'dotenv';
|
|
2
|
+
|
|
3
|
+
dotenv.config();
|
|
4
|
+
|
|
1
5
|
const DefaultConf = {
|
|
2
6
|
client: {
|
|
3
7
|
default: {
|
|
@@ -229,7 +233,12 @@ const DefaultConf = {
|
|
|
229
233
|
proxy: [80, 443],
|
|
230
234
|
db: {
|
|
231
235
|
provider: 'mongoose',
|
|
236
|
+
// mongodb://<username>:<password>@<pod-0-name>.<headless-service-name>.<namespace>.svc.cluster.local:27017
|
|
237
|
+
// ,<pod-1-name>.<headless-service-name>.<namespace>.svc.cluster.local:27017/<database-name>?replicaSet=rs0;
|
|
238
|
+
// <k8s-pod-name>.<k8s-internal-service-name>.<k8s-namespace>.<cluster-name>
|
|
239
|
+
// host: 'mongodb://mongodb-0.mongodb-service.default.svc.cluster.local:27017?replicaSet=rs0',
|
|
232
240
|
host: 'mongodb://127.0.0.1:27017',
|
|
241
|
+
// host: `mongodb://${process.env.MONGO_INITDB_ROOT_USERNAME}:${process.env.MONGO_INITDB_ROOT_PASSWORD}@mongodb-0.mongodb-service:27017`, // ?replicaSet=rs0
|
|
233
242
|
name: 'default',
|
|
234
243
|
},
|
|
235
244
|
mailer: {
|
package/docker-compose.yml
CHANGED