feat: додано Node Registry, GreenFood, Monitoring та Utils

This commit is contained in:
Apple
2025-11-21 00:35:41 -08:00
parent 31f3602047
commit e018b9ab68
74 changed files with 13948 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
#!/bin/bash
# Health check script for telegram-gateway
# Перевіряє статус всіх сервісів
set -e
echo "🏥 Health Check for Telegram Infrastructure"
echo "=========================================="
# Check telegram-gateway
echo -n "📡 telegram-gateway: "
if curl -s http://localhost:8000/healthz > /dev/null; then
echo "✅ OK"
curl -s http://localhost:8000/bots/list | jq .
else
echo "❌ FAILED"
fi
# Check NATS
echo -n "📨 NATS: "
if docker ps | grep -q nats; then
echo "✅ Running"
else
echo "❌ Not running"
fi
# Check telegram-bot-api
echo -n "🤖 telegram-bot-api: "
if docker ps | grep -q telegram-bot-api; then
echo "✅ Running"
else
echo "❌ Not running"
fi
# Check registered bots
echo ""
echo "📋 Registered Bots:"
curl -s http://localhost:8000/bots/list | jq -r '.bots[]' | while read bot; do
echo " - $bot"
done
echo ""
echo "✅ Health check complete!"

View File

@@ -0,0 +1,44 @@
#!/bin/bash
# Deployment script for telegram-gateway
# Використання: ./scripts/deploy.sh [production|development]
set -e
ENVIRONMENT=${1:-production}
PROJECT_ROOT="/opt/telegram-infrastructure"
REMOTE_HOST="root@144.76.224.179"
LOCAL_ROOT="/Users/apple/github-projects/microdao-daarion/telegram-infrastructure"
echo "🚀 Deploying telegram-gateway to $ENVIRONMENT..."
if [ "$ENVIRONMENT" = "production" ]; then
echo "📦 Syncing files to production server..."
rsync -avz \
--exclude='.git' \
--exclude='__pycache__' \
--exclude='*.pyc' \
--exclude='data/' \
--exclude='.env' \
"$LOCAL_ROOT/" "$REMOTE_HOST:$PROJECT_ROOT/"
echo "🔄 Restarting services on production server..."
ssh "$REMOTE_HOST" "cd $PROJECT_ROOT && \
docker compose down telegram-gateway && \
docker compose up -d --build telegram-gateway"
echo "✅ Deployment complete!"
echo "📋 Check logs: ssh $REMOTE_HOST 'docker logs -f telegram-gateway'"
elif [ "$ENVIRONMENT" = "development" ]; then
echo "🔄 Restarting services locally..."
cd "$LOCAL_ROOT"
docker compose down telegram-gateway
docker compose up -d --build telegram-gateway
echo "✅ Local deployment complete!"
echo "📋 Check logs: docker compose logs -f telegram-gateway"
else
echo "❌ Unknown environment: $ENVIRONMENT"
echo "Usage: ./scripts/deploy.sh [production|development]"
exit 1
fi