searx.rst 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. .. template evaluated by: ./utils/searx.sh docs
  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' $SERVICE_USER
  40. $ sudo -H mkdir \"$SERVICE_HOME\"
  41. $ sudo -H chown -R \"$SERVICE_GROUP:$SERVICE_GROUP\" \"$SERVICE_HOME\"
  42. .. END create user
  43. .. START clone searx
  44. .. tabs::
  45. .. group-tab:: bash
  46. .. code-block:: sh
  47. $ sudo -H -u ${SERVICE_USER} -i
  48. (${SERVICE_USER})$ git clone \"$GIT_URL\" \"$SEARX_SRC\"
  49. .. END clone searx
  50. .. START create virtualenv
  51. .. tabs::
  52. .. group-tab:: bash
  53. .. code-block:: sh
  54. (${SERVICE_USER})$ python3 -m venv \"${SEARX_PYENV}\"
  55. (${SERVICE_USER})$ echo \". ${SEARX_PYENV}/bin/activate\" >> \"$SERVICE_HOME/.profile\"
  56. .. END create virtualenv
  57. .. START manage.sh update_packages
  58. .. tabs::
  59. .. group-tab:: bash
  60. .. code-block:: sh
  61. $ sudo -H -u ${SERVICE_USER} -i
  62. (${SERVICE_USER})$ command -v python && python --version
  63. $SEARX_PYENV/bin/python
  64. Python 3.8.1
  65. # update pip's boilerplate ..
  66. pip install -U pip
  67. pip install -U setuptools
  68. pip install -U wheel
  69. pip install -U pyyaml
  70. # jump to searx's working tree and install searx into virtualenv
  71. (${SERVICE_USER})$ cd \"$SEARX_SRC\"
  72. (${SERVICE_USER})$ pip install -e .
  73. .. END manage.sh update_packages
  74. .. START searx config
  75. .. tabs::
  76. .. group-tab:: Use default settings
  77. .. code-block:: sh
  78. $ sudo -H mkdir -p \"$(dirname ${SEARX_SETTINGS_PATH})\"
  79. $ sudo -H cp \"$SEARX_SRC/utils/templates/etc/searx/settings.yml\" \\
  80. \"${SEARX_SETTINGS_PATH}\"
  81. .. group-tab:: searx/settings.yml
  82. .. code-block:: sh
  83. $ sudo -H mkdir -p \"$(dirname ${SEARX_SETTINGS_PATH})\"
  84. $ sudo -H cp \"$SEARX_SRC/searx/settings.yml\" \\
  85. \"${SEARX_SETTINGS_PATH}\"
  86. .. tabs::
  87. .. group-tab:: minimal setup
  88. .. code-block:: sh
  89. $ sudo -H sed -i -e \"s/ultrasecretkey/\$(openssl rand -hex 16)/g\" \"$SEARX_SETTINGS_PATH\"
  90. .. END searx config
  91. .. START check searx installation
  92. .. tabs::
  93. .. group-tab:: bash
  94. .. code-block:: sh
  95. # enable debug ..
  96. $ sudo -H sed -i -e \"s/debug : False/debug : True/g\" \"$SEARX_SETTINGS_PATH\"
  97. # start webapp
  98. $ sudo -H -u ${SERVICE_USER} -i
  99. (${SERVICE_USER})$ cd ${SEARX_SRC}
  100. (${SERVICE_USER})$ export SEARX_SETTINGS_PATH=\"${SEARX_SETTINGS_PATH}\"
  101. (${SERVICE_USER})$ python searx/webapp.py
  102. # disable debug
  103. $ sudo -H sed -i -e \"s/debug : True/debug : False/g\" \"$SEARX_SETTINGS_PATH\"
  104. Open WEB browser and visit http://$SEARX_INTERNAL_HTTP . If you are inside a
  105. container or in a script, test with curl:
  106. .. tabs::
  107. .. group-tab:: WEB browser
  108. .. code-block:: sh
  109. $ xdg-open http://$SEARX_INTERNAL_HTTP
  110. .. group-tab:: curl
  111. .. code-block:: none
  112. $ curl --location --verbose --head --insecure $SEARX_INTERNAL_HTTP
  113. * Trying 127.0.0.1:8888...
  114. * TCP_NODELAY set
  115. * Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
  116. > HEAD / HTTP/1.1
  117. > Host: 127.0.0.1:8888
  118. > User-Agent: curl/7.68.0
  119. > Accept: */*
  120. >
  121. * Mark bundle as not supporting multiuse
  122. * HTTP 1.0, assume close after body
  123. < HTTP/1.0 200 OK
  124. HTTP/1.0 200 OK
  125. ...
  126. .. END check searx installation