Repository navigation
Conversation
…h.com Morgan Stanley's proxy blocks sourcegraph.com, so the production docs are also served from ms-docs.sg.dev. - Mark ms-docs.sg.dev noindex, like the versioned docs domains. - Redirect latest-version paths (/v/X.Y, /@X.Y) on the same host. - Use the bundled version list in production instead of fetching it from sourcegraph.com. - Render links to https://sourcegraph.com/docs/... as internal links. Amp-Thread-ID: https://ampcode.com/threads/T-01a1d87e-2c3b-7242-bfb4-cb53bd8dc153 Co-authored-by: Amp <amp@ampcode.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
This comment has been minimized.
This comment has been minimized.
Amp-Thread-ID: https://ampcode.com/threads/T-01a1d87e-2c3b-7242-bfb4-cb53bd8dc153 Co-authored-by: Amp <amp@ampcode.com>
This branch was successfully deployed
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.
Morgan Stanley's proxy (Netskope) blocks sourcegraph.com, so their users can't open sourcegraph.com/docs. As a short-term workaround the production deployment is also served from
ms-docs.sg.dev(their instance isms.sg.dev). This PR keeps visitors on that host instead of sending them back to sourcegraph.com, and keeps it out of search indexes. Background: https://sourcegraph.slack.com/archives/C01DXLN3D0T/p1794592592148349Changes
vercel.json: theX-Robots-Tag: noindex, nofollowhost rule for versioned docs also matchesms-docs.sg.dev. The Cloudflare robots.txt worker only covers*.sourcegraph.com.ms-docs.sg.dev/robots.txtreturns 404, so crawlers can still fetch pages and see the noindex, and canonical URLs already point athttps://sourcegraph.com/docs/....src/proxy.ts:/v/<latest>[/…]and/@<latest>[/…]redirected to a hardcodedhttps://sourcegraph.com/docs; they now drop the version and stay on the request's host and basePath.VersionSelector: the production build (basePath/docs) uses its bundled version list instead of fetchinghttps://sourcegraph.com/docs/api/versions, which is the same list, is blocked for these users, and would point "latest" at sourcegraph.com. Preview and versioned builds still fetch it.CustomLink: MDX links tohttps://sourcegraph.com/docs/...render as internal links. Most come from generated pages (CLI reference, dashboards, telemetry).Already fine on the new host:
/redirects to/docson the same host (next.config.js), redirects fromredirects.tssend relative Locations, assets are relative, and Algolia accepts any Referer, with hit URLs already rewritten to the current host.Still on sourcegraph.com, with nothing on this site to point at instead: the Changelog/RSS/Pricing links,
/docs/changelog.rss, about 90redirects.tsentries to handbook/pricing/changelog pages, links to sourcegraph.com/search, and older versions onX.Y.sourcegraph.com.Deployment dependencies
ms-docs.sg.dev→cname.vercel-dns.com, DNS-only (separate infrastructure PR).ms-docs.sg.devto the Vercel project as a Production domain (no git branch, not a redirect), and check that Deployment Protection and Firewall rules don't block it.NEXT_PUBLIC_DOCS_VERSIONS_URLmust not be set for Production.Test plan
VERCEL_ENV=production pnpm run build+next start, curled withHost: ms-docs.sg.devandHost: sourcegraph.com: both give relative redirects (/→/docs,/docs/v/8.2/admin/config→/docs/admin/config;/docs/v/8.1/admin→https://8.1.sourcegraph.com/admin), pages 200, unknown paths 404. Production today sends/docs/v/8.2tohttps://sourcegraph.com/docs.https://ms-docs.sg.devmapped to the local build, withhttps://sourcegraph.com/**blocked: root, version menu, search, a CLI reference link, and the 8.2 redirect stayed on the host; the HAR had 0 requests to sourcegraph.com.'') withHost: 8.3.sourcegraph.com:/serves and/v/8.2/admin/config→/admin/config.tsc --noEmitand eslint pass. Thevercel.jsonheader can only be checked on a Vercel deployment.Amp thread: https://ampcode.com/threads/T-01a1d87e-2c3b-7242-bfb4-cb53bd8dc153