diff --git a/searx/settings.yml b/searx/settings.yml index ba25fe9c..01f2769f 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -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 diff --git a/searx/webapp.py b/searx/webapp.py index bdc2e454..ca62c389 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -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',