contribution_guide.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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>How to contribute &#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. <script src="../_static/documentation_options.js?v=b12b0e12"></script>
  11. <script src="../_static/doctools.js?v=9a2dae69"></script>
  12. <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
  13. <script data-project="searxng" data-version="2025.4.30+fd33559cf" src="../_static/describe_version.js?v=fa7f30d0"></script>
  14. <link rel="index" title="Index" href="../genindex.html" />
  15. <link rel="search" title="Search" href="../search.html" />
  16. <link rel="next" title="Extended Types" href="extended_types.html" />
  17. <link rel="prev" title="Runtime Management" href="rtm_asdf.html" />
  18. </head><body>
  19. <div class="related" role="navigation" aria-label="Related">
  20. <h3>Navigation</h3>
  21. <ul>
  22. <li class="right" style="margin-right: 10px">
  23. <a href="../genindex.html" title="General Index"
  24. accesskey="I">index</a></li>
  25. <li class="right" >
  26. <a href="../py-modindex.html" title="Python Module Index"
  27. >modules</a> |</li>
  28. <li class="right" >
  29. <a href="extended_types.html" title="Extended Types"
  30. accesskey="N">next</a> |</li>
  31. <li class="right" >
  32. <a href="rtm_asdf.html" title="Runtime Management"
  33. accesskey="P">previous</a> |</li>
  34. <li class="nav-item nav-item-0"><a href="../index.html">SearXNG Documentation (2025.4.30+fd33559cf)</a> &#187;</li>
  35. <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Developer documentation</a> &#187;</li>
  36. <li class="nav-item nav-item-this"><a href="">How to contribute</a></li>
  37. </ul>
  38. </div>
  39. <div class="document">
  40. <div class="documentwrapper">
  41. <div class="bodywrapper">
  42. <div class="body" role="main">
  43. <section id="how-to-contribute">
  44. <span id="id1"></span><h1>How to contribute<a class="headerlink" href="#how-to-contribute" title="Link to this heading">¶</a></h1>
  45. <nav class="contents local" id="contents">
  46. <ul class="simple">
  47. <li><p><a class="reference internal" href="#prime-directives-privacy-hackability" id="id3">Prime directives: Privacy, Hackability</a></p>
  48. <ul>
  49. <li><p><a class="reference internal" href="#privacy-by-design" id="id4">Privacy-by-design</a></p></li>
  50. </ul>
  51. </li>
  52. <li><p><a class="reference internal" href="#code" id="id5">Code</a></p></li>
  53. <li><p><a class="reference internal" href="#translation" id="id6">Translation</a></p></li>
  54. <li><p><a class="reference internal" href="#documentation" id="id7">Documentation</a></p>
  55. <ul>
  56. <li><p><a class="reference internal" href="#live-build" id="id8">Live build</a></p></li>
  57. <li><p><a class="reference internal" href="#deploy-on-github-io" id="id9">deploy on github.io</a></p></li>
  58. </ul>
  59. </li>
  60. </ul>
  61. </nav>
  62. <section id="prime-directives-privacy-hackability">
  63. <h2><a class="toc-backref" href="#id3" role="doc-backlink">Prime directives: Privacy, Hackability</a><a class="headerlink" href="#prime-directives-privacy-hackability" title="Link to this heading">¶</a></h2>
  64. <p>SearXNG has two prime directives, <strong>privacy-by-design and hackability</strong> . The
  65. hackability comes in three levels:</p>
  66. <ul class="simple">
  67. <li><p>support of search engines</p></li>
  68. <li><p>plugins to alter search behaviour</p></li>
  69. <li><p>hacking SearXNG itself</p></li>
  70. </ul>
  71. <p>Note the lack of “world domination” among the directives. SearXNG has no
  72. intention of wide mass-adoption, rounded corners, etc. The prime directive
  73. “privacy” deserves a separate chapter, as it’s quite uncommon unfortunately.</p>
  74. <section id="privacy-by-design">
  75. <h3><a class="toc-backref" href="#id4" role="doc-backlink">Privacy-by-design</a><a class="headerlink" href="#privacy-by-design" title="Link to this heading">¶</a></h3>
  76. <p>SearXNG was born out of the need for a <strong>privacy-respecting</strong> search tool which
  77. can be extended easily to maximize both its search and its privacy protecting
  78. capabilities.</p>
  79. <p>Some widely used search engine features may work differently,
  80. may be turned off by default, or may not be implemented at all in SearXNG
  81. <strong>as a consequence of a privacy-by-design approach</strong>.</p>
  82. <p>Following this approach, features reducing the privacy preserving aspects of SearXNG should be
  83. switched off by default or should not be implemented at all. There are plenty of
  84. search engines already providing such features. If a feature reduces
  85. SearXNG’s efficacy in protecting a user’s privacy, the user must be informed about
  86. the effect of choosing to enable it. Features that protect privacy but differ from the
  87. expectations of the user should also be carefully explained to them.</p>
  88. <p>Also, if you think that something works weird with SearXNG, it might be because
  89. the tool you are using is designed in a way that interferes with SearXNG’s privacy aspects.
  90. Submitting a bug report to the vendor of the tool that misbehaves might be a good
  91. feedback for them to reconsider the disrespect to their customers (e.g., <code class="docutils literal notranslate"><span class="pre">GET</span></code> vs <code class="docutils literal notranslate"><span class="pre">POST</span></code>
  92. requests in various browsers).</p>
  93. <p>Remember the other prime directive of SearXNG is to be hackable, so if the above
  94. privacy concerns do not fancy you, simply fork it.</p>
  95. <blockquote>
  96. <div><p><em>Happy hacking.</em></p>
  97. </div></blockquote>
  98. </section>
  99. </section>
  100. <section id="code">
  101. <h2><a class="toc-backref" href="#id5" role="doc-backlink">Code</a><a class="headerlink" href="#code" title="Link to this heading">¶</a></h2>
  102. <aside class="sidebar">
  103. <p class="sidebar-title">Create good commits!</p>
  104. <ul class="simple">
  105. <li><p><a class="reference external" href="https://wiki.openstack.org/wiki/GitCommitMessages#Structural_split_of_changes">Structural split of changes</a></p></li>
  106. <li><p><a class="reference external" href="https://www.conventionalcommits.org/">Conventional Commits</a></p></li>
  107. <li><p><a class="reference external" href="https://wiki.openstack.org/wiki/GitCommitMessages">Git Commit Good Practice</a></p></li>
  108. <li><p>some like to use: <a class="reference external" href="https://gitmoji.carloscuesta.me/">gitmoji</a></p></li>
  109. <li><p>not yet active: <a class="reference external" href="https://github.com/zeke/semantic-pull-requests">Semantic PR</a></p></li>
  110. </ul>
  111. </aside>
  112. <p>In order to submit a patch, please follow the steps below:</p>
  113. <ul>
  114. <li><p>Follow coding conventions.</p>
  115. <ul class="simple">
  116. <li><p><a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">PEP8</a> standards apply, except the convention of line length</p></li>
  117. <li><p>Maximum line length is 120 characters</p></li>
  118. </ul>
  119. </li>
  120. <li><p>The cardinal rule for creating good commits is to ensure there is only one
  121. <em>logical change</em> per commit / read <a class="reference external" href="https://wiki.openstack.org/wiki/GitCommitMessages#Structural_split_of_changes">Structural split of changes</a></p></li>
  122. <li><p>Check if your code breaks existing tests. If so, update the tests or fix your
  123. code.</p></li>
  124. <li><p>If your code can be unit-tested, add unit tests.</p></li>
  125. <li><p>Add yourself to the <a class="extlink-origin reference external" href="https://github.com/searxng/searxng/blob/master/AUTHORS.rst">git://AUTHORS.rst</a> file.</p></li>
  126. <li><p>Choose meaningful commit messages, read <a class="reference external" href="https://www.conventionalcommits.org/">Conventional Commits</a></p>
  127. <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="nb">type</span><span class="o">&gt;</span><span class="p">[</span><span class="n">optional</span> <span class="n">scope</span><span class="p">]:</span> <span class="o">&lt;</span><span class="n">description</span><span class="o">&gt;</span>
  128. <span class="p">[</span><span class="n">optional</span> <span class="n">body</span><span class="p">]</span>
  129. <span class="p">[</span><span class="n">optional</span> <span class="n">footer</span><span class="p">(</span><span class="n">s</span><span class="p">)]</span>
  130. </pre></div>
  131. </div>
  132. </li>
  133. <li><p>Create a pull request.</p></li>
  134. </ul>
  135. <p>For more help on getting started with SearXNG development, see <a class="reference internal" href="quickstart.html#devquickstart"><span class="std std-ref">Development Quickstart</span></a>.</p>
  136. </section>
  137. <section id="translation">
  138. <h2><a class="toc-backref" href="#id6" role="doc-backlink">Translation</a><a class="headerlink" href="#translation" title="Link to this heading">¶</a></h2>
  139. <p>Translation currently takes place on <a class="reference internal" href="translation.html#translation"><span class="std std-ref">weblate</span></a>.</p>
  140. </section>
  141. <section id="documentation">
  142. <span id="contrib-docs"></span><h2><a class="toc-backref" href="#id7" role="doc-backlink">Documentation</a><a class="headerlink" href="#documentation" title="Link to this heading">¶</a></h2>
  143. <aside class="sidebar">
  144. <p class="sidebar-title">The reST sources</p>
  145. <p>has been moved from <code class="docutils literal notranslate"><span class="pre">gh-branch</span></code> into <code class="docutils literal notranslate"><span class="pre">master</span></code> (<a class="extlink-origin reference external" href="https://github.com/searxng/searxng/blob/master/docs">git://docs</a>).</p>
  146. </aside>
  147. <p>The documentation is built using <a class="reference external" href="https://www.sphinx-doc.org">Sphinx</a>. So in order to be able to generate
  148. the required files, you have to install it on your system. Much easier, use
  149. our <a class="reference internal" href="makefile.html#makefile"><span class="std std-ref">Makefile &amp; ./manage</span></a>.</p>
  150. <p>Here is an example which makes a complete rebuild:</p>
  151. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>make<span class="w"> </span>docs.clean<span class="w"> </span>docs.html
  152. ...
  153. The<span class="w"> </span>HTML<span class="w"> </span>pages<span class="w"> </span>are<span class="w"> </span><span class="k">in</span><span class="w"> </span>dist/docs.
  154. </pre></div>
  155. </div>
  156. <section id="live-build">
  157. <span id="make-docs-live"></span><h3><a class="toc-backref" href="#id8" role="doc-backlink">Live build</a><a class="headerlink" href="#live-build" title="Link to this heading">¶</a></h3>
  158. <aside class="sidebar">
  159. <p class="sidebar-title">docs.clean</p>
  160. <p>It is recommended to assert a complete rebuild before deploying (use
  161. <code class="docutils literal notranslate"><span class="pre">docs.clean</span></code>).</p>
  162. </aside>
  163. <p>Live build is like WYSIWYG. It’s the recommended way to go if you want to edit the documentation.
  164. The Makefile target <code class="docutils literal notranslate"><span class="pre">docs.live</span></code> builds the docs, opens
  165. URL in your favorite browser and rebuilds every time a reST file has been
  166. changed (<a class="reference internal" href="makefile.html#make-docs-clean"><span class="std std-ref">make docs.clean docs.live</span></a>).</p>
  167. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>make<span class="w"> </span>docs.live
  168. ...
  169. The<span class="w"> </span>HTML<span class="w"> </span>pages<span class="w"> </span>are<span class="w"> </span><span class="k">in</span><span class="w"> </span>dist/docs.
  170. ...<span class="w"> </span>Serving<span class="w"> </span>on<span class="w"> </span>http://0.0.0.0:8000
  171. ...<span class="w"> </span>Start<span class="w"> </span>watching<span class="w"> </span>changes
  172. </pre></div>
  173. </div>
  174. <p>Live builds are implemented by <a class="reference external" href="https://github.com/executablebooks/sphinx-autobuild/blob/master/README.md">sphinx-autobuild</a>. Use environment
  175. <code class="docutils literal notranslate"><span class="pre">$(SPHINXOPTS)</span></code> to pass arguments to the <a class="reference external" href="https://github.com/executablebooks/sphinx-autobuild/blob/master/README.md">sphinx-autobuild</a> command. You can
  176. pass any argument except for the <code class="docutils literal notranslate"><span class="pre">--host</span></code> option (which is always set to <code class="docutils literal notranslate"><span class="pre">0.0.0.0</span></code>).
  177. E.g., to find and use a free port, use:</p>
  178. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span><span class="nv">SPHINXOPTS</span><span class="o">=</span><span class="s2">&quot;--port 0&quot;</span><span class="w"> </span>make<span class="w"> </span>docs.live
  179. ...
  180. ...<span class="w"> </span>Serving<span class="w"> </span>on<span class="w"> </span>http://0.0.0.0:50593
  181. ...
  182. </pre></div>
  183. </div>
  184. </section>
  185. <section id="deploy-on-github-io">
  186. <span id="id2"></span><h3><a class="toc-backref" href="#id9" role="doc-backlink">deploy on github.io</a><a class="headerlink" href="#deploy-on-github-io" title="Link to this heading">¶</a></h3>
  187. <p>To deploy documentation at <a class="extlink-docs reference external" href="https://docs.searxng.org//.">github.io</a> use Makefile target <a class="reference internal" href="makefile.html#make-docs-gh-pages"><span class="std std-ref">make docs.gh-pages</span></a>, which builds the documentation and runs all the needed git add,
  188. commit and push:</p>
  189. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>make<span class="w"> </span>docs.clean<span class="w"> </span>docs.gh-pages
  190. </pre></div>
  191. </div>
  192. <div class="admonition attention">
  193. <p class="admonition-title">Attention</p>
  194. <p>If you are working in your own brand, don’t forget to adjust your
  195. <a class="reference internal" href="../admin/settings/settings_brand.html#settings-brand"><span class="std std-ref">brand:</span></a>.</p>
  196. </div>
  197. </section>
  198. </section>
  199. </section>
  200. <div class="clearer"></div>
  201. </div>
  202. </div>
  203. </div>
  204. <span id="sidebar-top"></span>
  205. <div class="sphinxsidebar" role="navigation" aria-label="Main">
  206. <div class="sphinxsidebarwrapper">
  207. <p class="logo"><a href="../index.html">
  208. <img class="logo" src="../_static/searxng-wordmark.svg" alt="Logo of SearXNG"/>
  209. </a></p>
  210. <h3><a href="../index.html">Table of Contents</a></h3>
  211. <ul class="current">
  212. <li class="toctree-l1"><a class="reference internal" href="../user/index.html">User information</a></li>
  213. <li class="toctree-l1"><a class="reference internal" href="../own-instance.html">Why use a private instance?</a></li>
  214. <li class="toctree-l1"><a class="reference internal" href="../admin/index.html">Administrator documentation</a></li>
  215. <li class="toctree-l1 current"><a class="reference internal" href="index.html">Developer documentation</a><ul class="current">
  216. <li class="toctree-l2"><a class="reference internal" href="quickstart.html">Development Quickstart</a></li>
  217. <li class="toctree-l2"><a class="reference internal" href="rtm_asdf.html">Runtime Management</a></li>
  218. <li class="toctree-l2 current"><a class="current reference internal" href="#">How to contribute</a><ul>
  219. <li class="toctree-l3"><a class="reference internal" href="#prime-directives-privacy-hackability">Prime directives: Privacy, Hackability</a><ul>
  220. <li class="toctree-l4"><a class="reference internal" href="#privacy-by-design">Privacy-by-design</a></li>
  221. </ul>
  222. </li>
  223. <li class="toctree-l3"><a class="reference internal" href="#code">Code</a></li>
  224. <li class="toctree-l3"><a class="reference internal" href="#translation">Translation</a></li>
  225. <li class="toctree-l3"><a class="reference internal" href="#documentation">Documentation</a><ul>
  226. <li class="toctree-l4"><a class="reference internal" href="#live-build">Live build</a></li>
  227. <li class="toctree-l4"><a class="reference internal" href="#deploy-on-github-io">deploy on github.io</a></li>
  228. </ul>
  229. </li>
  230. </ul>
  231. </li>
  232. <li class="toctree-l2"><a class="reference internal" href="extended_types.html">Extended Types</a></li>
  233. <li class="toctree-l2"><a class="reference internal" href="engines/index.html">Engine Implementations</a></li>
  234. <li class="toctree-l2"><a class="reference internal" href="result_types/index.html">Result Types</a></li>
  235. <li class="toctree-l2"><a class="reference internal" href="templates.html">Simple Theme Templates</a></li>
  236. <li class="toctree-l2"><a class="reference internal" href="search_api.html">Search API</a></li>
  237. <li class="toctree-l2"><a class="reference internal" href="plugins/index.html">Plugins</a></li>
  238. <li class="toctree-l2"><a class="reference internal" href="answerers/index.html">Answerers</a></li>
  239. <li class="toctree-l2"><a class="reference internal" href="translation.html">Translation</a></li>
  240. <li class="toctree-l2"><a class="reference internal" href="lxcdev.html">Developing in Linux Containers</a></li>
  241. <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>
  242. <li class="toctree-l2"><a class="reference internal" href="reST.html">reST primer</a></li>
  243. <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>
  244. </ul>
  245. </li>
  246. <li class="toctree-l1"><a class="reference internal" href="../utils/index.html">DevOps tooling box</a></li>
  247. <li class="toctree-l1"><a class="reference internal" href="../src/index.html">Source-Code</a></li>
  248. </ul>
  249. <h3>Project Links</h3>
  250. <ul>
  251. <li><a href="https://github.com/searxng/searxng/tree/master">Source</a>
  252. <li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
  253. <li><a href="https://searx.space">Public instances</a>
  254. <li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
  255. </ul><h3>Navigation</h3>
  256. <ul>
  257. <li><a href="../index.html">Overview</a>
  258. <ul>
  259. <li><a href="index.html">Developer documentation</a>
  260. <ul>
  261. <li>Previous: <a href="rtm_asdf.html" title="previous chapter">Runtime Management</a>
  262. <li>Next: <a href="extended_types.html" title="next chapter">Extended Types</a></ul>
  263. </li>
  264. </ul>
  265. </li>
  266. </ul>
  267. <search id="searchbox" style="display: none" role="search">
  268. <h3 id="searchlabel">Quick search</h3>
  269. <div class="searchformwrapper">
  270. <form class="search" action="../search.html" method="get">
  271. <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
  272. <input type="submit" value="Go" />
  273. </form>
  274. </div>
  275. </search>
  276. <script>document.getElementById('searchbox').style.display = "block"</script>
  277. <div role="note" aria-label="source link">
  278. <h3>This Page</h3>
  279. <ul class="this-page-menu">
  280. <li><a href="../_sources/dev/contribution_guide.rst.txt"
  281. rel="nofollow">Show Source</a></li>
  282. </ul>
  283. </div>
  284. </div>
  285. </div>
  286. <div class="clearer"></div>
  287. </div>
  288. <div class="footer" role="contentinfo">
  289. &#169; Copyright SearXNG team.
  290. </div>
  291. </body>
  292. </html>