changes so that you can ignore the sri while developing

pull/913/head
Adrian Maraj 2024-04-29 13:09:54 +02:00 committed by Raphaël Vinot
parent 6595d92df0
commit e110ba6ea4
9 changed files with 21 additions and 15 deletions

View File

@ -13,6 +13,7 @@
"days": 0, "days": 0,
"hours": 0 "hours": 0
}, },
"enable_ignore_sri": false,
"async_capture_processes": 1, "async_capture_processes": 1,
"use_user_agents_users": false, "use_user_agents_users": false,
"enable_default_blur_screenshot": false, "enable_default_blur_screenshot": false,

View File

@ -139,6 +139,7 @@ blur_screenshot = get_config('generic', 'enable_default_blur_screenshot')
use_own_ua = get_config('generic', 'use_user_agents_users') use_own_ua = get_config('generic', 'use_user_agents_users')
enable_mail_notification = get_config('generic', 'enable_mail_notification') enable_mail_notification = get_config('generic', 'enable_mail_notification')
enable_ignore_sri = get_config('generic', 'enable_ignore_sri')
if enable_mail_notification: if enable_mail_notification:
confirm_message = get_config('generic', 'email').get('confirm_message') confirm_message = get_config('generic', 'email').get('confirm_message')
else: else:
@ -182,8 +183,10 @@ app.jinja_env.globals.update(month_name=month_name)
def get_sri(directory: str, filename: str) -> str: def get_sri(directory: str, filename: str) -> str:
if enable_ignore_sri:
return ""
sha512 = sri_load()[directory][filename] sha512 = sri_load()[directory][filename]
return f'sha512-{sha512}' return f'integrity=sha512-{sha512}'
app.jinja_env.globals.update(get_sri=get_sri) app.jinja_env.globals.update(get_sri=get_sri)
@ -1177,6 +1180,7 @@ def tree(tree_uuid: str, node_uuid: str | None=None) -> Response | str | Werkzeu
screenshot_size=screenshot_size, screenshot_size=screenshot_size,
meta=meta, enable_mail_notification=enable_mail_notification, meta=meta, enable_mail_notification=enable_mail_notification,
enable_monitoring=lookyloo.monitoring_enabled, enable_monitoring=lookyloo.monitoring_enabled,
ignore_sri_enable=enable_ignore_sri,
monitoring_settings=lookyloo.monitoring_settings if lookyloo.monitoring_enabled else None, monitoring_settings=lookyloo.monitoring_settings if lookyloo.monitoring_enabled else None,
monitoring_collections=monitoring_collections if lookyloo.monitoring_enabled else [], monitoring_collections=monitoring_collections if lookyloo.monitoring_enabled else [],
enable_context_by_users=enable_context_by_users, enable_context_by_users=enable_context_by_users,

View File

@ -22,6 +22,7 @@
"generic.css": "Sh/BcxFMLYYaLdCluVt9efGvJ9CF5d+YJ7lkL2M24PRGu8VZHI9lJiUlFObIocjQgwss3Ve2U5cUAE5WiAdpQQ==", "generic.css": "Sh/BcxFMLYYaLdCluVt9efGvJ9CF5d+YJ7lkL2M24PRGu8VZHI9lJiUlFObIocjQgwss3Ve2U5cUAE5WiAdpQQ==",
"generic.js": "h2tLqpn8r1mZ/5FqiBDK6Er6mY5MdRuyir2mS9piT8VUUco2daxdKWSkiEtIsH2Ok+/W+NJb95A1ob5J/6sW4A==", "generic.js": "h2tLqpn8r1mZ/5FqiBDK6Er6mY5MdRuyir2mS9piT8VUUco2daxdKWSkiEtIsH2Ok+/W+NJb95A1ob5J/6sW4A==",
"html.png": "T7pZrb8MMDsA/JV/51hu+TOglTqlxySuEVY0rpDjTuAEyhzk2v+W4kYrj7vX+Tp3n2d2lvVD08PwhCG62Yfbzg==", "html.png": "T7pZrb8MMDsA/JV/51hu+TOglTqlxySuEVY0rpDjTuAEyhzk2v+W4kYrj7vX+Tp3n2d2lvVD08PwhCG62Yfbzg==",
"html2canvas.min.js": "BNaRQnYJYiPSqHHDb58B0yaPfCu+Wgds8Gp/gU33kqBtgNS4tSPHuGibyoeqMV/TJlSKda6FXzoEyYGjTe+vXA==",
"ifr.png": "rI5YJypmz1QcULRf9UaOYSqV4tPUSxUdLAycoYzCwywt4Pw4eWzBg9SUr769VyIimoiIyJR+aNuoIA4p5WO2fQ==", "ifr.png": "rI5YJypmz1QcULRf9UaOYSqV4tPUSxUdLAycoYzCwywt4Pw4eWzBg9SUr769VyIimoiIyJR+aNuoIA4p5WO2fQ==",
"img.png": "bknBlmIfSb9qv9/lSaJ2idn2a8bDyvJ2pATj4oOpehRlCdXlWYOyb2jN3wV1QGHFoqyxNqOv5MfCpI0tbqkicg==", "img.png": "bknBlmIfSb9qv9/lSaJ2idn2a8bDyvJ2pATj4oOpehRlCdXlWYOyb2jN3wV1QGHFoqyxNqOv5MfCpI0tbqkicg==",
"index.css": "2hAsQwCClHQ7b6VthbKYIkUPam4Ef6wbSxa3+nK0UuqCHezvPMr3aqpz16gD0lyYop55VEd/dhzZJLA4WMAplQ==", "index.css": "2hAsQwCClHQ7b6VthbKYIkUPam4Ef6wbSxa3+nK0UuqCHezvPMr3aqpz16gD0lyYop55VEd/dhzZJLA4WMAplQ==",

View File

@ -375,7 +375,7 @@
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src='{{ url_for('static', filename='capture.js') }}' <script src='{{ url_for('static', filename='capture.js') }}'
integrity="{{get_sri('static', 'capture.js')}}" {{get_sri('static', 'capture.js')}}
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<script> <script>
$('#nav-url-tab').on('click', function(e) { $('#nav-url-tab').on('click', function(e) {

View File

@ -51,7 +51,7 @@ $(document).ready(function () {
{% block styles %} {% block styles %}
{{ super() }} {{ super() }}
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}" <link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}"
integrity="{{get_sri('static', 'index.css')}}" {{get_sri('static', 'index.css')}}
crossorigin="anonymous"> crossorigin="anonymous">
{% endblock %} {% endblock %}

View File

@ -6,17 +6,17 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}" <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"
integrity="{{get_sri('static', 'favicon.ico')}}" {{get_sri('static', 'favicon.ico')}}
crossorigin="anonymous"> crossorigin="anonymous">
{% block styles %} {% block styles %}
<!-- Bootstrap CSS --> <!-- Bootstrap CSS -->
{{ bootstrap.load_css() }} {{ bootstrap.load_css() }}
<link rel="stylesheet" href="{{ url_for('static', filename='generic.css') }}" <link rel="stylesheet" href="{{ url_for('static', filename='generic.css') }}"
integrity="{{get_sri('static', 'generic.css')}}" {{get_sri('static', 'generic.css')}}
crossorigin="anonymous"> crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('static', filename='datatables.min.css') }}" <link rel="stylesheet" href="{{ url_for('static', filename='datatables.min.css') }}"
integrity="{{get_sri('static', 'datatables.min.css')}}" {{get_sri('static', 'datatables.min.css')}}
crossorigin="anonymous"> crossorigin="anonymous">
{% endblock %} {% endblock %}
@ -36,13 +36,13 @@
<!-- Optional JavaScript --> <!-- Optional JavaScript -->
{{ bootstrap.load_js() }} {{ bootstrap.load_js() }}
<script src='{{ url_for('static', filename='jquery.min.js') }}' <script src='{{ url_for('static', filename='jquery.min.js') }}'
integrity="{{get_sri('static', 'jquery.min.js')}}" {{get_sri('static', 'jquery.min.js')}}
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<script src='{{ url_for('static', filename='datatables.min.js') }}' <script src='{{ url_for('static', filename='datatables.min.js') }}'
integrity="{{get_sri('static', 'datatables.min.js')}}" {{get_sri('static', 'datatables.min.js')}}
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<script src='{{ url_for('static', filename='generic.js') }}' <script src='{{ url_for('static', filename='generic.js') }}'
integrity="{{get_sri('static', 'generic.js')}}" {{get_sri('static', 'generic.js')}}
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
{% endblock %} {% endblock %}
</body> </body>

View File

@ -62,6 +62,6 @@
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src='{{ url_for('static', filename='capture.js') }}' <script src='{{ url_for('static', filename='capture.js') }}'
integrity="{{get_sri('static', 'capture.js')}}" {{get_sri('static', 'capture.js')}}
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
{% endblock %} {% endblock %}

View File

@ -70,16 +70,16 @@
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src='{{ url_for('static', filename='d3.min.js') }}' <script src='{{ url_for('static', filename='d3.min.js') }}'
integrity="{{get_sri('static', 'd3.min.js')}}" {{get_sri('static', 'd3.min.js')}}
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<script src='{{ url_for('static', filename='stats_graph.js') }}' <script src='{{ url_for('static', filename='stats_graph.js') }}'
integrity="{{get_sri('static', 'stats_graph.js')}}" {{get_sri('static', 'stats_graph.js')}}
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
{% endblock %} {% endblock %}
{% block styles %} {% block styles %}
{{ super() }} {{ super() }}
<link rel="stylesheet" href="{{ url_for('static', filename='stats.css') }}" <link rel="stylesheet" href="{{ url_for('static', filename='stats.css') }}"
integrity="{{get_sri('static', 'stats.css')}}" {{get_sri('static', 'stats.css')}}
crossorigin="anonymous"> crossorigin="anonymous">
{% endblock %} {% endblock %}

View File

@ -29,10 +29,10 @@
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src='{{ url_for('static', filename='d3.min.js') }}' <script src='{{ url_for('static', filename='d3.min.js') }}'
integrity="{{get_sri('static', 'd3.min.js')}}" {{get_sri('static', 'd3.min.js')}}
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<script src='{{ url_for('static', filename='tree.js') }}' <script src='{{ url_for('static', filename='tree.js') }}'
integrity="{{get_sri('static', 'tree.js')}}" {{get_sri('static', 'tree.js')}}
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<script> <script>