install

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2017 License: BSD-3-Clause, BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ComponentNames are all the valid component names

Functions

func AfterUpdateApply added in v1.0.17

func AfterUpdateApply(context Context, willRestart bool, force bool, log Log) error

AfterUpdateApply runs after an update has been applied

func AppBundleForPath added in v1.0.17

func AppBundleForPath() (string, error)

AppBundleForPath returns path to app bundle

func AutoInstall

func AutoInstall(context Context, binPath string, force bool, timeout time.Duration, log Log) (newProc bool, err error)

AutoInstall runs the auto install

func AutoInstallWithStatus

func AutoInstallWithStatus(context Context, binPath string, force bool, timeout time.Duration, log Log) keybase1.InstallResult

AutoInstallWithStatus runs the auto install and returns a result

func BinPath added in v1.0.17

func BinPath() (string, error)

BinPath returns path to the keybase executable

func CheckIfValidLocation

func CheckIfValidLocation() *keybase1.Error

CheckIfValidLocation checks if the current environment is running from a valid location. For example, this will return an error if this isn't running from /Applications/Keybase.app on MacOS.

func DefaultKBFSLabel

func DefaultKBFSLabel(runMode libkb.RunMode) string

DefaultKBFSLabel returns the default label for KBFS service in launchd

func DefaultLaunchdEnvVars

func DefaultLaunchdEnvVars(label string) []launchd.EnvVar

DefaultLaunchdEnvVars returns default environment vars for launchd

func DefaultServiceLabel

func DefaultServiceLabel(runMode libkb.RunMode) string

DefaultServiceLabel returns the default label for Keybase service in launchd

func DefaultUpdaterLabel added in v1.0.17

func DefaultUpdaterLabel(runMode libkb.RunMode) string

DefaultUpdaterLabel returns the default label for the update service in launchd

func Install

func Install(context Context, binPath string, sourcePath string, components []string, force bool, timeout time.Duration, log Log) keybase1.InstallResult

Install installs specified components

func InstallKBFS added in v1.0.18

func InstallKBFS(context Context, binPath string, force bool, timeout time.Duration, log Log) error

InstallKBFS installs the KBFS launchd service

func InstallKBNM added in v1.0.21

func InstallKBNM(context Context, binPath string, log Log) error

InstallKBNM installs the Keybase NativeMessaging whitelist

func InstallLogPath added in v1.0.18

func InstallLogPath() (string, error)

InstallLogPath doesn't exist on darwin as an independent log file (see desktop app log)

func InstallService added in v1.0.18

func InstallService(context Context, binPath string, force bool, timeout time.Duration, log Log) error

InstallService installs the launchd service

func InstallUpdater added in v1.0.18

func InstallUpdater(context Context, keybaseBinPath string, force bool, timeout time.Duration, log Log) error

InstallUpdater installs the updater launchd service

func IsInUse added in v1.0.16

func IsInUse(mountDir string, log Log) bool

IsInUse returns true if the mount is in use. This may be used by the updater to determine if it's safe to apply an update and restart.

func KBFSBinPath added in v1.0.17

func KBFSBinPath(runMode libkb.RunMode, binPath string) (string, error)

KBFSBinPath returns the path to the KBFS executable. If binPath (directory) is specifed, it will override the default (which is in the same directory where the keybase executable is).

func KBFSBundleVersion

func KBFSBundleVersion(context Context, binPath string) (string, error)

KBFSBundleVersion returns the bundle (not installed) version for KBFS

func KBFSServiceStatus

func KBFSServiceStatus(context Context, label string, wait time.Duration, log Log) (status keybase1.ServiceStatus)

KBFSServiceStatus returns service status for KBFS

func KeybaseFuseStatus

func KeybaseFuseStatus(bundleVersion string, log Log) keybase1.FuseStatus

KeybaseFuseStatus returns Fuse status

func KeybaseFuseStatusForAppBundle

func KeybaseFuseStatusForAppBundle(appPath string, log Log) (keybase1.FuseStatus, error)

KeybaseFuseStatusForAppBundle returns Fuse status for application at appPath

func KeybaseServiceStatus

func KeybaseServiceStatus(context Context, label string, wait time.Duration, log Log) (status keybase1.ServiceStatus)

KeybaseServiceStatus returns service status for Keybase service

func ListServices

func ListServices(context Context, wait time.Duration, log Log) (*keybase1.ServicesStatus, error)

ListServices returns status for all services

func OSVersion

func OSVersion() (semver.Version, error)

OSVersion returns the OS version

func ResolveInstallStatus

func ResolveInstallStatus(version string, bundleVersion string, lastExitStatus string, log Log) (installStatus keybase1.InstallStatus, installAction keybase1.InstallAction, status keybase1.Status)

ResolveInstallStatus will determine necessary install actions for the current environment

func RunApp added in v1.0.17

func RunApp(context Context, log Log) error

RunApp starts the app

func ServiceStatus

func ServiceStatus(context Context, label ServiceLabel, wait time.Duration, log Log) (*keybase1.ServiceStatus, error)

ServiceStatus returns status for a service named by label

func SystemLogPath added in v1.0.18

func SystemLogPath() string

SystemLogPath is where privileged keybase processes log to on darwin

func TerminateApp added in v1.0.17

func TerminateApp(context Context, log Log) error

TerminateApp will stop the Keybase (UI) app

func Uninstall

func Uninstall(context Context, components []string, log Log) keybase1.UninstallResult

Uninstall uninstalls all keybase services

func UninstallKBFS added in v1.0.16

func UninstallKBFS(runMode libkb.RunMode, mountDir string, forceUnmount bool, removeMountDir bool, log Log) error

UninstallKBFS uninstalls all KBFS services, unmounts and optionally removes the mount directory

func UninstallKBFSOnStop added in v1.0.18

func UninstallKBFSOnStop(context Context, log Log) error

UninstallKBFSOnStop removes KBFS services and unmounts and removes /keybase from the system

func UninstallKBFSServices added in v1.0.18

func UninstallKBFSServices(runMode libkb.RunMode, log Log) error

UninstallKBFSServices removes KBFS service (including homebrew)

func UninstallKBNM added in v1.0.21

func UninstallKBNM(log Log) error

UninstallKBNM removes the Keybase NativeMessaging whitelist

func UninstallKeybaseServices added in v1.0.18

func UninstallKeybaseServices(runMode libkb.RunMode, log Log) error

UninstallKeybaseServices removes the keybase service (includes homebrew)

func UninstallUpdaterService added in v1.0.18

func UninstallUpdaterService(runMode libkb.RunMode, log Log) error

UninstallUpdaterService removes updater launchd service

func UpdaterBinPath added in v1.0.17

func UpdaterBinPath() (string, error)

UpdaterBinPath returns the path to the updater executable, by default is in the same directory as the keybase executable.

func UpdaterServiceStatus added in v1.0.17

func UpdaterServiceStatus(context Context, label string) keybase1.ServiceStatus

UpdaterServiceStatus returns service status for the Updater service

Types

type ComponentName

type ComponentName string

ComponentName defines a component name

const (
	// ComponentNameCLI is the command line component
	ComponentNameCLI ComponentName = "cli"
	// ComponentNameService is the service component
	ComponentNameService ComponentName = "service"
	// ComponentNameKBFS is the KBFS component
	ComponentNameKBFS ComponentName = "kbfs"
	// ComponentNameKBNM is the Keybase NativeMessaging client component
	ComponentNameKBNM ComponentName = "kbnm"
	// ComponentNameUpdater is the updater component
	ComponentNameUpdater ComponentName = "updater"
	// ComponentNameApp is the UI app
	ComponentNameApp ComponentName = "app"
	// ComponentNameFuse is the Fuse component
	ComponentNameFuse ComponentName = "fuse"
	// ComponentNameHelper is the privileged helper tool
	ComponentNameHelper ComponentName = "helper"
	// ComponentNameMountDir is the mount directory
	ComponentNameMountDir ComponentName = "mountdir"
	// ComponentNameUnknown is placeholder for unknown components
	ComponentNameUnknown ComponentName = "unknown"
)

func ComponentNameFromString

func ComponentNameFromString(s string) ComponentName

ComponentNameFromString returns ComponentName from a string

func (ComponentName) Description added in v1.0.17

func (c ComponentName) Description() string

Description returns description for component name

func (ComponentName) String

func (c ComponentName) String() string

String returns string for ComponentName

type Context

type Context interface {
	GetConfigDir() string
	GetCacheDir() string
	GetRuntimeDir() string
	GetMountDir() (string, error)
	GetLogDir() string
	GetRunMode() libkb.RunMode
	GetServiceInfoPath() string
	GetKBFSInfoPath() string
}

Context is the enviroment for this package

type Log added in v1.0.17

type Log interface {
	Debug(s string, args ...interface{})
	Info(s string, args ...interface{})
	Warning(s string, args ...interface{})
	Errorf(s string, args ...interface{})
}

Log is the logging interface for this package

type ServiceLabel

type ServiceLabel string

ServiceLabel is an identifier string for a service

const (
	// AppServiceLabel is the service label for the keybase launchd service in Keybase.app
	AppServiceLabel ServiceLabel = "keybase.service"
	// AppKBFSLabel is the service label for the kbfs launchd service in Keybase.app
	AppKBFSLabel ServiceLabel = "keybase.kbfs"
	// AppUpdaterLabel is the service label for the updater launchd service in Keybase.app
	AppUpdaterLabel ServiceLabel = "keybase.updater"
	// BrewServiceLabel is the service label for the updater launchd service in homebrew
	BrewServiceLabel ServiceLabel = "homebrew.mxcl.keybase"
	// BrewKBFSLabel is the service label for the kbfs launchd service in homebrew
	BrewKBFSLabel ServiceLabel = "homebrew.mxcl.kbfs"
	// UnknownLabel is an empty/unknown label
	UnknownLabel ServiceLabel = ""
)

func NewServiceLabel

func NewServiceLabel(s string) (ServiceLabel, error)

NewServiceLabel constructs a service label

func (ServiceLabel) ComponentName

func (l ServiceLabel) ComponentName() ComponentName

ComponentName returns the component name for a service label

func (ServiceLabel) String added in v1.0.17

func (l ServiceLabel) String() string

Jump to

Keyboard shortcuts

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