Documentation
¶
Overview ¶
Package paths returns platform and user-specific default paths to Tailscale files and directories.
Index ¶
- Variables
- func DefaultTailscaledSocket() string
- func DefaultTailscaledStateDir() string
- func DefaultTailscaledStateFile() string
- func LegacyStateFilePath() string
- func MakeAutomaticStateDir() bool
- func MkStateDir(dirPath string) error
- func TryConfigFileMigration(logf logger.Logf, oldFile, newFile string) string
Constants ¶
This section is empty.
Variables ¶
AppSharedDir is a string set by the iOS or Android app on start containing a directory we can read/write in.
Functions ¶
func DefaultTailscaledSocket ¶
func DefaultTailscaledSocket() string
DefaultTailscaledSocket returns the path to the tailscaled Unix socket or the empty string if there's no reasonable default.
func DefaultTailscaledStateDir ¶ added in v1.86.0
func DefaultTailscaledStateDir() string
DefaultTailscaledStateDir returns the default state directory to use for tailscaled, for use when the user provided neither a state directory or state file path to use.
It returns the empty string if there's no reasonable default.
func DefaultTailscaledStateFile ¶
func DefaultTailscaledStateFile() string
DefaultTailscaledStateFile returns the default path to the tailscaled state file, or the empty string if there's no reasonable default value.
func LegacyStateFilePath ¶ added in v1.18.0
func LegacyStateFilePath() string
LegacyStateFilePath returns the legacy path to the state file when it was stored under the current user's %LocalAppData%.
It is only called on Windows.
func MakeAutomaticStateDir ¶ added in v1.86.0
func MakeAutomaticStateDir() bool
MakeAutomaticStateDir reports whether the platform automatically creates the state directory for tailscaled when it's absent.
func MkStateDir ¶ added in v1.14.4
MkStateDir ensures that dirPath, the daemon's configuration directory containing machine keys etc, both exists and has the correct permissions. We want it to only be accessible to the user the daemon is running under.
func TryConfigFileMigration ¶ added in v1.14.4
TryConfigFileMigration carefully copies the contents of oldFile to newFile, returning the path which should be used to read the config.
- if newFile already exists, don't modify it just return its path
- if neither oldFile nor newFile exist, return newFile for a fresh default config to be written to.
- if oldFile exists but copying to newFile fails, return oldFile so there will at least be some config to work with.
Types ¶
This section is empty.