Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

DAVify WebDAV server - Easy two way file transfer directly between Codea and PC over WiFi

edited July 29 in Code Sharing Posts: 170

Hello everyone!

Today I would like to present a little utility that I started a few months ago mostly for fun, but also in protest of App Store policy. That restricts code sharing for developers using legitimate IDEs. Although now there looks like there is hope that Apple may finally be coming to their senses. I still thought I would post this anyway... just in case they change their mind. ;)

Essentially this WebDAV server allows you to perform the functionality that you expect to be able to do with iTunes. Transfer your project source code and assets easily between your PC and Codea.

Features

  • Import project source code and assets directly from your PC into Codea
  • Backup projects and assets easily without extracting files from iTunes backups
  • Remotely access projects, project collections and assets (Documents & Dropbox) with full control (create, modify, rename and delete)

  • Supports all standard project and asset file types

    • Project source files (*.lua, Info.plist) - Info.plist is updated automatically when lua files are created, renamed or deleted.
    • Models (.obj, modelAssetName.mtl, modelAssetName.obj.mtl) - Codea Craft required
    • Music (.mp3, .m4a, .wav)
    • Sounds (.caf)
    • Sprites (.png, .pdf)
    • Text (.txt)
    • Shaders (Fragment.fsh, Vertex.vsh and Info.plist)
  • WebDAV is widely supported by major operating systems

    • Windows 10, 8 & 7 - Tested Windows 7 and Windows 10
    • Mac OS X - Tested Sierra
    • Linux - Untested

Installation

Usage

  • Run the project

  • Connect to the server using a WebDAV client using the URL emitted to the output window.

Windows 10, 8 & 7

  • Open Computer click Map network drive
  • Click Connect to a Web site that you can use to store your documents and pictures
  • Select Choose a custom network location click Next
  • Enter full server url including the port e.g. http://192.168.0.2:8080
  • Click Next then Finish
  • The Windows DAV client may need some tweaking to get working.

  • If you are experiencing dropouts followed by problems reconnecting try disabling caching with the following reg key.

    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\
    • FileNotFoundCacheLifeTimeInSec = 0
    • Don't forget to restart your computer afterwards.
  • If you are experiencing slow connectivity try temporarily disabling automatic proxy detection in Control Panel.

    • Internet Options->Connections->LAN settings .
  • You can find a good troubleshooting guide at http://sabre.io/dav/clients/windows/.

Mac OSx

  • Finder -> Go -> Connect to server
  • Enter full server url including the port e.g. http://192.168.0.2:8080
  • Click Connect

Linux

  • GNOME Files

    • File -> Connect to server
    • Enter full server url including the port e.g. http://192.168.0.2:8080
    • Click Connect

For a list of 3rd party clients see Comparison of WebDAV software (Wikipedia).

Thanks

Thank you for reading, I hope you enjoy using DAVify!

I'd be grateful to hear your feedback. If you find any bugs please create an issue. Pull requests are also welcome :).

Comments

  • JohnJohn Admin Mod
    Posts: 456

    Hi @XanDDemoX

    I tried running it on my iPad Air 2 to my Macbook through Chrome/Safari/Firefox but website stays blank. Turning on SERVER_DEBUG reveals the following issue:

    HTTP/1.1 405 Method Not Allowed
    Allow: OPTIONS, PROPFIND
    Cache-Control: no-cache
    Connection: close
    Date: Sun, 18 Jun 2017 03:54:19 GMT
    Server: Codea-WebDAV-HTTP/1.1
    
  • Posts: 170

    @John Hmm I haven't tried connecting through a browser. You need to use a WebDAV client. I'll make that clearer. On Mac OS X you can connect directly with Finder.

  • JohnJohn Admin Mod
    Posts: 456
    Ah ok, I totally misunderstood. My bad!
  • Posts: 170

    @John No worries. It's my bad for missing off the connection instructions in the first place B)

  • JohnJohn Admin Mod
    Posts: 456

    @XanDDemoX I just tried this on Windows and it's very impressive! Hopefully this will all be possible natively once Apple get their act together.

  • Posts: 170

    @John Thanks! Did you have any luck connecting with Finder? It definitely looks hopeful that they are getting it together. Fingers crossed for 2.3.7.

  • JohnJohn Admin Mod
    Posts: 456

    @XanDDemoX 2.3.7 was just approved, although this tool is still pretty helpful. The only thing that seems to be missing is the ability to access project assets (images, text files and shaders).

  • Posts: 170

    @John Congratulations for 2.3.7's approval! You're correct, project assets aren't accessible. I couldn't find a way to list them, assetlist(ProjectKey) didn't seem to work. Have I missed something?

  • JohnJohn Admin Mod
    Posts: 456

    @XanDDemoX Ah yeah. That is an issue with project assets in general (accessing them from other projects). I'll look into changing this.

  • Posts: 140

    @XanDDemoX Thank you! I wish Apple would allow iTunes access--like any non-programmer is going to buy the software, upload a random program and play Thermonuclear War!

    I tried connecting through the Mac Finder and despite getting an HTTP 200, it's refusing to connect. Yet another reason Apple needs to strangle some of their hopeless programmers/tech writers (for really WRONG docs!)

    However, CyberDuck came to the rescue with flying colors and I was able to restore 6 tabs that were somehow lost, probably due to using AirCode. (And these were tabs I never touched--they just happened to be the last 6 tabs of my project.) I was lucky that I had just done a zipped backup before monkeying about. grrr...

    So, thanks again!

  • Posts: 170

    @syntonica Thanks for your kind feedback! Sorry to hear that you had trouble connecting with Finder. I'm glad that CyberDuck was able to come to the rescue. I was hoping OS X wouldn't be as temperamental as Windows was about the protocol implementation. It probably just needs appeasing with something minor in the server's responses... I'll try and get access to a Mac for a bit somehow so that I can get Wireshark on the case. B)

  • edited July 16 Posts: 140
    @XanDDemoX I haven't tried it again, but I may have missed the http vs https because Apple. Let me check again in a bit. Right now, I'm wrestling with a table that's inserting as keys and not values...

    Update: it's Apple, not me. And my table suddenly started working, but now I have another table that keeps coming up as nil, exact same code as another method. ???
  • Posts: 170

    @syntonica I've just pushed some fixes for connectivity problems with Finder. They were mostly trivial except having to implement chunked transfer encoding for file writing to work but got there in the end... I just needed read the rfcs a little better :#

    Note if Finder asks for authentication when connecting you may have problems connecting as a guest, I couldn't even get it to work for an Apache WebDAV server. Instead connect with any username but leave the password field blank. That seemed to work reliably for me.

Sign In or Register to comment.