[PR #7924] [MERGED] fix(server): ask search engines not to index Marinara #8004

Closed
opened 2026-10-24 04:09:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7924
Author: @Gunterlie
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @Gunterlie

Base: staging ← Head: fix/noindex-7910


📝 Commits (2)

  • 556fb87 fix(server): ask search engines not to index Marinara (#7910)
  • 74c6f6c docs: place search-engine note before related guides

📊 Changes

6 files changed (+24 additions, -3 deletions)

View changed files

📝 docs/REMOTE_ACCESS.md (+4 -0)
📝 packages/client/index.html (+1 -0)
📝 packages/server/src/app.ts (+3 -3)
📝 packages/server/src/middleware/security-headers.ts (+2 -0)
📝 scripts/regressions/loopback-proxy-auth-security.regression.ts (+10 -0)
📝 scripts/regressions/static-cache-headers.regression.ts (+4 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote the repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7910. Part of #7909. @SpicyMarinara

Why this change

Search engines index reachable Marinara installations, so strangers can find them by searching for the product name. Only the access-refusal page asked crawlers not to index it. Every response now does. This is a secondary measure: it does not give access control and does not remove pages that are already indexed.

What changed

  • security-headers.ts: every response gets X-Robots-Tag: noindex, nofollow. It is set on the raw response too, so routes that write raw SSE headers (reply.raw.writeHead) also carry it.
  • app.ts: the security-headers hook now runs before host validation, so 421 refusals (and CORS preflights) also get the security headers. No later hook reads or removes these headers.
  • index.html: <meta name="robots" content="noindex, nofollow">.
  • docs/REMOTE_ACCESS.md: a short "Search engines" section that says this is not access control.
  • Regressions: header asserted on a normal 200, a 401, a host-validation 421, a static asset and the SPA shell.

Known test gaps (accepted, low): the regression mirrors the app.ts hook order instead of reading it, and no regression drives a raw SSE route.

Validation

Run by the agent on devbox:

  • loopback-proxy-auth-security regression: pass

  • pnpm regression:static-cache: pass

  • server tsc --noEmit: pass

  • prettier --check on changed files: pass

  • Opus gate review: ship, no defects; docs placement nit fixed in this PR

  • pnpm check passes locally

  • Container (Docker / Podman) built and ran without issue

  • Ran the app, clicked through the changes manually

  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)

  • Above manual verification completed (describe below)

  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify with curl -sI http://localhost:7860/ that the response has X-Robots-Tag: noindex, nofollow.
  • Manually verify that the page source of the app contains the robots meta tag.
  • Manually verify that a streaming chat generation (SSE) still works and its response headers include X-Robots-Tag.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Docs-i18n: the "Search engines" section is already translated for all ten packs together with #7921; that PR opens after this one merges so its manifests can point at the merged staging commit.

UI evidence (if applicable)

Not applicable: response header, one meta tag and docs.

Summary by CodeRabbit

  • Security

    • Added noindex, nofollow directives to prevent search engines from indexing the client interface or following its links.
    • Security headers are now included on host-validation error responses and other tested response types.
  • Documentation

    • Clarified that search-engine exclusion does not secure an installation or remove pages already indexed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7924 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `fix/noindex-7910` --- ### 📝 Commits (2) - [`556fb87`](https://github.com/Pasta-Devs/Marinara-Engine/commit/556fb87e58dd9454b7796fc5821d2ddd7c1c252e) fix(server): ask search engines not to index Marinara (#7910) - [`74c6f6c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/74c6f6ca76201b1c58c8b423ba96aa1db038845c) docs: place search-engine note before related guides ### 📊 Changes **6 files changed** (+24 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/REMOTE_ACCESS.md` (+4 -0) 📝 `packages/client/index.html` (+1 -0) 📝 `packages/server/src/app.ts` (+3 -3) 📝 `packages/server/src/middleware/security-headers.ts` (+2 -0) 📝 `scripts/regressions/loopback-proxy-auth-security.regression.ts` (+10 -0) 📝 `scripts/regressions/static-cache-headers.regression.ts` (+4 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote the repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7910. Part of #7909. @SpicyMarinara ## Why this change Search engines index reachable Marinara installations, so strangers can find them by searching for the product name. Only the access-refusal page asked crawlers not to index it. Every response now does. This is a secondary measure: it does not give access control and does not remove pages that are already indexed. ## What changed - `security-headers.ts`: every response gets `X-Robots-Tag: noindex, nofollow`. It is set on the raw response too, so routes that write raw SSE headers (`reply.raw.writeHead`) also carry it. - `app.ts`: the security-headers hook now runs before host validation, so 421 refusals (and CORS preflights) also get the security headers. No later hook reads or removes these headers. - `index.html`: `<meta name="robots" content="noindex, nofollow">`. - `docs/REMOTE_ACCESS.md`: a short "Search engines" section that says this is not access control. - Regressions: header asserted on a normal 200, a 401, a host-validation 421, a static asset and the SPA shell. Known test gaps (accepted, low): the regression mirrors the `app.ts` hook order instead of reading it, and no regression drives a raw SSE route. ## Validation <!-- Required: include commands run and/or manual checks performed --> Run by the agent on devbox: - `loopback-proxy-auth-security` regression: pass - `pnpm regression:static-cache`: pass - server `tsc --noEmit`: pass - `prettier --check` on changed files: pass - Opus gate review: ship, no defects; docs placement nit fixed in this PR - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify with `curl -sI http://localhost:7860/` that the response has `X-Robots-Tag: noindex, nofollow`. - Manually verify that the page source of the app contains the robots meta tag. - Manually verify that a streaming chat generation (SSE) still works and its response headers include `X-Robots-Tag`. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Docs-i18n: the "Search engines" section is already translated for all ten packs together with #7921; that PR opens after this one merges so its manifests can point at the merged staging commit. ## UI evidence (if applicable) Not applicable: response header, one meta tag and docs. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Security** * Added `noindex, nofollow` directives to prevent search engines from indexing the client interface or following its links. * Security headers are now included on host-validation error responses and other tested response types. * **Documentation** * Clarified that search-engine exclusion does not secure an installation or remove pages already indexed. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:35 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8004
No description provided.