feat: implement manual routing sync system, update map tile URLs to HTTPS, and migrate admin session storage to localStorage

This commit is contained in:
Hamza-Ayed
2026-07-15 23:01:18 +03:00
parent 78fe6c48cc
commit c97c961c96
14 changed files with 281 additions and 18 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
# --------------------------------------------------------------------------
# check_routing_sync.sh
# Runs via cron every minute to check if the admin dashboard requested
# a routing graph rebuild (due to a newly approved road).
# --------------------------------------------------------------------------
APP_DIR="/home/hamzadoctor/app"
cd "${APP_DIR}"
# Read flag from Redis using the redis container
SYNC_REQ=$(docker compose exec -T redis redis-cli get routing_sync_requested | tr -d '\r')
if [ "$SYNC_REQ" = "1" ] || [ "$SYNC_REQ" = "\"1\"" ]; then
echo "$(date): Sync requested! Triggering delta apply and GH rebuild..."
# 1. Delete the flag immediately so we don't trigger it again
docker compose exec -T redis redis-cli del routing_sync_requested
# 2. Apply delta
if [ -f "${APP_DIR}/infrastructure/scripts/apply-delta.sh" ]; then
bash "${APP_DIR}/infrastructure/scripts/apply-delta.sh"
fi
# 3. Restart GraphHopper to rebuild index
docker compose stop routing
rm -rf "${APP_DIR}/infrastructure/osm-data/graph-cache" "${APP_DIR}/infrastructure/osm-data/default-gh"
docker compose up -d routing
echo "$(date): Routing rebuild triggered successfully."
fi