toolbox

package
v0.0.0-...-e7ef357 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFtpUnsafePath = errors.New("FTP root path is unsafe")

Functions

func EnsureStandaloneFtpIdentity

func EnsureStandaloneFtpIdentity() (uint, uint, error)

func FtpStatus

func FtpStatus() (bool, bool)

func ValidateFtpRootPath

func ValidateFtpRootPath(rootPath string) error

Types

type Fail2ban

type Fail2ban struct{}

func NewFail2Ban

func NewFail2Ban() (*Fail2ban, error)

func (*Fail2ban) ListBanned

func (f *Fail2ban) ListBanned() ([]string, error)

func (*Fail2ban) ListIgnore

func (f *Fail2ban) ListIgnore() ([]string, error)

func (*Fail2ban) Operate

func (f *Fail2ban) Operate(operate string) error

func (*Fail2ban) ReBanIPs

func (f *Fail2ban) ReBanIPs(ips []string) error

func (*Fail2ban) Status

func (f *Fail2ban) Status() (bool, bool, bool)

func (*Fail2ban) Version

func (f *Fail2ban) Version() string

type FirewallClient

type FirewallClient interface {
	Status() (bool, bool, bool)
	Version() (string, error)
	Operate(operate string) error
	OperateSSHD(operate, ip string) error
}

type Ftp

type Ftp struct{}

func NewFtpClient

func NewFtpClient() (*Ftp, error)

func (*Ftp) LoadList

func (f *Ftp) LoadList() ([]FtpList, error)

func (*Ftp) LoadLogs

func (f *Ftp) LoadLogs(user, operation string) ([]FtpLog, error)

func (*Ftp) Operate

func (f *Ftp) Operate(operate string) error

func (*Ftp) Reload

func (f *Ftp) Reload() error

func (*Ftp) SetPasswd

func (f *Ftp) SetPasswd(username, passwd string) error

func (*Ftp) SetPath

func (f *Ftp) SetPath(username, path string, uid, gid uint) error

func (*Ftp) SetStatus

func (f *Ftp) SetStatus(username, status string) error

func (*Ftp) Status

func (f *Ftp) Status() (bool, bool)

func (*Ftp) UserAdd

func (f *Ftp) UserAdd(username, passwd, path string, uid, gid uint) error

func (*Ftp) UserDel

func (f *Ftp) UserDel(username string) error

type FtpClient

type FtpClient interface {
	Status() (bool, bool)
	Operate(operate string) error
	LoadList() ([]FtpList, error)
	UserAdd(username, passwd, path string, uid, gid uint) error
	UserDel(username string) error
	SetPasswd(username, passwd string) error
	SetPath(username, path string, uid, gid uint) error
	Reload() error
	LoadLogs() ([]FtpLog, error)
}

type FtpList

type FtpList struct {
	User   string
	Path   string
	Status string
	UID    uint
	GID    uint
}

type FtpLog

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL