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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
apiVersion: apps/v1
|
|
3
|
+
kind: StatefulSet
|
|
4
|
+
metadata:
|
|
5
|
+
name: service-valkey
|
|
6
|
+
namespace: default
|
|
7
|
+
spec:
|
|
8
|
+
serviceName: service-valkey
|
|
9
|
+
replicas: 1
|
|
10
|
+
selector:
|
|
11
|
+
matchLabels:
|
|
12
|
+
app: service-valkey
|
|
13
|
+
template:
|
|
14
|
+
metadata:
|
|
15
|
+
labels:
|
|
16
|
+
app: service-valkey
|
|
17
|
+
spec:
|
|
18
|
+
containers:
|
|
19
|
+
- name: service-valkey
|
|
20
|
+
image: docker.io/valkey/valkey:latest
|
|
21
|
+
env:
|
|
22
|
+
- name: TZ
|
|
23
|
+
value: Europe/Zurich
|
|
24
|
+
ports:
|
|
25
|
+
- containerPort: 6379
|
|
26
|
+
startupProbe:
|
|
27
|
+
tcpSocket:
|
|
28
|
+
port: 6379
|
|
29
|
+
failureThreshold: 30
|
|
30
|
+
periodSeconds: 5
|
|
31
|
+
timeoutSeconds: 5
|
|
32
|
+
livenessProbe:
|
|
33
|
+
tcpSocket:
|
|
34
|
+
port: 6379
|
|
35
|
+
failureThreshold: 2
|
|
36
|
+
periodSeconds: 30
|
|
37
|
+
timeoutSeconds: 5
|
|
38
|
+
restartPolicy: Always
|
|
39
|
+
automountServiceAccountToken: false
|
package/package.json
CHANGED
|
@@ -1,135 +1,145 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
2
|
+
"type": "module",
|
|
3
|
+
"main": "src/index.js",
|
|
4
|
+
"name": "underpost",
|
|
5
|
+
"version": "2.8.31",
|
|
6
|
+
"description": "pwa api rest template",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
|
|
9
|
+
"pm2": "env-cmd -f .env.production pm2 start src/server.js --node-args=\"--max-old-space-size=8192\" --name engine && pm2 logs",
|
|
10
|
+
"ssl": "env-cmd -f .env.production node bin/ssl",
|
|
11
|
+
"pm2-delete": "pm2 delete engine",
|
|
12
|
+
"build": "node bin/deploy build-full-client && node bin/deploy fix-deps",
|
|
13
|
+
"build-production": "env-cmd -f .env.production node bin/deploy build-full-client",
|
|
14
|
+
"dev": "env-cmd -f .env.development node src/client.dev default",
|
|
15
|
+
"dev-api": "env-cmd -f .env.development nodemon --watch src --ignore src/client src/api",
|
|
16
|
+
"docs": "jsdoc -c jsdoc.json",
|
|
17
|
+
"backup": "node bin/db default.net/ export",
|
|
18
|
+
"install-template": "npm install && npm run build",
|
|
19
|
+
"install-global": "npm install -g pm2 && npm install -g jsdoc && npm install -g prettier && npm install -g env-cmd && npm install -g yarn && npm install -g auto-changelog",
|
|
20
|
+
"install-test": "npm install -g mocha && npm install -g c8 && npm install -g nyc && npm install -g coveralls",
|
|
21
|
+
"install-vs-extensions": "node bin/vs import",
|
|
22
|
+
"preinstall": "npm config set audit false && npm config set loglevel error",
|
|
23
|
+
"restore-preinstall": "npm config set audit true && npm config set loglevel notice",
|
|
24
|
+
"install": "npm run install-global && npm run install-test && npm run restore-preinstall --no-audit --no-warnings",
|
|
25
|
+
"docker:start": "docker-compose up",
|
|
26
|
+
"prettier": "prettier --write .",
|
|
27
|
+
"coveralls": "nyc npm run test --reporter=text-lcov | coveralls -v",
|
|
28
|
+
"test": "env-cmd -f .env.test c8 mocha",
|
|
29
|
+
"update": "npm update -g && npm update && npm audit fix --force && npm audit fix --force",
|
|
30
|
+
"underpost-publish": "npm publish --provenance --access public",
|
|
31
|
+
"underpost-unpublish": "npm unpublish underpost@2.5.x",
|
|
32
|
+
"login": "npm adduser",
|
|
33
|
+
"bin": "npm link --force"
|
|
34
|
+
},
|
|
35
|
+
"bin": {
|
|
36
|
+
"underpost": "bin/index.js"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/underpostnet/pwa-microservices-template.git"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"engine",
|
|
44
|
+
"server",
|
|
45
|
+
"proxy",
|
|
46
|
+
"client"
|
|
47
|
+
],
|
|
48
|
+
"author": "https://github.com/underpostnet",
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/underpostnet/pwa-microservices-template/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/underpostnet/pwa-microservices-template#readme",
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@fortawesome/fontawesome-free": "^6.4.2",
|
|
56
|
+
"@fullcalendar/rrule": "^6.1.15",
|
|
57
|
+
"@google/generative-ai": "^0.21.0",
|
|
58
|
+
"@loadingio/css-spinner": "^2.0.2",
|
|
59
|
+
"@neodrag/vanilla": "^2.0.3",
|
|
60
|
+
"@nomiclabs/hardhat-ethers": "^2.2.3",
|
|
61
|
+
"@nomiclabs/hardhat-etherscan": "^3.1.8",
|
|
62
|
+
"@nomiclabs/hardhat-waffle": "^2.0.6",
|
|
63
|
+
"@openzeppelin/contracts": "^5.0.2",
|
|
64
|
+
"adm-zip": "^0.5.10",
|
|
65
|
+
"ag-grid-community": "31.0.0",
|
|
66
|
+
"axios": "^1.5.1",
|
|
67
|
+
"chai": "^5.1.0",
|
|
68
|
+
"cli-progress": "^3.12.0",
|
|
69
|
+
"cli-spinners": "^3.0.0",
|
|
70
|
+
"clipboardy": "^4.0.0",
|
|
71
|
+
"color": "^4.2.3",
|
|
72
|
+
"colors": "^1.4.0",
|
|
73
|
+
"commander": "^12.1.0",
|
|
74
|
+
"compression": "^1.7.4",
|
|
75
|
+
"cors": "^2.8.5",
|
|
76
|
+
"d3": "^7.9.0",
|
|
77
|
+
"deepmerge": "^4.3.1",
|
|
78
|
+
"detect-port": "^1.5.1",
|
|
79
|
+
"dotenv": "^16.3.1",
|
|
80
|
+
"easymde": "^2.18.0",
|
|
81
|
+
"env-cmd": "^10.1.0",
|
|
82
|
+
"eventemitter3": "^5.0.1",
|
|
83
|
+
"express": "^4.18.2",
|
|
84
|
+
"express-fileupload": "^1.4.3",
|
|
85
|
+
"favicons": "^7.2.0",
|
|
86
|
+
"font-awesome-assets": "^0.0.9",
|
|
87
|
+
"fs-extra": "^11.1.1",
|
|
88
|
+
"fullcalendar": "^6.1.15",
|
|
89
|
+
"html-minifier-terser": "^7.2.0",
|
|
90
|
+
"http-proxy-middleware": "^2.0.6",
|
|
91
|
+
"ignore-walk": "^6.0.4",
|
|
92
|
+
"iovalkey": "^0.2.1",
|
|
93
|
+
"is-admin": "^4.0.0",
|
|
94
|
+
"is-ip": "^5.0.1",
|
|
95
|
+
"jimp": "^0.22.12",
|
|
96
|
+
"joystick-controller": "^1.0.15",
|
|
97
|
+
"json-colorizer": "^2.2.2",
|
|
98
|
+
"jsonwebtoken": "^9.0.2",
|
|
99
|
+
"keyword-extractor": "^0.0.28",
|
|
100
|
+
"kill-port-process": "^3.2.0",
|
|
101
|
+
"log-update": "^6.0.0",
|
|
102
|
+
"mariadb": "^3.2.2",
|
|
103
|
+
"marked": "^12.0.2",
|
|
104
|
+
"mongoose": "^8.9.5",
|
|
105
|
+
"morgan": "^1.10.0",
|
|
106
|
+
"nodemailer": "^6.9.9",
|
|
107
|
+
"nodemon": "^3.0.1",
|
|
108
|
+
"pathfinding": "^0.4.18",
|
|
109
|
+
"peer": "^1.0.2",
|
|
110
|
+
"peerjs": "^1.5.2",
|
|
111
|
+
"pixi.js": "7.4.2",
|
|
112
|
+
"prom-client": "^15.1.2",
|
|
113
|
+
"public-ip": "^6.0.1",
|
|
114
|
+
"read": "^2.1.0",
|
|
115
|
+
"rrule": "^2.8.1",
|
|
116
|
+
"sharp": "^0.32.5",
|
|
117
|
+
"shelljs": "^0.8.5",
|
|
118
|
+
"simple-git": "^3.26.0",
|
|
119
|
+
"simple-icons": "^13.9.0",
|
|
120
|
+
"sitemap": "^7.1.1",
|
|
121
|
+
"socket.io": "^4.8.0",
|
|
122
|
+
"sortablejs": "^1.15.0",
|
|
123
|
+
"split-file": "^2.3.0",
|
|
124
|
+
"swagger-ui-express": "^5.0.0",
|
|
125
|
+
"systeminformation": "^5.23.7",
|
|
126
|
+
"uglify-js": "^3.17.4",
|
|
127
|
+
"validator": "^13.11.0",
|
|
128
|
+
"vanilla-jsoneditor": "^2.3.2",
|
|
129
|
+
"web3": "^4.13.0",
|
|
130
|
+
"winston": "^3.11.0"
|
|
131
|
+
},
|
|
132
|
+
"devDependencies": {
|
|
133
|
+
"clean-jsdoc-theme": "^4.3.0",
|
|
134
|
+
"easy-json-schema": "^0.0.2-beta",
|
|
135
|
+
"hardhat": "^2.22.13",
|
|
136
|
+
"mocha": "^10.4.0",
|
|
137
|
+
"plantuml": "^0.0.2",
|
|
138
|
+
"swagger-autogen": "^2.23.7"
|
|
139
|
+
},
|
|
140
|
+
"publishConfig": {
|
|
141
|
+
"provenance": true,
|
|
142
|
+
"access": "public",
|
|
143
|
+
"registry": "https://registry.npmjs.org/"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -26,7 +26,11 @@ const UserSchema = new Schema(
|
|
|
26
26
|
profileImageId: { type: Schema.Types.ObjectId, ref: 'File' },
|
|
27
27
|
phoneNumbers: [
|
|
28
28
|
{
|
|
29
|
-
type: {
|
|
29
|
+
type: {
|
|
30
|
+
type: String,
|
|
31
|
+
enum: ['office', 'home', 'private'],
|
|
32
|
+
},
|
|
33
|
+
number: { type: String },
|
|
30
34
|
},
|
|
31
35
|
],
|
|
32
36
|
publicKey: {
|
|
@@ -58,6 +62,10 @@ const UserDto = {
|
|
|
58
62
|
},
|
|
59
63
|
},
|
|
60
64
|
auth: {
|
|
65
|
+
// TODO: -> set login device, location, ip, fingerprint
|
|
66
|
+
// and validate on authorization middleware
|
|
67
|
+
// -> dynamic refresh 100 tokens per session with 12h interval
|
|
68
|
+
// -> back secret per user, registrarion user model -> secret: { type: String }
|
|
61
69
|
payload: (user) => ({ _id: user._id.toString(), role: user.role, email: user.email }),
|
|
62
70
|
},
|
|
63
71
|
};
|
|
@@ -237,7 +237,7 @@ const UserService = {
|
|
|
237
237
|
const validatePassword = validatePasswordMiddleware(req.body.password);
|
|
238
238
|
if (validatePassword.status === 'error') throw new Error(validatePassword.message);
|
|
239
239
|
req.body.password = await hashPassword(req.body.password);
|
|
240
|
-
req.body.role = 'user';
|
|
240
|
+
req.body.role = req.body.role === 'guest' ? 'guest' : 'user';
|
|
241
241
|
req.body.profileImageId = await getDefaultProfileImageId(File);
|
|
242
242
|
const { _id } = await new User(req.body).save();
|
|
243
243
|
if (_id) {
|
|
@@ -300,8 +300,10 @@ const Account = {
|
|
|
300
300
|
s(`.account-profile-image`).style.opacity = 0;
|
|
301
301
|
for (const inputData of this.formData)
|
|
302
302
|
if (s(`.${inputData.id}`)) s(`.${inputData.id}`).value = user[inputData.model];
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
if (LogIn.Scope.user.main.model.user.profileImage) {
|
|
304
|
+
s(`.account-profile-image`).src = LogIn.Scope.user.main.model.user.profileImage.imageSrc;
|
|
305
|
+
s(`.account-profile-image`).style.opacity = 1;
|
|
306
|
+
}
|
|
305
307
|
},
|
|
306
308
|
};
|
|
307
309
|
|
|
@@ -46,8 +46,8 @@ const Auth = {
|
|
|
46
46
|
) {
|
|
47
47
|
try {
|
|
48
48
|
localStorage.setItem('jwt', result.data.token);
|
|
49
|
-
await Auth.sessionIn();
|
|
50
49
|
await SignUp.Trigger(result.data);
|
|
50
|
+
await Auth.sessionIn();
|
|
51
51
|
} catch (error) {
|
|
52
52
|
logger.error(error);
|
|
53
53
|
localStorage.removeItem('jwt');
|
|
@@ -76,7 +76,7 @@ const Auth = {
|
|
|
76
76
|
await LogIn.Trigger({ user: data.user });
|
|
77
77
|
await Account.updateForm(data.user);
|
|
78
78
|
return { user: data.user };
|
|
79
|
-
}
|
|
79
|
+
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
// anon guest session
|