This gist describes a set of configurations to implement a new set of Qubes RPCs, qubes.GitUploadPack and qubes.GitReceivePack. These RPCs allow a client qube to clone, fetch, push, etc from local repositories to repositories on service qubes over qrexec. Qubes policy can control ro (clone, fetch, etc) and rw (push, etc) access per-repository.
The RPCs only allow access to git repositories on the service qube filesystem. They do not connect the client qube to internet git servers or forges.
However, the service qube can mount directories of git repositories to its filesystem from any remote storage service.
There are nicer ways to implement these RPCs. But the files in this gist are, hopefully, close to the minimal delta from a base system to implement them. They are suited for manual entry to bootstrap a new Qubes system.
Debian qubes. YMMV.
git clone --config protocol.ext.allow=user "ext::git qubes-remote-%s remote-qube /repos/project"These RPCs require an argument to connect to the git repository. The argument must be a systemd-escaped path to a git repository on the git remote service qube.
For example, a git remote service qube has a git repository at /repos/project. The systemd-escaped version of this path is repos-project. A policy that allows client-qube to clone /repos/project on remote-qube would be
qubes.GitUploadPack +repos-project client-qube remote-qube allow
Without the --path flag, systemd-escape will escape the entire path, producing -repos-project, which programs interpret as an option. Always uses the --path flag with systemd-escape on paths for both escaping and unescaping.