index.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>Admin’s tooling box &#8212; Searx Documentation (Searx-1.1.0.tex)</title>
  8. <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
  9. <link rel="stylesheet" type="text/css" href="../_static/searx.css" />
  10. <link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
  11. <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
  12. <script src="../_static/jquery.js"></script>
  13. <script src="../_static/underscore.js"></script>
  14. <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
  15. <script src="../_static/doctools.js"></script>
  16. <script src="../_static/sphinx_highlight.js"></script>
  17. <link rel="index" title="Index" href="../genindex.html" />
  18. <link rel="search" title="Search" href="../search.html" />
  19. <link rel="next" title="utils/searx.sh" href="searx.sh.html" />
  20. <link rel="prev" title="searx_extra/standalone_searx.py" href="../searx_extra/standalone_searx.py.html" />
  21. </head><body>
  22. <div class="related" role="navigation" aria-label="related navigation">
  23. <h3>Navigation</h3>
  24. <ul>
  25. <li class="right" style="margin-right: 10px">
  26. <a href="../genindex.html" title="General Index"
  27. accesskey="I">index</a></li>
  28. <li class="right" >
  29. <a href="../py-modindex.html" title="Python Module Index"
  30. >modules</a> |</li>
  31. <li class="right" >
  32. <a href="searx.sh.html" title="utils/searx.sh"
  33. accesskey="N">next</a> |</li>
  34. <li class="right" >
  35. <a href="../searx_extra/standalone_searx.py.html" title="searx_extra/standalone_searx.py"
  36. accesskey="P">previous</a> |</li>
  37. <li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.1.0.tex)</a> &#187;</li>
  38. <li class="nav-item nav-item-this"><a href="">Admin’s tooling box</a></li>
  39. </ul>
  40. </div>
  41. <div class="document">
  42. <div class="documentwrapper">
  43. <div class="bodywrapper">
  44. <div class="body" role="main">
  45. <section id="admin-s-tooling-box">
  46. <span id="toolboxing"></span><span id="searx-utils"></span><h1>Admin’s tooling box<a class="headerlink" href="#admin-s-tooling-box" title="Permalink to this heading">¶</a></h1>
  47. <p>In the folder <a class="reference external" href="https://github.com/searx/searx/blob/master/utils/">Origin: utils/</a> we maintain some tools useful for administrators.</p>
  48. <div class="toctree-wrapper compound">
  49. <p class="caption" role="heading"><span class="caption-text">Contents</span></p>
  50. <ul>
  51. <li class="toctree-l1"><a class="reference internal" href="searx.sh.html"><code class="docutils literal notranslate"><span class="pre">utils/searx.sh</span></code></a><ul>
  52. <li class="toctree-l2"><a class="reference internal" href="searx.sh.html#install">Install</a></li>
  53. <li class="toctree-l2"><a class="reference internal" href="searx.sh.html#overview">Overview</a></li>
  54. </ul>
  55. </li>
  56. <li class="toctree-l1"><a class="reference internal" href="filtron.sh.html"><code class="docutils literal notranslate"><span class="pre">utils/filtron.sh</span></code></a><ul>
  57. <li class="toctree-l2"><a class="reference internal" href="filtron.sh.html#create-user">Create user</a></li>
  58. <li class="toctree-l2"><a class="reference internal" href="filtron.sh.html#install-go">Install go</a></li>
  59. <li class="toctree-l2"><a class="reference internal" href="filtron.sh.html#install-filtron">Install filtron</a></li>
  60. <li class="toctree-l2"><a class="reference internal" href="filtron.sh.html#overview">Overview</a></li>
  61. </ul>
  62. </li>
  63. <li class="toctree-l1"><a class="reference internal" href="morty.sh.html"><code class="docutils literal notranslate"><span class="pre">utils/morty.sh</span></code></a><ul>
  64. <li class="toctree-l2"><a class="reference internal" href="morty.sh.html#create-user">Create user</a></li>
  65. <li class="toctree-l2"><a class="reference internal" href="morty.sh.html#install-go">Install go</a></li>
  66. <li class="toctree-l2"><a class="reference internal" href="morty.sh.html#install-morty">Install morty</a></li>
  67. <li class="toctree-l2"><a class="reference internal" href="morty.sh.html#overview">Overview</a></li>
  68. </ul>
  69. </li>
  70. <li class="toctree-l1"><a class="reference internal" href="lxc.sh.html"><code class="docutils literal notranslate"><span class="pre">utils/lxc.sh</span></code></a><ul>
  71. <li class="toctree-l2"><a class="reference internal" href="lxc.sh.html#install-suite">Install suite</a></li>
  72. <li class="toctree-l2"><a class="reference internal" href="lxc.sh.html#running-commands">Running commands</a></li>
  73. <li class="toctree-l2"><a class="reference internal" href="lxc.sh.html#setup-searx-buildhost">Setup searx buildhost</a></li>
  74. <li class="toctree-l2"><a class="reference internal" href="lxc.sh.html#overview">Overview</a></li>
  75. <li class="toctree-l2"><a class="reference internal" href="lxc.sh.html#searx-suite">searx suite</a></li>
  76. </ul>
  77. </li>
  78. </ul>
  79. </div>
  80. <section id="common-commands-environment">
  81. <span id="toolboxing-common"></span><h2>Common commands &amp; environment<a class="headerlink" href="#common-commands-environment" title="Permalink to this heading">¶</a></h2>
  82. <p>Scripts to maintain services often dispose of common commands and environments.</p>
  83. <dl>
  84. <dt><code class="docutils literal notranslate"><span class="pre">shell</span></code><span class="classifier">command</span></dt><dd><p>Opens a shell from the service user <code class="docutils literal notranslate"><span class="pre">${SERVICE_USSR}</span></code>, very helpful for
  85. troubleshooting.</p>
  86. </dd>
  87. <dt><code class="docutils literal notranslate"><span class="pre">inspect</span> <span class="pre">service</span></code><span class="classifier">command</span></dt><dd><p>Shows status and log of the service, most often you have a option to enable
  88. more verbose debug logs. Very helpful for debugging, but be careful not to
  89. enable debugging in a production environment!</p>
  90. </dd>
  91. <dt><code class="docutils literal notranslate"><span class="pre">FORCE_TIMEOUT</span></code><span class="classifier">environment</span></dt><dd><p>Sets timeout for interactive prompts. If you want to run a script in batch
  92. job, with defaults choices, set <code class="docutils literal notranslate"><span class="pre">FORCE_TIMEOUT=0</span></code>. By example; to install a
  93. reverse proxy for filtron on all containers of the <a class="reference internal" href="lxc.sh.html#lxc-searx-env"><span class="std std-ref">searx suite</span></a> use</p>
  94. <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>sudo -H ./utils/lxc.sh cmd -- FORCE_TIMEOUT=0 ./utils/filtron.sh apache install
  95. </pre></div>
  96. </div>
  97. </dd>
  98. </dl>
  99. </section>
  100. <section id="tooling-box-setup">
  101. <span id="toolboxing-setup"></span><h2>Tooling box setup<a class="headerlink" href="#tooling-box-setup" title="Permalink to this heading">¶</a></h2>
  102. <p>The main setup is done in the <a class="reference external" href="https://github.com/searx/searx/blob/master/.config.sh">Origin: .config.sh</a> (read also <a class="reference internal" href="../admin/settings.html#settings-global"><span class="std std-ref">Global Settings</span></a>).</p>
  103. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># -*- coding: utf-8; mode: sh -*-</span>
  104. <span class="c1"># SPDX-License-Identifier: AGPL-3.0-or-later</span>
  105. <span class="c1"># shellcheck shell=bash disable=SC2034</span>
  106. <span class="c1">#</span>
  107. <span class="c1"># This environment is used by ./utils scripts like filtron.sh or searx.sh. The</span>
  108. <span class="c1"># default values are *most flexible* and *best maintained*, you normally not</span>
  109. <span class="c1"># need to change the defaults (except PUBLIC_URL).</span>
  110. <span class="c1">#</span>
  111. <span class="c1"># Before you change any value here you have to uninstall any previous</span>
  112. <span class="c1"># installation. Further is it recommended to backup your changes simply by</span>
  113. <span class="c1"># adding them to you local brand (git branch)::</span>
  114. <span class="c1">#</span>
  115. <span class="c1"># git add .config</span>
  116. <span class="c1"># The public URL of the searx instance: PUBLIC_URL=&quot;https://mydomain.xy/searx&quot;</span>
  117. <span class="c1"># The default is taken from ./utils/brand.env.</span>
  118. <span class="nv">PUBLIC_URL</span><span class="o">=</span><span class="s2">&quot;</span><span class="si">${</span><span class="nv">SEARX_URL</span><span class="si">}</span><span class="s2">&quot;</span>
  119. <span class="k">if</span> <span class="o">[[</span> <span class="si">${</span><span class="nv">PUBLIC_URL</span><span class="si">}</span> <span class="o">==</span> <span class="s2">&quot;https://searx.me&quot;</span> <span class="o">]]</span><span class="p">;</span> <span class="k">then</span>
  120. <span class="c1"># hint: Linux containers do not have DNS entries, lets use IPs</span>
  121. <span class="nv">PUBLIC_URL</span><span class="o">=</span><span class="s2">&quot;http://</span><span class="k">$(</span>primary_ip<span class="k">)</span><span class="s2">/searx&quot;</span>
  122. <span class="k">fi</span>
  123. <span class="c1"># searx.sh</span>
  124. <span class="c1"># ---------</span>
  125. <span class="c1"># SEARX_INTERNAL_URL=&quot;127.0.0.1:8888&quot;</span>
  126. <span class="c1"># SEARX_SETTINGS_TEMPLATE=&quot;${REPO_ROOT}/utils/templates/etc/searx/use_default_settings.yml&quot;</span>
  127. <span class="c1"># Only change, if you maintain a searx brand in your searx fork (GIT_URL) which</span>
  128. <span class="c1"># is not hold by branch &#39;master&#39;. The branch has to be a local branch, in the</span>
  129. <span class="c1"># repository from which you install (which is most often the case). If you want</span>
  130. <span class="c1"># to install branch &#39;foo&#39;, don&#39;t forget to run &#39;git branch foo origin/foo&#39; once.</span>
  131. <span class="c1"># GIT_BRANCH=&quot;${GIT_BRANCH:-master}&quot;</span>
  132. <span class="c1"># filtron.sh</span>
  133. <span class="c1"># ----------</span>
  134. <span class="c1"># FILTRON_API=&quot;127.0.0.1:4005&quot;</span>
  135. <span class="c1"># FILTRON_LISTEN=&quot;127.0.0.1:4004&quot;</span>
  136. <span class="c1"># FILTRON_TARGET=&quot;127.0.0.1:8888&quot;</span>
  137. <span class="c1"># morty.sh</span>
  138. <span class="c1"># --------</span>
  139. <span class="c1"># morty listen address</span>
  140. <span class="c1"># MORTY_LISTEN=&quot;127.0.0.1:3000&quot;</span>
  141. <span class="c1"># PUBLIC_URL_PATH_MORTY=&quot;/morty/&quot;</span>
  142. <span class="c1"># system services</span>
  143. <span class="c1"># ---------------</span>
  144. <span class="c1"># Common $HOME folder of the service accounts</span>
  145. <span class="c1"># SERVICE_HOME_BASE=&quot;/usr/local&quot;</span>
  146. <span class="c1"># **experimental**: Set SERVICE_USER to run all services by one account, but be</span>
  147. <span class="c1"># aware that removing discrete components might conflict!</span>
  148. <span class="c1"># SERVICE_USER=searx</span>
  149. </pre></div>
  150. </div>
  151. </section>
  152. </section>
  153. <div class="clearer"></div>
  154. </div>
  155. </div>
  156. </div>
  157. <span id="sidebar-top"></span>
  158. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  159. <div class="sphinxsidebarwrapper">
  160. <p class="logo"><a href="../index.html">
  161. <img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
  162. </a></p>
  163. <h3>Project Links</h3>
  164. <ul>
  165. <li><a href="https://searx.github.io/searx/blog/index.html">Blog</a>
  166. <li><a href="https://github.com/searx/searx">Source</a>
  167. <li><a href="https://github.com/searx/searx/wiki">Wiki</a>
  168. <li><a href="https://twitter.com/Searx_engine">Twitter</a>
  169. <li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
  170. </ul><h3>Navigation</h3>
  171. <ul>
  172. <li><a href="../index.html">Overview</a>
  173. <ul>
  174. <li>Previous: <a href="../searx_extra/standalone_searx.py.html" title="previous chapter"><code class="docutils literal notranslate"><span class="pre">searx_extra/standalone_searx.py</span></code></a>
  175. <li>Next: <a href="searx.sh.html" title="next chapter"><code class="docutils literal notranslate"><span class="pre">utils/searx.sh</span></code></a>
  176. </ul>
  177. </li>
  178. </ul>
  179. <div id="searchbox" style="display: none" role="search">
  180. <h3 id="searchlabel">Quick search</h3>
  181. <div class="searchformwrapper">
  182. <form class="search" action="../search.html" method="get">
  183. <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
  184. <input type="submit" value="Go" />
  185. </form>
  186. </div>
  187. </div>
  188. <script>document.getElementById('searchbox').style.display = "block"</script>
  189. </div>
  190. </div>
  191. <div class="clearer"></div>
  192. </div>
  193. <div class="footer" role="contentinfo">
  194. &#169; Copyright 2015-2022, Adam Tauber, Noémi Ványi.
  195. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
  196. </div>
  197. <script src="../_static/version_warning_offset.js"></script>
  198. </body>
  199. </html>