- Notifications
You must be signed in to change notification settings - Fork8
An experimental go FTP server framework
License
koofr/graval
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Go FTP server framework. By providing a simple driver class thatresponds to a handful of methods you can have a complete FTP server.
Some sample use cases include persisting data to:
- an Amazon S3 bucket
- a relational database
- redis
- memory
Full documentation for the package is available ongodoc
go get github.com/koofr/graval
go run example/example.go
To boot an FTP server you will need to provide a driver that speaks to yourpersistence layer - the required driver contract is listed below.
Do not forget to seed math random in your main program. Otherwise passive ports will be predictable.
func main() { rand.Seed(time.Now().UTC().UnixNano()) ...}
Your driver MUST implement a number of simple methods. You can view the requiredcontract in the package docs ongodoc
- James Healyjames@yob.id.auhttp://www.yob.id.au
- Luka Zakrajsekluka@koofr.nethttp://koofr.net
FTP is an incredibly insecure protocol. Be careful about forcing users to authenticatewith a username or password that are important.
This library is distributed under the terms of the MIT License. See the included file formore detail.
All suggestions and patches welcome, preferably via a git repository I can pull from.If this library proves useful to you, please let me know.
There are a range of RFCs that together specify the FTP protocol. In chronologicalorder, the more useful ones are:
- http://tools.ietf.org/rfc/rfc959.txt
- http://tools.ietf.org/rfc/rfc1123.txt
- http://tools.ietf.org/rfc/rfc2228.txt
- http://tools.ietf.org/rfc/rfc2389.txt
- http://tools.ietf.org/rfc/rfc2428.txt
- http://tools.ietf.org/rfc/rfc3659.txt
- http://tools.ietf.org/rfc/rfc4217.txt
For an english summary that's somewhat more legible than the RFCs, and providessome commentary on what features are actually useful or relevant 24 years afterRFC959 was published:
For a history lesson, check out Appendix III of RCF959. It lists the preceding(obsolete) RFC documents that relate to file transfers, including the ye oldRFC114 from 1971, "A File Transfer Protocol"
This library is heavily based onem-ftpd, an FTPdframework with similar design goals within the ruby and EventMachine ecosystems. Itworked well enough, but you know, callbacks and event loops make me somethingsomething.
TLS implementation and some other commands are based onpyftpdlib.