Ticket #12716: 0001-Add-firefox-and-profile-options-to-meek-client-torbr.patch

File 0001-Add-firefox-and-profile-options-to-meek-client-torbr.patch, 4.5 KB (added by dcf, 5 years ago)
  • meek-client-torbrowser/linux.go

    From d45a6541e9b71b96dbe72d95606c5f2394fb91d6 Mon Sep 17 00:00:00 2001
    From: David Fifield <david@bamsoftware.com>
    Date: Sat, 2 Aug 2014 00:41:38 -0700
    Subject: [PATCH] Add --firefox and --profile options to
     meek-client-torbrowser.
    
    It makes these values configurable from torrc, rather than being baked
    into the executable. The old values are still default.
    
    https://trac.torproject.org/projects/tor/ticket/12716
    ---
     meek-client-torbrowser/linux.go                  |  4 ++--
     meek-client-torbrowser/mac.go                    |  4 ++--
     meek-client-torbrowser/meek-client-torbrowser.go | 11 ++++++++---
     meek-client-torbrowser/windows.go                |  4 ++--
     4 files changed, 14 insertions(+), 9 deletions(-)
    
    diff --git a/meek-client-torbrowser/linux.go b/meek-client-torbrowser/linux.go
    index 7a85d82..f01003e 100644
    a b  
    66package main
    77
    88const (
    9         firefoxPath        = "./firefox"
    10         firefoxProfilePath = "TorBrowser/Data/Browser/profile.meek-http-helper"
     9        defaultFirefoxPath        = "./firefox"
     10        defaultFirefoxProfilePath = "TorBrowser/Data/Browser/profile.meek-http-helper"
    1111)
  • meek-client-torbrowser/mac.go

    diff --git a/meek-client-torbrowser/mac.go b/meek-client-torbrowser/mac.go
    index 7eee72d..207e650 100644
    a b const ( 
    99        // The TorBrowser.app.meek-http-helper directory is a special case for
    1010        // the mac bundle. It is a copy of TorBrowser.app that has a modified
    1111        // Info.plist file so that it doesn't show a dock icon.
    12         firefoxPath        = "PluggableTransports/TorBrowser.app.meek-http-helper/Contents/MacOS/firefox"
    13         firefoxProfilePath = "../Data/Browser/profile.meek-http-helper"
     12        defaultFirefoxPath        = "PluggableTransports/TorBrowser.app.meek-http-helper/Contents/MacOS/firefox"
     13        defaultFirefoxProfilePath = "../Data/Browser/profile.meek-http-helper"
    1414)
  • meek-client-torbrowser/meek-client-torbrowser.go

    diff --git a/meek-client-torbrowser/meek-client-torbrowser.go b/meek-client-torbrowser/meek-client-torbrowser.go
    index 0c339af..4e74674 100644
    a b  
    22// meek-client to meek-http-helper running in Tor Browser.
    33//
    44// Sample usage in torrc (exact paths depend on platform):
    5 //      ClientTransportPlugin meek exec ./meek-client-torbrowser --log meek-client-torbrowser.log -- ./meek-client --url=https://meek-reflect.appspot.com/ --front=www.google.com --log meek-client.log
     5//      ClientTransportPlugin meek exec ./meek-client-torbrowser --firefox ./firefox --profile TorBrowser/Data/Browser/profile.meek-http-helper --log meek-client-torbrowser.log -- ./meek-client --url=https://meek-reflect.appspot.com/ --front=www.google.com --log meek-client.log
    66// Everything up to "--" is options for this program. Everything following it is
    7 // a meek-client command line. The command line for running firefox is implicit
    8 // and hardcoded in this program.
     7// a meek-client command line. The command line for running firefox is
     8// constructed from the --firefox and --profile options.
    99//
    1010// This program, meek-client-torbrowser, starts a copy of firefox under the
    1111// meek-http-helper profile, which must have configured the meek-http-helper
    import ( 
    4646// This magic string is emitted by meek-http-helper.
    4747var helperAddrPattern = regexp.MustCompile(`^meek-http-helper: listen (127\.0\.0\.1:\d+)$`)
    4848
     49var firefoxPath string
     50var firefoxProfilePath string
     51
    4952func usage() {
    5053        fmt.Fprintf(os.Stderr, "Usage: %s [meek-client-torbrowser args] -- meek-client [meek-client args]\n", os.Args[0])
    5154        flag.PrintDefaults()
    func main() { 
    144147
    145148        flag.Usage = usage
    146149        flag.BoolVar(&exitOnStdinEOF, "exit-on-stdin-eof", false, "exit when stdin is closed (use with terminateprocess-buffer)")
     150        flag.StringVar(&firefoxPath, "firefox", defaultFirefoxPath, "path to firefox executable")
    147151        flag.StringVar(&logFilename, "log", "", "name of log file")
     152        flag.StringVar(&firefoxProfilePath, "profile", defaultFirefoxProfilePath, "path to firefox profile")
    148153        flag.Parse()
    149154
    150155        if logFilename != "" {
  • meek-client-torbrowser/windows.go

    diff --git a/meek-client-torbrowser/windows.go b/meek-client-torbrowser/windows.go
    index cc69bec..c3a8b6a 100644
    a b  
    66package main
    77
    88const (
    9         firefoxPath        = "./firefox.exe"
    10         firefoxProfilePath = "TorBrowser/Data/Browser/profile.meek-http-helper"
     9        defaultFirefoxPath        = "./firefox.exe"
     10        defaultFirefoxProfilePath = "TorBrowser/Data/Browser/profile.meek-http-helper"
    1111)