Skip to content

fix(EVO-976): fix avatar storage — shared volumes, AUTH_SERVICE_URL, storage docs#80

Merged
DavidsonGomes merged 7 commits intomainfrom
fix/EVO-976-avatar-storage
May 4, 2026
Merged

fix(EVO-976): fix avatar storage — shared volumes, AUTH_SERVICE_URL, storage docs#80
DavidsonGomes merged 7 commits intomainfrom
fix/EVO-976-avatar-storage

Conversation

@marcelogorutuba
Copy link
Copy Markdown
Contributor

@marcelogorutuba marcelogorutuba commented May 4, 2026

Resumo

Corrige os critérios de aceite pendentes do EVO-976 não endereçados no PR #41:
foto de perfil com 404, volumes de storage não compartilhados e documentação ausente.

Mudanças

docker-compose.yml

  • Adiciona crm_storage volume declarado ao evo-crm e evo-crm-sidekiq
  • Sem volume compartilhado, blobs escritos pelo Sidekiq ficavam invisíveis ao container web (root cause do issue original com ACTIVE_STORAGE_SERVICE=local)

.env.example

  • Adiciona AUTH_SERVICE_URL=http://localhost:3001 — variável lida pelo auth service para montar URLs absolutas de avatar (ver PR chore(deps): bump actions/upload-artifact from 4.6.2 to 7.0.0 #10 em evo-auth-service-community)
  • Expande seção de cloud storage com guia completo para Cloudflare R2 / AWS S3, incluindo nota sobre CORS do bucket (critério de aceite do issue que estava faltando)

evo-auth-service-community (bump para PR #10)

  • avatarable.rb: rails_service_blob_proxy_path → URL absoluta com app_url
  • environment_config.rb: lê AUTH_SERVICE_URL, configura routes.default_url_options
  • development.rb: corrige action_mailer porta 30003001

Critérios de aceite × este PR

Critério Status
Images persist to S3 ✅ (PR anterior)
CORS / port mismatches resolved ✅ volume compartilhado + docs CORS bucket
Profile photo upload persists ✅ avatarable.rb URL absoluta
Storage env vars documentados no README .env.example expandido

Test plan

  • docker-compose up → upload de imagem via WhatsApp → imagem visível na conversa após reload
  • Upload de avatar no perfil → avatar persiste após reload (sem 404)
  • ACTIVE_STORAGE_SERVICE=s3_compatible com R2 → avatar carrega direto do bucket
  • .env.example cópia → AUTH_SERVICE_URL presente por padrão

🤖 Generated with Claude Code

Summary by Sourcery

Ensure avatar and storage behavior works correctly across services and environments

Enhancements:

  • Share a persistent crm_storage volume between the evo-crm web and Sidekiq containers to keep uploaded files visible across processes
  • Mount a storage volume for the auth service container and adjust its startup command to clear stale Rails PID files before booting the server

Documentation:

  • Update environment example configuration to include AUTH_SERVICE_URL and expanded guidance for S3-compatible/cloud storage setup

marcelogorutuba and others added 5 commits April 24, 2026 20:14
… permission denied on storage

Named Docker volumes are created with root ownership, causing Errno::EACCES
when the Rails process (running as user rails:1000) tries to create subdirs
under /rails/storage. Bind mount gives the container process write access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cleanup

- evo-ai-crm-community: bump submodule to fix(EVO-975) — remove :account from
  fetch_pipeline eager loading (AssociationNotFoundError broke set_as_default,
  preventing Pipeline.default.first from ever returning a pipeline)
- docker-compose.yml: add rm -f server.pid to evo-auth startup command to
  prevent stale PID file from blocking restarts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- evo-ai-crm-community: fix(EVO-975) messages eager loading + auth service
  stale connection retry + evolution health endpoint + attachment url expiry
- evo-ai-core-service-community: refactor EvoAuthAccount json.RawMessage + ActivePlan optional
- evo-ai-frontend-community: fix(EVO-979) audio OGG/Opus + Profile i18n + SLA types + setup locale
- evo-ai-processor-community: fix run_seeders.py argparse help text
- evo-auth-service-community: onboarding survey backend (token, endpoint, user associations)
- evolution-api: v2.3.7 release
- evolution-go: updated binary with latest changes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rage docs

- docker-compose.yml: add crm_storage volume to evo-crm and evo-crm-sidekiq
  so web and Sidekiq containers share the same local storage (fixes ActiveStorage
  blobs written by Sidekiq not being visible to the web container)
- .env.example: add AUTH_SERVICE_URL var (needed by avatarable.rb to generate
  absolute avatar URLs accessible from the browser)
- .env.example: expand cloud storage section with Cloudflare R2 / S3 setup guide
  and CORS bucket configuration note (acceptance criterion from EVO-976)
- evo-auth-service-community: bump to fix/EVO-976-avatar-url (PR #10)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 4, 2026

🧙 Sourcery has finished reviewing your pull request!


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider using a named volume for evo-auth-service-community storage instead of a host bind (./evo-auth-service-community/storage:/rails/storage) to keep storage handling consistent with the CRM services and avoid path-related discrepancies across environments.
  • Since storage is now shared via crm_storage, it might be worth explicitly calling out any expected cleanup or migration for existing local blobs to avoid unexpected behavior for developers who already have non-shared storage data.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider using a named volume for `evo-auth-service-community` storage instead of a host bind (`./evo-auth-service-community/storage:/rails/storage`) to keep storage handling consistent with the CRM services and avoid path-related discrepancies across environments.
- Since storage is now shared via `crm_storage`, it might be worth explicitly calling out any expected cleanup or migration for existing local blobs to avoid unexpected behavior for developers who already have non-shared storage data.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

DavidsonGomes and others added 2 commits May 4, 2026 16:59
…bmodules)

- docker-compose.yml: drop crm_storage named volume from evo-crm and
  evo-crm-sidekiq (C2). The project bind ./evo-ai-crm-community:/app:delegated
  already shares /app/storage between the two containers — the named volume
  was masking the bind, which (a) hides ActiveStorage blobs from the host
  and (b) reintroduces the same root-ownership pitfall fixed for auth_storage
  in commit d29cf49.
- evo-ai-crm-community → 87a81660 (C1): bumps to fix/EVO-976-attachment-processor-spec
  which adds the AttachmentProcessor specs round-1 review flagged as missing
  (round-2 reply claimed they existed but they did not).
- evo-auth-service-community → 623b5b9d: bumps to fix/EVO-976-avatar-url HEAD
  with H3/H4/L1 fixes (1.hour TTL, nil instead of '', URI scheme validation).
- evo-ai-frontend-community → 36544f5: PR #35 (EVO-979) merged to main —
  previous pointer 5206b1fd was an orphan SHA (not our ref).
- evo-ai-processor-community → 2b329c6c (main HEAD): previous pointer
  aa7fbf3 was orphan.
- evo-ai-core-service-community → 33230bb (main HEAD): previous pointer
  ba04dc8b was orphan.
- evolution-go → 9f0eb34b: refreshed to clean tree.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@DavidsonGomes DavidsonGomes merged commit 03b9dd9 into main May 4, 2026
@DavidsonGomes DavidsonGomes deleted the fix/EVO-976-avatar-storage branch May 4, 2026 20:02
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.

2 participants