-
Notifications
You must be signed in to change notification settings - Fork 626
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
[WIP] Read files from disk with every request #1256
base: main
Are you sure you want to change the base?
Conversation
This allows files to be changed and have the changes be reflected on the website without restarting Onionshare
Wow, this is very cool! I will start taking a look soon, and maybe we can get it in the 2.3 release. |
"gzip compress the individual file, if it hasn't already been compressed" -> "gzip compress the individual file" It's gonna be compressed either way
Files are re-read and gzipped each time their BTW I just realized that files already are read from disk with each request if There's no change yet to share mode's |
uses the new gzip caching function from the last commit
some changes in the last commit were reverting the code back to v2.3.dev1
Share mode's |
when gzipping the 1 file initially
When you share more than 1 file or any directories, it zips them all at startup and sends that whenever The way I see it, if any shared files are modified while the share is up, to be able to reflect the changes when someone requests A potential problem is that this is happening when someone requests That leaves (2) but I'm not that familiar with zip files in Python. According to these StackOverflow answers from 2014 you can't modify files in a zip archive directly. And you can't delete files from a zip archive either; that feature request has been in Python's issue tracker since 2009. There is a PR from April 2020 that implements deleting from zip files. something like this maybe? |
Implements #1059.
I didn't go to great lengths to figure out the best way to do this, but I think it works.
Demo