Skip to content

fix(storage): 优化图片存储加速与 Zeabur 部署#211

Open
ThaddeusJiang wants to merge 1 commit into
mainfrom
fix/storage-nginx-accel
Open

fix(storage): 优化图片存储加速与 Zeabur 部署#211
ThaddeusJiang wants to merge 1 commit into
mainfrom
fix/storage-nginx-accel

Conversation

@ThaddeusJiang

Copy link
Copy Markdown
Owner

Summary

  • /storage/v1 增加轻量 Phoenix pipeline,只做 session/current_user 权限检查,避免走完整 browser pipeline。
  • 默认通过 X-Accel-Redirect 交给 Nginx 内部路径返回图片文件,保留浏览器访问 URL 为 /storage/v1/...
  • 增加本地 proxy profile、生产 Nginx 配置、Docker/Zeabur 启动配置与相关文档。
  • 修复 worktree 下 MIX_DEPS_PATH 依赖路径导致的 Tailwind/heroicons setup 问题。
  • 稳定图片列表 e2e:全局登录改为 CSRF POST,会话建立更稳定;列表页显式断言图片真实加载。

Validation

  • mix format
  • mix compile --warnings-as-errors --no-listeners --ignore-module-conflict
  • DATABASE_URL=postgres://postgres:postgres@localhost:20001/vmemo_test TYPESENSE_URL=http://localhost:20002 TYPESENSE_API_KEY=xyz mix test test/vmemo_web/controllers/file_controller_test.exs
  • E2E_BASE_URL=http://localhost:4080 bun run e2e -- tests/photos-index-page.spec.ts tests/photo-upload-page.spec.ts tests/photo-detail-page.spec.ts --project=macbook-13
  • sh -n rel/entrypoint.sh
  • docker run --rm -v "$PWD/config/nginx/prod.conf:/etc/nginx/nginx.conf:ro" nginx:1.27.5-alpine nginx -t
  • docker run --rm -v "$PWD/config/nginx/dev.conf:/etc/nginx/nginx.conf:ro" nginx:1.27.5-alpine nginx -t
  • Zeabur template YAML key check for PHX_PORT=4001 and VMEMO_ENABLE_NGINX=true
  • Docker runner image Nginx smoke build/check completed locally

Notes

  • 浏览器仍使用 /storage/v1/... 访问图片;/storage/v1/_internal/... 只作为 Nginx internal 路径,不对外访问。
  • Zeabur Marketplace 模板发布仍需在 Zeabur 控制台手动更新。

@ThaddeusJiang ThaddeusJiang self-assigned this Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant