jafeha / parabird

Simple script written in python to build an os independent truecrypt encrypted usb-stick containing a portable thunderbird, enigmail, torbirdy and vidalia.
GNU General Public License v3.0
11 stars 7 forks source link

pgp var stuff #36

Closed jafeha closed 11 years ago

jafeha commented 11 years ago

to the basics:

we have to do two thing: the path to the gpg binary needs to be set and the path to keyring needs to be specified.

i'd suggest to write the binary paths into the extensions standard prefs. those are e.g. stored in

apps/linux/thunderbird/thunderbird/distribution/extensions/
{847b3a00-7ab1-11d4-8f02-006008948af5}/defaults/pref/enigmail.js

furthermore, i'd place the keys in data/gpg and specify the pgp home exporting it in the starter:

export GNUPGHOME=/media/truecrypt1/data/gpg/
export GNUPGHOME=$PWD/data/gpg/

we have to find out, how this var is set under windows.

jafeha commented 11 years ago
export GNUPGHOME=$PWD/data/gpg/

worksforme under linux. should be working on mac os too. binary folder needs to be fixed.

jafeha commented 11 years ago

placing an prefs.js in the profile folder including the binary path works, but i can't get it to work with relative paths:

This works (remove the returns):

/media/truecrypt1$ echo 'user_pref("extensions.enigmail.agentPath", 
"/media/truecrypt1/apps/linux/gpg/gpg4usb/bin/gpg");' > data/profile/prefs.js

This won't work:

/media/truecrypt1$ echo 'user_pref("extensions.enigmail.agentPath", 
"$PWD/apps/linux/gpg/gpg4usb/bin/gpg");' > data/profile/prefs.js

/media/truecrypt1$ echo 'user_pref("extensions.enigmail.agentPath", 
"../../apps/linux/gpg/gpg4usb/bin/gpg");' > data/profile/prefs.js

any ideas?

jafeha commented 11 years ago

i had some more thoughts about this. we should try setting the path relative within the extension and not in the prefs.js. i hope the path is read every time enigmail gets loaded.

just if setting the relative path in the extension won't work:

we could write / change the absolute path in the prefs.js file every time the starter gets loaded (e.g. using sed). i'm quite sure that we would we need the powershell under windows to do that. so i'm not sure if we could support win xp (powershell 1.0 or 2.0) anymore.

another problem is, that we have one prefs.js file for all three instances. i haven't tried yet, but i don't think that setting three different paths would work. we could either go with the way described above or we could use a one profile file for each starter copying and pasting it. that would possibly cause different behavior in the instances over the time.

jafeha commented 11 years ago

if we place the path to the gpg binaries here:

apps/linux/thunderbird/thunderbird/distribution/extensions/
{847b3a00-7ab1-11d4-8f02-006008948af5}/defaults/pref/enigmail.js

and here:

apps/linux/thunderbird/thunderbird/distribution/extensions/
{847b3a00-7ab1-11d4-8f02-006008948af5}/defaults/preferences/enigmail.js

the extension loads with the right path to the binary. unfortunately, it's set only once when the extension gets initialized. so if tb is started under a different os, the path might get overwritten once, but not another time switching back to the prior os.

jafeha commented 11 years ago

digging in the depth of the old internet (Web Archive: Share Mail), i've come up with solution for both problems, relative paths within the config and setting different paths to binaries:

using the syntax "ProfD$path" we can use relative paths within the config. i'll do some testing for that.

ProfD is a special identifier for the profile directory that exists so that you don't 
need to figure out its location. In general this is the only directory flag you'll need, 
but sometimes you'll need access to other system directories, and you don't 
want to have to worry about which operating system or system language your
extension is running on. A full list of these flags can be found in the Firefox source.

for shared profiles but split configs, we could go with split configurations but shared mail storage folders. this would cause the following folder structure:

apps/.../
data/profile_linux/prefs.js
data/profile_windows/prefs.js
data/profile_mac/prefs.js
data/mailstorage

within each prefs.js file, we can specify the relative path to the binary:

 'user_pref("extensions.enigmail.agentPath", "[ProfD]../../apps/linux/gpg/gpg4usb/bin/gpg");'

and we can set the mail storage var to the relative path:

user_pref("mail.root.none", "[ProfD]../mailstorage");

as i have already pointed out, the bahavior of the three possible instances will be different over the time. setting an option under linux from a "A" to "B" won't cause the option being set to "B" under windows. but i guess thats a deal with the devil i'd take for while until we come up with another solution.

jafeha commented 11 years ago

this is not working so far... well, but instead of shipping an prefs.js file, we should probably place a user.js file in the profile folder: http://kb.mozillazine.org/User.js_file

jafeha commented 11 years ago

fixed.