@underpostnet/underpost 2.8.5 → 2.8.7
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/.github/workflows/ghpkg.yml +1 -1
- package/.github/workflows/npmpkg.yml +1 -1
- package/.github/workflows/pwa-microservices-template.page.yml +1 -1
- package/.vscode/extensions.json +3 -2
- package/.vscode/settings.json +6 -0
- package/CHANGELOG.md +44 -0
- package/Dockerfile +9 -10
- package/README.md +39 -2
- package/bin/build.js +31 -6
- package/bin/deploy.js +1404 -202
- package/bin/file.js +8 -0
- package/bin/hwt.js +0 -10
- package/bin/index.js +1 -187
- package/bin/util.js +0 -7
- package/bin/vs.js +1 -0
- package/cli.md +451 -0
- package/conf.js +0 -2
- package/docker-compose.yml +1 -1
- package/jsdoc.json +1 -1
- package/manifests/calico-custom-resources.yaml +25 -0
- package/manifests/deployment/adminer/deployment.yaml +32 -0
- package/manifests/deployment/adminer/kustomization.yaml +7 -0
- package/manifests/deployment/adminer/service.yaml +13 -0
- package/manifests/deployment/fastapi/backend-deployment.yml +120 -0
- package/manifests/deployment/fastapi/backend-service.yml +19 -0
- package/manifests/deployment/fastapi/frontend-deployment.yml +54 -0
- package/manifests/deployment/fastapi/frontend-service.yml +15 -0
- package/manifests/deployment/kafka/deployment.yaml +69 -0
- package/manifests/kind-config-dev.yaml +12 -0
- package/manifests/kubeadm-calico-config.yaml +119 -0
- package/manifests/mongodb/kustomization.yaml +2 -2
- package/manifests/mongodb-4.4/kustomization.yaml +7 -0
- package/manifests/mongodb-4.4/service-deployment.yaml +63 -0
- package/manifests/postgresql/configmap.yaml +9 -0
- package/manifests/postgresql/kustomization.yaml +10 -0
- package/manifests/postgresql/pv.yaml +15 -0
- package/manifests/postgresql/pvc.yaml +13 -0
- package/manifests/{core/underpost-engine-headless-service.yaml → postgresql/service.yaml} +3 -3
- package/manifests/postgresql/statefulset.yaml +37 -0
- package/manifests/valkey/statefulset.yaml +6 -4
- package/package.json +10 -14
- package/src/api/default/default.service.js +1 -1
- package/src/api/user/user.service.js +14 -11
- package/src/cli/cluster.js +298 -63
- package/src/cli/cron.js +39 -8
- package/src/cli/db.js +118 -44
- package/src/cli/deploy.js +312 -102
- package/src/cli/env.js +9 -3
- package/src/cli/fs.js +161 -0
- package/src/cli/image.js +45 -104
- package/src/cli/index.js +312 -0
- package/src/cli/monitor.js +236 -0
- package/src/cli/repository.js +26 -2
- package/src/cli/script.js +25 -1
- package/src/cli/test.js +39 -4
- package/src/client/components/core/Account.js +28 -24
- package/src/client/components/core/Blockchain.js +1 -1
- package/src/client/components/core/CalendarCore.js +14 -73
- package/src/client/components/core/CommonJs.js +54 -2
- package/src/client/components/core/Css.js +0 -1
- package/src/client/components/core/CssCore.js +10 -4
- package/src/client/components/core/Docs.js +1 -2
- package/src/client/components/core/EventsUI.js +3 -3
- package/src/client/components/core/FileExplorer.js +86 -78
- package/src/client/components/core/Input.js +4 -2
- package/src/client/components/core/JoyStick.js +2 -2
- package/src/client/components/core/LoadingAnimation.js +3 -12
- package/src/client/components/core/LogIn.js +3 -3
- package/src/client/components/core/LogOut.js +1 -1
- package/src/client/components/core/Modal.js +44 -14
- package/src/client/components/core/Panel.js +26 -66
- package/src/client/components/core/PanelForm.js +22 -15
- package/src/client/components/core/Recover.js +3 -3
- package/src/client/components/core/RichText.js +1 -11
- package/src/client/components/core/Router.js +3 -1
- package/src/client/components/core/SignUp.js +2 -2
- package/src/client/components/default/RoutesDefault.js +3 -2
- package/src/client/services/core/core.service.js +15 -10
- package/src/client/services/default/default.management.js +45 -38
- package/src/client/ssr/Render.js +6 -1
- package/src/client/ssr/body/CacheControl.js +2 -3
- package/src/client/sw/default.sw.js +3 -3
- package/src/db/mongo/MongooseDB.js +17 -1
- package/src/index.js +25 -1
- package/src/mailer/MailerProvider.js +3 -0
- package/src/runtime/lampp/Dockerfile +65 -0
- package/src/server/backup.js +3 -3
- package/src/server/client-build.js +45 -23
- package/src/server/client-formatted.js +2 -1
- package/src/server/conf.js +110 -16
- package/src/server/dns.js +74 -43
- package/src/server/downloader.js +0 -8
- package/src/server/json-schema.js +77 -0
- package/src/server/network.js +7 -122
- package/src/server/peer.js +2 -2
- package/src/server/proxy.js +4 -4
- package/src/server/runtime.js +40 -12
- package/src/server/start.js +122 -0
- package/src/server/valkey.js +25 -11
- package/test/api.test.js +0 -8
- package/manifests/core/kustomization.yaml +0 -11
- package/manifests/core/underpost-engine-backup-access.yaml +0 -16
- package/manifests/core/underpost-engine-backup-pv-pvc.yaml +0 -22
- package/manifests/core/underpost-engine-mongodb-backup-cronjob.yaml +0 -40
- package/manifests/core/underpost-engine-mongodb-configmap.yaml +0 -26
- package/manifests/core/underpost-engine-statefulset.yaml +0 -91
- package/manifests/valkey/underpost-engine-valkey-service.yaml +0 -17
- package/manifests/valkey/underpost-engine-valkey-statefulset.yaml +0 -39
- /package/manifests/{core/underpost-engine-pv-pvc.yaml → mongodb-4.4/pv-pvc.yaml} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
apiVersion: apps/v1
|
|
2
|
+
kind: Deployment
|
|
3
|
+
metadata:
|
|
4
|
+
name: react-frontend
|
|
5
|
+
labels:
|
|
6
|
+
app: react-frontend
|
|
7
|
+
spec:
|
|
8
|
+
replicas: 2
|
|
9
|
+
selector:
|
|
10
|
+
matchLabels:
|
|
11
|
+
app: react-frontend
|
|
12
|
+
template:
|
|
13
|
+
metadata:
|
|
14
|
+
labels:
|
|
15
|
+
app: react-frontend
|
|
16
|
+
spec:
|
|
17
|
+
containers:
|
|
18
|
+
- name: react-frontend-container
|
|
19
|
+
image: localhost/fastapi-frontend:latest
|
|
20
|
+
imagePullPolicy: IfNotPresent
|
|
21
|
+
|
|
22
|
+
ports:
|
|
23
|
+
- containerPort: 80
|
|
24
|
+
name: http-web
|
|
25
|
+
|
|
26
|
+
env:
|
|
27
|
+
- name: VITE_FASTAPI_URL
|
|
28
|
+
value: '/api'
|
|
29
|
+
|
|
30
|
+
livenessProbe:
|
|
31
|
+
httpGet:
|
|
32
|
+
path: /
|
|
33
|
+
port: 80
|
|
34
|
+
initialDelaySeconds: 5
|
|
35
|
+
periodSeconds: 10
|
|
36
|
+
timeoutSeconds: 3
|
|
37
|
+
failureThreshold: 3
|
|
38
|
+
|
|
39
|
+
readinessProbe:
|
|
40
|
+
httpGet:
|
|
41
|
+
path: /
|
|
42
|
+
port: 80
|
|
43
|
+
initialDelaySeconds: 3
|
|
44
|
+
periodSeconds: 5
|
|
45
|
+
timeoutSeconds: 3
|
|
46
|
+
failureThreshold: 3
|
|
47
|
+
|
|
48
|
+
resources:
|
|
49
|
+
requests:
|
|
50
|
+
cpu: 100m
|
|
51
|
+
memory: 128Mi
|
|
52
|
+
limits:
|
|
53
|
+
cpu: 500m
|
|
54
|
+
memory: 512Mi
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
apiVersion: apps/v1
|
|
2
|
+
kind: StatefulSet
|
|
3
|
+
metadata:
|
|
4
|
+
name: kafka
|
|
5
|
+
namespace: kafka
|
|
6
|
+
labels:
|
|
7
|
+
app: kafka-app
|
|
8
|
+
spec:
|
|
9
|
+
serviceName: kafka-svc
|
|
10
|
+
replicas: 3
|
|
11
|
+
selector:
|
|
12
|
+
matchLabels:
|
|
13
|
+
app: kafka-app
|
|
14
|
+
template:
|
|
15
|
+
metadata:
|
|
16
|
+
labels:
|
|
17
|
+
app: kafka-app
|
|
18
|
+
spec:
|
|
19
|
+
containers:
|
|
20
|
+
- name: kafka-container
|
|
21
|
+
image: doughgle/kafka-kraft
|
|
22
|
+
ports:
|
|
23
|
+
- containerPort: 9092
|
|
24
|
+
- containerPort: 9093
|
|
25
|
+
env:
|
|
26
|
+
- name: REPLICAS
|
|
27
|
+
value: '3'
|
|
28
|
+
- name: SERVICE
|
|
29
|
+
value: kafka-svc
|
|
30
|
+
- name: NAMESPACE
|
|
31
|
+
value: kafka
|
|
32
|
+
- name: SHARE_DIR
|
|
33
|
+
value: /mnt/kafka
|
|
34
|
+
- name: CLUSTER_ID
|
|
35
|
+
value: bXktY2x1c3Rlci0xMjM0NQ==
|
|
36
|
+
- name: DEFAULT_REPLICATION_FACTOR
|
|
37
|
+
value: '3'
|
|
38
|
+
- name: DEFAULT_MIN_INSYNC_REPLICAS
|
|
39
|
+
value: '2'
|
|
40
|
+
volumeMounts:
|
|
41
|
+
- name: data
|
|
42
|
+
mountPath: /mnt/kafka
|
|
43
|
+
volumeClaimTemplates:
|
|
44
|
+
- metadata:
|
|
45
|
+
name: data
|
|
46
|
+
spec:
|
|
47
|
+
accessModes:
|
|
48
|
+
- 'ReadWriteOnce'
|
|
49
|
+
resources:
|
|
50
|
+
requests:
|
|
51
|
+
storage: '1Gi'
|
|
52
|
+
---
|
|
53
|
+
apiVersion: v1
|
|
54
|
+
kind: Service
|
|
55
|
+
metadata:
|
|
56
|
+
name: kafka-svc
|
|
57
|
+
namespace: kafka
|
|
58
|
+
labels:
|
|
59
|
+
app: kafka-app
|
|
60
|
+
spec:
|
|
61
|
+
type: NodePort
|
|
62
|
+
ports:
|
|
63
|
+
- name: '9092'
|
|
64
|
+
port: 9092
|
|
65
|
+
protocol: TCP
|
|
66
|
+
targetPort: 9092
|
|
67
|
+
nodePort: 30092
|
|
68
|
+
selector:
|
|
69
|
+
app: kafka-app
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
kind: Cluster
|
|
2
|
+
apiVersion: kind.x-k8s.io/v1alpha4
|
|
3
|
+
nodes:
|
|
4
|
+
- role: control-plane
|
|
5
|
+
- role: worker
|
|
6
|
+
# extraPortMappings:
|
|
7
|
+
# - containerPort: 80
|
|
8
|
+
# hostPort: 80
|
|
9
|
+
# listenAddress: '0.0.0.0'
|
|
10
|
+
# - containerPort: 443
|
|
11
|
+
# hostPort: 443
|
|
12
|
+
# listenAddress: '0.0.0.0'
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# This consolidated YAML file contains configurations for:
|
|
2
|
+
# 1. Calico Installation (Installation and APIServer resources)
|
|
3
|
+
# 2. A permissive Egress NetworkPolicy for the 'default' namespace
|
|
4
|
+
#
|
|
5
|
+
# These are standard Kubernetes resources that can be applied directly using 'kubectl apply'.
|
|
6
|
+
# The kubeadm-specific ClusterConfiguration and InitConfiguration have been removed
|
|
7
|
+
# as they are only processed by the 'kubeadm init' command, not 'kubectl apply'.
|
|
8
|
+
|
|
9
|
+
# --- Calico Installation: Base configuration for Calico ---
|
|
10
|
+
# For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.Installation
|
|
11
|
+
apiVersion: operator.tigera.io/v1
|
|
12
|
+
kind: Installation
|
|
13
|
+
metadata:
|
|
14
|
+
name: default
|
|
15
|
+
spec:
|
|
16
|
+
# Configures Calico networking.
|
|
17
|
+
calicoNetwork:
|
|
18
|
+
# Note: The ipPools section cannot be modified post-install.
|
|
19
|
+
ipPools:
|
|
20
|
+
- blockSize: 26
|
|
21
|
+
cidr: 192.168.0.0/16
|
|
22
|
+
encapsulation: VXLANCrossSubnet
|
|
23
|
+
natOutgoing: Enabled
|
|
24
|
+
nodeSelector: all()
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
# This section configures the Calico API server.
|
|
28
|
+
# For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.APIServer
|
|
29
|
+
apiVersion: operator.tigera.io/v1
|
|
30
|
+
kind: APIServer
|
|
31
|
+
metadata:
|
|
32
|
+
name: default
|
|
33
|
+
spec: {}
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
# This consolidated NetworkPolicy file ensures that all pods in the specified namespaces
|
|
37
|
+
# have unrestricted egress (outbound) access.
|
|
38
|
+
# This is useful for troubleshooting or for environments where strict egress control
|
|
39
|
+
# is not immediately required for these system/default namespaces.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
# Policy for the 'default' namespace
|
|
43
|
+
apiVersion: networking.k8s.io/v1
|
|
44
|
+
kind: NetworkPolicy
|
|
45
|
+
metadata:
|
|
46
|
+
name: allow-all-egress-default-namespace
|
|
47
|
+
namespace: default # This policy applies to the 'default' namespace
|
|
48
|
+
spec:
|
|
49
|
+
podSelector: {} # Selects all pods in this namespace
|
|
50
|
+
policyTypes:
|
|
51
|
+
- Egress
|
|
52
|
+
egress:
|
|
53
|
+
- to:
|
|
54
|
+
- ipBlock:
|
|
55
|
+
cidr: 0.0.0.0/0 # Allows traffic to any IPv4 address
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
# Policy for the 'kube-system' namespace
|
|
59
|
+
apiVersion: networking.k8s.io/v1
|
|
60
|
+
kind: NetworkPolicy
|
|
61
|
+
metadata:
|
|
62
|
+
name: allow-all-egress-kube-system-namespace
|
|
63
|
+
namespace: kube-system # This policy applies to the 'kube-system' namespace
|
|
64
|
+
spec:
|
|
65
|
+
podSelector: {} # Selects all pods in this namespace
|
|
66
|
+
policyTypes:
|
|
67
|
+
- Egress
|
|
68
|
+
egress:
|
|
69
|
+
- to:
|
|
70
|
+
- ipBlock:
|
|
71
|
+
cidr: 0.0.0.0/0 # Allows traffic to any IPv4 address
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
# Policy for the 'kube-node-lease' namespace
|
|
75
|
+
apiVersion: networking.k8s.io/v1
|
|
76
|
+
kind: NetworkPolicy
|
|
77
|
+
metadata:
|
|
78
|
+
name: allow-all-egress-kube-node-lease-namespace
|
|
79
|
+
namespace: kube-node-lease # This policy applies to the 'kube-node-lease' namespace
|
|
80
|
+
spec:
|
|
81
|
+
podSelector: {} # Selects all pods in this namespace
|
|
82
|
+
policyTypes:
|
|
83
|
+
- Egress
|
|
84
|
+
egress:
|
|
85
|
+
- to:
|
|
86
|
+
- ipBlock:
|
|
87
|
+
cidr: 0.0.0.0/0 # Allows traffic to any IPv4 address
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
# Policy for the 'kube-public' namespace
|
|
91
|
+
apiVersion: networking.k8s.io/v1
|
|
92
|
+
kind: NetworkPolicy
|
|
93
|
+
metadata:
|
|
94
|
+
name: allow-all-egress-kube-public-namespace
|
|
95
|
+
namespace: kube-public # This policy applies to the 'kube-public' namespace
|
|
96
|
+
spec:
|
|
97
|
+
podSelector: {} # Selects all pods in this namespace
|
|
98
|
+
policyTypes:
|
|
99
|
+
- Egress
|
|
100
|
+
egress:
|
|
101
|
+
- to:
|
|
102
|
+
- ipBlock:
|
|
103
|
+
cidr: 0.0.0.0/0 # Allows traffic to any IPv4 address
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
# Policy for the 'tigera-operator' namespace
|
|
107
|
+
apiVersion: networking.k8s.io/v1
|
|
108
|
+
kind: NetworkPolicy
|
|
109
|
+
metadata:
|
|
110
|
+
name: allow-all-egress-tigera-operator-namespace
|
|
111
|
+
namespace: tigera-operator # This policy applies to the 'tigera-operator' namespace
|
|
112
|
+
spec:
|
|
113
|
+
podSelector: {} # Selects all pods in this namespace
|
|
114
|
+
policyTypes:
|
|
115
|
+
- Egress
|
|
116
|
+
egress:
|
|
117
|
+
- to:
|
|
118
|
+
- ipBlock:
|
|
119
|
+
cidr: 0.0.0.0/0 # Allows traffic to any IPv4 address
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
apiVersion: apps/v1
|
|
2
|
+
kind: Deployment
|
|
3
|
+
metadata:
|
|
4
|
+
name: mongodb-deployment
|
|
5
|
+
namespace: default
|
|
6
|
+
spec:
|
|
7
|
+
selector:
|
|
8
|
+
matchLabels:
|
|
9
|
+
app: mongodb
|
|
10
|
+
replicas: 1
|
|
11
|
+
template:
|
|
12
|
+
metadata:
|
|
13
|
+
labels:
|
|
14
|
+
app: mongodb
|
|
15
|
+
spec:
|
|
16
|
+
hostname: mongo
|
|
17
|
+
containers:
|
|
18
|
+
- name: mongodb
|
|
19
|
+
image: mongo:4.4
|
|
20
|
+
command: ['mongod', '--replSet', 'rs0', '--bind_ip_all']
|
|
21
|
+
# -- bash
|
|
22
|
+
# mongo
|
|
23
|
+
# use admin
|
|
24
|
+
# rs.initiate()
|
|
25
|
+
ports:
|
|
26
|
+
- containerPort: 27017
|
|
27
|
+
|
|
28
|
+
volumeMounts:
|
|
29
|
+
- name: mongo-persistent-storage
|
|
30
|
+
mountPath: /data/db
|
|
31
|
+
|
|
32
|
+
# resources:
|
|
33
|
+
# requests:
|
|
34
|
+
# memory: '500Mi'
|
|
35
|
+
# cpu: '500m'
|
|
36
|
+
volumes:
|
|
37
|
+
- name: mongo-persistent-storage
|
|
38
|
+
persistentVolumeClaim:
|
|
39
|
+
claimName: mongodb-pvc
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
apiVersion: v1
|
|
43
|
+
kind: Service
|
|
44
|
+
metadata:
|
|
45
|
+
name: mongodb-service
|
|
46
|
+
namespace: default
|
|
47
|
+
spec:
|
|
48
|
+
clusterIP: None
|
|
49
|
+
selector:
|
|
50
|
+
app: mongodb
|
|
51
|
+
ports:
|
|
52
|
+
- protocol: TCP
|
|
53
|
+
port: 27017
|
|
54
|
+
# targetPort: 27017
|
|
55
|
+
# type: ClusterIP
|
|
56
|
+
|
|
57
|
+
# rs.initiate();
|
|
58
|
+
# use admin;
|
|
59
|
+
# rs.initiate({ _id: "rs0", members: [ { _id: 0, host: "127.0.0.1:27017" } ] })
|
|
60
|
+
# db.createUser({user: "your_user",pwd: "your_password", roles: [{role: "userAdminAnyDatabase", db: "admin" },{ role: "readWriteAnyDatabase", db: "admin" }]});
|
|
61
|
+
# cfg = rs.conf();
|
|
62
|
+
# cfg.members[0].host = "127.0.0.1:27027";
|
|
63
|
+
# rs.reconfig(cfg);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
kind: PersistentVolume
|
|
2
|
+
apiVersion: v1
|
|
3
|
+
metadata:
|
|
4
|
+
name: postgres-pv-volume
|
|
5
|
+
labels:
|
|
6
|
+
type: local
|
|
7
|
+
app: postgres
|
|
8
|
+
spec:
|
|
9
|
+
storageClassName: manual
|
|
10
|
+
capacity:
|
|
11
|
+
storage: 5Gi
|
|
12
|
+
accessModes:
|
|
13
|
+
- ReadWriteMany
|
|
14
|
+
hostPath:
|
|
15
|
+
path: '/mnt/data'
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
apiVersion: apps/v1
|
|
2
|
+
kind: StatefulSet
|
|
3
|
+
metadata:
|
|
4
|
+
name: postgres
|
|
5
|
+
spec:
|
|
6
|
+
serviceName: postgres
|
|
7
|
+
replicas: 3
|
|
8
|
+
selector:
|
|
9
|
+
matchLabels:
|
|
10
|
+
app: postgres
|
|
11
|
+
template:
|
|
12
|
+
metadata:
|
|
13
|
+
labels:
|
|
14
|
+
app: postgres
|
|
15
|
+
spec:
|
|
16
|
+
containers:
|
|
17
|
+
- name: postgres
|
|
18
|
+
image: postgres:latest
|
|
19
|
+
imagePullPolicy: Never
|
|
20
|
+
ports:
|
|
21
|
+
- containerPort: 5432
|
|
22
|
+
envFrom:
|
|
23
|
+
- configMapRef:
|
|
24
|
+
name: postgres-config
|
|
25
|
+
env:
|
|
26
|
+
- name: POSTGRES_PASSWORD
|
|
27
|
+
valueFrom:
|
|
28
|
+
secretKeyRef:
|
|
29
|
+
name: postgres-secret
|
|
30
|
+
key: password
|
|
31
|
+
volumeMounts:
|
|
32
|
+
- mountPath: /var/lib/postgresql/data
|
|
33
|
+
name: postgredb
|
|
34
|
+
volumes:
|
|
35
|
+
- name: postgredb
|
|
36
|
+
persistentVolumeClaim:
|
|
37
|
+
claimName: postgres-pv-claim
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
---
|
|
2
1
|
apiVersion: apps/v1
|
|
3
2
|
kind: StatefulSet
|
|
4
3
|
metadata:
|
|
@@ -15,9 +14,14 @@ spec:
|
|
|
15
14
|
labels:
|
|
16
15
|
app: service-valkey
|
|
17
16
|
spec:
|
|
17
|
+
# Prevent automatic token mounting if you're not using the default ServiceAccount
|
|
18
|
+
automountServiceAccountToken: false
|
|
19
|
+
|
|
18
20
|
containers:
|
|
19
21
|
- name: service-valkey
|
|
20
|
-
image:
|
|
22
|
+
image: valkey/valkey:latest
|
|
23
|
+
# Ensure you pull only if not present (Never will error if missing)
|
|
24
|
+
imagePullPolicy: Never
|
|
21
25
|
env:
|
|
22
26
|
- name: TZ
|
|
23
27
|
value: Europe/Zurich
|
|
@@ -35,5 +39,3 @@ spec:
|
|
|
35
39
|
failureThreshold: 2
|
|
36
40
|
periodSeconds: 30
|
|
37
41
|
timeoutSeconds: 5
|
|
38
|
-
restartPolicy: Always
|
|
39
|
-
automountServiceAccountToken: false
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"main": "src/index.js",
|
|
4
4
|
"name": "@underpostnet/underpost",
|
|
5
|
-
"version": "2.8.
|
|
5
|
+
"version": "2.8.7",
|
|
6
6
|
"description": "pwa api rest template",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
"pm2": "env-cmd -f .env.production pm2 start src/server.js --node-args=\"--max-old-space-size=8192\" --name engine",
|
|
11
11
|
"dev": "env-cmd -f .env.development node src/client.dev default",
|
|
12
12
|
"dev-img": "env-cmd -f .env.development node src/server",
|
|
13
|
+
"prod-img": "env-cmd -f .env.production node src/server",
|
|
14
|
+
"monitor": "pm2 start bin/deploy.js --name monitor -- monitor",
|
|
13
15
|
"dev-api": "env-cmd -f .env.development nodemon --watch src --ignore src/client src/api",
|
|
14
16
|
"dev-client": "env-cmd -f .env.development node src/client.dev",
|
|
15
17
|
"proxy": "node src/proxy proxy",
|
|
@@ -56,9 +58,11 @@
|
|
|
56
58
|
"ag-grid-community": "31.0.0",
|
|
57
59
|
"axios": "^1.5.1",
|
|
58
60
|
"chai": "^5.1.0",
|
|
61
|
+
"clean-jsdoc-theme": "^4.3.0",
|
|
59
62
|
"cli-progress": "^3.12.0",
|
|
60
63
|
"cli-spinners": "^3.0.0",
|
|
61
64
|
"clipboardy": "^4.0.0",
|
|
65
|
+
"cloudinary": "^2.5.1",
|
|
62
66
|
"color": "^4.2.3",
|
|
63
67
|
"colors": "^1.4.0",
|
|
64
68
|
"commander": "^12.1.0",
|
|
@@ -86,6 +90,7 @@
|
|
|
86
90
|
"log-update": "^6.0.0",
|
|
87
91
|
"mariadb": "^3.2.2",
|
|
88
92
|
"marked": "^12.0.2",
|
|
93
|
+
"mocha": "^10.8.2",
|
|
89
94
|
"mongoose": "^8.9.5",
|
|
90
95
|
"morgan": "^1.10.0",
|
|
91
96
|
"nodemailer": "^6.9.9",
|
|
@@ -94,6 +99,7 @@
|
|
|
94
99
|
"peer": "^1.0.2",
|
|
95
100
|
"peerjs": "^1.5.2",
|
|
96
101
|
"pixi.js": "7.4.2",
|
|
102
|
+
"plantuml": "^0.0.2",
|
|
97
103
|
"prom-client": "^15.1.2",
|
|
98
104
|
"public-ip": "^6.0.1",
|
|
99
105
|
"read": "^2.1.0",
|
|
@@ -105,25 +111,15 @@
|
|
|
105
111
|
"socket.io": "^4.8.0",
|
|
106
112
|
"sortablejs": "^1.15.0",
|
|
107
113
|
"split-file": "^2.3.0",
|
|
114
|
+
"swagger-autogen": "^2.23.7",
|
|
108
115
|
"swagger-ui-express": "^5.0.0",
|
|
109
116
|
"systeminformation": "^5.23.7",
|
|
110
117
|
"uglify-js": "^3.17.4",
|
|
111
118
|
"validator": "^13.11.0",
|
|
112
119
|
"vanilla-jsoneditor": "^2.3.2",
|
|
113
|
-
"winston": "^3.11.0"
|
|
114
|
-
"clean-jsdoc-theme": "^4.3.0",
|
|
115
|
-
"easy-json-schema": "^0.0.2-beta",
|
|
116
|
-
"mocha": "^10.8.2",
|
|
117
|
-
"plantuml": "^0.0.2",
|
|
118
|
-
"swagger-autogen": "^2.23.7"
|
|
119
|
-
},
|
|
120
|
-
"devDependencies": {
|
|
121
|
-
"clean-jsdoc-theme": "^4.3.0",
|
|
122
|
-
"easy-json-schema": "^0.0.2-beta",
|
|
123
|
-
"mocha": "^10.8.2",
|
|
124
|
-
"plantuml": "^0.0.2",
|
|
125
|
-
"swagger-autogen": "^2.23.7"
|
|
120
|
+
"winston": "^3.11.0"
|
|
126
121
|
},
|
|
122
|
+
"devDependencies": {},
|
|
127
123
|
"publishConfig": {
|
|
128
124
|
"provenance": true,
|
|
129
125
|
"access": "public",
|
|
@@ -24,7 +24,7 @@ const DefaultService = {
|
|
|
24
24
|
/** @type {import('./default.model.js').DefaultModel} */
|
|
25
25
|
const Default = DataBaseProvider.instance[`${options.host}${options.path}`].mongoose.models.Default;
|
|
26
26
|
if (req.params.id) return await Default.findByIdAndDelete(req.params.id);
|
|
27
|
-
else return await
|
|
27
|
+
else return await Default.deleteMany();
|
|
28
28
|
},
|
|
29
29
|
};
|
|
30
30
|
|
|
@@ -225,8 +225,8 @@ const UserService = {
|
|
|
225
225
|
} else throw new Error('invalid email or password');
|
|
226
226
|
|
|
227
227
|
case 'guest': {
|
|
228
|
-
const user = await ValkeyAPI.valkeyObjectFactory('user'
|
|
229
|
-
await ValkeyAPI.setValkeyObject(user.email, user);
|
|
228
|
+
const user = await ValkeyAPI.valkeyObjectFactory(options, 'user');
|
|
229
|
+
await ValkeyAPI.setValkeyObject(options, user.email, user);
|
|
230
230
|
return {
|
|
231
231
|
token: hashJWT({ user: UserDto.auth.payload(user) }),
|
|
232
232
|
user: selectDtoFactory(user, UserDto.select.get()),
|
|
@@ -325,15 +325,18 @@ const UserService = {
|
|
|
325
325
|
return await User.find().select(UserDto.select.getAll());
|
|
326
326
|
|
|
327
327
|
case 'auth': {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
328
|
+
let user;
|
|
329
|
+
if (req.auth.user._id.match('guest')) {
|
|
330
|
+
user = await ValkeyAPI.getValkeyObject(options, req.auth.user.email);
|
|
331
|
+
if (!user) throw new Error('guest user expired');
|
|
332
|
+
} else
|
|
333
|
+
user = await User.findOne({
|
|
334
|
+
_id: req.auth.user._id,
|
|
335
|
+
});
|
|
333
336
|
|
|
334
337
|
const file = await File.findOne({ _id: user.profileImageId });
|
|
335
338
|
|
|
336
|
-
if (!file && !(await ValkeyAPI.getValkeyObject(req.auth.user.email))) {
|
|
339
|
+
if (!file && !(await ValkeyAPI.getValkeyObject(options, req.auth.user.email))) {
|
|
337
340
|
await User.findByIdAndUpdate(
|
|
338
341
|
user._id,
|
|
339
342
|
{ profileImageId: await getDefaultProfileImageId(File) },
|
|
@@ -342,8 +345,8 @@ const UserService = {
|
|
|
342
345
|
},
|
|
343
346
|
);
|
|
344
347
|
}
|
|
345
|
-
return (await ValkeyAPI.getValkeyObject(req.auth.user.email))
|
|
346
|
-
? selectDtoFactory(await ValkeyAPI.getValkeyObject(req.auth.user.email), UserDto.select.get())
|
|
348
|
+
return (await ValkeyAPI.getValkeyObject(options, req.auth.user.email))
|
|
349
|
+
? selectDtoFactory(await ValkeyAPI.getValkeyObject(options, req.auth.user.email), UserDto.select.get())
|
|
347
350
|
: await User.findOne({
|
|
348
351
|
_id: req.auth.user._id,
|
|
349
352
|
}).select(UserDto.select.get());
|
|
@@ -378,7 +381,7 @@ const UserService = {
|
|
|
378
381
|
switch (user.role) {
|
|
379
382
|
case 'admin': {
|
|
380
383
|
if (req.params.id) return await User.findByIdAndDelete(req.params.id);
|
|
381
|
-
else return await
|
|
384
|
+
else return await User.deleteMany();
|
|
382
385
|
}
|
|
383
386
|
default:
|
|
384
387
|
if (req.auth.user._id !== req.params.id) throw new Error(`Invalid token user id`);
|