Documentation ¶
Index ¶
- Constants
- Variables
- func CacheSetup()
- func CommonSetup()
- func CronSetup()
- func DirectoryExists(directoryPath string) bool
- func FileExists(filePath string) bool
- func IsClientAction(q string) bool
- func IsEventType(q string) bool
- func IsIPVersionOption(q string) bool
- func IsRegisterRuleProperty(q string) bool
- func IsScheduleResult(q int) bool
- func LoadOptions()
- func MakeDirectoryIfNotExist(directoryPath string) error
- func RouterSetup()
- func Start()
- func StartHeartbeatMonitor()
- func Stop()
- type Attachment
- type AuthenticationResult
- type Error
- type Event
- type Group
- type Heartbeat
- type Host
- func (host *Host) ExitClient() *Error
- func (h Host) Groups() ([]Group, *Error)
- func (host *Host) Ping() *Error
- func (h *Host) RotatePSKIfNeeded() *Error
- func (h *Host) RotatePSKNow() (string, *Error)
- func (host *Host) RunScript(script *Script, scriptOutput func(stdout, stderr []byte), cancel chan bool) (*ScriptResult, *Error)
- func (h Host) Scripts() []ScriptEnabledGroup
- func (host *Host) TriggerAction(action otto.MessageTriggerAction, actionOutput func(stdout, stderr []byte), ...) (*otto.ScriptResult, *Error)
- type OptionsAuthentication
- type OptionsGeneral
- type OptionsNetwork
- type OptionsPSKRotate
- type OptionsRegister
- type OptionsSecurity
- type OttoOptions
- type RegisterRule
- type RegisterRuleClause
- type RunAs
- type Schedule
- type ScheduleReport
- type ScheduleReportTime
- type ScheduleScope
- type Script
- type ScriptEnabledGroup
- type ScriptEnabledHost
- type ScriptResult
- type Session
- type SystemSearchResult
- type User
Constants ¶
const ( // ClientActionPing Ping the host ClientActionPing = "ping" // ClientActionRunScript Run the script on the host ClientActionRunScript = "run_script" // ClientActionExitClient Exit the client on the host ClientActionExitClient = "exit_client" // ClientActionReboot Reboot the host ClientActionReboot = "reboot" // ClientActionShutdown Power off the host ClientActionShutdown = "shutdown" // ClientActionUpdatePSK Update the client PSK ClientActionUpdatePSK = "update_psk" )
const ( // EventTypeUserLoggedIn UserLoggedIn event EventTypeUserLoggedIn = "UserLoggedIn" // EventTypeUserIncorrectPassword UserIncorrectPassword event EventTypeUserIncorrectPassword = "UserIncorrectPassword" // EventTypeUserLoggedOut UserLoggedOut event EventTypeUserLoggedOut = "UserLoggedOut" // EventTypeUserAdded UserAdded event EventTypeUserAdded = "UserAdded" // EventTypeUserModified UserModified event EventTypeUserModified = "UserModified" // EventTypeUserResetPassword UserResetPassword event EventTypeUserResetPassword = "UserResetPassword" // EventTypeUserResetAPIKey UserResetAPIKey event EventTypeUserResetAPIKey = "UserResetAPIKey" // EventTypeUserDeleted UserDeleted event EventTypeUserDeleted = "UserDeleted" // EventTypeHostAdded HostAdded event EventTypeHostAdded = "HostAdded" // EventTypeHostModified HostModified event EventTypeHostModified = "HostModified" // EventTypeHostDeleted HostDeleted event EventTypeHostDeleted = "HostDeleted" // EventTypeHostRegisterSuccess HostRegisterSuccess event EventTypeHostRegisterSuccess = "HostRegisterSuccess" // EventTypeHostRegisterIncorrectKey HostRegisterIncorrectKey event EventTypeHostRegisterIncorrectKey = "HostRegisterIncorrectKey" // EventTypeGroupAdded GroupAdded event EventTypeGroupAdded = "GroupAdded" // EventTypeGroupModified GroupModified event EventTypeGroupModified = "GroupModified" // EventTypeGroupDeleted GroupDeleted event EventTypeGroupDeleted = "GroupDeleted" // EventTypeScheduleAdded ScheduleAdded event EventTypeScheduleAdded = "ScheduleAdded" // EventTypeScheduleModified ScheduleModified event EventTypeScheduleModified = "ScheduleModified" // EventTypeScheduleDeleted ScheduleDeleted event EventTypeScheduleDeleted = "ScheduleDeleted" // EventTypeAttachmentAdded AttachmentAdded event EventTypeAttachmentAdded = "AttachmentAdded" // EventTypeAttachmentModified AttachmentModified event EventTypeAttachmentModified = "AttachmentModified" // EventTypeAttachmentDeleted AttachmentDeleted event EventTypeAttachmentDeleted = "AttachmentDeleted" // EventTypeScriptAdded ScriptAdded event EventTypeScriptAdded = "ScriptAdded" // EventTypeScriptModified ScriptModified event EventTypeScriptModified = "ScriptModified" // EventTypeScriptDeleted ScriptDeleted event EventTypeScriptDeleted = "ScriptDeleted" // EventTypeScriptRun ScriptRun event EventTypeScriptRun = "ScriptRun" // EventTypeServerStarted ServerStarted event EventTypeServerStarted = "ServerStarted" // EventTypeServerOptionsModified ServerOptionsModified event EventTypeServerOptionsModified = "ServerOptionsModified" // EventTypeRegisterRuleAdded RegisterRuleAdded event EventTypeRegisterRuleAdded = "RegisterRuleAdded" // EventTypeRegisterRuleModified RegisterRuleModified event EventTypeRegisterRuleModified = "RegisterRuleModified" // EventTypeRegisterRuleDeleted RegisterRuleDeleted event EventTypeRegisterRuleDeleted = "RegisterRuleDeleted" )
const ( // IPVersionOptionAuto IPv4 or IPv6 as chosen by the system automatically IPVersionOptionAuto = "auto" // IPVersionOptionIPv4 IPv4 only IPVersionOptionIPv4 = "ipv4" // IPVersionOptionIPv6 IPv6 only IPVersionOptionIPv6 = "ipv6" )
const ( // RegisterRulePropertyHostname Hostname RegisterRulePropertyHostname = "hostname" // RegisterRulePropertyKernelName Kernel Name RegisterRulePropertyKernelName = "kernel_name" // RegisterRulePropertyKernelVersion Kernel Version RegisterRulePropertyKernelVersion = "kernel_version" // RegisterRulePropertyDistributionName Distribution Name RegisterRulePropertyDistributionName = "distribution_name" // RegisterRulePropertyDistributionVersion Distribution Version RegisterRulePropertyDistributionVersion = "distribution_version" )
const ( // ScheduleResultSuccess All hosts executed the script successfully ScheduleResultSuccess = 0 // ScheduleResultPartialSuccess Some hosts did not execute the script successfully ScheduleResultPartialSuccess = 1 // ScheduleResultFail No hosts executed the script successfully ScheduleResultFail = 2 )
Variables ¶
var AllClientAction = []string{ ClientActionPing, ClientActionRunScript, ClientActionExitClient, ClientActionReboot, ClientActionShutdown, ClientActionUpdatePSK, }
AllClientAction all ClientAction values
var AllEnums = map[string]interface{}{ "ClientAction": ClientActionSchema, "EventType": EventTypeSchema, "IPVersionOption": IPVersionOptionSchema, "RegisterRuleProperty": RegisterRulePropertySchema, "ScheduleResult": ScheduleResultSchema, }
AllEnums map of all enums
var AllEventType = []string{ EventTypeUserLoggedIn, EventTypeUserIncorrectPassword, EventTypeUserLoggedOut, EventTypeUserAdded, EventTypeUserModified, EventTypeUserResetPassword, EventTypeUserResetAPIKey, EventTypeUserDeleted, EventTypeHostAdded, EventTypeHostModified, EventTypeHostDeleted, EventTypeHostRegisterSuccess, EventTypeHostRegisterIncorrectKey, EventTypeGroupAdded, EventTypeGroupModified, EventTypeGroupDeleted, EventTypeScheduleAdded, EventTypeScheduleModified, EventTypeScheduleDeleted, EventTypeAttachmentAdded, EventTypeAttachmentModified, EventTypeAttachmentDeleted, EventTypeScriptAdded, EventTypeScriptModified, EventTypeScriptDeleted, EventTypeScriptRun, EventTypeServerStarted, EventTypeServerOptionsModified, EventTypeRegisterRuleAdded, EventTypeRegisterRuleModified, EventTypeRegisterRuleDeleted, }
AllEventType all EventType values
var AllIPVersionOption = []string{ IPVersionOptionAuto, IPVersionOptionIPv4, IPVersionOptionIPv6, }
AllIPVersionOption all IPVersionOption values
var AllRegisterRuleProperty = []string{ RegisterRulePropertyHostname, RegisterRulePropertyKernelName, RegisterRulePropertyKernelVersion, RegisterRulePropertyDistributionName, RegisterRulePropertyDistributionVersion, }
AllRegisterRuleProperty all RegisterRuleProperty values
var AllScheduleResult = []int{ ScheduleResultSuccess, ScheduleResultPartialSuccess, ScheduleResultFail, }
AllScheduleResult all ScheduleResult values
var AttachmentStore = attachmentStoreObject{}
AttachmentStore the global attachment store
var ClientActionMap = map[string]string{ ClientActionPing: "ping", ClientActionRunScript: "run_script", ClientActionExitClient: "exit_client", ClientActionReboot: "reboot", ClientActionShutdown: "shutdown", ClientActionUpdatePSK: "update_psk", }
ClientActionMap map ClientAction keys to values
var ClientActionNameMap = map[string]string{
"Ping": "ping",
"RunScript": "run_script",
"ExitClient": "exit_client",
"Reboot": "reboot",
"Shutdown": "shutdown",
"UpdatePSK": "update_psk",
}
ClientActionNameMap map ClientAction keys to values
var ClientActionSchema = []map[string]interface{}{
{
"name": "Ping",
"description": "Ping the host",
"value": "ping",
},
{
"name": "RunScript",
"description": "Run the script on the host",
"value": "run_script",
},
{
"name": "ExitClient",
"description": "Exit the client on the host",
"value": "exit_client",
},
{
"name": "Reboot",
"description": "Reboot the host",
"value": "reboot",
},
{
"name": "Shutdown",
"description": "Power off the host",
"value": "shutdown",
},
{
"name": "UpdatePSK",
"description": "Update the client PSK",
"value": "update_psk",
},
}
ClientActionSchema the ClientAction schema.
var Directories = apiDirectories{}
Directories absolute paths of API related directires.
var EventStore = eventStoreObject{}
EventStore the global event store
var EventTypeMap = map[string]string{ EventTypeUserLoggedIn: "UserLoggedIn", EventTypeUserIncorrectPassword: "UserIncorrectPassword", EventTypeUserLoggedOut: "UserLoggedOut", EventTypeUserAdded: "UserAdded", EventTypeUserModified: "UserModified", EventTypeUserResetPassword: "UserResetPassword", EventTypeUserResetAPIKey: "UserResetAPIKey", EventTypeUserDeleted: "UserDeleted", EventTypeHostAdded: "HostAdded", EventTypeHostModified: "HostModified", EventTypeHostDeleted: "HostDeleted", EventTypeHostRegisterSuccess: "HostRegisterSuccess", EventTypeHostRegisterIncorrectKey: "HostRegisterIncorrectKey", EventTypeGroupAdded: "GroupAdded", EventTypeGroupModified: "GroupModified", EventTypeGroupDeleted: "GroupDeleted", EventTypeScheduleAdded: "ScheduleAdded", EventTypeScheduleModified: "ScheduleModified", EventTypeScheduleDeleted: "ScheduleDeleted", EventTypeAttachmentAdded: "AttachmentAdded", EventTypeAttachmentModified: "AttachmentModified", EventTypeAttachmentDeleted: "AttachmentDeleted", EventTypeScriptAdded: "ScriptAdded", EventTypeScriptModified: "ScriptModified", EventTypeScriptDeleted: "ScriptDeleted", EventTypeScriptRun: "ScriptRun", EventTypeServerStarted: "ServerStarted", EventTypeServerOptionsModified: "ServerOptionsModified", EventTypeRegisterRuleAdded: "RegisterRuleAdded", EventTypeRegisterRuleModified: "RegisterRuleModified", EventTypeRegisterRuleDeleted: "RegisterRuleDeleted", }
EventTypeMap map EventType keys to values
var EventTypeNameMap = map[string]string{
"UserLoggedIn": "UserLoggedIn",
"UserIncorrectPassword": "UserIncorrectPassword",
"UserLoggedOut": "UserLoggedOut",
"UserAdded": "UserAdded",
"UserModified": "UserModified",
"UserResetPassword": "UserResetPassword",
"UserResetAPIKey": "UserResetAPIKey",
"UserDeleted": "UserDeleted",
"HostAdded": "HostAdded",
"HostModified": "HostModified",
"HostDeleted": "HostDeleted",
"HostRegisterSuccess": "HostRegisterSuccess",
"HostRegisterIncorrectKey": "HostRegisterIncorrectKey",
"GroupAdded": "GroupAdded",
"GroupModified": "GroupModified",
"GroupDeleted": "GroupDeleted",
"ScheduleAdded": "ScheduleAdded",
"ScheduleModified": "ScheduleModified",
"ScheduleDeleted": "ScheduleDeleted",
"AttachmentAdded": "AttachmentAdded",
"AttachmentModified": "AttachmentModified",
"AttachmentDeleted": "AttachmentDeleted",
"ScriptAdded": "ScriptAdded",
"ScriptModified": "ScriptModified",
"ScriptDeleted": "ScriptDeleted",
"ScriptRun": "ScriptRun",
"ServerStarted": "ServerStarted",
"ServerOptionsModified": "ServerOptionsModified",
"RegisterRuleAdded": "RegisterRuleAdded",
"RegisterRuleModified": "RegisterRuleModified",
"RegisterRuleDeleted": "RegisterRuleDeleted",
}
EventTypeNameMap map EventType keys to values
var EventTypeSchema = []map[string]interface{}{
{
"name": "UserLoggedIn",
"description": "UserLoggedIn event",
"value": "UserLoggedIn",
},
{
"name": "UserIncorrectPassword",
"description": "UserIncorrectPassword event",
"value": "UserIncorrectPassword",
},
{
"name": "UserLoggedOut",
"description": "UserLoggedOut event",
"value": "UserLoggedOut",
},
{
"name": "UserAdded",
"description": "UserAdded event",
"value": "UserAdded",
},
{
"name": "UserModified",
"description": "UserModified event",
"value": "UserModified",
},
{
"name": "UserResetPassword",
"description": "UserResetPassword event",
"value": "UserResetPassword",
},
{
"name": "UserResetAPIKey",
"description": "UserResetAPIKey event",
"value": "UserResetAPIKey",
},
{
"name": "UserDeleted",
"description": "UserDeleted event",
"value": "UserDeleted",
},
{
"name": "HostAdded",
"description": "HostAdded event",
"value": "HostAdded",
},
{
"name": "HostModified",
"description": "HostModified event",
"value": "HostModified",
},
{
"name": "HostDeleted",
"description": "HostDeleted event",
"value": "HostDeleted",
},
{
"name": "HostRegisterSuccess",
"description": "HostRegisterSuccess event",
"value": "HostRegisterSuccess",
},
{
"name": "HostRegisterIncorrectKey",
"description": "HostRegisterIncorrectKey event",
"value": "HostRegisterIncorrectKey",
},
{
"name": "GroupAdded",
"description": "GroupAdded event",
"value": "GroupAdded",
},
{
"name": "GroupModified",
"description": "GroupModified event",
"value": "GroupModified",
},
{
"name": "GroupDeleted",
"description": "GroupDeleted event",
"value": "GroupDeleted",
},
{
"name": "ScheduleAdded",
"description": "ScheduleAdded event",
"value": "ScheduleAdded",
},
{
"name": "ScheduleModified",
"description": "ScheduleModified event",
"value": "ScheduleModified",
},
{
"name": "ScheduleDeleted",
"description": "ScheduleDeleted event",
"value": "ScheduleDeleted",
},
{
"name": "AttachmentAdded",
"description": "AttachmentAdded event",
"value": "AttachmentAdded",
},
{
"name": "AttachmentModified",
"description": "AttachmentModified event",
"value": "AttachmentModified",
},
{
"name": "AttachmentDeleted",
"description": "AttachmentDeleted event",
"value": "AttachmentDeleted",
},
{
"name": "ScriptAdded",
"description": "ScriptAdded event",
"value": "ScriptAdded",
},
{
"name": "ScriptModified",
"description": "ScriptModified event",
"value": "ScriptModified",
},
{
"name": "ScriptDeleted",
"description": "ScriptDeleted event",
"value": "ScriptDeleted",
},
{
"name": "ScriptRun",
"description": "ScriptRun event",
"value": "ScriptRun",
},
{
"name": "ServerStarted",
"description": "ServerStarted event",
"value": "ServerStarted",
},
{
"name": "ServerOptionsModified",
"description": "ServerOptionsModified event",
"value": "ServerOptionsModified",
},
{
"name": "RegisterRuleAdded",
"description": "RegisterRuleAdded event",
"value": "RegisterRuleAdded",
},
{
"name": "RegisterRuleModified",
"description": "RegisterRuleModified event",
"value": "RegisterRuleModified",
},
{
"name": "RegisterRuleDeleted",
"description": "RegisterRuleDeleted event",
"value": "RegisterRuleDeleted",
},
}
EventTypeSchema the EventType schema.
var GroupCache = &cacheTypeGroup{lock: &sync.RWMutex{}}
GroupCache the group cache
var GroupStore = groupStoreObject{}
GroupStore the global group store
var HostCache = &cacheTypeHost{lock: &sync.RWMutex{}}
HostCache the host cache
var HostStore = hostStoreObject{}
HostStore the global host store
var IPVersionOptionMap = map[string]string{ IPVersionOptionAuto: "auto", IPVersionOptionIPv4: "ipv4", IPVersionOptionIPv6: "ipv6", }
IPVersionOptionMap map IPVersionOption keys to values
var IPVersionOptionNameMap = map[string]string{
"Auto": "auto",
"IPv4": "ipv4",
"IPv6": "ipv6",
}
IPVersionOptionNameMap map IPVersionOption keys to values
var IPVersionOptionSchema = []map[string]interface{}{
{
"name": "Auto",
"description": "IPv4 or IPv6 as chosen by the system automatically",
"value": "auto",
},
{
"name": "IPv4",
"description": "IPv4 only",
"value": "ipv4",
},
{
"name": "IPv6",
"description": "IPv6 only",
"value": "ipv6",
},
}
IPVersionOptionSchema the IPVersionOption schema.
var RegisterRulePropertyMap = map[string]string{ RegisterRulePropertyHostname: "hostname", RegisterRulePropertyKernelName: "kernel_name", RegisterRulePropertyKernelVersion: "kernel_version", RegisterRulePropertyDistributionName: "distribution_name", RegisterRulePropertyDistributionVersion: "distribution_version", }
RegisterRulePropertyMap map RegisterRuleProperty keys to values
var RegisterRulePropertyNameMap = map[string]string{
"Hostname": "hostname",
"KernelName": "kernel_name",
"KernelVersion": "kernel_version",
"DistributionName": "distribution_name",
"DistributionVersion": "distribution_version",
}
RegisterRulePropertyNameMap map RegisterRuleProperty keys to values
var RegisterRulePropertySchema = []map[string]interface{}{
{
"name": "Hostname",
"description": "Hostname",
"value": "hostname",
},
{
"name": "KernelName",
"description": "Kernel Name",
"value": "kernel_name",
},
{
"name": "KernelVersion",
"description": "Kernel Version",
"value": "kernel_version",
},
{
"name": "DistributionName",
"description": "Distribution Name",
"value": "distribution_name",
},
{
"name": "DistributionVersion",
"description": "Distribution Version",
"value": "distribution_version",
},
}
RegisterRulePropertySchema the RegisterRuleProperty schema.
var RegisterRuleStore = registerruleStoreObject{}
RegisterRuleStore the global registerrule store
var ScheduleCache = &cacheTypeSchedule{lock: &sync.RWMutex{}}
ScheduleCache the schedule cache
var ScheduleReportStore = schedulereportStoreObject{}
ScheduleReportStore the global schedulereport store
var ScheduleResultMap = map[int]int{ ScheduleResultSuccess: 0, ScheduleResultPartialSuccess: 1, ScheduleResultFail: 2, }
ScheduleResultMap map ScheduleResult keys to values
var ScheduleResultNameMap = map[string]int{
"Success": 0,
"PartialSuccess": 1,
"Fail": 2,
}
ScheduleResultNameMap map ScheduleResult keys to values
var ScheduleResultSchema = []map[string]interface{}{
{
"name": "Success",
"description": "All hosts executed the script successfully",
"value": 0,
},
{
"name": "PartialSuccess",
"description": "Some hosts did not execute the script successfully",
"value": 1,
},
{
"name": "Fail",
"description": "No hosts executed the script successfully",
"value": 2,
},
}
ScheduleResultSchema the ScheduleResult schema.
var ScheduleStore = scheduleStoreObject{}
ScheduleStore the global schedule store
var ScriptCache = &cacheTypeScript{lock: &sync.RWMutex{}}
ScriptCache the script cache
var ScriptStore = scriptStoreObject{}
ScriptStore the global script store
var ServerVersion = "dev"
ServerVersion the version of server
var SessionStore = &sessionStoreObject{ m: map[string]Session{}, l: &sync.RWMutex{}, }
SessionStore describes the session store
var ShadowStore = shadowStoreObject{ Lock: &sync.Mutex{}, }
ShadowStore the global shadow store
var State *cbgenStateObject
State the global state object
var UserCache = &cacheTypeUser{lock: &sync.RWMutex{}}
UserCache the user cache
var UserStore = userStoreObject{}
UserStore the global user store
Functions ¶
func DirectoryExists ¶
DirectoryExists does the given directory exist (and is it a directory)
func IsClientAction ¶
IsClientAction is the provided value a valid ClientAction
func IsEventType ¶
IsEventType is the provided value a valid EventType
func IsIPVersionOption ¶
IsIPVersionOption is the provided value a valid IPVersionOption
func IsRegisterRuleProperty ¶
IsRegisterRuleProperty is the provided value a valid RegisterRuleProperty
func IsScheduleResult ¶
IsScheduleResult is the provided value a valid ScheduleResult
func MakeDirectoryIfNotExist ¶
MakeDirectoryIfNotExist make the given directory if it does not exist
func StartHeartbeatMonitor ¶
func StartHeartbeatMonitor()
StartHeartbeatMonitor starts the heartbeat monitor
Types ¶
type Attachment ¶
type Attachment struct { ID string `ds:"primary"` Path string Name string MimeType string Owner RunAs Created time.Time Modified time.Time Mode uint32 Size uint64 }
Attachment describes a file for a script
func (Attachment) FilePath ¶
func (attachment Attachment) FilePath() string
FilePath returns the absolute path for this attachment
type AuthenticationResult ¶
AuthenticationResult describes an authentication result
type Error ¶
Error describes an error object
func ErrorServer ¶
ErrorServer create a new server-side error
type Event ¶
type Event struct { ID string `ds:"primary"` Event string `ds:"index"` Time time.Time Details map[string]string }
Event describes an Otto server event
type Group ¶
type Group struct { ID string `ds:"primary"` Name string `ds:"unique" min:"1" max:"140"` ScriptIDs []string Environment []environ.Variable }
Group describes a group object
type Heartbeat ¶
type Heartbeat struct { Address string IsReachable bool LastReply time.Time LastAttempt time.Time Version string Properties map[string]string }
Heartbeat describes a heartbeat to a host
type Host ¶
type Host struct { ID string `ds:"primary"` Name string `ds:"unique" min:"1" max:"140"` Address string `ds:"unique" min:"1"` Port uint32 PSK string `min:"1" max:"512"` LastPSKRotate time.Time Enabled bool `ds:"index"` GroupIDs []string Environment []environ.Variable }
Host describes a otto host
func (*Host) ExitClient ¶
ExitClient exit the otto client on the host
func (*Host) RotatePSKIfNeeded ¶
func (*Host) RotatePSKNow ¶
func (*Host) RunScript ¶
func (host *Host) RunScript(script *Script, scriptOutput func(stdout, stderr []byte), cancel chan bool) (*ScriptResult, *Error)
RunScript run the script on the host. Error will only ever be populated with internal server errors, such as being unable to read from the database.
func (Host) Scripts ¶
func (h Host) Scripts() []ScriptEnabledGroup
Scripts return all scripts for this host
func (*Host) TriggerAction ¶
func (host *Host) TriggerAction(action otto.MessageTriggerAction, actionOutput func(stdout, stderr []byte), cancel chan bool) (*otto.ScriptResult, *Error)
TriggerAction will trigger the given action on the host
type OptionsAuthentication ¶
OptionsAuthentication describes the authentication options
type OptionsGeneral ¶
OptionsGeneral describes the general options
type OptionsNetwork ¶
OptionsNetwork describes network options for connecting to otto clients
type OptionsPSKRotate ¶
OptionsPSKRotate describes PSK rotation options
type OptionsRegister ¶
type OptionsRegister struct { Enabled bool Key string DefaultGroupID string RunScriptsOnRegister bool }
OptionsRegister describes register options
type OptionsSecurity ¶
type OptionsSecurity struct { IncludePSKEnv bool RotatePSK OptionsPSKRotate }
OptionsSecurity describes security options
type OttoOptions ¶
type OttoOptions struct { General OptionsGeneral Authentication OptionsAuthentication Network OptionsNetwork Register OptionsRegister Security OptionsSecurity }
OttoOptions describes options for the otto server
var Options *OttoOptions
Options the global options
func (*OttoOptions) Save ¶
func (o *OttoOptions) Save() (string, bool)
Save save the options to disk. Will panic on any error. Returns true if the options did change
func (*OttoOptions) Validate ¶
func (o *OttoOptions) Validate() error
Validate returns an error if the options is not valid
type RegisterRule ¶
type RegisterRule struct { ID string `ds:"primary"` Name string `ds:"unique" min:"1" max:"140"` Clauses []RegisterRuleClause `min:"1"` GroupID string `ds:"index"` }
RegisterRule describes a register rule
func (RegisterRule) Matches ¶
func (rule RegisterRule) Matches(properties otto.RegisterRequestProperties) bool
Matches does this rule match the given set of host properties
type RegisterRuleClause ¶
RegisterRuleClause describes a single clause for a register rule
type Schedule ¶
type Schedule struct { ID string `ds:"primary"` Name string `ds:"unique" min:"1" max:"140"` ScriptID string `ds:"index"` Scope ScheduleScope Pattern string Enabled bool LastRunTime time.Time }
Schedule describes a recurring task
type ScheduleReport ¶
type ScheduleReport struct { ID string `ds:"primary"` ScheduleID string `ds:"index"` HostIDs []string Time ScheduleReportTime Result int HostResult map[string]int }
ScheduleReport describes a report from a schedule
type ScheduleReportTime ¶
ScheduleReportTime describes timing information from a schedule run
type ScheduleScope ¶
ScheduleScope describes the scope for a schedule
func (ScheduleScope) Groups ¶
func (s ScheduleScope) Groups() ([]Group, *Error)
Groups get the groups for this schedule
func (ScheduleScope) Hosts ¶
func (s ScheduleScope) Hosts() ([]Host, *Error)
Hosts get the hosts for this schedule
type Script ¶
type Script struct { ID string `ds:"primary"` Name string `ds:"unique" min:"1" max:"140"` Enabled bool `ds:"index"` Executable string `min:"1"` Script string `min:"1"` Environment []environ.Variable RunAs RunAs WorkingDirectory string AfterExecution string AttachmentIDs []string }
Script describes an otto script
func (*Script) Attachments ¶
func (s *Script) Attachments() ([]Attachment, *Error)
Attachments all files for this script
func (*Script) Hosts ¶
func (s *Script) Hosts() []ScriptEnabledHost
Hosts all hosts with this script enabled
type ScriptEnabledGroup ¶
type ScriptEnabledGroup struct { ScriptID string ScriptName string GroupID string GroupName string }
ScriptEnabledGroup describes a host where a script is enabled on it by a group
type ScriptEnabledHost ¶
type ScriptEnabledHost struct { ScriptID string ScriptName string GroupID string GroupName string HostID string HostName string }
ScriptEnabledHost describes a host where a script is eanbled on it by a group
type ScriptResult ¶
type ScriptResult struct { ScriptID string Duration time.Duration Environment []environ.Variable Result otto.ScriptResult RunError string }
ScriptResult describes a script result
type SystemSearchResult ¶
SystemSearchResult describes a search result for a system search
func SystemSearch ¶
func SystemSearch(q string) []SystemSearchResult
SystemSearch search the otto system
Source Files ¶
- args.go
- attachment.go
- attachment_store.go
- authentication.go
- cache.go
- cache_group.go
- cache_host.go
- cache_schedule.go
- cache_script.go
- cache_user.go
- cbgen_data_store.go
- cbgen_directory.go
- cbgen_enum.go
- cbgen_gob.go
- cbgen_state.go
- cbgen_store.go
- cbgen_version.go
- cron.go
- environment.go
- error.go
- event.go
- event_store.go
- execute.go
- first_run.go
- group.go
- group_store.go
- handle.go
- handle_attachment.go
- handle_authentication.go
- handle_events.go
- handle_group.go
- handle_heartbeat.go
- handle_host.go
- handle_options.go
- handle_register.go
- handle_register_rules.go
- handle_request.go
- handle_schedule.go
- handle_script.go
- handle_state.go
- handle_system_search.go
- handle_users.go
- handle_view.go
- heartbeat.go
- host.go
- host_store.go
- migrate.go
- options.go
- otto.go
- register_rule.go
- router.go
- schedule.go
- schedule_report.go
- schedule_store.go
- script.go
- script_store.go
- session.go
- shadow_store.go
- system_search.go
- user.go
- user_store.go
- util.go