From 1683d98b9014072d4fa165b587d5d05331ed41cd Mon Sep 17 00:00:00 2001 From: Mitch Ross Date: Fri, 6 Feb 2026 13:29:45 -0500 Subject: [PATCH] up --- app.py | 4 +- config.py | 2 + docker-compose.yml | 6 + static/js/core/observer-location.js | 9 +- templates/index.html | 168 ++++++++++++++++++++++++++++ 5 files changed, 187 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index de1e5ee..ad54ea4 100644 --- a/app.py +++ b/app.py @@ -27,7 +27,7 @@ from typing import Any from flask import Flask, render_template, jsonify, send_file, Response, request,redirect, url_for, flash, session from werkzeug.security import check_password_hash -from config import VERSION, CHANGELOG, SHARED_OBSERVER_LOCATION_ENABLED +from config import VERSION, CHANGELOG, SHARED_OBSERVER_LOCATION_ENABLED, DEFAULT_LATITUDE, DEFAULT_LONGITUDE from utils.dependencies import check_tool, check_all_dependencies, TOOL_DEPENDENCIES from utils.process import cleanup_stale_processes from utils.sdr import SDRFactory @@ -350,6 +350,8 @@ def index() -> str: version=VERSION, changelog=CHANGELOG, shared_observer_location=SHARED_OBSERVER_LOCATION_ENABLED, + default_latitude=DEFAULT_LATITUDE, + default_longitude=DEFAULT_LONGITUDE, ) diff --git a/config.py b/config.py index 72b9235..d642c96 100644 --- a/config.py +++ b/config.py @@ -185,6 +185,8 @@ ADSB_HISTORY_QUEUE_SIZE = _get_env_int('ADSB_HISTORY_QUEUE_SIZE', 50000) # Observer location settings SHARED_OBSERVER_LOCATION_ENABLED = _get_env_bool('SHARED_OBSERVER_LOCATION', True) +DEFAULT_LATITUDE = _get_env_float('DEFAULT_LAT', 0.0) +DEFAULT_LONGITUDE = _get_env_float('DEFAULT_LON', 0.0) # Satellite settings SATELLITE_UPDATE_INTERVAL = _get_env_int('SATELLITE_UPDATE_INTERVAL', 30) diff --git a/docker-compose.yml b/docker-compose.yml index be409e8..b8e524c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,6 +45,9 @@ services: - INTERCEPT_ADSB_AUTO_START=${INTERCEPT_ADSB_AUTO_START:-false} # Shared observer location across modules - INTERCEPT_SHARED_OBSERVER_LOCATION=${INTERCEPT_SHARED_OBSERVER_LOCATION:-true} + # Default observer coordinates (set to your location to skip the GPS prompt) + # - INTERCEPT_DEFAULT_LAT=${INTERCEPT_DEFAULT_LAT:-0} + # - INTERCEPT_DEFAULT_LON=${INTERCEPT_DEFAULT_LON:-0} # Network mode for WiFi scanning (requires host network) # network_mode: host restart: unless-stopped @@ -88,6 +91,9 @@ services: - INTERCEPT_ADSB_AUTO_START=${INTERCEPT_ADSB_AUTO_START:-false} # Shared observer location across modules - INTERCEPT_SHARED_OBSERVER_LOCATION=${INTERCEPT_SHARED_OBSERVER_LOCATION:-true} + # Default observer coordinates (set to your location to skip the GPS prompt) + # - INTERCEPT_DEFAULT_LAT=${INTERCEPT_DEFAULT_LAT:-0} + # - INTERCEPT_DEFAULT_LON=${INTERCEPT_DEFAULT_LON:-0} restart: unless-stopped healthcheck: test: ["CMD", "curl", "-sf", "http://localhost:5050/health"] diff --git a/static/js/core/observer-location.js b/static/js/core/observer-location.js index 018c2b4..53b8c5d 100644 --- a/static/js/core/observer-location.js +++ b/static/js/core/observer-location.js @@ -1,7 +1,9 @@ // Shared observer location helper for map-based modules. // Default: shared location enabled unless explicitly disabled via config. window.ObserverLocation = (function() { - const DEFAULT_LOCATION = { lat: 51.5074, lon: -0.1278 }; + const DEFAULT_LOCATION = (window.INTERCEPT_DEFAULT_LAT && window.INTERCEPT_DEFAULT_LON) + ? { lat: window.INTERCEPT_DEFAULT_LAT, lon: window.INTERCEPT_DEFAULT_LON } + : { lat: 51.5074, lon: -0.1278 }; const SHARED_KEY = 'observerLocation'; const AIS_KEY = 'ais_observerLocation'; const LEGACY_LAT_KEY = 'observerLat'; @@ -41,6 +43,10 @@ window.ObserverLocation = (function() { return normalize(lat, lon); } + function hasStoredLocation() { + return !!(readKey(SHARED_KEY) || readKey(AIS_KEY) || readLegacyLatLon()); + } + function getShared() { const current = readKey(SHARED_KEY); if (current) return current; @@ -93,6 +99,7 @@ window.ObserverLocation = (function() { return { isSharedEnabled, + hasStoredLocation, getShared, setShared, getForModule, diff --git a/templates/index.html b/templates/index.html index 4108ff5..b75029b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -21,6 +21,8 @@ @@ -14074,6 +14076,172 @@ {% include 'partials/settings-modal.html' %} + + + +