From b6c46d370b301fc633ebe42443b28ae98f5abb19 Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Sat, 6 Sep 2025 16:17:52 +0200 Subject: [PATCH] Fix jwt-token --- .env | 41 ++++++++++++++++++++++++++--------------- docker-compose.yml | 8 ++++---- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/.env b/.env index 3433fba..9d873df 100644 --- a/.env +++ b/.env @@ -1,14 +1,22 @@ -# For local development, uncomment these lines: -# VITE_API_URL=http://localhost:3002/api -# VITE_WS_URL=ws://localhost:3002 +# Environment Configuration -# For production/domain deployment, use relative URLs (default): -VITE_API_URL=/drones/api -VITE_WS_URL=/drones +# Application Base Path VITE_BASE_PATH=/uggla/ -# Docker Environment Configuration -# Copy this file to .env and update with your actual values +# For local development, these will be auto-configured based on VITE_BASE_PATH +# For production/domain deployment, these will use relative URLs based on base path +# VITE_API_URL= (leave empty to auto-configure) + +# Backend Configuration +NODE_ENV=production +PORT=3001 + +# Database Configuration +DB_HOST=localhost +DB_PORT=5432 +DB_NAME=drone_detection +DB_USER=postgres +DB_PASSWORD=postgres123 # JWT Configuration JWT_SECRET=your-super-secret-jwt-key-change-in-production-make-it-long-and-random @@ -18,13 +26,16 @@ TWILIO_ACCOUNT_SID=your_twilio_account_sid_here TWILIO_AUTH_TOKEN=your_twilio_auth_token_here TWILIO_PHONE_NUMBER=your_twilio_phone_number_here +# CORS Configuration +CORS_ORIGIN=http://localhost:3000 + +# Debug Configuration +STORE_HEARTBEATS=false +STORE_DRONE_TYPE0=false +LOG_ALL_DETECTIONS=false +API_DEBUG=true + # Health Probe Simulator Configuration PROBE_FAILRATE=30 PROBE_INTERVAL_SECONDS=60 -API_BASE_URL=https://selfservice.cqers.com/drones/api - -API_DEBUG=true - -# Optional: Override default settings -# NODE_ENV=production -# CORS_ORIGIN=http://localhost:3000 +API_BASE_URL=https://selfservice.cqers.com/uggla/api diff --git a/docker-compose.yml b/docker-compose.yml index a641e7a..fb1b975 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -60,9 +60,9 @@ services: REDIS_HOST: redis REDIS_PORT: 6379 JWT_SECRET: ${JWT_SECRET:-your-super-secret-jwt-key-change-in-production} - TWILIO_ACCOUNT_SID: ${TWILIO_ACCOUNT_SID} - TWILIO_AUTH_TOKEN: ${TWILIO_AUTH_TOKEN} - TWILIO_PHONE_NUMBER: ${TWILIO_PHONE_NUMBER} + TWILIO_ACCOUNT_SID: ${TWILIO_ACCOUNT_SID:-} + TWILIO_AUTH_TOKEN: ${TWILIO_AUTH_TOKEN:-} + TWILIO_PHONE_NUMBER: ${TWILIO_PHONE_NUMBER:-} CORS_ORIGIN: http://localhost:3001 API_DEBUG: ${API_DEBUG:-false} STORE_HEARTBEATS: ${STORE_HEARTBEATS:-false} @@ -93,7 +93,7 @@ services: dockerfile: Dockerfile args: VITE_BASE_PATH: ${VITE_BASE_PATH:-/uggla/} - VITE_API_URL: ${VITE_API_URL} + VITE_API_URL: ${VITE_API_URL:-} NODE_ENV: production container_name: drone-detection-frontend restart: unless-stopped