Update application to use environment variables for configuration

Migrate hardcoded Cloudflare account hash and Supabase URL to environment variables, and fix sonner.tsx theme import.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f1469493-0a69-4efc-91bd-478d1879573a
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7cdf4e95-3f41-4180-b8e3-8ef56d032c0e/f1469493-0a69-4efc-91bd-478d1879573a/gC5lzMj
This commit is contained in:
pac7
2025-10-07 14:13:38 +00:00
parent 44e4187b17
commit 19d8766285

View File

@@ -227,6 +227,8 @@ Preferred communication style: Simple, everyday language.
- `VITE_NOVU_APPLICATION_IDENTIFIER`: Novu app ID - `VITE_NOVU_APPLICATION_IDENTIFIER`: Novu app ID
- `VITE_NOVU_SOCKET_URL`: Novu WebSocket endpoint - `VITE_NOVU_SOCKET_URL`: Novu WebSocket endpoint
- `VITE_NOVU_API_URL`: Novu API endpoint - `VITE_NOVU_API_URL`: Novu API endpoint
- `VITE_CLOUDFLARE_ACCOUNT_HASH`: Cloudflare Images account hash for image URL construction
- `VITE_SUPABASE_URL`: Supabase project URL
- Supabase credentials (injected by hosting platform) - Supabase credentials (injected by hosting platform)
- Cloudflare Images API credentials (stored in Supabase secrets) - Cloudflare Images API credentials (stored in Supabase secrets)
@@ -234,4 +236,20 @@ Preferred communication style: Simple, everyday language.
- Theme persistence via localStorage - Theme persistence via localStorage
- Unit preferences (metric/imperial) - Unit preferences (metric/imperial)
- Auto-detection for location-based settings - Auto-detection for location-based settings
- Notification channel preferences - Notification channel preferences
## Recent Changes
### Security Fixes (October 7, 2025)
**Environment Variable Migration:**
- Moved hardcoded Cloudflare account hash to `VITE_CLOUDFLARE_ACCOUNT_HASH` environment variable
- Updated 14 components to use environment variable instead of hardcoded values:
- Card components: ParkCard, RideCard, ManufacturerCard, OperatorCard, ParkOwnerCard, RideModelCard
- Detail pages: ParkDetail, RideDetail, ManufacturerDetail, OperatorDetail, PropertyOwnerDetail, DesignerDetail
- Upload component: PhotoUpload (now uses env var for Supabase URL)
- Verified zero hardcoded sensitive values remain in codebase
**Import Fixes:**
- Fixed sonner.tsx to import `useTheme` from local `@/components/theme/ThemeProvider` instead of incorrect `next-themes` package
- Ensures proper theme functionality without external dependency issues