Skip to content

Commit 09d5f4a

Browse files
aaddrickclaude
andauthored
fix(worker): use raw.githubusercontent.com as origin to avoid Pages 301 loop (#504)
Once the CNAME file is in place on gh-pages (Phase 4a-APT), GitHub Pages auto-301s all aaddrick.github.io/claude-desktop-debian/* traffic to pkg.claude-desktop-debian.dev/*. The Worker's origin fetch against aaddrick.github.io gets 301'd by Pages, the 301 passes through to the client, the client follows it back to pkg.<domain>, and the Worker runs again — infinite loop. Observed immediately after merging #503 and Pages finishing the CNAME build: $ curl -I https://pkg.claude-desktop-debian.dev/dists/stable/InRelease HTTP/2 301 location: http://pkg.claude-desktop-debian.dev/dists/stable/InRelease x-github-request-id: 3C94:286425:... x-served-by: cache-yyz4566-YYZ via: 1.1 varnish (Scheme-downgrade to http is a separate Pages quirk when https_enforced=false, which is the case here because DNS points at Cloudflare, not Pages, so Pages can't provision a cert.) raw.githubusercontent.com serves the same gh-pages branch content without Pages' routing layer. All five metadata paths verified to return 200: /dists/stable/InRelease /dists/stable/main/binary-amd64/Packages /KEY.gpg /rpm/x86_64/repodata/repomd.xml /rpm/x86_64/repodata/repomd.xml.asc Also fixes the deploy-worker.yml post-deploy probe which still hardcoded pkg-staging. That's what made #503's deploy show as failed in the Actions UI even though the wrangler deploy itself succeeded — route bound and Worker live, but the probe was resolving a hostname wrangler had just removed. Refs #493, #503 Co-authored-by: Claude <claude@anthropic.com>
1 parent b9bc02d commit 09d5f4a

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/deploy-worker.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ jobs:
2727

2828
- name: Verify route is bound and Worker responds
2929
env:
30-
# Probe whichever route wrangler.toml currently binds. Update this
31-
# when Phase 4a switches wrangler.toml to the production hostname.
32-
PROBE_HOST: pkg-staging.claude-desktop-debian.dev
30+
# Must match the hostname in worker/wrangler.toml's route.
31+
PROBE_HOST: pkg.claude-desktop-debian.dev
3332
run: |
3433
# Wait briefly for deploy + DNS propagation
3534
sleep 30

worker/src/worker.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010
//
1111
// See docs/worker-apt-plan.md for the full architecture.
1212

13-
const ORIGIN = 'https://aaddrick.github.io/claude-desktop-debian';
13+
// Raw gh-pages content, bypassing the Pages routing layer. Fetching
14+
// via aaddrick.github.io auto-301s back to pkg.<domain> once the CNAME
15+
// is in place (Pages' custom-domain redirect), creating a loop through
16+
// this Worker. raw.githubusercontent.com serves the same branch content
17+
// directly and is unaffected by the custom-domain config.
18+
const ORIGIN =
19+
'https://raw.githubusercontent.com/aaddrick/claude-desktop-debian/gh-pages';
1420
const RELEASES =
1521
'https://github.com/aaddrick/claude-desktop-debian/releases/download';
1622

0 commit comments

Comments
 (0)