sftpd

package
v0.3.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package sftpd is the agent's built-in SFTP server. Users sign in with their panel email and password (the agent asks the panel over the link; nothing is stored on the node) and land in one service's data directory. Every operation goes through an os.Root, so paths and symlinks cannot reach outside that directory. Only the "sftp" subsystem is offered: no shell, exec or port forwarding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator func(ctx context.Context, user, password, remoteIP string) (Login, error)

Authenticator checks a username/password and returns where the user may go.

type Login

type Login struct {
	ServiceID string
	DataDir   string // the service's data directory on this node
	UID       int    // owner for files created over SFTP (the container user)
	// CheckWrite refuses uploads once the service is at its disk limit (optional).
	CheckWrite func() error
}

Login is the result of a successful authentication.

type Server

type Server struct {
	Addr        string
	HostKeyPath string
	Auth        Authenticator
	Logger      *slog.Logger
	// Listener, when set, is used instead of listening on Addr (tests).
	Listener net.Listener
	// contains filtered or unexported fields
}

Server serves SFTP.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run listens until ctx ends.

Jump to

Keyboard shortcuts

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