Skip to content
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

No sftp support? #11

Closed
devhell opened this issue Jan 15, 2023 · 12 comments · Fixed by #73
Closed

No sftp support? #11

devhell opened this issue Jan 15, 2023 · 12 comments · Fixed by #73
Labels
A-backends Area: Related to backends in rustic_core E-help-wanted Call for participation: Help is requested to fix this issue good first issue Call for participation: Good for newcomers

Comments

@devhell
Copy link

devhell commented Jan 15, 2023

Hi!

Love the project, thank you so much! When I tried to use my existing restic repository (Hetzner Storagebox), rustic lets me know that the sftp backend is not supported. Am I missing something? :)

Thank you :D

@aawsome
Copy link
Member

aawsome commented Jan 15, 2023

You are right, sftp is so far only supported via the rclone backend. In fact, so far only local, rest and rclone backend are implemented.
I do hesitate a bit to implement more backends as this also may introduce maintenance burden, but would favor more to work on #14 if more backends are desirable.
That said, if anyone is up with a PR to support sftp or another backend (maybe within a feature ) - I would happily accept it!

@aawsome aawsome added E-help-wanted Call for participation: Help is requested to fix this issue A-backends Area: Related to backends in rustic_core labels Jan 15, 2023
@aawsome
Copy link
Member

aawsome commented Jan 15, 2023

Some info if anyone wants to implement a sftp backend:

  • I think the crate to use is ssh2, see https://docs.rs/ssh2/latest/ssh2/struct.Sftp.html
  • One needs to implement the ReadBackend and WriteBackend traits, see e.g. src/backends/local.rs and src/backends/rest.rs
  • I'm not sure about the best strategy for retrying on errors, but rest.rs can be a good example how to handle these retries.
  • Finally, the backend given in the command line is chosen in the ChooseBackend, see src/backends/choose.rs. Currently this is an Enum struct which itself needs to implement ReadBackend and WriteBackend - so, just some dumb copy&paste needed here. (Maybe in future I'll change this to hold a Trait Object, that will simplify some code here..)

@devhell
Copy link
Author

devhell commented Jan 16, 2023

Ah, I didn't realize that it was only available via the rclone backend. Thank you for the feedback! I'm afraid I'm in no position to help with the implementation. But I'll keep my eye on your project as I'd like to help with documentation. 🍻

@aawsome
Copy link
Member

aawsome commented Jan 16, 2023

Help with documentation is also highly appreciated! Feel free to open any PR which adds or improves the docu!

@aawsome aawsome added the good first issue Call for participation: Good for newcomers label Jan 16, 2023
@devhell
Copy link
Author

devhell commented Jan 31, 2023

Just to add to this, I've now tried rustic on my restic repo on Hetzner's storagebox via rclone. The result is, I'm guessing, down to rclone:

$ rustic repoinfo
[WARN] Error error decoding response body: Odd number of digits at line 1 column 482760 at 367.252424ms, retrying

It will continue backing-off forever, it seems (I stopped it once the retry would be attempted after 82 seconds).

PS: I did repoinfo because I wanted to see what rustic would make of it before trying any other actions.

@aawsome
Copy link
Member

aawsome commented Feb 3, 2023

Sorry for the late reply. There must be some additional files in your repository. Valid files are all named by an sha256 hex (i.e. a 64 digit hexadecimal number). rustic-rs/rustic#415 should fix this as it ignores all additional files.

@devhell
Copy link
Author

devhell commented Feb 3, 2023

Awesome, thanks!

@aawsome
Copy link
Member

aawsome commented Feb 3, 2023

It will continue backing-off forever, it seems (I stopped it once the retry would be attempted after 82 seconds).

I just checked this: It should retry for a maximum of 10 minutes and then finally fail... (in case there is a true fetching error)

@tbm
Copy link

tbm commented Feb 4, 2023

I just discovered rustic. I'd also like sftp support natively (but also can't contribute code).

@simonsan simonsan transferred this issue from rustic-rs/rustic Sep 18, 2023
@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Sep 18, 2023
@simonsan simonsan removed the S-triage Status: Waiting for a maintainer to triage this issue/PR label Sep 18, 2023
@jirutka
Copy link

jirutka commented Jan 7, 2024

That’s a really unpleasant finding. I had no idea that rustic didn’t support SSH transport, I took it for granted. I preferred rustic over restic because I really don’t like Go, so rclone is not an option – it’s bloated af.

@aawsome aawsome mentioned this issue Jan 7, 2024
10 tasks
@aawsome
Copy link
Member

aawsome commented Jan 7, 2024

@jirutka See #73 which is currently under review. sftp will be supported via opendal. When #73 is merged we'll make a new rustic_core release and soon after a new rustic release.

Also looking forward to feedback if you are able to self-compile with that PR (Note: for rustic, you should also use rustic-rs/rustic#977).

@simonsan
Copy link
Contributor

simonsan commented Jan 7, 2024

sftp will be supported via opendal.

I think we need to update a lot in the documentation afterwards, and also have a good overview of supported platforms and how to setup a profile/rustic for them. I'll create a tracking issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backends Area: Related to backends in rustic_core E-help-wanted Call for participation: Help is requested to fix this issue good first issue Call for participation: Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants