mirror of
https://github.com/YuzuZensai/TrollSSH.git
synced 2026-09-13 22:09:04 +00:00
🐛 fix: harden connection lifecycle and add session safeguards
This commit is contained in:
@@ -28,6 +28,8 @@ type Config struct {
|
||||
MaxAuthAttempts int
|
||||
HandshakeTimeout time.Duration
|
||||
MaxDimension int
|
||||
MaxTerminalCells int
|
||||
SessionTimeout time.Duration
|
||||
RenderCacheMB int
|
||||
BrightnessThreshold int
|
||||
Charset string
|
||||
@@ -126,6 +128,8 @@ func loadConfig() Config {
|
||||
MaxAuthAttempts: envInt("MAX_AUTH_ATTEMPTS", 6, 1, maxInt),
|
||||
HandshakeTimeout: envDurationMs("HANDSHAKE_TIMEOUT", 10*time.Second),
|
||||
MaxDimension: envInt("MAX_DIMENSION", 512, 1, 4096),
|
||||
MaxTerminalCells: envInt("MAX_TERMINAL_CELLS", 500*512, 1, maxInt),
|
||||
SessionTimeout: envDurationMs("SESSION_TIMEOUT", 10*time.Minute),
|
||||
RenderCacheMB: envInt("RENDER_CACHE_MB", 256, 0, maxInt),
|
||||
BrightnessThreshold: envInt("BRIGHTNESS_THRESHOLD", 40, 0, 100),
|
||||
Charset: envString("CHARSET", "detailed"),
|
||||
|
||||
Reference in New Issue
Block a user