new: config option to make capture private by default, better working on capture page

Related #279
pull/280/head
Raphaël Vinot 2021-10-26 10:47:02 -04:00
parent 05ab994728
commit b4771f63a7
3 changed files with 13 additions and 4 deletions

View File

@ -7,8 +7,9 @@
"website_listen_ip": "0.0.0.0",
"website_listen_port": 5100,
"systemd_service_name": "lookyloo",
"default_public": true,
"splash_url": "http://127.0.0.1:8050",
"default_user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
"default_user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"users": {},
"time_delta_on_index": {
"weeks": 1,
@ -54,6 +55,7 @@
"website_listen_ip": "IP Flask will listen on. Defaults to 0.0.0.0, meaning all interfaces.",
"website_listen_port": "Port Flask will listen on.",
"systemd_service_name": "(Optional) Name of the systemd service if your project has one.",
"default_public": "If true, the capture is public and will be visible on the index page by default (can be unticked on the capture page)."
"splash_url": "URL to connect to splash",
"default_user_agent": "Ultimate fallback if the capture form, or the asynchronous submission, doesn't provide a user agent.",
"users": "It is some kind of an admin accounts. Format: {username: password}",

View File

@ -805,6 +805,7 @@ def _prepare_capture_template(user_ua: Optional[str], predefined_url: Optional[s
flash('The request will be enqueued, but capturing may take a while and require the administrator to wake up.', 'error')
return render_template('capture.html', user_agents=user_agents, default=default_ua,
max_depth=max_depth, personal_ua=user_ua,
default_public=get_config('generic', 'default_public'),
predefined_url_to_capture=predefined_url if predefined_url else '')

View File

@ -35,7 +35,7 @@
<div class="form-group row">
<div class="col-sm-10">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="listing" checked="true"></input>
<input class="form-check-input" type="checkbox" name="listing" {% if default_public %}checked="true"{% endif %}></input>
<label for="listing" class="form-check-label">Display results on public page</label>
</div>
</div>
@ -89,7 +89,7 @@
<div class="col-sm-10">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="personal_ua"></input>
<label for="personal_ua" class="form-check-label">Tick the box to use the current <a href="https://en.wikipedia.org/wiki/User_agent">user-agent</a> of your own browser:</br>
<label for="personal_ua" class="form-check-label">Use the current <a href="https://en.wikipedia.org/wiki/User_agent">user-agent</a> of your own browser:</br>
{{ personal_ua }}
</label>
</div>
@ -144,7 +144,13 @@
{% endfor%}
<div class="dropdown-divider"></div>
<center>
<b>By default, the capture is public. If you do not want that, untick the box at the top of the form.</b>
<b>
{% if default_public %}
By default, the capture is public. If you do not want that, untick the box at the top of the form.
{% else %}
By default, the capture is private (not visible on the index page). If you want it to be public tick the box at the top of the form.
{% endif %}
</b>
</br>
</br>
<button type="submit" class="new-capture-button" id="btn-looking">Start looking!</button>