Repository navigation
chore(deploy): domínios webchat.gcruz.dev.br e webchat-api.gcruz.dev.br - #22
Merged
Merged
Conversation
O frontend passa a ser servido em chat.gcruz.dev.br e o WebSocket em chat-api.gcruz.dev.br. Durante a transição, ALLOWED_ORIGINS aceita as duas origens do site e o connect-src da CSP aceita os dois endereços do backend, então o merge não depende da ordem da troca de DNS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MtFw2a1gk1CyMWBrCUmKRT
O site passa a responder em webchat.gcruz.dev.br e o backend em webchat-api.gcruz.dev.br. O nome segue o do repositório e não se confunde com um serviço de chat do domínio inteiro. ALLOWED_ORIGINS, VITE_SOCKET_URL, o connect-src da CSP e a documentação foram ajustados; os endereços onrender.com continuam aceitos na transição.
Com VITE_PUBLIC_URL definida no build, quem abre o site pelo *.onrender.com é levado ao mesmo caminho, query e convite (#/s/código) no domínio próprio. Site estático no Render não tem redirecionamento por host, então o primeiro módulo carregado faz isso. Sem a variável, ou em outro host, nada muda.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumo
Prepara a migração do chat para o domínio próprio:
chat-frontendwebchat.gcruz.dev.brchat-frontend-g42t.onrender.comchat-backendwebchat-api.gcruz.dev.brchat-backend-3sxv.onrender.comMudanças
render.yaml:ALLOWED_ORIGINS:https://webchat.gcruz.dev.br,https://chat-frontend-g42t.onrender.com.VITE_SOCKET_URL:wss://webchat-api.gcruz.dev.br.connect-src 'self' wss://webchat-api.gcruz.dev.br wss://chat-backend-3sxv.onrender.com.infra/render-frontend-headers.yaml: a mesma CSP, para os dois arquivos não divergirem (o testefrontend/test/headers.test.jsconfere isso).backend/src/config.js: o exemplo da mensagem de erro deALLOWED_ORIGINSusa o domínio novo.docs/DEPLOY_RENDER.md: nova seção Domínios, tabela de variáveis e comandos de verificação atualizados.docs/PRODUCAO.md: verificação pós-publicação nos endereços novos.Por que o merge é seguro antes da troca de DNS
render.yamlnão é aplicado sozinho (é documentação revisável da configuração).VITE_SOCKET_URLem produção vem do painel do Render, não deste arquivo. O frontend continua conectando no backend antigo até a variável ser trocada lá.ALLOWED_ORIGINSdochat-backendjá aceita as duas origens.Depois do merge
chat/chat-apina Cloudflare (DNS only).infra/render-frontend-headers.yamlpara a branchops/render-frontend-headerse sincronizar o Blueprint (os cabeçalhos de produção vêm de lá).VITE_SOCKET_URL=wss://webchat-api.gcruz.dev.brnochat-frontende novo deploy.Testes
npm run format:check,npm run lint:js: ok.npm test: frontend 238/238 e backend 374/374.Generated by Claude Code