Yamipa

Yamipa

3.7k Downloads

Folders support

Kikisito opened this issue ยท 9 comments

commented

Hello! It would be nice if the Yamipa was able to support images from folders. We want to migrate from another plugin to Yamipa and we need to sort over 300 images, and without folders, it's really difficult to do that.

commented

I'm closing this indefinitely.

As I've already said, I don't see the point in supporting subdirectories. It has significant performance and security drawbacks, and it would require a considerable effort to implement for so little to gain.

commented

@josemmo It gets very messy regardless with all them in the same file. Kiki's idea would help immensely with server management. I'd like to create a discord bot that will emulate photos and send them into Yamipa. It would be amazing if it was per user with vault connectivity.

commented

Again, the thing about adding subdirectories is that:

  1. It would definitely worsen the performance of a server with lots of directories (which is not the case for a server with lots of image files)
  2. It could open the door to path traversal vulnerabilities

In my opinion, two big drawbacks for just the ability to have folders.

Another important thing to note is that Yamipa supporting folders does not magically enable permissions so that each player can have its own image directory. That would need to be implemented as well and it would take considerable time and effort.

I'm not saying a hard "no" to this, I'm just saying these concerns need to be addressed before starting coding.
Also, I don't want to keep adding features to Yamipa just because until it becomes a bloated mess, so the pros/cons of any new feature have to be weighted.

commented

Sounds good. I'd love a differential between player pictures and admin stuff. Would save a lot of hardship. Permissions would suffice.

commented

I don't think this is a good idea. Allowing subdirectories will require watching for file changes recursively, which could lead to performance issues. It could also open the door to path traversal vulnerabilities and I'd prefer not to deal with those.

@Kikisito, I'm probably missing something. Why can't you just copy all images from the previous plugin into the "YamipaPlugin/images" directory?

commented

I don't think this is a good idea. Allowing subdirectories will require watching for file changes recursively, which could lead to performance issues. It could also open the door to path traversal vulnerabilities and I'd prefer not to deal with those.

@Kikisito, I'm probably missing something. Why can't you just copy all images from the previous plugin into the "YamipaPlugin/images" directory?

I can do that, but this feature would be useful to sort images. As an example, each user may have its own folder with images and we wouldn't have all files in a single and messy folder.

Also some panels as Pterodactyl don't show more than 250 files in a single directory so we can't sort them by prefixes.

commented

Hi again. Sorry for the delay, I've been out for some days.

Regarding the performance, couldn't an option to allow folders support be done? I guess this would allow players to choose if they want folders support in exchange of losing some performance while Yamipa can choose which algorithm should use.

About the path traversal vulnerability, can't the user input be filtered in any way? Maybe applying some regex before searching the files may help.

Thanks for your support.

commented

Implemented in 0edd1f2, currently being tested.

commented

Implemented in v1.3.0! ๐ŸŽ‰