awesome icon indicating copy to clipboard operation
awesome copied to clipboard

YOURLS-diff

Open gioxx opened this issue 8 months ago • 3 comments

Proposed functionality

Patch your YOURLS installation, without the need to download and upload the entire release ZIP file.

Use case

Years ago I had set up a small bash script that allowed me to generate a "patch" to update YOURLS using only the modified files between official releases. I picked up the project again, threw everything away and rewrote in Python + GitHub Actions to make everything automatic and publish (via Release) these patch files to update YOURLS faster: https://github.com/gioxx/YOURLS-diff

I thought it might be a good idea to include the tool within this repository to make life easier for those who have their own instance of YOURLS 😄

Potential solution

No response

gioxx avatar May 13 '25 15:05 gioxx

I don't see this saving much in the way of data transfer since most of each YOURLS release .zip is in the GeoIP database. Recent "patch" archives are ~4 MB, while 1.10.1's full release is ~5 MB.

Does this account for deleted files in any way, or is it only stripping out ~1 MB (approx. 20%) of unchanged files?

Honestly, if transfer efficiency is really the goal, I would think a well-crafted rsync command easier to work with than these. rsync can also remove files at the destination that no longer exist in the "source" directory, which no .zip patch could do.

Still feel free to submit an actual PR adding the link to your tool! I'm just spouting more ideas. 😅

dgw avatar May 13 '25 22:05 dgw

Ciao @dgw 👋🏻 Any comments you have are welcome. I've always used rsync too, but I put myself in the shoes of people who don't know how to do it and thought of something to make their lives easier.

The savings aren't in terms of archive size (that's outdated now thanks to fast connections), but in the number of files you have to upload via FTP. You often have to deal with shared hosting that's just not fast enough when it comes to handling multiple file uploads. This can make the process of uploading the entire YOURLS archive pretty time-consuming.

Having fewer files definitely leads to time savings.

Either way, you've got me thinking about how to keep track of files that aren't being used between releases. Right now, I use a file to keep track of files that have changed between two releases (which you'll find in the patch). I could do the same thing by reporting which files are no longer there from the old version to the new one. That way, I could give the user the option of deleting them from their FTP space.

I'll definitely suggest a PR to integrate the project into Awesome YOURLS after I make this change, but I have to admit, I have no idea where to put the link! :sweat_smile:

gioxx avatar May 14 '25 06:05 gioxx

The savings aren't in terms of archive size (that's outdated now thanks to fast connections), but in the number of files you have to upload via FTP. You often have to deal with shared hosting that's just not fast enough when it comes to handling multiple file uploads. This can make the process of uploading the entire YOURLS archive pretty time-consuming.

Having fewer files definitely leads to time savings.

My shared-hosting provider must be "one of the good ones" then, since it's never occurred to me that FTP uploads take too long. 😁 Though, YOURLS is the only manually-updated site I have on there; everything else uses built-in updaters or gets built in GitHub actions and deployed with rsync.

Thanks for explaining the reasoning to me!

I could do the same thing by reporting which files are no longer there from the old version to the new one. That way, I could give the user the option of deleting them from their FTP space.

That would be neat. Since you're already reporting the new and changed files in each Release's description, you can put the list of removed files (if any) there, too, for users to use after updating.

but I have to admit, I have no idea where to put the link! 😅

Hmm, there's no section like "Tools" or similar, true. Your tool could fit into the installation tutorials, especially if you tweaked the README a little to include a section heading that could be used as a link target. (I see it already mentions how to take advantage of the built update packages, but my eyes skipped past that section twice before I finally noticed it. 😅)

dgw avatar May 14 '25 23:05 dgw

Closing this as the question seem to be be answered. Still, don't hesitate to continue the discussion below if needed and to open a PR with the tool link.

LeoColomb avatar Jul 20 '25 16:07 LeoColomb