axeloz / filesharing

Self-hosted files sharing application, easy to setup, easy to use
https://filesharing.webinno.fr
GNU General Public License v3.0
220 stars 33 forks source link

error : permission denied #49

Closed RisedSky closed 1 month ago

RisedSky commented 1 year ago

Hello i have a permission denied on the cosnole of my web page. I tried with a volume, with changing the user and mounting a local directory, can you provide me some advice to made your container work ? (i don't have any problem with others container)

axeloz commented 1 year ago

Hello, I guess this is related to https://github.com/axeloz/filesharing/issues/48 I never came accross this issue, I need more testing.

axeloz commented 1 year ago

You did try to chmod -R 777 your local storage disk, right?

RisedSky commented 1 year ago

You did try to chmod -R 777 your local storage disk, right?

Yep, i changed the owner id and the group id + chmod Fixed but that's kinda bad to change the uid and gid, i think you need to midfy the docker file to be able to change it or so. Also, i tried filesharing and i didn't like the fact there is no preview link directly, instead of viewing on the web page (discord sharing for exemple)

axeloz commented 1 year ago

I didn't understand your feedback about the preview link. There is a preview link but I guess this is not what you need

Let me know.

RisedSky commented 12 months ago

I didn't understand your feedback about the preview link. There is a preview link but I guess this is not what you need

Let me know.

I was meaning a direct link like the following : mylink.domain/preview

To be used in discord for exemple

theDepart3d commented 7 months ago

I just ran into this same issue. Locally it worked but access via WAN it showed 403 Forbidden.

To get this to work correctly you need the correct permission.

NEVER EVER SET ANY DIRECTORY THAT IS ACCESSIBLE TO THE WEB AS 777. - bad security practice

To solve the issue all you have to do is set the correct permission using something like find All I did was the following;

find /path/to/the/app -type f -exec chmod 644 {} \;
find /path/to/the/app -type d -exec chmod 755 {} \;

The first one; sets all files to 644 and the second one sets all directories to 755 which is correct for any laravel application or web app.

Problem solved and I was able to access it via WAN/Web.

axeloz commented 7 months ago

@theDepart3d thanks, you are right for the 777. Bad advise, I wanted to make sure this was a permission related issue. Thanks for your message anyways, I'm sure this will help others. I will update the readme accordingly.

theDepart3d commented 7 months ago

@theDepart3d thanks, you are right for the 777. Bad advise, I wanted to make sure this was a permission related issue. Thanks for your message anyways, I'm sure this will help others. I will update the readme accordingly.

You could also add that the app folder should match with the apache2/nginx user

chown -R www-data:www-data /path/to/app/dir