Add oc-rsync source connector with SSH and daemon transports - #261
Add oc-rsync source connector with SSH and daemon transports#261oferchen wants to merge 3 commits into
Conversation
Integrates a new filesystem-family source that stages remote files via oc-rsync before handing them to the shared filesystem reader. Registers the `rsync://` (daemon) and `rsync+ssh://` (SSH) URI schemes, with full test coverage across transport, command building, staging, and end-to-end reads.
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
looks like some lint rules. |
|
Wow, thank you so much!
Yes. |
amotl
left a comment
There was a problem hiding this comment.
This is huge, thank you so much. 💯
I think we can merge easily, but a documentation page about the new connector would be good. 🙏
|
(rsync)= rsync[rsync] is a utility for efficiently transferring and synchronizing files The connector stages remote files into a local directory, then reads them URI formatsTwo transport schemes are supported, both handled by the same connector. SSH transport |
Excellent, that's right on the spot. Thank you! |
Address five findings from issue panodata#262: - B1/B4: Normalise trailing slashes in remote_spec (transport.py) - B2: Guard empty pattern in filter_rules (command.py) - B6: Deduplicate query_params call (api.py) - S1: Allowlist validation for binary option (config.py) - S9: Restrict staging directory permissions to 0o700 (stager.py) Tighten docstrings across all rsync modules and tests to match current code after the fixes.
Update: Audit fixes from #262Addressed five findings from the audit in issue #262:
Not fixed (by design):
Tests: 83 passed (70 original + 13 new), 100% coverage on all rsync modules. Also tightened docstrings across all source and test files. |
- Fix ruff I001 (unsorted imports) in api.py - Skip SubprocessRunner tests on Windows (shell scripts need POSIX) - Skip staging dir permissions test on Windows (NTFS has no mode bits)
| DEFAULT_BINARY = "oc-rsync" | ||
| ALLOWED_BINARIES = frozenset({"oc-rsync", "rsync"}) |
There was a problem hiding this comment.
Hi. Let me just add a little question here: Instead of invoking the program directly, after a traditional permanent installation, omniload could alternatively invoke oc-rsync ephemerally using Docker or Podman, right?
That alternative doesn't need to go into this very patch, but it could if you're still up for it. Otherwise, let's take a note for a subsequent iteration?
There was a problem hiding this comment.
The software binary can be distributed and executed directly from the container image.
The container provides the executable and its runtime dependencies, while the required host directories, configuration files, and other resources are bind-mounted into the container. This allows the software to operate on host data without requiring installation or dependency management on the host system.
Advantages:
- No software installation is required on the host.
- The container provides a consistent and reproducible runtime environment.
- The exact software version is controlled by the container image.
- Dependencies are isolated from the host operating system.
- Upgrading the software only requires pulling a newer container image.
- Multiple versions or builds can coexist without conflicts.
For example, if the container contains the binary at /usr/bin/oc-rsync, the host can execute it by mounting the required directories.
Docker
Run oc-rsync from the container against host directories:
docker run --rm \
-v /host/source:/source:ro \
-v /host/destination:/destination \
ghcr.io/oferchen/oc-rsync \
/usr/bin/oc-rsync /source /destinationPodman
The equivalent Podman usage:
podman run --rm \
-v /host/source:/source:ro \
-v /host/destination:/destination \
ghcr.io/oferchen/oc-rsync \
/usr/bin/oc-rsync /source /destinationThis approach effectively turns the container image into a portable software package. The host provides the data and configuration, while the container provides the executable and all required runtime dependencies.
Users can run different versions or builds of the software without modifying the host operating system or managing additional packages.
Rather than having each extension define its own container integration model, a structural solution would be preferable. The container execution mechanism should be handled centrally, providing a consistent interface for all extensions and avoiding duplicated logic, incompatible approaches, and maintenance overhead.
A unified container integration layer would allow extensions to simply declare the required binary, arguments, mounts, and environment variables while the framework handles execution, lifecycle management, and compatibility.
Integrates a new filesystem-family source that stages remote files via oc-rsync before handing them to the shared filesystem reader. Registers the
rsync://(daemon) andrsync+ssh://(SSH) URI schemes, with full test coverage across transport, command building, staging, and end-to-end reads.