sciactive / nephele

A pluggable WebDAV, CardDAV, and CalDAV server for Node.js and Express.
Apache License 2.0
62 stars 3 forks source link

FileSystemAdapter outputs files as directories #8

Closed FROGGS closed 3 hours ago

FROGGS commented 4 hours ago

Hi, I've subclassed the VirtualAdapter to serve stuff from an sql database as files and folders which is awesome, but the FileSystemAdapter gives me some headache. In Folder bar are some files, but these appear as folders. I can even open these folders but of course the appear empty. I've tried to debug the adapter, but with no luck so far. The resources start being not a directory, but somewhere down the road their url have a traling slash and so are treated as a directory. Though, this might happen because my file explorer tries to PROFIND these "directories". I hope you can reproduce the issue, it is already late where I live. If you need more information I'll provide these tomorrow happily.

createServer({
      adapter: {
        '/foo/': new FileSystemAdapter({ root: './mount/foo/' }),
        '/bar/': new FileSystemAdapter({ root: './mount/bar/' }),
        '/': new VirtualAdapter({ ... }),,
      },
      authenticator: new InsecureAuthenticator(),
      plugins: [],
    })
hperrin commented 4 hours ago

Can you tell me which OS you're using?

FROGGS commented 4 hours ago

The client runs Windows 10 (Windows Explorer), the server is Ubuntu 22.04.

hperrin commented 4 hours ago

Ok. Which file system are you using? I'll try to recreate the issue locally.

FROGGS commented 4 hours ago

I just found out, that only the first directory level is affected.

  1. I create a folder inside bar
  2. I create a file inside the new folder using the webdav client, press F5, everything is okay
  3. I create a file inside bar directly, press F5, and the file now looks like a folder.

Filesystem is ext4 on server side.

hperrin commented 4 hours ago

Ok. Let me try to reproduce this.

hperrin commented 4 hours ago

Yep, I'm able to reproduce this. I'll work on a fix.

FROGGS commented 4 hours ago

Awesome, thank you very much.

hperrin commented 3 hours ago

Fixed and released as 1.0.0-alpha.61. Thank you for the report. :)