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

Add SSH/SFTP backend #658

Merged
merged 4 commits into from
Feb 13, 2023
Merged

Add SSH/SFTP backend #658

merged 4 commits into from
Feb 13, 2023

Conversation

ydylla
Copy link
Contributor

@ydylla ydylla commented Jan 15, 2023

Hi,
this PR adds an ssh/sftp backend. I used the file backend as inspiration and just used the corresponding sftp client commands from github.com/pkg/sftp.
It also fixes a small bug in the file backend and adds a new line to the backup status message.

The ssh backend can be configured via multiple environment variables (see README.md) but by default tries to use common keys/config files from the users home directory.

Copy link
Owner

@someone1 someone1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

@@ -94,7 +94,7 @@ func (f *FileBackend) Upload(ctx context.Context, vol *files.VolumeInfo) error {
_, err = io.Copy(w, vol)
if err != nil {
if closeErr := w.Close(); closeErr != nil {
log.AppLogger.Warningf("file backend: Error closing volume %s - %v", vol.ObjectName, err)
log.AppLogger.Warningf("file backend: Error closing volume %s - %v", vol.ObjectName, closeErr)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Nice catch!

@someone1 someone1 merged commit 0ac389e into someone1:master Feb 13, 2023
@ydylla
Copy link
Contributor Author

ydylla commented Feb 13, 2023

Awesome, thanks for the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants