Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
67 additions
and
3 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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[!exec:gpg] skip 'gpg not found in $PATH' | ||
|
||
mkgpgconfig | ||
|
||
# use chezmoi's encryption to encrypt a file and an archive | ||
exec tar czf $HOME/archive.tar.gz archive | ||
chezmoi add --encrypt $HOME${/}.file $HOME${/}archive.tar.gz | ||
mkdir www | ||
cp $CHEZMOISOURCEDIR/encrypted_dot_file.asc www/.file.asc | ||
cp $CHEZMOISOURCEDIR/encrypted_archive.tar.gz.asc www/archive.tar.gz.asc | ||
|
||
httpd www | ||
|
||
# test that chezmoi reads encrypted external files and archives | ||
chhome home2/user | ||
mkdir $CHEZMOICONFIGDIR | ||
cp home/user/.config/chezmoi/chezmoi.toml $CHEZMOICONFIGDIR | ||
chezmoi apply --force | ||
cmp $HOME/.file golden/.file | ||
cmp $HOME/.dir/file golden/dir/file | ||
|
||
-- archive/dir/file -- | ||
# contents of dir/file | ||
-- golden/.file -- | ||
# contents of .file | ||
-- golden/dir/file -- | ||
# contents of dir/file | ||
-- home/user/.file -- | ||
# contents of .file | ||
-- home2/user/.local/share/chezmoi/.chezmoiexternal.json -- | ||
{ | ||
".file": { | ||
"type": "file", | ||
"url": "{{ env "HTTPD_URL" }}/.file.asc", | ||
"encrypted": true | ||
}, | ||
".dir": { | ||
"type": "archive", | ||
"url": "{{ env "HTTPD_URL" }}/archive.tar.gz.asc", | ||
"encrypted": true, | ||
"stripComponents": 2 | ||
} | ||
} |