serverconfig

package
v0.0.0-...-ed6f70f Latest Latest
Warning

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

Go to latest
Published: May 19, 2014 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package serverconfig provides types related to the server configuration file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Auth               string `json:"auth"`               // auth scheme and values (ex: userpass:foo:bar).
	BaseURL            string `json:"baseURL,omitempty"`  // Base URL the server advertizes. For when behind a proxy.
	Listen             string `json:"listen"`             // address (of the form host|ip:port) on which the server will listen on.
	Identity           string `json:"identity"`           // GPG identity.
	IdentitySecretRing string `json:"identitySecretRing"` // path to the secret ring file.
	// alternative source tree, to override the embedded ui and/or closure resources.
	// If non empty, the ui files will be expected at
	// sourceRoot + "/server/camlistored/ui" and the closure library at
	// sourceRoot + "/third_party/closure/lib"
	// Also used by the publish handler.
	SourceRoot string `json:"sourceRoot,omitempty"`
	OwnerName  string `json:"ownerName,omitempty"`

	// Blob storage.
	BlobPath           string `json:"blobPath,omitempty"`           // path to the directory containing the blobs.
	PackBlobs          bool   `json:"packBlobs,omitempty"`          // use diskpacked instead of the default filestorage.
	S3                 string `json:"s3,omitempty"`                 // Amazon S3 credentials: access_key_id:secret_access_key:bucket[:hostname].
	GoogleCloudStorage string `json:"googlecloudstorage,omitempty"` // Google Cloud credentials: clientId:clientSecret:refreshToken:bucket.
	GoogleDrive        string `json:"googledrive,omitempty"`        // Google Drive credentials: clientId:clientSecret:refreshToken:parentId.
	ShareHandler       bool   `json:"shareHandler,omitempty"`       // enable the share handler. If true, and shareHandlerPath is empty then shareHandlerPath will default to "/share/" when generating the low-level config.
	ShareHandlerPath   string `json:"shareHandlerPath,omitempty"`   // URL prefix for the share handler. If set, overrides shareHandler.

	// HTTPS.
	HTTPS     bool   `json:"https,omitempty"`     // enable HTTPS.
	HTTPSCert string `json:"httpsCert,omitempty"` // path to the HTTPS certificate file.
	HTTPSKey  string `json:"httpsKey,omitempty"`  // path to the HTTPS key file.

	// Index.
	MemoryIndex types.InvertedBool `json:"memoryIndex,omitempty"` // copy disk-based index to memory on start-up.
	RunIndex    types.InvertedBool `json:"runIndex,omitempty"`    // if logically false: no search, no UI, etc.
	DBName      string             `json:"dbname,omitempty"`      // name of the database for mysql, postgres, mongo.
	KVFile      string             `json:"kvIndexFile,omitempty"` // path to the kv file, for indexing with github.com/cznic/kv.
	MySQL       string             `json:"mysql,omitempty"`       // MySQL credentials (username@host:password), for indexing with MySQL.
	Mongo       string             `json:"mongo,omitempty"`       // MongoDB credentials ([username:password@]host), for indexing with MongoDB.
	PostgreSQL  string             `json:"postgres,omitempty"`    // PostgreSQL credentials (username@host:password), for indexing with PostgreSQL.
	SQLite      string             `json:"sqlite,omitempty"`      // path to the SQLite file, for indexing with SQLite.

	ReplicateTo []interface{} `json:"replicateTo,omitempty"` // NOOP for now.
	// Publish maps a URL prefix path used as a root for published paths (a.k.a. a camliRoot path), to the configuration of the publish handler that serves all the published paths under this root.
	Publish map[string]*Publish `json:"publish,omitempty"`

	// TODO(mpl): map of importers instead?
	Flickr string `json:"flickr,omitempty"` // flicker importer.
	Picasa string `json:"picasa,omitempty"` // picasa importer.
}

Config holds the values from the JSON (high-level) server config file that is exposed to users (and is by default at osutil.UserServerConfigPath). From this simpler configuration, a complete, low-level one, is generated by serverinit.genLowLevelConfig, and used to configure the various Camlistore components.

type Publish

type Publish struct {
	// Root is the permanode used as the root for all the paths served by this publish handler. The camliRoot value that is the root path for this handler is a property of this permanode.
	Root blob.Ref `json:"rootPermanode"`
	// GoTemplate is the name of the Go template file used by this publish handler to represent the data. This file should live in server/camlistored/ui/.
	GoTemplate string `json:"goTemplate"`
	// Javascript is the name of an optional javascript file used for additional features. This file should live in server/camlistored/ui/.
	Javascript string `json:"js,omitempty"`
	// Style is the name of an optional css file. This file should live in server/camlistored/ui/.
	Style string `json:"style,omitempty"`
}

Publish holds the server configuration values specific to publishing, i.e. to a publish handler.

Jump to

Keyboard shortcuts

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