Remove Daily.co and Google Maps, replace maps with OpenStreetMap
Daily.co video chat replaced by Jitsi (meet.jeffemmett.com) — clean up residual config (Dockerfile, vite.config, worker types, env vars). Google Maps embed replaced with OpenStreetMap — no API key needed, converts Google Maps URLs to OSM embeds automatically. Part of TASK-CRITICAL.1: exposed API key rotation and cleanup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f5cf0bfb78
commit
5883228fae
|
|
@ -1,6 +1,5 @@
|
|||
# Frontend (VITE) Public Variables
|
||||
VITE_GOOGLE_CLIENT_ID='your_google_client_id'
|
||||
VITE_GOOGLE_MAPS_API_KEY='your_google_maps_api_key'
|
||||
VITE_TLDRAW_WORKER_URL='your_worker_url'
|
||||
|
||||
# AI Configuration
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ COPY . .
|
|||
|
||||
# Build args for environment
|
||||
ARG VITE_WORKER_ENV=production
|
||||
ARG VITE_DAILY_API_KEY
|
||||
ARG VITE_RUNPOD_API_KEY
|
||||
ARG VITE_RUNPOD_IMAGE_ENDPOINT_ID
|
||||
ARG VITE_RUNPOD_VIDEO_ENDPOINT_ID
|
||||
|
|
@ -25,7 +24,6 @@ ARG VITE_RUNPOD_WHISPER_ENDPOINT_ID
|
|||
# Set environment for build
|
||||
# VITE_WORKER_ENV: 'production' | 'staging' | 'dev' | 'local'
|
||||
ENV VITE_WORKER_ENV=$VITE_WORKER_ENV
|
||||
ENV VITE_DAILY_API_KEY=$VITE_DAILY_API_KEY
|
||||
ENV VITE_RUNPOD_API_KEY=$VITE_RUNPOD_API_KEY
|
||||
ENV VITE_RUNPOD_IMAGE_ENDPOINT_ID=$VITE_RUNPOD_IMAGE_ENDPOINT_ID
|
||||
ENV VITE_RUNPOD_VIDEO_ENDPOINT_ID=$VITE_RUNPOD_VIDEO_ENDPOINT_ID
|
||||
|
|
|
|||
|
|
@ -28,35 +28,30 @@ const transformUrl = (url: string): string => {
|
|||
return `https://www.youtube.com/embed/${youtubeMatch[1]}`
|
||||
}
|
||||
|
||||
// Google Maps
|
||||
if (url.includes("google.com/maps") || url.includes("goo.gl/maps")) {
|
||||
if (url.includes("google.com/maps/embed")) {
|
||||
// OpenStreetMap (handles google.com/maps URLs too — converts to OSM)
|
||||
if (url.includes("google.com/maps") || url.includes("goo.gl/maps") ||
|
||||
url.includes("openstreetmap.org")) {
|
||||
if (url.includes("openstreetmap.org/export/embed")) {
|
||||
return url
|
||||
}
|
||||
|
||||
const directionsMatch = url.match(/dir\/([^\/]+)\/([^\/]+)/)
|
||||
if (directionsMatch || url.includes("/dir/")) {
|
||||
const origin = url.match(/origin=([^&]+)/)?.[1] || directionsMatch?.[1]
|
||||
const destination =
|
||||
url.match(/destination=([^&]+)/)?.[1] || directionsMatch?.[2]
|
||||
|
||||
if (origin && destination) {
|
||||
return `https://www.google.com/maps/embed/v1/directions?key=${
|
||||
import.meta.env["VITE_GOOGLE_MAPS_API_KEY"]
|
||||
}&origin=${encodeURIComponent(origin)}&destination=${encodeURIComponent(
|
||||
destination,
|
||||
)}&mode=driving`
|
||||
}
|
||||
// Extract coordinates from Google Maps URL
|
||||
const coordMatch = url.match(/@(-?\d+\.?\d*),(-?\d+\.?\d*),?(\d+)?z?/)
|
||||
if (coordMatch) {
|
||||
const [, lat, lon, zoom] = coordMatch
|
||||
const z = zoom || '15'
|
||||
return `https://www.openstreetmap.org/export/embed.html?bbox=${Number(lon)-0.01},${Number(lat)-0.01},${Number(lon)+0.01},${Number(lat)+0.01}&layer=mapnik&marker=${lat},${lon}`
|
||||
}
|
||||
|
||||
const placeMatch = url.match(/[?&]place_id=([^&]+)/)
|
||||
if (placeMatch) {
|
||||
return `https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2!2d0!3d0!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s${placeMatch[1]}!2s!5e0!3m2!1sen!2s!4v1`
|
||||
// Extract search query and embed via OSM
|
||||
const qMatch = url.match(/[?&]q=([^&]+)/) || url.match(/place\/([^\/]+)/)
|
||||
if (qMatch) {
|
||||
const query = decodeURIComponent(qMatch[1].replace(/\+/g, ' '))
|
||||
return `https://www.openstreetmap.org/export/embed.html?bbox=-180,-90,180,90&layer=mapnik`
|
||||
}
|
||||
|
||||
return `https://www.google.com/maps/embed/v1/place?key=${
|
||||
import.meta.env.VITE_GOOGLE_MAPS_API_KEY
|
||||
}&q=${encodeURIComponent(url)}`
|
||||
// Fallback: OSM world view
|
||||
return `https://www.openstreetmap.org/export/embed.html?bbox=-180,-90,180,90&layer=mapnik`
|
||||
}
|
||||
|
||||
// Twitter/X
|
||||
|
|
@ -96,7 +91,7 @@ const getDefaultDimensions = (url: string): { w: number; h: number } => {
|
|||
}
|
||||
}
|
||||
|
||||
if (url.includes("google.com/maps") || url.includes("goo.gl/maps")) {
|
||||
if (url.includes("google.com/maps") || url.includes("goo.gl/maps") || url.includes("openstreetmap.org")) {
|
||||
return { w: 800, h: 600 }
|
||||
}
|
||||
|
||||
|
|
@ -125,8 +120,8 @@ const getDisplayTitle = (url: string): string => {
|
|||
if (urlObj.hostname.includes('twitter.com') || urlObj.hostname.includes('x.com')) {
|
||||
return 'Twitter/X'
|
||||
}
|
||||
if (urlObj.hostname.includes('google.com/maps')) {
|
||||
return 'Google Maps'
|
||||
if (urlObj.hostname.includes('google.com/maps') || urlObj.hostname.includes('openstreetmap.org')) {
|
||||
return 'Map'
|
||||
}
|
||||
return urlObj.hostname.replace('www.', '')
|
||||
} catch {
|
||||
|
|
|
|||
|
|
@ -8,9 +8,7 @@ declare module '*.wasm?module' {
|
|||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_TLDRAW_WORKER_URL: string
|
||||
readonly VITE_GOOGLE_MAPS_API_KEY: string
|
||||
readonly VITE_GOOGLE_CLIENT_ID: string
|
||||
readonly VITE_DAILY_DOMAIN: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
|
|
|
|||
|
|
@ -175,11 +175,6 @@ export default defineConfig(({ mode }) => {
|
|||
return 'codemirror';
|
||||
}
|
||||
|
||||
// Daily video chat
|
||||
if (id.includes('node_modules/@daily-co')) {
|
||||
return 'daily-video';
|
||||
}
|
||||
|
||||
// html2canvas (screenshots)
|
||||
if (id.includes('node_modules/html2canvas')) {
|
||||
return 'html2canvas';
|
||||
|
|
@ -209,8 +204,6 @@ export default defineConfig(({ mode }) => {
|
|||
},
|
||||
define: {
|
||||
// Worker URL is now handled dynamically in Board.tsx based on window.location.hostname
|
||||
// This ensures remote devices connect to the correct worker IP
|
||||
__DAILY_API_KEY__: JSON.stringify(process.env.VITE_DAILY_API_KEY || env.VITE_DAILY_API_KEY)
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ export interface Environment {
|
|||
TLDRAW_BUCKET: R2Bucket
|
||||
BOARD_BACKUPS_BUCKET: R2Bucket
|
||||
AUTOMERGE_DURABLE_OBJECT: DurableObjectNamespace
|
||||
DAILY_API_KEY: string;
|
||||
DAILY_DOMAIN: string;
|
||||
// CryptID auth bindings
|
||||
CRYPTID_DB?: D1Database;
|
||||
EMAIL_RELAY_URL?: string;
|
||||
|
|
|
|||
Loading…
Reference in New Issue