Blame doc/custom_gitolite_conf.rst

Pierre-Yves Chibon 145998
.. _custom-gitolite:
Pierre-Yves Chibon 145998
Pierre-Yves Chibon 145998
Customize the gitolite configuration
Pierre-Yves Chibon 145998
====================================
Pierre-Yves Chibon 145998
Pierre-Yves Chibon 145998
Pagure provides a mechanism to allow customizing the creation and
Pierre-Yves Chibon 145998
compilation of the configuration file of gitolite.
Pierre-Yves Chibon 145998
Pierre-Yves Chibon 145998
To customize the gitolite configuration file, we invite you to look at the
Pierre-Yves Chibon 145998
`sources of the module pagure.lib.git_auth
Pierre-Yves Chibon 145998
<https: blob="" f="" git_auth.py="" lib="" master="" pagure="" pagure.io="">`_.</https:>
Pierre-Yves Chibon 145998
Pierre-Yves Chibon 145998
As you can see it defines the following class::
Pierre-Yves Chibon 145998
Pierre-Yves Chibon 145998
    class GitAuthHelper(object):
Pierre-Yves Chibon 145998
Pierre-Yves Chibon 145998
        __metaclass__ = abc.ABCMeta
Pierre-Yves Chibon 145998
Pierre-Yves Chibon 145998
        @staticmethod
Pierre-Yves Chibon 145998
        @abc.abstractmethod
Pierre-Yves Chibon 145998
        def generate_acls():
Pierre-Yves Chibon 145998
            pass
Pierre-Yves Chibon 145998
Pierre-Yves Chibon cdf542
        @classmethod
Pierre-Yves Chibon cdf542
        @abc.abstractmethod
Pierre-Yves Chibon cdf542
        def remove_acls(self, session, project):
Pierre-Yves Chibon cdf542
            pass
Pierre-Yves Chibon cdf542
Pierre-Yves Chibon 145998
This will be the class you will have to inherit from in order to inject your
Pierre-Yves Chibon 145998
own code.
Pierre-Yves Chibon 145998
You will then declare an entry point in your `setup.py` following this
Pierre-Yves Chibon 145998
template::
Pierre-Yves Chibon 145998
Pierre-Yves Chibon 145998
    entry_points="""
Pierre-Yves Chibon 145998
    [pagure.git_auth.helpers]
Pierre-Yves Chibon 145998
    my_git_auth = my_pagure.my_module:MyGitAuthTestHelper
Pierre-Yves Chibon 145998
    """
Pierre-Yves Chibon 145998
Pierre-Yves Chibon 145998
Then you can adjust pagure's configuration file to say::
Pierre-Yves Chibon 145998
Pierre-Yves Chibon 145998
    GITOLITE_BACKEND = 'my_git_auth'