Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Filestash as WebDAV Server #756

Open
Glujaz opened this issue Oct 19, 2024 · 6 comments
Open

[Feature Request] Filestash as WebDAV Server #756

Glujaz opened this issue Oct 19, 2024 · 6 comments

Comments

@Glujaz
Copy link

Glujaz commented Oct 19, 2024

I saw there was a way to have to access files and folders over webdav by sharing with a link.

It would be nice to have it as a general option like Filerun or Nextcloud so that someone can add file stash to an external app.

PS : I saw you went full time, wish you good luck. I am currently planing to move from filer, as I prefer the SMB connection to the storage, but want to have a web and webDAV UI when outside, and your solution seems very interested but the webdav limit, which I saw was partially existing.

@sevmonster
Copy link

sevmonster commented Oct 23, 2024

It is intended for Filestash to be a functional WebDAV server. But until #697 and #699 are fixed, it is essentially broken and unusable—outside of using Filestash as a client to itself, which is silly.

There is also #669 related to WebDAV, though it isn't as critical a bug.

@Glujaz
Copy link
Author

Glujaz commented Oct 23, 2024

Thanks for your reply.

I managed to play a bit with it, and made it working partially by using the share link option, and it is working fine when I have no credentials set.
However, whenever I set a password, a user, or both, it is not working at all.

I don't know why, connection Is always refuse with an error 400, which (from my little knowledge), might be related to #697 ? I am using FE File Explorer for info.

By the way, as users, the example given are emails. Can just a simple name be possible as well ?

For info, as I could not find a lot of documentation on this solution, I also tried to connect to file stash over webdav using these addresses without success :

http://ip.address/ (Port error)
http://ip.adress/s/ (error 405)

Anyway, thanks again for your software ! And the windows error of #669 , yeah, it's a webdav classic...

@sevmonster
Copy link

sevmonster commented Oct 24, 2024

Sorry, I misunderstood you. WebDAV only works with share links, and it is not exposed on any other endpoint.

Furthermore, there is no login mechanism with WebDAV. The share link functions like an API key: whatever credentials that were in use when you create the share link will be used to sign in when the share link is accessed. Likewise, the original credentials can't be obtained from simply possessing a share link, but it still provides the same access.

If you don't mind this method of access, you can easily add Filestash links to any WebDAV-compatible app. Instead of logging in, the user creates a share link that they then copy into their app of choice. This is similar to using app keys with Nextcloud, and you can revoke access to the folder in the same manner (i.e. deleting the share link).

As for users, it depends on the backend. Whatever username you configure in the backend is what will be used to log in with. I set up a local backend with folders named after my users, and the username inserted into the file path. I then set up SSO in front of Filestash which provides the password authentication. Works fine for my purposes. Find my experiences here. (I need to make some changes to my Nginx config in the post though, so I would recommend you don't copy that part if you'd like to try my configuration :)

@Glujaz
Copy link
Author

Glujaz commented Oct 24, 2024

Thanks for your reply.

So I understood it pretty well. The WebDAV function requires a shared link.
As said before, I managed to connect without any credentials by following the link, but I am not super fan of not having credentials, especially since this is planned to be the open to the web UI for my personal files.
So I tried to add users and a password to the shared link, but this time, it does not work anymore... I always get error 400 as proposed above.
It is probably because I write the name wrongly in the shared link section. Probably? Or, there is a bug 😅

My backend is a truenas SMB share, so, the settings in Filestash is to just pass through, and use the SMB logins with filestash UI to get in, and it works perfectly.

why SMB ? Because my truenas has one mount point for all my users, but some folders are not allowed to access some folders, so using SMB over Filestash allows me to set the rights once, where it is the most needed (on SMB for local access), and Filestash should just copy this. And this works really well. When the user has no rights, Filestash just says "oops, not allowed", and the problem is solved without having to otherwise add ACL rules for www-data like other tools require 😁
This is also the reason why I would have loved filestash to just pass through the connection and login over WebDAV, exactly how the webgui does, without any configured link, or credentials. This way, if I add a user, I have no need to create a new link. Something that nextcloud (or in my case filerun) does extremely well !

@sevmonster
Copy link

sevmonster commented Nov 6, 2024

Let me apologize, I didn't ever try out the Only for users or Password features before... So WebDAV does support user authentication, but only after having that user verify their email address. The user's password is also simply the email address hashed and salted with the Filestash admin key, which means it's the same password every time... Not a great idea in my opinion. I'd rather it be randomly generated and saved to the database instead, or at least salted with the share ID + path.

I also use direct passthrough. I don't have any unique permissions though as I dedicate a single directory to every user, so that's not an issue for me.

I really hope @mickael-kerjean spends more time on WebDAV, because it's the most significant feature I'm missing compared to Nextcloud. If I were more versed in Go I would consider contributing, it's that significant.

@Glujaz
Copy link
Author

Glujaz commented Nov 6, 2024

Yep, do agree, and disagree as well, as I would prefer to keep the username and password of exist users.

sadly, I do not know how to code, would have enjoyed proposing otherwise to help. I'm happy already understanding and coding a little bit of C for ESP32, but they are very simple things...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@sevmonster @Glujaz and others