summaryrefslogtreecommitdiff
path: root/docs/admin
diff options
context:
space:
mode:
Diffstat (limited to 'docs/admin')
-rw-r--r--docs/admin/api.rst94
-rw-r--r--docs/admin/filtron.rst114
-rw-r--r--docs/admin/morty.rst21
3 files changed, 229 insertions, 0 deletions
diff --git a/docs/admin/api.rst b/docs/admin/api.rst
new file mode 100644
index 000000000..8d6162247
--- /dev/null
+++ b/docs/admin/api.rst
@@ -0,0 +1,94 @@
+.. _adminapi:
+
+Administration API
+------------------
+
+Get configuration data
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code:: sh
+
+ GET /config
+
+Sample response
+```````````````
+
+.. code:: sh
+
+ {
+ "autocomplete": "",
+ "categories": [
+ "map",
+ "it",
+ "images",
+ ],
+ "default_locale": "",
+ "default_theme": "oscar",
+ "engines": [
+ {
+ "categories": [
+ "map"
+ ],
+ "enabled": true,
+ "name": "openstreetmap",
+ "shortcut": "osm"
+ },
+ {
+ "categories": [
+ "it"
+ ],
+ "enabled": true,
+ "name": "arch linux wiki",
+ "shortcut": "al"
+ },
+ {
+ "categories": [
+ "images"
+ ],
+ "enabled": true,
+ "name": "google images",
+ "shortcut": "goi"
+ },
+ {
+ "categories": [
+ "it"
+ ],
+ "enabled": false,
+ "name": "bitbucket",
+ "shortcut": "bb"
+ },
+ ],
+ "instance_name": "searx",
+ "locales": {
+ "de": "Deutsch (German)",
+ "en": "English",
+ "eo": "Esperanto (Esperanto)",
+ },
+ "plugins": [
+ {
+ "enabled": true,
+ "name": "HTTPS rewrite"
+ },
+ {
+ "enabled": false,
+ "name": "Vim-like hotkeys"
+ }
+ ],
+ "safe_search": 0
+ }
+
+Embed search bar
+----------------
+
+The search bar can be embedded into websites. Just paste the example into the HTML of the site.
+URL of the searx instance and values are customizable.
+
+.. code:: html
+
+ <form method="post" action="https://searx.me/">
+ <!-- search query --> <input type="text" name="q" />
+ <!-- categories --> <input type="hidden" name="categories" value="general,social media" />
+ <!-- language --> <input type="hidden" name="lang" value="all" />
+ <!-- locale --> <input type="hidden" name="locale" value="en" />
+ <!-- date filter --> <input type="hidden" name="time_range" value="month" />
+ </form>
diff --git a/docs/admin/filtron.rst b/docs/admin/filtron.rst
new file mode 100644
index 000000000..c422cb0a8
--- /dev/null
+++ b/docs/admin/filtron.rst
@@ -0,0 +1,114 @@
+How to protect an instance
+==========================
+
+Searx depens on external search services. To avoid the abuse of these services it is advised to limit the number of requests processed by searx.
+
+An application firewall, ``filtron`` solves exactly this problem. Information on how to install it can be found at the `project page of filtron <https://github.com/asciimoo/filtron>`__.
+
+Sample configuration of filtron
+-------------------------------
+
+An example configuration can be find below. This configuration limits the access of
+
+ * scripts or applications (roboagent limit)
+
+ * webcrawlers (botlimit)
+
+ * IPs which send too many requests (IP limit)
+
+ * too many json, csv, etc. requests (rss/json limit)
+
+ * the same UserAgent of if too many requests (useragent limit)
+
+
+.. code:: json
+
+ [
+ {
+ "name": "search request",
+ "filters": ["Param:q", "Path=^(/|/search)$"],
+ "interval": <time-interval-in-sec>,
+ "limit": <max-request-number-in-interval>,
+ "subrules": [
+ {
+ "name": "roboagent limit",
+ "interval": <time-interval-in-sec>,
+ "limit": <max-request-number-in-interval>,
+ "filters": ["Header:User-Agent=(curl|cURL|Wget|python-requests|Scrapy|FeedFetcher|Go-http-client)"],
+ "actions": [
+ {"name": "block",
+ "params": {"message": "Rate limit exceeded"}}
+ ]
+ },
+ {
+ "name": "botlimit",
+ "limit": 0,
+ "stop": true,
+ "filters": ["Header:User-Agent=(Googlebot|bingbot|Baiduspider|yacybot|YandexMobileBot|YandexBot|Yahoo! Slurp|MJ12bot|AhrefsBot|archive.org_bot|msnbot|MJ12bot|SeznamBot|linkdexbot|Netvibes|SMTBot|zgrab|James BOT)"],
+ "actions": [
+ {"name": "block",
+ "params": {"message": "Rate limit exceeded"}}
+ ]
+ },
+ {
+ "name": "IP limit",
+ "interval": <time-interval-in-sec>,
+ "limit": <max-request-number-in-interval>,
+ "stop": true,
+ "aggregations": ["Header:X-Forwarded-For"],
+ "actions": [
+ {"name": "block",
+ "params": {"message": "Rate limit exceeded"}}
+ ]
+ },
+ {
+ "name": "rss/json limit",
+ "interval": <time-interval-in-sec>,
+ "limit": <max-request-number-in-interval>,
+ "stop": true,
+ "filters": ["Param:format=(csv|json|rss)"],
+ "actions": [
+ {"name": "block",
+ "params": {"message": "Rate limit exceeded"}}
+ ]
+ },
+ {
+ "name": "useragent limit",
+ "interval": <time-interval-in-sec>,
+ "limit": <max-request-number-in-interval>,
+ "aggregations": ["Header:User-Agent"],
+ "actions": [
+ {"name": "block",
+ "params": {"message": "Rate limit exceeded"}}
+ ]
+ }
+ ]
+ }
+ ]
+
+
+
+Route request through filtron
+-----------------------------
+
+Filtron can be started using the following command:
+
+.. code:: bash
+
+ $ filtron -rules rules.json
+
+It listens on 127.0.0.1:4004 and forwards filtered requests to 127.0.0.1:8888 by default.
+
+Use it along with ``nginx`` with the following example configuration.
+
+.. code:: bash
+
+ location / {
+ proxy_set_header Host $http_host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Scheme $scheme;
+ proxy_pass http://127.0.0.1:4004/;
+ }
+
+Requests are coming from port 4004 going through filtron and then forwarded to port 8888 where a searx is being run.
diff --git a/docs/admin/morty.rst b/docs/admin/morty.rst
new file mode 100644
index 000000000..49e62bba9
--- /dev/null
+++ b/docs/admin/morty.rst
@@ -0,0 +1,21 @@
+How to setup result proxy
+=========================
+
+By default searx can only act as an image proxy for result images,
+but it is possible to proxify all the result URLs with an external service,
+`morty <https://github.com/asciimoo/morty>`__.
+
+To use this feature, morty has to be installed and activated in searx's ``settings.yml``.
+
+Add the following snippet to your ``settings.yml`` and restart searx:
+
+
+.. code:: yaml
+
+ result_proxy:
+ url : http://127.0.0.1:3000/
+ key : your_morty_proxy_key
+
+``url`` is the address of the running morty service
+
+``key`` is an optional argument, see `morty's README <https://github.com/asciimoo/morty>`__ for more information.