How drakkan/sftpgo works
SFTPGo is an event-driven file-transfer server supporting SFTP, HTTP/S, FTP/S, and WebDAV, with local, encrypted, and cloud/remote storage backends. The main workflow is a client connecting through a protocol server, authenticating against configured account data, and transferring files through a virtual filesystem to its storage backend. The tree and README establish the major protocol, UI/API, storage, and automation capabilities; sampled server excerpts confirm some server startup and authentication paths, but not every protocol-to-storage call, so uncertain wiring is omitted.
Main entry points: server.go HTTP/S server · vfs.go Virtual filesystem · service.go Service lifecycle · dataprovider.go Data provider
Components 22
Runtime
- Service lifecycle
internal/service/service.go - Telemetry
internal/telemetry/router.go
Transfer protocols
- SFTP server
internal/sftpd/server.go - FTP/S server
internal/ftpd/server.go - HTTP/S server
internal/httpd/server.go - WebDAV server
internal/webdavd/server.go - WebAdmin UI
internal/httpd/webadmin.go - WebClient UI
internal/httpd/webclient.go - REST API
internal/httpd/api_user.go - Public sharing
internal/httpd/api_shares.go
Identity and control
- Accounts and policy
internal/dataprovider/user.go - Data provider
internal/dataprovider/dataprovider.go - Authentication
internal/httpd/auth_utils.go - Event automation
internal/common/eventmanager.go - Multi-factor auth
internal/mfa/mfa.go
Storage
- Virtual filesystem
internal/vfs/vfs.go - Local storage
internal/vfs/osfs.go - Encrypted storage
internal/vfs/cryptfs.go - Cloud storage
internal/vfs/s3fs.go - Remote SFTP
internal/vfs/sftpfs.go
Other components
- Operator
- Transfer client
Connections 32
- Operator → Service lifecycle: starts and configures
- Service lifecycle → SFTP server: starts
- Service lifecycle → FTP/S server: starts
- Service lifecycle → HTTP/S server: starts
- Service lifecycle → WebDAV server: starts
- Service lifecycle → Telemetry: starts
- Transfer client → SFTP server: connects
- Transfer client → FTP/S server: connects
- Transfer client → HTTP/S server: connects
- Transfer client → WebDAV server: connects
- HTTP/S server → WebAdmin UI: serves UI
- HTTP/S server → WebClient UI: serves UI
- HTTP/S server → REST API: routes API
- HTTP/S server → Public sharing: routes sharing
- SFTP server → Data provider: validates credentials
- FTP/S server → Data provider: authenticates users
- WebDAV server → Data provider: authenticates users
- HTTP/S server → Data provider: checks accounts
- Data provider → Accounts and policy: loads account data
- HTTP/S server → Authentication: uses auth helpers
- Authentication → Multi-factor auth: supports MFA
- Data provider → Event automation: event rules
- SFTP server → Virtual filesystem: file operations
- FTP/S server → Virtual filesystem: file operations
- HTTP/S server → Virtual filesystem: file operations
- WebDAV server → Virtual filesystem: file operations
- Virtual filesystem → Local storage: accesses
- Virtual filesystem → Encrypted storage: accesses
- Virtual filesystem → Cloud storage: accesses
- Virtual filesystem → Remote SFTP: accesses
- Transfer client → WebAdmin UI: manages server
- Transfer client → WebClient UI: browses files