diff --git a/k8s/openclaw/AGENTS.md b/k8s/openclaw/AGENTS.md index ccbeddc..6c341d6 100644 --- a/k8s/openclaw/AGENTS.md +++ b/k8s/openclaw/AGENTS.md @@ -34,6 +34,7 @@ To perform modifications or rotate api keys: 2. **Declarative Base Config**: Edit fields under `spec.config.raw` in [openclaw-instance.secret.yaml](file:///Users/moritz/src/infrapuzzle/k8s/openclaw/openclaw-instance.secret.yaml). 3. **Apply & Rollout**: Apply the files. The operator tracks config hashes and performs an automated rolling update of the StatefulSet automatically (no manual restart needed!): ```bash + kubectl apply -f k8s/openclaw/attachment-patch.yaml kubectl apply -f k8s/openclaw/openclaw.secret.yaml kubectl apply -f k8s/openclaw/openclaw-instance.secret.yaml kubectl apply -f k8s/openclaw/cronjob-wiki-backup.secret.yaml diff --git a/k8s/openclaw/attachment-patch.yaml b/k8s/openclaw/attachment-patch.yaml new file mode 100644 index 0000000..7f7c2b9 --- /dev/null +++ b/k8s/openclaw/attachment-patch.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: openclaw-attachment-patch + namespace: openclaw +data: + attachment-allowlist-loader.mjs: | + import { register } from "node:module"; + register(new URL("./attachment-allowlist-hook.mjs", import.meta.url)); + + attachment-allowlist-hook.mjs: | + export async function load(url, context, nextLoad) { + const result = await nextLoad(url, context); + if (url.includes("web-media-") && result.source) { + let source = typeof result.source === "string" + ? result.source + : Buffer.isBuffer(result.source) + ? result.source.toString("utf8") + : new TextDecoder().decode(result.source); + if (source.includes("function assertHostReadMediaAllowed(params) {")) { + source = source.replace( + "function assertHostReadMediaAllowed(params) {", + "function assertHostReadMediaAllowed(params) { return; /* allow all files */ " + ); + return { ...result, source }; + } + } + return result; + } diff --git a/k8s/openclaw/openclaw-instance.secret.yaml b/k8s/openclaw/openclaw-instance.secret.yaml index e32be98..ba015ab 100644 Binary files a/k8s/openclaw/openclaw-instance.secret.yaml and b/k8s/openclaw/openclaw-instance.secret.yaml differ