Release v2.2.47: webhook GET ping + v2 default API port
This commit is contained in:
parent
2bd5a3e057
commit
9fc57feda4
17
RELEASE_NOTES_v2.2.47.md
Normal file
17
RELEASE_NOTES_v2.2.47.md
Normal file
@ -0,0 +1,17 @@
|
||||
# Release Notes v2.2.47
|
||||
|
||||
Dato: 4. marts 2026
|
||||
|
||||
## Fixes
|
||||
- Mission webhook GET for ringing accepterer nu token-only ping uden `call_id` og returnerer `200 OK`.
|
||||
- `updateto.sh` bruger nu automatisk port `8001` som default i v2-mappen (`/srv/podman/bmc_hub_v2`), med fortsat støtte for `API_PORT` override i `.env`.
|
||||
|
||||
## Ændrede filer
|
||||
- `app/dashboard/backend/mission_router.py`
|
||||
- `updateto.sh`
|
||||
- `VERSION`
|
||||
- `RELEASE_NOTES_v2.2.47.md`
|
||||
|
||||
## Drift
|
||||
- Deploy: `./updateto.sh v2.2.47`
|
||||
- Verificér webhook ping: `curl -i "http://localhost:8001/api/v1/mission/webhook/telefoni/ringing?token=<TOKEN>"`
|
||||
@ -218,6 +218,13 @@ async def mission_telefoni_ringing(event: MissionCallEvent, request: Request, to
|
||||
|
||||
@router.get("/mission/webhook/telefoni/ringing")
|
||||
async def mission_telefoni_ringing_get(request: Request, token: Optional[str] = Query(None)):
|
||||
_validate_mission_webhook_token(request, token)
|
||||
|
||||
# Allow token-only GET calls (no call payload) for phone webhook validation/ping.
|
||||
if not _first_query_param(request, "call_id", "callid", "id", "session_id", "uuid"):
|
||||
logger.info("☎️ Mission webhook ringing ping method=%s", request.method)
|
||||
return {"status": "ok", "mode": "ping"}
|
||||
|
||||
event = _event_from_query(request)
|
||||
return await mission_telefoni_ringing(event, request, token)
|
||||
|
||||
|
||||
57
updateto.sh
57
updateto.sh
@ -62,6 +62,14 @@ set -a
|
||||
source .env
|
||||
set +a
|
||||
|
||||
if [ -z "${API_PORT:-}" ]; then
|
||||
if [ "$CURRENT_DIR" = "/srv/podman/bmc_hub_v2" ]; then
|
||||
API_PORT="8001"
|
||||
else
|
||||
API_PORT="8000"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Update RELEASE_VERSION in .env
|
||||
echo "📝 Opdaterer .env med version $VERSION..."
|
||||
if grep -q "^RELEASE_VERSION=" .env; then
|
||||
@ -81,6 +89,17 @@ podman update --restart=no bmc-hub-api-v2 bmc-hub-postgres-v2 >/dev/null 2>&1 ||
|
||||
podman stop bmc-hub-api-v2 bmc-hub-postgres-v2 >/dev/null 2>&1 || true
|
||||
podman rm -f bmc-hub-api-v2 bmc-hub-postgres-v2 >/dev/null 2>&1 || true
|
||||
|
||||
# Also cleanup legacy compose-style names that can keep host ports locked
|
||||
LEGACY_CONTAINERS=$(podman ps -a --format '{{.Names}}' | grep -E '^(bmc_hub_v2_|bmc-hub-.*-v2)' || true)
|
||||
if [ -n "$LEGACY_CONTAINERS" ]; then
|
||||
echo "$LEGACY_CONTAINERS" | while read -r name; do
|
||||
[ -z "$name" ] && continue
|
||||
podman update --restart=no "$name" >/dev/null 2>&1 || true
|
||||
podman stop "$name" >/dev/null 2>&1 || true
|
||||
podman rm -f "$name" >/dev/null 2>&1 || true
|
||||
done
|
||||
fi
|
||||
|
||||
# Guard against host port conflicts before attempting startup
|
||||
POSTGRES_BIND_ADDR="${POSTGRES_BIND_ADDR:-127.0.0.1}"
|
||||
POSTGRES_PORT="${POSTGRES_PORT:-5432}"
|
||||
@ -91,6 +110,21 @@ if podman ps --format '{{.Names}} {{.Ports}}' | grep -E "${POSTGRES_BIND_ADDR}:$
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Also detect stopped containers reserving legacy port mappings in config (rootlessport conflicts)
|
||||
if podman ps -a --format '{{.Names}} {{.Ports}}' | grep -E "${POSTGRES_BIND_ADDR}:${POSTGRES_PORT}->5432/tcp" | grep -v "bmc-hub-postgres-prod" >/dev/null 2>&1; then
|
||||
echo "⚠️ Finder gamle containere med portbinding ${POSTGRES_BIND_ADDR}:${POSTGRES_PORT}; forsøger oprydning..."
|
||||
podman ps -a --format '{{.Names}} {{.Ports}}' \
|
||||
| grep -E "${POSTGRES_BIND_ADDR}:${POSTGRES_PORT}->5432/tcp" \
|
||||
| grep -v "bmc-hub-postgres-prod" \
|
||||
| awk '{print $1}' \
|
||||
| while read -r holder; do
|
||||
[ -z "$holder" ] && continue
|
||||
podman update --restart=no "$holder" >/dev/null 2>&1 || true
|
||||
podman stop "$holder" >/dev/null 2>&1 || true
|
||||
podman rm -f "$holder" >/dev/null 2>&1 || true
|
||||
done
|
||||
fi
|
||||
|
||||
# Stop containers
|
||||
echo ""
|
||||
echo "⏹️ Stopper containere..."
|
||||
@ -118,6 +152,23 @@ if ! podman ps --format '{{.Names}}' | grep -q '^bmc-hub-api-prod$'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verify API health before continuing
|
||||
HEALTH_OK=false
|
||||
for i in {1..30}; do
|
||||
if curl -fsS "http://localhost:${API_PORT}/health" >/dev/null 2>&1; then
|
||||
HEALTH_OK=true
|
||||
break
|
||||
fi
|
||||
echo "⏳ Venter på API health... ($i/30)"
|
||||
sleep 2
|
||||
done
|
||||
|
||||
if [ "$HEALTH_OK" != "true" ]; then
|
||||
echo "❌ Fejl: API health fejlede på http://localhost:${API_PORT}/health"
|
||||
podman logs --tail 120 bmc-hub-api-prod || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Sync migrations from container to host
|
||||
echo ""
|
||||
echo "📁 Syncer migrations fra container til host..."
|
||||
@ -199,10 +250,10 @@ echo " podman-compose -f $PODMAN_COMPOSE_FILE ps"
|
||||
echo " podman logs -f bmc-hub-api-prod"
|
||||
echo ""
|
||||
echo "🌐 Test health endpoint:"
|
||||
echo " curl http://localhost:8000/health"
|
||||
echo " curl http://localhost:${API_PORT}/health"
|
||||
echo ""
|
||||
echo "📊 Sync kunder fra e-conomic:"
|
||||
echo " curl -X POST http://localhost:8000/api/v1/system/sync/economic"
|
||||
echo " curl -X POST http://localhost:${API_PORT}/api/v1/system/sync/economic"
|
||||
echo ""
|
||||
echo "🔗 Link vTiger til kunder:"
|
||||
echo " curl -X POST http://localhost:8000/api/v1/system/sync/vtiger"
|
||||
echo " curl -X POST http://localhost:${API_PORT}/api/v1/system/sync/vtiger"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user