mirror of
https://github.com/rclone/rclone.git
synced 2024-11-29 12:04:11 +08:00
parent
8beab1aaf2
commit
f865280afa
|
@ -78,6 +78,7 @@ func newServer(f fs.Fs, opt *ftpopt.Options) (*server, error) {
|
||||||
},
|
},
|
||||||
Hostname: host,
|
Hostname: host,
|
||||||
Port: portNum,
|
Port: portNum,
|
||||||
|
PublicIp: opt.PublicIP,
|
||||||
PassivePorts: opt.PassivePorts,
|
PassivePorts: opt.PassivePorts,
|
||||||
Auth: &Auth{
|
Auth: &Auth{
|
||||||
BasicUser: opt.BasicUser,
|
BasicUser: opt.BasicUser,
|
||||||
|
|
|
@ -16,6 +16,7 @@ var (
|
||||||
func AddFlagsPrefix(flagSet *pflag.FlagSet, prefix string, Opt *ftpopt.Options) {
|
func AddFlagsPrefix(flagSet *pflag.FlagSet, prefix string, Opt *ftpopt.Options) {
|
||||||
rc.AddOption("ftp", &Opt)
|
rc.AddOption("ftp", &Opt)
|
||||||
flags.StringVarP(flagSet, &Opt.ListenAddr, prefix+"addr", "", Opt.ListenAddr, "IPaddress:Port or :Port to bind server to.")
|
flags.StringVarP(flagSet, &Opt.ListenAddr, prefix+"addr", "", Opt.ListenAddr, "IPaddress:Port or :Port to bind server to.")
|
||||||
|
flags.StringVarP(flagSet, &Opt.PublicIP, prefix+"public-ip", "", Opt.PublicIP, "Public IP address to advertise for passive connections.")
|
||||||
flags.StringVarP(flagSet, &Opt.PassivePorts, prefix+"passive-port", "", Opt.PassivePorts, "Passive port range to use.")
|
flags.StringVarP(flagSet, &Opt.PassivePorts, prefix+"passive-port", "", Opt.PassivePorts, "Passive port range to use.")
|
||||||
flags.StringVarP(flagSet, &Opt.BasicUser, prefix+"user", "", Opt.BasicUser, "User name for authentication.")
|
flags.StringVarP(flagSet, &Opt.BasicUser, prefix+"user", "", Opt.BasicUser, "User name for authentication.")
|
||||||
flags.StringVarP(flagSet, &Opt.BasicPass, prefix+"pass", "", Opt.BasicPass, "Password for authentication. (empty value allow every password)")
|
flags.StringVarP(flagSet, &Opt.BasicPass, prefix+"pass", "", Opt.BasicPass, "Password for authentication. (empty value allow every password)")
|
||||||
|
|
|
@ -24,6 +24,7 @@ You can set a single username and password with the --user and --pass flags.
|
||||||
type Options struct {
|
type Options struct {
|
||||||
//TODO add more options
|
//TODO add more options
|
||||||
ListenAddr string // Port to listen on
|
ListenAddr string // Port to listen on
|
||||||
|
PublicIP string // Passive ports range
|
||||||
PassivePorts string // Passive ports range
|
PassivePorts string // Passive ports range
|
||||||
BasicUser string // single username for basic auth if not using Htpasswd
|
BasicUser string // single username for basic auth if not using Htpasswd
|
||||||
BasicPass string // password for BasicUser
|
BasicPass string // password for BasicUser
|
||||||
|
@ -32,6 +33,7 @@ type Options struct {
|
||||||
// DefaultOpt is the default values used for Options
|
// DefaultOpt is the default values used for Options
|
||||||
var DefaultOpt = Options{
|
var DefaultOpt = Options{
|
||||||
ListenAddr: "localhost:2121",
|
ListenAddr: "localhost:2121",
|
||||||
|
PublicIP: "",
|
||||||
PassivePorts: "30000-32000",
|
PassivePorts: "30000-32000",
|
||||||
BasicUser: "anonymous",
|
BasicUser: "anonymous",
|
||||||
BasicPass: "",
|
BasicPass: "",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user