Documentation
¶
Index ¶
- Variables
- func EnterpriseConfig(c Config, service string) (yaml.Node, bool)
- func NewLiteNode(ctx context.Context, c Config, storagePath string) (peer.Node, error)
- func NewNode(ctx context.Context, c Config, storagePath string) (peer.Node, error)
- type Accounts
- type AccountsEmail
- type AcmeCAConfig
- type AcmeConfig
- type Bundle
- type BundleOrigin
- type Config
- type DVKey
- type DomainValidation
- type Domains
- type Option
- func WithAccounts(a Accounts) Option
- func WithAcmeKey(key crypto.Signer) Option
- func WithAcmeUrl(url string) Option
- func WithAliasDomainsRegExp(r []*regexp.Regexp) Option
- func WithCluster(cluster string) Option
- func WithCustomAcme(v bool) Option
- func WithDevMode(dev bool) Option
- func WithDomainValidation(dv DomainValidation) Option
- func WithEnableHTTPS(v bool) Option
- func WithGeneratedDomainRegExp(r *regexp.Regexp) Option
- func WithHosts(h map[string]string) Option
- func WithHttpListen(addr string) Option
- func WithLocation(loc *seerIface.Location) Option
- func WithNetworkFqdn(fqdn string) Option
- func WithP2PAnnounce(addrs []string) Option
- func WithP2PListen(addrs []string) Option
- func WithPeers(peers []string) Option
- func WithPlugins(p Plugins) Option
- func WithPorts(ports map[string]int) Option
- func WithPrivateKey(key []byte) Option
- func WithRoot(root string) Option
- func WithServicesDomainRegExp(r *regexp.Regexp) Option
- func WithSource(src *Source, opts SourceOptions) Option
- func WithSwarmKey(key []byte) Option
- func WithTenancy(t Tenancy) Option
- func WithVerbose(v bool) Option
- type Plugin
- type Plugins
- type Ports
- type ProtoCommandIface
- type SMTP
- type Source
- type SourceOptions
- type Tenancy
- type TenancyApp
Constants ¶
This section is empty.
Variables ¶
var ( DefaultRoot = "/tb" DefaultP2PListenFormat = "/ip4/0.0.0.0/tcp/%d" DefaultHTTPListen = "0.0.0.0:443" )
var WaitForSwamDuration = 10 * time.Second
Functions ¶
func EnterpriseConfig ¶
EnterpriseConfig returns the raw enterprise.<service> config node when present. tau/spore-drive treat the enterprise config opaquely; an ee service decodes its own block from this node, so no service schema lives in the public tree.
func NewLiteNode ¶
Types ¶
type Accounts ¶
type Accounts struct {
SessionTTL string `yaml:"session-ttl,omitempty"`
Email AccountsEmail `yaml:"email"`
}
Accounts holds runtime configuration for the Accounts subsystem.
AccountsURL and WebAuthn are derived from NetworkFqdn at runtime (core/services/accounts/url.go). VerifyOnAuth is a package-level global, not a config field.
type AccountsEmail ¶
type AccountsEmail struct {
SMTP SMTP `yaml:"smtp,omitempty"`
}
AccountsEmail configures the magic-link sender. Stdout fallback auto- enables in DevMode; rate limits are hardcoded.
type AcmeCAConfig ¶
type AcmeConfig ¶
type AcmeConfig struct {
Url string `yaml:"url"`
CA *AcmeCAConfig `yaml:"ca,omitempty"`
Key string `yaml:"key"`
}
type Bundle ¶
type Bundle struct {
Origin BundleOrigin `yaml:"origin"`
Source
}
type BundleOrigin ¶
type Config ¶
type Config interface {
Root() string
Shape() string
Services() []string
Cluster() string
Peers() []string
P2PListen() []string
P2PAnnounce() []string
Ports() map[string]int
Location() *seerIface.Location
NetworkFqdn() string
GeneratedDomain() string
AliasDomains() []string
HttpListen() string
AliasDomainsRegExp() []*regexp.Regexp
GeneratedDomainRegExp() *regexp.Regexp
ServicesDomainRegExp() *regexp.Regexp
ServicesDomainMatch(s string) bool
AliasDomainsMatch(dom string) bool
GeneratedDomainMatch(s string) bool
// Hosts: custom domain -> service bindings (domains.hosts).
Hosts() map[string]string
ServiceForHost(host string) (string, bool)
HostsForService(service string) []string
RouteHosts(service string) []string
CustomAcme() bool
AcmeUrl() string
AcmeCAARecord() string
AcmeKey() crypto.Signer
AcmeCAInsecureSkipVerify() bool
AcmeRootCA() *x509.CertPool
Node() peer.Node
PrivateKey() []byte
Databases() kvdb.Factory
RaftCluster() raft.Cluster
ClientNode() peer.Node
SwarmKey() []byte
Http() http.Service
Sensors() *sensors.Service
EnableHTTPS() bool
Verbose() bool
DevMode() bool
Plugins() Plugins
DomainValidation() DomainValidation
SensorsRegistry() *sensors.Registry
Accounts() Accounts
Tenancy() Tenancy
SetNode(peer.Node)
SetRaftCluster(raft.Cluster)
SetClientNode(peer.Node)
SetDatabases(kvdb.Factory)
SetHttp(http.Service)
SetSensors(*sensors.Service)
}
Config is the validated node configuration. Created via New; mutable fields can be set by bootstrap (e.g. SetNode, SetRaftCluster).
type DomainValidation ¶
type Domains ¶
type Domains struct {
Key DVKey `yaml:"key"`
Acme *AcmeConfig `yaml:"acme,omitempty"`
Aliases []string `yaml:"aliases"`
Generated string `yaml:"generated"`
// Hosts binds a custom domain to the service that serves it, e.g.
// {"console.example.com": "gateway"}. seer resolves the domain to that service's
// nodes, the shared http server accepts + autocerts it, and the service
// registers its routes under it. Distinct from Aliases (generic
// <svc>.<alias> base domains resolved by first label).
Hosts map[string]string `yaml:"hosts,omitempty"`
}
type Option ¶
type Option func(*config) error
Option applies a setting during construction and may validate it.
func WithAccounts ¶
WithAccounts sets the Accounts subsystem configuration.
func WithAcmeKey ¶
WithAcmeKey sets the ACME account key (crypto.Signer).
func WithAliasDomainsRegExp ¶
WithAliasDomainsRegExp sets the alias domains regex list.
func WithDevMode ¶
WithDevMode sets dev mode (default true when using New).
func WithDomainValidation ¶
func WithDomainValidation(dv DomainValidation) Option
WithDomainValidation sets domain validation keys.
func WithGeneratedDomainRegExp ¶
WithGeneratedDomainRegExp sets the generated domain regex.
func WithHttpListen ¶
WithHttpListen sets the HTTP listen address.
func WithLocation ¶
WithLocation sets the location.
func WithNetworkFqdn ¶
WithNetworkFqdn sets the network FQDN.
func WithP2PAnnounce ¶
WithP2PAnnounce sets the p2p announce addresses. Validates at least one address.
func WithP2PListen ¶
WithP2PListen sets the p2p listen addresses. Validates at least one address.
func WithPrivateKey ¶
WithPrivateKey sets the node private key. Validates non-empty when DevMode is false.
func WithServicesDomainRegExp ¶
WithServicesDomainRegExp sets the services domain regex.
func WithSource ¶
func WithSource(src *Source, opts SourceOptions) Option
WithSource builds config from a Source (e.g. YAML). Resolves paths under root/config and loads keys from disk.
func WithTenancy ¶
WithTenancy sets the owning namespace for this cloud.
type Ports ¶
type ProtoCommandIface ¶
type SMTP ¶
type SMTP struct {
Host string `yaml:"host,omitempty"`
Port int `yaml:"port,omitempty"`
User string `yaml:"user,omitempty"`
Pass string `yaml:"pass,omitempty"`
From string `yaml:"from,omitempty"`
}
SMTP minimal config. Empty Host = not configured (refused in production, stdout fallback in DevMode). Empty From defaults to `noreply@<NetworkFqdn>`.
type Source ¶
type Source struct {
Privatekey string `yaml:"privatekey"`
Swarmkey string `yaml:"swarmkey"`
Services []string `yaml:"services,omitempty"`
P2PListen []string `yaml:"p2p-listen"`
P2PAnnounce []string `yaml:"p2p-announce"`
Ports Ports `yaml:"ports"`
Location *seerIface.Location `yaml:"location,omitempty"`
Peers []string `yaml:"peers,omitempty"`
NetworkFqdn string `yaml:"network-fqdn"`
Domains Domains `yaml:"domains"`
Cluster string `yaml:"cluster,omitempty"`
// Accounts subsystem config (session-ttl, email/SMTP). Optional —
// community / dream installs can omit. AccountsURL + WebAuthn are
// derived from NetworkFqdn at runtime.
Accounts Accounts `yaml:"accounts,omitempty"`
// Tenancy names the git namespace that owns this cloud. Unlike Accounts it
// is emitted to every shape, so any service can compare a repository's
// owner against it without a client or an API call.
Tenancy Tenancy `yaml:"tenancy,omitempty"`
// Enterprise namespaces raw config for enterprise-only services under
// `enterprise:` in the shape config. Community builds carry it opaquely;
// `//go:build ee` code decodes each service's entry into its own typed
// config (via EnterpriseConfig).
Enterprise map[string]yaml.Node `yaml:"enterprise,omitempty"`
Plugins
}
type SourceOptions ¶
SourceOptions configures how a Source is applied when using WithSource.
type Tenancy ¶
type Tenancy struct {
Provider string `yaml:"provider,omitempty"`
Owner string `yaml:"owner,omitempty"`
App TenancyApp `yaml:"app,omitempty"`
}
Tenancy names the git namespace (GitHub org, GitLab group, Bitbucket workspace) that owns this cloud. Owner is the owning segment of `owner/repo`, which is what a repository URI yields on every provider.
An empty Owner means no namespace is configured. Registration refuses in that state rather than falling open, so a cloud is never accidentally open to anyone holding a valid provider token.
func (Tenancy) Configured ¶
Configured reports whether an owning namespace was set.
type TenancyApp ¶
type TenancyApp struct {
ClientId string `yaml:"client-id,omitempty"`
Key string `yaml:"key,omitempty"`
}
TenancyApp is the credential the namespace itself granted. The caller's own token cannot answer questions about other users or private repositories, so membership is checked with an installation token minted from this key.
Key is the PEM inline, matching how Privatekey and Swarmkey already travel.