# OpenHamClock Configuration
# 
# This file is automatically copied to .env on first run.
# Edit .env with your station info - it won't be overwritten by updates.
#
# After editing, restart the server: npm start

# ===========================================
# REQUIRED - Your Station Information
# ===========================================

# Your amateur radio callsign
CALLSIGN=CALLSIGN

# Your Maidenhead grid locator (4 or 6 character)
LOCATOR=GRID-LOCATOR

# Your station coordinates (optional - calculated from LOCATOR if not set)
# LATITUDE=40.7128
# LONGITUDE=-74.0060

# ===========================================
# SERVER SETTINGS
# ===========================================

# Port to run the server on (default: 3000)
PORT=3000

# Host/IP to bind to
# localhost = only accessible from this computer
# 0.0.0.0 = accessible from other devices on your network
HOST=0.0.0.0

# ===========================================
# SECURITY
# ===========================================

# API key for write operations (POST /api/update, /api/settings, /api/n3fjp/qso, etc.)
# If not set, write endpoints are open (fine for local/home network installs)
# REQUIRED for cloud/public deployments to prevent unauthorized access
# API_WRITE_KEY=your-secret-key-here

# CORS allowed origins (comma-separated)
# If not set, defaults to reflecting the request origin (backward-compatible)
# Set this for cloud deployments to restrict which websites can call your API
# CORS_ORIGINS=https://yourdomain.com,http://localhost:3000

# ===========================================
# AUTO UPDATE (GIT)
# ===========================================

# Enable automatic updates (requires git installation and repo clone)
AUTO_UPDATE_ENABLED=false

# Check interval in minutes
AUTO_UPDATE_INTERVAL_MINUTES=60

# Run a check shortly after startup (true/false)
AUTO_UPDATE_ON_START=false

# Exit after update so a supervisor (systemd/pm2) can restart (true/false)
AUTO_UPDATE_EXIT_AFTER=true

# ===========================================
# SETTINGS SYNC (Self-Hosted / Pi)
# ===========================================

# When enabled, all UI settings (layout, panels, map layers, filters, theme, etc.)
# are saved on the server. Any device that connects to your OHC instance will
# automatically load your saved configuration — no need to set up each browser.
# Disabled by default. Enable for single-operator self-hosted/Pi deployments.
# Do NOT enable on multi-user hosted deployments (e.g. openhamclock.com).
SETTINGS_SYNC=true

# Optional: custom path for settings file (default: ./data/settings.json)
#SETTINGS_FILE=/home/dilshan/hamclock/openhamclock/data/settings.json

# ===========================================
# DISPLAY PREFERENCES  
# ===========================================

# Units: 'imperial' or 'metric'
# Affects temperature (°F/°C) and distances (mi/km)
UNITS=metric

# Time format: '12' or '24' hour
TIME_FORMAT=12

# Theme: 'dark', 'light', 'legacy', or 'retro'
THEME=dark

# Layout: 'modern' or 'classic'
LAYOUT=modern

# Timezone: IANA timezone identifier
# Set this if your local time shows incorrectly (e.g. same as UTC).
# This is common with privacy browsers like Librewolf that spoof timezone.
# Examples: America/New_York, America/Regina, Europe/London, Asia/Tokyo
# Leave blank or commented out to use browser default.
TZ=Asia/Colombo

# ===========================================
# OPTIONAL - External Services
# ===========================================

# ITURHFProp service URL (for advanced propagation predictions)
# Only uncomment if you have your own ITURHFProp service running
# ITURHFPROP_URL=https://proppy-production.up.railway.app  # Default — uses public OpenHamClock P.533 service. Override only if self-hosting.

# DX Spider Proxy URL (for DX cluster spots)
# Only uncomment if you have your own proxy running
# DXSPIDER_PROXY_URL=https://your-dxspider-proxy.com

# DX Cluster source: auto | proxy | hamqth | dxspider
# auto = tries proxy first, then HamQTH, then direct telnet
# proxy = use DX Spider Proxy (set DXSPIDER_PROXY_URL above)
# hamqth = HamQTH CSV feed (HTTP, works everywhere)
# dxspider = direct telnet to DX Spider nodes (works locally/Pi)
# DX_CLUSTER_SOURCE=auto

# OpenWeatherMap API key (optional — only needed for the Cloud Layer map overlay)
# Weather data uses Open-Meteo directly from each user's browser — no key needed.
# Get a free key at https://openweathermap.org/api (ONLY for the Cloud Layer map overlay)
# OPENWEATHER_API_KEY=your_api_key_here
# VITE_OPENWEATHER_API_KEY=your_api_key_here

# ===========================================
# FEATURE TOGGLES
# ===========================================

# Show POTA spots on map (true/false)
SHOW_POTA=true

# Show satellite tracks on map (true/false)
SHOW_SATELLITES=true

# Show DX paths on map (true/false)
SHOW_DX_PATHS=true

# Show weather for DX target location (true/false)
SHOW_DX_WEATHER=true

# Show analog clock in classic layout (true/false)
# The analog clock is always available in the dockable layout
CLASSIC_ANALOG_CLOCK=false

# ===========================================
# WSJT-X / JTDX UDP INTEGRATION
# ===========================================

# Enable WSJT-X UDP listener (true/false)
# Listens for decoded FT8/FT4/JT65/WSPR messages from WSJT-X, JTDX, etc.
WSJTX_ENABLED=false

# UDP port to listen on (must match WSJT-X Settings > Reporting > UDP Server port)
WSJTX_UDP_PORT=2237

# Relay key for remote WSJT-X relay agent (cloud deployments)
# If you're running OpenHamClock on a cloud server (e.g. Railway, openhamclock.com),
# WSJT-X UDP can't reach it directly. Set this key and run the relay agent
# (wsjtx-relay/relay.js) on your local machine to bridge the gap.
# Pick any strong random string — it must match on both sides.
# WSJTX_RELAY_KEY=your-secret-relay-key-here

# ===========================================
# DX CLUSTER SETTINGS
# ===========================================

# Your callsign for DX cluster login (default: CALLSIGN-56)
# DX_CLUSTER_CALLSIGN=N0CALL-56

# Spot retention time in minutes (5-30)
SPOT_RETENTION_MINUTES=30

# CONTEST LOGGER UDP (N1MM / DXLog)
# ===========================================

# Enable N1MM UDP listener (true/false)
N1MM_UDP_ENABLED=false

# UDP port to listen on (set to match N1MM Logger+ broadcast port)
N1MM_UDP_PORT=12060

# Max QSOs to retain in memory
N1MM_MAX_QSOS=200

# QSO retention window in minutes
N1MM_QSO_MAX_AGE_MINUTES=360

# ===========================================
# ===========================================
# AMBIENT WEATHER (AmbientWeather.net)
# ===========================================

# Create keys at AmbientWeather.net:
#   Account -> API Keys
#
# These are read by the Vite client (must start with VITE_)
# Put real keys in .env.local (recommended) so you don't commit secrets.

# Ambient Weather Application Key
VITE_AMBIENT_APPLICATION_KEY=your_application_key_here

# Ambient Weather Personal API Key
VITE_AMBIENT_API_KEY=your_api_key_here

# Optional: MAC address of the station device to use (if you have multiple)
# Format example: 48:E7:29:69:96:10
# VITE_AMBIENT_DEVICE_MAC=48:E7:29:69:96:10

# Optional: polling interval in seconds (minimum 15)
# VITE_AMBIENT_POLL_SECONDS=30

