From 71550b4adf868de4800bdc1244ee0a41f9880c77 Mon Sep 17 00:00:00 2001 From: C3B2W23 <217007207+C3B2W23@users.noreply.github.com> Date: Fri, 11 Sep 2026 12:17:28 -0700 Subject: [PATCH] fix(basemap): trim header comments to match repo style Co-Authored-By: Claude Fable 5.1 --- .env.example | 6 ++---- frontend/src/app/api/basemap-config/route.ts | 14 +++----------- frontend/src/components/map/styles/mapStyles.ts | 14 +++----------- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/.env.example b/.env.example index 9f4cf28..fc868f0 100644 --- a/.env.example +++ b/.env.example @@ -27,10 +27,8 @@ AIS_API_KEY= # Windy Webcams global CCTV layer — free key from https://api.windy.com/webcams/docs # WINDY_API_KEY= -# CARTO basemap tiles (DEFAULT dark/light map). CARTO now requires an API key; -# without one the map still loads but every tile carries an "API KEY REQUIRED" -# watermark. Free key (no CARTO account needed, 5M tiles/month fair use): -# https://carto.com/basemaps/apikey — used by the frontend container only. +# CARTO basemap tiles (DEFAULT map) — free key from https://carto.com/basemaps/apikey +# Without it tiles render with an "API KEY REQUIRED" watermark. # CARTO_API_KEY= # Telegram OSINT map layer — scrapes public t.me/s channel previews (no bot token). diff --git a/frontend/src/app/api/basemap-config/route.ts b/frontend/src/app/api/basemap-config/route.ts index ba657c2..f82f2e4 100644 --- a/frontend/src/app/api/basemap-config/route.ts +++ b/frontend/src/app/api/basemap-config/route.ts @@ -1,15 +1,7 @@ /** - * Runtime basemap configuration for the browser map. - * - * CARTO_API_KEY is a plain server-side env var on the frontend container - * (see docker-compose.yml). Like BACKEND_URL it is read at request time, so - * operators running the prebuilt GHCR image can set it in .env without a - * rebuild. A NEXT_PUBLIC_ var would be baked in at image build time and - * therefore always empty for them. - * - * The key is not a secret in the usual sense — the browser sends it to - * CARTO on every tile request — but it is only returned to same-origin - * callers of this Next.js server, never proxied to the backend. + * Serves CARTO_API_KEY to the browser map. Read from the frontend container's + * environment at request time (like BACKEND_URL) so the prebuilt image needs + * no rebuild. Consumed by useBasemapConfig(). */ import { NextResponse } from 'next/server'; diff --git a/frontend/src/components/map/styles/mapStyles.ts b/frontend/src/components/map/styles/mapStyles.ts index cfd27a2..8acdcd8 100644 --- a/frontend/src/components/map/styles/mapStyles.ts +++ b/frontend/src/components/map/styles/mapStyles.ts @@ -1,14 +1,7 @@ /** - * MapLibre basemap styles backed by CARTO raster tiles. - * - * CARTO now requires an API key for its basemap tiles; unkeyed requests - * return tiles stamped with an "API KEY REQUIRED" watermark. The key is - * read at request time by /api/basemap-config (CARTO_API_KEY on the - * frontend container) and threaded in here via `buildBasemapStyle`, so - * prebuilt Docker images pick it up without a rebuild. - * - * With no key configured the styles are unchanged from before, so existing - * deployments keep working exactly as they did (watermark included). + * MapLibre basemap styles on CARTO raster tiles. CARTO requires an API key + * (unkeyed tiles are watermarked); MaplibreViewer passes one from + * useBasemapConfig() via buildBasemapStyle(). */ export type BasemapTheme = 'dark' | 'light'; @@ -49,6 +42,5 @@ export function buildBasemapStyle(theme: BasemapTheme, cartoApiKey?: string | nu }; } -// Key-less defaults, kept for callers that do not need a CARTO key. export const darkStyle = buildBasemapStyle('dark'); export const lightStyle = buildBasemapStyle('light');