Package: django-anyvcs
django-anyvcs is a Django app providing homogenous management of multiple
version control systems, and the access rights to them.  Currently supported
VCS systems are git, Mercurial, and Subversion.Each instance ofdjango_anyvcs.models.Repocorresponds to a VCS repository
on the server’s disk.  You can grant access on these repos to one or more
DjangoUserorGroup(fromdjango.contrib.auth.models).All repositories can be made available through the SSH access method.  The SSH
server should be configured with user public keys which force a specific
command to be run, instead of the command that was requested - this command
should bedjango-anyvcs-ssh, which is generated by setuptools when this
package is installed.  You’ll probably want to usedjango-sshkeyto help
you do this.  The originalssh_dispatch.pyscript is still included with a
deprecation warning for backwards compatibility.Thedjango-anyvcs-sshprogram interprets the original ssh command, which
should be in theSSH_ORIGINAL_COMMANDenvironment variable (automatically
set by OpenSSH), and fulfills the request, granting and denying access as
configured in Django.ConfigurationAdddjango_anyvcsto your project’sINSTALLED_APPS.Thedjango_anyvcs.views.accessview is used bydjango-anyvcs-ssh.
The URL that maps to this view should be accessible to the host runningdjango-anyvcs-ssh(usually localhost).Thedjango_anyvcs.views.api_callview is not used by any component of
django-anyvcs, but is made available to provide a web API to access the
underlying repository.  Thedjango_anyvcs.remotemodule provides a python
API to this web API which provides an interface similar toanyvcs.common.VCSRepoobjects.WarningDo not make any URLs fromdjango_anyvcs.urlsavailable to the public,
as they can reveal sensitive information.Settingsdjango-anyvcs looks at the following variables in your project’s settings.py:VCSREPO_ROOTString, required.  The root directory in which all VCS repositories are
stored.VCSREPO_PATH_FUNCTIONFunction, optional.  Override the default path given to a repo.  The function
is given a repo and returns a string (the path).VCSREPO_CHECK_NESTED_PATHSBoolean, defaults to True.  If true then repo paths are checked against all
other repo paths to make sure they aren’t nested inside each other.  This is
a fairly expensive operation, so if you know this won’t ever happen then set
this to False.VCSREPO_ALLOW_NESTED_PATHSBoolean, defaults to False.  If true then VCS systems that support it will
allow path nesting.  Currently, only Mercurial supports this.VCSREPO_USE_USER_RIGHTSBoolean, defaults to True.  If true then the UserRights model will be enabled.VCSREPO_USE_GROUP_RIGHTSBoolean, defaults to True.  If true then the GroupRights model will be
enabled.VCSREPO_USER_MODELString, defaults toAUTH_USER_MODELor'auth.User'.  Defines the user
model that UserRights is tied to.VCSREPO_GROUP_MODELString, defaults to'auth.Group'.  Defines the group model that
GroupRights is tied to.VCSREPO_RIGHTS_FUNCTIONFunction, optional.  If set, this function is called with two parameters: the
repository being accessed, and the user who is accessing the repository (may
be None to indicate an anonymous user).  The function should return the
rights string, which is one of ‘-’ (deny access), ‘r’ (read-only access), or
‘rw’ (read and write access).VCSREPO_USER_ACL_FUNCTIONFunction, optional.  If set, this function is called with one parameter which
is a repository. The function should return adictwhich mapsauth.Userinstances to a rights string, one of ‘-’, ‘r’, or ‘rw’ for the
given repository.VCSREPO_GROUP_ACL_FUNCTIONFunction, optional.  If set, this function is called with one parameter which
is a repository. The function should return adictwhich mapsauth.Groupinstances to a rights string, one of ‘-’, ‘r’, or ‘rw’ for the
given repository.VCSREPO_RECALCULATE_DISK_SIZEBoolean, optional.  If true, django-anyvcs will automatically recalculate
disk size of repositories wheneverdjango-anyvcs-sshis invoked to access
them.  Defaults to true.VCSREPO_IGNORE_PRIVATEBoolean, optional. If true, django-anyvcs will not consider cached
information generated bypython-anyvcsa part of the disk size. Defaults to
true.When used withdjango-sshkey, a setting similar to this will tie together
the two apps:SSHKEY_AUTHORIZED_KEYS_OPTIONS = \
  'command="env VCSREPO_ROOT=%s /path/to/django-anyvcs-ssh ' \
  'http://localhost:8000/anyvcs/access {username}",no-agent-forwarding,' \
  'no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding' % VCSREPO_ROOTDependenciespython-anyvcsversion 1.1.0 or greaterAlthough not a strict dependency, django-anyvcs was designed to be used in
conjunction withdjango-sshkey(version 2.0.0 or greater) and would be
fairly useless without it or something that provides a similar functionality.