custom_gitolite_conf.rst 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. .. _custom-gitolite:
  2. Customize the gitolite configuration
  3. ====================================
  4. Pagure provides a mechanism to allow customizing the creation and
  5. compilation of the configuration file of gitolite.
  6. To customize the gitolite configuration file, we invite you to look at the
  7. `sources of the module pagure.lib.git_auth
  8. <https://pagure.io/pagure/blob/master/f/pagure/lib/git_auth.py>`_.
  9. As you can see it defines the following class::
  10. class GitAuthHelper(object):
  11. __metaclass__ = abc.ABCMeta
  12. @staticmethod
  13. @abc.abstractmethod
  14. def generate_acls():
  15. pass
  16. @classmethod
  17. @abc.abstractmethod
  18. def remove_acls(self, session, project):
  19. pass
  20. This will be the class you will have to inherit from in order to inject your
  21. own code.
  22. You will then declare an entry point in your `setup.py` following this
  23. template::
  24. entry_points="""
  25. [pagure.git_auth.helpers]
  26. my_git_auth = my_pagure.my_module:MyGitAuthTestHelper
  27. """
  28. Then you can adjust pagure's configuration file to say::
  29. GITOLITE_BACKEND = 'my_git_auth'