defaults

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentVersion = 0

CurrentVersion is the current version of brig's config

Variables

View Source
var Defaults = DefaultsV0

Defaults is the default validation for brig

View Source
var DefaultsV0 = config.DefaultMapping{
	"daemon": config.DefaultMapping{
		"port": config.DefaultEntry{
			Default:      6666,
			NeedsRestart: true,
			Docs:         "Port of the daemon process",
			Validator:    config.IntRangeValidator(1, 655356),
		},
	},
	"gateway": config.DefaultMapping{
		"enabled": config.DefaultEntry{
			Default:      false,
			NeedsRestart: false,
			Docs:         "Wether the gateway should be running",
		},
		"port": config.DefaultEntry{
			Default:      5000,
			NeedsRestart: false,
			Docs:         "On what port the gateway runs on",
		},
		"folders": config.DefaultEntry{
			Default:      []string{"/"},
			NeedsRestart: false,
			Docs:         "What folders may be accessed by the gateway",
		},
		"cert": config.DefaultMapping{
			"certfile": config.DefaultEntry{
				Default:      "",
				NeedsRestart: false,
				Docs:         "Path to an existing certificate file",
			},
			"keyfile": config.DefaultEntry{
				Default:      "",
				NeedsRestart: false,
				Docs:         "Path to an existing key file",
			},
			"domain": config.DefaultEntry{
				Default:      "",
				NeedsRestart: false,
				Docs:         "What domain to use for getting a certificate from LetsEncrypt",
			},
			"redirect": config.DefaultMapping{
				"enabled": config.DefaultEntry{
					Default:      true,
					NeedsRestart: false,
					Docs:         "Wether http request should be forwarded to https",
				},
				"http_port": config.DefaultEntry{
					Default:      5001,
					NeedsRestart: false,
					Docs:         "What port the http redirect server should run on",
				},
			},
		},
		"auth": config.DefaultMapping{
			"enabled": config.DefaultEntry{
				Default:      false,
				NeedsRestart: false,
				Docs:         "Wether the gateway should be running",
			},
			"user": config.DefaultEntry{
				Default:      "",
				NeedsRestart: false,
				Docs:         "User used for basic HTTP auth",
			},
			"pass": config.DefaultEntry{
				Default:      "",
				NeedsRestart: false,
				Docs:         "Password used for basic HTTP auth",
			},
		},
	},
	"fs": config.DefaultMapping{
		"sync": config.DefaultMapping{
			"ignore_removed": config.DefaultEntry{
				Default:      false,
				NeedsRestart: false,
				Docs:         "Do not remove what the remote removed",
			},
			"ignore_moved": config.DefaultEntry{
				Default:      false,
				NeedsRestart: false,
				Docs:         "Do not move what the remote moved",
			},
			"conflict_strategy": config.DefaultEntry{
				Default:      "marker",
				NeedsRestart: false,
				Validator: config.EnumValidator(
					"marker", "ignore",
				),
			},
		},
		"compress": config.DefaultMapping{
			"default_algo": config.DefaultEntry{
				Default:      "snappy",
				NeedsRestart: false,
				Docs:         "What compression algorithm to use by default",
				Validator: config.EnumValidator(
					"snappy", "lz4", "none",
				),
			},
		},
		"pre_cache": config.DefaultMapping{
			"enabled": config.DefaultEntry{
				Default:      true,
				NeedsRestart: false,
				Docs:         "pre-cache pinned files",
			},
		},
		"autocommit": config.DefaultMapping{
			"enabled": config.DefaultEntry{
				Default:      true,
				NeedsRestart: false,
				Docs:         "Enable the autocommit logic",
			},
			"interval": config.DefaultEntry{
				Default:      "5m",
				NeedsRestart: false,
				Docs:         "In what interval to make automatic commits",
				Validator:    config.DurationValidator(),
			},
		},
	},
	"repo": config.DefaultMapping{
		"current_user": config.DefaultEntry{
			Default:      "",
			NeedsRestart: true,
			Docs:         "The repository owner that is published to the outside",
		},
		"password_command": config.DefaultEntry{
			Default:      "",
			NeedsRestart: false,
			Docs:         "If set, the repo password is taken from stdout of this command",
		},
	},
	"mounts": config.DefaultMapping{
		"__many__": config.DefaultMapping{
			"path": config.DefaultEntry{
				Default:      "",
				NeedsRestart: true,
				Docs:         "The place where the mount path can be found",
			},
			"read_only": config.DefaultEntry{
				Default:      false,
				NeedsRestart: true,
				Docs:         "Wether this mount should be done read-only",
			},
			"root": config.DefaultEntry{
				Default:      "/",
				NeedsRestart: true,
				Docs:         "The root of the mount",
			},
		},
	},
	"data": config.DefaultMapping{
		"ipfs": config.DefaultMapping{
			"path": config.DefaultEntry{
				Default:      "",
				NeedsRestart: true,
				Docs:         "Root directory of the ipfs repository",
			},
		},
	},
}

DefaultsV0 is the default config validation for brig

Functions

func OpenMigratedConfig

func OpenMigratedConfig(path string) (*config.Config, error)

OpenMigratedConfig takes the config.yml at path and loads it. If required, it also migrates the config structure to the newest version - brig can always rely on the latest config keys to be present.

Types

This section is empty.

Jump to

Keyboard shortcuts

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