diff options
author | Markus Heiser <markus.heiser@darmarIT.de> | 2021-07-27 05:32:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-27 05:32:57 +0000 |
commit | beff764d7402e6a834f6dbb0a28921fc2577defe (patch) | |
tree | d1fd3beb026c1199d60ffc67b9c6e79ddb8f5f80 /docs | |
parent | 80f5241387aea1381dd96ed2b91ca62de927ba23 (diff) | |
parent | e946c3462c2b44fb154d0b6595f4f42605a326e5 (diff) | |
download | searxng-beff764d7402e6a834f6dbb0a28921fc2577defe.tar.gz searxng-beff764d7402e6a834f6dbb0a28921fc2577defe.zip |
Merge pull request #216 from return42/fix-searx.sh
normalize environment of installation tasks (shell) with YAML settings
Diffstat (limited to 'docs')
-rw-r--r-- | docs/admin/api.rst | 2 | ||||
-rw-r--r-- | docs/admin/engines/settings.rst | 73 | ||||
-rw-r--r-- | docs/admin/installation-searx.rst | 2 | ||||
-rw-r--r-- | docs/build-templates/searx.rst | 3 | ||||
-rw-r--r-- | docs/dev/makefile.rst | 34 |
5 files changed, 87 insertions, 27 deletions
diff --git a/docs/admin/api.rst b/docs/admin/api.rst index 7804a8664..8c782ea9c 100644 --- a/docs/admin/api.rst +++ b/docs/admin/api.rst @@ -87,7 +87,7 @@ HTML of the site. URL of the searx instance and values are customizable. .. code:: html - <form method="post" action="https://searx.me/"> + <form method="post" action="https://example.org/"> <!-- search --> <input type="text" name="q" /> <!-- categories --> <input type="hidden" name="categories" value="general,social media" /> <!-- language --> <input type="hidden" name="lang" value="all" /> diff --git a/docs/admin/engines/settings.rst b/docs/admin/engines/settings.rst index 7335b9a2a..cab4ee493 100644 --- a/docs/admin/engines/settings.rst +++ b/docs/admin/engines/settings.rst @@ -37,15 +37,10 @@ see how you can simplify your *user defined* ``settings.yml``. Global Settings =============== -``general:`` ------------- - -.. code:: yaml +.. _settings global brand: - general: - debug: false # Debug mode, only for development - instance_name: "searxng" # displayed name - contact_url: false # mailto:contact@example.com +``brand:`` +------------ .. code:: yaml @@ -57,22 +52,47 @@ Global Settings public_instances: https://searx.space wiki_url: https://github.com/searxng/searxng/wiki -``debug`` : - Allow a more detailed log if you run searx directly. Display *detailed* error - messages in the browser too, so this must be deactivated in production. +.. sidebar:: buildenv -``contact_url``: - Contact ``mailto:`` address or WEB form. + Changing a value tagged by :ref:`buildenv <make buildenv>`, needs to + rebuild instance's environment :ref:`utils/brand.env <make buildenv>`. -``git_url`` and ``git_branch``: +``git_url`` & ``git_branch`` : :ref:`buildenv GIT_URL & GIT_BRANCH <make buildenv>` Changes this, to point to your searx fork (branch). -``docs_url`` - If you host your own documentation, change this URL. +``issue_url`` : + If you host your own issue tracker change this URL. + +``docs_url`` : + If you host your own documentation change this URL. -``wiki_url``: +``public_instances`` : + If you host your own https://searx.space change this URL. + +``wiki_url`` : Link to your wiki (or ``false``) +.. _settings global general: + +``general:`` +------------ + +.. code:: yaml + + general: + debug: false # Debug mode, only for development + instance_name: "searxng" # displayed name + contact_url: false # mailto:contact@example.com + +``debug`` : ``$SEARX_DEBUG`` + Allow a more detailed log if you run searx directly. Display *detailed* error + messages in the browser too, so this must be deactivated in production. + +``contact_url``: + Contact ``mailto:`` address or WEB form. + + +.. _settings global server: ``server:`` ----------- @@ -80,10 +100,10 @@ Global Settings .. code:: yaml server: + base_url: false # set custom base_url (or false) port: 8888 bind_address: "127.0.0.1" # address to listen on secret_key: "ultrasecretkey" # change this! - base_url: false # set custom base_url (or false) image_proxy: false # proxying image results through searx default_locale: "" # default interface locale default_theme: oscar # ui theme @@ -94,17 +114,24 @@ Global Settings X-Robots-Tag : noindex, nofollow Referrer-Policy : no-referrer -``port`` & ``bind_address``: +.. sidebar:: buildenv + + Changing a value tagged by :ref:`buildenv <make buildenv>`, needs to + rebuild instance's environment :ref:`utils/brand.env <make buildenv>`. + +``base_url`` : :ref:`buildenv SEARX_URL <make buildenv>` + The base URL where searx is deployed. Used to create correct inbound links. + If you change the value, don't forget to rebuild instance's environment + (:ref:`utils/brand.env <make buildenv>`) + +``port`` & ``bind_address``: :ref:`buildenv SEARX_PORT & SEARX_BIND_ADDRESS <make buildenv>` Port number and *bind address* of the searx web application if you run it directly using ``python searx/webapp.py``. Doesn't apply to searx running on Apache or Nginx. -``secret_key`` : +``secret_key`` : ``$SEARX_SECRET`` Used for cryptography purpose. -``base_url`` : - The base URL where searx is deployed. Used to create correct inbound links. - ``image_proxy`` : Allow your instance of searx of being able to proxy images. Uses memory space. diff --git a/docs/admin/installation-searx.rst b/docs/admin/installation-searx.rst index 5c9985e8b..c5e1a05e7 100644 --- a/docs/admin/installation-searx.rst +++ b/docs/admin/installation-searx.rst @@ -94,7 +94,7 @@ For a *minimal setup*, configure like shown below – replace ``searx@$(uname .. group-tab:: Use default settings - .. literalinclude:: ../../utils/templates/etc/searx/use_default_settings.yml + .. literalinclude:: ../../utils/templates/etc/searx/settings.yml :language: yaml .. group-tab:: searx/settings.yml diff --git a/docs/build-templates/searx.rst b/docs/build-templates/searx.rst index 33ed9601c..e4d5f06b3 100644 --- a/docs/build-templates/searx.rst +++ b/docs/build-templates/searx.rst @@ -134,7 +134,7 @@ ${fedora_build} .. code-block:: sh $ sudo -H mkdir -p \"$(dirname ${SEARX_SETTINGS_PATH})\" - $ sudo -H cp \"$SEARX_SRC/utils/templates/etc/searx/use_default_settings.yml\" \\ + $ sudo -H cp \"$SEARX_SRC/utils/templates/etc/searx/settings.yml\" \\ \"${SEARX_SETTINGS_PATH}\" .. group-tab:: searx/settings.yml @@ -152,7 +152,6 @@ ${fedora_build} .. code-block:: sh $ sudo -H sed -i -e \"s/ultrasecretkey/\$(openssl rand -hex 16)/g\" \"$SEARX_SETTINGS_PATH\" - $ sudo -H sed -i -e \"s/{instance_name}/searx@\$(uname -n)/g\" \"$SEARX_SETTINGS_PATH\" .. END searx config diff --git a/docs/dev/makefile.rst b/docs/dev/makefile.rst index b7472dad7..5bf3c13b2 100644 --- a/docs/dev/makefile.rst +++ b/docs/dev/makefile.rst @@ -81,6 +81,40 @@ the check fails if you edit the requirements listed in If you think, something goes wrong with your ./local environment or you change the :origin:`setup.py` file, you have to call :ref:`make clean`. +.. _make buildenv: + +``make buildenv`` +================= + +Rebuild instance's environment with the modified settings from the +:ref:`settings global brand` and :ref:`settings global server` section of your +:ref:`settings.yml <settings location>`. + +We have all SearXNG setups are centralized in the :ref:`settings.yml` file. +This setup is available as long we are in a *installed instance*. E.g. the +*installed instance* on the server or the *installed developer instance* at +``./local`` (the later one is created by a :ref:`make install <make +install>` or :ref:`make run <make run>`). + +Tasks running outside of an *installed instance*, especially those tasks and +scripts running at (pre-) installation time do not have access to the SearXNG +setup (from a *installed instance*). Those tasks need a *build environment*. + +The ``make buildenv`` target will update the *build environment* in: + +- :origin:`utils/brand.env` + +Tasks running outside of an *installed instance*, need the following settings +from the YAML configuration: + +- ``GIT_URL`` from :ref:`brand.git_url <settings global brand>` +- ``GIT_BRANCH`` from :ref:`brand.git_branch <settings global brand>` + +- ``SEARX_URL`` from :ref:`server.base_url <settings global server>` (aka + ``PUBLIC_URL``) +- ``SEARX_BIND_ADDRESS`` from :ref:`server.bind_address <settings global server>` +- ``SEARX_PORT`` from :ref:`server.port <settings global server>` + .. _make run: ``make run`` |