mirror of https://github.com/CIRCL/lookyloo
Merge pull request #917 from cvandeplas/main
fix: [modules] Gracefully accept no hashlookup fixes #916pull/918/head
commit
ac2c5b16cf
|
@ -5,6 +5,9 @@ set -x
|
||||||
|
|
||||||
if [ -f ../../valkey/src/valkey-server ]; then
|
if [ -f ../../valkey/src/valkey-server ]; then
|
||||||
../../valkey/src/valkey-server ./cache.conf
|
../../valkey/src/valkey-server ./cache.conf
|
||||||
else
|
elif [ -f ../../redis/src/redis-server ]; then
|
||||||
../../redis/src/redis-server ./cache.conf
|
../../redis/src/redis-server ./cache.conf
|
||||||
|
else
|
||||||
|
echo "Warning: using system redis-server. Valkey-server or redis-server from source is recommended." >&2
|
||||||
|
/usr/bin/redis-server ./cache.conf
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -5,6 +5,9 @@ set -x
|
||||||
|
|
||||||
if [ -f ../../valkey/src/valkey-server ]; then
|
if [ -f ../../valkey/src/valkey-server ]; then
|
||||||
../../valkey/src/valkey-server ./indexing.conf
|
../../valkey/src/valkey-server ./indexing.conf
|
||||||
else
|
elif [ -f ../../redis/src/redis-server ]; then
|
||||||
../../redis/src/redis-server ./indexing.conf
|
../../redis/src/redis-server ./indexing.conf
|
||||||
|
else
|
||||||
|
echo "Warning: using system redis-server. Valkey-server or redis-server from source is recommended." >&2
|
||||||
|
/usr/bin/redis-server ./indexing.conf
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -962,10 +962,14 @@ def urls_rendered_page(tree_uuid: str) -> WerkzeugResponse | str | Response:
|
||||||
|
|
||||||
@app.route('/tree/<string:tree_uuid>/hashlookup', methods=['GET'])
|
@app.route('/tree/<string:tree_uuid>/hashlookup', methods=['GET'])
|
||||||
def hashlookup(tree_uuid: str) -> str | WerkzeugResponse | Response:
|
def hashlookup(tree_uuid: str) -> str | WerkzeugResponse | Response:
|
||||||
merged, total_ressources = lookyloo.merge_hashlookup_tree(tree_uuid)
|
try:
|
||||||
# We only want unique URLs for the template
|
merged, total_ressources = lookyloo.merge_hashlookup_tree(tree_uuid)
|
||||||
for sha1, entries in merged.items():
|
# We only want unique URLs for the template
|
||||||
entries['nodes'] = {node.name for node in entries['nodes']}
|
for sha1, entries in merged.items():
|
||||||
|
entries['nodes'] = {node.name for node in entries['nodes']}
|
||||||
|
except Exception: # error or module not enabled
|
||||||
|
merged = {}
|
||||||
|
total_ressources = 0
|
||||||
return render_template('hashlookup.html', base_tree_uuid=tree_uuid, merged=merged, total_ressources=total_ressources)
|
return render_template('hashlookup.html', base_tree_uuid=tree_uuid, merged=merged, total_ressources=total_ressources)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<div>
|
<div>
|
||||||
|
{% if not merged %}
|
||||||
|
No result data available or hashlookup module not enabled.
|
||||||
|
{%else%}
|
||||||
|
|
||||||
<b>Total Hits</b>: {{ merged|length }}</br>
|
<b>Total Hits</b>: {{ merged|length }}</br>
|
||||||
<b>Total ressources</b>: {{total_ressources}}</br></br>
|
<b>Total ressources</b>: {{total_ressources}}</br></br>
|
||||||
{% for sha1, entries in merged.items() %}
|
{% for sha1, entries in merged.items() %}
|
||||||
|
@ -25,4 +29,5 @@
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{%endif%}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -434,7 +434,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<a id="help" href="https://www.lookyloo.eu/docs/main/usage.html#_investigate_a_capture" role="button" title="Lookyloo Manual">?</a>
|
<a id="help" href="https://www.lookyloo.eu/docs/main/usage.html#_investigate_a_capture" role="button" title="Lookyloo Manual" target="_blank">?</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue