fix(dashboard): keep the dashboard out of search indexes
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 7m3s
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 7m3s
Every response carries X-Robots-Tag: noindex, nofollow and /robots.txt disallows everything. On an orca agent node the cluster's security headers are not applied, so the production host sent none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
This commit is contained in:
1 parent
6a6587a074
commit
2a1e23e1ca
2 files changed
+13
-2
No files matched your search
@@ -62,7 +62,7 @@ gloo-timers = { version = "0.3", features = ["futures"], optional = true }
|
||||
# Server-only
|
||||
axum = { version = "0.8", optional = true }
|
||||
mongodb = { workspace = true, optional = true }
|
||||
tower-http = { version = "0.6", features = ["cors", "trace"], optional = true }
|
||||
tower-http = { version = "0.6", features = ["cors", "trace", "set-header"], optional = true }
|
||||
secrecy = { workspace = true, optional = true }
|
||||
dotenvy = { version = "0.15", optional = true }
|
||||
tokio = { workspace = true, optional = true }
|
||||
|
||||
@@ -2,6 +2,7 @@ use axum::routing::get;
|
||||
use axum::{middleware, Extension};
|
||||
use dioxus::prelude::*;
|
||||
use time::Duration;
|
||||
use tower_http::set_header::SetResponseHeaderLayer;
|
||||
use tower_sessions::SessionManagerLayer;
|
||||
|
||||
use compliance_core::config::AppEnv;
|
||||
@@ -90,6 +91,12 @@ pub fn server_start(app: fn() -> Element) -> Result<(), DashboardError> {
|
||||
// Liveness for the container healthcheck; outside `/api/`, so
|
||||
// it needs no session.
|
||||
.route("/health", get(|| async { "ok" }))
|
||||
// A signed-in application: nothing here belongs in a search
|
||||
// index (the orca agent adds no headers of its own).
|
||||
.route(
|
||||
"/robots.txt",
|
||||
get(|| async { "User-agent: *\nDisallow: /\n" }),
|
||||
)
|
||||
.route("/auth", get(auth_login))
|
||||
.route("/auth/callback", get(auth_callback))
|
||||
.route("/logout", get(logout))
|
||||
@@ -100,7 +107,11 @@ pub fn server_start(app: fn() -> Element) -> Result<(), DashboardError> {
|
||||
.layer(Extension(PendingOAuthStore::default()))
|
||||
.layer(middleware::from_fn(require_auth))
|
||||
.layer(Extension(server_state))
|
||||
.layer(session);
|
||||
.layer(session)
|
||||
.layer(SetResponseHeaderLayer::overriding(
|
||||
axum::http::HeaderName::from_static("x-robots-tag"),
|
||||
axum::http::HeaderValue::from_static("noindex, nofollow"),
|
||||
));
|
||||
|
||||
axum::serve(listener, router.into_make_service())
|
||||
.await
|
||||
|
||||
Reference in new issue
Block a user