on master help sign in
doc: add descriptions of our tooling box in ./utils

Initial started with the scripts for searx, filtron and morty installations. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commit94ac560dcc85e2e75d3b14706a65eb9488643eb4 authorMarkus Heiser <markus.heiser@darmarit.de> dateMon 3 Feb 2020, 13:25 (7 years ago) parente740179
11 files changed+141−26
docs/admin/filtron.rst+11−25 docs/admin/morty.rst+3 docs/index.rst+1 docs/utils/filtron.sh.rst+44 docs/utils/index.rst+23 docs/utils/morty.sh.rst+31 docs/utils/searx.sh.rst+21 utils/filtron.sh+1 utils/lib.sh+4−1 utils/morty.sh+1 utils/searx.sh+1
docs/admin/filtron.rst+11−25
@@ -1,14 +1,22 @@
1+
2+.. _searx_filtron:
3+
14==========================
25How to protect an instance
36==========================
47
8+.. sidebar:: further reading
9+
10+ - :ref:`filtron.sh`
11+
512.. _filtron: https://github.com/asciimoo/filtron
613
714Searx depens on external search services. To avoid the abuse of these services
815it is advised to limit the number of requests processed by searx.
916
1017An 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`.
1220
1321
1422filtron & go
@@ -17,32 +25,10 @@ filtron & go
1725.. _Go: https://golang.org/
1826.. _filtron README: https://github.com/asciimoo/filtron/blob/master/README.md
1927
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−
2728Filtron needs Go_ installed. If Go_ is preinstalled, filtron_ is simply
2829installed by ``go get`` package management (see `filtron README`_). If you use
29−filtron as middleware, a more isolated setup is recommended.
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
42−``utils/filtron.sh``:
43−
44−.. program-output:: ../utils/filtron.sh --help
45− :ellipsis: 0,5
30+filtron as middleware, a more isolated setup is recommended. To simplify such
31+an installation and the maintenance of, use our script :ref:`filtron.sh`.
4632
4733
4834Sample configuration of filtron
docs/admin/morty.rst+3
@@ -1,3 +1,6 @@
1+
2+.. _searx_morty:
3+
14=========================
25How to setup result proxy
36=========================
docs/index.rst+1
@@ -29,4 +29,5 @@ don't trust anyone, you can set up your own, see :ref:`installation`.
2929 user/index
3030 admin/index
3131 dev/index
32+ utils/index
3233 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/"
8989
9090 PUBLIC_URL : ${PUBLIC_URL}
9191 PUBLIC_HOST : ${PUBLIC_HOST}
92+ SERVICE_USER : ${SERVICE_USER}
9293
9394EOF
9495 [ ! -z ${1+x} ] && echo -e "$1"
utils/lib.sh+4−1
@@ -97,7 +97,10 @@ set_terminal_colors() {
9797 _BPurple='\e[1;35m'
9898 _BCyan='\e[1;36m'
9999}
100−set_terminal_colors
100+
101+if [ ! -p /dev/stdout ]; then
102+ set_terminal_colors
103+fi
101104
102105# reST
103106# ----
utils/morty.sh+1
@@ -77,6 +77,7 @@ If needed, set the environment variable MORTY_LISTEN in the
7777${DOT_CONFIG#"$REPO_ROOT/"} file::
7878
7979 MORTY_LISTEN : ${MORTY_LISTEN}
80+ SERVICE_USER : ${SERVICE_USER}
8081
8182To activate morty in searx, add result_proxy to your settings.yml::
8283
utils/searx.sh+1
@@ -104,6 +104,7 @@ If needed, set PUBLIC_URL of your WEB service in the '${DOT_CONFIG#"$REPO_ROOT/"
104104 PUBLIC_URL : ${PUBLIC_URL}
105105 PUBLIC_HOST : ${PUBLIC_HOST}
106106 SEARX_INSTANCE_NAME : ${SEARX_INSTANCE_NAME}
107+ SERVICE_USER : ${SERVICE_USER}
107108
108109EOF
109110 [ ! -z ${1+x} ] && echo -e "$1"