config

package
v0.1.13-rc8 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultServerFilters = []string{
	"/ip4/10.0.0.0/ipcidr/8",
	"/ip4/100.64.0.0/ipcidr/10",
	"/ip4/169.254.0.0/ipcidr/16",
	"/ip4/172.16.0.0/ipcidr/12",
	"/ip4/192.0.0.0/ipcidr/24",
	"/ip4/192.0.0.0/ipcidr/29",
	"/ip4/192.0.0.8/ipcidr/32",
	"/ip4/192.0.0.170/ipcidr/32",
	"/ip4/192.0.0.171/ipcidr/32",
	"/ip4/192.0.2.0/ipcidr/24",
	"/ip4/192.168.0.0/ipcidr/16",
	"/ip4/198.18.0.0/ipcidr/15",
	"/ip4/198.51.100.0/ipcidr/24",
	"/ip4/203.0.113.0/ipcidr/24",
	"/ip4/240.0.0.0/ipcidr/4",
	"/ip6/100::/ipcidr/64",
	"/ip6/2001:2::/ipcidr/48",
	"/ip6/2001:db8::/ipcidr/32",
	"/ip6/fc00::/ipcidr/7",
	"/ip6/fe80::/ipcidr/10",
}

DefaultServerFilters has is a list of IPv4 and IPv6 prefixes that are private, local only, or unrouteable. according to https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml and https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml

View Source
var TextileBootstrapAddresses = []string{
	"/ip4/18.144.12.135/tcp/4001/ipfs/12D3KooWGBW3LfzypK3zgV4QxdPyUm3aEuwBDMKRRpCPm9FrJvar",
	"/ip4/13.57.23.210/tcp/4001/ipfs/12D3KooWQue2dSRqnZTVvikoxorZQ5Qyyug3hV65rYnWYpYsNMRE",
	"/ip4/18.221.167.133/tcp/4001/ipfs/12D3KooWERmHT6g4YkrPBTmhfDLjfi8b662vFCfvBXqzcdkPGQn1",
	"/ip4/18.224.173.65/tcp/4001/ipfs/12D3KooWLh9Gd4C3knv4XqCyCuaNddfEoSLXgekVJzRyC5vsjv5d",
	"/ip4/35.180.16.103/tcp/4001/ipfs/12D3KooWDhSfXZCBVAK6SNQu7h6mfGCBJtjMS44PW5YA5YCjVmjB",
	"/ip4/35.180.35.45/tcp/4001/ipfs/12D3KooWBCZEDkZ2VxdNYKLLUACWbXMvW9SpVbbvoFR9CtH4qJv9",
	"/ip4/13.250.53.27/tcp/4001/ipfs/12D3KooWQ5MR9Ugz9HkVU3fYFbiWbQR4jxKJB66JoSY7nP5ShsqQ",
	"/ip4/3.1.49.130/tcp/4001/ipfs/12D3KooWDWJ473M3fXMEcajbaGtqgr6i6SvDdh5Ru9i5ZzoJ9Qy8",
}

TextileBootstrapAddresses are the addresses of cafe nodes run by the Textile team.

Functions

func InitIpfs added in v0.1.10

func InitIpfs(identity native.Identity, mobile bool, server bool) (*native.Config, error)

InitIpfs create the IPFS config file

func TextileBootstrapPeers added in v0.1.10

func TextileBootstrapPeers() ([]native.BootstrapPeer, error)

TextileBootstrapPeers returns the (parsed) set of Textile bootstrap peers.

func Write added in v0.1.10

func Write(repoPath string, conf *Config) error

Write replaces the on-disk version of config with the given one

Types

type API added in v0.1.10

type API struct {
	HTTPHeaders map[string][]string // HTTP headers to return with the API.
	SizeLimit   int64               // Maximum file size limit to accept for POST requests in bytes
}

API settings

type Account added in v0.1.10

type Account struct {
	Address string // public key (seed is stored in the _possibly_ encrypted datastore)
	Thread  string // thread id of the default account thread used for sync between account peers
}

Account store public account info

type Addresses added in v0.1.10

type Addresses struct {
	API       string // bind address of the local REST API
	CafeAPI   string // bind address of the cafe REST API
	Gateway   string // bind address of the IPFS object gateway
	Profiling string // bind address of the profiling API
}

Addresses stores the (string) bind addresses for the node.

type Cafe added in v0.1.10

type Cafe struct {
	Host   CafeHost
	Client CafeClient
}

Cafe settings

type CafeClient added in v0.1.10

type CafeClient struct {
	Mobile MobileCafeClient
}

CafeClient settings

type CafeHost added in v0.1.10

type CafeHost struct {
	Open        bool   // When true, other peers can register with this node for cafe services.
	URL         string // Override the resolved URL of this cafe, useful for load HTTPS and/or load balancers
	NeighborURL string // Specifies the URL of a secondary cafe. Must return cafe info.
	SizeLimit   int64  // Maximum file size limit to accept for POST requests in bytes.
}

TODO: add some more knobs: max num. clients, max client msg age, inbox size, etc.

type Config added in v0.1.10

type Config struct {
	Account   Account   // local node's account (public info only)
	Addresses Addresses // local node's addresses
	API       API       // local node's API settings
	Logs      Logs      // local node's log settings
	Threads   Threads   // local node's thread settings
	IsMobile  bool      // local node is setup for mobile
	IsServer  bool      // local node is setup for a server w/ a public IP
	Cafe      Cafe      // local node cafe settings
}

Config is used to load textile config files.

func Init

func Init() (*Config, error)

Init returns the default textile config

func Read added in v0.1.10

func Read(repoPath string) (*Config, error)

Read reads config from disk

type Logs added in v0.1.10

type Logs struct {
	LogToDisk bool // when true, sends all logs to rolling files on disk
}

Logs settings

type MobileCafeClient added in v0.1.10

type MobileCafeClient struct {
	// messages w/ size less than limit will be handled by the p2p cafe service,
	// messages w/ size greater than limit will be handled by the mobile OS's background
	// upload service and the cafe HTTP API
	P2PWireLimit int
}

MobileCafeClient settings

type SwarmPorts added in v0.1.10

type SwarmPorts struct {
	TCP string // TCP address port
	WS  string // WS address port
}

type ThreadDefaults added in v0.1.10

type ThreadDefaults struct {
	ID string // default thread ID for reads/writes
}

ThreadDefaults settings

type Threads added in v0.1.10

type Threads struct {
	Defaults ThreadDefaults // default settings
}

Thread settings

Jump to

Keyboard shortcuts

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