SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[enh] make version of searx readable
Thomas Pointhuberaba65369d2d5
diff --git a/searx/settings.yml b/searx/settings.ymlindex c4589a0a7..d64a23bf1 100644--- a/searx/settings.yml+++ b/searx/settings.yml@@ -7,6 +7,7 @@ server:themes_path : "" # Custom ui themes pathdefault_theme : default # ui themehttps_rewrite : True # Force rewrite result urls. See searx/https_rewrite.py+ useragent_suffix : "" # suffix of searx_useragent, could contain informations like an email address to the administratorengines:- name : wikipediadiff --git a/searx/templates/courgette/base.html b/searx/templates/courgette/base.htmlindex da5ae905f..382b8d5ed 100644--- a/searx/templates/courgette/base.html+++ b/searx/templates/courgette/base.html@@ -4,6 +4,7 @@<meta charset="UTF-8" /><meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" /><meta name="keywords" content="searx, search, search engine, metasearch, meta search" />+ <meta name="generator" content="searx/{{ searx_version }}"><meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" /><title>{% block title %}{% endblock %}searx</title><link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" />diff --git a/searx/templates/default/base.html b/searx/templates/default/base.htmlindex c231bf8cc..bc7f0972e 100644--- a/searx/templates/default/base.html+++ b/searx/templates/default/base.html@@ -4,6 +4,7 @@<meta charset="UTF-8" /><meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" /><meta name="keywords" content="searx, search, search engine, metasearch, meta search" />+ <meta name="generator" content="searx/{{ searx_version }}"><meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" /><title>{% block title %}{% endblock %}searx</title><link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" />diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.htmlindex a023db415..807da84e7 100644--- a/searx/templates/oscar/base.html+++ b/searx/templates/oscar/base.html@@ -5,6 +5,7 @@<meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" /><meta name="keywords" content="searx, search, search engine, metasearch, meta search" /><meta http-equiv="X-UA-Compatible" content="IE=edge">+ <meta name="generator" content="searx/{{ searx_version }}"><meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=1.0, user-scalable=1" /><title>{% block title %}{% endblock %}searx</title>@@ -64,7 +65,7 @@<div class="container">{% block footer %}{% endblock %}- <p class="text-muted">{{ _('Powered by') }} <a href="https://github.com/asciimoo/searx">Searx</a> - {{ _('a privacy-respecting, hackable metasearch engine') }}</p>+ <p class="text-muted">{{ _('Powered by') }} <a href="https://github.com/asciimoo/searx">searx</a> - {{ searx_version }} - {{ _('a privacy-respecting, hackable metasearch engine') }}</p></div></div><script src="{{ url_for('static', filename='js/jquery-1.11.1.min.js') }}"></script>diff --git a/searx/utils.py b/searx/utils.pyindex 7764291fc..47980bd36 100644--- a/searx/utils.py+++ b/searx/utils.py@@ -3,6 +3,9 @@ from codecs import getincrementalencoderfrom HTMLParser import HTMLParserfrom random import choice+from searx.version import VERSION_STRING+from searx import settings+import cStringIOimport csvimport os@@ -21,7 +24,8 @@ def gen_useragent():def searx_useragent():- return 'searx'+ return 'searx/{searx_version} {suffix}'.format(searx_version=VERSION_STRING,+ suffix=settings['server'].get('useragent_suffix', ''))def highlight_content(content, query):diff --git a/searx/version.py b/searx/version.pynew file mode 100644index 000000000..8127d853d--- /dev/null+++ b/searx/version.py@@ -0,0 +1,24 @@+# -*- coding: utf-8 -*-+'''+searx is free software: you can redistribute it and/or modify+it under the terms of the GNU Affero General Public License as published by+the Free Software Foundation, either version 3 of the License, or+(at your option) any later version.++searx is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU Affero General Public License for more details.++You should have received a copy of the GNU Affero General Public License+along with searx. If not, see < http://www.gnu.org/licenses/ >.++(C) 2013- by Adam Tauber, <[email protected]>+'''++# version of searx+VERSION_MAJOR = 0+VERSION_MINOR = 4+VERSION_BUILD = 0++VERSION_STRING = "%d.%d.%d" % (VERSION_MAJOR,VERSION_MINOR,VERSION_BUILD)diff --git a/searx/webapp.py b/searx/webapp.pyindex e25a4067a..332415e6a 100644--- a/searx/webapp.py+++ b/searx/webapp.py@@ -44,6 +44,7 @@ from searx.engines import (from searx.utils import (UnicodeWriter, highlight_content, html_to_text, get_themes)+from searx.version import VERSION_STRINGfrom searx.https_rewrite import https_rulesfrom searx.languages import language_codesfrom searx.search import Search@@ -171,6 +172,8 @@ def render(template_name, override_theme=None, **kwargs):if 'autocomplete' not in kwargs:kwargs['autocomplete'] = autocomplete+ kwargs['searx_version'] = VERSION_STRING+kwargs['method'] = request.cookies.get('method', 'POST')# override url_for function in templatesdiff --git a/setup.py b/setup.pyindex da3d1b6a4..3e52e18d3 100644--- a/setup.py+++ b/setup.py@@ -6,6 +6,10 @@ from setuptools import find_packagesimport os+# required to load VERSION_STRING constant+sys.path.insert(0, './searx')+from version import VERSION_STRING+def read(*rnames):return open(os.path.join(os.path.dirname(__file__), *rnames)).read()@@ -15,7 +19,7 @@ long_description = read('README.rst')setup(name='searx',- version="0.4.0",+ version=VERSION_STRING,description="A privacy-respecting, hackable metasearch engine",long_description=long_description,classifiers=[