filestash icon indicating copy to clipboard operation
filestash copied to clipboard

[bug] SMB host variable BUG

Open matoH12 opened this issue 9 months ago • 4 comments

Description of the bug

The authetification in SMB plugin no work. The host variable is not apply

Step by step instructions to reproduce the bug

Create SAMBA backend and try login. In debug log you can not see the host variale correcty. Im see in host error

Im find in code this:

if u, err := url.Parse(params["host"]); err == nil {
 		**params["host"] = u.Host**
 		if params["port"] == "" {
 			params["port"] = u.Port()
 		}
 		if params["share"] == "" {
 			params["share"] = strings.ReplaceAll(u.Path, "/", "")
 		}

where the "u.Host" dont have (). u.Host()

matoH12 avatar May 05 '24 18:05 matoH12

u.Host is a string so no need for parentheses there. The function url.Parse expect a string with protocol. If you want to use samba, you need to specify smb://hostname as hostname. I thing this should be changed so it add automatically the protocol if is missing

serboupal avatar May 09 '24 10:05 serboupal

Looks like this got fixed recently... https://github.com/mickael-kerjean/filestash/commit/d898231918727a4d2e4de3f0ff2b0737915b577a

zeighy avatar Jun 09 '24 20:06 zeighy

Thanks for the workaround and dev for the fix. I just encountered this issue using latest docker image 14f176ae7f6e. With full protocol specification in url it works allright.

Ownercz avatar Jun 09 '24 20:06 Ownercz

Also encountered this problem - as a workaround, I added smb:// to the hostname prefix as mentioned by @serboupal - thanks! :)

mwllgr avatar Jun 22 '24 08:06 mwllgr