new: Add feature to automatically trigger the modules on tree load

pull/129/head
Raphaël Vinot 2020-11-22 23:23:42 +01:00
parent a15a30850b
commit a117a91341
3 changed files with 13 additions and 2 deletions

View File

@ -18,6 +18,7 @@
"enable_default_blur_screenshot": false,
"enable_context_by_users": false,
"enable_categorization": false,
"auto_trigger_modules": false,
"enable_mail_notification": false,
"email": {
"from": "Lookyloo <lookyloo@myorg.local>",
@ -43,6 +44,7 @@
"enable_default_blur_screenshot": "If true, blur the screenshot by default (useful on public instances)",
"enable_context_by_users": "Allow the users to add context to a response body",
"enable_categorization": "Allow the users to add contextualization to a capture",
"auto_trigger_modules": "Automatically trigger the modules when the tree is loaded",
"enable_mail_notification": "Enable email notification or not",
"email": "Configuration for sending email notifications."
}

View File

@ -51,6 +51,7 @@ max_depth = get_config('generic', 'max_depth')
enable_mail_notification = get_config('generic', 'enable_mail_notification')
enable_context_by_users = get_config('generic', 'enable_context_by_users')
enable_categorization = get_config('generic', 'enable_categorization')
auto_trigger_modules = get_config('generic', 'auto_trigger_modules')
logging.basicConfig(level=get_config('generic', 'loglevel'))
@ -348,8 +349,9 @@ def tree(tree_uuid: str, urlnode_uuid: Optional[str]=None):
meta=meta, enable_mail_notification=enable_mail_notification,
enable_context_by_users=enable_context_by_users,
enable_categorization=enable_categorization,
blur_screenshot=blur_screenshot,
urlnode_uuid=urlnode_uuid, has_redirects=True if cache['redirects'] else False)
blur_screenshot=blur_screenshot, urlnode_uuid=urlnode_uuid,
auto_trigger_modules=auto_trigger_modules,
has_redirects=True if cache['redirects'] else False)
except NoValidHarFile as e:
return render_template('error.html', error_message=e)

View File

@ -54,6 +54,13 @@
});
</script>
{% endif%}
{% if auto_trigger_modules %}
<script>
$.get("{{ url_for('trigger_modules', tree_uuid=tree_uuid) }}")
</script>
{% endif%}
{% endblock %}
{% block content %}