diff --git a/bb-cli/src/bb/apps.rs b/bb-cli/src/bb/apps.rs index 9492101a8..573a74348 100644 --- a/bb-cli/src/bb/apps.rs +++ b/bb-cli/src/bb/apps.rs @@ -56,6 +56,7 @@ const CONTROL_PLANE_REQUEST_TIMEOUT: Duration = Duration::from_secs(3 * 60); const CONTROL_PLANE_RESPONSE_MAX_BYTES: usize = 2 * 1024 * 1024; const TRUSTED_CONTROL_PLANE_HOSTS: &[&str] = &[ "compose-ctrl.test.blockstaging.build", + "compose-ctrl.block.builderlabstaging.xyz", "compose-ctrl.app.builderlab.xyz", ]; @@ -3889,8 +3890,10 @@ mod tests { for trusted in [ "https://compose-ctrl.test.blockstaging.build", + "https://compose-ctrl.block.builderlabstaging.xyz", "https://compose-ctrl.app.builderlab.xyz", "https://compose-ctrl.test.blockstaging.build:443", + "https://compose-ctrl.block.builderlabstaging.xyz:443", ] { assert!( ControlPlaneClient::new(trusted, "1.0.0", style).is_ok(), @@ -3905,6 +3908,9 @@ mod tests { "https://app.builderlab.xyz", "https://compose-ctrl.test.blockstaging.build.attacker.example", "https://compose-ctrl.test.blockstaging.build:444", + "http://compose-ctrl.block.builderlabstaging.xyz", + "https://compose-ctrl.block.builderlabstaging.xyz.attacker.example", + "https://compose-ctrl.block.builderlabstaging.xyz:444", "https://compose-ctrl.app.builderlab.xyz.attacker.example", "https://compose-ctrl.app.builderlab.xyz:444", "https://user@compose-ctrl.test.blockstaging.build", diff --git a/src-tauri/src/commands/telemetry.rs b/src-tauri/src/commands/telemetry.rs index ed8c8fd44..8a5f3e948 100644 --- a/src-tauri/src/commands/telemetry.rs +++ b/src-tauri/src/commands/telemetry.rs @@ -45,7 +45,7 @@ const TELEMETRY_SCHEMA_VERSION: &str = "berd-otlp-logs-v3"; // // - otel.berd.xyz — the production gateway (squareup/berd-monitoring's // production deployment), injected for VITE_ENVIRONMENT=production builds. -// - otel.test.blockstaging.build — the staging gateway +// - otel.block.builderlabstaging.xyz — the staging gateway // (squareup/berd-monitoring's staging deployment), injected for // VITE_ENVIRONMENT=staging builds. // - otlp.invalid.goose-internal.example — DUMMY placeholder injected in @@ -56,7 +56,7 @@ const TELEMETRY_SCHEMA_VERSION: &str = "berd-otlp-logs-v3"; // tauri.conf.json's CSP connect-src. const ALLOWED_OTEL_LOGS_HOSTS: [&str; 3] = [ "otel.berd.xyz", - "otel.test.blockstaging.build", + "otel.block.builderlabstaging.xyz", "otlp.invalid.goose-internal.example", ]; @@ -1674,17 +1674,17 @@ mod tests { #[test] fn allows_the_staging_gateway_host_and_derives_its_bootstrap_url() { let logs_url = - allowed_otel_logs_endpoint("https://otel.test.blockstaging.build/v1/logs").unwrap(); + allowed_otel_logs_endpoint("https://otel.block.builderlabstaging.xyz/v1/logs").unwrap(); let bootstrap_url = telemetry_bootstrap_url(&logs_url).unwrap(); assert_eq!( logs_url.as_str(), - "https://otel.test.blockstaging.build/v1/logs" + "https://otel.block.builderlabstaging.xyz/v1/logs" ); assert_eq!( bootstrap_url.as_str(), - "https://otel.test.blockstaging.build/v1/bootstrap" + "https://otel.block.builderlabstaging.xyz/v1/bootstrap" ); } @@ -1719,9 +1719,10 @@ mod tests { /// request; the error must not echo the credential either. #[test] fn rejects_endpoint_with_userinfo_credentials() { - let error = - allowed_otel_logs_endpoint("https://user:hunter2@otel.test.blockstaging.build/v1/logs") - .unwrap_err(); + let error = allowed_otel_logs_endpoint( + "https://user:hunter2@otel.block.builderlabstaging.xyz/v1/logs", + ) + .unwrap_err(); assert!(error.contains("credentials")); assert!(!error.contains("hunter2")); @@ -1729,8 +1730,9 @@ mod tests { #[test] fn rejects_endpoint_with_username_only_userinfo() { - let error = allowed_otel_logs_endpoint("https://user@otel.test.blockstaging.build/v1/logs") - .unwrap_err(); + let error = + allowed_otel_logs_endpoint("https://user@otel.block.builderlabstaging.xyz/v1/logs") + .unwrap_err(); assert!(error.contains("credentials")); } @@ -1740,8 +1742,9 @@ mod tests { /// and installation id. #[test] fn rejects_endpoint_with_explicit_port() { - let error = allowed_otel_logs_endpoint("https://otel.test.blockstaging.build:8443/v1/logs") - .unwrap_err(); + let error = + allowed_otel_logs_endpoint("https://otel.block.builderlabstaging.xyz:8443/v1/logs") + .unwrap_err(); assert!(error.contains("port")); } @@ -1751,9 +1754,13 @@ mod tests { #[test] fn allows_the_scheme_default_port() { let url = - allowed_otel_logs_endpoint("https://otel.test.blockstaging.build:443/v1/logs").unwrap(); + allowed_otel_logs_endpoint("https://otel.block.builderlabstaging.xyz:443/v1/logs") + .unwrap(); - assert_eq!(url.as_str(), "https://otel.test.blockstaging.build/v1/logs"); + assert_eq!( + url.as_str(), + "https://otel.block.builderlabstaging.xyz/v1/logs" + ); } #[test] diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index ef00b5e22..386b1d992 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -34,7 +34,7 @@ "security": { "csp": { "default-src": "'self' asset:", - "connect-src": "'self' ipc: asset: http://asset.localhost http://ipc.localhost http://localhost:* ws://localhost:* http://127.0.0.1:* ws://127.0.0.1:* data: https: https://otel.berd.xyz/v1/logs https://otel.berd.xyz/v1/bootstrap https://otel.test.blockstaging.build/v1/logs https://otel.test.blockstaging.build/v1/bootstrap https://otlp.invalid.goose-internal.example/v1/logs https://otlp.invalid.goose-internal.example/v1/bootstrap", + "connect-src": "'self' ipc: asset: http://asset.localhost http://ipc.localhost http://localhost:* ws://localhost:* http://127.0.0.1:* ws://127.0.0.1:* data: https: https://otel.berd.xyz/v1/logs https://otel.berd.xyz/v1/bootstrap https://otel.block.builderlabstaging.xyz/v1/logs https://otel.block.builderlabstaging.xyz/v1/bootstrap https://otlp.invalid.goose-internal.example/v1/logs https://otlp.invalid.goose-internal.example/v1/bootstrap", "font-src": "'self'", "img-src": "'self' asset: http://asset.localhost blob: data: https://models.dev", "media-src": "'self' asset: http://asset.localhost blob: data:", diff --git a/src/shared/telemetry/exporter.ts b/src/shared/telemetry/exporter.ts index d0517715e..b32353a50 100644 --- a/src/shared/telemetry/exporter.ts +++ b/src/shared/telemetry/exporter.ts @@ -25,7 +25,7 @@ import { JsonLogsSerializer } from "@opentelemetry/otlp-transformer"; // Injected by vite.config.ts from VITE_OTLP_LOGS_ENDPOINT: the full telemetry // gateway `https:///v1/logs` URL. Production builds get the production // gateway (otel.berd.xyz), staging builds the staging gateway -// (otel.test.blockstaging.build); development gets an obviously-fake DUMMY +// (otel.block.builderlabstaging.xyz); development gets an obviously-fake DUMMY // host, so the prod/staging gate (see `./client`) plus that placeholder keep // the path inert in dev and external clones. The native side derives the // anonymous `/v1/bootstrap` URL from this same endpoint, so no bootstrap URL diff --git a/vite.config.ts b/vite.config.ts index 9db1a7fc8..b64aff98b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -48,7 +48,7 @@ const PRODUCTION_OTLP_LOGS_ENDPOINT = "https://otel.berd.xyz/v1/logs"; // The staging gateway (squareup/berd-monitoring's staging deployment) — // injected whenever VITE_ENVIRONMENT=staging. const STAGING_OTLP_LOGS_ENDPOINT = - "https://otel.test.blockstaging.build/v1/logs"; + "https://otel.block.builderlabstaging.xyz/v1/logs"; // DUMMY placeholder for development. The telemetry send path (OTel logs over // OTLP) is gated to production/staging, so this fake host is never contacted