config

package
v1.0.40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path() string

Path returns the default config file path.

func RemoveKeys added in v1.0.1

func RemoveKeys(path string, keys ...string) error

RemoveKeys removes all lines matching the given keys from the config file.

func SetKey

func SetKey(path, key, val string) error

SetKey updates or appends a key=value pair in the config file. Creates the file if it doesn't exist.

Types

type Config

type Config struct {
	PrefixKey       byte   // prefix key byte (default: 0x1d = Ctrl-])
	Shell           string // shell to spawn (default: $SHELL or /bin/sh)
	ScrollbackLines int    // VT scrollback lines (default: 10000)
	MaxSessions     int    // max concurrent sessions (default: 64)
	Mouse           bool   // enable mouse support (default: true)

	// Rendering
	RenderCoalesceMs int // render coalesce delay in ms (default: 2)

	// Network defaults
	SSHAddr string // default SSH listen address (default: :2222)
	WebAddr string // default web listen address (default: :7680)

	// Server mode
	Persistent bool // keep running even when all sessions/clients disconnect

	// Relay
	RelayHost    string // API server host (default: unixshells.com)
	RelayNode    string // QUIC relay hostname (regional, e.g. us.unixshells.com)
	RelayUser    string // relay account username
	RelayDevice  string // device name (default: OS hostname)
	RelayEnabled bool   // whether relay is enabled
	RelayCAFile  string // CA certificate file for relay TLS verification

	APIEnabled bool // whether API access (send/screen) is enabled
}

Config holds all configurable latch settings.

func Default

func Default() *Config

Default returns a Config with default values.

func Load

func Load(path string) (*Config, error)

Load reads config from the given path. Missing file returns defaults.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL