Document that Cloudflare Rocket Loader must be disabled (blank page, third report)
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 1/5
- Tempo estimado
- Menos de uma hora
- Facilidade para iniciantes
- 92/100
- Tipo de issue
- Documentação
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Domínio
- documentation
Direção de pesquisa
Edite a seção de reverse proxy de docs/guide.md, próxima à referência existente ao Cloudflare Access por volta da linha 279. Comece revisando a redação ao redor e a regra de configuração sugerida do Rocket Loader; em seguida, adicione uma orientação de que ele deve ser desabilitado para nomes de host do code-server. A tarefa estará concluída quando o guia explicar claramente o sintoma de uma página em branco e a configuração do Cloudflare com escopo por nome de host.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
What is your suggestion?
Document that Cloudflare's Rocket Loader must be disabled for hostnames serving code-server, in the reverse-proxy section of docs/guide.md (which already references Cloudflare Access around line 279).
Suggested wording:
Cloudflare users: disable Rocket Loader for your code-server hostname. Rocket Loader rewrites inline
<script>tags at the edge, which code-server's Content Security Policy blocks, resulting in a blank page with no visible error. Scope it with a Configuration Rule rather than disabling it zone-wide:Expression: (http.host eq "code.example.com") Setting: Rocket Loader → Off
How will this improve the docs?
This failure has now been reported three times (#1451, #4164, and my own investigation below), always as "white screen behind Cloudflare". It is hard to self-diagnose: every asset returns HTTP 200, the server logs look healthy, and the only symptom is an empty <body> plus a CSP error that does not mention Cloudflare.
The failure became easier to hit in recent releases. Comparing the CSP script-src emitted by two versions:
| 4.130.0 (loads) | 4.138.0 (blank) | |
|---|---|---|
| nonce | 'nonce-1nline-m4p' (static literal) |
random per request |
sha256 hashes |
5 | 2 |
With a static nonce, Rocket Loader's injected inline scripts copy the nonce out of the surrounding markup and still validate. With a per-request nonce and a shorter hash list they do not, so CSP blocks them and the AMD loader fails with Cannot determine URI for module id!.
I reproduced this on two independent machines behind separate Cloudflare Tunnels. Both worked on 4.130.0 and broke immediately after upgrading to 4.138.0, with no Cloudflare configuration change in between. Disabling Rocket Loader for those hostnames fixed both, with no change to the origin.
The underlying CSP change is upstream, not code-server's — patches/csp-hashes.diff is byte-identical between v4.130.0 and v4.138.0, and code serve-web 1.138.0 fails the same way with no code-server in the path. I filed that separately as microsoft/vscode#337226. This request is only about documenting the interaction, since code-server users are the ones who predominantly hit it.
One related note: in #1451 a maintainer mentioned adding "the proper tags so our scripts don't get rocket-loaded by default". That does not appear to be in effect on 4.138.0 — all six bootstrap script tags are still rewritten to type="<hash>-text/javascript". If that mitigation is still wanted, it would remove the need for the docs change; otherwise documenting the workaround seems like the cheaper fix.
Are you interested in submitting a PR for this?
Yes, happy to open a PR against docs/guide.md if you would like the wording above (or something closer to your house style).
- Linguagem predominante
- TypeScript
- Estrelas
- 79.4k
- Forks
- 6.9k
- Merge médio
- 2d 13h
- PRs com merge (30d)
- 39
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de coder/code-server
-
Bump proxy-addr to 2.0.8 Abertasecurity
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
coder/code-server#8013 · 4 comentários ·
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
coder/code-server#7976 · 2 comentários ·
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
coder/code-server#7962 · 3 comentários ·
-
bug needs-investigation
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
coder/code-server#7955 · 1 comentário ·
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 42/100
coder/code-server#7948 · 1 comentário · 2 reações ·
Todas as issues de coder/code-server
Issues semelhantes
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
-
Mend: dependency security vulnerability untriaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100