2024-04-18, 07:37 PM
(This post was last modified: 2024-04-18, 08:08 PM by Efficient_Good_5784. Edited 1 time in total.)
(2024-04-18, 06:39 PM)joseph Wrote: • Prevent setting the cache directory to a non-empty directory. Or..One of the problems here is how Jellyfin is deployed. You can't write a program to do things before it even is deployed. How is it going to run directory checks if the program isn't running?
• Issue a strongly worded popup confirmation if the system detects the cache directory is being changed to a non-empty directory
Understanding that it’s impossible to ever build software that cannot do bad things inadvertently… but warnings can at least reduce the likelihood that someone makes a careless mistake that ends up being so costly.
For example, a lot of people deploy Jellyfin using Docker. How are you going to program Jellyfin to prevent you from host mounting a sensitive directory as the cache directory? Jellyfin will literally see it with the name "cache" and assume it's fine. You can link any directory to Jellyfin using Docker and give each directory different names than what they actually are.
To implement your idea with Docker in this example, you would have to take it up to Docker itself to prevent you from doing so.
Also, the cache directory doesn't have to be empty to be the correct one to link to. Continuing with the Docker example, lets say you delete your Jellyfin container and redeploy a new container. Deleting the old container won't delete external host mounts which means the old cache folder remains. All you have to do now is link this old cache folder to the new Jellyfin container to reuse it. Having a message pop up stating the cache folder has items in it that you might not want to delete would be a false positive in this case. How would this message be handled? Would it block the server from running until it's dismissed? That would mean you'll need to log into Jellyfin's dashboard each time the server restarts to dismiss it. And you can't just do it once for the life of the server. For all the server knows, you might have changed the cache directory to something else while it was offline.