Skip to content

Commit 2f905dc

Browse files
committed
Complete preparations for 2.1.0 release
- bump version number to 2.1.0 - add CHANGELOG.md document with historical and new changes - update man page to match changes to README.md - always use double brackets '[[' ']]' around tests, they're safer
1 parent a36f7af commit 2f905dc

15 files changed

+388
-229
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sensitive_file filter=crypt diff=crypt
1+
sensitive_file filter=crypt diff=crypt merge=crypt

CHANGELOG.md

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Changelog
2+
3+
This is a summary of transcrypt releases, dates, and key changes.
4+
5+
See also https://github.com/elasticdog/transcrypt/releases
6+
7+
## transcrypt v2.1.0 (? ? 2020)
8+
9+
This release includes features to make it easier and safer to use transcrypt,
10+
in particular: fix merge of encrypted files with conflicts, preventing
11+
accidental commit of plain text files by incompatible Git tools, and upgrade
12+
easily with `--upgrade`.
13+
14+
### Steps to upgrade
15+
16+
1. Make sure you are running the latest version of _transcrypt_:
17+
18+
```
19+
$ transcrypt --version
20+
```
21+
22+
2. Upgrade a repository:
23+
24+
```
25+
$ transcrypt --upgrade
26+
```
27+
28+
3. Enable the merge handling fix by adding `merge=crypt` to the end of each
29+
_transcrypt_ pattern in `.gitattribute`, to look like this:
30+
31+
```
32+
sensitive_file filter=crypt diff=crypt merge=crypt
33+
```
34+
35+
### New features
36+
37+
- Add `--upgrade` command to apply the latest transcrypt scripts in an already
38+
configured repository without the need to re-apply existing settings.
39+
40+
- Install a Git pre-commit hook to reject accidental commit of unencrypted
41+
plain text version of sensitive files, which could otherwise happen if a tool
42+
does not respect the `.gitattribute` filters Transcrypt needs to do its job.
43+
44+
### Fixed
45+
46+
- Fix handling of branch merges with conflicts in encrypted files, which would
47+
previously leave the user to manually merge files with a mix of encrypted and
48+
unencrypted content. (#69, #8, #23, #67)
49+
50+
- Remove any cached unencrypted files from Git's object database when
51+
credentials are removed from a repository with a flush or uninstall, so
52+
sensitive file data does not remain accessible in a surprising way. (#74)
53+
54+
- Fix handling of sensitive files with non-ASCII file names, such as extended
55+
Unicode characters. (#78)
56+
57+
- Transcrypt `--version` and `--help` commands now work when run outside a Git
58+
repository. (#68)
59+
60+
- The `--list` command now works in a repository that has not yet been init-ed.
61+
62+
### Changed
63+
64+
- Add a functional test suite built on [bats-core](https://github.com/bats-core/bats-core#installation).
65+
- Apply Continuous Integration: run functional tests with GitHub Actions.
66+
- Fix [EditorConfig](https://editorconfig.org/) file config for Markdown files.
67+
- Add [CHANGELOG.md](CHANGELOG.md) file to make it easier to find notes about
68+
project changes (see also Release)
69+
70+
## transcrypt v2.0.0 (20 Jul 2019)
71+
72+
**\*\*\* WARNING: Re-encryption will be required when updating to version 2.0.0! \*\*\***
73+
74+
This is not a security issue, but the result of a [bug fix](https://github.com/elasticdog/transcrypt/pull/57) to ensure that the salt generation is consistent across all operating systems. Once someone on your team updates to version 2.0.0, it will manifest as the encrypted files in your repository showing as _changed_. You should ensure that all users upgrade at the same time...since `transcrypt` itself is small, it may make sense to commit the script directly into your repo to maintain consistency moving forward.
75+
76+
### Steps to Re-encrypt
77+
78+
After you've upgraded to v2.0.0...
79+
80+
1. Display the current config so you can reference the command to re-initialize things:
81+
82+
```
83+
$ transcrypt --display
84+
The current repository was configured using transcrypt version 1.1.0
85+
and has the following configuration:
86+
87+
GIT_WORK_TREE: /home/elasticdog/src/transcrypt
88+
GIT_DIR: /home/elasticdog/src/transcrypt/.git
89+
GIT_ATTRIBUTES: /home/elasticdog/src/transcrypt/.gitattributes
90+
91+
CIPHER: aes-256-cbc
92+
PASSWORD: correct horse battery staple
93+
94+
Copy and paste the following command to initialize a cloned repository:
95+
96+
transcrypt -c aes-256-cbc -p 'correct horse battery staple'
97+
```
98+
99+
2. Flush the credentials and re-configure the repo with the same settings as above:
100+
101+
```
102+
$ transcrypt --flush-credentials
103+
$ transcrypt -c aes-256-cbc -p 'correct horse battery staple'
104+
```
105+
106+
3. Now that all of the appropriate files have been re-encrypted, add them and commit the changes:
107+
```
108+
$ git add -- $(transcrypt --list)
109+
$ git commit --message="Re-encrypt files protected by transcrypt using new salt value"
110+
```
111+
112+
### Fixed
113+
114+
- Force the use of macOS's system `sed` binary to prevent errors (#50)
115+
- Fix cross-platform compatibility by making salt generation logic consistent (#57)
116+
117+
### Changed
118+
119+
- Add an [EditorConfig](https://editorconfig.org/) file to help with consistency in formatting (#51)
120+
- Use [unofficial Bash strict mode](http://redsymbol.net/articles/unofficial-bash-strict-mode/) for safety (#53)
121+
- Reformat files using the automated formatting tools [Prettier](https://prettier.io/) and [shfmt](https://github.com/mvdan/sh)
122+
- Ensure that `transcrypt` addresses all [ShellCheck](https://github.com/koalaman/shellcheck) static analysis warnings
123+
124+
## transcrypt v1.1.0 (26 May 2018)
125+
126+
### Fixed
127+
128+
- Fix broken cipher validation safety check when running with OpenSSL v1.1.0+. (#48)
129+
130+
## transcrypt v1.0.3 (21 Aug 2017)
131+
132+
### Fixed
133+
134+
- Explicitly set digest hash function to match default settings before OpenSSL v1.1.0. (#41)
135+
136+
## transcrypt v1.0.2 (6 Apr 2017)
137+
138+
### Fixed
139+
140+
- Ensure realpath function does not incorrectly return the current directory for certain inputs. (#38)
141+
142+
## transcrypt v1.0.1 (6 Jan 2017)
143+
144+
### Fixed
145+
146+
- Correct the behavior of `mktemp` when running on OS X versions 10.10 Yosemite and earlier.
147+
- Prevent unexpected error output when running transcrypt outside of a Git repository.
148+
149+
## transcrypt v1.0.0 (2 Jan 2017)
150+
151+
Since the v0.9.9 release, these are the notable improvements made to transcrypt:
152+
153+
- properly handle file names with spaces
154+
- adjust usage of `mktemp` utility to be more cross-platform
155+
- additional safety checks for all required cli utility dependencies
156+
157+
## transcrypt v0.9.9 (5 Sep 2016)
158+
159+
Since the v0.9.7 release, these are the notable improvements made to transcrypt:
160+
161+
- support for use of a [wildcard](https://github.com/elasticdog/transcrypt/commit/a0b7d4ec0296e83974cb02be640747149b23ef54) with `--show-raw` to dump the raw commit objects for _all_ encrypted files
162+
- GPG import/export of repository configuration
163+
- more [strict filter script behavior](https://github.com/elasticdog/transcrypt/pull/29) to adhere to upstream recommendations
164+
- automatic caching of the decrypted content for faster Git operations like `git log -p`
165+
- ability to configure bare repositories
166+
- ability to configure "fake bare" repositories for use through [vcsh](https://github.com/RichiH/vcsh)
167+
- ability configure multiple worktrees via [git-workflow](https://github.com/blog/2042-git-2-5-including-multiple-worktrees-and-triangular-workflows)
168+
- support for unencrypted archive exporting via [git-archive](https://git-scm.com/docs/git-archive)
169+
170+
## transcrypt v0.9.8 (5 Sep 2016)
171+
172+
## transcrypt v0.9.7 ( 23 Mar 2015)
173+
174+
## transcrypt v0.9.6 (30 Aug 2014 )
175+
176+
## transcrypt v0.9.5 (23 Aug 2014)
177+
178+
## transcrypt v0.9.4 (3 Mar 2014)

README.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ The requirements to run transcrypt are minimal:
5555
- Bash
5656
- Git
5757
- OpenSSL
58+
- `column` command (on Ubuntu/Debian install `bsdmainutils`)
5859

5960
...and optionally:
6061

@@ -325,30 +326,3 @@ To run the tests:
325326
- [install bats-core](https://github.com/bats-core/bats-core#installation)
326327
- run all tests with: `bats tests/`
327328
- run an individual test with e.g: `./tests/test_help.bats`
328-
329-
## Changes
330-
331-
Fixes:
332-
333-
- Fix handling of branch merges with conflicts in encrypted files, which would
334-
previously leave the user to manually merge files with a mix of encrypted and
335-
unencrypted content.
336-
337-
To apply this fix in projects that already use transcrypt: use the `--upgrade`
338-
command, or uninstall and re-init transcrypt then add `merge=crypt` to the
339-
patterns in _.gitattributes_
340-
341-
- Remove any cached unencrypted from Git's object database when credentials are
342-
removed from a repository with a flush or uninstall (#74).
343-
344-
Improvements:
345-
346-
- Add Git pre-commit hook to reject commit of file that should be encrypted but
347-
has plain text content: a safety mechanism to prevent accidental commits of
348-
plain text files staged by tools that do not respect the .gitattribute
349-
filters Transcrypt needs to do its job.
350-
351-
- Add --upgrade command to apply the latest transcrypt scripts in the
352-
repository without changing its configuration settings.
353-
354-
- Add functional tests.

contrib/bash/transcrypt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ _transcrypt() {
2222
cur="${COMP_WORDS[COMP_CWORD]}"
2323
prev="${COMP_WORDS[COMP_CWORD-1]}"
2424
opts="-c -p -y -d -r -f -F -u -l -s -e -i -v -h \
25-
--cipher --password --yes --display --rekey --flush-credentials --force --uninstall --list --show-raw --export-gpg --import-gpg --version --help"
25+
--cipher --password --yes --display --rekey --flush-credentials --force --uninstall --upgrade --list --show-raw --export-gpg --import-gpg --version --help"
2626

2727
case "${prev}" in
2828
-c | --cipher)

contrib/packaging/pacman/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Maintainer: Aaron Bull Schaefer <aaron@elasticdog.com>
22
pkgname=transcrypt
3-
pkgver=2.0.0
3+
pkgver=2.1.0
44
pkgrel=1
55
pkgdesc='A script to configure transparent encryption of files within a Git repository'
66
arch=('any')

contrib/zsh/_transcrypt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ _transcrypt() {
1818
'(-f --flush-credentials -c --cipher -p --password -r --rekey -u --uninstall)'{-f,--flush-credentials}'[flush cached credentials]' \
1919
'(-F --force -d --display -u --uninstall)'{-F,--force}'[ignore repository clean state]' \
2020
'(-u --uninstall -c --cipher -d --display -f --flush-credentials -p --password -r --rekey)'{-u,--uninstall}'[uninstall transcrypt]' \
21+
'(--upgrade -c --cipher -d --display -f --flush-credentials -p --password -r --rekey)'{--upgrade}'[upgrade transcrypt]' \
2122
'(-i --import-gpg -c --cipher -p --password -d --display -f --flush-credentials -u --uninstall)'{-i,--import-gpg=}'[import config from gpg file]:file:->file' \
2223
&& return 0
2324

man/transcrypt.1.ronn

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ The transcrypt source code and full documentation may be downloaded from
4646
remove all transcrypt configuration from the repository
4747
and leave files in the current working copy decrypted
4848

49+
* `--upgrade`:
50+
apply the latest transcrypt scripts in the repository without
51+
changing your configuration settings
52+
4953
* `-l`, `--list`:
5054
list all of the transparently encrypted files in the repository,
5155
relative to the top-level directory
@@ -78,12 +82,12 @@ were not given.
7882
$ transcrypt
7983

8084
Once a repository has been configured with transcrypt, you can transparently
81-
encrypt files by applying the "crypt" filter and diff to a pattern in the
82-
top-level _.gitattributes_ config. If that pattern matches a file in your
85+
encrypt files by applying the "crypt" filter, diff and merge to a pattern in
86+
the top-level _.gitattributes_ config. If that pattern matches a file in your
8387
repository, the file will be transparently encrypted once you stage and commit
8488
it:
8589

86-
$ echo 'sensitive_file filter=crypt diff=crypt' >> .gitattributes
90+
$ echo 'sensitive_file filter=crypt diff=crypt merge=crypt' >> .gitattributes
8791
$ git add .gitattributes sensitive_file
8892
$ git commit -m 'Add encrypted version of a sensitive file'
8993

tests/_test_helper.bash

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
function init_git_repo {
22
# Warn and do nothing if test dir envvar is unset
3-
if [ -z $BATS_TEST_DIRNAME ]; then
3+
if [[ -z "$BATS_TEST_DIRNAME" ]]; then
44
echo "WARNING: Required envvar \$BATS_TEST_DIRNAME is unset"
55
# Warn and do nothing if test git repo path already exists
6-
elif [ -e $BATS_TEST_DIRNAME/.git ]; then
6+
elif [[ -e "$BATS_TEST_DIRNAME/.git" ]]; then
77
echo "WARNING: Test repo already exists at $BATS_TEST_DIRNAME/.git"
88
else
99
# Initialise test git repo at the same path as the test files
10-
git init $BATS_TEST_DIRNAME
10+
git init "$BATS_TEST_DIRNAME"
1111
# Flag test git repo as 100% the test one, for safety before later removal
12-
touch $BATS_TEST_DIRNAME/.git/repo-for-transcrypt-bats-tests
12+
touch "$BATS_TEST_DIRNAME"/.git/repo-for-transcrypt-bats-tests
1313
fi
1414
}
1515

1616
function nuke_git_repo {
1717
# Warn and do nothing if test dir envvar is unset
18-
if [ -z $BATS_TEST_DIRNAME ]; then
18+
if [[ -z "$BATS_TEST_DIRNAME" ]]; then
1919
echo "WARNING: Required envvar \$BATS_TEST_DIRNAME is unset"
2020
# Warn and do nothing if the test git repo is missing the flag file that
2121
# ensures it *really* is the test one, as set by the 'init_git_repo' function
22-
elif [ ! -e $BATS_TEST_DIRNAME/.git/repo-for-transcrypt-bats-tests ]; then
22+
elif [[ ! -e "$BATS_TEST_DIRNAME/.git/repo-for-transcrypt-bats-tests" ]]; then
2323
echo "WARNING: Aborting delete of non-test Git repo at $BATS_TEST_DIRNAME/.git"
2424
else
2525
# Forcibly delete the test git repo
26-
rm -fR $BATS_TEST_DIRNAME/.git
26+
rm -fR "$BATS_TEST_DIRNAME"/.git
2727
fi
2828
}
2929

3030
function cleanup_all {
3131
nuke_git_repo
32-
rm $BATS_TEST_DIRNAME/.gitattributes
33-
rm -f $BATS_TEST_DIRNAME/sensitive_file
32+
rm "$BATS_TEST_DIRNAME"/.gitattributes
33+
rm -f "$BATS_TEST_DIRNAME"/sensitive_file
3434
}
3535

3636
function init_transcrypt {
37-
$BATS_TEST_DIRNAME/../transcrypt --cipher=aes-256-cbc --password=abc123 --yes
37+
"$BATS_TEST_DIRNAME"/../transcrypt --cipher=aes-256-cbc --password=abc123 --yes
3838
}
3939

4040
function encrypt_named_file {
4141
filename="$1"
4242
content=$2
43-
if [ "$content" ]; then
43+
if [[ "$content" ]]; then
4444
echo "$content" > "$filename"
4545
fi
4646
echo "\"$filename\" filter=crypt diff=crypt merge=crypt" >> .gitattributes
@@ -49,14 +49,14 @@ function encrypt_named_file {
4949
}
5050

5151
function setup {
52-
pushd $BATS_TEST_DIRNAME
52+
pushd "$BATS_TEST_DIRNAME" || exit 1
5353
init_git_repo
54-
if [ ! "$SETUP_SKIP_INIT_TRANSCRYPT" ]; then
54+
if [[ ! "$SETUP_SKIP_INIT_TRANSCRYPT" ]]; then
5555
init_transcrypt
5656
fi
5757
}
5858

5959
function teardown {
6060
cleanup_all
61-
popd
61+
popd || exit 1
6262
}

0 commit comments

Comments
 (0)