Documentation
¶
Overview ¶
Package enrollment registers an agent with the FallBCK server using a one-time token
Index ¶
Constants ¶
const ConfigFileName = "agent.yaml"
ConfigFileName is the agent configuration file inside the data directory
Variables ¶
var AgentVersion = "0.1.0"
AgentVersion is reported to the server at enrollment; set by the agent binary
Functions ¶
func Enroll ¶ added in v0.6.0
Enroll exchanges a one-time enrollment token for an agent identity and bearer token, and writes agent.yaml (and an optional server CA bundle) into the data directory. The enrollment request honours o.CACertPath / o.InsecureSkipVerify, so a server with a private or self-signed certificate can be enrolled with. Operator settings already present in an existing agent.yaml (db_backup, TLS options) are preserved.
func EnrollAgent ¶
func EnrollAgent(ctx context.Context, serverURL, token, dataDir string) (*config.AgentConfig, error)
EnrollAgent enrolls a filesystem agent (see Enroll)
Types ¶
type Options ¶ added in v0.6.0
type Options struct {
ServerURL string
Token string
// DataDir receives agent.yaml; default: the type's default data directory
DataDir string
// AgentType is config.AgentTypeFilesystem (default) or config.AgentTypeDatabase
AgentType string
// Version reported to the server (default AgentVersion)
Version string
// Hostname overrides the reported hostname (e.g. k8s-<cluster>); default os.Hostname()
Hostname string
// CACertPath is a PEM bundle of a private CA to trust for ServerURL; it is used for
// the enrollment request itself and persisted in agent.yaml
CACertPath string
// InsecureSkipVerify disables certificate verification for ServerURL (enrollment
// request and agent.yaml)
InsecureSkipVerify bool
}
Options parameterise an enrollment