Documentation
¶
Index ¶
- Constants
- Variables
- func ChannelHandler(srv *gliderssh.Server, conn *ssh.ServerConn, newChan ssh.NewChannel, ...)
- func DBInit(db *gorm.DB, aesKey string) error
- func FetchPaginated[T any](queryBuilder *gorm.DB, limit int, batchSize int, getID func(T) uint) ([]T, error)
- func FormatCount(fetched int, total int64) string
- func MigrateToGCMCipher(db *gorm.DB, aesKey string) error
- func NewLogChannel(channel ssh.Channel, writer io.WriteCloser) *logChannel
- func PasswordAuthHandler(db *gorm.DB, ...) gliderssh.PasswordHandler
- func PrivateKeyFromDB(db *gorm.DB, aesKey string) func(*gliderssh.Server) error
- func PublicKeyAuthHandler(db *gorm.DB, ...) gliderssh.PublicKeyHandler
- func ShellHandler(s gliderssh.Session, version, gitSha, gitTag string)
- func StartSessionCleanupJob(db *gorm.DB, interval time.Duration, retentionDuration time.Duration)
Constants ¶
View Source
const ( UserAdmin = "admin" UserDefault = "default" CommentDefault = "created by sshportal" )
View Source
const ( Reset = "\033[0m" Bold = "\033[1m" FgGreen = "\033[32m" FgRed = "\033[31m" FgMag = "\033[35m" )
View Source
const ( FlagCommentName = "comment" FlagCommentUsage = "Adds a comment" FlagLatestName = "latest" FlagQuietUsage = "Only display IDs" FlagQuietName = "quiet" FlagInspectName = "inspect" UserAdminName = "admin" FlagLimitName = "limit" FlagLimitUsage = "Limit the number of item to display (0 for no limit)" FlagLimitDefault = 250 )
View Source
const ACLHookTimeout = 2 * time.Second
ACLHookTimeout is timeout for external ACL hook execution
Variables ¶
View Source
var DefaultChannelHandler gliderssh.ChannelHandler = func(srv *gliderssh.Server, conn *ssh.ServerConn, newChan ssh.NewChannel, ctx gliderssh.Context) {}
Functions ¶
func ChannelHandler ¶
func ChannelHandler(srv *gliderssh.Server, conn *ssh.ServerConn, newChan ssh.NewChannel, ctx gliderssh.Context)
func FetchPaginated ¶ added in v1.31.0
func FetchPaginated[T any]( queryBuilder *gorm.DB, limit int, batchSize int, getID func(T) uint, ) ([]T, error)
FetchPaginated retrieves records in batches, using cursor-based pagination on the ID (avoids costly OFFSETs on large tables). limit == 0 will fetch all data (with batchSize). limit > 0 will stop as soon as `limit` results are fetched.
func FormatCount ¶ added in v1.31.0
func NewLogChannel ¶
func NewLogChannel(channel ssh.Channel, writer io.WriteCloser) *logChannel
func PasswordAuthHandler ¶
func PrivateKeyFromDB ¶
func PublicKeyAuthHandler ¶
func ShellHandler ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.