diff --git a/backend/utils/toolbox/pure-ftpd.go b/backend/utils/toolbox/pure-ftpd.go index 8538ea599..68eb72ac8 100644 --- a/backend/utils/toolbox/pure-ftpd.go +++ b/backend/utils/toolbox/pure-ftpd.go @@ -1,8 +1,10 @@ package toolbox import ( + "bufio" "errors" "fmt" + "golang.org/x/crypto/bcrypt" "os" "os/user" "path" @@ -21,6 +23,21 @@ type Ftp struct { DefaultGroup string } +type FtpList struct { + User string + Path string + Status string +} + +type FtpLog struct { + IP string `json:"ip"` + User string `json:"user"` + Time string `json:"time"` + Operation string `json:"operation"` + Status string `json:"status"` + Size string `json:"size"` +} + type FtpClient interface { Status() (bool, bool) Operate(operate string) error @@ -88,9 +105,19 @@ func (f *Ftp) Operate(operate string) error { } func (f *Ftp) UserAdd(username, passwd, path string) error { - std, err := cmd.Execf("pure-pw useradd %s -u %s -d %s <