diff --git a/doc/configuration.rst b/doc/configuration.rst index c8411dc..035a481 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -706,6 +706,7 @@ Note: Specify SMTP_USERNAME and SMTP_PASSWORD for using SMTP auth Defaults to: ``None`` + SHORT_LENGTH ~~~~~~~~~~~~ @@ -764,6 +765,7 @@ Valid options are ``fas``, ``openid``, ``oidc``, or ``local``. Defaults to: ``fas``. + OIDC Settings ~~~~~~~~~~~~~ @@ -833,6 +835,7 @@ is empty - can be ``email`` (to use the part before ``@``) or ``sub`` (IdP-specific user id, can be a nickname, email or a numeric ID depending on identity provider). + IP_ALLOWED_INTERNAL ~~~~~~~~~~~~~~~~~~~ @@ -933,6 +936,15 @@ This configuration key allows to turn on or off notifications via `fedmsg Defaults to: ``True``. +ALWAYS_FEDMSG_ON_COMMITS +~~~~~~~~~~~~~~~~~~~~~~~~ + +This configuration key allows to enforce `fedmsg `_ +notifications on commits made on all projects in a pagure instance. + +Defaults to: ``True``. + + ALLOW_DELETE_BRANCH ~~~~~~~~~~~~~~~~~~~ diff --git a/pagure/hooks/files/default_hook.py b/pagure/hooks/files/default_hook.py index c3153c2..519d1e8 100755 --- a/pagure/hooks/files/default_hook.py +++ b/pagure/hooks/files/default_hook.py @@ -25,7 +25,7 @@ import pagure.lib.tasks # noqa: E402 import pagure.lib.tasks_services # noqa: E402 -_config = pagure.config.config +_config = pagure.config.reload_config() _log = logging.getLogger(__name__) abspath = os.path.abspath(os.environ['GIT_DIR']) @@ -102,7 +102,10 @@ def send_notifications(session, project, refname, revs, forced): fedmsg_hook = pagure.lib.plugins.get_plugin('Fedmsg') fedmsg_hook.db_object() - if project.fedmsg_hook and project.fedmsg_hook.active: + always_fedmsg = _config.get('ALWAYS_FEDMSG_ON_COMMITS') or None + + if always_fedmsg \ + or (project.fedmsg_hook and project.fedmsg_hook.active): try: print(" - to fedmsg") send_fedmsg_notifications(project, topic, msg)