-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for multiple password "contexts" in one repo
Context names let you encrypt some files with different passwords for a different audience, such as super-users. The 'default' context applies unless you set a context name. Add a context by reinitialising transcrypt with a context name then add a pattern with crypt-<CONTEXT*NAME> attributes to *.gitattributes*. For example, to encrypt a file \_top-secret* in a "super" context: # Initialise a new "super" context, and set a different password $ transcrypt --context=super # Add a pattern to .gitattributes with "crypt-super" values $ echo >> .gitattributes \\ 'top-secret filter=crypt-super diff=crypt-super merge=crypt-super' # Add and commit your top-secret and .gitattribute files $ git add .gitattributes top-secret $ git commit -m "Add top secret file for super-users only" # List all contexts $ transcrypt --list-contexts # Display the cipher and password for the "super" context $ transcrypt --context=super --display
- Loading branch information
Showing
9 changed files
with
830 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Maintainer: Aaron Bull Schaefer <[email protected]> | ||
pkgname=transcrypt | ||
pkgver=2.2.0 | ||
pkgver=2.3.0-pre | ||
pkgrel=1 | ||
pkgdesc='A script to configure transparent encryption of files within a Git repository' | ||
arch=('any') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,15 @@ The transcrypt source code and full documentation may be downloaded from | |
* `-i`, `--import-gpg`=<file>: | ||
import the password and cipher from a gpg encrypted file | ||
|
||
* `-C`, `--context`=<context_name> | ||
name for a context that can use a different passphrase and cipher | ||
from the 'default' context; use this advanced option, to permit | ||
encrypting different files with different passphrases | ||
|
||
* `--list-contexts` | ||
list all contexts configured in the repository, and warn about | ||
incompletely configured contexts. | ||
|
||
* `-v`, `--version`: | ||
print the version information | ||
|
||
|
@@ -105,6 +114,33 @@ If the origin repository has just rekeyed, all clones should flush their | |
transcrypt credentials, fetch and merge the new encrypted files via Git, and | ||
then re-configure transcrypt with the new credentials. | ||
|
||
## ADVANCED | ||
|
||
Context names let you encrypt some files with different passwords for a | ||
different audience, such as super-users. The 'default' context applies unless | ||
you set a context name. | ||
|
||
Add a context by reinitialising transcrypt with a context name then add a | ||
pattern with crypt-<CONTEXT_NAME> attributes to .gitattributes. | ||
For example, to encrypt a file 'top-secret' in a "super" context: | ||
|
||
# Initialise a new "super" context, and set a different password | ||
$ transcrypt --context=super | ||
|
||
# Add a pattern to .gitattributes with "crypt-super" values | ||
$ echo >> .gitattributes \\ | ||
'top-secret filter=crypt-super diff=crypt-super merge=crypt-super' | ||
|
||
# Add and commit your top-secret and .gitattribute files | ||
$ git add .gitattributes top-secret | ||
$ git commit -m "Add top secret file for super-users only" | ||
|
||
# List all contexts | ||
$ transcrypt --list-contexts | ||
|
||
# Display the cipher and password for the "super" context | ||
$ transcrypt --context=super --display | ||
|
||
## AUTHOR | ||
|
||
Aaron Bull Schaefer <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.