From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-0.5 required=3.0 tests=AWL,MSGID_FROM_MTA_HEADER, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.general,gmane.comp.lang.ruby.rainbows.general Subject: [ANN] upr - Upload Progress for Rack (initial release) Date: Wed, 11 Nov 2009 10:38:45 +0900 Message-ID: <20091111013842.GB21125@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257903559 10697 80.91.229.12 (11 Nov 2009 01:39:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Nov 2009 01:39:19 +0000 (UTC) Cc: rainbows-talk@rubyforge.org To: ruby-talk@ruby-lang.org (ruby-talk ML) Original-X-From: ruby-talk-admin@ruby-lang.org Wed Nov 11 02:39:12 2009 Return-path: Envelope-to: gclrg-ruby-talk@m.gmane.org Delivered-To: ruby-talk@ruby-lang.org Original-Posted: Tue, 10 Nov 2009 17:38:42 -0800 X-ML-Name: ruby-talk X-Mail-Count: 350151 X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address ruby-talk-ctl@ruby-lang.org; help= User-Agent: Mutt/1.5.18 (2008-05-17) Content-Disposition: inline Precedence: bulk Original-Lines: 78 List-Id: List-Software: fml [fml 4.0.3 release (20011202/4.0.3)] List-Post: List-Owner: List-Help: List-Unsubscribe: Xref: news.gmane.org gmane.comp.lang.ruby.general:307290 gmane.comp.lang.ruby.rainbows.general:23 Archived-At: Received: from carbon.ruby-lang.org ([221.186.184.68]) by lo.gmane.org with esmtp (Exim 4.50) id 1N82Au-0005BZ-Ib for gclrg-ruby-talk@m.gmane.org; Wed, 11 Nov 2009 02:39:09 +0100 Received: from carbon.ruby-lang.org (beryllium.ruby-lang.org [127.0.0.1]) by carbon.ruby-lang.org (Postfix) with ESMTP id 594523C1C95D3; Wed, 11 Nov 2009 10:38:50 +0900 (JST) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by carbon.ruby-lang.org (Postfix) with ESMTP id 818B33C229408 for ; Wed, 11 Nov 2009 10:38:45 +0900 (JST) Received: from localhost (unknown [127.0.2.5]) by dcvr.yhbt.net (Postfix) with ESMTP id 698B31F677; Wed, 11 Nov 2009 01:38:42 +0000 (UTC) upr is Rack middleware that allows browser-side upload progress monitoring. It is based-on the "mongrel_upload_progress" module, but allows any Moneta backing store in addition to DRb. There is also a packaged example for using an ActiveRecord model for Rails. * http://upr.bogomips.org/ * upr@librelist.com * git://git.bogomips.org/upr.git You can see upr it in action at http://upr-demo.bogomips.org/ It will report the size and SHA1 of the file you've uploaded. Much of the demo was stolen from mongrel_upload_progress. == Web Server Compatibility While upr is completely Rack::Lint-compatible, upr is only compatible with Rack web servers that support a streaming "rack.input". Currently this is limited to {Rainbows!}[http://rainbows.rubyforge.org/] with a handful of concurrency models: * ThreadSpawn * ThreadPool * Revactor* For use with Revactor, the use of network-based Moneta stores or DRb is only advised if those stores are using Revactor-aware sockets. == JavaScript/HTML Compatibility The current developer does not react well with GUIs. Thus all (R)HTML and Prototype JavaScript code was stolen from mongrel_upload_progress. Contributions to add compatibility for more modern things like JQuery and HTML5 are very welcome. == Backend Compatibility We depend on {Moneta}[http://github.com/wycats/moneta], which allows the use of a multitude of key-value stores. We also provide a DRb+Moneta::Memory server to ease transitions from mongrel_upload_progress. Additionally, there is an example for using Rails ActiveRecord as a backend storage mechanism. Cookie-based upload tracking may eventually be used, too (contributions very welcome). == Proxy Compatibility No proxy is required when used with Rainbows! The only incompatible HTTP proxy we know of is nginx. nginx will buffer large requests to the filesystem before sending them to the backend. nginx has its own 3rd-party module for {upload progress}[http://wiki.nginx.org/NginxHttpUploadProgressModule] and may be used instead of upr. Most other HTTP-aware and all TCP-only proxies should be compatible. Disabling Nagle's algorithm in both the Rack web server and proxy is advised for lower latency, especially with stunnel. == Unicorn Compatibility While {Unicorn}[http://unicorn.bogomips.org/] provides the streaming "rack.input" for Rainbows!, using Unicorn with upr is generally NOT recommended. Unicorn only supports fast clients and progress reporting is unnecessary unless clients are uploading files that are hundreds of megabyte in size or larger. == Getting Started gem install upr For Rails, look at the Rails application {example}[http://git.bogomips.org/cgit/upr.git/tree/examples/rails_app-2.3.4] and RDoc. More documentation is on the way. -- Eric Wong