diff --git a/Makefile b/Makefile index 6b5ceeb1..284afc8c 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,6 @@ container: -v ~/.config/gcloud:/root/.config/gcloud \ -v ~/.gemini/antigravity-cli:/root/.gemini/antigravity-cli:ro \ -e GOOGLE_CLOUD_PROJECT=cloud-db-nl2sql \ - -e MESOP_XSRF_CHECK=false \ --cap-add=SYS_PTRACE \ -p 3000:3000 \ -p 50051:50051 \ @@ -119,7 +118,7 @@ deploy-corprun: --min-instances=1 \ --no-cpu-throttling \ --service-account=crsvc-evalbench@evalbench-dev.iam.gserviceaccount.com \ - --set-env-vars CLOUD_RUN=True,GOOGLE_CLOUD_PROJECT=evalbench-dev,MESOP_XSRF_CHECK=false \ + --set-env-vars CLOUD_RUN=True,GOOGLE_CLOUD_PROJECT=evalbench-dev \ --ingress=internal-and-cloud-load-balancing \ --network=cr-infra-vpc-network \ --subnet=cr-infra-subnetwork \ diff --git a/skills/evalbench-review/references/deployment-checklist.md b/skills/evalbench-review/references/deployment-checklist.md index 065bda4b..014c946c 100644 --- a/skills/evalbench-review/references/deployment-checklist.md +++ b/skills/evalbench-review/references/deployment-checklist.md @@ -155,8 +155,10 @@ Under `evalbench_service/k8s/`: `namespace.yaml`, `pvc.yaml`, `ksa.yaml`, `us-central1-docker.pkg.dev/evalbench-dev/cr-images/eval_server:latest`. - **4 CPU / 8Gi**, versus GKE's 20/80Gi. Work sized for the cluster OOMs here. -- `--port=3000`, `CLOUD_RUN=True`, `MESOP_XSRF_CHECK=false`, `min-instances=1`, - `--no-cpu-throttling`, internal ingress on `cr-infra-vpc-network`. +- `--port=3000`, `CLOUD_RUN=True`, `min-instances=1`, `--no-cpu-throttling`, + internal ingress on `cr-infra-vpc-network`. +- Do not set `MESOP_XSRF_CHECK=false`. The viewer ignores it and keeps the + Mesop XSRF check on. - GCS volume at `/tmp_session_files`; no PVC. - The jobs run `python3 viewer/precompute_trends.py` (and `--clean` for recompute). Changing that script's CLI surface or entry point requires diff --git a/viewer/main.py b/viewer/main.py index db79560c..6d047bf5 100644 --- a/viewer/main.py +++ b/viewer/main.py @@ -64,14 +64,11 @@ class State: logging.basicConfig(level=logging.INFO) -# Manually enable debug mode to bypass XSRF check if needed -# (e.g. when running in container behind a proxy) +# Mesop rejects a cross-site POST to the UI endpoint. Keep that check on. if os.environ.get("MESOP_XSRF_CHECK") == "false": - try: - from mesop.runtime import runtime - runtime().debug_mode = True - except Exception as e: - logging.error(f"Failed to enable debug mode: {e}") + logging.warning( + "MESOP_XSRF_CHECK=false has no effect. The XSRF check stays on." + ) try: import dashboard