mirror of https://github.com/CIRCL/lookyloo
fix: Do not initialize the Lookyloo class multiple times
parent
264d94cd2d
commit
a4c643cc16
|
@ -34,7 +34,7 @@ from werkzeug.security import check_password_hash
|
||||||
from lookyloo.default import get_config
|
from lookyloo.default import get_config
|
||||||
from lookyloo.exceptions import MissingUUID, NoValidHarFile
|
from lookyloo.exceptions import MissingUUID, NoValidHarFile
|
||||||
from lookyloo.helpers import get_taxonomies, UserAgents, load_cookies
|
from lookyloo.helpers import get_taxonomies, UserAgents, load_cookies
|
||||||
from lookyloo.lookyloo import Indexing, Lookyloo, CaptureSettings
|
from lookyloo.lookyloo import Lookyloo, CaptureSettings
|
||||||
|
|
||||||
if sys.version_info < (3, 9):
|
if sys.version_info < (3, 9):
|
||||||
from pytz import all_timezones_set
|
from pytz import all_timezones_set
|
||||||
|
@ -119,7 +119,6 @@ def logout():
|
||||||
# Config
|
# Config
|
||||||
|
|
||||||
lookyloo: Lookyloo = Lookyloo()
|
lookyloo: Lookyloo = Lookyloo()
|
||||||
indexing: Indexing = Indexing()
|
|
||||||
|
|
||||||
time_delta_on_index = get_config('generic', 'time_delta_on_index')
|
time_delta_on_index = get_config('generic', 'time_delta_on_index')
|
||||||
blur_screenshot = get_config('generic', 'enable_default_blur_screenshot')
|
blur_screenshot = get_config('generic', 'enable_default_blur_screenshot')
|
||||||
|
@ -928,25 +927,25 @@ def index_hidden():
|
||||||
|
|
||||||
@app.route('/cookies', methods=['GET'])
|
@app.route('/cookies', methods=['GET'])
|
||||||
def cookies_lookup():
|
def cookies_lookup():
|
||||||
cookies_names = [(name, freq, indexing.cookies_names_number_domains(name))
|
cookies_names = [(name, freq, lookyloo.indexing.cookies_names_number_domains(name))
|
||||||
for name, freq in indexing.cookies_names]
|
for name, freq in lookyloo.indexing.cookies_names]
|
||||||
return render_template('cookies.html', cookies_names=cookies_names)
|
return render_template('cookies.html', cookies_names=cookies_names)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/hhhashes', methods=['GET'])
|
@app.route('/hhhashes', methods=['GET'])
|
||||||
def hhhashes_lookup():
|
def hhhashes_lookup():
|
||||||
hhhashes = [(hhh, freq, indexing.http_headers_hashes_number_captures(hhh))
|
hhhashes = [(hhh, freq, lookyloo.indexing.http_headers_hashes_number_captures(hhh))
|
||||||
for hhh, freq in indexing.http_headers_hashes]
|
for hhh, freq in lookyloo.indexing.http_headers_hashes]
|
||||||
return render_template('hhhashes.html', hhhashes=hhhashes)
|
return render_template('hhhashes.html', hhhashes=hhhashes)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/ressources', methods=['GET'])
|
@app.route('/ressources', methods=['GET'])
|
||||||
def ressources():
|
def ressources():
|
||||||
ressources = []
|
ressources = []
|
||||||
for h, freq in indexing.ressources:
|
for h, freq in lookyloo.indexing.ressources:
|
||||||
domain_freq = indexing.ressources_number_domains(h)
|
domain_freq = lookyloo.indexing.ressources_number_domains(h)
|
||||||
context = lookyloo.context.find_known_content(h)
|
context = lookyloo.context.find_known_content(h)
|
||||||
capture_uuid, url_uuid, hostnode_uuid = indexing.get_hash_uuids(h)
|
capture_uuid, url_uuid, hostnode_uuid = lookyloo.indexing.get_hash_uuids(h)
|
||||||
try:
|
try:
|
||||||
ressource = lookyloo.get_ressource(capture_uuid, url_uuid, h)
|
ressource = lookyloo.get_ressource(capture_uuid, url_uuid, h)
|
||||||
except MissingUUID:
|
except MissingUUID:
|
||||||
|
@ -960,7 +959,7 @@ def ressources():
|
||||||
|
|
||||||
@app.route('/categories', methods=['GET'])
|
@app.route('/categories', methods=['GET'])
|
||||||
def categories():
|
def categories():
|
||||||
return render_template('categories.html', categories=indexing.categories)
|
return render_template('categories.html', categories=lookyloo.indexing.categories)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/rebuild_all')
|
@app.route('/rebuild_all')
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import importlib
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
@ -17,14 +18,13 @@ from lacuscore import CaptureStatus as CaptureStatusCore
|
||||||
from pylacus import CaptureStatus as CaptureStatusPy
|
from pylacus import CaptureStatus as CaptureStatusPy
|
||||||
from lookyloo.comparator import Comparator
|
from lookyloo.comparator import Comparator
|
||||||
from lookyloo.exceptions import MissingUUID, NoValidHarFile
|
from lookyloo.exceptions import MissingUUID, NoValidHarFile
|
||||||
from lookyloo.lookyloo import Lookyloo, CaptureSettings
|
from lookyloo.lookyloo import CaptureSettings
|
||||||
|
|
||||||
from .helpers import build_users_table, load_user_from_request, src_request_ip
|
from .helpers import build_users_table, load_user_from_request, src_request_ip
|
||||||
|
|
||||||
api = Namespace('GenericAPI', description='Generic Lookyloo API', path='/')
|
api = Namespace('GenericAPI', description='Generic Lookyloo API', path='/')
|
||||||
|
|
||||||
|
lookyloo = importlib.import_module('lookyloo', '.')
|
||||||
lookyloo: Lookyloo = Lookyloo()
|
|
||||||
comparator: Comparator = Comparator()
|
comparator: Comparator = Comparator()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue