fix: wire Phase 25.5a deploy docs and sync connectivity
- use app_network status for device sync connectivity checks - mount migrate_phase25_5a.sql in server docker compose - document manual server upgrade migration steps - record verified Pi and unraid SSH access details in PLAN Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -4,11 +4,14 @@ Pi fetches device config from server when internet is available (connection-driv
|
||||
Stores in SQLite and hot-reloads app globals if config changes.
|
||||
"""
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import threading
|
||||
import time
|
||||
import os
|
||||
|
||||
import requests
|
||||
from . import app_sql
|
||||
|
||||
from . import app_network, app_sql
|
||||
|
||||
|
||||
_SYNC_THREAD = None
|
||||
@@ -16,6 +19,20 @@ _SYNC_STOP = False
|
||||
_SYNC_CONFIG_VERSION = 0 # Track last-synced version to detect changes
|
||||
|
||||
|
||||
def _has_internet():
|
||||
"""Use the existing NetworkManager-derived status instead of probing 8.8.8.8 over HTTP."""
|
||||
try:
|
||||
return app_network.get_status().get("internet_reachable", False)
|
||||
except (
|
||||
OSError,
|
||||
subprocess.SubprocessError,
|
||||
ValueError,
|
||||
KeyError,
|
||||
app_network.NetworkConfigurationError,
|
||||
):
|
||||
return False
|
||||
|
||||
|
||||
def start_sync():
|
||||
"""Start background device config sync thread."""
|
||||
global _SYNC_THREAD, _SYNC_STOP
|
||||
@@ -49,12 +66,7 @@ def _sync_loop():
|
||||
|
||||
while not _SYNC_STOP:
|
||||
try:
|
||||
# Check if internet is available (simple connectivity test)
|
||||
try:
|
||||
requests.head("http://8.8.8.8", timeout=2)
|
||||
is_connected = True
|
||||
except (requests.RequestException, Exception):
|
||||
is_connected = False
|
||||
is_connected = _has_internet()
|
||||
|
||||
if is_connected:
|
||||
# Fetch device config from server
|
||||
|
||||
Reference in New Issue
Block a user