[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #9976 [Flashproxy]: flashproxy-client needs to pass args to reg-methods



#9976: flashproxy-client needs to pass args to reg-methods
----------------------------+-----------------
     Reporter:  infinity0   |      Owner:  dcf
         Type:  defect      |     Status:  new
     Priority:  normal      |  Milestone:
    Component:  Flashproxy  |    Version:
   Resolution:              |   Keywords:
Actual Points:              |  Parent ID:
       Points:              |
----------------------------+-----------------

Comment (by dcf):

 This is a good observation. We currently special-case a few options (like
 `--facilitator`, which has meaning only for `flashproxy-reg-http`). But we
 don't want to do that for every possible option for every possible
 registration helper.

 I'm afraid I must vigorously object to passing options as arguments of
 other options. I think it's long and hard to read, like a doubly escaped
 string. Some things I would prefer (just brainstorming, not meant to be
 exhaustive):
  1. A configuration file stating what command to run for each registration
 method string. We might need to introduce some syntax so that the usual
 options controlled by flashproxy-client are still propagated correctly.
 {{{
 [appspot]
 flashproxy-reg-appspot ${AF_INET:+-4} ${AF_INET6:+-6}
 ${TRANSPORT:+--transport=$TRANSPORT} ${UNSAFE_LOGGING:+--unsafe-logging}
 ${FACILITATOR_PUBKEY:+--facilitator-pubkey=$FACILITATOR_PUBKEY} $ADDRESS
 [email]
 flashproxy-reg-email ${AF_INET:+-4} ${AF_INET6:+-6}
 ${TRANSPORT:+--transport=$TRANSPORT} ${UNSAFE_LOGGING:+--unsafe-logging}
 ${FACILITATOR_PUBKEY:+--facilitator-pubkey=$FACILITATOR_PUBKEY} $ADDRESS
 [http]
 flashproxy-reg-http ${AF_INET:+-4} ${AF_INET6:+-6}
 ${TRANSPORT:+--transport=$TRANSPORT} ${UNSAFE_LOGGING:+--unsafe-logging}
 ${FACILITATOR_URL:+--facilitator=$FACILITATOR_URL} $ADDRESS
 [twitter]
 my-twitter-registerer ${TRANSPORT:+--transport=$TRANSPORT}
 ${UNSAFE_LOGGING:+--loglevel=none} --register-address=$ADDRESS
 }}}
  The `${:+}` syntax is [https://www.gnu.org/software/bash/manual/html_node
 /Shell-Parameter-Expansion.html borrowed from Bash] and is just a
 suggestion. This is a pretty heavyweight solution but it's also general
 and complete because it doesn't require changes to flashproxy-client when
 a new helper is added (perhaps somebody's private homebrew helper), and it
 doesn't require helpers to conform to the option naming convention we've
 established (notice the fictitious "twitter" helper I added).
  2. A flashproxy-client option to give an entire command line to run.
 {{{
 flashproxy-client --register-command='flashproxy-reg-email
 --email=blah@blah'
 # Try http, appspot, and a custom command.
 flashproxy-client --register-methods http,appspot --register-command='my-
 twitter-registerer'
 }}}
  This way, the custom commands would not automatically pick up options
 like `-4` and `--unsafe-logging`. But it would provide complete
 flexibility to use the helpers we ship, and also would allow you to use
 any other helper you may have.
  3. An option that at least lets you set all the helper's extra options at
 once. So
 {{{
 flashproxy-client --reg-email-extra='--foo bar'
 }}}
  Instead of
 {{{
 flashproxy-client --reg-email-arg=--foo --reg-email-arg=bar
 }}}
  Something to note about this technique (may not be important) is that it
 doesn't allow you to delete options that might otherwise be set.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9976#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs