on master help sign in
[mod] disable /stats page by default to prevent potential data leak
9b5415eAdam Tauber
searx/settings.yml+1
@@ -2,6 +2,7 @@ general:
2 debug : False # Debug mode, only for development
2 debug : False # Debug mode, only for development
3 instance_name : "searx" # displayed name
3 instance_name : "searx" # displayed name
4 contact_url: False # mailto:contact@example.com
4 contact_url: False # mailto:contact@example.com
5+ enable_stats: False # activate /stats page - note: it may leak usage data
5
6
6brand:
7brand:
7 git_url: https://github.com/searx/searx
8 git_url: https://github.com/searx/searx
searx/webapp.py+2
@@ -978,6 +978,8 @@ def image_proxy():
978@app.route('/stats', methods=['GET'])
978@app.route('/stats', methods=['GET'])
979def stats():
979def stats():
980 """Render engine statistics page."""
980 """Render engine statistics page."""
981+ if not settings['general'].get('enable_stats'):
982+ return page_not_found(None)
981 stats = get_engines_stats(request.preferences)
983 stats = get_engines_stats(request.preferences)
982 return render(
984 return render(
983 'stats.html',
985 'stats.html',