searxng.rst 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. .. template evaluated by: ./utils/searxng.sh searxng.doc.rst
  2. .. hint: all dollar-names are variables, dollar sign itself is quoted by: \\$
  3. .. START distro-packages
  4. .. tabs::
  5. .. group-tab:: Ubuntu / debian
  6. .. code-block:: sh
  7. $ sudo -H apt-get install -y \\
  8. ${debian}
  9. .. group-tab:: Arch Linux
  10. .. code-block:: sh
  11. $ sudo -H pacman -S --noconfirm \\
  12. ${arch}
  13. .. group-tab:: Fedora / RHEL
  14. .. code-block:: sh
  15. $ sudo -H dnf install -y \\
  16. ${fedora}
  17. .. END distro-packages
  18. .. START build-packages
  19. .. tabs::
  20. .. group-tab:: Ubuntu / debian
  21. .. code-block:: sh
  22. $ sudo -H apt-get install -y \\
  23. ${debian_build}
  24. .. group-tab:: Arch Linux
  25. .. code-block:: sh
  26. $ sudo -H pacman -S --noconfirm \\
  27. ${arch_build}
  28. .. group-tab:: Fedora / RHEL
  29. .. code-block:: sh
  30. $ sudo -H dnf install -y \\
  31. ${fedora_build}
  32. .. END build-packages
  33. .. START create user
  34. .. tabs::
  35. .. group-tab:: bash
  36. .. code-block:: sh
  37. $ sudo -H useradd --shell /bin/bash --system \\
  38. --home-dir \"$SERVICE_HOME\" \\
  39. --comment 'Privacy-respecting metasearch engine' \\
  40. $SERVICE_USER
  41. $ sudo -H mkdir \"$SERVICE_HOME\"
  42. $ sudo -H chown -R \"$SERVICE_GROUP:$SERVICE_GROUP\" \"$SERVICE_HOME\"
  43. .. END create user
  44. .. START clone searxng
  45. .. tabs::
  46. .. group-tab:: bash
  47. .. code-block:: sh
  48. $ sudo -H -u ${SERVICE_USER} -i
  49. (${SERVICE_USER})$ git clone \"$GIT_URL\" \\
  50. \"$SEARXNG_SRC\"
  51. .. END clone searxng
  52. .. START create virtualenv
  53. .. tabs::
  54. .. group-tab:: bash
  55. .. code-block:: sh
  56. (${SERVICE_USER})$ python3 -m venv \"${SEARXNG_PYENV}\"
  57. (${SERVICE_USER})$ echo \". ${SEARXNG_PYENV}/bin/activate\" \\
  58. >> \"$SERVICE_HOME/.profile\"
  59. .. END create virtualenv
  60. .. START manage.sh update_packages
  61. .. tabs::
  62. .. group-tab:: bash
  63. .. code-block:: sh
  64. $ sudo -H -u ${SERVICE_USER} -i
  65. (${SERVICE_USER})$ command -v python && python --version
  66. $SEARXNG_PYENV/bin/python
  67. Python 3.11.10
  68. # update pip's boilerplate ..
  69. pip install -U pip
  70. pip install -U setuptools
  71. pip install -U wheel
  72. pip install -U pyyaml
  73. # jump to SearXNG's working tree and install SearXNG into virtualenv
  74. (${SERVICE_USER})$ cd \"$SEARXNG_SRC\"
  75. (${SERVICE_USER})$ pip install --use-pep517 --no-build-isolation -e .
  76. .. END manage.sh update_packages
  77. .. START searxng config
  78. .. tabs::
  79. .. group-tab:: Use default settings
  80. .. code-block:: sh
  81. $ sudo -H mkdir -p \"$(dirname ${SEARXNG_SETTINGS_PATH})\"
  82. $ sudo -H cp \"$SEARXNG_SRC/utils/templates/etc/searxng/settings.yml\" \\
  83. \"${SEARXNG_SETTINGS_PATH}\"
  84. .. group-tab:: minimal setup
  85. .. code-block:: sh
  86. $ sudo -H sed -i -e \"s/ultrasecretkey/\$(openssl rand -hex 16)/g\" \\
  87. \"$SEARXNG_SETTINGS_PATH\"
  88. .. END searxng config
  89. .. START check searxng installation
  90. .. tabs::
  91. .. group-tab:: bash
  92. .. code-block:: sh
  93. # enable debug ..
  94. $ sudo -H sed -i -e \"s/debug : False/debug : True/g\" \"$SEARXNG_SETTINGS_PATH\"
  95. # start webapp
  96. $ sudo -H -u ${SERVICE_USER} -i
  97. (${SERVICE_USER})$ cd ${SEARXNG_SRC}
  98. (${SERVICE_USER})$ export SEARXNG_SETTINGS_PATH=\"${SEARXNG_SETTINGS_PATH}\"
  99. (${SERVICE_USER})$ python searx/webapp.py
  100. # disable debug
  101. $ sudo -H sed -i -e \"s/debug : True/debug : False/g\" \"$SEARXNG_SETTINGS_PATH\"
  102. Open WEB browser and visit http://$SEARXNG_INTERNAL_HTTP . If you are inside a
  103. container or in a script, test with curl:
  104. .. tabs::
  105. .. group-tab:: WEB browser
  106. .. code-block:: sh
  107. $ xdg-open http://$SEARXNG_INTERNAL_HTTP
  108. .. group-tab:: curl
  109. .. code-block:: none
  110. $ curl --location --verbose --head --insecure $SEARXNG_INTERNAL_HTTP
  111. * Trying 127.0.0.1:8888...
  112. * TCP_NODELAY set
  113. * Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
  114. > HEAD / HTTP/1.1
  115. > Host: 127.0.0.1:8888
  116. > User-Agent: curl/7.68.0
  117. > Accept: */*
  118. >
  119. * Mark bundle as not supporting multiuse
  120. * HTTP 1.0, assume close after body
  121. < HTTP/1.0 200 OK
  122. HTTP/1.0 200 OK
  123. ...
  124. .. END check searxng installation