-
-
Notifications
You must be signed in to change notification settings - Fork 678
ci: keep studio.geolibre.app out of search results #1843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,6 +129,24 @@ jobs: | |
| touch .nojekyll | ||
| # Keeps the custom domain if the Pages settings are ever reset. | ||
| echo "studio.geolibre.app" > CNAME | ||
| # Keep the gated instance out of search results. Nothing here is | ||
| # useful to a crawler — every route renders the sign-in card until a | ||
| # session exists — and the deployment is meant to be reached by | ||
| # invitation, not found. | ||
| printf 'User-agent: *\nDisallow: /\n' > robots.txt | ||
| # A second signal for crawlers that ignore robots.txt. Note the two | ||
| # do not compose: a crawler that honours the Disallow above never | ||
| # fetches this page and so never reads the noindex, which is why a | ||
| # URL linked from elsewhere can still be listed (bare, no title). If | ||
| # studio is ever linked publicly and that matters, relax robots.txt | ||
| # to "Allow: /" so the noindex is the rule that applies. | ||
| # Appended to the end of <head> rather than the start, so the charset | ||
| # declaration keeps its place as the first thing in the document. | ||
| sed -i '0,/<\/head>/s// <meta name="robots" content="noindex, nofollow" \/>\n <\/head>/' index.html | ||
| # The tag is injected into generated markup, so fail loudly if a | ||
| # future index.html no longer matches rather than publishing an | ||
| # indexable page. | ||
| grep -q 'name="robots"' index.html | ||
|
Comment on lines
+145
to
+149
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Validate the exact tag and document structure before publishing. At Line 149, Suggested minimum guard+ head_count_before=$(grep -oF '</head>' index.html | wc -l || true)
+ if [ "$head_count_before" -eq 0 ]; then
+ echo "::error::index.html has no </head> element."
+ exit 1
+ fi
sed -i '0,/<\/head>/s// <meta name="robots" content="noindex, nofollow" \/>\n <\/head>/' index.html
- grep -q 'name="robots"' index.html
+ head_count_after=$(grep -oF '</head>' index.html | wc -l || true)
+ robots_count=$(grep -oF '<meta name="robots" content="noindex, nofollow" />' index.html | wc -l || true)
+ if [ "$head_count_after" -ne "$head_count_before" ] || [ "$robots_count" -ne 1 ]; then
+ echo "::error::index.html failed robots meta validation."
+ exit 1
+ fi🤖 Prompt for AI Agents |
||
| # Published Pages sites may be no larger than 1 GB. The build is | ||
| # ~200 MB today, most of it the two DuckDB-WASM binaries; fail early | ||
| # rather than publish a site Pages will reject. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor/informational, low confidence:
vite-plugin-pwa's workboxglobPatternsincludeshtml(seevite.config.tsaround theworkbox:block), so the service-worker precache manifest's revision hash forindex.htmlis computed at build time from the pre-sed content. Thissedruns after that build step, so the deployedindex.html(with thenoindexmeta tag) will differ from what the manifest hashed.In practice this is likely harmless — Workbox precaching fetches the resource by URL at install time rather than validating byte-for-byte against the revision hash, so the service worker should still end up caching the actual (modified) file. Flagging only because it's a subtle build-step-ordering interaction worth being aware of if precache behavior ever looks stale for this deployment specifically.