diff options
-rw-r--r-- | README | 15 | ||||
-rwxr-xr-x | bin/local-openid | 18 |
2 files changed, 29 insertions, 4 deletions
@@ -44,9 +44,18 @@ server. To be useful, it also depends on having a user account on a machine with a publically-accessible IP and DNS name to use as your OpenID identity. -"local-openid" should be installed in your $PATH by RubyGems. -It is a Sinatra application and takes all the usual command-line -arguments. Run "local-openid -h" for help. +== Running + +"local-openid" should be installed in your $PATH by RubyGems or +setup.rb. It is a Sinatra application and takes the usual +command-line arguments. It binds on all addresses (0.0.0.0) and port +4567 by default, using the standard WEBrick web server. + +You may specify a different port with the *-p* switch and address with +the *-o* switch. The following command will start local-openid on port +3000 bound to localhost (useful if behind a reverse proxy like nginx). + + local-openid -o 127.0.0.1 -p 3000 == Hacking diff --git a/bin/local-openid b/bin/local-openid index 7fc6b33..4b8f315 100755 --- a/bin/local-openid +++ b/bin/local-openid @@ -1,3 +1,19 @@ #!/usr/bin/env ruby require 'local_openid' -LocalOpenID.run! +require 'optparse' +require 'socket' +BasicSocket.do_not_reverse_lookup = true +opts = { + :server => 'webrick', # webrick is standard, and plenty fast enough +} +OptionParser.new { |op| + op.on('-s <mongrel|thin|webrick>') { |v| opts[:server] = v } + op.on('-p port') { |val| opts[:port] = val.to_i } + op.on('-o addr') { |val| opts[:bind] = val } + op.on('-h', '--help', 'Show this message') do + puts op.to_s + exit + end +}.parse!(ARGV) + +LocalOpenID.run!(opts) |