Repository navigation
Conversation
…el Telegram parts - Files backups can go to a Telegram destination as <dir>_<ts>.vdbf.tar (kept out of the app lists); telegram-pull restores them into .paths/. ERR_TG_KIND now covers /data/adb backups only. - path-backup takes .paths[] and/or .path (deduplicated, up to 64). A single folder writes the old manifest unchanged; several folders get one archive each plus items[] and sources[]. Restore checks every folder before it deletes anything. - schedule-set accepts kind "files" with paths[] (backup only); the scheduler runs one path-backup per job and keeps the newest keep copies. - An archive over tg_part_mb (default 256, 64 to 1900) is split into .partNNNofMMM and tg_parallel parts (default 3, 1 to 8) move at once, each mtproto-store process on its own session copy. A failed part is retried once; on failure the parts that landed are deleted. telegram-list folds a complete part set into one entry, so pull and delete work unchanged. Downloads fetch parts in parallel and stream them in order into tar. Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three requests from Telegram users, done in the backend so any UI can use them:
<dir>_<ts>.vdbf.tar(the suffix keeps it out of the app lists) andtelegram-pullrestores it into.paths/<dir>.ERR_TG_KINDnow covers/data/adbbackups only. The local copy is kept, as before.path-backuptakes.paths[]and/or.path(deduplicated, up to 64, each checked as before; paths with spaces work). A single folder writes exactly the old manifest, so an older worker still restores it. Several folders get one archive each (data<i>.<ext>) plusitems[]andsources[]in the manifest. Restore runs every safety and checksum check for all folders before it deletes anything.schedule-setacceptskind: "files"withpaths[](backup only,ERR_JOB_PATHon bad input). The scheduler runs onepath-backupper job and keeps the newestkeepbackups of that folder set (pinned ones stay). Encrypted runs use the saved default passphrase, like app jobs.Parallel Telegram transfers.
mtproto-storeuploads one file on 4 threads but downloads on 1 and sends files one after another. An archive overtg_part_mb(default 256, 64 to 1900) is now split into<name>.partNNNofMMM, andtg_parallelparts (default 3, 1 to 8) move at once, each in its ownmtproto-storeprocess with a private copy of the session so no two processes rewrite the session file. Starts are 1 s apart, a failed part is retried once, and if the upload still fails the parts that landed are deleted from the channel.telegram-listfolds a complete part set into one entry (message_idbecomes"id1,id2,..."), so pull and delete in both UIs work unchanged. Downloads fetch parts in parallel and stream them in order intotar. Archives under the part size upload exactly as before. This also lifts the 2000 MiB per-file limit for large app backups.Settings:
tg_parallelandtg_part_mbare plain config keys. The New interface (#47) has the UI for folder lists, Files schedules, Telegram folder restores and the parallel setting.How it was tested
Not tested on a device or against real Telegram. In a Linux sandbox, the real
worker.shandhelper.shran in a user-namespace chroot with a fake/dataand a fakemtproto-store:telegram-listshowed one entry, the pull was byte-identical and the restore brought back all 3 folders;ERR_TRANSFER, the landed parts were deleted and staging and session copies were cleaned up;message_ids and names were refused with the expected codes; the old single-file app pull still works;keep=2.sh -nandshellcheck -s sh -S errorare clean.Known limits
.partNNNofMMMitems;cat name.part* > namejoins them.