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

Implement canRead for attached files #320

Open
luke- opened this issue Apr 2, 2023 · 7 comments · May be fixed by #363
Open

Implement canRead for attached files #320

luke- opened this issue Apr 2, 2023 · 7 comments · May be fixed by #363
Assignees

Comments

@luke-
Copy link
Contributor

luke- commented Apr 2, 2023

Currently uploaded files in a conversation are not specially protected, only by the individual link including the GUID.
It would be good to check here also if the user is a participant of the conversation.

@usirg
Copy link

usirg commented Apr 4, 2023

thanks, looking forward to it 😁

@luke-
Copy link
Contributor Author

luke- commented Jul 26, 2023

Maybe rel: humhub/humhub#6451

@martin-rueegg
Copy link
Contributor

@Gilbertdelyon
Copy link

Gilbertdelyon commented Nov 20, 2023

May I ask a newbie question? (only for my personnal knowledge)
In HH I guess all images are are served by PHP. url example
https://mydomain.xyz/index.php?r=file%2Ffile%2Fdownload&guid=c99b3fe3-1234-5678-95fc-c9bd4450a800
Php will the execute the file download request, check permissions and send the file, probably with a readfile() or readfile_chunked() function.
I worry if this couldn't increase too much the server load when the site is populated with a lot of images and videos?

@yurabakhtin yurabakhtin self-assigned this Nov 21, 2023
@Gilbertdelyon
Copy link

Gilbertdelyon commented Nov 21, 2023

I worry if this couldn't increase too much the server load when the site is populated with a lot of images and videos?

Why do I ask this question?
I am also administrating a DRUPAL web site (DRUPAL is based on Symfony framework).
DRUPAL media files are all public by default.
You can activate a private file system, but it is not easily available for common users. You have to modify the settings.php file of the site, and tthe documentation says:

This adds to server load and download time, since Drupal must resolve the path for each file download request, but allows for access restrictions to be added......

In the opposite, HH medias are "private" (url must be resolved in any case), without any warning.
I have no idea about the side effects on server load and pages loading time

@luke-
Copy link
Contributor Author

luke- commented Nov 21, 2023

@Gilbertdelyon You're right, when the download is handled by the PHP application, there is additional load. This can be reduced, when sendfile is activated. PHP then only performs the initial session & authorization check and then passes the download on to the web server.

e.g. https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/#enabling-sendfile
https://docs.humhub.org/docs/admin/performance#x-sendfile

@Gilbertdelyon
Copy link

@luke-
Unfortunately, in our Apache shared hosting X-sendfile is not available. So, I guess some php fread($file) or readfile_chunk($file, CHUNK_SIZE) will be used in HH.
But I dont know how significantely it can increase the load and downgrade usability.

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

Successfully merging a pull request may close this issue.

5 participants