forked from Icycoide/searxng
Merge PR #1900 of https://github.com/asciimoo/searx into filtron
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
commit
65b22be1f4
20 changed files with 322 additions and 212 deletions
5
searx/brand.py
Normal file
5
searx/brand.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
GIT_URL = 'https://github.com/asciimoo/searx'
|
||||
ISSUE_URL = 'https://github.com/asciimoo/searx/issues'
|
||||
SEARX_URL = 'https://searx.me'
|
||||
DOCS_URL = 'https://asciimoo.github.io/searx'
|
||||
PUBLIC_INSTANCES = 'https://searx.space'
|
|
@ -1,11 +1,8 @@
|
|||
{
|
||||
"versions": [
|
||||
"70.0.1",
|
||||
"70.0",
|
||||
"69.0.3",
|
||||
"69.0.2",
|
||||
"69.0.1",
|
||||
"69.0"
|
||||
"74.0",
|
||||
"73.0.1",
|
||||
"73.0"
|
||||
],
|
||||
"os": [
|
||||
"Windows NT 10; WOW64",
|
||||
|
|
2
searx/static/themes/oscar/.gitignore
vendored
2
searx/static/themes/oscar/.gitignore
vendored
|
@ -1 +1 @@
|
|||
node_modules/
|
||||
/node_modules
|
||||
|
|
|
@ -13,7 +13,7 @@ module.exports = function(grunt) {
|
|||
},
|
||||
uglify: {
|
||||
options: {
|
||||
banner: '/*! oscar/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
|
||||
banner: '/*! oscar/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n'
|
||||
},
|
||||
dist: {
|
||||
files: {
|
||||
|
@ -38,7 +38,6 @@ module.exports = function(grunt) {
|
|||
development: {
|
||||
options: {
|
||||
paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"]
|
||||
//banner: '/*! less/oscar/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
|
||||
},
|
||||
files: {"css/pointhi.css": "less/pointhi/oscar.less",
|
||||
"css/logicodev.css": "less/logicodev-dark/oscar.less",
|
||||
|
@ -47,7 +46,6 @@ module.exports = function(grunt) {
|
|||
production: {
|
||||
options: {
|
||||
paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"],
|
||||
//banner: '/*! less/oscar/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n',
|
||||
cleancss: true
|
||||
},
|
||||
files: {"css/pointhi.min.css": "less/pointhi/oscar.less",
|
||||
|
|
1
searx/static/themes/simple/.gitignore
vendored
Normal file
1
searx/static/themes/simple/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/node_modules
|
|
@ -36,7 +36,7 @@ module.exports = function(grunt) {
|
|||
},
|
||||
uglify: {
|
||||
options: {
|
||||
banner: '/*! simple/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n',
|
||||
banner: '/*! simple/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n',
|
||||
output: {
|
||||
comments: 'some'
|
||||
},
|
||||
|
@ -57,7 +57,7 @@ module.exports = function(grunt) {
|
|||
development: {
|
||||
options: {
|
||||
paths: ["less"],
|
||||
banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
|
||||
banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n'
|
||||
},
|
||||
files: {
|
||||
"css/searx.css": "less/style.less",
|
||||
|
@ -73,7 +73,7 @@ module.exports = function(grunt) {
|
|||
compatibility: '*'
|
||||
})
|
||||
],
|
||||
banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
|
||||
banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n'
|
||||
},
|
||||
files: {
|
||||
"css/searx.min.css": "less/style.less",
|
||||
|
|
|
@ -1,63 +1,97 @@
|
|||
<div{% if rtl %} dir="ltr"{% endif %}>
|
||||
<h1>About <a href="{{ url_for('index') }}">searx</a></h1>
|
||||
<h1>About <a href="{{ url_for('index') }}">searx</a></h1>
|
||||
|
||||
<p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
|
||||
</p>
|
||||
<h2>Why use searx?</h2>
|
||||
<ul>
|
||||
<li>searx may not offer you as personalised results as Google, but it doesn't generate a profile about you</li>
|
||||
<li>searx doesn't care about what you search for, never shares anything with a third party, and it can't be used to compromise you</li>
|
||||
<li>searx is free software, the code is 100% open and you can help to make it better. See more on <a href="https://github.com/asciimoo/searx">github</a></li>
|
||||
</ul>
|
||||
<p>If you do care about privacy, want to be a conscious user, or otherwise believe
|
||||
in digital freedom, make searx your default search engine or run it on your own server</p>
|
||||
<p>
|
||||
Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>,
|
||||
aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a>
|
||||
while not storing information about its users.
|
||||
</p>
|
||||
|
||||
<h2>Technical details - How does it work?</h2>
|
||||
<p>More about searx ...</p>
|
||||
|
||||
<p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>,
|
||||
inspired by the <a href="https://beniz.github.io/seeks/">seeks project</a>.<br />
|
||||
It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrome*). Therefore they show up in neither our logs, nor your url history. In case of Chrome* users there is an exception, searx uses the search bar to perform GET requests.<br />
|
||||
Searx can be added to your browser's search bar; moreover, it can be set as the default search engine.
|
||||
</p>
|
||||
|
||||
<h2>How can I make it my own?</h2>
|
||||
|
||||
<p>Searx appreciates your concern regarding logs, so take the <a href="https://github.com/asciimoo/searx">code</a> and run it yourself! <br />Add your Searx to this <a href="https://searx.space/">list</a> to help other people reclaim their privacy and make the Internet freer!
|
||||
<br />The more decentralized the Internet is, the more freedom we have!</p>
|
||||
|
||||
|
||||
<h2>More about searx</h2>
|
||||
|
||||
<ul>
|
||||
<ul>
|
||||
<li><a href="https://github.com/asciimoo/searx">github</a></li>
|
||||
<li><a href="https://www.ohloh.net/p/searx/">ohloh</a></li>
|
||||
<li><a href="https://twitter.com/Searx_engine">twitter</a></li>
|
||||
<li>IRC: #searx @ freenode (<a href="https://kiwiirc.com/client/irc.freenode.com/searx">webclient</a>)</li>
|
||||
<li><a href="https://www.transifex.com/projects/p/searx/">transifex</a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<hr />
|
||||
|
||||
<hr />
|
||||
<h2>Why use searx?</h2>
|
||||
|
||||
<h2 id="faq">FAQ</h2>
|
||||
<ul>
|
||||
<li>
|
||||
Searx may not offer you as personalised results as Google, but it doesn't
|
||||
generate a profile about you.
|
||||
</li>
|
||||
<li>
|
||||
Searx doesn't care about what you search for, never shares anything with a
|
||||
third party, and it can't be used to compromise you.
|
||||
</li>
|
||||
<li>
|
||||
Searx is free software, the code is 100% open and you can help to make it
|
||||
better. See more on <a href="https://github.com/asciimoo/searx">github</a>.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>How to add to firefox?</h3>
|
||||
<p><a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a> searx as a search engine on any version of Firefox! (javascript required)</p>
|
||||
<p>
|
||||
If you do care about privacy, want to be a conscious user, or otherwise
|
||||
believe in digital freedom, make searx your default search engine or run it
|
||||
on your own server
|
||||
</p>
|
||||
|
||||
<h2 id="dev_faq">Developer FAQ</h2>
|
||||
<h2>Technical details - How does it work?</h2>
|
||||
|
||||
<h3>New engines?</h3>
|
||||
<ul>
|
||||
<li>Edit your <a href="https://raw.github.com/asciimoo/searx/master/searx/settings.yml">settings.yml</a></li>
|
||||
<li>Create your custom engine module, check the <a href="https://github.com/asciimoo/searx/blob/master/examples/basic_engine.py">example engine</a></li>
|
||||
</ul>
|
||||
<p>Don't forget to restart searx after config edit!</p>
|
||||
<p>
|
||||
Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>,
|
||||
inspired by the <a href="https://beniz.github.io/seeks/">seeks project</a>.
|
||||
|
||||
<h3>Installation/WSGI support?</h3>
|
||||
<p>See the <a href="https://github.com/asciimoo/searx/wiki/Installation">installation and setup</a> wiki page</p>
|
||||
It provides basic privacy by mixing your queries with searches on other
|
||||
platforms without storing search data. Queries are made using a POST request
|
||||
on every browser (except chrome*). Therefore they show up in neither our
|
||||
logs, nor your url history. In case of Chrome* users there is an exception,
|
||||
searx uses the search bar to perform GET requests.
|
||||
|
||||
<h3>How to debug engines?</h3>
|
||||
<p><a href="{{ url_for('stats') }}">Stats page</a> contains some useful data about the engines used.</p>
|
||||
Searx can be added to your browser's search bar; moreover, it can be set as
|
||||
the default search engine.
|
||||
</p>
|
||||
|
||||
<h2 id='add to browser'>How to set as the default search engine?</h2>
|
||||
|
||||
<dt>Firefox</dt>
|
||||
|
||||
<dd>
|
||||
<a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a>
|
||||
searx as a search engine on any version of Firefox! (javascript required)
|
||||
</dd>
|
||||
|
||||
<h2>Where to find anonymous usage statistics of this instance ?</h2>
|
||||
|
||||
<p>
|
||||
<a href="{{ url_for('stats') }}">Stats page</a> contains some useful data about the engines used.
|
||||
</p>
|
||||
|
||||
<h2>How can I make it my own?</h2>
|
||||
|
||||
<p>
|
||||
Searx appreciates your concern regarding logs, so take the
|
||||
code from the <a href="https://github.com/asciimoo/searx">orgin searx project</a> and
|
||||
run it yourself!
|
||||
</p>
|
||||
<p>
|
||||
Add your searx instance to this <a href="{{ brand.PUBLIC_INSTANCES }}"> list
|
||||
of public searx instances</a> to help other people reclaim their privacy and
|
||||
make the Internet freer! The more decentralized the Internet is, the more
|
||||
freedom we have!
|
||||
</p>
|
||||
|
||||
<h2>Where are the docs & code of this instance?</h2>
|
||||
|
||||
<p>
|
||||
See the <a href="{{ brand.DOCS_URL }}">{{ brand.DOCS_URL }}</a>
|
||||
and <a href="{{ brand.GIT_URL }}">{{ brand.GIT_URL }}</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
{% include "__common__/aboutextend.html" ignore missing %}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<a href="https://github.com/asciimoo/searx" class="github">
|
||||
<img style="position: absolute; top: 0; right: 0; border: 0;" src="{{ url_for('static', filename='img/github_ribbon.png') }}" alt="Fork me on GitHub" class="github"/>
|
||||
</a>
|
||||
</a>
|
||||
|
|
|
@ -85,10 +85,10 @@
|
|||
{% endblock %}
|
||||
<p class="text-muted">
|
||||
<small>
|
||||
{{ _('Powered by') }} <a href="https://asciimoo.github.io/searx/">searx</a> - {{ searx_version }} - {{ _('a privacy-respecting, hackable metasearch engine') }}<br/>
|
||||
<a href="https://github.com/asciimoo/searx">{{ _('Source code') }}</a> |
|
||||
<a href="https://github.com/asciimoo/searx/issues">{{ _('Issue tracker') }}</a> |
|
||||
<a href="https://searx.space/">{{ _('Public instances') }}</a>
|
||||
{{ _('Powered by') }} <a href="{{ brand.DOCS_URL }}">searx</a> - {{ searx_version }} - {{ _('a privacy-respecting, hackable metasearch engine') }}<br/>
|
||||
<a href="{{ brand.GIT_URL }}">{{ _('Source code') }}</a> |
|
||||
<a href="{{ brand.ISSUE_URL }}">{{ _('Issue tracker') }}</a> |
|
||||
<a href="{{ brand.PUBLIC_INSTANCES }}">{{ _('Public instances') }}</a>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
<footer>
|
||||
<p>
|
||||
{{ _('Powered by') }} <a href="{{ url_for('about') }}">searx</a> - {{ searx_version }} - {{ _('a privacy-respecting, hackable metasearch engine') }}<br/>
|
||||
<a href="https://github.com/asciimoo/searx">{{ _('Source code') }}</a> |
|
||||
<a href="https://github.com/asciimoo/searx/issues">{{ _('Issue tracker') }}</a> |
|
||||
<a href="https://searx.space/">{{ _('Public instances') }}</a>
|
||||
<a href="{{ brand.GIT_URL }}">{{ _('Source code') }}</a> |
|
||||
<a href="{{ brand.ISSUE_URL }}">{{ _('Issue tracker') }}</a> |
|
||||
<a href="{{ brand.PUBLIC_INSTANCES }}">{{ _('Public instances') }}</a>
|
||||
</p>
|
||||
</footer>
|
||||
<!--[if gte IE 9]>-->
|
||||
|
|
76
searx/webapp.py
Normal file → Executable file
76
searx/webapp.py
Normal file → Executable file
|
@ -57,6 +57,7 @@ from babel.support import Translations
|
|||
import flask_babel
|
||||
from flask_babel import Babel, gettext, format_date, format_decimal
|
||||
from flask.json import jsonify
|
||||
from searx import brand
|
||||
from searx import settings, searx_dir, searx_debug
|
||||
from searx.exceptions import SearxParameterException
|
||||
from searx.engines import (
|
||||
|
@ -427,6 +428,8 @@ def render(template_name, override_theme=None, **kwargs):
|
|||
|
||||
kwargs['preferences'] = request.preferences
|
||||
|
||||
kwargs['brand'] = brand
|
||||
|
||||
kwargs['scripts'] = set()
|
||||
for plugin in request.user_plugins:
|
||||
for script in plugin.js_dependencies:
|
||||
|
@ -955,34 +958,51 @@ def clear_cookies():
|
|||
|
||||
@app.route('/config')
|
||||
def config():
|
||||
return jsonify({'categories': list(categories.keys()),
|
||||
'engines': [{'name': name,
|
||||
'categories': engine.categories,
|
||||
'shortcut': engine.shortcut,
|
||||
'enabled': not engine.disabled,
|
||||
'paging': engine.paging,
|
||||
'language_support': engine.language_support,
|
||||
'supported_languages':
|
||||
list(engine.supported_languages.keys())
|
||||
if isinstance(engine.supported_languages, dict)
|
||||
else engine.supported_languages,
|
||||
'safesearch': engine.safesearch,
|
||||
'time_range_support': engine.time_range_support,
|
||||
'timeout': engine.timeout}
|
||||
for name, engine in engines.items() if request.preferences.validate_token(engine)],
|
||||
'plugins': [{'name': plugin.name,
|
||||
'enabled': plugin.default_on}
|
||||
for plugin in plugins],
|
||||
'instance_name': settings['general']['instance_name'],
|
||||
'locales': settings['locales'],
|
||||
'default_locale': settings['ui']['default_locale'],
|
||||
'autocomplete': settings['search']['autocomplete'],
|
||||
'safe_search': settings['search']['safe_search'],
|
||||
'default_theme': settings['ui']['default_theme'],
|
||||
'version': VERSION_STRING,
|
||||
'doi_resolvers': [r for r in settings['doi_resolvers']],
|
||||
'default_doi_resolver': settings['default_doi_resolver'],
|
||||
})
|
||||
"""Return configuration in JSON format."""
|
||||
_engines = []
|
||||
for name, engine in engines.items():
|
||||
if not request.preferences.validate_token(engine):
|
||||
continue
|
||||
|
||||
supported_languages = engine.supported_languages
|
||||
if isinstance(engine.supported_languages, dict):
|
||||
supported_languages = list(engine.supported_languages.keys())
|
||||
|
||||
_engines.append({
|
||||
'name': name,
|
||||
'categories': engine.categories,
|
||||
'shortcut': engine.shortcut,
|
||||
'enabled': not engine.disabled,
|
||||
'paging': engine.paging,
|
||||
'language_support': engine.language_support,
|
||||
'supported_languages': supported_languages,
|
||||
'safesearch': engine.safesearch,
|
||||
'time_range_support': engine.time_range_support,
|
||||
'timeout': engine.timeout
|
||||
})
|
||||
|
||||
_plugins = []
|
||||
for _ in plugins:
|
||||
_plugins.append({'name': _.name, 'enabled': _.default_on})
|
||||
|
||||
return jsonify({
|
||||
'categories': list(categories.keys()),
|
||||
'engines': _engines,
|
||||
'plugins': _plugins,
|
||||
'instance_name': settings['general']['instance_name'],
|
||||
'locales': settings['locales'],
|
||||
'default_locale': settings['ui']['default_locale'],
|
||||
'autocomplete': settings['search']['autocomplete'],
|
||||
'safe_search': settings['search']['safe_search'],
|
||||
'default_theme': settings['ui']['default_theme'],
|
||||
'version': VERSION_STRING,
|
||||
'brand': {
|
||||
'GIT_URL': brand.GIT_URL,
|
||||
'DOCS_URL': brand.DOCS_URL
|
||||
},
|
||||
'doi_resolvers': [r for r in settings['doi_resolvers']],
|
||||
'default_doi_resolver': settings['default_doi_resolver'],
|
||||
})
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue