123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>Development Quickstart &#8212; searx 0.12.0 documentation</title>
  8. <link rel="stylesheet" href="../_static/style.css" type="text/css" />
  9. <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  10. <script type="text/javascript" src="../_static/documentation_options.js"></script>
  11. <script type="text/javascript" src="../_static/jquery.js"></script>
  12. <script type="text/javascript" src="../_static/underscore.js"></script>
  13. <script type="text/javascript" src="../_static/doctools.js"></script>
  14. <link rel="index" title="Index" href="../genindex.html" />
  15. <link rel="search" title="Search" href="../search.html" />
  16. <link rel="next" title="How to contribute" href="contribution_guide.html" />
  17. <link rel="prev" title="How to setup result proxy" href="../admin/morty.html" />
  18. <link media="only screen and (max-device-width: 480px)" href="../_static/small_flask.css" type= "text/css" rel="stylesheet" />
  19. <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
  20. </head><body>
  21. <div class="document">
  22. <div class="documentwrapper">
  23. <div class="bodywrapper">
  24. <div class="body" role="main">
  25. <div class="section" id="development-quickstart">
  26. <span id="devquickstart"></span><h1>Development Quickstart<a class="headerlink" href="#development-quickstart" title="Permalink to this headline">¶</a></h1>
  27. <p>This quickstart guide gets your environment set up with searx. Furthermore, it gives a
  28. short introduction to the new manage.sh script.</p>
  29. <div class="section" id="how-to-setup-your-development-environment">
  30. <h2>How to setup your development environment<a class="headerlink" href="#how-to-setup-your-development-environment" title="Permalink to this headline">¶</a></h2>
  31. <p>First, clone the source code of searx to the desired folder. In this case the source
  32. is cloned to ~/myprojects/searx. Then create and activate the searx-ve
  33. virtualenv and install the required packages using manage.sh.</p>
  34. <div class="code sh highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">~/</span><span class="n">myprojects</span>
  35. <span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">asciimoo</span><span class="o">/</span><span class="n">searx</span><span class="o">.</span><span class="n">git</span>
  36. <span class="n">cd</span> <span class="n">searx</span>
  37. <span class="n">virtualenv</span> <span class="n">searx</span><span class="o">-</span><span class="n">ve</span>
  38. <span class="o">.</span> <span class="o">./</span><span class="n">searx</span><span class="o">-</span><span class="n">ve</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">activate</span>
  39. <span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">update_dev_packages</span>
  40. </pre></div>
  41. </div>
  42. </div>
  43. <div class="section" id="how-to-run-tests">
  44. <h2>How to run tests<a class="headerlink" href="#how-to-run-tests" title="Permalink to this headline">¶</a></h2>
  45. <p>Tests can be run using the manage.sh script.</p>
  46. <p>Following tests and checks are available:</p>
  47. <ul class="simple">
  48. <li>Unit tests</li>
  49. <li>Selenium tests</li>
  50. <li>PEP8 validation</li>
  51. <li>Unit test coverage check</li>
  52. </ul>
  53. <p>For example unit tests are run with the command below:</p>
  54. <div class="code sh highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">unit_tests</span>
  55. </pre></div>
  56. </div>
  57. <p>For further test options, please consult the help of the manage.sh script.</p>
  58. </div>
  59. <div class="section" id="how-to-compile-styles-and-javascript">
  60. <h2>How to compile styles and javascript<a class="headerlink" href="#how-to-compile-styles-and-javascript" title="Permalink to this headline">¶</a></h2>
  61. <div class="section" id="how-to-build-styles">
  62. <h3>How to build styles<a class="headerlink" href="#how-to-build-styles" title="Permalink to this headline">¶</a></h3>
  63. <p>Less is required to build the styles of searx. Less can be installed using either NodeJS or Apt.</p>
  64. <div class="code sh highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">nodejs</span>
  65. <span class="n">sudo</span> <span class="n">npm</span> <span class="n">install</span> <span class="o">-</span><span class="n">g</span> <span class="n">less</span>
  66. </pre></div>
  67. </div>
  68. <p>OR</p>
  69. <div class="code sh highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">node</span><span class="o">-</span><span class="n">less</span>
  70. </pre></div>
  71. </div>
  72. <p>After satisfying the requirements styles can be build using manage.sh</p>
  73. <div class="code sh highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">styles</span>
  74. </pre></div>
  75. </div>
  76. </div>
  77. <div class="section" id="how-to-build-the-source-of-the-oscar-theme">
  78. <h3>How to build the source of the oscar theme<a class="headerlink" href="#how-to-build-the-source-of-the-oscar-theme" title="Permalink to this headline">¶</a></h3>
  79. <p>Grunt must be installed in order to build the javascript sources. It depends on NodeJS, so first
  80. Node has to be installed.</p>
  81. <div class="code sh highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">nodejs</span>
  82. <span class="n">sudo</span> <span class="n">npm</span> <span class="n">install</span> <span class="o">-</span><span class="n">g</span> <span class="n">grunt</span><span class="o">-</span><span class="n">cli</span>
  83. </pre></div>
  84. </div>
  85. <p>After installing grunt, the files can be built using the following command:</p>
  86. <div class="code sh highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">build_grunt</span>
  87. </pre></div>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="section" id="tips-for-debugging-development">
  92. <h2>Tips for debugging/development<a class="headerlink" href="#tips-for-debugging-development" title="Permalink to this headline">¶</a></h2>
  93. <ol class="arabic simple">
  94. <li><dl class="first docutils">
  95. <dt>Turn on debug logging</dt>
  96. <dd>Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea
  97. to turn on debug logging. When debug logging is enabled a stack trace appears,
  98. instead of the cryptic <code class="docutils literal notranslate"><span class="pre">Internal</span> <span class="pre">Server</span> <span class="pre">Error</span></code> message. It can be turned on by setting
  99. <code class="docutils literal notranslate"><span class="pre">debug:</span> <span class="pre">False</span></code> to <code class="docutils literal notranslate"><span class="pre">debug:</span> <span class="pre">True</span></code> in settings.yml.</dd>
  100. </dl>
  101. </li>
  102. <li><dl class="first docutils">
  103. <dt>Run <code class="docutils literal notranslate"><span class="pre">./manage.sh</span> <span class="pre">tests</span></code> before creating a PR.</dt>
  104. <dd>Failing build on Travis is common because of PEP8 checks. So a new commit must be created
  105. containing these format fixes. This phase can be skipped if <code class="docutils literal notranslate"><span class="pre">./manage.sh</span> <span class="pre">tests</span></code> is run
  106. locally before creating a PR.</dd>
  107. </dl>
  108. </li>
  109. </ol>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  116. <div class="sphinxsidebarwrapper">
  117. <h3><a href="../index.html">Table Of Contents</a></h3>
  118. <ul>
  119. <li><a class="reference internal" href="#">Development Quickstart</a><ul>
  120. <li><a class="reference internal" href="#how-to-setup-your-development-environment">How to setup your development environment</a></li>
  121. <li><a class="reference internal" href="#how-to-run-tests">How to run tests</a></li>
  122. <li><a class="reference internal" href="#how-to-compile-styles-and-javascript">How to compile styles and javascript</a><ul>
  123. <li><a class="reference internal" href="#how-to-build-styles">How to build styles</a></li>
  124. <li><a class="reference internal" href="#how-to-build-the-source-of-the-oscar-theme">How to build the source of the oscar theme</a></li>
  125. </ul>
  126. </li>
  127. <li><a class="reference internal" href="#tips-for-debugging-development">Tips for debugging/development</a></li>
  128. </ul>
  129. </li>
  130. </ul>
  131. <div class="sidebar_container body">
  132. <h1>Searx</h1>
  133. <ul>
  134. <li><a href="../index.html">Home</a></li>
  135. <li><a href="https://github.com/asciimoo/searx">Source</a></li>
  136. <li><a href="../blog/blog.html">Blog</a></li>
  137. <li><a href="https://github.com/asciimoo/searx/wiki">Wiki</a></li>
  138. <li><a href="https://github.com/asciimoo/searx/wiki/Searx-instances">Public instances</a></li>
  139. </ul>
  140. <hr />
  141. <ul>
  142. <li><a href="https://twitter.com/Searx_engine">Twitter</a></li>
  143. </ul>
  144. </div>
  145. <div role="note" aria-label="source link">
  146. <h3>This Page</h3>
  147. <ul class="this-page-menu">
  148. <li><a href="../_sources/dev/quickstart.rst.txt"
  149. rel="nofollow">Show Source</a></li>
  150. </ul>
  151. </div>
  152. <div id="searchbox" style="display: none" role="search">
  153. <h3>Quick search</h3>
  154. <div class="searchformwrapper">
  155. <form class="search" action="../search.html" method="get">
  156. <input type="text" name="q" />
  157. <input type="submit" value="Go" />
  158. <input type="hidden" name="check_keywords" value="yes" />
  159. <input type="hidden" name="area" value="default" />
  160. </form>
  161. </div>
  162. </div>
  163. <script type="text/javascript">$('#searchbox').show(0);</script>
  164. </div>
  165. </div>
  166. <div class="clearer"></div>
  167. </div>
  168. <div class="footer">
  169. &copy; Copyright 2015-2017, Adam Tauber.
  170. </div>
  171. </body>
  172. </html>