diff options
Diffstat (limited to 'docs/dev')
| -rw-r--r-- | docs/dev/lxcdev.rst | 10 | ||||
| -rw-r--r-- | docs/dev/makefile.rst | 68 | ||||
| -rw-r--r-- | docs/dev/quickstart.rst | 35 | ||||
| -rw-r--r-- | docs/dev/search_api.rst | 4 |
4 files changed, 82 insertions, 35 deletions
diff --git a/docs/dev/lxcdev.rst b/docs/dev/lxcdev.rst index e13667c0b..597f99925 100644 --- a/docs/dev/lxcdev.rst +++ b/docs/dev/lxcdev.rst @@ -88,8 +88,8 @@ fork: .. code:: sh $ cd ~/Downloads - $ git clone https://github.com/searxng/searxng.git searx - $ cd searx + $ git clone https://github.com/searxng/searxng.git searxng + $ cd searxng The :ref:`lxc-searx.env` consists of several images, see ``export LXC_SUITE=(...`` near by :origin:`utils/lxc-searx.env#L19`. For this blog post @@ -180,7 +180,7 @@ searx-archlinux``: $ sudo -H ./utils/lxc.sh cmd searx-archlinux bash INFO: [searx-archlinux] bash [root@searx-archlinux searx]# pwd - /share/searx + /share/searxng The prompt ``[root@searx-archlinux ...]`` signals, that you are the root user in the searx-container. To debug the running SearXNG instance use: @@ -213,7 +213,7 @@ To debug services from filtron and morty analogous use: Another point we have to notice is that each service (:ref:`SearXNG <searx.sh>`, :ref:`filtron <filtron.sh>` and :ref:`morty <morty.sh>`) runs under dedicated -system user account with the same name (compare :ref:`create searx user`). To +system user account with the same name (compare :ref:`create searxng user`). To get a shell from theses accounts, simply call one of the scripts: .. tabs:: @@ -267,7 +267,7 @@ suite. For this, we have to keep an eye on the :ref:`installation basic`: - SearXNG software in: ``/usr/local/searx/searx-src`` With the use of the :ref:`searx.sh` the SearXNG service was installed as -:ref:`uWSGI application <searx uwsgi>`. To maintain this service, we can use +:ref:`uWSGI application <searxng uwsgi>`. To maintain this service, we can use ``systemctl`` (compare :ref:`service architectures on distributions <uwsgi configuration>`). diff --git a/docs/dev/makefile.rst b/docs/dev/makefile.rst index 6e563b1bd..66def0b3a 100644 --- a/docs/dev/makefile.rst +++ b/docs/dev/makefile.rst @@ -29,7 +29,7 @@ Calling the ``help`` target gives a first overview (``make help``): .. _make install: -Python Environment (``make install``) +Python environment (``make install``) ===================================== .. sidebar:: activate environment @@ -112,6 +112,60 @@ from the YAML configuration: - ``SEARXNG_BIND_ADDRESS`` from :ref:`server.bind_address <settings global server>` - ``SEARXNG_PORT`` from :ref:`server.port <settings global server>` +.. _make node.env: + +Node.js environment (``make node.env``) +======================================= + +.. _Node.js: https://nodejs.org/ +.. _nvm: https://github.com/nvm-sh +.. _npm: https://www.npmjs.com/ + +.. jinja:: searx + + Node.js_ version {{version.node}} or higher is required to build the themes. + If the requirement is not met, the build chain uses nvm_ (Node Version + Manager) to install latest LTS of Node.js_ locally: there is no need to + install nvm_ or npm_ on your system. + +Use ``make nvm.status`` to get the current status of you Node.js_ and nvm_ setup. + +Here is the output you will typically get on a Ubuntu 20.04 system which serves +only a `no longer active <https://nodejs.org/en/about/releases/>`_ Release +`Node.js v10.19.0 <https://packages.ubuntu.com/focal/nodejs>`_. + +:: + + $ make nvm.status + INFO: Node.js is installed at /usr/bin/node + INFO: Node.js is version v10.19.0 + WARN: minimal Node.js version is 16.13.0 + INFO: npm is installed at /usr/bin/npm + INFO: npm is version 6.14.4 + WARN: NVM is not installed + INFO: to install NVM and Node.js (LTS) use: manage nvm install --lts + +To install you can also use :ref:`make nvm.nodejs` + +.. _make nvm.nodejs: + +``make nvm.nodejs`` +=================== + +Install latest Node.js_ LTS locally (uses nvm_):: + + $ make nvm.nodejs + INFO: install (update) NVM at /share/searxng/.nvm + INFO: clone: https://github.com/nvm-sh/nvm.git + ... + Downloading and installing node v16.13.0... + ... + INFO: Node.js is installed at searxng/.nvm/versions/node/v16.13.0/bin/node + INFO: Node.js is version v16.13.0 + INFO: npm is installed at searxng/.nvm/versions/node/v16.13.0/bin/npm + INFO: npm is version 8.1.0 + INFO: NVM is installed at searxng/.nvm + .. _make run: ``make run`` @@ -133,14 +187,16 @@ browser (:man:`xdg-open`):: ``make clean`` ============== -Drop all intermediate files, all builds, but keep sources untouched. Before -calling ``make clean`` stop all processes using :ref:`make install`. :: +Drops all intermediate files, all builds, but keep sources untouched. Before +calling ``make clean`` stop all processes using the :ref:`make install` or +:ref:`make node.env`. :: $ make clean CLEAN pyenv - PYENV [virtualenv] drop ./local/py3 - CLEAN docs -- ./build/docs ./dist/docs - CLEAN locally installed npm dependencies + PYENV [virtualenv] drop local/py3 + CLEAN docs -- build/docs dist/docs + CLEAN themes -- locally installed npm dependencies + ... CLEAN test stuff CLEAN common files diff --git a/docs/dev/quickstart.rst b/docs/dev/quickstart.rst index fee09216e..d2b666c09 100644 --- a/docs/dev/quickstart.rst +++ b/docs/dev/quickstart.rst @@ -5,13 +5,14 @@ Development Quickstart ====================== .. _npm: https://www.npmjs.com/ +.. _Node.js: https://nodejs.org/ SearXNG loves developers, just clone and start hacking. All the rest is done for you simply by using :ref:`make <makefile>`. .. code:: sh - git clone https://github.com/searxng/searxng.git searx + git clone https://github.com/searxng/searxng.git searxng Here is how a minimal workflow looks like: @@ -24,37 +25,27 @@ choose a meaningful commit message and we are happy to receive your pull request. To not end in *wild west* we have some directives, please pay attention to our ":ref:`how to contribute`" guideline. -If you implement themes, you will need to compile styles and JavaScript before -*run*. +If you implement themes, you will need to setup a :ref:`make node.env` once: .. code:: sh - make themes.all - -Don't forget to install npm_ first. - -.. tabs:: - - .. group-tab:: Ubuntu / debian - - .. code:: sh + make node.env - sudo -H apt-get install npm +Before you call *make run* (2.), you need to compile the modified styles and +JavaScript: - .. group-tab:: Arch Linux - - .. code-block:: sh - - sudo -H pacman -S npm +.. code:: sh - .. group-tab:: Fedora / RHEL + make themes.all - .. code-block:: sh +Alternatively you can also compile selective the theme you have modified, +e.g. the *simple* theme. +.. code:: sh - sudo -H dnf install npm + make themes.simple If you finished your *tests* you can start to commit your changes. To separate -the changed code from the build products first run: +the modified source code from the build products first run: .. code:: sh diff --git a/docs/dev/search_api.rst b/docs/dev/search_api.rst index 552b0ff84..ce7237677 100644 --- a/docs/dev/search_api.rst +++ b/docs/dev/search_api.rst @@ -25,7 +25,7 @@ Parameters ``q`` : required The search query. This string is passed to external search services. Thus, SearXNG supports syntax of each search service. For example, ``site:github.com - searx`` is a valid query for Google. However, if simply the query above is + SearXNG`` is a valid query for Google. However, if simply the query above is passed to any search engine which does not filter its results based on this syntax, you might not get the results you wanted. @@ -62,7 +62,7 @@ Parameters ``image_proxy`` : default ``False`` [ ``True``, ``False`` ] - Proxy image results through searx. + Proxy image results through SearXNG. ``autocomplete`` : default *empty* [ ``google``, ``dbpedia``, ``duckduckgo``, ``startpage``, ``wikipedia`` ] |