-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sftp: add support for ~/.ssh/config, fixes #37 #38
sftp: add support for ~/.ssh/config, fixes #37 #38
Conversation
Works for me, thanks a lot! Some nit-picking:
Anyway, here a convenient pointer to how duplicity uses paramiko and deals with the quirks: https://git.launchpad.net/duplicity/tree/duplicity/backends/ssh_paramiko_backend.py#n210 |
Oh, and maybe also still parse respective parts from the URL provided. I think it's more than reasonable to assume that, if I specify So:
[*] Of course there's also |
I didn't find any docs about how to parse multiple ssh configs (like user and system, and includes), so I just called parse multiple times: first user, then system. Guess we might need another PR to improve that. |
I'll squash everything together after review is finished, so we can have a 0.0.3 release soon. |
I think we could do it as simple as duplicity does it: https://git.launchpad.net/duplicity/tree/duplicity/backends/ssh_paramiko_backend.py#n210 Parse system config and put it into a dict. Yes, that would replace instead of adding options to keys which are allowed to be specified multiple times, but I think that's more predictable and easier to document behaviour as well.
that's also how duplicity does it
shouldn't it be the other way round? First system and override with duplicates specified in user [and then override with elements from the URL]? |
e007950
to
330e026
Compare
5ff7a6a
to
a8ba7de
Compare
OK, I'll check the duplicity way now. I first parsed user then system due to the documented "first match counts" behavior when dealing with the whole configs. |
Not tested, but looking through the changeset it's how I'd expect it to be(have) now |
I did some sftp tests (with the test suite, but it only works with my keys), works. |
I can test with my setup and assumptions in a few hours if that provides any benefits |
- support configured IdentityFiles - parse user and system ssh config - prefer values in url over config - add note about missing ssh_config.d/* support
1de46f4
to
c31cdf3
Compare
export BORGSTORE_TEST_SFTP_URL="sftp://user@host:port/home/user/borgstore/temp-store"
@mirko Now testing sftp is much easier, see latest commit. |
Didn't use the test suite - but tested all possible and impossible combinations. What was to be expected: Everything else set / replaced as intended. |
No description provided.