ids.alfacom.it/deployment/scripts/deploy_public_lists.sh
marco370 5952142a56 Add public lists integration with exact IP matching
Update merge logic to use exact IP matching for public lists, add deployment scripts and documentation for limitations.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 75a02f7d-492b-46a8-9e67-d4fd471cabc7
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/QKzTQQy
2025-11-26 09:45:55 +00:00

51 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# Deploy Public Lists Integration (v2.0.0)
# Run on AlmaLinux 9 server after git pull
set -e
echo "=================================="
echo "PUBLIC LISTS DEPLOYMENT - v2.0.0"
echo "=================================="
# 1. Database Migration
echo -e "\n[1/5] Running database migration..."
sudo -u postgres psql -d ids_system -f deployment/migrations/006_add_public_lists.sql
echo "✓ Migration 006 applied"
# 2. Seed default lists
echo -e "\n[2/5] Seeding default public lists..."
cd python_ml/list_fetcher
DATABASE_URL=$DATABASE_URL python seed_lists.py
cd ../..
echo "✓ Default lists seeded"
# 3. Install systemd services
echo -e "\n[3/5] Installing systemd services..."
sudo cp deployment/systemd/ids-list-fetcher.service /etc/systemd/system/
sudo cp deployment/systemd/ids-list-fetcher.timer /etc/systemd/system/
sudo systemctl daemon-reload
echo "✓ Systemd services installed"
# 4. Enable and start
echo -e "\n[4/5] Enabling services..."
sudo systemctl enable ids-list-fetcher.timer
sudo systemctl start ids-list-fetcher.timer
echo "✓ Timer enabled (10-minute intervals)"
# 5. Initial sync
echo -e "\n[5/5] Running initial sync..."
sudo systemctl start ids-list-fetcher.service
echo "✓ Initial sync triggered"
echo -e "\n=================================="
echo "DEPLOYMENT COMPLETE"
echo "=================================="
echo ""
echo "Verify:"
echo " journalctl -u ids-list-fetcher -n 50"
echo " systemctl status ids-list-fetcher.timer"
echo ""
echo "Check UI: http://your-server/public-lists"
echo ""