mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
Merge branch 'master' of github.com:ail-project/ail-framework
This commit is contained in:
commit
77e8cc6c02
2 changed files with 7 additions and 6 deletions
|
@ -595,21 +595,22 @@ def get_domains_up_by_filers(domain_types, date_from=None, date_to=None, tags=[]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def sanitize_domain_name_to_search(name_to_search, domain_type):
|
def sanitize_domain_name_to_search(name_to_search, domain_type):
|
||||||
|
if not name_to_search:
|
||||||
|
return ""
|
||||||
if domain_type == 'onion':
|
if domain_type == 'onion':
|
||||||
r_name = r'[a-z0-9\.]+'
|
r_name = r'[a-z0-9\.]+'
|
||||||
else:
|
else:
|
||||||
r_name = r'[a-zA-Z0-9-_\.]+'
|
r_name = r'[a-zA-Z0-9-_\.]+'
|
||||||
# invalid domain name
|
# invalid domain name
|
||||||
if not re.fullmatch(r_name, name_to_search):
|
if not re.fullmatch(r_name, name_to_search):
|
||||||
res = re.match(r_name, name_to_search)
|
return ""
|
||||||
return {'search': name_to_search, 'error': res.string.replace( res[0], '')}
|
|
||||||
return name_to_search.replace('.', '\.')
|
return name_to_search.replace('.', '\.')
|
||||||
|
|
||||||
def search_domain_by_name(name_to_search, domain_types, r_pos=False):
|
def search_domain_by_name(name_to_search, domain_types, r_pos=False):
|
||||||
domains = {}
|
domains = {}
|
||||||
for domain_type in domain_types:
|
for domain_type in domain_types:
|
||||||
r_name = sanitize_domain_name_to_search(name_to_search, domain_type)
|
r_name = sanitize_domain_name_to_search(name_to_search, domain_type)
|
||||||
if not name_to_search or isinstance(r_name, dict):
|
if not r_name:
|
||||||
break
|
break
|
||||||
r_name = re.compile(r_name)
|
r_name = re.compile(r_name)
|
||||||
for domain in get_domains_up_by_type(domain_type):
|
for domain in get_domains_up_by_type(domain_type):
|
||||||
|
|
|
@ -89,12 +89,12 @@ Available Importers:
|
||||||
5. Launch ail-framework, pystemon and PystemonImporter.py (all within the virtual environment):
|
5. Launch ail-framework, pystemon and PystemonImporter.py (all within the virtual environment):
|
||||||
- Option 1 (recommended):
|
- Option 1 (recommended):
|
||||||
```
|
```
|
||||||
./ail-framework/bin/LAUNCH.py -l #starts ail-framework
|
./ail-framework/bin/LAUNCH.sh -l #starts ail-framework
|
||||||
./ail-framework/bin/LAUNCH.py -f #starts pystemon and the PystemonImporter.py
|
./ail-framework/bin/LAUNCH.sh -f #starts pystemon and the PystemonImporter.py
|
||||||
```
|
```
|
||||||
- Option 2 (may require two terminal windows):
|
- Option 2 (may require two terminal windows):
|
||||||
```
|
```
|
||||||
./ail-framework/bin/LAUNCH.py -l #starts ail-framework
|
./ail-framework/bin/LAUNCH.sh -l #starts ail-framework
|
||||||
./pystemon/pystemon.py
|
./pystemon/pystemon.py
|
||||||
./ail-framework/bin/importer/PystemonImporter.py
|
./ail-framework/bin/importer/PystemonImporter.py
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue