meek-client-torbrowser hardcodes the firefox binary and profile paths: linuxmacwindows. The problem is that when Tor Browser is reorganized, as it was in #11641 (closed), you need to make the corresponding change in meek-client-torbrowser, for example 178572f5.
meek-client-torbrowser already takes the full meek-client command on the command line; it looks like:
I don't know of a good clear way to encode two separate command lines into the command line of another program, except maybe to do them both as long strings and then parse the strings before calling exec.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
But then there would need to be code to split up a quoted string, and I'm not sure I want that. Also I think tor might split up a ClientTransportPlugin line on whitespace, and chop up the quoted strings.
Another option is to slightly abuse -- as an additional separator between the firefox command and the meek-client command:
You can get away with that because firefox doesn't use --.
But there's an additional problem with passing a complete firefox command line. Mac OS X needs an absolute path for the profile directory, so meek-client-torbrowser absolutizes it. It couldn't do that easily if the whole command were to come as a unit.
But there's an additional problem with passing a complete firefox command line. Mac OS X needs an absolute path for the profile directory, so meek-client-torbrowser absolutizes it. It couldn't do that easily if the whole command were to come as a unit.
But there's an additional problem with passing a complete firefox command line. Mac OS X needs an absolute path for the profile directory, so meek-client-torbrowser absolutizes it. It couldn't do that easily if the whole command were to come as a unit.
Hmm, I see. I wasn't aware of that Mozilla bug. I had assumed the reason was how OS X 10.9 started setting the working directory of applications to "/"; i.e., the same reason we do the silly tor.real trick a.k.a. #10030 (closed). But I could be wrong.
"TBB" can be anything, it's just what would show up in process lists as the "command name".
This means we can remove all firefox/tbb specificness from this program, as well as the OSX workaround. I am hoping the Bridge line supports args with spaces in. If it doesn't, we can instead write a wrapper shell script that calls firefox and does $(realpath) on the profile arg.
I'm not in love with any idea that has been proposed so far. The double-dash idea from comment:1 and comment:5 is workable, but I think we would grow to dislike it.
The sh -c exec "$1" idea in comment:5 is about 1.2× as crazy I usually like solutions to be :) But it's headed in a good direction. What infinity0 wrote "we can instead write a wrapper shell script that calls firefox" is what we should do, I think.
The --helper option is the program that runs the helper. However the catch is that you only get to specify the name of a single file to run: no arguments, no shell expansion, and no string splitting. Anything that the helper needs, for example the path to the profile, or a call to realpath, has to be encoded into the script.
In the browser bundle, we'll have a different helper script for each OS, corresponding to the current linux.go, mac.go, and windows.go in meek-client-torbrowser. On windows we can use, I don't know, a batch file or something, or in the worst case yet another compiled program. The customization for Debian will be just one Debian-specific shell script.
The reason for having a --helper option instead of having it being implied by position is to leave room for other options in meek-client-helper like --log. It keeps the usual meaning of --; i.e., everything before -- "belongs" to meek-client-helper and everything after is a non-option. Omitting the --helper option could mean to just run meek-client directly without a helper (which is sometimes useful).
meek-browser-helper is similar in functionality to tbb-linux.sh, except it also automatically creates a user profile with that extension enabled. That is, you can use it like ClientTransportPlugin meek exec meek-client-wrapper --helper meek-browser-helper -- meek-client <args> etc. It's meant to work on a clean linux system where you don't already have a pre-made profile for meek-http-helper (unlike TBB).
I'm planning to have it in the Debian package, but it should be generic enough to work for other Linux distros as well (the hardcoded paths are same across linux distros) - which is why I didn't add a -debian suffix to the filename.
Trac: Summary: Make meek-client-torbrower take the firefox command as a parameter to Make meek-client-torbrowser take the firefox command as a parameter
Wilton and Mark say it doesn't work on OS X, giving an error "Your Firefox profile cannot be loaded." Mark suggests it's because there is no realpath on OS X.
Here is the meek-browser-helper-mac.sh script:
# Mac OS X needs an absolute profile path.# https://bugzilla.mozilla.org/show_bug.cgi?id=673955exec "PluggableTransports/TorBrowser.app.meek-http-helper/Contents/MacOS/firefox" \ -no-remote -profile "$(realpath "../Data/Browser/profile.meek-http-helper")"
Oh! infinity0, please do not add a default browser helper argument like this. I'm fine with having the meek-browser-helper script in the repo as an example, but I do not want to make it the default behavior for everybody. I was surprised when I ran it and got this error:
2015/03/13 09:22:17 running browser-helper command ["meek-browser-helper"]2015/03/13 09:22:17 exec: "meek-browser-helper": executable file not found in $PATH
I want this to be a place where distributions set policy, not us.
So I thought a default value of "meek-browser-helper" was the best option - it would work at least some of the time (as opposed to none of the time), and distros can still install their own /usr/bin/meek-browser-helper if they disagreed with the example script given.
An alternative is to set the default value to "", and if this is not set by the user then give a custom error message like "either set --helper or use meek-client directly". Will do that in a commit tomorrow if you prefer.
So I thought a default value of "meek-browser-helper" was the best option - it would work at least some of the time (as opposed to none of the time), and distros can still install their own /usr/bin/meek-browser-helper if they disagreed with the example script given.
An alternative is to set the default value to "", and if this is not set by the user then give a custom error message like "either set --helper or use meek-client directly". Will do that in a commit tomorrow if you prefer.
The last one is what I had in mind—just output an error. Or we could just make it really optional, and not run any helper (nor pass --helper to meek-client) if it's missing.