mirror of https://github.com/searx/searx
[mod] disable /stats page by default to prevent potential data leak
This commit is contained in:
parent
6cd3bf376f
commit
9b5415ea2f
|
@ -2,6 +2,7 @@ general:
|
||||||
debug : False # Debug mode, only for development
|
debug : False # Debug mode, only for development
|
||||||
instance_name : "searx" # displayed name
|
instance_name : "searx" # displayed name
|
||||||
contact_url: False # mailto:contact@example.com
|
contact_url: False # mailto:contact@example.com
|
||||||
|
enable_stats: False # activate /stats page - note: it may leak usage data
|
||||||
|
|
||||||
brand:
|
brand:
|
||||||
git_url: https://github.com/searx/searx
|
git_url: https://github.com/searx/searx
|
||||||
|
|
|
@ -978,6 +978,8 @@ def image_proxy():
|
||||||
@app.route('/stats', methods=['GET'])
|
@app.route('/stats', methods=['GET'])
|
||||||
def stats():
|
def stats():
|
||||||
"""Render engine statistics page."""
|
"""Render engine statistics page."""
|
||||||
|
if not settings['general'].get('enable_stats'):
|
||||||
|
return page_not_found(None)
|
||||||
stats = get_engines_stats(request.preferences)
|
stats = get_engines_stats(request.preferences)
|
||||||
return render(
|
return render(
|
||||||
'stats.html',
|
'stats.html',
|
||||||
|
|
Loading…
Reference in New Issue