Spaces:
Paused
Paused
| import os | |
| from pathlib import Path | |
| from gradio.themes import Soft | |
| DATA_DIR = Path(os.getenv("DF_DATA_DIR", "/mnt/data")) | |
| HF_TOKEN = os.getenv("DF_HF_TOKEN", "") | |
| SHODAN_API_KEY = os.getenv("DF_SHODAN_API_KEY", "") | |
| ZOOMEYE_API_KEY = os.getenv("DF_ZOOMEYE_API_KEY", "") | |
| ENABLE_EXECUTE = os.getenv("DF_ENABLE_EXECUTE", "false").lower() == "true" | |
| RATE_LIMIT_PER_MIN = int(os.getenv("DF_RATE_LIMIT_PER_MIN", "80")) | |
| OWNER_PIN = os.getenv("DF_OWNER_PIN", "123456") | |
| LLM_MODE = os.getenv("DF_LLM_MODE", "No LLM") | |
| ALLOWED_MODELS = [ | |
| "No LLM", | |
| "TinyLlama/TinyLlama-1.1B-Chat-v1.0", | |
| "microsoft/Phi-3-mini-4k-instruct", | |
| "Qwen/Qwen2.5-7B-Instruct", | |
| ] | |
| ALLOWED_OPERATORS = [ | |
| "AND", | |
| "OR", | |
| "NOT", | |
| "after", | |
| "before", | |
| "city", | |
| "country", | |
| "geo", | |
| "hostname", | |
| "ip", | |
| "net", | |
| "org", | |
| "os", | |
| "port", | |
| "product", | |
| "title", | |
| ] | |
| THEME = Soft( | |
| primary_hue="red", | |
| secondary_hue="gray", | |
| neutral_hue="gray", | |
| text_size="lg", | |
| spacing_size="lg", | |
| radius_size="lg", | |
| ) | |
| COUNTRIES = [ | |
| "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Argentina", "Armenia", | |
| "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", | |
| "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", | |
| "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cabo Verde", | |
| "Cambodia", "Cameroon", "Canada", "Central African Republic", "Chad", "Chile", "China", | |
| "Colombia", "Comoros", "Congo", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic", | |
| "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", | |
| "Equatorial Guinea", "Eritrea", "Estonia", "Eswatini", "Ethiopia", "Fiji", "Finland", | |
| "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Greece", "Grenada", | |
| "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", | |
| "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", | |
| "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos", | |
| "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", | |
| "Luxembourg", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", | |
| "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", | |
| "Monaco", "Mongolia", "Montenegro", "Morocco", "Mozambique", "Myanmar", "Namibia", | |
| "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", | |
| "North Korea", "North Macedonia", "Norway", "Oman", "Pakistan", "Palau", "Palestine", | |
| "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", | |
| "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", | |
| "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", | |
| "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", | |
| "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Korea", | |
| "South Sudan", "Spain", "Sri Lanka", "Sudan", "Suriname", "Sweden", "Switzerland", | |
| "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Timor-Leste", "Togo", "Tonga", | |
| "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", | |
| "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", | |
| "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", | |
| "Zimbabwe" | |
| ] |