Live data from Hacker News

SFTPGo: A Full Featured SFTP Server in Go

github.com

31–40 of 59 posts

Re: SFTPGo: A Full Featured SFTP Server in Go

#32
post #29

Earlier quoted context omitted.

Sqlite has been rewritten in both Go and C#. It's really not that hard. The code is clearly documented and everything works in roughly the same way. Easily achievable by a single developer in a few months. Sqlite code is emulating classes with structs and methods (they're even called classes in the code). This it's pretty easy to translate into languages with reference and struct support. Memory allocation is separat…

Can you point to the pure Go re-implementation of Sqlite? I was looking for such a thing but never found it. Instead I had to go with a k/v store like Bolt.

[deleted]

Re: SFTPGo: A Full Featured SFTP Server in Go

#33
post #29

Earlier quoted context omitted.

Sqlite has been rewritten in both Go and C#. It's really not that hard. The code is clearly documented and everything works in roughly the same way. Easily achievable by a single developer in a few months. Sqlite code is emulating classes with structs and methods (they're even called classes in the code). This it's pretty easy to translate into languages with reference and struct support. Memory allocation is separat…

Can you point to the pure Go re-implementation of Sqlite? I was looking for such a thing but never found it. Instead I had to go with a k/v store like Bolt.

https://godoc.org/modernc.org/ql

Re: SFTPGo: A Full Featured SFTP Server in Go

#35
post #33
post #29

Earlier quoted context omitted.

Can you point to the pure Go re-implementation of Sqlite? I was looking for such a thing but never found it. Instead I had to go with a k/v store like Bolt.

https://godoc.org/modernc.org/ql

That's not it. It was a GitLab project, but searching for that is pretty difficult. I'll edit this comment if i find it.

Edit: Here it is: https://gitlab.com/cznic/sqlite

Re: SFTPGo: A Full Featured SFTP Server in Go

#36

Earlier quoted context omitted.

I'd second this, I've longed struggled to come up with a easy-to-deploy sshd/sftp/chroot configuration that permitted easy database-driven configuration w/o extra shell access. You have to fight a lot of defaults to get this just right. Would the OpenSSH upstream accept patches for an unprivileged sshd/sftp-subsystem to make this easier to use their battle tested code?

If you just want to share files and not giving the option to upload files, you could try graft... https://github.com/sandreas/graft graft serve ./*.txt will serve every txt file in the current dir...

For that use case, I just use `python3 -m http.server` (or the Python 2 equivalent), especially since Python is almost always already installed.

Re: SFTPGo: A Full Featured SFTP Server in Go

#37
post #15

This looks like a very interesting project to make a lightweight sftp server, though the dependency on an SQL db makes it a bit harder to install. Go has a really good set of crypto primitives, an excellent ssh implementation maintained by the core team, and a great sftp server and client library which makes this project possible. I recently added an sftp server to rclone: https://rclone.org/commands/rclone_serve_sft…

Does it need to be relational? Perhaps boltdb could do it

https://github.com/boltdb/bolt

Re: SFTPGo: A Full Featured SFTP Server in Go

#38
post #15

This looks like a very interesting project to make a lightweight sftp server, though the dependency on an SQL db makes it a bit harder to install. Go has a really good set of crypto primitives, an excellent ssh implementation maintained by the core team, and a great sftp server and client library which makes this project possible. I recently added an sftp server to rclone: https://rclone.org/commands/rclone_serve_sft…

Not sure the case in this context, but usually the SQLite dependency can almost be seen as no-dependency at all - it's just a file on the disk without any external dependency.

If you were planing on using this on a PaaS host where the file system is ephemeral this would be a non-starter.

Re: SFTPGo: A Full Featured SFTP Server in Go

#39

Earlier quoted context omitted.

Not sure the case in this context, but usually the SQLite dependency can almost be seen as no-dependency at all - it's just a file on the disk without any external dependency.

If you were planing on using this on a PaaS host where the file system is ephemeral this would be a non-starter.

What would the RL use case be for running this server, whose purpose is to facilitate transferring files from one computer's filesystem to another, on an ephemeral filesystem?

Re: SFTPGo: A Full Featured SFTP Server in Go

#40
post #6

Part of the utility of SFTP to clients and admins is the fact there are no additional requirements other than SSHD to function. This seems to fly in the face of that. If you are willing to install more software, why not use a more feature filled file server?

OpenSSH is very much tied to system users, but sometimes you might want to give access to external users that don’t need to exist as actual unix users. because SSH and SFTP are so closely tied together, a configuration via PAM is pretty hard and inconvenient because creating fake users via PAM for SFTP will also create them for SSH and because there’s no easy way to map all such virtual users to the same user-id. Als…

Seems like a use-case for just wrapping regular SFTP in a virtualized userland with definable hooks for things like PAM’s user data lookups. I believe that gVisor does this?
Post reply on HN