mickael-kerjean/filestash

[bug] Dot-prefixed files/dirs are forcefully ignored with WebDAV

Opened this issue · 3 comments

Description of the bug

if strings.HasPrefix(filepath.Base(this.path), ".") {

if strings.HasPrefix(filepath.Base(this.path), ".") {

I am trying to use a share link with Obsidian (again to replace Nextcloud) and the .obsidian and .trash dirs are not accessible.

You can see the files and folders, you can rename anything to be dot-prefixed and it will accept it, but you cannot view/edit or navigate into such files or folders respectively.

Step by step instructions to reproduce the bug

  1. Make a directory
  2. Share it
  3. Open with WebDAV
  4. Attempt to access any directory or file that starts with . inside the share

Can you replicate that error from the demo?

Yes

Observed behavior

It doesn't work

Expected behavior

It works, or an option is added to disable this feature per-share or per-tenant

Do you have a testing account I can use to replicate this? My personal email address is mickael@kerjean.me

There's not much you would be able to test, other than creating/renaming a file to .anything and watching it disappear into the aether over WebDAV share link. I can probably recreate it with the demo instance.

...Actually, I can't see any "hidden" (dot-prefixed) files in the demo instance. So I don't know if they're present or not to test with WebDAV.

I am not currently running a Filestash instance so I can't provide a test for you at the moment. But the issue is clearly illustrated in the code I linked.

A test environment would be immensely helpful to dig deeper. The code you quoted was there for a reason (reason I don't remember but likely due to weird quirks), providing a fix would need a lot of experiment to figure out why it was there in the first place and ideally a place where I can replicate things, hence a test environment to make sure your use case is covered