fix(openclaw): bypass local attachment allowlist to support all files (.zwo, .json, etc.)
This commit is contained in:
@@ -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).
|
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!):
|
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
|
```bash
|
||||||
|
kubectl apply -f k8s/openclaw/attachment-patch.yaml
|
||||||
kubectl apply -f k8s/openclaw/openclaw.secret.yaml
|
kubectl apply -f k8s/openclaw/openclaw.secret.yaml
|
||||||
kubectl apply -f k8s/openclaw/openclaw-instance.secret.yaml
|
kubectl apply -f k8s/openclaw/openclaw-instance.secret.yaml
|
||||||
kubectl apply -f k8s/openclaw/cronjob-wiki-backup.secret.yaml
|
kubectl apply -f k8s/openclaw/cronjob-wiki-backup.secret.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;
|
||||||
|
}
|
||||||
Binary file not shown.
Reference in New Issue
Block a user