[Cosmo-dev] /home proxy in place
Aparna Kadakia
aparna at osafoundation.org
Mon Feb 26 10:53:24 PST 2007
Jared,
Using alpha4, I am able to successfully test my account on
lab.osaf.us but the 'restore shares' dialog comes up with the
"Sharing Error:
<zanshin.http.HttpError (404)>"
and here's the corresponding error in the chandler.log
007-02-26 10:48:49,098 repository INFO: <DBRepositoryView: MainThread
(5)> committed 4 items (3 kbytes) in 0:00:00.431094, 9 items/s (7
kbytes/s)
2007-02-26 10:48:53,452 application.dialogs.RestoreShares ERROR:
Error during listing of existing resources
Traceback (most recent call last):
File "/Users/aparna/Desktop/Chandler_osx_0.7alpha4.app/Contents/
Resources/application/dialogs/RestoreShares.py", line 98, in
PopulateSharesList
existing = sharing.getExistingResources(self.currentAccount)
File "/Users/aparna/Desktop/Chandler_osx_0.7alpha4.app/Contents/
Resources/parcels/osaf/sharing/__init__.py", line 1453, in
getExistingResources
resources = chain(resources, handle.blockUntil
(fbparent.getAllChildren))
File "/Users/aparna/Desktop/Chandler_osx_0.7alpha4.app/Contents/
Resources/parcels/osaf/sharing/WebDAV.py", line 80, in blockUntil
return zanshin.util.blockUntil(callable, *args, **keywds)
File "/Users/aparna/Desktop/Chandler_osx_0.7alpha4.app/Contents/
Resources/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/zanshin/util.py", line 200, in blockUntil
res.raiseException()
File "/Users/aparna/Desktop/Chandler_osx_0.7alpha4.app/Contents/
Resources/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/twisted/internet/defer.py", line 307, in
_runCallbacks
self.result = callback(self.result, *args, **kw)
File "/Users/aparna/Desktop/Chandler_osx_0.7alpha4.app/Contents/
Resources/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/zanshin/webdav.py", line 1100, in handlePropfind
raise zanshin.http.HTTPError(status=http.NOT_FOUND)
HTTPError: <zanshin.http.HTTPError (404)>
On Feb 24, 2007, at 7:54 PM, Jared Rhine wrote:
> I wrote and am now running the enclosed HTTP proxy on lab.osaf.us.
> This, with the Apache-based routing of PROPFIND /cosmo/home URLs
> through
> this proxy, has mitigated the issues with the failed osaf.us update
> last
> week.
>
> <insert snoopy dance here>
>
> I've been able to run the "account dialog test" test case and the
> "restore shares" test case. I'm not asking for a specific additional
> testing before scheduling another osaf.us update, but others are
> welcome
> to test it out (against http://lab.osaf.us/cosmo) and report. It'd of
> course be wise to get more confirmations. When I'm back in the office
> Monday, I'll schedule the osaf.us update to Cosmo 0.6.0.
>
> The new Apache rewrite set is:
>
> RewriteCond %{REQUEST_METHOD} ^PROPFIND$
> RewriteRule ^/cosmo/home/(.*) http://localhost:10000/cosmo/dav/$1
> [P,L]
> RewriteRule ^/cosmo/home/(.*) http://localhost:4001/cosmo/dav/$1
> [P,L]
> RewriteRule ^/cosmo/(.*) http://localhost:4001/cosmo/$1 [P,L]
>
> This approach should minimize any possible behavior changes. Only
> PROPFIND requests with a path of /cosmo/home are routed through the
> "home-dav-proxy-perl" code below.
>
> The "Apache module" approach wasn't getting very far quickly.
> Compilation of the Webthing modules wasn't really documented, support
> was sketchy ("send us money"), and they didn't seem to allow me to be
> fine-grained enough (single method on single path).
>
> If someone felt like schooling me in the Pythonic way to get the same
> results, I'd happily learn. I futzed with some Python/WSGI/scotch
> (the
> code, not the drink) before just letting CPAN do the heavy lifting.
>
> Note that requests through the above proxy get transformed into a
> chunked content-encoding. Chandler doesn't have any problem with
> that,
> and neither do I.
>
> -------- Forwarded Message --------
>
> Added: osaf.us/bin/home-dav-proxy-perl (1477 => 1478)
> --- osaf.us/bin/home-dav-proxy-perl 2007-02-23 20:25:48 UTC (rev 1477)
> +++ osaf.us/bin/home-dav-proxy-perl 2007-02-25 03:44:51 UTC (rev 1478)
> @@ -0,0 +1,32 @@
> +#!/usr/bin/perl
> +
> +use strict;
> +use warnings;
> +
> +use HTTP::Proxy qw(NONE);
> +use HTTP::Proxy::BodyFilter::simple;
> +use HTTP::Proxy::HeaderFilter::simple;
> +use Data::Dumper qw(Dumper);
> +
> +my $proxy_port = 10_000;
> +my $orig_url = 'http://lab.osaf.us/cosmo/dav/';
> +my $new_url = 'http://lab.osaf.us/cosmo/home/';
> +my $dest_server = 'http://localhost:4001/';
> +
> +my $request_filter = HTTP::Proxy::HeaderFilter::simple->new(
> + sub { shift->proxy->agent->proxy( http => $dest_server ) }
> +);
> +
> +my $response_body = HTTP::Proxy::BodyFilter::simple->new(
> + sub { ${ $_[1] } =~ s/<D:href>$orig_url/<D:href>$new_url/g }
> +);
> +
> +my $proxy = HTTP::Proxy->new;
> +$proxy->port($proxy_port);
> +$proxy->logmask(NONE);
> +$proxy->push_filter(
> + request => $request_filter,
> + response => $response_body,
> + );
> +
> +$proxy->start;
> Property changes on: osaf.us/bin/home-dav-proxy-perl
> ___________________________________________________________________
> Name: svn:executable
> + *
>
> _______________________________________________
> Commits-sandbox mailing list
> Commits-sandbox at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/commits-sandbox
>
> _______________________________________________
> cosmo-dev mailing list
> cosmo-dev at lists.osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/cosmo-dev
More information about the cosmo-dev
mailing list