From b6c6c7756e4f45ddd08cc4da4336565b80090dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 13 Aug 2020 15:56:46 +0200 Subject: [PATCH] new: Optionally blur screenshots by default (public instances) --- config/generic.json.sample | 2 ++ website/web/__init__.py | 2 ++ website/web/static/tree.css | 10 ++-------- website/web/templates/tree.html | 10 +++++++++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/config/generic.json.sample b/config/generic.json.sample index 8d5eebfb..507fa011 100644 --- a/config/generic.json.sample +++ b/config/generic.json.sample @@ -13,6 +13,7 @@ }, "max_depth": 1, "use_user_agents_users": false, + "enable_default_blur_screenshot": false, "enable_mail_notification": false, "email": { "from": "Lookyloo ", @@ -33,6 +34,7 @@ "time_delta_on_index": "Time interval of the capture displayed on the index", "max_depth": "Maximum depth for scraping. Anything > 1 will be exponentially bigger.", "use_user_agents_users": "Only usable for medium/high use instances: use the user agents of the users of the platform", + "enable_default_blur_screenshot": "If true, blur the screenshot by default (useful on public instances)", "enable_mail_notification": "Enable email notification or not", "email": "Configuration for sending email notifications." } diff --git a/website/web/__init__.py b/website/web/__init__.py index c52a53e7..14da5e2f 100644 --- a/website/web/__init__.py +++ b/website/web/__init__.py @@ -44,6 +44,7 @@ lookyloo: Lookyloo = Lookyloo() user = lookyloo.get_config('cache_clean_user') time_delta_on_index = lookyloo.get_config('time_delta_on_index') +blur_screenshot = lookyloo.get_config('enable_default_blur_screenshot') logging.basicConfig(level=lookyloo.get_config('loglevel')) @@ -419,6 +420,7 @@ def tree(tree_uuid: str, urlnode_uuid: Optional[str]=None): return render_template('tree.html', tree_json=tree_json, start_time=start_time, user_agent=user_agent, root_url=root_url, tree_uuid=tree_uuid, meta=meta, enable_mail_notification=enable_mail_notification, + blur_screenshot=blur_screenshot, urlnode_uuid=urlnode_uuid, has_redirects=True if cache['redirects'] else False) except NoValidHarFile as e: diff --git a/website/web/static/tree.css b/website/web/static/tree.css index 6c4fe9ba..4f0a8d01 100644 --- a/website/web/static/tree.css +++ b/website/web/static/tree.css @@ -56,14 +56,8 @@ background: #fff; } -#screenshot { - position: fixed; - top: 5px; - right: 5px; - background: white; - border: 2px solid; - height: 1030px; - overflow: hidden; +.blur { + filter: blur(10px); } #legend_container { diff --git a/website/web/templates/tree.html b/website/web/templates/tree.html index 93e54149..018c4501 100644 --- a/website/web/templates/tree.html +++ b/website/web/templates/tree.html @@ -240,7 +240,15 @@