diff --git a/k8s/apps/paperless/paperless-ai.yaml b/k8s/apps/paperless/paperless-ai.yaml index 2cc7941..43d4c2a 100644 --- a/k8s/apps/paperless/paperless-ai.yaml +++ b/k8s/apps/paperless/paperless-ai.yaml @@ -28,6 +28,9 @@ spec: initContainers: - name: fetch-llm-token image: curlimages/curl:8.12.0 + securityContext: + runAsUser: 0 + fsGroup: 0 command: - sh - -c @@ -52,9 +55,13 @@ spec: fi # Store token in file for main container to read - mkdir -p /app/data - echo "$TOKEN" > /app/data/llm_token.txt - echo "[init] Token fetched and stored successfully" + # Write to both locations for compatibility + mkdir -p /tmp/llm-token /app/data 2>/dev/null || true + echo "$TOKEN" | tee /tmp/llm-token/llm_token.txt > /dev/null 2>&1 + echo "$TOKEN" > /app/data/llm_token.txt 2>/dev/null || true + echo "[init] Token fetched and stored" + [ -f /tmp/llm-token/llm_token.txt ] && echo " -> /tmp/llm-token/llm_token.txt" + [ -f /app/data/llm_token.txt ] && echo " -> /app/data/llm_token.txt" env: - name: LLM_AUTH_CLIENT_SECRET valueFrom: