commit
5f913c2fe9
@ -0,0 +1,86 @@
|
|||||||
|
# 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=N0CALL
|
||||||
|
|
||||||
|
# Your Maidenhead grid locator (4 or 6 character)
|
||||||
|
LOCATOR=FN31
|
||||||
|
|
||||||
|
# Your station coordinates (optional - calculated from LOCATOR if not set)
|
||||||
|
LATITUDE=
|
||||||
|
LONGITUDE=
|
||||||
|
|
||||||
|
# ===========================================
|
||||||
|
# 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=localhost
|
||||||
|
|
||||||
|
# ===========================================
|
||||||
|
# DISPLAY PREFERENCES
|
||||||
|
# ===========================================
|
||||||
|
|
||||||
|
# Units: 'imperial' or 'metric'
|
||||||
|
# Affects temperature (°F/°C) and distances (mi/km)
|
||||||
|
UNITS=imperial
|
||||||
|
|
||||||
|
# Time format: '12' or '24' hour
|
||||||
|
TIME_FORMAT=12
|
||||||
|
|
||||||
|
# Theme: 'dark', 'light', 'legacy', or 'retro'
|
||||||
|
THEME=dark
|
||||||
|
|
||||||
|
# Layout: 'modern' or 'classic'
|
||||||
|
LAYOUT=modern
|
||||||
|
|
||||||
|
# ===========================================
|
||||||
|
# OPTIONAL - External Services
|
||||||
|
# ===========================================
|
||||||
|
|
||||||
|
# ITURHFProp service URL (for advanced propagation predictions)
|
||||||
|
ITURHFPROP_URL=
|
||||||
|
|
||||||
|
# DX Spider Proxy URL (for DX cluster spots)
|
||||||
|
DXSPIDER_PROXY_URL=
|
||||||
|
|
||||||
|
# OpenWeatherMap API key (for local weather display)
|
||||||
|
# Get a free key at https://openweathermap.org/api
|
||||||
|
OPENWEATHER_API_KEY=
|
||||||
|
|
||||||
|
# ===========================================
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# ===========================================
|
||||||
|
# DX CLUSTER SETTINGS
|
||||||
|
# ===========================================
|
||||||
|
|
||||||
|
# Your callsign for DX cluster login (default: CALLSIGN-56)
|
||||||
|
DX_CLUSTER_CALLSIGN=
|
||||||
|
|
||||||
|
# Spot retention time in minutes (5-30)
|
||||||
|
SPOT_RETENTION_MINUTES=30
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"_comment": "OpenHamClock User Configuration",
|
||||||
|
"_instructions": "Copy this file to config.json and customize for your station. Your config.json will NOT be overwritten by git updates.",
|
||||||
|
|
||||||
|
"callsign": "N0CALL",
|
||||||
|
"locator": "FN31",
|
||||||
|
|
||||||
|
"location": {
|
||||||
|
"lat": 40.0150,
|
||||||
|
"lon": -105.2705
|
||||||
|
},
|
||||||
|
|
||||||
|
"defaultDX": {
|
||||||
|
"lat": 35.6762,
|
||||||
|
"lon": 139.6503
|
||||||
|
},
|
||||||
|
|
||||||
|
"units": "imperial",
|
||||||
|
"timeFormat": "12",
|
||||||
|
"theme": "dark",
|
||||||
|
"layout": "modern",
|
||||||
|
|
||||||
|
"features": {
|
||||||
|
"showPOTA": true,
|
||||||
|
"showSatellites": true,
|
||||||
|
"showDXPaths": true,
|
||||||
|
"showContests": true,
|
||||||
|
"showDXpeditions": true
|
||||||
|
},
|
||||||
|
|
||||||
|
"dxCluster": {
|
||||||
|
"spotRetentionMinutes": 30,
|
||||||
|
"source": "auto"
|
||||||
|
},
|
||||||
|
|
||||||
|
"refreshIntervals": {
|
||||||
|
"spaceWeather": 300000,
|
||||||
|
"bandConditions": 300000,
|
||||||
|
"pota": 60000,
|
||||||
|
"dxCluster": 30000
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,138 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# OpenHamClock Update Script
|
||||||
|
# Updates to the latest version while preserving your configuration
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "╔═══════════════════════════════════════════════════════╗"
|
||||||
|
echo "║ OpenHamClock Update Script ║"
|
||||||
|
echo "╚═══════════════════════════════════════════════════════╝"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Check if we're in the right directory
|
||||||
|
if [ ! -f "server.js" ] || [ ! -f "package.json" ]; then
|
||||||
|
echo "❌ Error: Please run this script from the openhamclock directory"
|
||||||
|
echo " cd /path/to/openhamclock"
|
||||||
|
echo " ./scripts/update.sh"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if git is available
|
||||||
|
if ! command -v git &> /dev/null; then
|
||||||
|
echo "❌ Error: git is not installed"
|
||||||
|
echo " sudo apt install git"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if this is a git repository
|
||||||
|
if [ ! -d ".git" ]; then
|
||||||
|
echo "❌ Error: This doesn't appear to be a git repository"
|
||||||
|
echo " If you installed from a zip file, you'll need to:"
|
||||||
|
echo " 1. Back up your .env file"
|
||||||
|
echo " 2. Download the new version"
|
||||||
|
echo " 3. Extract and copy your .env back"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "📋 Current version:"
|
||||||
|
grep '"version"' package.json | head -1
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "🔍 Checking for updates..."
|
||||||
|
|
||||||
|
# Fetch latest changes
|
||||||
|
git fetch origin
|
||||||
|
|
||||||
|
# Check if there are updates
|
||||||
|
LOCAL=$(git rev-parse HEAD)
|
||||||
|
REMOTE=$(git rev-parse origin/main 2>/dev/null || git rev-parse origin/master)
|
||||||
|
|
||||||
|
if [ "$LOCAL" = "$REMOTE" ]; then
|
||||||
|
echo "✅ Already up to date!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "📦 Updates available!"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Show what's new
|
||||||
|
echo "📝 Changes since your version:"
|
||||||
|
git log --oneline HEAD..origin/main 2>/dev/null || git log --oneline HEAD..origin/master
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Confirm update
|
||||||
|
read -p "🔄 Do you want to update? (y/N) " -n 1 -r
|
||||||
|
echo ""
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
echo "❌ Update cancelled"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "🛡️ Backing up configuration..."
|
||||||
|
|
||||||
|
# Backup .env if it exists
|
||||||
|
if [ -f ".env" ]; then
|
||||||
|
cp .env .env.backup
|
||||||
|
echo " ✓ .env → .env.backup"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Backup any other local config
|
||||||
|
if [ -f "config.json" ]; then
|
||||||
|
cp config.json config.json.backup
|
||||||
|
echo " ✓ config.json → config.json.backup"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "⬇️ Pulling latest changes..."
|
||||||
|
git pull origin main 2>/dev/null || git pull origin master
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "📦 Installing dependencies..."
|
||||||
|
npm install
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "🔨 Building frontend..."
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "🔄 Restoring configuration..."
|
||||||
|
|
||||||
|
# Restore .env (should still be there since it's gitignored, but just in case)
|
||||||
|
if [ -f ".env.backup" ] && [ ! -f ".env" ]; then
|
||||||
|
cp .env.backup .env
|
||||||
|
echo " ✓ .env restored from backup"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Restore config.json if needed
|
||||||
|
if [ -f "config.json.backup" ] && [ ! -f "config.json" ]; then
|
||||||
|
cp config.json.backup config.json
|
||||||
|
echo " ✓ config.json restored from backup"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "📋 New version:"
|
||||||
|
grep '"version"' package.json | head -1
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "╔═══════════════════════════════════════════════════════╗"
|
||||||
|
echo "║ ✅ Update Complete! ║"
|
||||||
|
echo "╚═══════════════════════════════════════════════════════╝"
|
||||||
|
echo ""
|
||||||
|
echo "🔄 Restart the server to apply changes:"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Check if running as systemd service
|
||||||
|
if systemctl is-active --quiet openhamclock 2>/dev/null; then
|
||||||
|
echo " sudo systemctl restart openhamclock"
|
||||||
|
else
|
||||||
|
echo " # If running in terminal, press Ctrl+C and run:"
|
||||||
|
echo " npm start"
|
||||||
|
echo ""
|
||||||
|
echo " # If running as a service:"
|
||||||
|
echo " sudo systemctl restart openhamclock"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "📖 See CHANGELOG.md for what's new"
|
||||||
|
echo ""
|
||||||
Loading…
Reference in new issue