ui

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

Package ui provides common functions and interfaces for the sandboxed-tor-browser user interfaces.

Index

Constants

View Source
const (
	// DefaultBridgeTransport is the decault bridge transport when using internal
	// bridges.
	DefaultBridgeTransport = "obfs4"
)

Variables

View Source
var (
	// BundleChannels is the map of Tor Browser architectures to channels.
	BundleChannels map[string][]string

	// BundleLocales is the map of Tor Browser channels to locales.
	BundleLocales map[string][]string

	// Bridges is the map of transports to Bridge lines.
	Bridges map[string][]string

	// Version is the version of `sandboxed-tor-browser`.
	Version string

	// Revision is the git commit of `sandboxed-tor-browser`.
	Revision string
)

Functions

func ValidateBridgeLines

func ValidateBridgeLines(ls string) (string, error)

ValidateBridgeLines validates and sanitizes bridge lines.

Types

type Common

type Common struct {
	Cfg     *config.Config
	Manif   *config.Manifest
	Sandbox *process.Process

	PendingUpdate *installer.UpdateEntry

	ForceInstall   bool
	ForceConfig    bool
	NoKillTor      bool
	AdvancedConfig bool
	PrintVersion   bool
	WasHardened    bool
	// contains filtered or unexported fields
}

Common holds ui implementation agnostic state.

func (*Common) CheckUpdate

func (c *Common) CheckUpdate(async *Async) *installer.UpdateEntry

CheckUpdate queries the update server to see if an update for the current bundle is available.

func (*Common) DoInstall

func (c *Common) DoInstall(async *Async)

DoInstall executes the install step based on the configured parameters. This is blocking and should be run from a go routine, with the appropriate Async structure used to communicate.

func (*Common) DoLaunch

func (c *Common) DoLaunch(async *Async, checkUpdates bool)

DoLaunch executes the launch step based on the configured parameters. This is blocking and should be run from a go routine, with the appropriate Async structure used to communicate.

func (*Common) FetchUpdate

func (c *Common) FetchUpdate(async *Async, patch *installer.Patch) []byte

FetchUpdate downloads the update specified by the patch over tor, and validates it with the hash in the patch datastructure, and the known MAR signing keys.

func (*Common) Init

func (c *Common) Init() error

Init initializes the common interface state.

func (*Common) NeedsInstall

func (c *Common) NeedsInstall() bool

NeedsInstall returns true if the bundle needs to be (re)installed.

func (*Common) Run

func (c *Common) Run() error

Run handles initiailzing the at-runtime state.

func (*Common) Term

func (c *Common) Term()

Term handles the common interface state cleanup, prior to termination.

type UI

type UI interface {
	// Run runs the user interface.
	Run() error

	// Cleanup cleans up the user interface prior to termination.
	Term()
}

UI is a user interface implementation.

Directories

Path Synopsis
Package async provides an async task struct to allow the UI to run background tasks.
Package async provides an async task struct to allow the UI to run background tasks.
Package config handles the launcher configuration.
Package config handles the launcher configuration.
Package gtk implements a Gtk+ user interface.
Package gtk implements a Gtk+ user interface.
Package notify interfaces with the Destop Notification daemon, as defined by the desktop notifications spec, via the libnotify library.
Package notify interfaces with the Destop Notification daemon, as defined by the desktop notifications spec, via the libnotify library.

Jump to

Keyboard shortcuts

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