这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Riscue
Copy link
Contributor

@Riscue Riscue commented Jun 15, 2022

SSH and SFtp feature added.

Copying and pruning working exactly same as other storage services.

Readme updated.

Tests updated.

@Riscue
Copy link
Contributor Author

Riscue commented Jun 15, 2022

#65

Copy link
Member

@m90 m90 left a comment

Choose a reason for hiding this comment

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

This is an amazing PR and addition, thank you very much.

One big open question from my end (which would add on top): how hard would it be to allow for SSH key authentication? Usually when I set up a VPS or similar I don't allow for password auth and I am not entirely sure if I'd loosen that rule just because another tool requires it. I've seen people mounting SSH keys into Docker containers, so maybe this could be a nice cherry on top for this feature?


I also left some comments inline, but nothing major.

@m90
Copy link
Member

m90 commented Jun 16, 2022

Yeah it seems as if Public Key authentication is supported https://pkg.go.dev/golang.org/x/crypto/ssh#AuthMethod

Maybe it could work like this:

  • when SSH_HOST_NAME is given but not SSH_PASSWORD, we try using key authentication, assuming a keypair is mounted in /root/.ssh (maybe we need to make the name of the key configurable too, not sure right now)
  • in case SSH_PASSWORD is given, password authentication is used

What do you think?

@Riscue
Copy link
Contributor Author

Riscue commented Jun 16, 2022

Yeah it seems as if Public Key authentication is supported https://pkg.go.dev/golang.org/x/crypto/ssh#AuthMethod

Maybe it could work like this:

  • when SSH_HOST_NAME is given but not SSH_PASSWORD, we try using key authentication, assuming a keypair is mounted in /root/.ssh (maybe we need to make the name of the key configurable too, not sure right now)
  • in case SSH_PASSWORD is given, password authentication is used

What do you think?

I am newbie at golang. I tried publickey auth but i was facing some issues couldn't resolve. I am not allowing password auth either. It would be nice. I will also try to make the corrections you mentioned in the comments. Thanks for review.

@m90
Copy link
Member

m90 commented Jun 16, 2022

I am newbie at golang.

It looks pretty solid already :) feel free to ask for help if you run into any problems and I'll see if I can help out.

@Riscue Riscue requested a review from m90 June 16, 2022 11:31
Copy link
Member

@m90 m90 left a comment

Choose a reason for hiding this comment

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

I left another round of questions, but again there are no major issues. Thanks!

@Riscue Riscue requested a review from m90 June 16, 2022 14:45
Default private key location changed to .ssh/id
@m90
Copy link
Member

m90 commented Jun 17, 2022

Brilliant, thank you very much!

@m90 m90 merged commit 0b205fe into offen:main Jun 17, 2022
@Riscue
Copy link
Contributor Author

Riscue commented Jun 17, 2022

Thank you! For your helps and this awesome solution. I needed some backup mechanism on my setup.

@m90
Copy link
Member

m90 commented Jun 17, 2022

This is now released in v2.18.0 🎉

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