pldubouilh / gossa

🎶 a fast and simple multimedia fileserver
MIT License
874 stars 73 forks source link

permission denied #92

Closed xiejiulong closed 1 year ago

xiejiulong commented 1 year ago

I run gossa in docker, and the run cmd is : sudo docker run -v ~/LocalDirToShare:/shared -p 8001:8001 pldubouilh/gossa but when i upload a file,for example css file, the docker log show me: error [upload %2Fstyle.css] open /shared/style.css: permission denied.

i tried other kind file , same err, why?

xiejiulong commented 1 year ago

image

pldubouilh commented 1 year ago

hey - thanks for the report ! So this happens when ~/LocalDirToShare is not created before calling sudo docker .... Then Docker creates the folder as root, making gossa unable to access it. Just rm -rf ~/LocalDirToShare and then mkdir ~/LocalDirToShare before you run the docker invoke. I'll amend the main docs to reflect this :+1:

xiejiulong commented 1 year ago

hey - thanks for the report ! So this happens when ~/LocalDirToShare is not created before calling sudo docker .... Then Docker creates the folder as root, making gossa unable to access it. Just rm -rf ~/LocalDirToShare and then mkdir ~/LocalDirToShare before you run the docker invoke. I'll amend the main docs to reflect this 👍

thanks for the replay. but it does't work for me. I execrm -rf ~/LocalDirToShare and thenmkdir ~/LocalDirToShare, and then clear all the docker containers. at last exec: sudo docker run -v ~/LocalDirToShare:/shared -p 8001:8001 pldubouilh/gossa the docker logs still show me: error [upload %2FOffice2Pdf.rar] open /shared/Office2Pdf.rar: permission denied I don't know why.

pldubouilh commented 1 year ago

hm odd, this is working just fine on my setup... maybe ls -lha ~/LocalDirToShare see who's the owner and what are the perms ?

xiejiulong commented 1 year ago

I solved the problem: after exec sudo docker run -v ~/LocalDirToShare:/shared -p 8001:8001 pldubouilh/gossa then, go to the container exec: chmod 777 /root/shared then exit the container. now, I can upload any file to gossa. thanks a lot.

But unfortunately, I don't know why the docker or gossa has no permission to access the dir named "~/LocalDirToShare" in host machine map to "/root/share" in the container