ids.alfacom.it/extracted_idf/config_database.py
marco370 0bfe3258b5 Saved progress at the end of the loop
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 1c71ce6e-1a3e-4f53-bb5d-77cdd22b8ea3
2025-11-11 09:15:10 +00:00

73 lines
2.3 KiB
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Configurazione Database per Sistema DDoS Detection
Modifica questo file per configurare l'accesso al tuo server remoto MySQL/MariaDB
"""
# =============================================================================
# CONFIGURAZIONE DATABASE REMOTO
# =============================================================================
# Indirizzo IP o hostname del server remoto
DB_HOST = "10.1.13.206" # Cambia con l'IP del tuo server remoto (es: "192.168.1.100")
# Porta del database (default MySQL/MariaDB: 3306)
DB_PORT = "3306"
# Nome del database
DB_NAME = "LOG_MIKROTIK"
# Credenziali di accesso
DB_USER = "root"
DB_PASSWORD = "Hdgtejskjjc0-"
# =============================================================================
# ESEMPI DI CONFIGURAZIONE
# =============================================================================
# Esempio per server remoto:
# DB_HOST = "192.168.1.100"
# DB_PORT = "3306"
# DB_USER = "ddos_user"
# DB_PASSWORD = "password_sicura"
# Esempio per server cloud:
# DB_HOST = "mysql.esempio.com"
# DB_PORT = "3306"
# DB_USER = "cloud_user"
# DB_PASSWORD = "cloud_password"
# =============================================================================
# FUNZIONI UTILI
# =============================================================================
def get_connection_info():
"""Restituisce le informazioni di connessione"""
return {
'host': DB_HOST,
'port': DB_PORT,
'database': DB_NAME,
'user': DB_USER,
'password': DB_PASSWORD
}
def print_config():
"""Stampa la configurazione corrente (senza password)"""
print("=== CONFIGURAZIONE DATABASE ===")
print(f"Host: {DB_HOST}:{DB_PORT}")
print(f"Database: {DB_NAME}")
print(f"User: {DB_USER}")
print(f"Password: {'*' * len(str(DB_PASSWORD))}")
print("===============================")
if __name__ == "__main__":
print("CONFIGURAZIONE DATABASE CORRENTE:")
print("")
print_config()
print("")
print("COMANDI DISPONIBILI:")
print(" python analisys_02.py --test # Test connessione")
print(" python analisys_02.py --demo --max-records 1000 # Modalita demo")
print(" python analisys_02.py --max-records 5000 # Addestramento normale")