--check option to see if a repo exists and can be decrypted
This is to allow programs to determine if a repo uses gcrypt, per #6.
Since this program already knows the name of the manifest file and how to
download it and decrypt it, it makes sense to do the check here rather than
in, eg, git-annex.
This is needed by git-annex assistant when it sets up a gcrypt repository,
to ensure that the gpg key it was asked to use to encrypt the repo is the
same key used to sign it. If it's not, pulling from the repo won't work,
due to git-remote-gcrypt's "Only accepting signatories" check.
The user may have a global user.signingkey setting (I do), but be setting
up a different special-purpose key for encrypting their git repo. The
git-annex assistant cannot mess with the global value, so needs this to
override it.
Otherwise gpg may prompt to verify if we want to encrypt to users who
do not have a defined trust level. But, the participants setting
explicitly listed them, so we know we want to encrypt to them.
root [Sat, 9 Mar 2013 21:44:26 +0000 (04:44 +0700)]
Use directory in /tmp for temporary files
Using a standard directory for temporaries buys us performance when the
user wants it (has configured tmpfs for /tmp) and configurability
(accepts TMPDIR=).
Moving /pack to a temporary directory gives safe concurrent remote
repacks.
root [Sun, 3 Mar 2013 08:02:43 +0000 (09:02 +0100)]
Use a longer pack key
There should be no difference if we use 32 random bytes or more, since
GPG's longest symmetric key is 32 bytes, but to just remove any doubt we
use a longer random passphrase.
root [Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)]
Encrypt to self by default; basic functionality now needs no configuration
Introduces gcrypt.participants "simple" mode which encrypts to self, and
accepts any valid signature by default. No configuration needed for
private repositories.
We also adds remote.<name>.gcrypt-participants to configure this per
remote.
root [Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)]
Migrate to SHA-256 and implicit repo ID (PARTIAL REPO FORMAT CHANGE)
* local, rsync, ssh, sftp repositories are still compatible
* gitception/git backend repositories are not compatible and need to be
deleted and recreated
* Put manifest in a static location, so we don't need #fragment in the URL
* Record repository ID for each remote, and warn if it changes.
* Use SHA-256 by default but allow reading SHA-224-identified packfiles
* The URL #fragment identifies branch to use when using the git backend
root [Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)]
Repack the encrypted remote regularly
Use a simple but slow method of repacking the remote repository.
Download (and verify) all packs not marked 'keep', and repack those into
a new packfile. The new packfile is marked 'keep' with generation 1.
After PUT is called on the manifest, we remove the redundant old
packfiles.
The generation number will allow further iterations of repacking to be
implemented later.
root [Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)]
Use config gcrypt.participants for GPG key ids
Instead of using a separate keyring file (gcrypt.keyring is now
deprecated!), use a simple list of key ids. Extract all keyids and use
these to match GOODSIG <keyid> manually on the gpg status output.
The gcrypt.keyring variable is still used, but it will be removed later.