Documentation ¶
Index ¶
- Constants
- Variables
- func ApiHeartbeatPath(ident string) string
- func ApiPath(resource string) string
- func ApiServerPath(ident string) string
- func ApiServerProcsPath(ident string) string
- func ApiServersPath() string
- func FetchLog() *logging.Logger
- func InitEnv(envStr string)
- func InitLogging()
- type Conf
- type Env
- type ServerConf
- type WatcherConf
Constants ¶
View Source
const ( PROD_URL = "https://www.appcanary.com" DEV_URL = "http://localhost:4000" DEFAULT_CONF_PATH = "/etc/appcanary/" DEFAULT_CONF_FILE_BASE = DEFAULT_CONF_PATH + "agent" DEFAULT_VAR_PATH = "/var/db/appcanary/" DEFAULT_VAR_FILE_BASE = DEFAULT_VAR_PATH + "server" DEFAULT_CONF_FILE = DEFAULT_CONF_FILE_BASE + ".yml" DEFAULT_VAR_FILE = DEFAULT_VAR_FILE_BASE + ".yml" OLD_DEFAULT_CONF_FILE = DEFAULT_CONF_FILE_BASE + ".conf" OLD_DEFAULT_VAR_FILE = DEFAULT_VAR_FILE_BASE + ".conf" DEFAULT_HEARTBEAT_DURATION = 1 * time.Hour DEV_HEARTBEAT_DURATION = 10 * time.Second DEFAULT_SYNC_ALL_DURATION = 24 * time.Hour DEV_SYNC_ALL_DURATION = 30 * time.Second DEFAULT_LOG_FILE = "/var/log/appcanary.log" )
env vars
View Source
const ( API_VERSION = "/api/v1/agent/" API_HEARTBEAT = API_VERSION + "heartbeat" API_SERVERS = API_VERSION + "servers" )
api endpoints
View Source
const ( DEFAULT_POLL_SLEEP = 5 * time.Minute // test env.PollSleep is 1second // test poll sleep is double to give the fs time to flush DEV_POLL_SLEEP = time.Second TEST_POLL_SLEEP = (time.Second + (150 * time.Millisecond)) * 2 )
file polling
View Source
const ( DEV_LOGO = `` /* 367-byte string literal not displayed */ PROD_LOGO = ` __ _____ _____ ___ __ ___ __ _ __ __ __ /'__` + "`" + `\ /\ '__` + "`" + `\/\ '__` + "`" + `\ /'___\ /'__` + "`" + `\ /' _ ` + "`" + `\ /'__` + "`" + `\ /\` + "`" + `'__\/\ \/\ \ /\ \L\.\_\ \ \L\ \ \ \L\ \/\ \__//\ \L\.\_/\ \/\ \/\ \L\.\_\ \ \/ \ \ \_\ \ \ \__/.\_\\ \ ,__/\ \ ,__/\ \____\ \__/.\_\ \_\ \_\ \__/.\_\\ \_\ \/` + "`" + `____ \ \/__/\/_/ \ \ \/ \ \ \/ \/____/\/__/\/_/\/_/\/_/\/__/\/_/ \/_/ ` + "`" + `/___/> \ \ \_\ \ \_\ /\___/ \/_/ \/_/ \/__/ ` )
trolol
Variables ¶
View Source
var DEV_CONF_FILE string
View Source
var DEV_CONF_PATH string
consts can't be outputs of functions?
View Source
var DEV_VAR_FILE string
View Source
var DEV_VAR_PATH string
View Source
var OLD_DEV_CONF_FILE string
View Source
var OLD_DEV_VAR_FILE string
Functions ¶
func ApiHeartbeatPath ¶
func ApiServerPath ¶
func ApiServerProcsPath ¶
func ApiServersPath ¶
func ApiServersPath() string
func InitLogging ¶
func InitLogging()
Types ¶
type Conf ¶
type Conf struct { detect.LinuxOSInfo `yaml:",inline"` ApiKey string `yaml:"api_key,omitempty" toml:"api_key"` LogPath string `yaml:"log_path,omitempty" toml:"log_path"` ServerName string `yaml:"server_name,omitempty" toml:"server_name"` Watchers []WatcherConf `yaml:"watchers" toml:"files"` StartupDelay int `yaml:"startup_delay,omitempty" toml:"startup_delay"` ServerConf *ServerConf `yaml:"-" toml:"-"` Tags []string `yaml:"tags,omitempty"` // no toml support for this }
func NewConfFromEnv ¶
we can't function without configuration so at some point some substack callee of this method will Fatal() if it can't find what it needs
func NewTomlConfFromEnv ¶
func NewYamlConfFromEnv ¶
func (*Conf) OSInfo ¶
func (c *Conf) OSInfo() *detect.LinuxOSInfo
type Env ¶
type ServerConf ¶
type ServerConf struct {
UUID string `toml:"uuid" yaml:"uuid"`
}
type WatcherConf ¶
Click to show internal directories.
Click to hide internal directories.