Merge pull request #110 from sirius0xdev/hermes-webhook-setup

Add Hermes webhook for wh.siriusdevops.com (fixes telegram picker timeouts)
This commit is contained in:
sirius0xdev 2026-05-08 10:56:02 -04:00 committed by GitHub
commit 3bf9cf1067
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 33 deletions

View file

@ -13,12 +13,10 @@ spec:
labels: labels:
app: hermes-agent app: hermes-agent
spec: spec:
# 1. Pod-level security context to ensure volumes inherit the right group
shareProcessNamespace: true shareProcessNamespace: true
securityContext: securityContext:
fsGroup: 1000 fsGroup: 1000
# 2. Define our shared bridge volumes
volumes: volumes:
- name: hermes-home - name: hermes-home
persistentVolumeClaim: persistentVolumeClaim:
@ -34,7 +32,6 @@ spec:
name: hermes-config name: hermes-config
initContainers: initContainers:
# 3. K8s workaround: Copy the agent source code into the shared emptyDir
- name: copy-agent-source - name: copy-agent-source
image: nousresearch/hermes-agent:latest image: nousresearch/hermes-agent:latest
command: command:
@ -53,7 +50,7 @@ spec:
chmod +x /shared-home/.local/bin/gh chmod +x /shared-home/.local/bin/gh
securityContext: securityContext:
runAsUser: 0 # Run as root briefly to copy and fix permissions runAsUser: 0
runAsNonRoot: false runAsNonRoot: false
volumeMounts: volumeMounts:
- name: hermes-agent-src - name: hermes-agent-src
@ -64,15 +61,12 @@ spec:
mountPath: /tmp/hermes/config.yaml mountPath: /tmp/hermes/config.yaml
subPath: config.yaml subPath: config.yaml
containers: containers:
# ==========================================
# CONTAINER 1: HERMES AGENT
# ==========================================
- name: hermes-agent - name: hermes-agent
image: nousresearch/hermes-agent:latest image: nousresearch/hermes-agent:latest
args: ["gateway", "run"] args: ["gateway", "run"]
ports: ports:
- containerPort: 8642 - containerPort: 8642
- containerPort: 9118 # Gateway webhook port
env: env:
- name: PATH - name: PATH
value: "/home/hermes/.hermes/.local/bin:/opt/hermes/.venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" value: "/home/hermes/.hermes/.local/bin:/opt/hermes/.venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
@ -84,57 +78,42 @@ spec:
value: "1024" value: "1024"
- name: HERMES_GID - name: HERMES_GID
value: "1000" value: "1000"
- name: TELEGRAM_BOT_TOKEN - name: TELEGRAM_BOT_TOKEN
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: hermes-secrets name: hermes-secrets
key: TELEGRAM_BOT_TOKEN key: TELEGRAM_BOT_TOKEN
- name: XAI_API_KEY - name: XAI_API_KEY
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: xai-apikey name: xai-apikey
key: XAI_API_KEY key: XAI_API_KEY
- name: TELEGRAM_ALLOWED_USERS - name: TELEGRAM_ALLOWED_USERS
value: "7528130947" value: "7528130947"
- name: TELEGRAM_WEBHOOK_URL
# === Local vLLM (OpenAI-compatible) === value: "https://wh.siriusdevops.com/telegram/webhook/default" # Webhook
- name: OPENAI_BASE_URL - name: OPENAI_BASE_URL
value: "http://openclaw-brain-service.customer1.svc.cluster.local:8000/v1" # ← adjust if your service name differs value: "http://openclaw-brain-service.customer1.svc.cluster.local:8000/v1"
- name: HERMES_MODEL_PROVIDER - name: HERMES_MODEL_PROVIDER
value: xai value: xai
- name: HERMES_MODEL - name: HERMES_MODEL
value: grok-4.20-0309-reasoning value: grok-4.20-0309-reasoning
- name: OPENAI_API_KEY - name: OPENAI_API_KEY
value: "dummy" value: "dummy"
volumeMounts: volumeMounts:
- name: hermes-home - name: hermes-home
mountPath: /home/hermes/.hermes mountPath: /home/hermes/.hermes
- name: hermes-agent-src - name: hermes-agent-src
mountPath: /opt/hermes mountPath: /opt/hermes
securityContext: securityContext:
runAsUser: 1024 runAsUser: 1024
runAsGroup: 1000 runAsGroup: 1000
runAsNonRoot: true runAsNonRoot: true
allowPrivilegeEscalation: true allowPrivilegeEscalation: true
# ==========================================
# CONTAINER 2: HERMES WEBUI
# ==========================================
- name: hermes-webui - name: hermes-webui
image: ghcr.io/nesquena/hermes-webui:latest image: ghcr.io/nesquena/hermes-webui:latest
ports: ports:
- containerPort: 8787 - containerPort: 8787
env: env:
- name: HOME - name: HOME
value: "/home/hermeswebui/.hermes" value: "/home/hermeswebui/.hermes"
@ -152,18 +131,15 @@ spec:
value: "1000" value: "1000"
- name: HERMES_SKIP_CHMOD - name: HERMES_SKIP_CHMOD
value: "1" value: "1"
volumeMounts: volumeMounts:
- name: hermes-home - name: hermes-home
mountPath: /home/hermeswebui/.hermes mountPath: /home/hermeswebui/.hermes
# This is where the WebUI looks for the agent source code to run `uv pip install`
- name: hermes-agent-src - name: hermes-agent-src
mountPath: /home/hermeswebui/.hermes/hermes-agent mountPath: /home/hermeswebui/.hermes/hermes-agent
- name: hermes-workspace - name: hermes-workspace
mountPath: /workspace mountPath: /workspace
- name: hermes-webui-app - name: hermes-webui-app
mountPath: /app mountPath: /app
resources: resources:
requests: requests:
memory: 500Mi memory: 500Mi
@ -171,7 +147,6 @@ spec:
limits: limits:
memory: 1Gi memory: 1Gi
cpu: "500m" cpu: "500m"
securityContext: securityContext:
runAsUser: 1024 runAsUser: 1024
runAsGroup: 1000 runAsGroup: 1000
@ -181,7 +156,19 @@ spec:
seccompProfile: seccompProfile:
type: RuntimeDefault type: RuntimeDefault
--- ---
apiVersion: v1
kind: Service
metadata:
name: hermes-gateway
namespace: customer1
spec:
selector:
app: hermes-agent
ports:
- name: webhook
port: 9118
targetPort: 9118
---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
@ -193,4 +180,3 @@ spec:
resources: resources:
requests: requests:
storage: 25Gi storage: 25Gi

View file

@ -0,0 +1,15 @@
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: hermes-webhook
namespace: customer1
spec:
parentRefs:
- name: external-http-gateway
sectionName: https
hostnames:
- "wh.siriusdevops.com"
rules:
- backendRefs:
- name: hermes-gateway
port: 9118