lxcdev.html 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. <!DOCTYPE html>
  2. <html lang="en" data-content_root="../">
  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>Developing in Linux Containers &#8212; SearXNG Documentation (2025.4.30+fd33559cf)</title>
  8. <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=6625fa76" />
  9. <link rel="stylesheet" type="text/css" href="../_static/searxng.css?v=52e4ff28" />
  10. <link rel="stylesheet" type="text/css" href="../_static/tabs.css?v=a5c4661c" />
  11. <script src="../_static/documentation_options.js?v=b12b0e12"></script>
  12. <script src="../_static/doctools.js?v=9a2dae69"></script>
  13. <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
  14. <script data-project="searxng" data-version="2025.4.30+fd33559cf" src="../_static/describe_version.js?v=fa7f30d0"></script>
  15. <script src="../_static/tabs.js?v=3030b3cb"></script>
  16. <link rel="index" title="Index" href="../genindex.html" />
  17. <link rel="search" title="Search" href="../search.html" />
  18. <link rel="next" title="Makefile &amp; ./manage" href="makefile.html" />
  19. <link rel="prev" title="Translation" href="translation.html" />
  20. </head><body>
  21. <div class="related" role="navigation" aria-label="Related">
  22. <h3>Navigation</h3>
  23. <ul>
  24. <li class="right" style="margin-right: 10px">
  25. <a href="../genindex.html" title="General Index"
  26. accesskey="I">index</a></li>
  27. <li class="right" >
  28. <a href="../py-modindex.html" title="Python Module Index"
  29. >modules</a> |</li>
  30. <li class="right" >
  31. <a href="makefile.html" title="Makefile &amp; ./manage"
  32. accesskey="N">next</a> |</li>
  33. <li class="right" >
  34. <a href="translation.html" title="Translation"
  35. accesskey="P">previous</a> |</li>
  36. <li class="nav-item nav-item-0"><a href="../index.html">SearXNG Documentation (2025.4.30+fd33559cf)</a> &#187;</li>
  37. <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Developer documentation</a> &#187;</li>
  38. <li class="nav-item nav-item-this"><a href="">Developing in Linux Containers</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="developing-in-linux-containers">
  46. <span id="lxcdev"></span><h1>Developing in Linux Containers<a class="headerlink" href="#developing-in-linux-containers" title="Link to this heading">¶</a></h1>
  47. <p>In this article we will show, how you can make use of Linux Containers (<a class="reference external" href="https://linuxcontainers.org/lxc/introduction/">LXC</a>) in
  48. <em>distributed and heterogeneous development cycles</em> (TL;DR; jump to the
  49. <a class="reference internal" href="#lxcdev-summary"><span class="std std-ref">Summary</span></a>).</p>
  50. <aside class="sidebar">
  51. <p class="sidebar-title">Audience</p>
  52. <p>This blog post is written for experienced admins and developers. Readers
  53. should have a serious meaning about the terms: <em>distributed</em>, <em>merge</em> and
  54. <em>linux container</em>.</p>
  55. <p><strong>hint</strong></p>
  56. <p>If you have issues with the internet connectivity of your containers read
  57. section <a class="reference internal" href="../utils/lxc.sh.html#internet-connectivity-docker"><span class="std std-ref">Internet Connectivity &amp; Docker</span></a>.</p>
  58. </aside>
  59. <nav class="contents local" id="contents">
  60. <ul class="simple">
  61. <li><p><a class="reference internal" href="#motivation" id="id1">Motivation</a></p></li>
  62. <li><p><a class="reference internal" href="#gentlemen-start-your-engines" id="id2">Gentlemen, start your engines!</a></p></li>
  63. <li><p><a class="reference internal" href="#in-containers-work-as-usual" id="id3">In containers, work as usual</a></p></li>
  64. <li><p><a class="reference internal" href="#wrap-production-into-developer-suite" id="id4">Wrap production into developer suite</a></p></li>
  65. <li><p><a class="reference internal" href="#summary" id="id5">Summary</a></p></li>
  66. </ul>
  67. </nav>
  68. <section id="motivation">
  69. <h2><a class="toc-backref" href="#id1" role="doc-backlink">Motivation</a><a class="headerlink" href="#motivation" title="Link to this heading">¶</a></h2>
  70. <p>Most often in our development cycle, we edit the sources and run some test
  71. and/or builds by using <code class="docutils literal notranslate"><span class="pre">make</span></code> <a class="reference internal" href="makefile.html#makefile"><span class="std std-ref">[ref]</span></a> before we commit. This
  72. cycle is simple and perfect but might fail in some aspects we should not
  73. overlook.</p>
  74. <blockquote>
  75. <div><p><strong>The environment in which we run all our development processes matters!</strong></p>
  76. </div></blockquote>
  77. <p>The <a class="reference internal" href="makefile.html#makefile"><span class="std std-ref">Makefile &amp; ./manage</span></a> and the <a class="reference internal" href="makefile.html#make-install"><span class="std std-ref">Python environment (make install)</span></a> encapsulate a lot for us, but
  78. these tools do not have access to all prerequisites. For example, there may
  79. have dependencies on packages that are installed on developer’s desktop, but
  80. usually are not preinstalled on a server or client system. Another example is;
  81. settings have been made to the software on developer’s desktop that would never
  82. be set on a <em>production</em> system.</p>
  83. <blockquote>
  84. <div><p><strong>Linux Containers are isolate environments</strong>, we use them to not mix up all
  85. the prerequisites from various projects on developer’s desktop.</p>
  86. </div></blockquote>
  87. <p>The scripts from <a class="reference internal" href="../utils/index.html#searx-utils"><span class="std std-ref">DevOps tooling box</span></a> can divide in those to install and maintain
  88. software</p>
  89. <ul class="simple">
  90. <li><p><a class="reference internal" href="../utils/searxng.sh.html#searxng-sh"><span class="std std-ref">utils/searxng.sh</span></a></p></li>
  91. </ul>
  92. <p>and the script</p>
  93. <ul class="simple">
  94. <li><p><a class="reference internal" href="../utils/lxc.sh.html#lxc-sh"><span class="std std-ref">utils/lxc.sh</span></a></p></li>
  95. </ul>
  96. <p>with we can scale our installation, maintenance or even development tasks over a
  97. stack of isolated containers / what we call the:</p>
  98. <ul class="simple">
  99. <li><p><a class="reference internal" href="../utils/lxc.sh.html#searxng-lxc-suite"><span class="std std-ref">SearXNG LXC suite</span></a></p></li>
  100. </ul>
  101. </section>
  102. <section id="gentlemen-start-your-engines">
  103. <span id="lxcdev-install-searxng"></span><h2><a class="toc-backref" href="#id2" role="doc-backlink">Gentlemen, start your engines!</a><a class="headerlink" href="#gentlemen-start-your-engines" title="Link to this heading">¶</a></h2>
  104. <p>Before you can start with containers, you need to install and initiate <a class="reference external" href="https://linuxcontainers.org/lxd/introduction/">LXD</a>
  105. once:</p>
  106. <div class="sphinx-tabs docutils container">
  107. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-0-ZGVza3RvcCAoSE9TVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-0-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="0">desktop (HOST)</button></div><div aria-labelledby="tab-0-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" id="panel-0-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>snap<span class="w"> </span>install<span class="w"> </span>lxd
  108. $<span class="w"> </span>lxd<span class="w"> </span>init<span class="w"> </span>--auto
  109. </pre></div>
  110. </div>
  111. </div></div>
  112. <p>And you need to clone from origin or if you have your own fork, clone from your
  113. fork:</p>
  114. <div class="sphinx-tabs docutils container">
  115. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-1-ZGVza3RvcCAoSE9TVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-1-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="0">desktop (HOST)</button></div><div aria-labelledby="tab-1-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" id="panel-1-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>~/Downloads
  116. $<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/searxng/searxng.git<span class="w"> </span>searxng
  117. $<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>searxng
  118. </pre></div>
  119. </div>
  120. </div></div>
  121. <aside class="sidebar">
  122. <p class="sidebar-title">The <code class="docutils literal notranslate"><span class="pre">searxng-archlinux</span></code> container</p>
  123. <p>is the base of all our exercises here.</p>
  124. </aside>
  125. <p>The <a class="reference internal" href="../utils/lxc.sh.html#lxc-searxng-env"><span class="std std-ref">SearXNG suite config</span></a> consists of several images, see <code class="docutils literal notranslate"><span class="pre">export</span>
  126. <span class="pre">LXC_SUITE=(...</span></code> near by <a class="extlink-origin reference external" href="https://github.com/searxng/searxng/blob/master/utils/lxc-searxng.env#L19">git://utils/lxc-searxng.env#L19</a>.
  127. For this blog post we exercise on a <a class="reference external" href="https://www.archlinux.org/">archlinux</a> image. The container of this
  128. image is named <code class="docutils literal notranslate"><span class="pre">searxng-archlinux</span></code>.</p>
  129. <p>Lets build the container, but be sure that this container does not already
  130. exists, so first lets remove possible old one:</p>
  131. <div class="sphinx-tabs docutils container">
  132. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-2-ZGVza3RvcCAoSE9TVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-2-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="0">desktop (HOST)</button></div><div aria-labelledby="tab-2-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" id="panel-2-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>remove<span class="w"> </span>searxng-archlinux
  133. $<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>build<span class="w"> </span>searxng-archlinux
  134. </pre></div>
  135. </div>
  136. </div></div>
  137. <aside class="sidebar">
  138. <p class="sidebar-title">further read</p>
  139. <ul class="simple">
  140. <li><p><a class="reference internal" href="../utils/lxc.sh.html#lxc-sh-install-suite"><span class="std std-ref">Install suite</span></a></p></li>
  141. <li><p><a class="reference internal" href="../admin/installation-nginx.html#installation-nginx"><span class="std std-ref">NGINX</span></a></p></li>
  142. </ul>
  143. </aside>
  144. <p>To install the complete <a class="reference internal" href="../utils/lxc.sh.html#searxng-lxc-suite"><span class="std std-ref">SearXNG suite</span></a> and the HTTP
  145. proxy <a class="reference internal" href="../admin/installation-nginx.html#installation-nginx"><span class="std std-ref">NGINX</span></a> into the archlinux container run:</p>
  146. <div class="sphinx-tabs docutils container">
  147. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-3-ZGVza3RvcCAoSE9TVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-3-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="0">desktop (HOST)</button></div><div aria-labelledby="tab-3-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" id="panel-3-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>install<span class="w"> </span>suite<span class="w"> </span>searxng-archlinux
  148. $<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>--<span class="w"> </span><span class="nv">FORCE_TIMEOUT</span><span class="o">=</span><span class="m">0</span><span class="w"> </span>./utils/searxng.sh<span class="w"> </span>install<span class="w"> </span>nginx
  149. $<span class="w"> </span>sudo<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>show<span class="w"> </span>suite<span class="w"> </span><span class="p">|</span><span class="w"> </span>grep<span class="w"> </span>SEARXNG_URL
  150. ...
  151. <span class="o">[</span>searxng-archlinux<span class="o">]</span><span class="w"> </span>SEARXNG_URL<span class="w"> </span>:<span class="w"> </span>http://n.n.n.140/searxng
  152. </pre></div>
  153. </div>
  154. </div></div>
  155. <aside class="sidebar">
  156. <p class="sidebar-title">Fully functional SearXNG suite</p>
  157. <p>From here on you have a fully functional SearXNG suite (including a
  158. <a class="reference internal" href="../src/searx.redisdb.html#redis-db"><span class="std std-ref">Redis DB</span></a>).</p>
  159. </aside>
  160. <p>In such a SearXNG suite admins can maintain and access the debug log of the
  161. services quite easy.</p>
  162. <p>In the example above the SearXNG instance in the container is wrapped to
  163. <code class="docutils literal notranslate"><span class="pre">http://n.n.n.140/searxng</span></code> to the HOST system. Note, on your HOST system, the
  164. IP of your <code class="docutils literal notranslate"><span class="pre">searxng-archlinux</span></code> container is different to this example. To
  165. test the instance in the container from outside of the container, in your WEB
  166. browser on your desktop just open the URL reported in your installation</p>
  167. </section>
  168. <section id="in-containers-work-as-usual">
  169. <span id="working-in-containers"></span><h2><a class="toc-backref" href="#id3" role="doc-backlink">In containers, work as usual</a><a class="headerlink" href="#in-containers-work-as-usual" title="Link to this heading">¶</a></h2>
  170. <p>Usually you open a root-bash using <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">-H</span> <span class="pre">bash</span></code>. In case of LXC containers
  171. open the root-bash in the container is done by the <code class="docutils literal notranslate"><span class="pre">./utils/lxc.sh</span> <span class="pre">cmd</span>
  172. <span class="pre">searxng-archlinux</span></code> command:</p>
  173. <div class="sphinx-tabs docutils container">
  174. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-4-ZGVza3RvcCAoSE9TVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-4-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="0">desktop (HOST)</button></div><div aria-labelledby="tab-4-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" id="panel-4-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span>bash
  175. INFO:<span class="w"> </span><span class="o">[</span>searxng-archlinux<span class="o">]</span><span class="w"> </span>bash
  176. <span class="o">[</span>root@searxng-archlinux<span class="w"> </span>SearXNG<span class="o">]</span>$
  177. </pre></div>
  178. </div>
  179. </div></div>
  180. <p>The prompt <code class="docutils literal notranslate"><span class="pre">[root&#64;searxng-archlinux</span> <span class="pre">...]</span></code> signals, that you are the root user
  181. in the container (GUEST). To debug the running SearXNG instance use:</p>
  182. <div class="sphinx-tabs docutils container">
  183. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-5-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-5-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tab" tabindex="0"><code class="docutils literal notranslate"><span class="pre">[root&#64;searxng-archlinux</span> <span class="pre">SearXNG]</span></code> (GUEST)</button><button aria-controls="panel-5-ZGVza3RvcCAoSE9TVCk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-5-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="-1">desktop (HOST)</button></div><div aria-labelledby="tab-5-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" class="sphinx-tabs-panel group-tab" id="panel-5-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>./utils/searxng.sh<span class="w"> </span>instance<span class="w"> </span>inspect
  184. ...
  185. use<span class="w"> </span><span class="o">[</span>CTRL-C<span class="o">]</span><span class="w"> </span>to<span class="w"> </span>stop<span class="w"> </span>monitoring<span class="w"> </span>the<span class="w"> </span>log
  186. ...
  187. </pre></div>
  188. </div>
  189. </div><div aria-labelledby="tab-5-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-5-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span>./utils/searxng.sh<span class="w"> </span>instance<span class="w"> </span>inspect
  190. ...
  191. use<span class="w"> </span><span class="o">[</span>CTRL-C<span class="o">]</span><span class="w"> </span>to<span class="w"> </span>stop<span class="w"> </span>monitoring<span class="w"> </span>the<span class="w"> </span>log
  192. ...
  193. </pre></div>
  194. </div>
  195. </div></div>
  196. <p>Back in the browser on your desktop open the service <a class="reference external" href="http://n.n.n.140/searxng">http://n.n.n.140/searxng</a>
  197. and run your application tests while the debug log is shown in the terminal from
  198. above. You can stop monitoring using <code class="docutils literal notranslate"><span class="pre">CTRL-C</span></code>, this also disables the <em>“debug
  199. option”</em> in SearXNG’s settings file and restarts the SearXNG uwsgi application.</p>
  200. <p>Another point we have to notice is that the service <a class="reference internal" href="../utils/searxng.sh.html#searxng-sh"><span class="std std-ref">SearXNG</span></a>
  201. runs under dedicated system user account with the same name (compare
  202. <a class="reference internal" href="../admin/installation-searxng.html#create-searxng-user"><span class="std std-ref">Create user</span></a>). To get a login shell from these accounts, simply
  203. call:</p>
  204. <div class="sphinx-tabs docutils container">
  205. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-6-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-6-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tab" tabindex="0"><code class="docutils literal notranslate"><span class="pre">[root&#64;searxng-archlinux</span> <span class="pre">SearXNG]</span></code> (GUEST)</button><button aria-controls="panel-6-ZGVza3RvcCAoSE9TVCk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-6-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="-1">desktop (HOST)</button></div><div aria-labelledby="tab-6-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" class="sphinx-tabs-panel group-tab" id="panel-6-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>./utils/searxng.sh<span class="w"> </span>instance<span class="w"> </span>cmd<span class="w"> </span>bash<span class="w"> </span>-l
  206. <span class="o">(</span>searx-pyenv<span class="o">)</span><span class="w"> </span><span class="o">[</span>searxng@searxng-archlinux<span class="w"> </span>~<span class="o">]</span>$<span class="w"> </span><span class="nb">pwd</span>
  207. /usr/local/searxng
  208. </pre></div>
  209. </div>
  210. </div><div aria-labelledby="tab-6-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-6-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span>./utils/searxng.sh<span class="w"> </span>instance<span class="w"> </span>cmd<span class="w"> </span>bash<span class="w"> </span>-l
  211. INFO:<span class="w"> </span><span class="o">[</span>searxng-archlinux<span class="o">]</span><span class="w"> </span>./utils/searxng.sh<span class="w"> </span>instance<span class="w"> </span>cmd<span class="w"> </span>bash<span class="w"> </span>-l
  212. <span class="o">(</span>searx-pyenv<span class="o">)</span><span class="w"> </span><span class="o">[</span>searxng@searxng-archlinux<span class="w"> </span>~<span class="o">]</span>$<span class="w"> </span><span class="nb">pwd</span>
  213. /usr/local/searxng
  214. </pre></div>
  215. </div>
  216. </div></div>
  217. <p>The prompt <code class="docutils literal notranslate"><span class="pre">[searxng&#64;searxng-archlinux]</span></code> signals that you are logged in as system
  218. user <code class="docutils literal notranslate"><span class="pre">searxng</span></code> in the <code class="docutils literal notranslate"><span class="pre">searxng-archlinux</span></code> container and the python <em>virtualenv</em>
  219. <code class="docutils literal notranslate"><span class="pre">(searxng-pyenv)</span></code> environment is activated.</p>
  220. </section>
  221. <section id="wrap-production-into-developer-suite">
  222. <h2><a class="toc-backref" href="#id4" role="doc-backlink">Wrap production into developer suite</a><a class="headerlink" href="#wrap-production-into-developer-suite" title="Link to this heading">¶</a></h2>
  223. <p>In this section we will see how to change the <em>“Fully functional SearXNG suite”</em>
  224. from a LXC container (which is quite ready for production) into a developer
  225. suite. For this, we have to keep an eye on the <a class="reference internal" href="../admin/installation-searxng.html#installation-basic"><span class="std std-ref">Step by step installation</span></a>:</p>
  226. <ul class="simple">
  227. <li><p>SearXNG setup in: <code class="docutils literal notranslate"><span class="pre">/etc/searxng/settings.yml</span></code></p></li>
  228. <li><p>SearXNG user’s home: <code class="docutils literal notranslate"><span class="pre">/usr/local/searxng</span></code></p></li>
  229. <li><p>virtualenv in: <code class="docutils literal notranslate"><span class="pre">/usr/local/searxng/searxng-pyenv</span></code></p></li>
  230. <li><p>SearXNG software in: <code class="docutils literal notranslate"><span class="pre">/usr/local/searxng/searxng-src</span></code></p></li>
  231. </ul>
  232. <p>With the use of the <a class="reference internal" href="../utils/searxng.sh.html#searxng-sh"><span class="std std-ref">utils/searxng.sh</span></a> the SearXNG service was installed as
  233. <a class="reference internal" href="../admin/installation-uwsgi.html#searxng-uwsgi"><span class="std std-ref">uWSGI application</span></a>. To maintain this service, we can use
  234. <code class="docutils literal notranslate"><span class="pre">systemctl</span></code> (compare <a class="reference internal" href="../admin/installation-uwsgi.html#uwsgi-maintenance"><span class="std std-ref">uWSGI maintenance</span></a>).</p>
  235. <div class="sphinx-tabs docutils container">
  236. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-7-dXdzZ2lAc2VhcnhuZw==" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-7-dXdzZ2lAc2VhcnhuZw==" name="dXdzZ2lAc2VhcnhuZw==" role="tab" tabindex="0"><a class="reference external" href="mailto:uwsgi&#37;&#52;&#48;searxng">uwsgi<span>&#64;</span>searxng</a></button></div><div aria-labelledby="tab-7-dXdzZ2lAc2VhcnhuZw==" class="sphinx-tabs-panel group-tab" id="panel-7-dXdzZ2lAc2VhcnhuZw==" name="dXdzZ2lAc2VhcnhuZw==" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span>systemctl<span class="w"> </span>stop<span class="w"> </span>uwsgi@searxng
  237. </pre></div>
  238. </div>
  239. </div></div>
  240. <p>With the command above, we stopped the SearXNG uWSGI-App in the archlinux
  241. container.</p>
  242. <p>The uWSGI-App for the archlinux distros is configured in
  243. <a class="extlink-origin reference external" href="https://github.com/searxng/searxng/blob/master/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini">git://utils/templates/etc/uwsgi/apps-archlinux/searxng.ini</a>, from where at
  244. least you should attend the settings of <code class="docutils literal notranslate"><span class="pre">uid</span></code>, <code class="docutils literal notranslate"><span class="pre">chdir</span></code>, <code class="docutils literal notranslate"><span class="pre">env</span></code> and
  245. <code class="docutils literal notranslate"><span class="pre">http</span></code>:</p>
  246. <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">env</span> <span class="o">=</span> <span class="n">SEARXNG_SETTINGS_PATH</span><span class="o">=/</span><span class="n">etc</span><span class="o">/</span><span class="n">searxng</span><span class="o">/</span><span class="n">settings</span><span class="o">.</span><span class="n">yml</span>
  247. <span class="n">http</span> <span class="o">=</span> <span class="mf">127.0.0.1</span><span class="p">:</span><span class="mi">8888</span>
  248. <span class="n">chdir</span> <span class="o">=</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">searxng</span><span class="o">/</span><span class="n">searxng</span><span class="o">-</span><span class="n">src</span><span class="o">/</span><span class="n">searx</span>
  249. <span class="n">virtualenv</span> <span class="o">=</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">searxng</span><span class="o">/</span><span class="n">searxng</span><span class="o">-</span><span class="n">pyenv</span>
  250. <span class="n">pythonpath</span> <span class="o">=</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">searxng</span><span class="o">/</span><span class="n">searxng</span><span class="o">-</span><span class="n">src</span>
  251. </pre></div>
  252. </div>
  253. <p>If you have read the <a class="reference internal" href="../utils/lxc.sh.html#good-to-know"><span class="std std-ref">Good to know</span></a> you remember, that each container
  254. shares the root folder of the repository and the command <code class="docutils literal notranslate"><span class="pre">utils/lxc.sh</span> <span class="pre">cmd</span></code>
  255. handles relative path names <strong>transparent</strong>.</p>
  256. <p>To wrap the SearXNG installation in the container into a developer one, we
  257. simple have to create a symlink to the <strong>transparent</strong> repository from the
  258. desktop. Now lets replace the repository at <code class="docutils literal notranslate"><span class="pre">searxng-src</span></code> in the container
  259. with the working tree from outside of the container:</p>
  260. <div class="sphinx-tabs docutils container">
  261. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-8-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-8-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tab" tabindex="0"><code class="docutils literal notranslate"><span class="pre">[root&#64;searxng-archlinux</span> <span class="pre">SearXNG]</span></code> (GUEST)</button><button aria-controls="panel-8-ZGVza3RvcCAoSE9TVCk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-8-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="-1">desktop (HOST)</button></div><div aria-labelledby="tab-8-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" class="sphinx-tabs-panel group-tab" id="panel-8-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>mv<span class="w"> </span>/usr/local/searxng/searxng-src<span class="w"> </span>/usr/local/searxng/searxng-src.old
  262. $<span class="w"> </span>ln<span class="w"> </span>-s<span class="w"> </span>/share/SearXNG/<span class="w"> </span>/usr/local/searxng/searxng-src
  263. </pre></div>
  264. </div>
  265. </div><div aria-labelledby="tab-8-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-8-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span><span class="se">\</span>
  266. <span class="w"> </span>mv<span class="w"> </span>/usr/local/searxng/searxng-src<span class="w"> </span>/usr/local/searxng/searxng-src.old
  267. $<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span><span class="se">\</span>
  268. <span class="w"> </span>ln<span class="w"> </span>-s<span class="w"> </span>/share/SearXNG/<span class="w"> </span>/usr/local/searxng/searxng-src
  269. </pre></div>
  270. </div>
  271. </div></div>
  272. <p>Now we can develop as usual in the working tree of our desktop system. Every
  273. time the software was changed, you have to restart the SearXNG service (in the
  274. container):</p>
  275. <div class="sphinx-tabs docutils container">
  276. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-9-dXdzZ2lAc2VhcnhuZw==" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-9-dXdzZ2lAc2VhcnhuZw==" name="dXdzZ2lAc2VhcnhuZw==" role="tab" tabindex="0"><a class="reference external" href="mailto:uwsgi&#37;&#52;&#48;searxng">uwsgi<span>&#64;</span>searxng</a></button></div><div aria-labelledby="tab-9-dXdzZ2lAc2VhcnhuZw==" class="sphinx-tabs-panel group-tab" id="panel-9-dXdzZ2lAc2VhcnhuZw==" name="dXdzZ2lAc2VhcnhuZw==" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span>systemctl<span class="w"> </span>restart<span class="w"> </span>uwsgi@searxng
  277. </pre></div>
  278. </div>
  279. </div></div>
  280. <p>Remember: <a class="reference internal" href="#working-in-containers"><span class="std std-ref">In containers, work as usual</span></a> .. here are just some examples from my
  281. daily usage:</p>
  282. <p>To <em>inspect</em> the SearXNG instance (already described above):</p>
  283. <div class="sphinx-tabs docutils container">
  284. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-10-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-10-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tab" tabindex="0"><code class="docutils literal notranslate"><span class="pre">[root&#64;searxng-archlinux</span> <span class="pre">SearXNG]</span></code> (GUEST)</button><button aria-controls="panel-10-ZGVza3RvcCAoSE9TVCk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-10-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="-1">desktop (HOST)</button></div><div aria-labelledby="tab-10-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" class="sphinx-tabs-panel group-tab" id="panel-10-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>./utils/searx.sh<span class="w"> </span>inspect<span class="w"> </span>service
  285. </pre></div>
  286. </div>
  287. </div><div aria-labelledby="tab-10-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-10-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span>./utils/searx.sh<span class="w"> </span>inspect<span class="w"> </span>service
  288. </pre></div>
  289. </div>
  290. </div></div>
  291. <p>Run <a class="reference internal" href="makefile.html#makefile"><span class="std std-ref">Makefile &amp; ./manage</span></a>, e.g. to test inside the container:</p>
  292. <div class="sphinx-tabs docutils container">
  293. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-11-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-11-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tab" tabindex="0"><code class="docutils literal notranslate"><span class="pre">[root&#64;searxng-archlinux</span> <span class="pre">SearXNG]</span></code> (GUEST)</button><button aria-controls="panel-11-ZGVza3RvcCAoSE9TVCk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-11-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="-1">desktop (HOST)</button></div><div aria-labelledby="tab-11-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" class="sphinx-tabs-panel group-tab" id="panel-11-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>make<span class="w"> </span><span class="nb">test</span>
  294. </pre></div>
  295. </div>
  296. </div><div aria-labelledby="tab-11-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-11-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span>make<span class="w"> </span><span class="nb">test</span>
  297. </pre></div>
  298. </div>
  299. </div></div>
  300. <p>To install all prerequisites needed for a <a class="reference internal" href="../admin/buildhosts.html#buildhosts"><span class="std std-ref">Buildhosts</span></a>:</p>
  301. <div class="sphinx-tabs docutils container">
  302. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-12-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-12-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tab" tabindex="0"><code class="docutils literal notranslate"><span class="pre">[root&#64;searxng-archlinux</span> <span class="pre">SearXNG]</span></code> (GUEST)</button><button aria-controls="panel-12-ZGVza3RvcCAoSE9TVCk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-12-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="-1">desktop (HOST)</button></div><div aria-labelledby="tab-12-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" class="sphinx-tabs-panel group-tab" id="panel-12-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>./utils/searxng.sh<span class="w"> </span>install<span class="w"> </span>buildhost
  303. </pre></div>
  304. </div>
  305. </div><div aria-labelledby="tab-12-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-12-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span>./utils/searxng.sh<span class="w"> </span>install<span class="w"> </span>buildhost
  306. </pre></div>
  307. </div>
  308. </div></div>
  309. <p>To build the docs on a buildhost <a class="reference internal" href="../admin/buildhosts.html#buildhosts"><span class="std std-ref">Buildhosts</span></a>:</p>
  310. <div class="sphinx-tabs docutils container">
  311. <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-13-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-13-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tab" tabindex="0"><code class="docutils literal notranslate"><span class="pre">[root&#64;searxng-archlinux</span> <span class="pre">SearXNG]</span></code> (GUEST)</button><button aria-controls="panel-13-ZGVza3RvcCAoSE9TVCk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-13-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tab" tabindex="-1">desktop (HOST)</button></div><div aria-labelledby="tab-13-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" class="sphinx-tabs-panel group-tab" id="panel-13-YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" name="YGBbcm9vdEBzZWFyeG5nLWFyY2hsaW51eCBTZWFyWE5HXWBgIChHVUVTVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>make<span class="w"> </span>docs.html
  312. </pre></div>
  313. </div>
  314. </div><div aria-labelledby="tab-13-ZGVza3RvcCAoSE9TVCk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-13-ZGVza3RvcCAoSE9TVCk=" name="ZGVza3RvcCAoSE9TVCk=" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span>make<span class="w"> </span>docs.html
  315. </pre></div>
  316. </div>
  317. </div></div>
  318. </section>
  319. <section id="summary">
  320. <span id="lxcdev-summary"></span><h2><a class="toc-backref" href="#id5" role="doc-backlink">Summary</a><a class="headerlink" href="#summary" title="Link to this heading">¶</a></h2>
  321. <p>We build up a fully functional SearXNG suite in a archlinux container:</p>
  322. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>build<span class="w"> </span>searxng-archlinux
  323. $<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>install<span class="w"> </span>suite<span class="w"> </span>searxng-archlinux
  324. ...
  325. Developer<span class="w"> </span>install?<span class="w"> </span><span class="o">(</span>wraps<span class="w"> </span><span class="nb">source</span><span class="w"> </span>from<span class="w"> </span>HOST<span class="w"> </span>into<span class="w"> </span>the<span class="w"> </span>running<span class="w"> </span>instance<span class="o">)</span><span class="w"> </span><span class="o">[</span>YES/no<span class="o">]</span>
  326. </pre></div>
  327. </div>
  328. <p>To wrap the suite into a developer one answer <code class="docutils literal notranslate"><span class="pre">YES</span></code> (or press Enter).</p>
  329. <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>link SearXNG&#39;s sources to: /share/SearXNG
  330. =========================================
  331. mv -f &quot;/usr/local/searxng/searxng-src&quot; &quot;/usr/local/searxng/searxng-src.backup&quot;
  332. ln -s &quot;/share/SearXNG&quot; &quot;/usr/local/searxng/searxng-src&quot;
  333. ls -ld /usr/local/searxng/searxng-src
  334. |searxng| lrwxrwxrwx 1 searxng searxng ... /usr/local/searxng/searxng-src -&gt; /share/SearXNG
  335. </pre></div>
  336. </div>
  337. <p>On code modification the instance has to be restarted (see <a class="reference internal" href="../admin/installation-uwsgi.html#uwsgi-maintenance"><span class="std std-ref">uWSGI maintenance</span></a>):</p>
  338. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>searxng-archlinux<span class="w"> </span>systemctl<span class="w"> </span>restart<span class="w"> </span>uwsgi@searxng
  339. </pre></div>
  340. </div>
  341. <p>To access HTTP from the desktop we installed nginx for the services inside the
  342. container:</p>
  343. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>-H<span class="w"> </span>./utils/lxc.sh<span class="w"> </span>cmd<span class="w"> </span>--<span class="w"> </span><span class="nv">FORCE_TIMEOUT</span><span class="o">=</span><span class="m">0</span><span class="w"> </span>./utils/searxng.sh<span class="w"> </span>install<span class="w"> </span>nginx
  344. </pre></div>
  345. </div>
  346. <p>To get information about the SearxNG suite in the archlinux container we can
  347. use:</p>
  348. <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ sudo -H ./utils/lxc.sh show suite searxng-archlinux
  349. [searxng-archlinux] INFO: (eth0) docs-live: http:///n.n.n.140:8080/
  350. [searxng-archlinux] INFO: (eth0) IPv6: http://[fd42:555b:2af9:e121:216:3eff:fe5b:1744]
  351. [searxng-archlinux] uWSGI:
  352. [searxng-archlinux] SEARXNG_UWSGI_SOCKET : /usr/local/searxng/run/socket
  353. [searxng-archlinux] environment /usr/local/searxng/searxng-src/utils/brand.env:
  354. [searxng-archlinux] GIT_URL : https://github.com/searxng/searxng
  355. [searxng-archlinux] GIT_BRANCH : master
  356. [searxng-archlinux] SEARXNG_URL : http:///n.n.n.140/searxng
  357. [searxng-archlinux] SEARXNG_PORT : 8888
  358. [searxng-archlinux] SEARXNG_BIND_ADDRESS : 127.0.0.1
  359. </pre></div>
  360. </div>
  361. </section>
  362. </section>
  363. <div class="clearer"></div>
  364. </div>
  365. </div>
  366. </div>
  367. <span id="sidebar-top"></span>
  368. <div class="sphinxsidebar" role="navigation" aria-label="Main">
  369. <div class="sphinxsidebarwrapper">
  370. <p class="logo"><a href="../index.html">
  371. <img class="logo" src="../_static/searxng-wordmark.svg" alt="Logo of SearXNG"/>
  372. </a></p>
  373. <h3><a href="../index.html">Table of Contents</a></h3>
  374. <ul class="current">
  375. <li class="toctree-l1"><a class="reference internal" href="../user/index.html">User information</a></li>
  376. <li class="toctree-l1"><a class="reference internal" href="../own-instance.html">Why use a private instance?</a></li>
  377. <li class="toctree-l1"><a class="reference internal" href="../admin/index.html">Administrator documentation</a></li>
  378. <li class="toctree-l1 current"><a class="reference internal" href="index.html">Developer documentation</a><ul class="current">
  379. <li class="toctree-l2"><a class="reference internal" href="quickstart.html">Development Quickstart</a></li>
  380. <li class="toctree-l2"><a class="reference internal" href="rtm_asdf.html">Runtime Management</a></li>
  381. <li class="toctree-l2"><a class="reference internal" href="contribution_guide.html">How to contribute</a></li>
  382. <li class="toctree-l2"><a class="reference internal" href="extended_types.html">Extended Types</a></li>
  383. <li class="toctree-l2"><a class="reference internal" href="engines/index.html">Engine Implementations</a></li>
  384. <li class="toctree-l2"><a class="reference internal" href="result_types/index.html">Result Types</a></li>
  385. <li class="toctree-l2"><a class="reference internal" href="templates.html">Simple Theme Templates</a></li>
  386. <li class="toctree-l2"><a class="reference internal" href="search_api.html">Search API</a></li>
  387. <li class="toctree-l2"><a class="reference internal" href="plugins/index.html">Plugins</a></li>
  388. <li class="toctree-l2"><a class="reference internal" href="answerers/index.html">Answerers</a></li>
  389. <li class="toctree-l2"><a class="reference internal" href="translation.html">Translation</a></li>
  390. <li class="toctree-l2 current"><a class="current reference internal" href="#">Developing in Linux Containers</a><ul>
  391. <li class="toctree-l3"><a class="reference internal" href="#motivation">Motivation</a></li>
  392. <li class="toctree-l3"><a class="reference internal" href="#gentlemen-start-your-engines">Gentlemen, start your engines!</a></li>
  393. <li class="toctree-l3"><a class="reference internal" href="#in-containers-work-as-usual">In containers, work as usual</a></li>
  394. <li class="toctree-l3"><a class="reference internal" href="#wrap-production-into-developer-suite">Wrap production into developer suite</a></li>
  395. <li class="toctree-l3"><a class="reference internal" href="#summary">Summary</a></li>
  396. </ul>
  397. </li>
  398. <li class="toctree-l2"><a class="reference internal" href="makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
  399. <li class="toctree-l2"><a class="reference internal" href="reST.html">reST primer</a></li>
  400. <li class="toctree-l2"><a class="reference internal" href="searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
  401. </ul>
  402. </li>
  403. <li class="toctree-l1"><a class="reference internal" href="../utils/index.html">DevOps tooling box</a></li>
  404. <li class="toctree-l1"><a class="reference internal" href="../src/index.html">Source-Code</a></li>
  405. </ul>
  406. <h3>Project Links</h3>
  407. <ul>
  408. <li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
  409. <li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
  410. <li><a href="https://searx.space">Public instances</a>
  411. <li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
  412. </ul><h3>Navigation</h3>
  413. <ul>
  414. <li><a href="../index.html">Overview</a>
  415. <ul>
  416. <li><a href="index.html">Developer documentation</a>
  417. <ul>
  418. <li>Previous: <a href="translation.html" title="previous chapter">Translation</a>
  419. <li>Next: <a href="makefile.html" title="next chapter">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></ul>
  420. </li>
  421. </ul>
  422. </li>
  423. </ul>
  424. <search id="searchbox" style="display: none" role="search">
  425. <h3 id="searchlabel">Quick search</h3>
  426. <div class="searchformwrapper">
  427. <form class="search" action="../search.html" method="get">
  428. <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
  429. <input type="submit" value="Go" />
  430. </form>
  431. </div>
  432. </search>
  433. <script>document.getElementById('searchbox').style.display = "block"</script>
  434. <div role="note" aria-label="source link">
  435. <h3>This Page</h3>
  436. <ul class="this-page-menu">
  437. <li><a href="../_sources/dev/lxcdev.rst.txt"
  438. rel="nofollow">Show Source</a></li>
  439. </ul>
  440. </div>
  441. </div>
  442. </div>
  443. <div class="clearer"></div>
  444. </div>
  445. <div class="footer" role="contentinfo">
  446. &#169; Copyright SearXNG team.
  447. </div>
  448. </body>
  449. </html>