{"id":13994600,"url":"https://github.com/sourcefrog/rsyn","last_synced_at":"2025-08-16T10:30:45.565Z","repository":{"id":38330355,"uuid":"259197720","full_name":"sourcefrog/rsyn","owner":"sourcefrog","description":"[alpha] Wire-compatible rsync client in Rust ","archived":true,"fork":false,"pushed_at":"2022-06-06T21:57:19.000Z","size":227,"stargazers_count":37,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"stable","last_synced_at":"2025-08-14T17:25:53.939Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcefrog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-27T03:43:54.000Z","updated_at":"2025-07-25T00:29:05.000Z","dependencies_parsed_at":"2022-08-25T03:53:37.724Z","dependency_job_id":null,"html_url":"https://github.com/sourcefrog/rsyn","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sourcefrog/rsyn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcefrog%2Frsyn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcefrog%2Frsyn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcefrog%2Frsyn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcefrog%2Frsyn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcefrog","download_url":"https://codeload.github.com/sourcefrog/rsyn/tar.gz/refs/heads/stable","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcefrog%2Frsyn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270490179,"owners_count":24592765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-09T14:02:58.574Z","updated_at":"2025-08-16T10:30:45.294Z","avatar_url":"https://github.com/sourcefrog.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Wire-compatible rsync client in Rust\n\n[![crates.io](https://img.shields.io/crates/v/rsyn.svg)](https://crates.io/crates/rsyn)\n[![docs.rs](https://docs.rs/rsyn/badge.svg)](https://docs.rs/rsyn)\n[![Tests](https://github.com/sourcefrog/rsyn/workflows/rust/badge.svg)](https://github.com/sourcefrog/rsyn/actions?query=workflow%3Arust)\n\n`rsyn` reimplements part of the rsync network protocol in pure Rust. (It's\n\"rsync with no C.\")\n\n**NOTE: `rsyn` is an incomplete and inactive experiment. It's not currently a\nuseful replacement for rsync.**\n\nrsyn supports protocol version 27, which is supported by rsync versions from\n2.6.0 (released in 2004) onwards, and by openrsync.\n\n## Install\n\n1. [Install Rust](https://rustup.rs/).\n\n2. Run\n\n   ```shell\n   cargo install rsyn\n   ```\n\nTo run the interoperability tests (with `cargo test`) you'll need a copy of\nrsync installed.\n\n## Usage\n\n`rsyn DIR` prints a recursive listing of the given local directory, by launching\nan rsync subprocess and controlling it over a pair of pipes.\n\n`rsyn USER@HOST:DIR` or `rsyn HOST:DIR` lists a remote directory, connecting to\nthe rsync server over SSH.\n\n## Roadmap\n\nProgress so far:\n\n- [x] List a local directory from a local subprocess.\n\n- [x] List a directory over SSH.\n\nIntended next steps are:\n\n- [ ] Copy a directory from rsync over SSH into an empty local directory.\n\n- [ ] Copy a directory from rsync into a local directory, skipping already\n      up-to-date files, but downloading the full content of missing or\n      out-of-date files.\n\n- [ ] Connect to an rsync daemon (`rsync://`): these talk a different\n      introductory protocol before starting the main rsync protocol. Support\n      downloads with the limitations above.\n\n- [ ] Support incremental rolling-sum and checksum file transfers: the actual\n      \"rsync algorithm\".\n\n- [ ] Support the commonly-used `-a` option.\n\n- [ ] Upload a directory to rsync over SSH.\n\nBelow this point the ordering is less certain but some options are:\n\n- [ ] Act as a server for rsync+ssh. In particular, use this to test rsyn\n      against itself, as well as against rsync.\n\n- [ ] Act as an `rsync://` daemon.\n\n- [ ] Support some more selected command line options.\n\n## Why do this?\n\nrsync does by-hand parsing of a complicated binary network protocol in C.\nAlthough that was a reasonble option in the 90s, today it looks dangerous.\nFuzzers find cases where a malicious peer can crash rsync, and worse may be\npossible.\n\nThe rsync C code is quite convoluted, with many interacting options and\nparameters stored in global variables affecting many different parts of the\ncontrol flow, including how structures are encoded and decoded.\n\nrsync is still fairly widely deployed, and does a good job. A safer\ninteroperable implementation could be useful.\n\nAnd, personally: I contributed to rsync many years ago, and it's interesting to\nrevisit the space with better tools, and with more experience, and see if I can\ndo better.\n\n## Goals\n\n- rsyn will interoperate with recent versions of upstream \"tridge\" rsync, over\n  (first) rsync+ssh or (later) `rsync://`.\n\n- rsyn will support commonly-used rsync options and scenarios. The most\n  important are to transfer files recursively, with mtimes and permissions, with\n  exclusion patterns.\n\n- rsyn will offer a clean public library Rust API through which transfers can be\n  initiated and observed in-process. As is usual for Rust libraries, the API is\n  not guaranteed to be stable before 1.0.\n\n- Every command line option in rsyn should have the same meaning as in rsync.\n\n  It's OK if some of the many rsync options are not supported.\n\n  The exception is that rsyn-specific options will start with `--Z` to\n  distinguish them and avoid collisions.\n\n- rsyn's test suite should demonstrate interoperability by automatically testing\n  rsyn against rsync. (Later versions might demonstrate compatibility against\n  various different versions of rsync, and maybe also against openrsync.)\n\n- rsyn should have no `unsafe` blocks. (The underlying Rust libraries have some\n  trusted implementation code and link in some C code.)\n\n- rsyn will run on Linux, macOS, Windows, and other Unixes, in both 64-bit and\n  (if the OS supports it) 32-bit mode.\n\n  rsyn will use Rust concurrency structures that are supported everywhere,\n  rather than rsync's creative application of Unix-isms such as sockets shared\n  between multiple processes.\n\n- rsyn should be safe even against an arbitrarily malicious peer.\n\n  In particular, paths received from the peer should be carefully validated to\n  prevent\n  [path traversal bugs](https://cwe.mitre.org/data/definitions/1219.html).\n\n- rsyn should show comparable performance to rsync, in terms of throughput, CPU,\n  and memory.\n\n- rsyn should have good test coverage: both unit tests and interoperability\n  tests.\n\n- rsyn code should be clean and understandable Rust code. (The rsync code is now\n  quite convoluted.) rsyn will use Rust type checking to prevent illegal or\n  unsafe states. Interacting options should be factored into composed types,\n  rather than forests of `if` statements.\n\n### Non-goals\n\n- rsyn will not necessarily support every single option and feature in rsync.\n\n  rsync has a lot of options, which (at least in the rsync codebase) interact in\n  complicated ways. Some seem to have niche audiences, or to be obsolete, such\n  as special support for `rsh` or HP-UX `remsh`.\n\n- rsyn speaks the protocol defined by rsync's implementation, and does not\n  aspire to evolve the protocol or to add rsyn-specific upgrades.\n\n  rsync's protocol is already fairly weird and complicated, and was built for a\n  different environment than exists today. Dramatically new features, in my\n  view, are better off in a clean-slate protocol.\n\n- rsyn need not address security weaknesses in the rsync protocol.\n\n  rsync's block-hashing, file-hashing, and daemon mode authentication use MD4,\n  which is not advisable today. This can't be unilaterally changed by rsyn while\n  keeping compatibility.\n\n  For sensitive data or writable directories, or really any traffic over\n  less-than-fully-trusted networks, I'd strongly recommend running rsync over\n  SSH.\n\n- rsyn need not generate exactly identical text/log output.\n\n## More docs\n\n* [Release notes](NEWS.md)\n\n## Acknowledgements\n\nThanks to [Tridge](https://www.samba.org/~tridge/) for his brilliant and\ngenerous mentorship and contributions to open source.\n\nThis project would have been far harder without Kristaps Dzonsons's\ndocumentation of the rsync protocol in the\n[openrsync](https://github.com/kristapsdz/openrsync) project.\n\n## License\n\n[Apache 2.0](LICENSE).\n\n## Contributing\n\nI'd love to accept patches to this project. Please read the\n[contribution guidelines](CONTRIBUTING.md) and\n[code of conduct](CODE_OF_CONDUCT.md).\n\n## Disclaimer\n\nThis is not an official Google project. It is not supported by Google, and\nGoogle specifically disclaims all warranties as to its quality, merchantability,\nor fitness for a particular purpose.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcefrog%2Frsyn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcefrog%2Frsyn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcefrog%2Frsyn/lists"}