Commit graph

2 commits

Author SHA1 Message Date
abounoone
4e2516cdd7 fix: socket.io Invalid origin + dev mode PYTHONPATH + sync-assets improvements
- compose.local-origin.yaml: patch nginx to forward Host: $http_host (not
  websocket:9000) in /socket.io block so authenticate.js host==origin check passes
- compose.picking-dev.yaml: add PYTHONPATH=/home/frappe/frappe-bench/apps/picking_app
  to all services so picking_app is importable without pip install in dev mode
- images/custom/Containerfile: fix Frappe bug — add missing return after
  next(new Error("Invalid namespace")) in socket.io authenticate middleware
- Makefile: recreate-frontend target; sync-assets clears cache before copy and
  uses --force-recreate instead of restart; dev-up force-recreates frontend to
  flush stale backend IPs from nginx cache

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 10:21:20 +00:00
abounoone
a3cac96a17 fix: sync assets between backend overlay and named frontend volume
bench build writes compiled bundles to the backend container's overlay
filesystem (apps/*/public/dist/), while nginx reads from the named
frappe-project_assets volume. Without syncing, frontend serves stale
bundle hashes from the original image.

- Makefile: rewrite 'assets' target to run bench build then sync-assets
- Makefile: add 'sync-assets' target that:
  - copies dist/ directories from backend container to frappe-project_assets
  - updates assets.json in the volume
  - deletes the stale pickle-encoded assets_json key from Redis (skipped
    by bench clear-cache because it uses a raw key, not Frappe's prefixed cache)
  - restarts frontend
- overrides/compose.local-origin.yaml: fix socket.io "Invalid origin" by
  patching nginx to pass browser's real Origin header ($http_origin) instead
  of forcing the site name (erp.local), which mismatches when browser
  connects via localhost or an external domain

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 18:35:39 +00:00