diff --git a/.env.example b/.env.example index 1b2ea06..891e7f5 100644 --- a/.env.example +++ b/.env.example @@ -26,12 +26,16 @@ FORCE_GRAYSCALE=false # Max rendered width/height in characters. MAX_DIMENSION=512 +# Max rendered area (columns x rows); larger terminals are scaled down. +MAX_TERMINAL_CELLS=256000 # Memory budget in MB for the rendered-frame cache (0 disables caching). RENDER_CACHE_MB=256 # Go soft memory limit; set below your container limit to avoid OOM kills. GOMEMLIMIT=1GiB +# Docker Compose container memory limit. Leave headroom for mapped frame files. +MEMORY_LIMIT=2g # Connection limits. New connections over a limit are dropped immediately. # Max simultaneous connections from a single client IP. @@ -43,6 +47,8 @@ MAX_TOTAL_CONNECTIONS=1000 MAX_AUTH_ATTEMPTS=3 # SSH handshake deadline in ms (0 to disable). HANDSHAKE_TIMEOUT=30000 +# Maximum session lifetime in ms (0 to disable). +SESSION_TIMEOUT=600000 # Log attempted usernames/passwords. LOG_CREDENTIALS=true diff --git a/docker-compose.yaml b/docker-compose.yaml index ebc4864..6fa290d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,6 +3,7 @@ services: image: ghcr.io/yuzuzensai/trollssh:v1.0.1 container_name: trollssh restart: unless-stopped + mem_limit: ${MEMORY_LIMIT:-2g} ports: - "22:22" env_file: