mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-06-03 04:48:03 +02:00
fix: add version to health endpoint + warn users with stale compose files
Repo migration in March 2026 rewrote all commit hashes, leaving old clones with a docker-compose.yml that builds from source instead of pulling pre-built images. Added detection warnings to compose.sh, start.bat, and start.sh so affected users see clear instructions. Also exposes APP_VERSION in /api/health for easier debugging.
This commit is contained in:
@@ -93,7 +93,21 @@ That's it. `pull` grabs the latest images, `up -d` restarts the containers.
|
||||
|
||||
### ⚠️ **Stuck on the old version?**
|
||||
|
||||
**If the dashboard still shows old data after updating:**
|
||||
**If `git pull` fails or `docker compose up` keeps building from source instead of pulling images**, your clone predates a March 2026 repository migration that rewrote commit history. A normal `git pull` cannot fix this. Run:
|
||||
|
||||
```bash
|
||||
# Back up any local config you want to keep (.env, etc.)
|
||||
cd ..
|
||||
rm -rf Shadowbroker
|
||||
git clone https://github.com/BigBodyCobain/Shadowbroker.git
|
||||
cd Shadowbroker
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
**How to tell if you're affected:** If `docker compose up` shows `RUN apt-get`, `RUN npm ci`, or `RUN pip install` — it's building from source instead of pulling pre-built images. You need a fresh clone.
|
||||
|
||||
**Other troubleshooting:**
|
||||
|
||||
* **Force re-pull:** `docker compose pull --no-cache`
|
||||
* **Prune old images:** `docker image prune -f`
|
||||
|
||||
@@ -12,6 +12,8 @@ from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
from json import JSONDecodeError
|
||||
|
||||
APP_VERSION = "0.9.6"
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
_start_time = time.time()
|
||||
@@ -6667,6 +6669,7 @@ async def health_check(request: Request):
|
||||
last = d.get("last_updated")
|
||||
return {
|
||||
"status": "ok",
|
||||
"version": APP_VERSION,
|
||||
"last_updated": last,
|
||||
"sources": {
|
||||
"flights": len(d.get("commercial_flights", [])),
|
||||
|
||||
@@ -4,6 +4,7 @@ from typing import Optional, Dict, List, Any
|
||||
|
||||
class HealthResponse(BaseModel):
|
||||
status: str
|
||||
version: str = ""
|
||||
last_updated: Optional[str] = None
|
||||
sources: Dict[str, int]
|
||||
freshness: Dict[str, str]
|
||||
|
||||
+21
@@ -45,6 +45,27 @@ if [ ! -f "$COMPOSE_FILE" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Detect stale compose file from pre-migration clones (before March 2026).
|
||||
# The current compose file uses "image:" to pull pre-built images from GHCR.
|
||||
# Old versions had "build:" directives that compile from local source — much
|
||||
# slower and will NOT pick up new releases.
|
||||
if grep -q '^\s*build:' "$COMPOSE_FILE" 2>/dev/null; then
|
||||
echo ""
|
||||
echo "================================================================"
|
||||
echo " [!] WARNING: Your docker-compose.yml is outdated."
|
||||
echo ""
|
||||
echo " It contains 'build:' directives, which means Docker is"
|
||||
echo " compiling from local source instead of pulling pre-built"
|
||||
echo " images. You will NOT receive updates this way."
|
||||
echo ""
|
||||
echo " Fix: re-clone the repository:"
|
||||
echo " cd .. && rm -rf $(basename "$SCRIPT_DIR")"
|
||||
echo " git clone https://github.com/BigBodyCobain/Shadowbroker.git"
|
||||
echo " cd Shadowbroker && docker compose pull && docker compose up -d"
|
||||
echo "================================================================"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
--engine)
|
||||
|
||||
@@ -6,6 +6,26 @@ echo S H A D O W B R O K E R -- STARTUP
|
||||
echo ===================================================
|
||||
echo.
|
||||
|
||||
:: Check for stale docker-compose.yml from pre-migration clones
|
||||
findstr /R /C:"build:" docker-compose.yml >nul 2>&1
|
||||
if %errorlevel% equ 0 (
|
||||
echo.
|
||||
echo ================================================================
|
||||
echo [!] WARNING: Your docker-compose.yml is outdated.
|
||||
echo.
|
||||
echo It contains 'build:' directives, which means Docker will
|
||||
echo compile from local source instead of pulling pre-built images.
|
||||
echo You will NOT receive updates this way.
|
||||
echo.
|
||||
echo If you use Docker, re-clone the repository:
|
||||
echo git clone https://github.com/BigBodyCobain/Shadowbroker.git
|
||||
echo cd Shadowbroker
|
||||
echo docker compose pull
|
||||
echo docker compose up -d
|
||||
echo ================================================================
|
||||
echo.
|
||||
)
|
||||
|
||||
:: Check for Python
|
||||
where python >nul 2>&1
|
||||
if %errorlevel% neq 0 (
|
||||
|
||||
@@ -8,6 +8,24 @@ echo " S H A D O W B R O K E R - macOS / Linux Start "
|
||||
echo "======================================================="
|
||||
echo ""
|
||||
|
||||
# Check for stale docker-compose.yml from pre-migration clones
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
if [ -f "$SCRIPT_DIR/docker-compose.yml" ] && grep -q '^\s*build:' "$SCRIPT_DIR/docker-compose.yml" 2>/dev/null; then
|
||||
echo ""
|
||||
echo "================================================================"
|
||||
echo " [!] WARNING: Your docker-compose.yml is outdated."
|
||||
echo ""
|
||||
echo " It contains 'build:' directives, which means Docker will"
|
||||
echo " compile from local source instead of pulling pre-built images."
|
||||
echo " You will NOT receive updates this way."
|
||||
echo ""
|
||||
echo " If you use Docker, re-clone the repository:"
|
||||
echo " git clone https://github.com/BigBodyCobain/Shadowbroker.git"
|
||||
echo " cd Shadowbroker && docker compose pull && docker compose up -d"
|
||||
echo "================================================================"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Check for Node.js
|
||||
if ! command -v npm &> /dev/null; then
|
||||
echo "[!] ERROR: npm is not installed. Please install Node.js 18+ (https://nodejs.org/)"
|
||||
|
||||
Reference in New Issue
Block a user