omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Tiny WebDav Server for Pythonista

    Pythonista
    5
    6
    10519
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wolf71
      wolf71 last edited by

      A Single File,Tiny, Python WebDav Server .

      1. It's just one 27K Python file.
      2. It's can run more python system.
         a. running PC/OSX/Linux Python.
         b. running on IOS Pythonista(iPad or iPhone) or IOS Editorial (iPad).
         c. running on RaspBerry Pi and more...
      3. It's support PC/OSX/IOS Webdav client.
      
       Gits: https://github.com/wolf71/TinyWebDav
      
      1 Reply Last reply Reply Quote 0
      • Stefano
        Stefano last edited by

        Nice! Haven't tried it out, but could come in handy.

        1 Reply Last reply Reply Quote 0
        • wolf71
          wolf71 last edited by

          Today add the webdav basic auth. update on github.

          • Create a wdusers.conf file at webdav.py same dir,and the file

            format:

                    user:passwd\n 
            
                    user:passwd\n
            

          If not found wdusers.conf file,the auth function disable.

          *because pythonista don't list not .py file,so you can just send this file thought this webdav server. :-)

          1 Reply Last reply Reply Quote 0
          • pacco
            pacco last edited by

            Hi wolf71,

            I know you posted this over a year ago, but I wanted to thank you for this mini-server and how valuable it has become!

            In order to understand why this is such a big deal to me, I need to explain a couple of things. [Apologies in advance for the longish post]

            As Pythonista has becoming an increasingly important tool in my work, one persistent challenge has been the difficulty in moving content between other apps. [Aside: I completely understand/accept why this situation exists with Pythonista and why omz has had to comply with this requirement]. For text/src files the clipboard works ok, but I often need to operate on binary files or entire folders of content. One of the most common solutions is to use Dropbox or some other external storage as an intermediate transfer area. A bit of a pain, but it works.

            The other thing to understand is there's another app that is absolutely essential to me: GoodReader. Since (by design) iOS lacks a global filesystem, I've chosen this app to serve as a central repository where I keep all my work files on my iPad. It's much more than just a document reader -- it allows general file manipulation (rename/delete/move/zip/unzip/etc) and connects to a variety of cloud services and server types. In effect, it has become my hub for moving stuff between other apps. Anyway, what I've been searching for is a way to easily move files between GoodReader and Pythonista. You probably see where this is going...

            Now all I have to do is run your mini-server in Pythonista and switch to GoodReader. Since GoodReader knows how to talk to WebDAV servers, I just connect to 127.0.0.1:8000 (localhost) and I'm able to transfer files between the two apps without connecting to an external server! Entire hierarchies of folders and huge (e.g., tested w/ 200MB) files can be moved this way without any fuss.

            There were two minor changes I made when using your code:

            • The following line resulted in a giaerror with Pythonista 1.5 over wifi: <br>
              <code>myaddr = socket.gethostbyname(myname)</code><br>
              I prefer to use <code>myaddr = '0.0.0.0' </code> so it binds to any interface IP.<br>
              But this should also work:<br>
              <code>myaddr = socket.gethostbyname(socket.gethostname())</code>
            • I want to always serve the entire Pythonista Scripts library and changed:<br>
              <code>root = DirCollection('./', '/')</code><br>
              to:<br>
              <code>root = DirCollection(os.path.join(os.path.expanduser("~"),"Documents"), '/')</code>

            --

            The last thing I wanted to share is that a few weeks ago I'd started working on mini-sftp server for just this purpose (GoodReader can also connect to SFTP servers) but I ran into a threading issue that caused file transfers to block and fail. Since I don't yet have the Python expertise to resolve the problem, I was incredibly pleased when I saw your DAV server and found it did exactly what I wanted.

            Thanks,<br>
            Pacco

            1 Reply Last reply Reply Quote 0
            • userista
              userista last edited by

              With minor modifications I was able to use this to have a locally run SFTP server (and transfer files via Transmit ). https://github.com/rspivak/sftpserver

              1 Reply Last reply Reply Quote 0
              • dotemacs
                dotemacs last edited by

                Hey hyshai,

                any chance you can share the steps you took to get sftpserver installed ? </br>
                What were those 'minor modifications' ?

                Thanks

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB Forums | Contributors