fix: add PVC for whatsapp session and expose qr via REST API
This commit is contained in:
parent
fed234e448
commit
81d191a516
|
|
@ -1,3 +1,16 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: whatsapp-auth-pvc
|
||||||
|
namespace: ai-agents
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
storageClassName: longhorn
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
|
@ -38,6 +51,8 @@ spec:
|
||||||
mountPath: /app
|
mountPath: /app
|
||||||
- name: dshm
|
- name: dshm
|
||||||
mountPath: /dev/shm
|
mountPath: /dev/shm
|
||||||
|
- name: auth-session
|
||||||
|
mountPath: /app/.wwebjs_auth
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 5001
|
- containerPort: 5001
|
||||||
resources:
|
resources:
|
||||||
|
|
@ -54,6 +69,9 @@ spec:
|
||||||
emptyDir:
|
emptyDir:
|
||||||
medium: Memory
|
medium: Memory
|
||||||
sizeLimit: 1Gi
|
sizeLimit: 1Gi
|
||||||
|
- name: auth-session
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: whatsapp-auth-pvc
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,8 @@ app.get('/api/status', (req, res) => {
|
||||||
res.json({
|
res.json({
|
||||||
service: 'whatsapp-gateway',
|
service: 'whatsapp-gateway',
|
||||||
ready: isReady,
|
ready: isReady,
|
||||||
authenticated: client.info ? true : false
|
authenticated: client.info ? true : false,
|
||||||
|
qr: currentQr
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue