zopefoundation / Zope

Zope is an open-source web application server.
https://zope.readthedocs.io
Other
354 stars 100 forks source link

FTP or WebDav access #649

Closed georgpfolz closed 4 years ago

georgpfolz commented 5 years ago

I'm wondering if it will still be possible to access the ZODB via FTP, WebDav or maybe even SFTP in future Zope versions without ZServer. Or is there a way already which I missed?

I hope this is the right place to ask this kind of questions, if not please refer me to the right place to go.

d-maurer commented 5 years ago

Georg Pfolz wrote at 2019-6-13 05:14 -0700:

I'm wondering if it will still be possible to access the ZODB via FTP, WebDav or maybe even SFTP in future Zope versions without ZServer. Or is there a way already which I missed?

I hope this is the right place to ask this kind of questions, if not please refer me to the right place to go.

WebDAV operates in fact on top of HTTP. There should be no big problem to use it in a WSGI environment (i.e. without ZServer).

Difficulties result from the fact, that WebDAV has slightly different expectations with respect to server behaviour than a typical browser:

The ZServer WebDAV (source) server marked the request to make different behaviour for the two use cases possible. But there are other possibilities to mark the request in a similar way.

For example, one could use a view '@@webdav' to mark the request on traversal as a WebDAV request and request WebDAV friendly behaviour. With this approach a URL of the form <host>/<path> could provide browser friendly access to the object identified by <path> while <host>/@@webdav/<path> would give WebDAV friendly access to the same object.

dataflake commented 5 years ago

There are no plans to support any of this in Zope without ZServer because Zope has essentially outsourced all network protocol services to third-party packages that use WSGI to talk to Zope.

thet commented 5 years ago

@datakurre worked on a ZServer implementation based on Twisted, which also supports http2, WebDAV and the like. See here: https://community.plone.org/t/moonshot-for-migrating-zserver-to-python-3-at-plog-2019/8191/19

It's not finished, but his statements sound very promising.

@d-maurer instead of using a specific @@webdav browser view, I'd prefer to mark the request as WebDAV request based on the webdav:// protocoll. By adapting a view to a webdav request, we'd have the same flexibility like with normal browser views.

datakurre commented 5 years ago

I have a Python 3 branch https://github.com/datakurre/ZServer/tree/datakurre/py3 that should be drop in replacement for the latest ZServer release and have working HTTP and WebDAV source servers based on Python 3 compatible Twisted (instead of old Python 2 only Medusa).

Some features like fast-listen=false are not yet implemented and, of course, I may have missed something (this has been too easy so far).

My branch as such is not yet ”stable”, because I’m still figuring out reasonable way to build extensible websocket support (based on autobahn and zmq).

d-maurer commented 5 years ago

Georg Pfolz wrote at 2019-6-13 05:14 -0700:

I'm wondering if it will still be possible to access the ZODB via FTP, WebDav or maybe even SFTP in future Zope versions without ZServer. Or is there a way already which I missed?

I hope this is the right place to ask this kind of questions, if not please refer me to the right place to go.

I have just seen that commit "ab6286700a64535256926f6e307a2faf40c8b3cc": Date: Sun Aug 14 21:17:06 2016 +0200

Make webdav/ftp methods conditionally available based on ZServer presence.

might have disabled WebDAV for WSGI even though there is no real necessity as WebDAV operates on top of HTTP/HTTPS and therefore could be used over WSGI.

d-maurer commented 5 years ago

Dieter Maurer wrote at 2019-6-14 09:04 +0200:

Georg Pfolz wrote at 2019-6-13 05:14 -0700:

I'm wondering if it will still be possible to access the ZODB via FTP, WebDav or maybe even SFTP in future Zope versions without ZServer. Or is there a way already which I missed?

I hope this is the right place to ask this kind of questions, if not please refer me to the right place to go.

I have just seen that commit "ab6286700a64535256926f6e307a2faf40c8b3cc": Date: Sun Aug 14 21:17:06 2016 +0200

Make webdav/ftp methods conditionally available based on ZServer presence.

might have disabled WebDAV for WSGI even though there is no real necessity as WebDAV operates on top of HTTP/HTTPS and therefore could be used over WSGI.

WebDAV support has indeed be moved to ZServer -- likely due to a misunderstanding that WebDAV were a special protocol requiring something special from ZServer. But the only special thing ZServer does for WebDAV can be seen in "https://github.com/zopefoundation/ZServer/blob/master/src/ZServer/WebDAVSrcHandler.py": it essentially adds manage_DAVget to PATH_INFO for GET requests in order to get the raw content of an object rather than a rendered view. Something equivalent could be easily done in e.g. an "AccessRule" or a view (no need to have ZServer for this).

In order to get WebDAV support in Zope over WSGI, the package webdav would need to be moved back to Zope (currently, it is part of ZServer).

icemac commented 5 years ago

Re-enabling WebDAV support would require to undo some of the changes made in #696 but this time import time conditions are not needed as the webdav package should become part of Zope again.

dataflake commented 4 years ago

I am going to close this issue for the following reasons: