{"id":32698478,"url":"https://github.com/patte/rsync","last_synced_at":"2026-05-09T05:10:54.213Z","repository":{"id":319902208,"uuid":"1079919434","full_name":"patte/rsync","owner":"patte","description":"docker image for rsync using SSH keys for authentication","archived":false,"fork":false,"pushed_at":"2025-11-25T09:43:47.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-28T06:28:25.459Z","etag":null,"topics":["container","debian","docker","rsync","ssh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-20T15:32:03.000Z","updated_at":"2025-11-25T09:43:51.000Z","dependencies_parsed_at":"2025-10-20T21:26:39.950Z","dependency_job_id":"98806fd9-f73b-4a5c-8b20-f825687aa609","html_url":"https://github.com/patte/rsync","commit_stats":null,"previous_names":["patte/rsync"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patte/rsync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patte%2Frsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patte%2Frsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patte%2Frsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patte%2Frsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patte","download_url":"https://codeload.github.com/patte/rsync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patte%2Frsync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32807883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"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":["container","debian","docker","rsync","ssh"],"created_at":"2025-11-01T21:00:49.977Z","updated_at":"2026-05-09T05:10:54.199Z","avatar_url":"https://github.com/patte.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rsync\n\n\u003ca href=\"https://github.com/patte/rsync/actions\"\u003e\u003cimg src=\"https://github.com/patte/rsync/actions/workflows/test.yml/badge.svg\" alt=\"Tests\" height=\"18\"\u003e\u003c/a\u003e\n\nSmall and secure container to provide rsync access to a shared `/data` volume using SSH keys for authentication.\n\nFeatures:\n- [x] small docker image based on `debian:13-slim`\n- [x] openssh-server with hardened sshd config\n- [x] rsync (and python3-minimal) installed\n- [x] forced command to restrict users to `/usr/bin/rrsync /data`\n- [x] `FS_UID` and `FS_GID` to control the ownership of files created by clients\n- [x] on startup:\n  - host keys are generated if none are found in `/var/rsync/host`\n  - local users and authorized_keys are generated based on keys in `/var/rsync/clients/*.pub`\n- [x] GitHub Action to build (daily) and push the image to ghcr.io\n- [x] Test harness using docker-compose in `test/` \n\nImage:\n```\nghcr.io/patte/rsync\n```\n\n## Controlling file ownership (FS_UID/FS_GID)\n\nFS_UID and FS_GID let you control which numeric user and group ID own files written to /data by any authenticated client.\n\n- Defaults: FS_UID=1000 and FS_GID=1000 if not set.\n- Shared across users: All SSH users created from /var/rsync/clients/*.pub share the same FS_UID/FS_GID. At the filesystem level, their writes are indistinguishable by user; use SSH logs if you need per-user auditing.\n- Non-root only: The container will refuse to start if either FS_UID or FS_GID is 0.\n\nChoosing values\n- If you bind-mount a host directory to /data on a Linux host, set FS_UID/FS_GID to the numeric uid:gid you want to see on the host for created files (for example, your host user and group IDs).\n- Existing files in the mounted directory are not modified; changing FS_UID/FS_GID later won’t rewrite ownership. Use chown on the host if you need to migrate existing data.\n\nRecommended rsync options:\nBecause the process that actually handles the rsync/rrsync session inside the container runs as FS_UID:FS_GID it's not allowed to set arbitrary permissions or ownership on created files.\nTherefore, when sending data it's recommended to disable preserving permissions, owner and group. For example:\n```bash\nrsync -a --no-perms --no-owner --no-group -e \"ssh -p 2222 -i keys/clients/test\" ./test-data/ test@localhost:/\n```\n\n## Development\n\nGenerate client keys for testing:\n```bash\nmkdir -p keys/clients\nssh-keygen -t ed25519 -f keys/clients/test -N \"\"\n```\n\nGenerate some test data:\n```bash\nmkdir ./test-data\necho \"This is a test file.\" \u003e test-data/test-file.txt\ndd if=/dev/urandom of=test-data/large-file.bin bs=1m count=10\n```\n\nBuild and run the container:\n```bash\ndocker compose build \u0026\u0026 docker compose down \u0026\u0026 docker compose up\n```\n\n```bash\nrsync -av -e 'ssh -p 2222 -i keys/clients/test' ./test-data/ test@localhost:/\n```\n\n## Usage\n\n### Docker\nExample docker run:\n```bash\ndocker run -d \\\n  --name rsync \\\n  --cap-drop=ALL \\\n  --cap-add=CHOWN --cap-add=FOWNER --cap-add=SETUID --cap-add=SETGID --cap-add=SYS_CHROOT \\\n  -p 2222:22 \\\n  -v /path/to/data:/data \\\n  -v /path/to/host-keys:/var/rsync/host \\\n  -v /path/to/client-keys:/var/rsync/clients:ro \\\n  ghcr.io/patte/rsync\n```\n\n### quadlet\nExample podman quadlet: rsync.container\n```ini\n[Unit]\nAfter=network.target\n\n[Container]\nImage=ghcr.io/patte/rsync:main\nAutoUpdate=registry\nVolume=/path/to/keys/rsync/keys:/var/rsync\nVolume=/path/to/data/:/data/\nPublishPort=2222:22\nPublishPort=[::]:2222:22\nEnvironment=FS_UID=1001\nEnvironment=FS_GID=1001\n\n[Service]\nRestart=on-failure\n\n[Install]\nWantedBy=multi-user.target\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatte%2Frsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatte%2Frsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatte%2Frsync/lists"}