config

package
v0.0.0-...-4bb11d9 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExampleConfig = `` /* 956-byte string literal not displayed */

ExampleConfig is a default template. See the systemd-install command.

View Source
var UnitFile = `` /* 395-byte string literal not displayed */

UnitFile can be written to /etc/systemd/system/co-chair.service to aid in installing co-chair as a linux service.

Functions

func SystemDInstall

func SystemDInstall(conf Config) error

SystemDInstall places a config file at /opt/co-chair/conf.toml and a systemd unit file at /etc/systemd/system/co-chair.service.

Types

type Config

type Config struct {
	// Filepath to the boltdb file.
	DBPath string `toml:"db_path"`

	// APICert and APIKey are paths to PEM-encoded TLS assets
	// for our pure gRPC api
	APICert             string `toml:"api_cert"`
	APIKey              string `toml:"api_key"`
	APIClientValidation bool   `toml:"api_client_validation"`
	APIPort             string `toml:"api_port"`

	// WebUICert and WebUIKey are paths to PEM-encoded TLS assets
	// for our GopherJS-over-websockets UI. This UI is wrapped with
	// auth0 handlers.
	WebUICert   string `toml:"webui_cert"`
	WebUIKey    string `toml:"webui_key"`
	WebUIDomain string `toml:"webui_domain"`
	WebUIPort   string `toml:"webui_port"`

	// WebAssetsPath, if provided, configures a path to a directory
	// to serve frontend assets from. If unset, use the embedded assets
	// from the frontend directory. This is useful during ui development.
	WebAssetsPath string `toml:"web_assets_path"`

	// ProxyCert and  are paths to PEM-encoded TLS assets
	// for our GopherJS-over-websockets UI. This UI is wrapped with
	// auth0 handlers.
	ProxyCert         string `toml:"proxy_cert"`
	ProxyKey          string `toml:"proxy_key"`
	ProxyPort         string `toml:"proxy_port"`
	ProxyInsecurePort string `toml:"proxy_insecure_port"`

	// Auth0 config values
	Auth0ClientID string `toml:"auth0_client_id"`
	Auth0Secret   string `toml:"auth0_secret"`
	Auth0Domain   string `toml:"auth0_domain"`
	BypassAuth0   bool   `toml:"bypass_auth0"`
}

The Config struct. Contains config values suitable for multiple processes we spin off, including the pure gRPC management API, the http(s) listener for our GopherJS Web UI (including websockets), and the listener for our proxy forwarding implementation.

func FromCLIOpts

func FromCLIOpts(ctx *cli.Context) (Config, error)

FromCLIOpts builds a Config from command line options and env vars. The urfave/cli Context gives us access to both on program start, and also allows us to set defaults.

Jump to

Keyboard shortcuts

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