bin/httpthumbnailer in httpthumbnailer-0.0.10 vs bin/httpthumbnailer in httpthumbnailer-0.0.11
- old
+ new
@@ -3,10 +3,11 @@
require 'cli'
require 'ip'
options = CLI.new do
description 'HTTP thumbnailing server'
+ switch :no_bind, :description => "Do not bind to TCP socket - useful with -s fastcgi option"
option :bind, :short => :b, :default => IP.new('127.0.0.1'), :cast => IP, :description => "HTTP server bind address - use 0.0.0.0 to bind to all interfaces"
option :port, :short => :p, :default => 3100, :cast => Integer, :description => "HTTP server TCP port"
option :server, :short => :s, :default => 'mongrel', :description => "Rack server handler like thin, mongrel, webrick, fastcgi etc."
option :limit_memory, :default => 128*1024**2, :cast => Integer, :description => "Image cache heap memory size limit in bytes"
option :limit_map, :default => 256*1024**2, :cast => Integer, :description => "Image cache memory mapped file size limit in bytes - used when heap memory limit is used up"
@@ -21,11 +22,16 @@
require 'httpthumbnailer/thumbnailer'
require 'httpthumbnailer/thumbnail_specs'
sinatra = Sinatra.new
-sinatra.set :port, options.port
-sinatra.set :bind, options.bind.to_s
+unless options.no_bind
+ sinatra.set :port, options.port
+ sinatra.set :bind, options.bind.to_s
+else
+ sinatra.set :port, nil
+ sinatra.set :bind, nil
+end
sinatra.set :environment, 'production'
sinatra.set :server, options.server
sinatra.set :lock, true
sinatra.set :boundary, "thumnail image data"
sinatra.set :logging, true