Giter Club home page Giter Club logo

zsync2's Introduction

zsync2

CI

A rewrite of the advanced file download/sync tool zsync.

Note: "zsync2" is a working title which might be changed in the future.

The rewrite changes fundamental principles of how zsync works. For example, the new code will be C++11. Furthermore, the entire functionality will be bundled in a single library called libzsync2. The library will serve as a base for the new zsync2 main binary, but can then also be linked by other projects which seek to make use of the algorithms and functionality in it.

This project is intended to remain compatible to the original zsync, i.e., the zsync file format will stay the same etc. However, the zsync file format should be extended to be able to serve additional purposes as well. Such purposes could be e.g., adding meta information like version numbers, etc.

Requirements

Although the library is written in C++11, it is intended that the headers are compatible to older revisions of the C++ language. Therefore, a pattern called Opaque Data Type is applied to all classes defined by the headers of this library.

Building

To build on Debian or Ubuntu style systems:

sudo apt-get -y install git cmake g++ libssl-dev libssh2-1-dev libcurl4-gnutls-dev zlib1g-dev
   
git submodule update --init
mkdir build
cd build
cmake .. -DUSE_SYSTEM_CURL=1 -DBUILD_CPR_TESTS=0
make -j$(nproc)

See .travis.yml for building on Travis CI.

Functional description

zsync is a well known tool for downloading and updating local files from HTTP servers using the well known algorithms rsync uses for diffing binary files. Therefore, it becomes possible to synchronize modifications by exchanging the changed blocks locally using Range: requests.

The system is based on meta files called .zsync files. They contain hash sums for every block of data. The file is generated from and stored along with the actual file it refers to. First, the client downloads the meta file. Then, it lets the same algorithms used to generate the meta file hash the local file. Then, just like with rsync, both lists of hash sums are compared. Then, modified blocks are fetched from the server, and with the unmodified blocks of binary data from the original files, a new file is put together, which eventually replaces the original.

Due to how system works, nothing but a "dumb" HTTP server is required to make use of zsync2. This makes it easy to integrate zsync2 into existing systems.

Applications

A popular application scenario is software deployment. Here, the popular "update channel" system can be used to describe the update model: For normal updates (i.e., staying on the same channel), one should call zsync2 with a URL to the .zsync file of the latest release of the application. Without additional effort, zsync2 is then going to update the file accordingly. One does not have to compare meta data to check for updates etc., and information like version numbers for example become purely informational for the user, but irrelevant for the actual update process. This makes setting up an update infrastructure easier (one just has to set up a static URL to the latest file).

Licensing

The original source code has been released under the terms of the Artistic License v2. Since this rewrite is a derivative work, it is published under the same license. See COPYING for a copy of the license.

Current State

Although zsync2 still shares a lot of the code with the original project, it is as of now not functional. While debugging is ongoing, the API is somewhat ready to be used by other projects. The project is therefore published in this state to allow testing the integration into other projects.

zsync2's People

Contributors

theassassin avatar probonopd avatar jonathonf avatar akiraohgaki avatar deedeeg avatar kevinmukuna avatar lgisler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.