Documentation
¶
Overview ¶
Package config holds hopsesh's user configuration and state locations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
func Dir() string
Dir is the configuration directory: $XDG_CONFIG_HOME/hopsesh or ~/.config/hopsesh on macOS and Linux, %APPDATA%\hopsesh on Windows.
Types ¶
type Config ¶
type Config struct {
ReposDir string `toml:"repos_dir"` // where clones go; default ~/git
Layout string `toml:"layout"` // flat | ghq
LivePolicy string `toml:"live_policy"` // handoff | fork
RemoteCtl bool `toml:"remote_control"`
// UpdateCheck is "on" or "off" once the person has answered whether the app may
// look for new releases once a day ("" = not asked yet).
UpdateCheck string `toml:"update_check,omitempty"`
Hosts []Host `toml:"hosts"`
}
Config is the user's configuration file.
func (*Config) UpsertHost ¶
UpsertHost adds or updates a host by name, keeping consent unless explicitly changed.
type Host ¶
type Host struct {
Name string `toml:"name"` // label shown to the user, e.g. "studio"
Destination string `toml:"destination"` // what to pass to ssh: alias, user@host or host
Via string `toml:"via"` // tailscale | ssh-config | manual (or a "+" combination)
Allowed bool `toml:"allowed"` // the user consented to hopsesh connecting
OS string `toml:"os,omitempty"`
// TailscaleName is the machine's MagicDNS name, used when Destination's own host
// name does not resolve (e.g. an alias pointing at a .local name on another network).
TailscaleName string `toml:"tailscale_name,omitempty"`
Helper bool `toml:"helper,omitempty"` // the user allowed deploying the remote helper
// HelperSHA256 pins the helper binary hopsesh uploaded; a helper that no longer
// matches is not run.
HelperSHA256 string `toml:"helper_sha256,omitempty"`
}
Host is one machine hopsesh knows about.