test fix hermes webui and hermes

This commit is contained in:
sirius0xdev 2026-05-08 00:07:16 +00:00
parent f79a0b648c
commit f1418d30a4

View file

@ -21,50 +21,50 @@ spec:
fsGroup: 1000 fsGroup: 1000
seccompProfile: seccompProfile:
type: RuntimeDefault type: RuntimeDefault
initContainers: #initContainers:
- name: fix-webui-perms #- name: fix-webui-perms
image: alpine:3.20 # image: alpine:3.20
imagePullPolicy: IfNotPresent #imagePullPolicy: IfNotPresent
securityContext: #securityContext:
runAsNonRoot: false # runAsNonRoot: false
runAsUser: 0 #runAsUser: 0
allowPrivilegeEscalation: false # allowPrivilegeEscalation: false
seccompProfile: #seccompProfile:
type: RuntimeDefault # type: RuntimeDefault
command: #command:
- sh # - sh
- -c # - -c
args: # args:
- | # - |
apk add --no-cache git # apk add --no-cache git
mkdir -p /data/.hermes/webui \ # mkdir -p /data/.hermes/webui \
/data/.hermes/logs \ # /data/.hermes/logs \
/data/.hermes/sessions \ # /data/.hermes/sessions \
/data/.cache \ # /data/.cache \
/data/.config \ # /data/.config \
/data/bin # /data/bin
touch /data/.hermes/sessions/sessions.json # touch /data/.hermes/sessions/sessions.json
chmod -R g+rwX,o-rwx /data # chmod -R g+rwX,o-rwx /data
chown -R 1000:1000 /data/.hermes /data/.cache /data/.config /data/bin || true #chown -R 1000:1000 /data/.hermes /data/.cache /data/.config /data/bin || true
chown -R 1024:1024 /data/.hermes/webui || true # chown -R 1024:1024 /data/.hermes/webui || true
echo "✅ Hermes data permissions fixed (agent=1000, webui=1024)" #echo "✅ Hermes data permissions fixed (agent=1000, webui=1024)"
if [ ! -d "/data/hermes-agent" ]; then # if [ ! -d "/data/hermes-agent" ]; then
echo "Cloning hermes-agent source..." # echo "Cloning hermes-agent source..."
git clone https://github.com/NousResearch/hermes-agent.git /data/hermes-agent # git clone https://github.com/NousResearch/hermes-agent.git /data/hermes-agent
echo "hermes-agent source cloned successfully" #echo "hermes-agent source cloned successfully"
else # else
echo "hermes-agent source already present" # echo "hermes-agent source already present"
fi # fi
# Full write permissions for webui user (fixes egg-info + logs) # Full write permissions for webui user (fixes egg-info + logs)
chown -R 1024:1024 /data/hermes-agent /data/.hermes/logs || true #chown -R 1024:1024 /data/hermes-agent /data/.hermes/logs || true
chmod -R 777 /data/hermes-agent /data/.hermes/logs || true # chmod -R 777 /data/hermes-agent /data/.hermes/logs || true
echo "✅ Full permissions applied to hermes-agent and logs" # echo "✅ Full permissions applied to hermes-agent and logs"
volumeMounts: # volumeMounts:
- name: hermes-data # - name: hermes-data
mountPath: /data # mountPath: /data
containers: containers:
- name: hermes-agent - name: hermes-agent
@ -80,13 +80,16 @@ spec:
seccompProfile: seccompProfile:
type: RuntimeDefault type: RuntimeDefault
image: nousresearch/hermes-agent:latest image: nousresearch/hermes-agent:latest
ports:
containerPort: 8642
command: ["/bin/bash", "-c"] command: ["/bin/bash", "-c"]
args: args:
- | - |
set -euo pipefail set -euo pipefail
echo "Hermes Agent starting (Telegram polling + full config persistence)..." echo "Hermes Agent starting (Telegram polling + full config persistence)..."
HERMES_BIN="/opt/hermes/.venv/bin/hermes" HERMES_BIN="/home/hermes/.venv/bin/hermes"
if [ ! -x "$HERMES_BIN" ]; then if [ ! -x "$HERMES_BIN" ]; then
echo "❌ hermes binary NOT FOUND at $HERMES_BIN" echo "❌ hermes binary NOT FOUND at $HERMES_BIN"
@ -98,25 +101,23 @@ spec:
echo "✅ Found hermes at: $HERMES_BIN" echo "✅ Found hermes at: $HERMES_BIN"
# Copy config # Copy config
cp -f /tmp/hermes/config.yaml /opt/data/config.yaml || true cp -f /tmp/hermes/config.yaml /home/hermes/.config/config.yaml || true
# Create symlink in a writable location (PVC) so it works when you exec in # Create symlink in a writable location (PVC) so it works when you exec in
mkdir -p /opt/data/bin mkdir -p /opt/data/bin
ln -sf "$HERMES_BIN" /opt/data/bin/hermes || true ln -sf "$HERMES_BIN" /home/hermes/bin || true
export PATH="/opt/data/bin:$PATH" export PATH="/home/hermes/bin:$PATH"
echo "🚀 Starting hermes gateway..." echo "🚀 Starting hermes gateway..."
exec "$HERMES_BIN" gateway run exec "$HERMES_BIN" gateway run
env: env:
# === Hermes Home - REQUIRED for config persistence === # === Hermes Home - REQUIRED for config persistence ===
- name: HERMES_HOME - name: HERMES_HOME
value: "/opt/data" value: "/home/hermes.hermes"
- name: HOME
value: "/opt/data"
- name: XDG_CACHE_HOME - name: XDG_CACHE_HOME
value: "/opt/data/.cache" value: "/home/hermes/.cache"
- name: XDG_CONFIG_HOME - name: XDG_CONFIG_HOME
value: "/opt/data/.config" value: "/home/hermes/.config"
# === Telegram Configuration (polling only - no public exposure) === # === Telegram Configuration (polling only - no public exposure) ===
- name: TELEGRAM_BOT_TOKEN - name: TELEGRAM_BOT_TOKEN
@ -163,28 +164,32 @@ spec:
# value: "INFO" # value: "INFO"
volumeMounts: volumeMounts:
- name: hermes-data - name: hermes-data
mountPath: /opt/data mountPath: /home/hermes/.hermes
- name: hermes-configmap - name: hermes-configmap
mountPath: /tmp/hermes/config.yaml mountPath: /tmp/hermes/config.yaml
subPath: config.yaml subPath: config.yaml
readOnly: true readOnly: true
- name: hermes-bin
mountPath: /home/hermes/bin
resources: resources:
requests: requests:
memory: 2Gi memory: 2Gi
cpu: "1" cpu: "1"
limits: limits:
memory: 4Gi memory: 3Gi
cpu: "2" cpu: "2"
- 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: HERMES_HOME - name: HERMES_HOME
value: "/home/hermeswebui/.hermes" value: "/home/hermeswebui/.hermes"
- name: HERMES_WEBUI_AGENT_DIR - name: HERMES_WEBUI_AGENT_DIR
value: "/home/hermeswebui/.hermes/hermes-agent" value: "/home/hermeswebui/.hermes/bin"
- name: HERMES_WEBUI_HOST - name: HERMES_WEBUI_HOST
value: "0.0.0.0" value: "0.0.0.0"
- name: HERMES_WEBUI_PORT - name: HERMES_WEBUI_PORT
@ -195,19 +200,23 @@ spec:
value: "1024" value: "1024"
- name: WANTED_GID - name: WANTED_GID
value: "1000" value: "1000"
volumeMounts: volumeMounts:
- name: hermes-data - name: hermes-data
mountPath: /home/hermeswebui/.hermes mountPath: /home/hermeswebui/.hermes
- name: hermes-webui-app - name: hermes-bin
mountPath: /app mountPath: /home/hermeswebui/.hermes/bin
- name: hermes-workspace
mountPath: /home/hermeswebui/workspace
resources: resources:
requests: requests:
memory: 256Mi memory: 500Mi
cpu: "100m" cpu: "100m"
limits: limits:
memory: 512Mi memory: 1Gi
cpu: "500m" cpu: "500m"
securityContext: securityContext:
runAsUser: 1024 runAsUser: 1024
@ -224,11 +233,13 @@ spec:
- name: hermes-configmap - name: hermes-configmap
configMap: configMap:
name: hermes-config name: hermes-config
- name: hermes-data - name: hermes-data
persistentVolumeClaim: persistentVolumeClaim:
claimName: hermes-agent-pvc claimName: hermes-agent-pvc
- name: hermes-webui-app - name: hermes-workspace
emptyDir: {} emtpyDir: {}
--- ---
apiVersion: v1 apiVersion: v1