summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.rst22
-rw-r--r--docs/_themes/searxng/static/searxng.css2
-rw-r--r--docs/admin/engines/settings.rst14
-rw-r--r--docs/conf.py24
-rw-r--r--requirements-dev.txt6
-rw-r--r--requirements.txt2
-rw-r--r--searx/engines/zlibrary.py2
-rw-r--r--searx/plugins/limiter.py2
-rw-r--r--searx/preferences.py6
-rw-r--r--searx/search/processors/online.py5
-rw-r--r--searx/settings.yml2
-rw-r--r--searx/settings_defaults.py2
-rw-r--r--searx/templates/simple/base.html2
-rw-r--r--searx/templates/simple/preferences.html8
14 files changed, 59 insertions, 40 deletions
diff --git a/README.rst b/README.rst
index 2e0cd488b..4785eb79f 100644
--- a/README.rst
+++ b/README.rst
@@ -101,17 +101,25 @@ User experience
* engines are grouped inside each tab
* each engine has a description
-- it is easier to report a bug of an engine
-- but you can also disable the recording of the metrics on the server
+- thanks to the anonymous metrics, it is easier to report a bug of an engine and
+ thus engines get fixed more quickly
+
+ - if you don't want any metrics to be recorded, you can `disable them on the server
+ <https://docs.searxng.org/admin/engines/settings.html#general>`_
+
+- administrator can `block and/or replace the URLs in the search results
+ <https://github.com/searxng/searxng/blob/5c1c0817c3996c5670a545d05831d234d21e6217/searx/settings.yml#L191-L199>`_
Setup
-----
-- the Docker image is now also built for ARM64 and ARM/v7 architectures
- you don't need `Morty`_ to proxy the images even on a public instance
-- on the way to embed `Filtron`_ into SearXNG
-- up to date installation scripts
+- you don't need `Filtron`_ to block bots, we implemented the builtin `limiter`_
+- you get a well maintained `Docker image`_, now also built for ARM64 and ARM/v7 architectures
+- alternatively we have up to date installation scripts
+
+.. _Docker image: https://github.com/searxng/searxng-docker
Contributing is easier
@@ -125,6 +133,7 @@ Contributing is easier
.. _Morty: https://github.com/asciimoo/morty
.. _Filtron: https://github.com/searxng/filtron
+.. _limiter: https://docs.searxng.org/src/searx.plugins.limiter.html
.. _Weblate: https://weblate.bubu1.eu/projects/searxng/searxng/
.. _Development Quickstart: https://docs.searxng.org/dev/quickstart.html
@@ -142,4 +151,5 @@ https://weblate.bubu1.eu/projects/searxng/searxng/
Make a donation
===============
-You can support the SearXNG project by clicking on the donation page: `https://docs.searxng.org/donate.html <https://docs.searxng.org/donate.html>`_
+You can support the SearXNG project by clicking on the donation page:
+https://docs.searxng.org/donate.html
diff --git a/docs/_themes/searxng/static/searxng.css b/docs/_themes/searxng/static/searxng.css
index 1ab8489ec..a214bc9d1 100644
--- a/docs/_themes/searxng/static/searxng.css
+++ b/docs/_themes/searxng/static/searxng.css
@@ -40,7 +40,7 @@ p.sidebar-title, .sidebar p {
/* admonitions
*/
-div.admonition, div.topic, div.toctree-wrapper {
+div.admonition, div.topic, nav.contents, div.toctree-wrapper {
background-color: #fafafa;
margin: 8px 0px;
padding: 1em;
diff --git a/docs/admin/engines/settings.rst b/docs/admin/engines/settings.rst
index ac0d3b4cc..cd98c7af6 100644
--- a/docs/admin/engines/settings.rst
+++ b/docs/admin/engines/settings.rst
@@ -230,6 +230,7 @@ Global Settings
ui:
default_locale: ""
query_in_title: false
+ center_alignment: false
default_theme: simple
theme_args:
simple_style: auto
@@ -240,16 +241,21 @@ Global Settings
specific instance of searx, a locale can be defined using an ISO language
code, like ``fr``, ``en``, ``de``.
+``query_in_title`` :
+ When true, the result page's titles contains the query it decreases the
+ privacy, since the browser can records the page titles.
+
+``center_alignment`` : default ``false``
+ When enabled, the results are centered instead of being in the left (or RTL)
+ side of the screen. This setting only affects the *desktop layout*
+ (:origin:`min-width: @tablet <searx/static/themes/simple/src/less/definitions.less>`)
+
``default_theme`` :
Name of the theme you want to use by default on your SearXNG instance.
``theme_args.simple_style``:
Style of simple theme: ``auto``, ``light``, ``dark``
-``query_in_title`` :
- When true, the result page's titles contains the query it decreases the
- privacy, since the browser can records the page titles.
-
``results_on_new_tab``:
Open result links in a new tab by default.
diff --git a/docs/conf.py b/docs/conf.py
index e2bbd1285..44d1c2ad9 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -88,26 +88,26 @@ def setup(app):
extlinks = {}
# upstream links
-extlinks['wiki'] = ('https://github.com/searxng/searxng/wiki/%s', ' ')
-extlinks['pull'] = ('https://github.com/searxng/searxng/pull/%s', 'PR ')
-extlinks['pull-searx'] = ('https://github.com/searx/searx/pull/%s', 'PR ')
+extlinks['wiki'] = ('https://github.com/searxng/searxng/wiki/%s', ' %s')
+extlinks['pull'] = ('https://github.com/searxng/searxng/pull/%s', 'PR %s')
+extlinks['pull-searx'] = ('https://github.com/searx/searx/pull/%s', 'PR %s')
# links to custom brand
-extlinks['origin'] = (GIT_URL + '/blob/' + GIT_BRANCH + '/%s', 'git://')
-extlinks['patch'] = (GIT_URL + '/commit/%s', '#')
-extlinks['docs'] = (DOCS_URL + '/%s', 'docs: ')
-extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ')
-extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '')
+extlinks['origin'] = (GIT_URL + '/blob/' + GIT_BRANCH + '/%s', 'git://%s')
+extlinks['patch'] = (GIT_URL + '/commit/%s', '#%s')
+extlinks['docs'] = (DOCS_URL + '/%s', 'docs: %s')
+extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: %s')
+extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '%s')
#extlinks['role'] = (
# 'https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-%s', '')
extlinks['duref'] = (
- 'https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#%s', '')
+ 'https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#%s', '%s')
extlinks['durole'] = (
- 'https://docutils.sourceforge.io/docs/ref/rst/roles.html#%s', '')
+ 'https://docutils.sourceforge.io/docs/ref/rst/roles.html#%s', '%s')
extlinks['dudir'] = (
- 'https://docutils.sourceforge.io/docs/ref/rst/directives.html#%s', '')
+ 'https://docutils.sourceforge.io/docs/ref/rst/directives.html#%s', '%s')
extlinks['ctan'] = (
- 'https://ctan.org/pkg/%s', 'CTAN: ')
+ 'https://ctan.org/pkg/%s', 'CTAN: %s')
extensions = [
'sphinx.ext.imgmath',
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 6c850f41e..ec30fdc01 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -8,10 +8,10 @@ splinter==0.18.1
selenium==4.3.0
twine==4.0.1
Pallets-Sphinx-Themes==2.0.2
-Sphinx==4.5.0
+Sphinx==5.0.2
sphinx-issues==3.0.1
-sphinx-jinja==2.0.1
-sphinx-tabs==3.3.1
+sphinx-jinja==2.0.2
+sphinx-tabs==3.4.1
sphinxcontrib-programoutput==0.17
sphinx-autobuild==2021.3.14
sphinx-notfound-page==0.8
diff --git a/requirements.txt b/requirements.txt
index f5939523a..3139cc64a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,7 +3,7 @@ babel==2.10.3
flask-babel==2.0.0
flask==2.1.2
jinja2==3.1.2
-lxml==4.9.0
+lxml==4.9.1
pygments==2.12.0
python-dateutil==2.8.2
pyyaml==6.0
diff --git a/searx/engines/zlibrary.py b/searx/engines/zlibrary.py
index 81d93ac84..7778f69b6 100644
--- a/searx/engines/zlibrary.py
+++ b/searx/engines/zlibrary.py
@@ -39,7 +39,7 @@ def init(engine_settings=None):
resp = http_get('https://z-lib.org', timeout=5.0)
if resp.ok:
dom = html.fromstring(resp.text)
- base_url = "https:" + extract_text(
+ base_url = extract_text(
eval_xpath(dom, './/a[contains(@class, "domain-check-link") and @data-mode="books"]/@href')
)
logger.debug("using base_url: %s" % base_url)
diff --git a/searx/plugins/limiter.py b/searx/plugins/limiter.py
index bdaeeea69..c9aa36265 100644
--- a/searx/plugins/limiter.py
+++ b/searx/plugins/limiter.py
@@ -85,7 +85,7 @@ def is_accepted_request() -> bool:
def pre_request():
if not is_accepted_request():
- return '', 429
+ return 'Too Many Requests', 429
return None
diff --git a/searx/preferences.py b/searx/preferences.py
index a7ecac55e..fdb4f5008 100644
--- a/searx/preferences.py
+++ b/searx/preferences.py
@@ -365,9 +365,9 @@ class Preferences:
locked=is_locked('simple_style'),
choices=['', 'auto', 'light', 'dark']
),
- 'center_aligment': MapSetting(
- settings['ui']['center_aligment'],
- locked=is_locked('center_aligment'),
+ 'center_alignment': MapSetting(
+ settings['ui']['center_alignment'],
+ locked=is_locked('center_alignment'),
map={
'0': False,
'1': True,
diff --git a/searx/search/processors/online.py b/searx/search/processors/online.py
index f8fbcf40c..0cfe6e123 100644
--- a/searx/search/processors/online.py
+++ b/searx/search/processors/online.py
@@ -163,7 +163,10 @@ class OnlineProcessor(EngineProcessor):
self.logger.exception('CAPTCHA')
except SearxEngineTooManyRequestsException as e:
if "google" in self.engine_name:
- self.logger.warn("We recommend enabling the use_mobile_ui parameter if google is blocked for you.")
+ self.logger.warn(
+ "Set to 'true' the use_mobile_ui parameter in the 'engines:'"
+ " section of your settings.yml file if google is blocked for you."
+ )
self.handle_exception(result_container, e, suspend=True)
self.logger.exception('Too many requests')
except SearxEngineAccessDeniedException as e:
diff --git a/searx/settings.yml b/searx/settings.yml
index a8ec798e7..7bbdda85e 100644
--- a/searx/settings.yml
+++ b/searx/settings.yml
@@ -92,7 +92,7 @@ ui:
# ui theme
default_theme: simple
# center the results ?
- center_aligment: false
+ center_alignment: false
# Default interface locale - leave blank to detect from browser information or
# use codes from the 'locales' config section
default_locale: ""
diff --git a/searx/settings_defaults.py b/searx/settings_defaults.py
index bb4707cc4..3185dd7bd 100644
--- a/searx/settings_defaults.py
+++ b/searx/settings_defaults.py
@@ -185,7 +185,7 @@ SCHEMA = {
'theme_args': {
'simple_style': SettingsValue(SIMPLE_STYLE, 'auto'),
},
- 'center_aligment': SettingsValue(bool, False),
+ 'center_alignment': SettingsValue(bool, False),
'results_on_new_tab': SettingsValue(bool, False),
'advanced_search': SettingsValue(bool, False),
'query_in_title': SettingsValue(bool, False),
diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html
index d1d3d8fe5..a2464a1a5 100644
--- a/searx/templates/simple/base.html
+++ b/searx/templates/simple/base.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html class="no-js theme-{{ preferences.get_value('simple_style') or 'auto' }} center-aligment-{{ preferences.get_value('center_aligment') and 'yes' or 'no' }}" lang="{{ locale_rfc5646 }}" {% if rtl %} dir="rtl"{% endif %}>
+<html class="no-js theme-{{ preferences.get_value('simple_style') or 'auto' }} center-aligment-{{ preferences.get_value('center_alignment') and 'yes' or 'no' }}" lang="{{ locale_rfc5646 }}" {% if rtl %} dir="rtl"{% endif %}>
<head>
<meta charset="UTF-8" />
<meta name="description" content="SearXNG — a privacy-respecting, hackable metasearch engine">
diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html
index aa0e65e28..8ee0a02c7 100644
--- a/searx/templates/simple/preferences.html
+++ b/searx/templates/simple/preferences.html
@@ -214,11 +214,11 @@
<div class="description">{{ _('Choose auto to follow your browser settings') }}</div>
</fieldset>
<fieldset>
- <legend id="pref_center_aligment">{{ _('Center Alignment') }}</legend>
+ <legend id="pref_center_alignment">{{ _('Center Alignment') }}</legend>
<p class="value">
- <select name="center_aligment" aria-labelledby="pref_center_aligment">
- <option value="1" {% if preferences.get_value('center_aligment') %}selected="selected"{% endif %}>{{ _('On') }}</option>
- <option value="0" {% if not preferences.get_value('center_aligment') %}selected="selected"{% endif %}>{{ _('Off')}}</option>
+ <select name="center_alignment" aria-labelledby="pref_center_alignment">
+ <option value="1" {% if preferences.get_value('center_alignment') %}selected="selected"{% endif %}>{{ _('On') }}</option>
+ <option value="0" {% if not preferences.get_value('center_alignment') %}selected="selected"{% endif %}>{{ _('Off')}}</option>
</select>
</p>
<div class="description">{{ _('Displays results in the center of the page (Oscar layout).') }}</div>