An experimental go FTP server framework

graval

Go FTP server framework. By providing a simple driver class that responds 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 on godoc

Installation

go get github.com/koofr/graval

Example

go run example/example.go

Usage

To boot an FTP server you will need to provide a driver that speaks to your persistence 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())
  ...
}

The Driver Contract

Your driver MUST implement a number of simple methods. You can view the required contract in the package docs on godoc

Contributors

Warning

FTP is an incredibly insecure protocol. Be careful about forcing users to authenticate with a username or password that are important.

License

This library is distributed under the terms of the MIT License. See the included file for more detail.

Contributing

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.

Further Reading

There are a range of RFCs that together specify the FTP protocol. In chronological order, the more useful ones are:

For an english summary that's somewhat more legible than the RFCs, and provides some commentary on what features are actually useful or relevant 24 years after RFC959 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 old RFC114 from 1971, "A File Transfer Protocol"

This library is heavily based on em-ftpd, an FTPd framework with similar design goals within the ruby and EventMachine ecosystems. It worked well enough, but you know, callbacks and event loops make me something something.

TLS implementation and some other commands are based on pyftpdlib.

Owner
Koofr
Because my data matters.
Koofr
Similar Resources

glossy-ly experimental proxy 💄☣️🖧

glossy-ly experimental proxy 💄☣️🖧

eyeZ HTTP proxy experiment powered by bubbletea and httransform Features Terminal UI Database recording (similar to hyperfox) Installation TUI and pro

Feb 17, 2022

A rule-based tunnel in Go with experimental features

A rule-based tunnel in Go with experimental features

Experimental-Clash A rule-based tunnel in Go with experimental features. Features Local HTTP/HTTPS/SOCKS server with authentication support VMess, Sha

Dec 25, 2022

An experimental package that rely on go generics to implement collection functions utilities

go-underscore go-underscore is a utility-belt library for Golang that provides s

Mar 20, 2022

An event driven remote access trojan for experimental purposes.

erat An event driven remote access trojan for experimental purposes. This example is very simple and leverages ssh failed login events to trigger erat

Jan 16, 2022

An experimental tektoncd/pipeline resolver

vegetable resolvers A set of experimental tektoncd/pipeline resolvers. The idea of this is to experiment with what could be achieved with a Resolver.

May 12, 2022

A TCP Server Framework with graceful shutdown, custom protocol.

xtcp A TCP Server Framework with graceful shutdown,custom protocol. Usage Define your protocol format: Before create server and client, you need defin

Dec 7, 2022

EasyTCP is a light-weight and less painful TCP server framework written in Go (Golang) based on the standard net package.

EasyTCP is a light-weight TCP framework written in Go (Golang), built with message router. EasyTCP helps you build a TCP server easily fast and less painful.

Jan 7, 2023

Gosof - A simple and easy golang socket server/client framework

Golang Socket Framework What A simple and easy golang socket server/client framework especially convenient for handling TCP fixed-length header and va

Feb 27, 2022

A Language Server Protocol (LSP) server for Jsonnet

Jsonnet Language Server Warning: This project is in active development and is likely very buggy. A Language Server Protocol (LSP) server for Jsonnet.

Nov 22, 2022
Comments
  • Question: Are there any existing drivers available?

    Question: Are there any existing drivers available?

    From the usage section in README,

    To boot an FTP server you will need to provide a driver that speaks to your persistence layer - the required driver contract is listed below.

    Are there any existing drivers available? I can see that the original repo provided a sample in-memory driver, and a swift/graval driver.

    It's great that an interface is used, making it possible to implement a variety of drivers, but it seems odd there isn't a single existing implementing mentioned or provided (unless I'm missing something?).

    Consider that the standard library has image which provides a general interface for dealing with images, and the most common formats are also provided at image/png, image/jpeg. Third party packages provide additional formats, like golang.org/x/image/tiff. It's also possible to write your own code to implement the interface in image, but the point is that you can use it right away for most common use cases (png, jpeg).

    Just wanted to get some clarification on this point, thanks!

Related tags
A simple FTP protocol with client and server implemented in TypeScript and Golang

websocket-ftp A simple FTP protocol with client and server implemented in TypeScript and Golang. Example (Client) const buffer: Uint8Array = (new Text

Apr 14, 2022
FTP server in Golang - Donovan and Kernighan´s excercise 8.2

This is my implementation of Exercise 8.2 in Donovan and Kernighan’s “The Go Programming Language”. With a LOT of help from Angus Morrison´s article h

Feb 6, 2022
FTP client package for Go

goftp A FTP client package for Go Install go get -u github.com/jlaffaye/ftp Documentation https://pkg.go.dev/github.com/jlaffaye/ftp?tab=doc Example

Jan 7, 2023
Access ftp through caddy

Access ftp through caddy

Dec 14, 2022
Experimental NFS(v4) server library

NFS server library Experimental NFS server library in pure go. NFSv4 implementation posix tests: access: 58/58 pass open: 19/22 pass chdir: 3/3 pass r

Dec 20, 2022
Hummingbard is an experimental client for building decentralized communities on top of Matrix.

Hummingbard is an experimental client for building decentralized communities on top of Matrix.

Oct 11, 2022
Experimental system call tracer for Linux x86-64, written in Go

gtrace A system call tracer for Linux x86-64. DISCLAIMER: This software is experimental and not considered stable. Do not use it in mission-critical e

Nov 29, 2022
An experimental Tor-Proxy serivce written in Go using Go-proxy and Go-libtor.

tor-proxy An experimental standalone tor-proxy service built with Go, using go-proxy, go-libtor and bine. This is a simple replacement to Tor's origin

Nov 9, 2022
Ananas is an experimental project for kubernetes CSI (Container Storage Interface) by using azure disk. Likewise, Ananas is the name of my cute british shorthair.

ananas Ananas is an experimental project for kubernetes CSI (Container Storage Interface) by using azure disk. Likewise, Ananas is the name of my cute

Aug 4, 2021
Highly experimental generator for Dragonfly

gen Highly experimental generator for Dragonfly Please note that this project is not currently actively being worked on. It may not be stable and it m

Nov 7, 2021