mrash / gpgdir

Recursive directory encryption with GnuPG
http://www.cipherdyne.org/gpgdir/
GNU General Public License v2.0
21 stars 5 forks source link

[ENHANCEMENT] Streamlining excluded directories #3

Open Hasimir opened 8 years ago

Hasimir commented 8 years ago

So it turns out I'm a bit slack and meant to do this last week, oops.

Excluding all hidden files or directories has the significan drawback of preventing gpgdir being used on things like IMAP mail folders, Maildir contents and anything in .config/ (including hexchat and xchat IRC logs) or .znc/ config and logs. No doubt everyone can come up with other examples of things they'd like to be able to compress encrypt and archive.

Nevertheless, the default behaviour of automatically excluding certain essential configuration files and directories needs to be protected. Principally the GPG home directory (traditionally ~/.gnupg/ on POSIX compliant systems) and the relevant shell rc files for the user.

Updating gpgdir to use the user's environment to determine which shell they use and exclude the relevant default rc or configuration files would be ideal, but a fallback of excluding the most common files (e.g. .bashrc, .bash_profile, .tcshrc, .cshrc, etc.). As for GPG's home directory, this should be determined with:

gpgconf --list-dirs

Normally the homedir value is the final line of the output of that command. The fallback should be the default of $HOME/.gnupg/

Note that systems which only use GPG Classic (i.e. GPG 1.4.x) will not have the gpgconf command. Some output may differ between GPG Stable (i.e. GPG 2.0.x) and GPG Modern (i.e. GPG 2.1.x). I've been referring to the output from GPG 2.1.11 here.

mrash commented 8 years ago

Thanks for opening this issue and for the detailed write up.