#4731 Switch default Git auth backend to the internal 'pagure_authorized_keys' backend
Merged by ngompa. Opened by ngompa.
ngompa/pagure switch-default-git-backend  into  master

Download 4731.patch

The Gitolite backend has turned into a rather difficult backend to support
by default. Among other things, newer versions of Gitolite seem to have
issues with parsing the configuration data generated by Pagure.

Combined with the performance issues for larger setups and the complexity
required to set up Pagure correctly with the Gitolite backend, it makes
sense to switch the default backend to the simpler, internal one.

Signed-off-by: Neal Gompa ngompa13@gmail.com

@pingou I don't know when we want to make this change, but I'm getting frustrated by gitolite becoming randomly broken on top of the poor performance.

Issues like #3971 are now commonplace for me on both Mageia and openSUSE, especially since openSUSE Leap 15.1 and newer are afflicted with the problem.

I'm obviously okay with us fixing #3971 for 5.9, but for 6.0, we should just change the default.

Thanks for this. As someone impacted by the bug mentioned in #3971, I think this makes sense. Unfortunately, though, this patch won't work out of the box as is. As you know, I spent several hours trying to get the pagure git auth working (with your help as well; thank you for that), so I thought it'd be a good idea to comment here and explain what you need to do in order to get things up and running.

  • You will need to set AuthorizedKeysCommand and AuthorizedKeysCommandUser on /etc/sshd/sshd_config. Currently the documentation doesn't mention anything about it. There is a Fedora configuration example here:

https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/basessh/templates/sshd_config#n46

  • You will need to set SSH_KEYS_USERNAME_EXPECT on pagure.cfg.

  • You will also need to set SSH_COMMAND_NON_REPO_SPANNER to:

SSH_COMMAND_NON_REPOSPANNER = ([
    "/usr/bin/%(cmd)s",
    "/srv/git/repositories/%(reponame)s",
], {"GL_USER": "%(username)s"})

There is also a Fedora example here:

https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/pagure/frontend/templates/pagure.cfg#n345

This should be better documented in the docs; the default is to always use gitolite3, which obviously doesn't work, and there's no mention in the docs about using this /usr/bin/%(cmd)s.

Anyway, with these modifications I was finally able to clone a repository using the pagure git auth backend.

This is probably not ready to go because we need documentation and a way to avoid changes to sshd_config(5) to make things work by default...

rebased onto dcd2ab7b155758fd0e4c37b583a146b583d45284

apart from the sshd_config thing, you need

HTTP_REPO_ACCESS_GITOLITE = None for http repo access too.

rebased onto 1b8eeb82aaeaae6f5797eb565b8c0292bae110e1

2 new commits added

  • Switch default Git auth backend to the 'pagure_authorized_keys' backend
  • doc: Update information about supported Git auth backends

rebased onto b0393e955a892f8bb5b0680beecf4c27223ec7b3

rebased onto d48ccadfab751e924a24ba6e43b5dfaa55db35a9

rebased onto c7d9837e82fe9a9a68d7b16d28756c670b089dc7

2 new commits added

  • Switch default Git auth backend to the 'pagure_authorized_keys' backend
  • doc: Update information about supported Git auth backends

2 new commits added

  • Switch default Git auth backend to the 'pagure_authorized_keys' backend
  • doc: Update information about supported Git auth backends

2 new commits added

  • Switch default Git auth backend to the 'pagure_authorized_keys' backend
  • doc: Update information about supported Git auth backends

rebased onto 0b4398be31b21982f5724fb2f3b8b506eccdd6d4

rebased onto 852ebe66f78036e155436cc20ce6e152c429e2c8

rebased onto 703837556b163d0de3c0c5bf4ed0e46983d8337f

rebased onto 17b8b05484f27d49f69ddc0b649bc5d34b3903b3

WTF?

01:28:13  Failed tests:
01:28:13  FAILED test: py-test_pagure_flask_api_fork

rebased onto c0c0583712b07e1bb3a98566ec2fb9f68e6905a1

rebased onto 38770e40641220506de733dc389d9a033c2d9fa2

rebased onto b2780b4b4feb6c45551e25a752da31fb67c98842

Pull-Request has been merged by ngompa

Metadata