Skip to content

Compressed snapshots #618

@FalsePhilosopher

Description

@FalsePhilosopher

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

You got your hands on a FZ, but are stuck on limited data bandwidth and/or data usage on sat internet or "borrowing" your neighbors wifi and want to setup your newly acquired fz with ubers repo/all of it's submodules. To run git clone --recursive that's 6.7GB of data to be downloaded. To save on data usage it would be cool if there was a compressed snapshot of the repo/submodules in the releases that you could pull instead.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Zstandard when faced with a lot of small files such as 90% of what is in Flipper and it's submodules does very favorably in compression ratio(near 50%)/decompression speed(up to 1.8GBs per core) when a dictionary is trained against the data set. I propose that the machine that's used to update the submodules for this repo also does a bi-weekly cron job to create a compressed snapshot of the repo and upload it as a release. I have an example in my Infosec-Cheatsheets repo releases that you can demo it's functionality as the end user. I achieved a 56% original size ratio saving 5GB of data as compared to git pull.

Your workflow looks like

zstd --train -T0 -r Flipper/*
tar --use-compress-program "zstd -T0 -19 -D dictionary" -cf - Flipper/ | split --bytes=2GB - Flipper.tar.zst
gh release create Snapshot-Sample-Date /Pathtofiles/*

If you add this script named zst.sh to your repo

#!/bin/bash
cd /tmp
gh release download -p 'Flipper.tar.zst*' -p 'dictionary' -R UberGuidoZ/Flipper
cat Flipper.tar.zst* > Flipper.tar.zst
rm Flipper.tar.zsta*
tar --use-compress-program "zstd -d --rm -T0 -D dictionary" -xvf "Flipper.tar.zst" --directory $HOME/Downloads
rm dictionary Flipper.tar.zst

then the end user can pull/extract it with this one liner

wget -q -O - https://raw.githubusercontent.com/UberGuidoZ/Flipper/refs/heads/main/zst.sh | bash

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Pray to the internet gods for more data/bandwidth lol.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions