""" Configuration and constants for GODCWAK. """ import json import shutil import sys from pathlib import Path APP_NAME = "GODCWAK" APP_VERSION = "1.0" def _is_frozen() -> bool: return getattr(sys, "frozen", False) def _exe_dir() -> Path: return Path(sys.executable).resolve().parent def _bundle_dir() -> Path: if _is_frozen() and hasattr(sys, "_MEIPASS"): return Path(sys._MEIPASS) return Path(__file__).resolve().parent # Writable root: next to the exe when frozen, project root in dev BASE_DIR = _exe_dir() if _is_frozen() else Path(__file__).resolve().parent BUNDLE_DIR = _bundle_dir() DATA_DIR = BASE_DIR / "data" _assets_bundle = BUNDLE_DIR / "assets" ASSETS_DIR = _assets_bundle if _assets_bundle.is_dir() else BASE_DIR / "assets" # Facebook FACEBOOK_LOGIN_URL = "https://m.facebook.com/login.php" FACEBOOK_BASE_URL = "https://m.facebook.com" # Proxy Settings MAX_PROXIES = 2000 PROXY_TEST_TIMEOUT = 10 # seconds PROXY_TEST_URL = "http://httpbin.org/ip" PROXY_REFRESH_INTERVAL = 300 # seconds (5 min) # Attack Settings DEFAULT_DELAY_MIN = 0.5 # seconds DEFAULT_DELAY_MAX = 2.0 # seconds MAX_CONCURRENT_WORKERS = 3 # parallel attack threads PROXY_ROTATION_EVERY = 1 # rotate proxy every N attempts (1 = each attempt) REQUEST_TIMEOUT = 20 # seconds per HTTP request # Proxy Testing PROXY_TEST_CONCURRENCY = 100 # concurrent proxy health-check connections # Password Generation DEFAULT_MIN_LENGTH = 6 DEFAULT_MAX_LENGTH = 32 GPU_THRESHOLD = 50_000 # use GPU when combinations exceed this # File Paths PASSWORDS_FILE = DATA_DIR / "passwords.txt" PROXIES_FILE = DATA_DIR / "proxies.txt" VALID_PROXIES_FILE = DATA_DIR / "valid_proxies.txt" ATTEMPT_LOG_FILE = DATA_DIR / "attempt_log.csv" OLLAMA_CONFIG_FILE = BASE_DIR / "config_ollama.json" DEFAULT_OLLAMA_CONFIG = { "ollama_host": "http://localhost:11434", "model": "", "timeout": 60, "temperature": 0.1, "top_p": 0.9, "max_tokens": 512, "prompt_template": "", "browser_engine": "Playwright", "headless": False, "viewport": "1280x720", "mouse_delay_ms": 50, "retry_limit": 3, } def ensure_dirs(): """Create writable dirs and seed default Ollama config for packaged builds.""" DATA_DIR.mkdir(exist_ok=True) (BASE_DIR / "assets").mkdir(exist_ok=True) if not OLLAMA_CONFIG_FILE.exists(): bundled = BUNDLE_DIR / "config_ollama.json" if bundled.is_file(): shutil.copy2(bundled, OLLAMA_CONFIG_FILE) else: OLLAMA_CONFIG_FILE.write_text( json.dumps(DEFAULT_OLLAMA_CONFIG, indent=2), encoding="utf-8", ) # GUI Theme Colors THEME = { "bg_dark": "#0a0a0f", "bg_medium": "#12121a", "bg_light": "#1a1a2e", "primary": "#00f0ff", "secondary": "#ff00aa", "tertiary": "#7700ff", "text_primary": "#e0e0ff", "text_secondary": "#8888aa", "text_dim": "#555577", "success": "#00ff88", "warning": "#ffaa00", "error": "#ff3355", "border": "#2a2a4a", "glow_cyan": "#00f0ff33", "glow_pink": "#ff00aa33", "glow_purple": "#7700ff33", }