Document that Cloudflare Rocket Loader must be disabled (blank page, third report)
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 92/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
docs/guide.md の、279 行目付近にある既存の Cloudflare Access への参照の近くにあるリバースプロキシのセクションを編集してください。まず周辺の文言と、提案されている Rocket Loader の設定ルールを確認し、その後、code-server のホスト名では無効にする必要があることを説明するガイダンスを追加してください。ガイドで空白ページになる症状と、ホスト名を対象範囲とする Cloudflare 設定が明確に説明されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- TypeScript
- スター
- 79.4k
- フォーク
- 6.9k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 39
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/code-server のほかの issue
-
security
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
coder/code-server#8013 · コメント 4 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
coder/code-server#7976 · コメント 2 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
coder/code-server#7962 · コメント 3 件 ·
-
bug needs-investigation
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
coder/code-server#7955 · コメント 1 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
coder/code-server#7948 · コメント 1 件 · リアクション 2 件 ·
coder/code-server の issue をすべて見る
似ている issue
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
supermomonga/zcode-acp#24 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
growthbook/growthbook#7100 ·
-
triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100