Documentation ¶
Overview ¶
Package ftp implements an FTP server for rclone
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "ftp remote:path", Short: `Serve remote:path over FTP.`, Long: ` Run a basic FTP server to serve a remote over FTP protocol. This can be viewed with a FTP client or you can make a remote of type FTP to read and write it. ### Server options Use --addr to specify which IP address and port the server should listen on, e.g. --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By default it only listens on localhost. You can use port :0 to let the OS choose an available port. If you set --addr to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info. #### Authentication By default this will serve files without needing a login. You can set a single username and password with the --user and --pass flags. ` + vfs.Help + proxy.Help, Annotations: map[string]string{ "versionIntroduced": "v1.44", "groups": "Filter", }, Run: func(command *cobra.Command, args []string) { var f fs.Fs if proxyflags.Opt.AuthProxy == "" { cmd.CheckArgs(1, 1, command, args) f = cmd.NewFsSrc(args) } else { cmd.CheckArgs(0, 0, command, args) } cmd.Run(false, false, command, func() error { s, err := newServer(context.Background(), f, &Opt) if err != nil { return err } return s.serve() }) }, }
Command definition for cobra
View Source
var DefaultOpt = Options{
ListenAddr: "localhost:2121",
PublicIP: "",
PassivePorts: "30000-32000",
BasicUser: "anonymous",
BasicPass: "",
}
DefaultOpt is the default values used for Options
View Source
var Opt = DefaultOpt
Opt is options set by command line flags
Functions ¶
Types ¶
type FileInfo ¶
FileInfo struct to hold file info for ftp server
type Logger ¶
type Logger struct{}
Logger ftp logger output formatted message
func (*Logger) PrintCommand ¶
PrintCommand log formatted command execution
func (*Logger) PrintResponse ¶
PrintResponse log responses
type Options ¶ added in v1.6.1
type Options struct { //TODO add more options ListenAddr string // Port to listen on PublicIP string // Passive ports range PassivePorts string // Passive ports range BasicUser string // single username for basic auth if not using Htpasswd BasicPass string // password for BasicUser TLSCert string // TLS PEM key (concatenation of certificate and CA certificate) TLSKey string // TLS PEM Private key }
Options contains options for the http Server
Click to show internal directories.
Click to hide internal directories.