underpost 2.8.1 → 2.8.41

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.
Files changed (74) hide show
  1. package/.dockerignore +1 -0
  2. package/.github/workflows/ghpkg.yml +14 -11
  3. package/.github/workflows/pwa-microservices-template.page.yml +10 -3
  4. package/.vscode/extensions.json +17 -71
  5. package/.vscode/settings.json +10 -4
  6. package/AUTHORS.md +16 -5
  7. package/CHANGELOG.md +63 -3
  8. package/Dockerfile +41 -62
  9. package/README.md +1 -28
  10. package/bin/build.js +278 -0
  11. package/bin/db.js +2 -24
  12. package/bin/deploy.js +105 -55
  13. package/bin/file.js +33 -4
  14. package/bin/index.js +33 -51
  15. package/bin/ssl.js +19 -11
  16. package/bin/util.js +9 -89
  17. package/bin/vs.js +25 -2
  18. package/conf.js +31 -138
  19. package/docker-compose.yml +1 -1
  20. package/manifests/core/kustomization.yaml +11 -0
  21. package/manifests/core/underpost-engine-backup-access.yaml +16 -0
  22. package/manifests/core/underpost-engine-backup-pv-pvc.yaml +22 -0
  23. package/manifests/core/underpost-engine-headless-service.yaml +10 -0
  24. package/manifests/core/underpost-engine-mongodb-backup-cronjob.yaml +40 -0
  25. package/manifests/core/underpost-engine-mongodb-configmap.yaml +26 -0
  26. package/manifests/core/underpost-engine-pv-pvc.yaml +23 -0
  27. package/manifests/core/underpost-engine-statefulset.yaml +91 -0
  28. package/manifests/deployment/mongo-express.yaml +60 -0
  29. package/manifests/deployment/phpmyadmin.yaml +54 -0
  30. package/manifests/kind-config.yaml +12 -0
  31. package/manifests/letsencrypt-prod.yaml +15 -0
  32. package/manifests/mariadb/config.yaml +10 -0
  33. package/manifests/mariadb/kustomization.yaml +9 -0
  34. package/manifests/mariadb/pv.yaml +12 -0
  35. package/manifests/mariadb/pvc.yaml +10 -0
  36. package/manifests/mariadb/secret.yaml +8 -0
  37. package/manifests/mariadb/service.yaml +10 -0
  38. package/manifests/mariadb/statefulset.yaml +55 -0
  39. package/manifests/valkey/kustomization.yaml +7 -0
  40. package/manifests/valkey/underpost-engine-valkey-service.yaml +17 -0
  41. package/manifests/valkey/underpost-engine-valkey-statefulset.yaml +39 -0
  42. package/package.json +115 -136
  43. package/src/api/user/user.model.js +16 -3
  44. package/src/api/user/user.service.js +1 -1
  45. package/src/client/components/core/CalendarCore.js +115 -49
  46. package/src/client/components/core/CommonJs.js +150 -19
  47. package/src/client/components/core/CssCore.js +6 -0
  48. package/src/client/components/core/DropDown.js +5 -1
  49. package/src/client/components/core/Input.js +17 -3
  50. package/src/client/components/core/Modal.js +10 -5
  51. package/src/client/components/core/Panel.js +84 -25
  52. package/src/client/components/core/PanelForm.js +4 -18
  53. package/src/client/components/core/Translate.js +43 -9
  54. package/src/client/components/core/Validator.js +9 -1
  55. package/src/client/services/default/default.management.js +4 -2
  56. package/src/db/mongo/MongooseDB.js +13 -1
  57. package/src/index.js +8 -1
  58. package/src/runtime/lampp/Lampp.js +1 -13
  59. package/src/runtime/xampp/Xampp.js +0 -13
  60. package/src/server/auth.js +3 -3
  61. package/src/server/client-build.js +3 -13
  62. package/src/server/conf.js +296 -29
  63. package/src/server/dns.js +2 -3
  64. package/src/server/logger.js +10 -5
  65. package/src/server/network.js +0 -36
  66. package/src/server/process.js +25 -2
  67. package/src/server/project.js +39 -0
  68. package/src/server/proxy.js +4 -26
  69. package/src/server/runtime.js +6 -7
  70. package/src/server/ssl.js +1 -1
  71. package/src/server/valkey.js +2 -0
  72. package/startup.cjs +12 -0
  73. package/src/server/prompt-optimizer.js +0 -28
  74. package/startup.js +0 -11
@@ -0,0 +1,40 @@
1
+ apiVersion: batch/v1
2
+ kind: CronJob
3
+ metadata:
4
+ name: mongodb-backup
5
+ spec:
6
+ schedule: '*/5 * * * *' # Runs backup every five minutes
7
+ jobTemplate:
8
+ spec:
9
+ template:
10
+ spec:
11
+ containers:
12
+ - name: mongodump
13
+ image: docker.io/library/mongo:latest
14
+ command:
15
+ - sh
16
+ - -c
17
+ - |
18
+ # Perform backup
19
+ mongodump -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --host=mongodb-service --port=27017 --out=/backup/$(date +\%Y-\%m-\%dT\%H-\%M-\%S)
20
+ # Remove backups older than 7 days
21
+ find /backup -type d -mtime +7 -exec rm -rf {} +
22
+ volumeMounts:
23
+ - name: backup-storage
24
+ mountPath: /backup
25
+ env:
26
+ - name: MONGO_INITDB_ROOT_USERNAME
27
+ valueFrom:
28
+ secretKeyRef:
29
+ name: mongodb-secret
30
+ key: username
31
+ - name: MONGO_INITDB_ROOT_PASSWORD
32
+ valueFrom:
33
+ secretKeyRef:
34
+ name: mongodb-secret
35
+ key: password
36
+ restartPolicy: Never
37
+ volumes:
38
+ - name: backup-storage
39
+ persistentVolumeClaim:
40
+ claimName: backup-pvc
@@ -0,0 +1,26 @@
1
+ # origin conf: /etc/mongod.conf
2
+ apiVersion: v1
3
+ kind: ConfigMap
4
+ metadata:
5
+ name: mongodb-config-file
6
+ namespace: default
7
+ data:
8
+ mongod.conf: |
9
+ storage:
10
+ dbPath: /data/db
11
+ systemLog:
12
+ destination: file
13
+ logAppend: true
14
+ path: /var/log/mongodb/mongod.log
15
+ replication:
16
+ replSetName: rs0
17
+ net:
18
+ bindIp: 127.0.0.1
19
+ port: 27017
20
+ processManagement:
21
+ fork: true
22
+ setParameter:
23
+ enableLocalhostAuthBypass: false
24
+ security:
25
+ authorization: enabled
26
+ keyFile: /etc/mongodb-keyfile
@@ -0,0 +1,23 @@
1
+ apiVersion: v1
2
+ kind: PersistentVolume
3
+ metadata:
4
+ name: mongodb-pv
5
+ spec:
6
+ capacity:
7
+ storage: 5Gi
8
+ accessModes:
9
+ - ReadWriteOnce
10
+ hostPath:
11
+ path: /data/mongodb
12
+ ---
13
+ apiVersion: v1
14
+ kind: PersistentVolumeClaim
15
+ metadata:
16
+ name: mongodb-pvc
17
+ spec:
18
+ storageClassName: ''
19
+ accessModes:
20
+ - ReadWriteOnce
21
+ resources:
22
+ requests:
23
+ storage: 5Gi
@@ -0,0 +1,91 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: mongodb # Specifies the name of the statefulset
5
+ spec:
6
+ serviceName: 'mongodb-service' # Specifies the service to use
7
+ replicas: 2
8
+ selector:
9
+ matchLabels:
10
+ app: mongodb
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: mongodb
15
+ spec:
16
+ containers:
17
+ - name: mongodb
18
+ image: docker.io/library/mongo:latest
19
+ command:
20
+ - mongod
21
+ - '--replSet'
22
+ - 'rs0'
23
+ # - '--config'
24
+ # - '-f'
25
+ # - '/etc/mongod.conf'
26
+ # - '--auth'
27
+ # - '--clusterAuthMode'
28
+ # - 'keyFile'
29
+ # - '--keyFile'
30
+ # - '/etc/mongodb-keyfile'
31
+ # - '--interleave'
32
+ # - 'all'
33
+ # - '--wiredTigerCacheSizeGB'
34
+ # - '0.25'
35
+ # - '--setParameter'
36
+ # - 'authenticationMechanisms=SCRAM-SHA-1'
37
+ # - '--fork'
38
+ - '--logpath'
39
+ - '/var/log/mongodb/mongod.log'
40
+ - '--bind_ip_all'
41
+ ports:
42
+ - containerPort: 27017
43
+ volumeMounts:
44
+ - name: mongodb-storage
45
+ mountPath: /data/db
46
+ - name: keyfile
47
+ mountPath: /etc/mongodb-keyfile
48
+ readOnly: true
49
+ # - name: mongodb-configuration-file
50
+ # mountPath: /etc/mongod.conf
51
+ # subPath: mongod.conf
52
+ # readOnly: true
53
+ # - name: mongodb-config
54
+ # mountPath: /config
55
+ env:
56
+ - name: MONGO_INITDB_ROOT_USERNAME
57
+ valueFrom:
58
+ secretKeyRef:
59
+ name: mongodb-secret
60
+ key: username
61
+ - name: MONGO_INITDB_ROOT_PASSWORD
62
+ valueFrom:
63
+ secretKeyRef:
64
+ name: mongodb-secret
65
+ key: password
66
+ resources:
67
+ requests:
68
+ cpu: '100m'
69
+ memory: '256Mi'
70
+ limits:
71
+ cpu: '500m'
72
+ memory: '512Mi'
73
+ volumes:
74
+ - name: keyfile
75
+ secret:
76
+ secretName: mongodb-keyfile
77
+ defaultMode: 0400
78
+ # - name: mongodb-configuration-file
79
+ # configMap:
80
+ # name: mongodb-config-file
81
+ # - name: mongodb-config
82
+ # configMap:
83
+ # name: mongodb-config
84
+ volumeClaimTemplates:
85
+ - metadata:
86
+ name: mongodb-storage
87
+ spec:
88
+ accessModes: ['ReadWriteOnce']
89
+ resources:
90
+ requests:
91
+ storage: 5Gi
@@ -0,0 +1,60 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: mongo-express
5
+ labels:
6
+ app: mongo-express
7
+ spec:
8
+ replicas: 1
9
+ selector:
10
+ matchLabels:
11
+ app: mongo-express
12
+ template:
13
+ metadata:
14
+ labels:
15
+ app: mongo-express
16
+ spec:
17
+ containers:
18
+ - name: mongo-express
19
+ image: mongo-express
20
+ ports:
21
+ - containerPort: 8081
22
+ env:
23
+ - name: ME_CONFIG_MONGODB_ADMINUSERNAME
24
+ valueFrom:
25
+ secretKeyRef:
26
+ name: mongodb-secret
27
+ key: username
28
+ - name: ME_CONFIG_MONGODB_ADMINPASSWORD
29
+ valueFrom:
30
+ secretKeyRef:
31
+ name: mongodb-secret
32
+ key: password
33
+ - name: ME_CONFIG_BASICAUTH_USERNAME
34
+ valueFrom:
35
+ secretKeyRef:
36
+ name: mongodb-secret
37
+ key: username
38
+ - name: ME_CONFIG_BASICAUTH_PASSWORD
39
+ valueFrom:
40
+ secretKeyRef:
41
+ name: mongodb-secret
42
+ key: password
43
+ - name: ME_CONFIG_MONGODB_SERVER
44
+ value: 'mongodb-0.mongodb-service'
45
+ - name: ME_CONFIG_MONGODB_ENABLE_ADMIN
46
+ value: 'true'
47
+ - name: ME_CONFIG_MONGODB_PORT
48
+ value: '27017'
49
+ ---
50
+ apiVersion: v1
51
+ kind: Service
52
+ metadata:
53
+ name: mongo-express-service
54
+ spec:
55
+ selector:
56
+ app: mongo-express
57
+ ports:
58
+ - protocol: TCP
59
+ port: 8081
60
+ targetPort: 8081
@@ -0,0 +1,54 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: phpmyadmin-deployment
5
+ labels:
6
+ app: phpmyadmin
7
+ spec:
8
+ replicas: 1
9
+ selector:
10
+ matchLabels:
11
+ app: phpmyadmin
12
+ template:
13
+ metadata:
14
+ labels:
15
+ app: phpmyadmin
16
+ spec:
17
+ containers:
18
+ - name: phpmyadmin
19
+ image: phpmyadmin/phpmyadmin
20
+ ports:
21
+ - containerPort: 80
22
+ env:
23
+ - name: PMA_HOST
24
+ value: 'mariadb'
25
+ - name: PMA_PORT
26
+ value: '3306'
27
+ - name: PMA_USER
28
+ valueFrom:
29
+ secretKeyRef:
30
+ name: mariadb-secret
31
+ key: username
32
+ - name: PMA_PASSWORD
33
+ valueFrom:
34
+ secretKeyRef:
35
+ name: mariadb-secret
36
+ key: password
37
+ - name: UPLOAD_LIMIT
38
+ value: '300M'
39
+ - name: PMA_ARBITRARY
40
+ value: '1'
41
+ ---
42
+ apiVersion: v1
43
+ kind: Service
44
+ metadata:
45
+ name: phpmyadmin-service
46
+ spec:
47
+ type: NodePort
48
+ selector:
49
+ app: phpmyadmin
50
+ ports:
51
+ - protocol: TCP
52
+ nodePort: 31008
53
+ port: 80
54
+ targetPort: 80
@@ -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,15 @@
1
+ apiVersion: cert-manager.io/v1
2
+ kind: ClusterIssuer
3
+ metadata:
4
+ name: letsencrypt-prod
5
+ namespace: cert-manager
6
+ spec:
7
+ acme:
8
+ email: development@underpost.net
9
+ privateKeySecretRef:
10
+ name: letsencrypt-prod
11
+ server: https://acme-v02.api.letsencrypt.org/directory
12
+ solvers:
13
+ - http01:
14
+ ingress:
15
+ class: contour
@@ -0,0 +1,10 @@
1
+ apiVersion: v1
2
+ kind: ConfigMap
3
+ metadata:
4
+ name: mariadb-config
5
+ data:
6
+ my.cnf: | # bind-address=0.0.0.0
7
+ [mysqld]
8
+ default_storage_engine=InnoDB
9
+ innodb_file_per_table=1
10
+ max_connections=1000
@@ -0,0 +1,9 @@
1
+ ---
2
+ # kubectl apply -k mariadb/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - pv.yaml
7
+ - pvc.yaml
8
+ - statefulset.yaml
9
+ - service.yaml
@@ -0,0 +1,12 @@
1
+ apiVersion: v1
2
+ kind: PersistentVolume
3
+ metadata:
4
+ name: mariadb-pv
5
+ spec:
6
+ capacity:
7
+ storage: 1Gi
8
+ volumeMode: Filesystem
9
+ accessModes:
10
+ - ReadWriteOnce
11
+ hostPath:
12
+ path: /data/mariadb
@@ -0,0 +1,10 @@
1
+ apiVersion: v1
2
+ kind: PersistentVolumeClaim
3
+ metadata:
4
+ name: mariadb-pvc
5
+ spec:
6
+ accessModes:
7
+ - ReadWriteOnce
8
+ resources:
9
+ requests:
10
+ storage: 1Gi
@@ -0,0 +1,8 @@
1
+ apiVersion: v1
2
+ kind: Secret
3
+ metadata:
4
+ name: mariadb-secret
5
+ type: Opaque
6
+ data:
7
+ password:
8
+ username:
@@ -0,0 +1,10 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: mariadb
5
+ spec:
6
+ ports:
7
+ - port: 3306
8
+ targetPort: 3306
9
+ selector:
10
+ app: mariadb
@@ -0,0 +1,55 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: mariadb-statefulset
5
+ spec:
6
+ serviceName: mariadb
7
+ replicas: 1
8
+ selector:
9
+ matchLabels:
10
+ app: mariadb
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: mariadb
15
+ spec:
16
+ containers:
17
+ - name: mariadb
18
+ image: mariadb:latest
19
+ env:
20
+ - name: MYSQL_ROOT_PASSWORD
21
+ valueFrom:
22
+ secretKeyRef:
23
+ name: mariadb-secret
24
+ key: password
25
+ # - name: MYSQL_PASSWORD
26
+ # valueFrom:
27
+ # secretKeyRef:
28
+ # name: mariadb-secret
29
+ # key: password
30
+ # - name: MYSQL_USER
31
+ # valueFrom:
32
+ # secretKeyRef:
33
+ # name: mariadb-secret
34
+ # key: username
35
+ # - name: MYSQL_DATABASE
36
+ # value: default
37
+ ports:
38
+ - containerPort: 3306
39
+ volumeMounts:
40
+ - mountPath: /var/lib/mysql
41
+ name: mariadb-storage
42
+ # - mountPath: /etc/mysql/conf.d
43
+ # name: config-volume
44
+ # volumes:
45
+ # - name: config-volume
46
+ # configMap:
47
+ # name: mariadb-config
48
+ volumeClaimTemplates:
49
+ - metadata:
50
+ name: mariadb-storage
51
+ spec:
52
+ accessModes: ['ReadWriteOnce']
53
+ resources:
54
+ requests:
55
+ storage: 1Gi
@@ -0,0 +1,7 @@
1
+ ---
2
+ # kubectl apply -k valkey/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - underpost-engine-valkey-service.yaml
7
+ - underpost-engine-valkey-statefulset.yaml
@@ -0,0 +1,17 @@
1
+ ---
2
+ apiVersion: v1
3
+ kind: Service
4
+ metadata:
5
+ name: service-valkey
6
+ namespace: default
7
+ spec:
8
+ ports:
9
+ - port: 6379
10
+ targetPort: 6379
11
+ selector:
12
+ app: service-valkey
13
+ ipFamilyPolicy: PreferDualStack
14
+ ipFamilies:
15
+ - IPv4
16
+ # - IPv6
17
+ type: ClusterIP
@@ -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