Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Addr string // ":2222"
HostKeyPath string // path to ed25519 host key (auto-created if missing)
APIBase string // override https://api.kyc.rip
APIKey string // optional X-API-Key
MaxSessions int // global cap (default 200)
MaxPerIP int // per-source-IP cap (default 3)
IdleTimeout time.Duration // session idle timeout (default 90s)
HandshakeWindow time.Duration // hard cap on time-to-PTY (default 8s)
Banner string // pre-PTY banner text
}
Config controls listener and runtime caps.
type HealthSnapshot ¶
type HealthSnapshot struct {
OK bool `json:"ok"`
Version string `json:"version,omitempty"`
UptimeSec int64 `json:"uptime_sec"`
Active int64 `json:"active_sessions"`
TotalConns int64 `json:"total_conns"`
RejectedPty int64 `json:"rejected_pty_or_exec"`
RejectedCaps int64 `json:"rejected_caps"`
Fingerprint string `json:"host_key_fingerprint,omitempty"`
}
HealthSnapshot is the JSON shape returned by the /healthz and /metrics endpoints. Stable enough to point monitoring at.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps a gliderlabs/ssh server with hard caps.
func (*Server) Fingerprint ¶
Fingerprint returns the SHA256 fingerprint of the host key.
func (*Server) ListenAndServe ¶
ListenAndServe blocks until ctx is cancelled.
func (*Server) ServeHealth ¶
ServeHealth runs an HTTP listener with /healthz and /metrics. Intended for loopback only (e.g. 127.0.0.1:9090). Returns when ctx is cancelled or ListenAndServe fails. Logs but does not panic.
func (*Server) Snapshot ¶
func (s *Server) Snapshot() HealthSnapshot
Snapshot returns the current health state. Safe to call concurrently.
Click to show internal directories.
Click to hide internal directories.