From ac1683d21bb1abf3316625c2c87719f39ab899ae Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Thu, 17 Aug 2017 11:03:29 +0200 Subject: [PATCH] Have a dedicated pagure config just for the git hook and specify it on the user's env --- inventory/group_vars/pkgs-stg | 4 +- roles/distgit/pagure/tasks/main.yml | 1 + .../distgit/pagure/templates/pagure_hook.cfg | 59 +++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 roles/distgit/pagure/templates/pagure_hook.cfg diff --git a/inventory/group_vars/pkgs-stg b/inventory/group_vars/pkgs-stg index ed3dba60ef..a922f3a9d3 100644 --- a/inventory/group_vars/pkgs-stg +++ b/inventory/group_vars/pkgs-stg @@ -17,8 +17,8 @@ wsgi_procs: 4 wsgi_threads: 4 fas_client_groups: sysadmin-main,sysadmin-cvs,sysadmin-releng,sysadmin-noc,sysadmin-veteran -fas_client_restricted_app: HOME=/srv/git /usr/share/gitolite3/gitolite-shell %(username)s -fas_client_admin_app: HOME=/srv/git /usr/share/gitolite3/gitolite-shell -s %(username)s +fas_client_restricted_app: PAGURE_CONFIG=/etc/pagure/pagure_hook.cfg HOME=/srv/git /usr/share/gitolite3/gitolite-shell %(username)s +fas_client_admin_app: PAGURE_CONFIG=/etc/pagure/pagure_hook.cfg HOME=/srv/git /usr/share/gitolite3/gitolite-shell -s %(username)s fas_client_ssh_groups: "@cvs,sysadmin-main,sysadmin-cvs,sysadmin-releng,sysadmin-noc,sysadmin-veteran" admin_groups: "@sysadmin-cvs @sysadmin-releng @sysadmin-noc @sysadmin-veteran" diff --git a/roles/distgit/pagure/tasks/main.yml b/roles/distgit/pagure/tasks/main.yml index 01394b2168..e6ad74df7c 100644 --- a/roles/distgit/pagure/tasks/main.yml +++ b/roles/distgit/pagure/tasks/main.yml @@ -83,6 +83,7 @@ owner=pagure group=postfix mode=0640 with_items: - { file: pagure.cfg, location: /etc/pagure } + - { file: pagure_hook.cfg, location: /etc/pagure } - { file: alembic.ini, location: /etc/pagure } tags: - config diff --git a/roles/distgit/pagure/templates/pagure_hook.cfg b/roles/distgit/pagure/templates/pagure_hook.cfg new file mode 100644 index 0000000000..023246f171 --- /dev/null +++ b/roles/distgit/pagure/templates/pagure_hook.cfg @@ -0,0 +1,59 @@ +from datetime import timedelta +import os + +os.umask(0o002) + +DB_URL = 'postgresql://{{ distgit_pagure_db_ro_user }}:{{ distgit_pagure_db_ro_pass }}@{{ distgit_pagure_db_host }}/{{ distgit_pagure_db_name }}' + +WEBHOOK = True +### Folder containing to the git repos +GIT_FOLDER = '/srv/git/repositories' + +### Folder containing the docs repos +DOCS_FOLDER = None + +### Folder containing the pull-requests repos +REQUESTS_FOLDER = '/srv/git/repositories/requests' + +### Folder containing the tickets repos +TICKETS_FOLDER = None + +### Folder containing the clones of the remotes git repo +REMOTE_GIT_FOLDER = '/srv/git/remotes' + +### Folder where to run gl-compile-conf from +GITOLITE_HOME = '/srv/git/' + +### Configuration file for gitolite +GITOLITE_CONFIG = '/srv/git/.gitolite/conf/gitolite.conf' + +### File to include at the top of the gitolite configuration file +GITOLITE_PRE_CONFIG = '/var/tmp/gitolite-prefix.txt' + +### Temp folder to be used to make the clones to work around bug in libgit2: +## refs: https://github.com/libgit2/libgit2/issues/2965 +## and https://github.com/libgit2/libgit2/issues/2797 +TMP_FOLDER = '/srv/tmp' + +REDIS_HOST = '0.0.0.0' +REDIS_PORT = 6379 +REDIS_DB = 0 + +# Configuration item that are specific for this odd pagure instance +CASE_SENSITIVE = True + +PROJECT_TICKETS = False +ENABLE_NEW_PROJECTS = True +ENABLE_DEL_PROJECTS = False +ENABLE_TICKETS = False +ENABLE_GROUP_MNGT = False +DEPLOY_KEY = False +LOCAL_SSH_KEY = False +ALLOW_DELETE_BRANCH = False + +DISABLED_PLUGINS = ['IRC', 'Pagure tickets', 'Read the Doc'] + +GITOLITE_BACKEND = 'distgit' +GITOLITE_CELERY_QUEUE = 'gitolite_queue' + +BLACKLISTED_GROUPS = ['forks', 'group']