Skip to content

Fix static hosting domain fallback for self-hosted custom domains#3382

Merged
Salazareo merged 1 commit into
HeyPuter:mainfrom
tamilselvanp57:fix/dev-center-static-hosting-404
Jul 15, 2026
Merged

Fix static hosting domain fallback for self-hosted custom domains#3382
Salazareo merged 1 commit into
HeyPuter:mainfrom
tamilselvanp57:fix/dev-center-static-hosting-404

Conversation

@tamilselvanp57

Copy link
Copy Markdown
Contributor

Title: Fix static hosting domain fallback for self-hosted custom domains (#3380)

Description:

Fixes #3380

Root cause
dev-center.js only remaps window.static_hosting_domain away from the hardcoded public default (puter.site) when window.domain === 'puter.localhost'. Any self-hosted instance running on a real custom domain falls through to puter.site, which doesn't exist on that network — so the Dev Center's "Give it a try" flow 404s after deploying via Apps → Deploy → Use files.

I also investigated the middleware side, since the original issue included a hostRedirects.js patch. hostRedirects.ts already guards against this correctly — createUserSubdomainRedirect's hostingDomains.some(...) check passes through requests already on the target hosting domain, preventing the redirect loop. So no change was needed there; the gap was isolated to the frontend fallback logic.

Fix
Added an else if branch so any self-hosted instance with a real custom domain (not puter.localhost, not puter.com) derives its static hosting domain as site. instead of falling back to the public puter.site.

Testing

Reproduced the original 404 on a self-hosted instance with a custom domain following the exact steps in #3380.
Confirmed the fix resolves it — after the change, deployed apps load correctly via "Give it a try."
Verified file syntax with node --check src/dev-center/js/dev-center.js.
Wasn't able to run the full local npm run build, since this repo requires Node ≥24 and I'm on Node 22.14.0 locally — will rely on CI to validate the full build/test suite. Happy to upgrade and re-verify locally if maintainers would prefer that before merge.

@CLAassistant

CLAassistant commented Jul 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Salazareo
Salazareo merged commit a4bb57b into HeyPuter:main Jul 15, 2026
3 checks passed
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.

Failed to load resource: the server responded with a status of 404

3 participants