on master help sign in
doc: add descriptions of our tooling box in ./utils
94ac560Markus Heiser
docs/admin/filtron.rst+11−25
@@ -1,14 +1,22 @@
1+
2+.. _searx_filtron:
3+
1==========================
4==========================
2How to protect an instance
5How to protect an instance
3==========================
6==========================
4
7
8+.. sidebar:: further reading
9+
10+ - :ref:`filtron.sh`
11+
5.. _filtron: https://github.com/asciimoo/filtron
12.. _filtron: https://github.com/asciimoo/filtron
6
13
7Searx depens on external search services. To avoid the abuse of these services
14Searx depens on external search services. To avoid the abuse of these services
8it is advised to limit the number of requests processed by searx.
15it is advised to limit the number of requests processed by searx.
9
16
10An application firewall, filtron_ solves exactly this problem. Filtron is just
17An application firewall, filtron_ solves exactly this problem. Filtron is just
11−a middleware between your web server (nginx, apache, ...) and searx.
18+a middleware between your web server (nginx, apache, ...) and searx, we describe
19+such infratructures in chapter: :ref:`architecture`.
12
20
13
21
14filtron & go
22filtron & go
@@ -17,32 +25,10 @@ filtron & go
17.. _Go: https://golang.org/
25.. _Go: https://golang.org/
18.. _filtron README: https://github.com/asciimoo/filtron/blob/master/README.md
26.. _filtron README: https://github.com/asciimoo/filtron/blob/master/README.md
19
27
20−
21−.. sidebar:: init system
22−
23− ATM the ``filtron.sh`` supports only systemd init process used by debian,
24− ubuntu and many other dists. If you have a working init.d file to start/stop
25− filtron service, please contribute.
26−
27Filtron needs Go_ installed. If Go_ is preinstalled, filtron_ is simply
28Filtron needs Go_ installed. If Go_ is preinstalled, filtron_ is simply
28installed by ``go get`` package management (see `filtron README`_). If you use
29installed by ``go get`` package management (see `filtron README`_). If you use
29−filtron as middleware, a more isolated setup is recommended.
30+filtron as middleware, a more isolated setup is recommended. To simplify such
30−
31−#. Create a separated user account (``filtron``).
32−#. Download and install Go_ binary in users $HOME (``~filtron``).
33−#. Install filtron with the package management of Go_ (``go get -v -u
34− github.com/asciimoo/filtron``)
35−#. Setup a proper rule configuration :origin:`[ref]
36− <utils/templates/etc/filtron/rules.json>` (``/etc/filtron/rules.json``).
37−#. Setup a systemd service unit :origin:`[ref]
38− <utils/templates/lib/systemd/system/filtron.service>`
39− (``/lib/systemd/system/filtron.service``).
40−
41−To simplify such a installation and the maintenance of; use our script
31+an installation and the maintenance of, use our script :ref:`filtron.sh`.
42−``utils/filtron.sh``:
43−
44−.. program-output:: ../utils/filtron.sh --help
45− :ellipsis: 0,5
46
32
47
33
48Sample configuration of filtron
34Sample configuration of filtron
docs/admin/morty.rst+3
@@ -1,3 +1,6 @@
1+
2+.. _searx_morty:
3+
1=========================
4=========================
2How to setup result proxy
5How to setup result proxy
3=========================
6=========================
docs/index.rst+1
@@ -29,4 +29,5 @@ don't trust anyone, you can set up your own, see :ref:`installation`.
29 user/index
29 user/index
30 admin/index
30 admin/index
31 dev/index
31 dev/index
32+ utils/index
32 blog/index
33 blog/index
docs/utils/filtron.sh.rstnew file+44
@@ -0,0 +1,44 @@
1+
2+.. _filtron.sh:
3+
4+====================
5+``utils/filtron.sh``
6+====================
7+
8+.. sidebar:: further reading
9+
10+ - :ref:`searx_filtron`
11+
12+.. _Go: https://golang.org/
13+.. _filtron: https://github.com/asciimoo/filtron
14+.. _filtron README: https://github.com/asciimoo/filtron/blob/master/README.md
15+
16+To simplify installation and maintenance of a filtron instance you can use the
17+script :origin:`utils/filtron.sh`. In most cases you will install filtron_
18+simply by running the command:
19+
20+.. code:: bash
21+
22+ sudo -H ./utils/filtron.sh install all
23+
24+The script adds a ``${SERVICE_USER}`` (default:``filtron``) and installs filtron_
25+into this user account:
26+
27+#. Create a separated user account (``filtron``).
28+#. Download and install Go_ binary in users $HOME (``~filtron``).
29+#. Install filtron with the package management of Go_ (``go get -v -u
30+ github.com/asciimoo/filtron``)
31+#. Setup a proper rule configuration :origin:`[ref]
32+ <utils/templates/etc/filtron/rules.json>` (``/etc/filtron/rules.json``).
33+#. Setup a systemd service unit :origin:`[ref]
34+ <utils/templates/lib/systemd/system/filtron.service>`
35+ (``/lib/systemd/system/filtron.service``).
36+
37+
38+Overview
39+========
40+
41+The ``--help`` output of the script is largely self-explanatory:
42+
43+.. program-output:: ../utils/filtron.sh --help
44+
docs/utils/index.rstnew file+23
@@ -0,0 +1,23 @@
1+
2+.. _searx_utils:
3+
4+======================
5+Tooling box ``utils/``
6+======================
7+
8+In the folder :origin:`utils/` we maintain some tools useful for admins and
9+developers.
10+
11+.. toctree::
12+ :maxdepth: 1
13+
14+ searx.sh
15+ filtron.sh
16+ morty.sh
17+
18+.. hint::
19+
20+ ATM :ref:`filtron.sh` and :ref:`searx.sh` do supports only systemd init
21+ process used by debian, ubuntu and many other dists. If you have working
22+ init.d files to start/stop services, please contribute / thanks!
23+
docs/utils/morty.sh.rstnew file+31
@@ -0,0 +1,31 @@
1+
2+.. _morty.sh:
3+
4+.. _morty: https://github.com/asciimoo/morty
5+.. _morty's README: https://github.com/asciimoo/morty
6+
7+==================
8+``utils/morty.sh``
9+==================
10+
11+To simplify installation and maintenance of a morty_ instance you can use the
12+script :origin:`utils/morty.sh`. In most cases you will install morty_ simply by
13+running the command:
14+
15+.. code:: bash
16+
17+ sudo -H ./utils/morty.sh install all
18+
19+The script adds a ``${SERVICE_USER}`` (default:``morty``) and installs morty_
20+into this user account.
21+
22+.. hint::
23+
24+ To add morty to your searx instance read chapter :reF:`searx_morty`.
25+
26+
27+The ``--help`` output of the script is largely
28+self-explanatory:
29+
30+.. program-output:: ../utils/morty.sh --help
31+
docs/utils/searx.sh.rstnew file+21
@@ -0,0 +1,21 @@
1+
2+.. _searx.sh:
3+
4+==================
5+``utils/searx.sh``
6+==================
7+
8+To simplify installation and maintenance of a searx instance you can use the
9+script :origin:`utils/searx.sh`. In most cases you will install searx simply by
10+running the command:
11+
12+.. code:: bash
13+
14+ sudo -H ./utils/searx.sh install all
15+
16+The script adds a ``${SERVICE_USER}`` (default:``searx``) and installs searx
17+into this user account. The ``--help`` output of the script is largely
18+self-explanatory:
19+
20+.. program-output:: ../utils/searx.sh --help
21+
utils/filtron.sh+1
@@ -89,6 +89,7 @@ If needed, set PUBLIC_URL of your WEB service in the '${DOT_CONFIG#"$REPO_ROOT/"
89
89
90 PUBLIC_URL : ${PUBLIC_URL}
90 PUBLIC_URL : ${PUBLIC_URL}
91 PUBLIC_HOST : ${PUBLIC_HOST}
91 PUBLIC_HOST : ${PUBLIC_HOST}
92+ SERVICE_USER : ${SERVICE_USER}
92
93
93EOF
94EOF
94 [ ! -z ${1+x} ] && echo -e "$1"
95 [ ! -z ${1+x} ] && echo -e "$1"
utils/lib.sh+4−1
@@ -97,7 +97,10 @@ set_terminal_colors() {
97 _BPurple='\e[1;35m'
97 _BPurple='\e[1;35m'
98 _BCyan='\e[1;36m'
98 _BCyan='\e[1;36m'
99}
99}
100+
101+if [ ! -p /dev/stdout ]; then
100−set_terminal_colors
102+ set_terminal_colors
103+fi
101
104
102# reST
105# reST
103# ----
106# ----
utils/morty.sh+1
@@ -77,6 +77,7 @@ If needed, set the environment variable MORTY_LISTEN in the
77${DOT_CONFIG#"$REPO_ROOT/"} file::
77${DOT_CONFIG#"$REPO_ROOT/"} file::
78
78
79 MORTY_LISTEN : ${MORTY_LISTEN}
79 MORTY_LISTEN : ${MORTY_LISTEN}
80+ SERVICE_USER : ${SERVICE_USER}
80
81
81To activate morty in searx, add result_proxy to your settings.yml::
82To activate morty in searx, add result_proxy to your settings.yml::
82
83
utils/searx.sh+1
@@ -104,6 +104,7 @@ If needed, set PUBLIC_URL of your WEB service in the '${DOT_CONFIG#"$REPO_ROOT/"
104 PUBLIC_URL : ${PUBLIC_URL}
104 PUBLIC_URL : ${PUBLIC_URL}
105 PUBLIC_HOST : ${PUBLIC_HOST}
105 PUBLIC_HOST : ${PUBLIC_HOST}
106 SEARX_INSTANCE_NAME : ${SEARX_INSTANCE_NAME}
106 SEARX_INSTANCE_NAME : ${SEARX_INSTANCE_NAME}
107+ SERVICE_USER : ${SERVICE_USER}
107
108
108EOF
109EOF
109 [ ! -z ${1+x} ] && echo -e "$1"
110 [ ! -z ${1+x} ] && echo -e "$1"