# Functions
DefaultTailscaledSocket returns the path to the tailscaled Unix socket or the empty string if there's no reasonable default.
DefaultTailscaledStateFile returns the default path to the tailscaled state file, or the empty string if there's no reasonable default value.
LegacyStateFilePath returns the legacy path to the state file when it was stored under the current user's %LocalAppData%.
MkStateDir ensures that dirPath, the daemon's configuration directory containing machine keys etc, both exists and has the correct permissions.
TryConfigFileMigration carefully copies the contents of oldFile to newFile, returning the path which should be used to read the config.
# Variables
AppSharedDir is a string set by the iOS or Android app on start containing a directory we can read/write in.