searx.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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 \"https://github.com/searx/searx.git\" \"$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/use_default_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. $ sudo -H sed -i -e \"s/{instance_name}/searx@\$(uname -n)/g\" \"$SEARX_SETTINGS_PATH\"
  91. .. END searx config
  92. .. START check searx installation
  93. .. tabs::
  94. .. group-tab:: bash
  95. .. code-block:: sh
  96. # enable debug ..
  97. $ sudo -H sed -i -e \"s/debug : False/debug : True/g\" \"$SEARX_SETTINGS_PATH\"
  98. # start webapp
  99. $ sudo -H -u ${SERVICE_USER} -i
  100. (${SERVICE_USER})$ cd ${SEARX_SRC}
  101. (${SERVICE_USER})$ export SEARX_SETTINGS_PATH=\"${SEARX_SETTINGS_PATH}\"
  102. (${SERVICE_USER})$ python searx/webapp.py
  103. # disable debug
  104. $ sudo -H sed -i -e \"s/debug : True/debug : False/g\" \"$SEARX_SETTINGS_PATH\"
  105. Open WEB browser and visit http://$SEARX_INTERNAL_URL . If you are inside a
  106. container or in a script, test with curl:
  107. .. tabs::
  108. .. group-tab:: WEB browser
  109. .. code-block:: sh
  110. $ xdg-open http://$SEARX_INTERNAL_URL
  111. .. group-tab:: curl
  112. .. code-block:: none
  113. $ curl --location --verbose --head --insecure $SEARX_INTERNAL_URL
  114. * Trying 127.0.0.1:8888...
  115. * TCP_NODELAY set
  116. * Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
  117. > HEAD / HTTP/1.1
  118. > Host: 127.0.0.1:8888
  119. > User-Agent: curl/7.68.0
  120. > Accept: */*
  121. >
  122. * Mark bundle as not supporting multiuse
  123. * HTTP 1.0, assume close after body
  124. < HTTP/1.0 200 OK
  125. HTTP/1.0 200 OK
  126. ...
  127. .. END check searx installation