contribution_guide.rst 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. .. _how to contribute:
  2. =================
  3. How to contribute
  4. =================
  5. .. contents::
  6. :depth: 2
  7. :local:
  8. :backlinks: entry
  9. Prime directives: Privacy, Hackability
  10. ======================================
  11. SearXNG has two prime directives, **privacy-by-design and hackability** . The
  12. hackability comes in three levels:
  13. - support of search engines
  14. - plugins to alter search behaviour
  15. - hacking SearXNG itself
  16. Note the lack of "world domination" among the directives. SearXNG has no
  17. intention of wide mass-adoption, rounded corners, etc. The prime directive
  18. "privacy" deserves a separate chapter, as it's quite uncommon unfortunately.
  19. Privacy-by-design
  20. -----------------
  21. SearXNG was born out of the need for a **privacy-respecting** search tool which
  22. can be extended easily to maximize both its search and its privacy protecting
  23. capabilities.
  24. Some widely used search engine features may work differently,
  25. may be turned off by default, or may not be implemented at all in SearXNG
  26. **as a consequence of a privacy-by-design approach**.
  27. Following this approach, features reducing the privacy preserving aspects of SearXNG should be
  28. switched off by default or should not be implemented at all. There are plenty of
  29. search engines already providing such features. If a feature reduces
  30. SearXNG's efficacy in protecting a user's privacy, the user must be informed about
  31. the effect of choosing to enable it. Features that protect privacy but differ from the
  32. expectations of the user should also be carefully explained to them.
  33. Also, if you think that something works weird with SearXNG, it might be because
  34. the tool you are using is designed in a way that interferes with SearXNG's privacy aspects.
  35. Submitting a bug report to the vendor of the tool that misbehaves might be a good
  36. feedback for them to reconsider the disrespect to their customers (e.g., ``GET`` vs ``POST``
  37. requests in various browsers).
  38. Remember the other prime directive of SearXNG is to be hackable, so if the above
  39. privacy concerns do not fancy you, simply fork it.
  40. *Happy hacking.*
  41. Code
  42. ====
  43. .. _PEP8: https://www.python.org/dev/peps/pep-0008/
  44. .. _Conventional Commits: https://www.conventionalcommits.org/
  45. .. _Git Commit Good Practice: https://wiki.openstack.org/wiki/GitCommitMessages
  46. .. _Structural split of changes:
  47. https://wiki.openstack.org/wiki/GitCommitMessages#Structural_split_of_changes
  48. .. _gitmoji: https://gitmoji.carloscuesta.me/
  49. .. _Semantic PR: https://github.com/zeke/semantic-pull-requests
  50. .. sidebar:: Create good commits!
  51. - `Structural split of changes`_
  52. - `Conventional Commits`_
  53. - `Git Commit Good Practice`_
  54. - some like to use: gitmoji_
  55. - not yet active: `Semantic PR`_
  56. In order to submit a patch, please follow the steps below:
  57. - Follow coding conventions.
  58. - PEP8_ standards apply, except the convention of line length
  59. - Maximum line length is 120 characters
  60. - The cardinal rule for creating good commits is to ensure there is only one
  61. *logical change* per commit / read `Structural split of changes`_
  62. - Check if your code breaks existing tests. If so, update the tests or fix your
  63. code.
  64. - If your code can be unit-tested, add unit tests.
  65. - Add yourself to the :origin:`AUTHORS.rst` file.
  66. - Choose meaningful commit messages, read `Conventional Commits`_
  67. .. code::
  68. <type>[optional scope]: <description>
  69. [optional body]
  70. [optional footer(s)]
  71. - Create a pull request.
  72. For more help on getting started with SearXNG development, see :ref:`devquickstart`.
  73. Translation
  74. ===========
  75. Translation currently takes place on :ref:`weblate <translation>`.
  76. .. _contrib docs:
  77. Documentation
  78. =============
  79. .. _Sphinx: https://www.sphinx-doc.org
  80. .. _reST: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
  81. .. sidebar:: The reST sources
  82. has been moved from ``gh-branch`` into ``master`` (:origin:`docs`).
  83. The documentation is built using Sphinx_. So in order to be able to generate
  84. the required files, you have to install it on your system. Much easier, use
  85. our :ref:`makefile`.
  86. Here is an example which makes a complete rebuild:
  87. .. code:: sh
  88. $ make docs.clean docs.html
  89. ...
  90. The HTML pages are in dist/docs.
  91. .. _make docs.live:
  92. Live build
  93. ----------
  94. .. _sphinx-autobuild:
  95. https://github.com/executablebooks/sphinx-autobuild/blob/master/README.md
  96. .. sidebar:: docs.clean
  97. It is recommended to assert a complete rebuild before deploying (use
  98. ``docs.clean``).
  99. Live build is like WYSIWYG. It's the recommended way to go if you want to edit the documentation.
  100. The Makefile target ``docs.live`` builds the docs, opens
  101. URL in your favorite browser and rebuilds every time a reST file has been
  102. changed (:ref:`make docs.clean`).
  103. .. code:: sh
  104. $ make docs.live
  105. ...
  106. The HTML pages are in dist/docs.
  107. ... Serving on http://0.0.0.0:8000
  108. ... Start watching changes
  109. Live builds are implemented by sphinx-autobuild_. Use environment
  110. ``$(SPHINXOPTS)`` to pass arguments to the sphinx-autobuild_ command. You can
  111. pass any argument except for the ``--host`` option (which is always set to ``0.0.0.0``).
  112. E.g., to find and use a free port, use:
  113. .. code:: sh
  114. $ SPHINXOPTS="--port 0" make docs.live
  115. ...
  116. ... Serving on http://0.0.0.0:50593
  117. ...
  118. .. _deploy on github.io:
  119. deploy on github.io
  120. -------------------
  121. To deploy documentation at :docs:`github.io <.>` use Makefile target :ref:`make
  122. docs.gh-pages`, which builds the documentation and runs all the needed git add,
  123. commit and push:
  124. .. code:: sh
  125. $ make docs.clean docs.gh-pages
  126. .. attention::
  127. If you are working in your own brand, don't forget to adjust your
  128. :ref:`settings brand`.