on master help sign in
Merge branch 'master' into gigablast
8d318eeMarkus Heiser
README.rst+53−43
@@ -1,63 +1,73 @@
1−searx
1+.. SPDX-License-Identifier: AGPL-3.0-or-later
2−=====
2+
3+.. figure:: https://raw.githubusercontent.com/asciimoo/searx/master/searx/static/themes/oscar/img/logo_searx_a.png
4+ :target: https://asciimoo.github.io/searx/
5+ :alt: searX
6+ :width: 100%
7+ :align: center
8+
9+-------
10+
11+|searx install|
12+|searx homepage|
13+|searx wiki|
14+|AGPL License|
15+|Issues|
16+|commits|
17+|OpenCollective searx backers|
18+|OpenCollective searx sponsors|
3
19
4−A privacy-respecting, hackable `metasearch
20+Privacy-respecting, hackable `metasearch engine`_ / *pronunciation* **səːks**.
5−engine <https://en.wikipedia.org/wiki/Metasearch_engine>`__.
6
21
7−Pronunciation: səːks
22+.. _metasearch engine: https://en.wikipedia.org/wiki/Metasearch_engine
8
23
9−List of `running
24+.. |searx install| image:: https://img.shields.io/badge/-install-blue
10−instances <https://searx.space/>`__.
25+ :target: https://asciimoo.github.io/searx/admin/installation.html
11
26
12−See the `documentation <https://asciimoo.github.io/searx>`__ and the `wiki <https://github.com/asciimoo/searx/wiki>`__ for more information.
27+.. |searx homepage| image:: https://img.shields.io/badge/-homepage-blue
28+ :target: https://asciimoo.github.io/searx
13
29
14−|OpenCollective searx backers|
30+.. |searx wiki| image:: https://img.shields.io/badge/-wiki-blue
15−|OpenCollective searx sponsors|
31+ :target: https://github.com/asciimoo/searx/wiki
16
32
17−Installation
33+.. |AGPL License| image:: https://img.shields.io/badge/license-AGPL-blue.svg
18−~~~~~~~~~~~~
34+ :target: https://github.com/asciimoo/searx/blob/master/LICENSE
19
35
20−With Docker
36+.. |Issues| image:: https://img.shields.io/github/issues/asciimoo/searx?color=yellow&label=issues
21−-----------
37+ :target: https://github.com/asciimoo/searx/issues
22−Go to the `searx-docker <https://github.com/searx/searx-docker>`__ project.
23
38
24−Without Docker
39+.. |PR| image:: https://img.shields.io/github/issues-pr-raw/asciimoo/searx?color=yellow&label=PR
25−--------------
40+ :target: https://github.com/asciimoo/searx/pulls
26−For all of the details, follow this `step by step installation <https://asciimoo.github.io/searx/admin/installation.html>`__.
27
41
28−Note: the documentation needs to be updated.
42+.. |commits| image:: https://img.shields.io/github/commit-activity/y/asciimoo/searx?color=yellow&label=commits
43+ :target: https://github.com/asciimoo/searx/commits/master
29
44
30−If you are in a hurry
45+.. |OpenCollective searx backers| image:: https://opencollective.com/searx/backers/badge.svg
31−---------------------
46+ :target: https://opencollective.com/searx#backer
32−- clone the source:
33− ``git clone https://github.com/asciimoo/searx.git && cd searx``
34−- install dependencies: ``./manage.sh update_packages``
35−- edit your
36− `settings.yml <https://github.com/asciimoo/searx/blob/master/searx/settings.yml>`__
37− (set your ``secret_key``!)
38−- run ``python searx/webapp.py`` to start the application
39
47
48+.. |OpenCollective searx sponsors| image:: https://opencollective.com/searx/sponsors/badge.svg
49+ :target: https://opencollective.com/searx#sponsor
40
50
41−Bugs
42−~~~~
43
51
44−Bugs or suggestions? Visit the `issue
52+If you are looking for running instances, ready to use, then visit searx.space_.
45−tracker <https://github.com/asciimoo/searx/issues>`__.
46
53
47−`License <https://github.com/asciimoo/searx/blob/master/LICENSE>`__
54+Otherwise jump to the user_, admin_ and developer_ handbooks you will find on
48−~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55+our homepage_.
49
56
50−More about searx
57+.. _searx.space: https://searx.space
51−~~~~~~~~~~~~~~~~
58+.. _user: https://asciimoo.github.io/searx/user
59+.. _admin: https://asciimoo.github.io/searx/admin
60+.. _developer: https://asciimoo.github.io/searx/dev
61+.. _homepage: https://asciimoo.github.io/searx
52
62
53−- `openhub <https://www.openhub.net/p/searx/>`__
63+contact:
54−- `twitter <https://twitter.com/Searx_engine>`__
55−- IRC: #searx @ freenode
64+ openhub_ // twitter_ // IRC: #searx @ freenode
56
65
66+.. _openhub: https://www.openhub.net/p/searx
67+.. _twitter: https://twitter.com/Searx_engine
57
68
58−.. |OpenCollective searx backers| image:: https://opencollective.com/searx/backers/badge.svg
69+-------
59− :target: https://opencollective.com/searx#backer
60
70
71+|gluten free|
61
72
62−.. |OpenCollective searx sponsors| image:: https://opencollective.com/searx/sponsors/badge.svg
73+.. |gluten free| image:: https://forthebadge.com/images/featured/featured-gluten-free.svg
63− :target: https://opencollective.com/searx#sponsor
docs/admin/installation-uwsgi.rst+6−5
@@ -108,6 +108,7 @@ restart the uwsgi application.
108 :start-after: START searx uwsgi-description ubuntu-20.04
108 :start-after: START searx uwsgi-description ubuntu-20.04
109 :end-before: END searx uwsgi-description ubuntu-20.04
109 :end-before: END searx uwsgi-description ubuntu-20.04
110
110
111+ .. hotfix: a bug group-tab need this comment
111
112
112 .. group-tab:: Arch Linux
113 .. group-tab:: Arch Linux
113
114
@@ -115,6 +116,7 @@ restart the uwsgi application.
115 :start-after: START searx uwsgi-description arch
116 :start-after: START searx uwsgi-description arch
116 :end-before: END searx uwsgi-description arch
117 :end-before: END searx uwsgi-description arch
117
118
119+ .. hotfix: a bug group-tab need this comment
118
120
119 .. group-tab:: Fedora / RHEL
121 .. group-tab:: Fedora / RHEL
120
122
@@ -128,22 +130,21 @@ restart the uwsgi application.
128 .. group-tab:: Ubuntu / debian
130 .. group-tab:: Ubuntu / debian
129
131
130 .. kernel-include:: $DOCS_BUILD/includes/searx.rst
132 .. kernel-include:: $DOCS_BUILD/includes/searx.rst
131− :code: ini
132 :start-after: START searx uwsgi-appini ubuntu-20.04
133 :start-after: START searx uwsgi-appini ubuntu-20.04
133 :end-before: END searx uwsgi-appini ubuntu-20.04
134 :end-before: END searx uwsgi-appini ubuntu-20.04
134
135
136+ .. hotfix: a bug group-tab need this comment
137+
135 .. group-tab:: Arch Linux
138 .. group-tab:: Arch Linux
136
139
137 .. kernel-include:: $DOCS_BUILD/includes/searx.rst
140 .. kernel-include:: $DOCS_BUILD/includes/searx.rst
138− :code: ini
139 :start-after: START searx uwsgi-appini arch
141 :start-after: START searx uwsgi-appini arch
140 :end-before: END searx uwsgi-appini arch
142 :end-before: END searx uwsgi-appini arch
141
143
144+ .. hotfix: a bug group-tab need this comment
145+
142 .. group-tab:: Fedora / RHEL
146 .. group-tab:: Fedora / RHEL
143
147
144 .. kernel-include:: $DOCS_BUILD/includes/searx.rst
148 .. kernel-include:: $DOCS_BUILD/includes/searx.rst
145− :code: ini
146 :start-after: START searx uwsgi-appini fedora
149 :start-after: START searx uwsgi-appini fedora
147 :end-before: END searx uwsgi-appini fedora
150 :end-before: END searx uwsgi-appini fedora
148−
149−
docs/blog/index.rst+1
@@ -6,6 +6,7 @@ Blog
6 :maxdepth: 2
6 :maxdepth: 2
7 :caption: Contents
7 :caption: Contents
8
8
9+ lxcdev-202006
9 python3
10 python3
10 admin
11 admin
11 intro-offline
12 intro-offline
docs/blog/lxcdev-202006.rstnew file+413
@@ -0,0 +1,413 @@
1+.. _blog-lxcdev-202006:
2+
3+=======================================
4+Developing in Linux containers [202006]
5+=======================================
6+
7+.. _LXC: https://linuxcontainers.org/lxc/introduction/
8+
9+.. sidebar:: Audience
10+
11+ This blog post is written for experienced admins and developers / readers
12+ should have a serious meaning about: *distributed*, *merge* and *linux
13+ container*.
14+
15+.. contents:: Contents
16+ :depth: 2
17+ :local:
18+ :backlinks: entry
19+
20+In PR :PR:`1803` we added a lot of scripts to Searx's boilerplate. In this blog
21+post I will show you, how you can make use of them in *distributed and
22+heterogeneous development cycles* (TL;DR; jump to the :ref:`blog-lxcdev-202006
23+abstract`).
24+
25+Motivation
26+==========
27+
28+Normally in our development cycle, we edit the sources and run some test and/or
29+builds by using ``make`` before we commit. This cycle is simple and perfect but
30+might fail in some aspects we should not overlook.
31+
32+ The environment in which we run all our development processes matters!
33+
34+The :ref:`makefile` and the :ref:`make pyenv` encapsulate a lot for us, but they
35+do not have access to all prerequisites. For example, there may have
36+dependencies on packages that are installed on the developer's desktop, but
37+usually are not preinstalled on a server or client system. Another examples
38+are; settings have been made to the software on the developer's host that would
39+never be set on a *production* system.
40+
41+*Linux Containers* (LXC_) are isolate environments and not to mix up on
42+developer's all the prerequisites of all the projects he contribute to, is
43+always a good choice.
44+
45+The scripts from PR :PR:`1803` can divide in those to install and maintain
46+software:
47+
48+- :ref:`searx.sh`
49+- :ref:`filtron.sh`
50+- :ref:`morty.sh`
51+
52+and the script :ref:`lxc.sh`, with we can scale our installation, maintenance or
53+even development tasks over a stack of containers, what we call: *Searx's lxc
54+suite*.
55+
56+Gentlemen, start your engines!
57+==============================
58+
59+.. _LXD: https://linuxcontainers.org/lxd/introduction/
60+.. _archlinux: https://www.archlinux.org/
61+
62+Before you can start with containers, you need to install and initiate LXD_
63+once:
64+
65+.. tabs::
66+
67+ .. group-tab:: desktop
68+
69+ .. code:: sh
70+
71+ $ snap install lxd
72+ $ lxd init --auto
73+
74+And you need to clone from origin or if you have your own fork, clone from your
75+fork:
76+
77+.. tabs::
78+
79+ .. group-tab:: desktop
80+
81+ .. code:: sh
82+
83+ $ cd ~/Downloads
84+ $ git clone https://github.com/asciimoo/searx.git
85+ $ cd searx
86+
87+The :ref:`lxc-searx.env` consists of several images, see ``export
88+LXC_SUITE=(...`` near by :origin:`utils/lxc-searx.env#L19`. For this blog post
89+we exercise on a archlinux_ image. The container of this image is named
90+``searx-archlinux``. Lets build the container, but be sure that this container
91+does not already exists, so first lets remove possible old one:
92+
93+.. tabs::
94+
95+ .. group-tab:: desktop
96+
97+ .. code:: sh
98+
99+ $ sudo -H ./utils/lxc.sh remove searx-archlinux
100+ $ sudo -H ./utils/lxc.sh build searx-archlinux
101+
102+.. sidebar:: The ``searx-archlinux`` container
103+
104+ is the base of all our exercises here.
105+
106+In this container we install all services :ref:`including searx, morty & filtron
107+<lxc.sh install suite>` in once:
108+
109+.. tabs::
110+
111+ .. group-tab:: desktop
112+
113+ .. code:: sh
114+
115+ $ sudo -H ./utils/lxc.sh install suite searx-archlinux
116+
117+To proxy HTTP from filtron and morty in the container to the outside of the
118+container, install nginx into the container. Once for the bot blocker filtron:
119+
120+.. tabs::
121+
122+ .. group-tab:: desktop
123+
124+ .. code:: sh
125+
126+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux \
127+ ./utils/filtron.sh nginx install
128+ ...
129+ INFO: got 429 from http://10.174.184.156/searx
130+
131+and once for the content sanitizer (content proxy morty):
132+
133+.. tabs::
134+
135+ .. group-tab:: desktop
136+
137+ .. code:: sh
138+
139+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux \
140+ ./utils/morty.sh nginx install
141+ ...
142+ INFO: got 200 from http://10.174.184.156/morty/
143+
144+.. sidebar:: Fully functional searx suite
145+
146+ From here on you have a fully functional searx suite running with bot blocker
147+ (filtron) and Web content sanitizer (content proxy morty) needed for a
148+ *privacy protecting* search engine.
149+
150+On your system, the IP of your ``searx-archlinux`` container differs from
151+http://10.174.184.156/searx, just open the URL reported in your installation
152+protocol in your WEB browser from the desktop to test the instance from outside
153+of the container.
154+
155+In such a searx suite admins can maintain and access the debug log of the
156+different services quite easy.
157+
158+.. _working in containers:
159+
160+In containers, work as usual
161+============================
162+
163+Usually you open a root-bash using ``sudo -H bash``. In case of LXC containers
164+open the root-bash in the container using ``./utils/lxc.sh cmd
165+searx-archlinux``:
166+
167+.. tabs::
168+
169+ .. group-tab:: desktop
170+
171+ .. code:: sh
172+
173+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux bash
174+ INFO: [searx-archlinux] bash
175+ [root@searx-archlinux searx]# pwd
176+ /share/searx
177+
178+The prompt ``[root@searx-archlinux ...]`` signals, that you are the root user in
179+the searx-container. To debug the running searx instance use:
180+
181+.. tabs::
182+
183+ .. group-tab:: root@searx-archlinux
184+
185+ .. code:: sh
186+
187+ $ ./utils/searx.sh inspect service
188+ ...
189+ use [CTRL-C] to stop monitoring the log
190+ ...
191+
192+Back in the browser on your desktop open the service http://10.174.184.156/searx
193+and run your application tests while the debug log is shown in the terminal from
194+above. You can stop monitoring using ``CTRL-C``, this also disables the *"debug
195+option"* in searx's settings file and restarts the searx uwsgi application. To
196+debug services from filtron and morty analogous use:
197+
198+.. tabs::
199+
200+ .. group-tab:: root@searx-archlinux
201+
202+ .. code:: sh
203+
204+ $ ./utils/filtron.sh inspect service
205+ $ ./utils/morty.sh inspect service
206+
207+Another point we have to notice is that each service (:ref:`searx <searx.sh>`,
208+:ref:`filtron <filtron.sh>` and :ref:`morty <morty.sh>`) runs under dedicated
209+system user account with the same name (compare :ref:`create searx user`). To
210+get a shell from theses accounts, simply call one of the scripts:
211+
212+.. tabs::
213+
214+ .. group-tab:: root@searx-archlinux
215+
216+ .. code:: sh
217+
218+ $ ./utils/searx.sh shell
219+ $ ./utils/filtron.sh shell
220+ $ ./utils/morty.sh shell
221+
222+To get in touch, open a shell from the service user (searx@searx-archlinux):
223+
224+.. tabs::
225+
226+ .. group-tab:: desktop
227+
228+ .. code:: sh
229+
230+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux \
231+ ./utils/searx.sh shell
232+ // exit with [CTRL-D]
233+ (searx-pyenv) [searx@searx-archlinux ~]$ ...
234+
235+The prompt ``[searx@searx-archlinux]`` signals that you are logged in as system
236+user ``searx`` in the ``searx-archlinux`` container and the python *virtualenv*
237+``(searx-pyenv)`` environment is activated.
238+
239+.. tabs::
240+
241+ .. group-tab:: searx@searx-archlinux
242+
243+ .. code:: sh
244+
245+ (searx-pyenv) [searx@searx-archlinux ~]$ pwd
246+ /usr/local/searx
247+
248+
249+
250+Wrap production into developer suite
251+====================================
252+
253+In this section we will see how to change the *"Fully functional searx suite"*
254+from a LXC container (which is quite ready for production) into a developer
255+suite. For this, we have to keep an eye on the :ref:`installation basic`:
256+
257+- searx setup in: ``/etc/searx/settings.yml``
258+- searx user's home: ``/usr/local/searx``
259+- virtualenv in: ``/usr/local/searx/searx-pyenv``
260+- searx software in: ``/usr/local/searx/searx-src``
261+
262+The searx software is a clone of the ``GIT_URL`` (see :ref:`makefile setup`) and
263+the working tree is checked out from the ``GIT_BRANCH``. With the use of the
264+:ref:`searx.sh` the searx service was installed as :ref:`uWSGI application
265+<searx uwsgi>`. To maintain this service, we can use ``systemctl`` (compare
266+:ref:`service architectures on distributions <uwsgi configuration>`).
267+
268+.. tabs::
269+
270+ .. group-tab:: desktop
271+
272+ .. code:: sh
273+
274+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux \
275+ systemctl stop uwsgi@searx
276+
277+With the command above, we stopped the searx uWSGI-App in the archlinux
278+container.
279+
280+The uWSGI-App for the archlinux dsitros is configured in
281+:origin:`utils/templates/etc/uwsgi/apps-archlinux/searx.ini`, from where at
282+least you should attend the settings of ``uid``, ``chdir``, ``env`` and
283+``http``::
284+
285+ env = SEARX_SETTINGS_PATH=/etc/searx/settings.yml
286+ http = 127.0.0.1:8888
287+
288+ chdir = /usr/local/searx/searx-src/searx
289+ virtualenv = /usr/local/searx/searx-pyenv
290+ pythonpath = /usr/local/searx/searx-src
291+
292+If you have read the :ref:`"Good to know section" <lxc.sh>` you remember, that
293+each container shares the root folder of the repository and the command
294+``utils/lxc.sh cmd`` handles relative path names **transparent**. To wrap the
295+searx installation into a developer one, we simple have to create a smylink to
296+the **transparent** reposetory from the desktop. Now lets replace the
297+repository at ``searx-src`` in the container with the working tree from outside
298+of the container:
299+
300+.. tabs::
301+
302+ .. group-tab:: container becomes a developer suite
303+
304+ .. code:: sh
305+
306+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux \
307+ mv /usr/local/searx/searx-src /usr/local/searx/searx-src.old
308+
309+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux \
310+ ln -s /share/searx/ /usr/local/searx/searx-src
311+
312+Now we can develop as usual in the working tree of our desktop system. Every
313+time the software was changed, you have to restart the searx service (in the
314+conatiner):
315+
316+.. tabs::
317+
318+ .. group-tab:: desktop
319+
320+ .. code:: sh
321+
322+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux \
323+ systemctl restart uwsgi@searx
324+
325+
326+Remember: :ref:`working in containers` .. here are just some examples from my
327+daily usage:
328+
329+.. tabs::
330+
331+ .. group-tab:: desktop
332+
333+ To *inspect* the searx instance (already described above):
334+
335+ .. code:: sh
336+
337+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux \
338+ ./utils/searx.sh inspect service
339+
340+ Run :ref:`makefile`, e.g. to test inside the container:
341+
342+ .. code:: sh
343+
344+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux \
345+ make test
346+
347+ To install all prerequisites needed for a :ref:`buildhosts`:
348+
349+ .. code:: sh
350+
351+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux \
352+ ./utils/searx.sh install buildhost
353+
354+ To build the docs on a buildhost :ref:`buildhosts`:
355+
356+ .. code:: sh
357+
358+ $ sudo -H ./utils/lxc.sh cmd searx-archlinux \
359+ make docs
360+
361+.. _blog-lxcdev-202006 abstract:
362+
363+Abstract
364+========
365+
366+We build up a fully functional searx suite in a archlinux container:
367+
368+.. code:: sh
369+
370+ $ sudo -H ./utils/lxc.sh install suite searx-archlinux
371+
372+To access HTTP from the desktop we installed nginx for the services inside the
373+conatiner:
374+
375+.. tabs::
376+
377+ .. group-tab:: [root@searx-archlinux]
378+
379+ .. code:: sh
380+
381+ $ ./utils/filtron.sh nginx install
382+ $ ./utils/morty.sh nginx install
383+
384+To wrap the suite into a developer one, we created a symbolic link to the
385+repository which is shared **transparent** from the desktop's file system into
386+the container :
387+
388+.. tabs::
389+
390+ .. group-tab:: [root@searx-archlinux]
391+
392+ .. code:: sh
393+
394+ $ mv /usr/local/searx/searx-src /usr/local/searx/searx-src.old
395+ $ ln -s /share/searx/ /usr/local/searx/searx-src
396+ $ systemctl restart uwsgi@searx
397+
398+To get remarks from the suite of the archlinux container we can use:
399+
400+.. tabs::
401+
402+ .. group-tab:: desktop
403+
404+ .. code:: sh
405+
406+ $ sudo -H ./utils/lxc.sh show suite searx-archlinux
407+ ...
408+ [searx-archlinux] INFO: (eth0) filtron: http://10.174.184.156:4004/ http://10.174.184.156/searx
409+ [searx-archlinux] INFO: (eth0) morty: http://10.174.184.156:3000/
410+ [searx-archlinux] INFO: (eth0) docs-live: http://10.174.184.156:8080/
411+ [searx-archlinux] INFO: (eth0) IPv6: http://[fd42:573b:e0b3:e97e:216:3eff:fea5:9b65]
412+ ...
413+
docs/blog/private-engines.rst+1−1
@@ -13,7 +13,7 @@ Private engines
13To solve this issue private engines were introduced in :pull:`1823`.
13To solve this issue private engines were introduced in :pull:`1823`.
14A new option was added to engines named `tokens`. It expects a list
14A new option was added to engines named `tokens`. It expects a list
15of strings. If the user making a request presents one of the tokens
15of strings. If the user making a request presents one of the tokens
16−of an engine, he/she is able to access information about the engine
16+of an engine, they can access information about the engine
17and make search requests.
17and make search requests.
18
18
19Example configuration to restrict access to the Arch Linux Wiki engine:
19Example configuration to restrict access to the Arch Linux Wiki engine:
docs/dev/search_api.rst+2−2
@@ -81,7 +81,7 @@ Parameters
81 Theme of instance.
81 Theme of instance.
82
82
83 Please note, available themes depend on an instance. It is possible that an
83 Please note, available themes depend on an instance. It is possible that an
84− instance administrator deleted, created or renamed themes on his/her instance.
84+ instance administrator deleted, created or renamed themes on their instance.
85 See the available options in the preferences page of the instance.
85 See the available options in the preferences page of the instance.
86
86
87``oscar-style`` : default ``logicodev``
87``oscar-style`` : default ``logicodev``
@@ -91,7 +91,7 @@ Parameters
91 ``oscar``.
91 ``oscar``.
92
92
93 Please note, available styles depend on an instance. It is possible that an
93 Please note, available styles depend on an instance. It is possible that an
94− instance administrator deleted, created or renamed styles on his/her
94+ instance administrator deleted, created or renamed styles on their
95 instance. See the available options in the preferences page of the instance.
95 instance. See the available options in the preferences page of the instance.
96
96
97``enabled_plugins`` : optional
97``enabled_plugins`` : optional
docs/user/own-instance.rst+2−2
@@ -44,9 +44,9 @@ hidden from visited result pages.
44What are the consequences of using public instances?
44What are the consequences of using public instances?
45----------------------------------------------------
45----------------------------------------------------
46
46
47−If someone uses a public instance, he/she has to trust the administrator of that
47+If someone uses a public instance, they have to trust the administrator of that
48instance. This means that the user of the public instance does not know whether
48instance. This means that the user of the public instance does not know whether
49−his/her requests are logged, aggregated and sent or sold to a third party.
49+their requests are logged, aggregated and sent or sold to a third party.
50
50
51Also, public instances without proper protection are more vulnerable to abusing
51Also, public instances without proper protection are more vulnerable to abusing
52the search service, In this case the external service in exchange returns
52the search service, In this case the external service in exchange returns
docs/utils/lxc.sh.rst+4−3
@@ -47,9 +47,9 @@ one**::
47
47
48*Good to know ...*
48*Good to know ...*
49
49
50−Eeach container shares the root folder of the repository and the
50+Each container shares the root folder of the repository and the command
51−command ``utils/lxc.sh cmd`` **handles relative path names transparent**,
51+``utils/lxc.sh cmd`` **handles relative path names transparent**, compare output
52−compare output of::
52+of::
53
53
54 $ sudo -H ./utils/lxc.sh cmd -- ls -la Makefile
54 $ sudo -H ./utils/lxc.sh cmd -- ls -la Makefile
55 ...
55 ...
@@ -66,6 +66,7 @@ If there comes the time you want to **get rid off all** the containers and
66 $ sudo -H ./utils/lxc.sh remove
66 $ sudo -H ./utils/lxc.sh remove
67 $ sudo -H ./utils/lxc.sh remove images
67 $ sudo -H ./utils/lxc.sh remove images
68
68
69+.. _lxc.sh install suite:
69
70
70Install suite
71Install suite
71=============
72=============
searx/engines/duckduckgo.py+6
@@ -50,6 +50,7 @@ result_xpath = '//div[@class="result results_links results_links_deep web-result
50url_xpath = './/a[@class="result__a"]/@href'
50url_xpath = './/a[@class="result__a"]/@href'
51title_xpath = './/a[@class="result__a"]'
51title_xpath = './/a[@class="result__a"]'
52content_xpath = './/a[@class="result__snippet"]'
52content_xpath = './/a[@class="result__snippet"]'
53+correction_xpath = '//div[@id="did_you_mean"]//a'
53
54
54
55
55# match query's language to a region code that duckduckgo will accept
56# match query's language to a region code that duckduckgo will accept
@@ -125,6 +126,11 @@ def response(resp):
125 'content': content,
126 'content': content,
126 'url': res_url})
127 'url': res_url})
127
128
129+ # parse correction
130+ for correction in eval_xpath(doc, correction_xpath):
131+ # append correction
132+ results.append({'correction': extract_text(correction)})
133+
128 # return results
134 # return results
129 return results
135 return results
130
136
searx/engines/yacy.py+1−1
@@ -75,7 +75,7 @@ def response(resp):
75
75
76 for result in search_results[0].get('items', []):
76 for result in search_results[0].get('items', []):
77 # parse image results
77 # parse image results
78− if result.get('image'):
78+ if result.get('image') and result.get('width') and result.get('height'):
79
79
80 result_url = ''
80 result_url = ''
81 if 'url' in result:
81 if 'url' in result:
searx/templates/__common__/about.html+9−5
@@ -59,12 +59,16 @@
59
59
60 <h2 id='add to browser'>How to set as the default search engine?</h2>
60 <h2 id='add to browser'>How to set as the default search engine?</h2>
61
61
62− <dt>Firefox</dt>
62+ <p>
63+ Searx supports <a href="https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md">OpenSearch</a>.
64+ For more information on changing your default search engine, see your browser's documentation:
65+ </p>
63
66
64− <dd>
67+ <ul>
65− <a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a>
68+ <li><a href="https://support.mozilla.org/en-US/kb/add-or-remove-search-engine-firefox">Firefox</a></li>
66− searx as a search engine on any version of Firefox! (javascript required)
69+ <li><a href="https://support.microsoft.com/en-us/help/4028574/microsoft-edge-change-the-default-search-engine" >Microsoft Egde</a></li>
67− </dd>
70+ <li>Chrome based browsers <a href="https://www.chromium.org/tab-to-search">only add websites that the user navigates to without a path.</a>
71+ </ul>
68
72
69 <h2>Where to find anonymous usage statistics of this instance ?</h2>
73 <h2>Where to find anonymous usage statistics of this instance ?</h2>
70
74
searx/templates/oscar/base.html+2−2
@@ -8,7 +8,7 @@
8 <meta http-equiv="X-UA-Compatible" content="IE=edge">
8 <meta http-equiv="X-UA-Compatible" content="IE=edge">
9 <meta name="generator" content="searx/{{ searx_version }}">
9 <meta name="generator" content="searx/{{ searx_version }}">
10 <meta name="referrer" content="no-referrer">
10 <meta name="referrer" content="no-referrer">
11− <meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=1.0, user-scalable=1" />
11+ <meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=2.0, user-scalable=1" />
12 {% block meta %}{% endblock %}
12 {% block meta %}{% endblock %}
13 <script src="{{ url_for('js_translations') }}"></script>
13 <script src="{{ url_for('js_translations') }}"></script>
14 <title>{% block title %}{% endblock %}{{ instance_name }}</title>
14 <title>{% block title %}{% endblock %}{{ instance_name }}</title>
@@ -42,7 +42,7 @@
42 <style type="text/css">
42 <style type="text/css">
43 .tab-content > .active_if_nojs, .active_if_nojs {display: block !important; visibility: visible !important;}
43 .tab-content > .active_if_nojs, .active_if_nojs {display: block !important; visibility: visible !important;}
44 .margin_top_if_nojs {margin-top: 20px;}
44 .margin_top_if_nojs {margin-top: 20px;}
45− .hide_if_nojs {display: none !important;overflow:none !important;}
45+ .hide_if_nojs {display: none !important;overflow: hidden !important;}
46 .disabled_if_nojs {pointer-events: none; cursor: default; text-decoration: line-through;}
46 .disabled_if_nojs {pointer-events: none; cursor: default; text-decoration: line-through;}
47 </style>
47 </style>
48 </noscript>
48 </noscript>
searx/templates/oscar/macros.html+13−13
@@ -8,34 +8,34 @@
8 <img width="32" height="32" class="favicon" src="{{ url_for('static', filename='themes/oscar/img/icons/' + favicon + '.png') }}" alt="{{ favicon }}" />
8 <img width="32" height="32" class="favicon" src="{{ url_for('static', filename='themes/oscar/img/icons/' + favicon + '.png') }}" alt="{{ favicon }}" />
9{%- endmacro %}
9{%- endmacro %}
10
10
11−{%- macro result_link(url, title, classes='') -%}
11+{%- macro result_link(url, title, classes='', id='') -%}
12−<a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ title }}</a>
12+<a href="{{ url }}" {% if classes %}class="{{ classes }}" {% endif %}{% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}{% if id %} aria-labelledby="result-{{id}}"{%endif%}>{{ title }}</a>
13{%- endmacro -%}
13{%- endmacro -%}
14
14
15<!-- Draw result header -->
15<!-- Draw result header -->
16−{% macro result_header(result, favicons) -%}
16+{% macro result_header(result, favicons, id) -%}
17−<h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{% if result.url %}{{ result_link(result.url, result.title|safe) }}{% else %}{{ result.title|safe}}{% endif %}</h4>
17+<h4 class="result_header" id="result-{{id}}">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}{% if result.url %}{{ result_link(result.url, result.title|safe, id=id) }}{% else %}{{ result.title|safe}}{% endif %}</h4>
18{%- endmacro %}
18{%- endmacro %}
19
19
20<!-- Draw result sub header -->
20<!-- Draw result sub header -->
21−{% macro result_sub_header(result) -%}
21+{% macro result_sub_header(result, id) -%}
22 {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
22 {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
23− {% if result.magnetlink %}<small> &bull; {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</small>{% endif %}
23+ {% if result.magnetlink %}<small> &bull; {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink", id) }}</small>{% endif %}
24− {% if result.torrentfile %}<small> &bull; {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</small>{% endif %}
24+ {% if result.torrentfile %}<small> &bull; {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile", id) }}</small>{% endif %}
25{%- endmacro %}
25{%- endmacro %}
26
26
27<!-- Draw result footer -->
27<!-- Draw result footer -->
28−{% macro result_footer(result) -%}
28+{% macro result_footer(result, id) -%}
29 <div class="clearfix"></div>{{- "" -}}
29 <div class="clearfix"></div>{{- "" -}}
30 <div class="pull-right">
30 <div class="pull-right">
31 {%- for engine in result.engines -%}
31 {%- for engine in result.engines -%}
32 <span class="label label-default">{{ engine }}</span>
32 <span class="label label-default">{{ engine }}</span>
33 {%- endfor -%}
33 {%- endfor -%}
34 {%- if result.url -%}
34 {%- if result.url -%}
35− <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
35+ <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small>
36 {%- endif -%}
36 {%- endif -%}
37 {%- if proxify -%}
37 {%- if proxify -%}
38− <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
38+ <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small>
39 {%- endif -%}
39 {%- endif -%}
40 </div>
40 </div>
41 {%- if result.pretty_url -%}
41 {%- if result.pretty_url -%}
@@ -44,16 +44,16 @@
44{%- endmacro %}
44{%- endmacro %}
45
45
46<!-- Draw result footer -->
46<!-- Draw result footer -->
47−{% macro result_footer_rtl(result) -%}
47+{% macro result_footer_rtl(result, id) -%}
48 <div class="clearfix"></div>{{- "" -}}
48 <div class="clearfix"></div>{{- "" -}}
49 {% for engine in result.engines -%}
49 {% for engine in result.engines -%}
50 <span class="label label-default">{{ engine }}</span>
50 <span class="label label-default">{{ engine }}</span>
51 {%- endfor %}
51 {%- endfor %}
52 {%- if result.url -%}
52 {%- if result.url -%}
53− <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info") }}</small>
53+ <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small>
54 {%- endif -%}
54 {%- endif -%}
55 {% if proxify -%}
55 {% if proxify -%}
56− <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info") }}</small>
56+ <small>{{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }}</small>
57 {%- endif %}
57 {%- endif %}
58 {%- if result.pretty_url -%}
58 {%- if result.pretty_url -%}
59 <div class="external-link">{{ result.pretty_url }}</div>
59 <div class="external-link">{{ result.pretty_url }}</div>
searx/templates/oscar/result_templates/code.html+2−2
@@ -1,11 +1,11 @@
1−{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
1+{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context%}
2
2
3{{ result_header(result, favicons) }}
3{{ result_header(result, favicons) }}
4{{ result_sub_header(result) }}
4{{ result_sub_header(result) }}
5
5
6{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
6{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
7
7
8−{% if result.repository %}<p class="result-content">{{ icon('file') }} <a href="{{ result.repository }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ result.repository }}</a></p>{% endif %}
8+{% if result.repository %}<p class="result-content">{{ icon('file') }} <a href="{{ result.repository }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} aria-labelledby="result-{{loop.index}}">{{ result.repository }}</a></p>{% endif %}
9
9
10<div dir="ltr">
10<div dir="ltr">
11{{ result.codelines|code_highlighter(result.code_language)|safe }}
11{{ result.codelines|code_highlighter(result.code_language)|safe }}
searx/templates/oscar/result_templates/default.html+5−5
@@ -1,10 +1,10 @@
1{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context %}
1{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context %}
2
2
3−{{- result_header(result, favicons) -}}
3+{{- result_header(result, favicons, loop.index) -}}
4−{{- result_sub_header(result) -}}
4+{{- result_sub_header(result, loop.index) -}}
5
5
6{%- if result.embedded -%}
6{%- if result.embedded -%}
7− <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music') }} {{ _('show media') }}</a></small>
7+ <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}" aria-labelledby="result-{{loop.index}}">{{ icon('music') }} {{ _('show media') }}</a></small>
8{%- endif -%}
8{%- endif -%}
9
9
10{%- if result.embedded -%}
10{%- if result.embedded -%}
@@ -25,7 +25,7 @@
25{%- endif -%}
25{%- endif -%}
26
26
27{%- if rtl -%}
27{%- if rtl -%}
28−{{ result_footer_rtl(result) }}
28+{{ result_footer_rtl(result, loop.index) }}
29{%- else -%}
29{%- else -%}
30−{{ result_footer(result) }}
30+{{ result_footer(result, loop.index) }}
31{%- endif -%}
31{%- endif -%}
searx/templates/oscar/result_templates/images.html+2−2
@@ -1,6 +1,6 @@
1−{%- from 'oscar/macros.html' import draw_favicon -%}
1+{%- from 'oscar/macros.html' import draw_favicon with context -%}
2
2
3−<a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} data-toggle="modal" data-target="#modal-{{ index }}-{{pageno}}">{{- "" -}}
3+<a href="{{ result.img_src }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} data-toggle="modal" data-target="#modal-{{ index }}-{{pageno}}" id="result-{{loop.index}}">{{- "" -}}
4 <img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="img-thumbnail">{{- "" -}}
4 <img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="img-thumbnail">{{- "" -}}
5</a>
5</a>
6<div class="modal fade" id="modal-{{ index }}-{{ pageno }}" tabindex="-1" role="dialog" aria-hidden="true">{{- "" -}}
6<div class="modal fade" id="modal-{{ index }}-{{ pageno }}" tabindex="-1" role="dialog" aria-hidden="true">{{- "" -}}
searx/templates/oscar/result_templates/map.html+4−4
@@ -1,7 +1,7 @@
1{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
1{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
2
2
3−{{ result_header(result, favicons) }}
3+{{ result_header(result, favicons, loop.index) }}
4−{{ result_sub_header(result) }}
4+{{ result_sub_header(result, loop.index) }}
5
5
6{% if (result.latitude and result.longitude) or result.boundingbox %}
6{% if (result.latitude and result.longitude) or result.boundingbox %}
7 <small> &bull; <a class="text-info btn-collapse collapsed searx_init_map cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></small>
7 <small> &bull; <a class="text-info btn-collapse collapsed searx_init_map cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></small>
@@ -66,7 +66,7 @@
66{% endif %}
66{% endif %}
67
67
68{% if rtl %}
68{% if rtl %}
69−{{ result_footer_rtl(result) }}
69+{{ result_footer_rtl(result, loop.index) }}
70{% else %}
70{% else %}
71−{{ result_footer(result) }}
71+{{ result_footer(result, loop.index) }}
72{% endif %}
72{% endif %}
searx/templates/oscar/result_templates/torrent.html+4−4
@@ -1,7 +1,7 @@
1{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
1{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
2
2
3−{{ result_header(result, favicons) }}
3+{{ result_header(result, favicons, loop.index) }}
4−{{ result_sub_header(result) }}
4+{{ result_sub_header(result, loop.index) }}
5
5
6{% if result.seed is defined %}<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> &bull; {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>{% endif %}
6{% if result.seed is defined %}<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> &bull; {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>{% endif %}
7{% if result.filesize %}<br />{{ icon('floppy-disk') }} {{ _('Filesize') }}
7{% if result.filesize %}<br />{{ icon('floppy-disk') }} {{ _('Filesize') }}
@@ -19,7 +19,7 @@
19</p>
19</p>
20
20
21{% if rtl %}
21{% if rtl %}
22−{{ result_footer_rtl(result) }}
22+{{ result_footer_rtl(result, loop.index) }}
23{% else %}
23{% else %}
24−{{ result_footer(result) }}
24+{{ result_footer(result, loop.index) }}
25{% endif %}
25{% endif %}
searx/templates/oscar/result_templates/videos.html+6−6
@@ -1,10 +1,10 @@
1{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
1{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
2
2
3−{{ result_header(result, favicons) }}
3+{{ result_header(result, favicons, loop.index) }}
4−{{ result_sub_header(result) }}
4+{{ result_sub_header(result, loop.index) }}
5
5
6{% if result.embedded %}
6{% if result.embedded %}
7− <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film') }} {{ _('show video') }}</a></small>
7+ <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}" aria-labelledby="result-{{loop.index}}">{{ icon('film') }} {{ _('show video') }}</a></small>
8{% endif %}
8{% endif %}
9
9
10{% if result.embedded %}
10{% if result.embedded %}
@@ -15,7 +15,7 @@
15
15
16<div class="container-fluid">
16<div class="container-fluid">
17 <div class="row">
17 <div class="row">
18− <a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" /></a>
18+ <a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" aria-labelledby="result-{{loop.index}}" /></a>
19 {% if result.author %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Author') }}</b>: {{ result.author }}</p>{% endif %}
19 {% if result.author %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Author') }}</b>: {{ result.author }}</p>{% endif %}
20 {% if result.length %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Length') }}</b>: {{ result.length }}</p>{% endif %}
20 {% if result.length %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Length') }}</b>: {{ result.length }}</p>{% endif %}
21 {% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
21 {% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
@@ -23,7 +23,7 @@
23</div>
23</div>
24
24
25{% if rtl %}
25{% if rtl %}
26−{{ result_footer_rtl(result) }}
26+{{ result_footer_rtl(result, loop.index) }}
27{% else %}
27{% else %}
28−{{ result_footer(result) }}
28+{{ result_footer(result, loop.index) }}
29{% endif %}
29{% endif %}
utils/searx.sh+42−28
@@ -816,47 +816,61 @@ rst-doc() {
816
816
817 case $DIST_ID-$DIST_VERS in
817 case $DIST_ID-$DIST_VERS in
818 ubuntu-*|debian-*) cat <<EOF
818 ubuntu-*|debian-*) cat <<EOF
819+
820+.. code:: bash
821+
819−# init.d --> /usr/share/doc/uwsgi/README.Debian.gz
822+ # init.d --> /usr/share/doc/uwsgi/README.Debian.gz
820−# For uWSGI debian uses the LSB init process, this might be changed
823+ # For uWSGI debian uses the LSB init process, this might be changed
821−# one day, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833067
824+ # one day, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833067
822−
825+
823−create ${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP}
826+ create ${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP}
824−enable: sudo -H ln -s ${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP} ${uWSGI_APPS_ENABLED}/
827+ enable: sudo -H ln -s ${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP} ${uWSGI_APPS_ENABLED}/
825−start: sudo -H service uwsgi start ${SEARX_UWSGI_APP%.*}
828+ start: sudo -H service uwsgi start ${SEARX_UWSGI_APP%.*}
826−restart: sudo -H service uwsgi restart ${SEARX_UWSGI_APP%.*}
829+ restart: sudo -H service uwsgi restart ${SEARX_UWSGI_APP%.*}
827−stop: sudo -H service uwsgi stop ${SEARX_UWSGI_APP%.*}
830+ stop: sudo -H service uwsgi stop ${SEARX_UWSGI_APP%.*}
828−disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
831+ disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
832+
829EOF
833EOF
830 ;;
834 ;;
831 arch-*) cat <<EOF
835 arch-*) cat <<EOF
836+
837+.. code:: bash
838+
832−# systemd --> /usr/lib/systemd/system/uwsgi@.service
839+ # systemd --> /usr/lib/systemd/system/uwsgi@.service
833−# For uWSGI archlinux uses systemd template units, see
840+ # For uWSGI archlinux uses systemd template units, see
834−# - http://0pointer.de/blog/projects/instances.html
841+ # - http://0pointer.de/blog/projects/instances.html
835−# - https://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd
842+ # - https://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd
836−
843+
837−create: ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
844+ create: ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
838−enable: sudo -H systemctl enable uwsgi@${SEARX_UWSGI_APP%.*}
845+ enable: sudo -H systemctl enable uwsgi@${SEARX_UWSGI_APP%.*}
839−start: sudo -H systemctl start uwsgi@${SEARX_UWSGI_APP%.*}
846+ start: sudo -H systemctl start uwsgi@${SEARX_UWSGI_APP%.*}
840−restart: sudo -H systemctl restart uwsgi@${SEARX_UWSGI_APP%.*}
847+ restart: sudo -H systemctl restart uwsgi@${SEARX_UWSGI_APP%.*}
841−stop: sudo -H systemctl stop uwsgi@${SEARX_UWSGI_APP%.*}
848+ stop: sudo -H systemctl stop uwsgi@${SEARX_UWSGI_APP%.*}
842−disable: sudo -H systemctl disable uwsgi@${SEARX_UWSGI_APP%.*}
849+ disable: sudo -H systemctl disable uwsgi@${SEARX_UWSGI_APP%.*}
850+
843EOF
851EOF
844 ;;
852 ;;
845 fedora-*) cat <<EOF
853 fedora-*) cat <<EOF
846−# systemd --> /usr/lib/systemd/system/uwsgi.service
847−# The unit file starts uWSGI in emperor mode (/etc/uwsgi.ini), see
848−# - https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html
849
854
855+.. code:: bash
856+
857+ # systemd --> /usr/lib/systemd/system/uwsgi.service
858+ # The unit file starts uWSGI in emperor mode (/etc/uwsgi.ini), see
859+ # - https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html
860+
850−create: ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
861+ create: ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
851−restart: sudo -H touch ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
862+ restart: sudo -H touch ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
852−disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
863+ disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
864+
853EOF
865EOF
854 ;;
866 ;;
855 esac
867 esac
856 echo -e ".. END searx uwsgi-description $DIST_NAME"
868 echo -e ".. END searx uwsgi-description $DIST_NAME"
857
869
858 echo -e "\n.. START searx uwsgi-appini $DIST_NAME"
870 echo -e "\n.. START searx uwsgi-appini $DIST_NAME"
871+ echo ".. code:: bash"
872+ echo
859− eval "echo \"$(< "${TEMPLATES}/${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP}")\""
873+ eval "echo \"$(< "${TEMPLATES}/${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP}")\"" | prefix_stdout " "
860 echo -e "\n.. END searx uwsgi-appini $DIST_NAME"
874 echo -e "\n.. END searx uwsgi-appini $DIST_NAME"
861
875
862 )
876 )