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