config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

internal/config/cloudsync.go

internal/config/config.go

internal/config/defaults.go

internal/config/tailscale.go

Index

Constants

View Source
const (
	DefaultPort         = 8750
	DefaultAdminPort    = 8751
	DefaultBind         = "tailscale"
	DefaultTTL          = 2 * time.Hour
	DefaultIdleShutdown = 30 * time.Minute
)

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() string

DefaultConfigPath returns %APPDATA%\ghosthost\config.toml (or platform equivalent).

func DetectCloudSync

func DetectCloudSync(dataDir string) string

DetectCloudSync returns a non-empty reason string if dataDir appears to live inside a cloud-sync root (OneDrive, Dropbox, Google Drive). Heuristic — used to warn, not to hard-fail.

func Save

func Save(path string, c Config) error

Save writes the Config to path.

Types

type Config

type Config struct {
	Host         string        `toml:"host"`
	Bind         string        `toml:"bind"`
	Port         int           `toml:"port"`
	AdminPort    int           `toml:"admin_port"`
	DataDir      string        `toml:"data_dir"`
	DefaultTTL   time.Duration `toml:"default_ttl"`
	IdleShutdown time.Duration `toml:"idle_shutdown"`
	TLSCert      string        `toml:"tls_cert"`
	TLSKey       string        `toml:"tls_key"`
}

Config is the on-disk configuration.

func Load

func Load(path string) (Config, error)

Load reads a Config from path. If the file does not exist, a template is written and an error is returned so the CLI can surface the condition.

func Merge

func Merge(base, override Config) Config

Merge applies override's non-zero fields over base.

Jump to

Keyboard shortcuts

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