[mod] disable /stats page by default to prevent potential data leak

This commit is contained in:
Adam Tauber 2021-05-13 22:20:02 +02:00
parent 6cd3bf376f
commit 9b5415ea2f
2 changed files with 3 additions and 0 deletions

View File

@ -2,6 +2,7 @@ general:
debug : False # Debug mode, only for development
instance_name : "searx" # displayed name
contact_url: False # mailto:contact@example.com
enable_stats: False # activate /stats page - note: it may leak usage data
brand:
git_url: https://github.com/searx/searx

View File

@ -978,6 +978,8 @@ def image_proxy():
@app.route('/stats', methods=['GET'])
def stats():
"""Render engine statistics page."""
if not settings['general'].get('enable_stats'):
return page_not_found(None)
stats = get_engines_stats(request.preferences)
return render(
'stats.html',