{"id":30208342,"url":"https://github.com/jonasalfredsson/docker-rsyncd","last_synced_at":"2025-09-11T23:17:18.855Z","repository":{"id":307104859,"uuid":"1028314482","full_name":"JonasAlfredsson/docker-rsyncd","owner":"JonasAlfredsson","description":"Rsync running as a daemon/server inside a Docker container.","archived":false,"fork":false,"pushed_at":"2025-07-30T18:35:25.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-10T02:53:29.224Z","etag":null,"topics":["alpine","arm64","armv7","docker","rsync","rsync-backup","rsyncd","x86","x86-64"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/jonasal/rsyncd/tags","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JonasAlfredsson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-29T10:49:09.000Z","updated_at":"2025-07-30T18:35:29.000Z","dependencies_parsed_at":"2025-07-29T14:00:06.436Z","dependency_job_id":"33c36862-105c-4295-92a2-f055ac65f86d","html_url":"https://github.com/JonasAlfredsson/docker-rsyncd","commit_stats":null,"previous_names":["jonasalfredsson/docker-rsync","jonasalfredsson/docker-rsyncd"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/JonasAlfredsson/docker-rsyncd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasAlfredsson%2Fdocker-rsyncd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasAlfredsson%2Fdocker-rsyncd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasAlfredsson%2Fdocker-rsyncd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasAlfredsson%2Fdocker-rsyncd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JonasAlfredsson","download_url":"https://codeload.github.com/JonasAlfredsson/docker-rsyncd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasAlfredsson%2Fdocker-rsyncd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270278724,"owners_count":24557188,"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-13T02:00:09.904Z","response_time":66,"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":["alpine","arm64","armv7","docker","rsync","rsync-backup","rsyncd","x86","x86-64"],"created_at":"2025-08-13T17:24:43.761Z","updated_at":"2025-08-13T17:24:45.253Z","avatar_url":"https://github.com/JonasAlfredsson.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-rsyncd\n\nA Docker image with the [rsync][1] binary running in daemon/server mode in order\nto allow for clients to push/pull data to it.\n\nRunning it as `root` inside a container allows us to keep the powerful archival\nfeatures (like keeping permissions and owner) while limiting its access to the\nhost's file system by only mounting the paths necessary. These mounts could\nalso be set to read only if no files are every to be written to the share.\n\n\u003e This container is primarily used by [this Ansible role][5].\n\n## Usage\n\nThe service reads the default config file located at `/etc/rsyncd.conf`, which\nin turn reads any additional `*.inc` an `*.conf` files found in the\n`/etc/rsyncd.d/` folder. By host mounting your custom configs into this\ndirectory they will be automatically included.\n\nHowever, please read up on the difference between how\n[`*.inc` an `*.conf` files][2] are handled, or look into the\n[examples directory](./examples/) and the [`rsyncd.conf`](./rsyncd.conf) file,\nto get a better understanding on what will happen.\n\nThe image may then be tested/started like this:\n\n```\ndocker run -it --network=host \\\n\t-v $(PWD)/examples:/etc/rsyncd.d:ro \\\n\tjonasal/rsync:latest\n```\n\n\u003e I recommend using `--network=host` to get some nicer printouts in the logs,\n\u003e but it is up to you if you prefer to port forward instead (port `873`).\n\n\n## Good to Know\n\n### Logging\nSince the service is running inside a container its output goes straight to\n`stdout` to then be caught by Docker. By default this container set the `-v`\nflag and `--log-file-format='%o %h [%a] %m (%u) %f %l'` as `CMD` arguments.\nThis is very easy to override by providing your own CMD which will replace\nwhat is set in the [Dockerfile](./Dockerfile).\n\n### Using chroot\nSince this image defaults to `use chroot = yes` it might be necessary to\nprovide the `--cap-add=SYS_CHROOT` [flag][3] if you run into any weird error\nmessages. I did not need to, but this is here just in case.\n\n### Authorizing Users\nThrough the use of the `secrets file` it is possible to create username+password\ncombinations that may be used to enable authentication to the shares. The\nusername and password defined here has nothing to do with the username or\npassword of the user on the system (they don't even need to exist as a user on\nthe system). Instead the `user` and `group` values the files/transfers will get\nis defined by the `uid` and `gid` options in the configuration. This means that\nit is possible to \"impersonate\" other system users if configured wrongly.\n\nWhile this allows us to force any connecting user to use the extremely\nrestricted `nobody/nogroup` user (to protect us from unwanted access to\nsensitive files) it also means that all files will be created by the same\nuser. This might not always be desired behavior so an option is to use the\n[RSYNC_USER_NAME][4] environment variable like this:\n\n```conf\nuid = %RSYNC_USER_NAME%\ngid = *\n```\n\nThis will make so that the rsync user, with username \"jonas\", gets assigned the\nsystem `uid` of \"jonas\". However, in contrast to the case when the `uid/gid`\nis statically assigned this share now only allows users which exists on the\nsystem, else it will fail with `@ERROR: invalid uid`.\n\nFurthermore, for this to work as intended the `/etc/passwd` file needs to be\nreadable from within the container, else it will not be possible for rsync to\nlook up the IDs of the usernames. This can be solved by adding the following\nmounts to the Docker run command:\n\n```\ndocker run -it --rm\n    -v '/etc/passwd:/etc/passwd:ro' \\\n    -v '/etc/group:/etc/group:ro' \\\n    jonasal/rsyncd:local\n```\n\n\n\n\n\n[1]: https://linux.die.net/man/1/rsync\n[2]: https://www.man7.org/linux/man-pages/man5/rsyncd.conf.5.html#CONFIG_DIRECTIVES\n[3]: https://stackoverflow.com/a/64937200\n[4]: https://download.samba.org/pub/rsync/rsyncd.conf.html#uid\n[5]: https://github.com/JonasAlfredsson/ansible-role-rsync_server\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasalfredsson%2Fdocker-rsyncd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonasalfredsson%2Fdocker-rsyncd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasalfredsson%2Fdocker-rsyncd/lists"}