configs

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: GPL-3.0 Imports: 15 Imported by: 22

README

server/configs

Overview

Configuration loading and validation for the server. Parses config files, environment overrides, and applies defaults. Key routines cover crack, database, and HTTP C2 within the configs subsystem.

Go Files

  • crack.go – Defines configuration structures for cracking infrastructure.
  • database.go – Loads and validates database connection settings.
  • http-c2.go – Parses HTTP C2 configuration blocks.
  • http-c2_test.go (tests) – Tests HTTP C2 configuration parsing logic.
  • server.go – Top-level server configuration loading and defaults.

Documentation

Index

Constants

View Source
const (
	// Sqlite - SQLite protocol
	Sqlite = "sqlite3"
	// Postgres - Postgresql protocol
	Postgres = "postgresql"
	// MySQL - MySQL protocol
	MySQL = "mysql"
)
View Source
const (
	DefaultChromeBaseVer = 106
	DefaultMacOSVer      = "10_15_7"
)

Variables

View Source
var (
	ErrMissingCookies             = errors.New("server config must specify at least one cookie")
	ErrMissingExtensions          = errors.New("implant config must specify at least one file extension")
	ErrMissingFiles               = errors.New("implant config must specify at least one files value")
	ErrMissingPaths               = errors.New("implant config must specify at least one paths value")
	ErrDuplicateC2ProfileName     = errors.New("C2 Profile name is already in use")
	ErrMissingC2ProfileName       = errors.New("C2 Profile name is required")
	ErrC2ProfileNotFound          = errors.New("C2 Profile does not exist")
	ErrUserAgentIllegalCharacters = errors.New("user agent cannot contain the ` character")
)
View Source
var (

	// Pro-tip: You can use ChatGPT to generate this stuff for you!
	Cookies = []string{
		"JSESSIONID",
		"rememberMe",
		"authToken",
		"userId",
		"userName",
		"language",
		"theme",
		"locale",
		"currency",
		"lastVisited",
		"loggedIn",
		"userRole",
		"cartId",
		"accessToken",
		"refreshToken",
		"consent",
		"notificationPreference",
		"userSettings",
		"sessionTimeout",
		"error",
		"errorMessage",
		"successMessage",
		"infoMessage",
		"warningMessage",
		"errorMessageKey",
		"successMessageKey",
		"infoMessageKey",
		"warningMessageKey",
		"sessionID",
		"userID",
		"username",
		"authToken",
		"rememberMe",
		"language",
		"theme",
		"locale",
		"currency",
		"lastVisit",
		"loggedIn",
		"userRole",
		"cartID",
		"accessToken",
		"refreshToken",
		"consent",
		"notificationPref",
		"userSettings",
		"sessionTimeout",
		"visitedPages",
		"favoriteItems",
		"searchHistory",
		"basketID",
		"promoCode",
		"campaignID",
		"referrer",
		"source",
		"utmCampaign",
		"utmSource",
		"utmMedium",
		"utmContent",
		"utmTerm",
		"deviceType",
		"OSVersion",
		"browser",
		"screenResolution",
		"timezone",
		"firstVisit",
		"feedbackGiven",
		"surveyID",
		"errorAlerts",
		"successAlerts",
		"infoAlerts",
		"warningAlerts",
		"darkMode",
		"emailSubscription",
		"privacyConsent",
		"PHPSESSID",
		"SID",
		"SSID",
		"APISID",
		"csrf-state",
		"AWSALBCORS",
	}
	Files = []string{}/* 109 elements not displayed */

	Paths = []string{
		"js",
		"umd",
		"assets",
		"bundle",
		"bundles",
		"scripts",
		"script",
		"javascripts",
		"javascript",
		"jscript",
		"js",
		"scripts",
		"assets",
		"src",
		"lib",
		"public",
		"static",
		"app",
		"www",
		"dist",
		"frontend",
		"client",
		"server",
		"resources",
		"jsfiles",
		"javascript",
		"jslib",
		"jslibraries",
		"jsdir",
		"jsfolder",
		"jsfilesdir",
		"jsfilesfolder",
		"scriptsdir",
		"assetsjs",
		"srcjs",
		"srcscripts",
		"libjs",
		"libscripts",
		"publicjs",
		"publicscripts",
		"staticjs",
		"staticscripts",
		"appjs",
		"appscripts",
		"distjs",
		"distscripts",
		"frontendjs",
		"frontendscripts",
		"clientjs",
		"clientscripts",
		"serverjs",
		"resourcesjs",
		"jsfilesjs",
		"jsfilesscripts",
		"javascriptjs",
		"jslibscripts",
		"assetsjs",
		"assetsjsscripts",
		"assetsjs",
		"assetsscripts",
		"srcjs",
		"srcjsscripts",
		"srcscripts",
		"srcscripts",
		"libjs",
		"libjsscripts",
	}
)
View Source
var (
	// ErrInvalidDialect - An invalid dialect was specified
	ErrInvalidDialect = errors.New("invalid SQL Dialect")
)

Functions

func CheckHTTPC2ConfigErrors added in v1.5.4

func CheckHTTPC2ConfigErrors(config *clientpb.HTTPC2Config) error

CheckHTTPC2ConfigErrors - Get the current HTTP C2 config

func GenerateDefaultHTTPC2Config added in v1.6.0

func GenerateDefaultHTTPC2Config() *clientpb.HTTPC2Config

func GenerateDefaultHTTPC2Cookies added in v1.6.0

func GenerateDefaultHTTPC2Cookies() []*clientpb.HTTPC2Cookie

func GenerateHTTPC2DefaultPathSegment added in v1.6.0

func GenerateHTTPC2DefaultPathSegment() []*clientpb.HTTPC2PathSegment

func GetDatabaseConfigPath

func GetDatabaseConfigPath() string

GetDatabaseConfigPath - File path to config.yaml

func GetServerConfigPath

func GetServerConfigPath() string

GetServerConfigPath - File path to config.yaml

func LoadCrackConfig added in v1.6.0

func LoadCrackConfig() (*clientpb.CrackConfig, error)

LoadCrackConfig - Get config value

func SaveCrackConfig added in v1.6.0

func SaveCrackConfig(config *clientpb.CrackConfig) error

Save - Save config file to disk

Types

type AmazonSESConfig added in v1.6.9

type AmazonSESConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	AccessKeyID               string   `json:"access_key_id" yaml:"access_key_id"`
	SecretKey                 string   `json:"secret_key" yaml:"secret_key"`
	Region                    string   `json:"region" yaml:"region"`
	SenderAddress             string   `json:"sender_address" yaml:"sender_address"`
	Receivers                 []string `json:"receivers" yaml:"receivers"`
}

AmazonSESConfig - Amazon SES notifications.

type AmazonSNSConfig added in v1.6.9

type AmazonSNSConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	AccessKeyID               string   `json:"access_key_id" yaml:"access_key_id"`
	SecretKey                 string   `json:"secret_key" yaml:"secret_key"`
	Region                    string   `json:"region" yaml:"region"`
	Receivers                 []string `json:"receivers" yaml:"receivers"`
}

AmazonSNSConfig - Amazon SNS notifications.

type BarkConfig added in v1.6.9

type BarkConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	DeviceKey                 string   `json:"device_key" yaml:"device_key"`
	Servers                   []string `json:"servers,omitempty" yaml:"servers,omitempty"`
}

BarkConfig - Bark notifications.

type DNSJobConfig

type DNSJobConfig struct {
	Domains    []string `json:"domains" yaml:"domains"`
	Canaries   bool     `json:"canaries" yaml:"canaries"`
	Host       string   `json:"host" yaml:"host"`
	Port       uint16   `json:"port" yaml:"port"`
	JobID      string   `json:"job_id" yaml:"job_id"`
	EnforceOTP bool     `json:"enforce_otp" yaml:"enforce_otp"`
}

DNSJobConfig - Persistent DNS job config

type DaemonConfig

type DaemonConfig struct {
	Host      string `json:"host" yaml:"host"`
	Port      int    `json:"port" yaml:"port"`
	Tailscale bool   `json:"tailscale" yaml:"tailscale"`
}

DaemonConfig - Configure daemon mode

type DatabaseConfig

type DatabaseConfig struct {
	Dialect  string `json:"dialect" yaml:"dialect"`
	Database string `json:"database" yaml:"database"`
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
	Host     string `json:"host" yaml:"host"`
	Port     uint16 `json:"port" yaml:"port"`

	Params  map[string]string `json:"params" yaml:"params"`
	Pragmas map[string]string `json:"pragmas" yaml:"pragmas"`

	MaxIdleConns int `json:"max_idle_conns" yaml:"max_idle_conns"`
	MaxOpenConns int `json:"max_open_conns" yaml:"max_open_conns"`

	LogLevel string `json:"log_level" yaml:"log_level"`
}

DatabaseConfig - Server config

func GetDatabaseConfig

func GetDatabaseConfig() *DatabaseConfig

GetDatabaseConfig - Get config value

func (*DatabaseConfig) DSN

func (c *DatabaseConfig) DSN() (string, error)

DSN - Get the db connections string https://github.com/go-sql-driver/mysql#examples

func (*DatabaseConfig) Save

func (c *DatabaseConfig) Save() error

Save - Save config file to disk

type DingDingConfig added in v1.6.9

type DingDingConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	Token                     string `json:"token" yaml:"token"`
	Secret                    string `json:"secret" yaml:"secret"`
}

DingDingConfig - DingTalk notifications.

type DiscordConfig added in v1.6.9

type DiscordConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	Token                     string   `json:"token" yaml:"token"`
	TokenType                 string   `json:"token_type,omitempty" yaml:"token_type,omitempty"`
	Channels                  []string `json:"channels" yaml:"channels"`
}

DiscordConfig - Discord notifications.

type FCMConfig added in v1.6.9

type FCMConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	CredentialsFile           string   `json:"credentials_file,omitempty" yaml:"credentials_file,omitempty"`
	ProjectID                 string   `json:"project_id,omitempty" yaml:"project_id,omitempty"`
	DeviceTokens              []string `json:"device_tokens" yaml:"device_tokens"`
}

FCMConfig - Firebase Cloud Messaging notifications.

type GRPCConfig added in v1.7.0

type GRPCConfig struct {
	Keepalive *GRPCKeepaliveConfig `json:"keepalive" yaml:"keepalive"`
}

GRPCConfig - gRPC server settings

type GRPCKeepaliveConfig added in v1.7.0

type GRPCKeepaliveConfig struct {
	MinTimeSeconds      int64 `json:"min_time_seconds" yaml:"min_time_seconds"`
	PermitWithoutStream *bool `json:"permit_without_stream" yaml:"permit_without_stream"`
}

GRPCKeepaliveConfig - gRPC keepalive enforcement settings

type GoogleChatConfig added in v1.6.9

type GoogleChatConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	CredentialsFile           string   `json:"credentials_file,omitempty" yaml:"credentials_file,omitempty"`
	CredentialsJSON           string   `json:"credentials_json,omitempty" yaml:"credentials_json,omitempty"`
	Spaces                    []string `json:"spaces" yaml:"spaces"`
}

GoogleChatConfig - Google Chat notifications.

type HTTPConfig added in v1.6.9

type HTTPConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	URLs                      []string            `json:"urls,omitempty" yaml:"urls,omitempty"`
	Webhooks                  []HTTPWebhookConfig `json:"webhooks,omitempty" yaml:"webhooks,omitempty"`
}

HTTPConfig - HTTP webhook notifications.

type HTTPJobConfig

type HTTPJobConfig struct {
	Domain          string `json:"domain" yaml:"domain"`
	Host            string `json:"host" yaml:"host"`
	Port            uint16 `json:"port" yaml:"port"`
	Secure          bool   `json:"secure" yaml:"secure"`
	Website         string `json:"website" yaml:"website"`
	Cert            []byte `json:"cert" yaml:"cert"`
	Key             []byte `json:"key" yaml:"key"`
	ACME            bool   `json:"acme" yaml:"acme"`
	JobID           string `json:"job_id" yaml:"job_id"`
	EnforceOTP      bool   `json:"enforce_otp" yaml:"enforce_otp"`
	LongPollTimeout int64  `json:"long_poll_timeout" yaml:"long_poll_timeout"`
	LongPollJitter  int64  `json:"long_poll_jitter" yaml:"long_poll_jitter"`
	RandomizeJARM   bool   `json:"randomize_jarm" yaml:"randomize_jarm"`
}

HTTPJobConfig - Persistent HTTP job config

type HTTPWebhookConfig added in v1.6.9

type HTTPWebhookConfig struct {
	URL         string            `json:"url" yaml:"url"`
	Method      string            `json:"method,omitempty" yaml:"method,omitempty"`
	ContentType string            `json:"content_type,omitempty" yaml:"content_type,omitempty"`
	Headers     map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
}

HTTPWebhookConfig - Detailed webhook configuration.

type HttpDefaultConfig added in v1.6.0

type HttpDefaultConfig struct {
	Headers []HttpDefaultHeader `json:"headers" yaml:"headers"`
}

type HttpDefaultHeader added in v1.6.8

type HttpDefaultHeader struct {
	Method      string `json:"method" yaml:"method"`
	Name        string `json:"name" yaml:"name"`
	Value       string `json:"value" yaml:"value"`
	Probability int32  `json:"probability" yaml:"probability"`
}

http server defaults for anonymous requests

func (*HttpDefaultHeader) UnmarshalJSON added in v1.6.8

func (h *HttpDefaultHeader) UnmarshalJSON(data []byte) error

func (*HttpDefaultHeader) UnmarshalYAML added in v1.6.8

func (h *HttpDefaultHeader) UnmarshalYAML(node *yaml.Node) error

type JobConfig

type JobConfig struct {
	Multiplayer []*MultiplayerJobConfig `json:"multiplayer" yaml:"multiplayer"`
	MTLS        []*MTLSJobConfig        `json:"mtls,omitempty" yaml:"mtls,omitempty"`
	WG          []*WGJobConfig          `json:"wg,omitempty" yaml:"wg,omitempty"`
	DNS         []*DNSJobConfig         `json:"dns,omitempty" yaml:"dns,omitempty"`
	HTTP        []*HTTPJobConfig        `json:"http,omitempty" yaml:"http,omitempty"`
}

JobConfig - Restart Jobs on Load

type LarkConfig added in v1.6.9

type LarkConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	Webhook                   *LarkWebhookConfig   `json:"webhook,omitempty" yaml:"webhook,omitempty"`
	CustomApp                 *LarkCustomAppConfig `json:"custom_app,omitempty" yaml:"custom_app,omitempty"`
}

LarkConfig - Lark notifications.

type LarkCustomAppConfig added in v1.6.9

type LarkCustomAppConfig struct {
	AppID     string               `json:"app_id" yaml:"app_id"`
	AppSecret string               `json:"app_secret" yaml:"app_secret"`
	Receivers []LarkReceiverConfig `json:"receivers" yaml:"receivers"`
}

LarkCustomAppConfig - Lark custom app notifications.

type LarkReceiverConfig added in v1.6.9

type LarkReceiverConfig struct {
	Type string `json:"type" yaml:"type"`
	ID   string `json:"id" yaml:"id"`
}

LarkReceiverConfig - Lark receiver IDs.

type LarkWebhookConfig added in v1.6.9

type LarkWebhookConfig struct {
	URL string `json:"url" yaml:"url"`
}

LarkWebhookConfig - Lark webhook notifications.

type LineConfig added in v1.6.9

type LineConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	ChannelSecret             string   `json:"channel_secret" yaml:"channel_secret"`
	ChannelAccessToken        string   `json:"channel_access_token" yaml:"channel_access_token"`
	Receivers                 []string `json:"receivers" yaml:"receivers"`
}

LineConfig - Line bot notifications.

type LineNotifyConfig added in v1.6.9

type LineNotifyConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	Receivers                 []string `json:"receivers" yaml:"receivers"`
}

LineNotifyConfig - Line notify token notifications.

type LogConfig

type LogConfig struct {
	Level              int  `json:"level" yaml:"level"`
	GRPCUnaryPayloads  bool `json:"grpc_unary_payloads" yaml:"grpc_unary_payloads"`
	GRPCStreamPayloads bool `json:"grpc_stream_payloads" yaml:"grpc_stream_payloads"`
	TLSKeyLogger       bool `json:"tls_key_logger" yaml:"tls_key_logger"`
}

LogConfig - Server logging config

type MSTeamsConfig added in v1.6.9

type MSTeamsConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	Webhooks                  []string `json:"webhooks" yaml:"webhooks"`
	WrapText                  bool     `json:"wrap_text,omitempty" yaml:"wrap_text,omitempty"`
	DisableWebhookValidation  bool     `json:"disable_webhook_validation,omitempty" yaml:"disable_webhook_validation,omitempty"`
	UserAgent                 string   `json:"user_agent,omitempty" yaml:"user_agent,omitempty"`
}

MSTeamsConfig - Microsoft Teams notifications.

type MTLSJobConfig

type MTLSJobConfig struct {
	Host  string `json:"host" yaml:"host"`
	Port  uint16 `json:"port" yaml:"port"`
	JobID string `json:"job_id" yaml:"job_id"`
}

MTLSJobConfig - Per-type job configs

type MailConfig added in v1.6.9

type MailConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	SenderAddress             string   `json:"sender_address" yaml:"sender_address"`
	SMTPHost                  string   `json:"smtp_host" yaml:"smtp_host"`
	SMTPIdentity              string   `json:"smtp_identity,omitempty" yaml:"smtp_identity,omitempty"`
	SMTPUsername              string   `json:"smtp_username,omitempty" yaml:"smtp_username,omitempty"`
	SMTPPassword              string   `json:"smtp_password,omitempty" yaml:"smtp_password,omitempty"`
	SMTPAuthHost              string   `json:"smtp_auth_host,omitempty" yaml:"smtp_auth_host,omitempty"`
	BodyType                  string   `json:"body_type,omitempty" yaml:"body_type,omitempty"`
	Receivers                 []string `json:"receivers" yaml:"receivers"`
}

MailConfig - SMTP mail notifications.

type MailgunConfig added in v1.6.9

type MailgunConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	Domain                    string   `json:"domain" yaml:"domain"`
	APIKey                    string   `json:"api_key" yaml:"api_key"`
	SenderAddress             string   `json:"sender_address" yaml:"sender_address"`
	Receivers                 []string `json:"receivers" yaml:"receivers"`
}

MailgunConfig - Mailgun notifications.

type MatrixConfig added in v1.6.9

type MatrixConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	UserID                    string `json:"user_id" yaml:"user_id"`
	RoomID                    string `json:"room_id" yaml:"room_id"`
	HomeServer                string `json:"home_server" yaml:"home_server"`
	AccessToken               string `json:"access_token" yaml:"access_token"`
}

MatrixConfig - Matrix notifications.

type MattermostConfig added in v1.6.9

type MattermostConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	URL                       string   `json:"url" yaml:"url"`
	LoginID                   string   `json:"login_id,omitempty" yaml:"login_id,omitempty"`
	Password                  string   `json:"password,omitempty" yaml:"password,omitempty"`
	Channels                  []string `json:"channels" yaml:"channels"`
}

MattermostConfig - Mattermost notifications.

type MultiplayerJobConfig added in v1.5.0

type MultiplayerJobConfig struct {
	Host      string `json:"host" yaml:"host"`
	Port      uint16 `json:"port" yaml:"port"`
	JobID     string `json:"job_id" yaml:"job_id"`
	Tailscale bool   `json:"tailscale" yaml:"tailscale"`
}

type NotificationServiceConfig added in v1.6.9

type NotificationServiceConfig struct {
	Enabled bool     `json:"enabled" yaml:"enabled"`
	Events  []string `json:"events,omitempty" yaml:"events,omitempty"`
}

NotificationServiceConfig - Shared settings for notification services.

type NotificationTemplateConfig added in v1.6.9

type NotificationTemplateConfig struct {
	Type     string `json:"type,omitempty" yaml:"type,omitempty"`
	Template string `json:"template" yaml:"template"`
}

NotificationTemplateConfig - Per-event template configuration.

type NotificationsConfig added in v1.6.9

type NotificationsConfig struct {
	Enabled   bool                                   `json:"enabled" yaml:"enabled"`
	Events    []string                               `json:"events,omitempty" yaml:"events,omitempty"`
	Templates map[string]*NotificationTemplateConfig `json:"templates,omitempty" yaml:"templates,omitempty"`
	Services  *NotificationsServicesConfig           `json:"services,omitempty" yaml:"services,omitempty"`
}

NotificationsConfig - Notification configuration for the server.

type NotificationsServicesConfig added in v1.6.9

type NotificationsServicesConfig struct {
	AmazonSES     *AmazonSESConfig     `json:"amazon_ses,omitempty" yaml:"amazon_ses,omitempty"`
	AmazonSNS     *AmazonSNSConfig     `json:"amazon_sns,omitempty" yaml:"amazon_sns,omitempty"`
	Bark          *BarkConfig          `json:"bark,omitempty" yaml:"bark,omitempty"`
	DingDing      *DingDingConfig      `json:"dingding,omitempty" yaml:"dingding,omitempty"`
	Discord       *DiscordConfig       `json:"discord,omitempty" yaml:"discord,omitempty"`
	FCM           *FCMConfig           `json:"fcm,omitempty" yaml:"fcm,omitempty"`
	GoogleChat    *GoogleChatConfig    `json:"google_chat,omitempty" yaml:"google_chat,omitempty"`
	HTTP          *HTTPConfig          `json:"http,omitempty" yaml:"http,omitempty"`
	Lark          *LarkConfig          `json:"lark,omitempty" yaml:"lark,omitempty"`
	Line          *LineConfig          `json:"line,omitempty" yaml:"line,omitempty"`
	LineNotify    *LineNotifyConfig    `json:"line_notify,omitempty" yaml:"line_notify,omitempty"`
	Mail          *MailConfig          `json:"mail,omitempty" yaml:"mail,omitempty"`
	Mailgun       *MailgunConfig       `json:"mailgun,omitempty" yaml:"mailgun,omitempty"`
	Matrix        *MatrixConfig        `json:"matrix,omitempty" yaml:"matrix,omitempty"`
	Mattermost    *MattermostConfig    `json:"mattermost,omitempty" yaml:"mattermost,omitempty"`
	MSTeams       *MSTeamsConfig       `json:"msteams,omitempty" yaml:"msteams,omitempty"`
	PagerDuty     *PagerDutyConfig     `json:"pagerduty,omitempty" yaml:"pagerduty,omitempty"`
	Plivo         *PlivoConfig         `json:"plivo,omitempty" yaml:"plivo,omitempty"`
	Pushbullet    *PushbulletConfig    `json:"pushbullet,omitempty" yaml:"pushbullet,omitempty"`
	PushbulletSMS *PushbulletSMSConfig `json:"pushbullet_sms,omitempty" yaml:"pushbullet_sms,omitempty"`
	Pushover      *PushoverConfig      `json:"pushover,omitempty" yaml:"pushover,omitempty"`
	Reddit        *RedditConfig        `json:"reddit,omitempty" yaml:"reddit,omitempty"`
	RocketChat    *RocketChatConfig    `json:"rocketchat,omitempty" yaml:"rocketchat,omitempty"`
	SendGrid      *SendGridConfig      `json:"sendgrid,omitempty" yaml:"sendgrid,omitempty"`
	Slack         *SlackConfig         `json:"slack,omitempty" yaml:"slack,omitempty"`
	Syslog        *SyslogConfig        `json:"syslog,omitempty" yaml:"syslog,omitempty"`
	Telegram      *TelegramConfig      `json:"telegram,omitempty" yaml:"telegram,omitempty"`
	TextMagic     *TextMagicConfig     `json:"textmagic,omitempty" yaml:"textmagic,omitempty"`
	Twilio        *TwilioConfig        `json:"twilio,omitempty" yaml:"twilio,omitempty"`
	Twitter       *TwitterConfig       `json:"twitter,omitempty" yaml:"twitter,omitempty"`
	Viber         *ViberConfig         `json:"viber,omitempty" yaml:"viber,omitempty"`
	WebPush       *WebPushConfig       `json:"webpush,omitempty" yaml:"webpush,omitempty"`
	WeChat        *WeChatConfig        `json:"wechat,omitempty" yaml:"wechat,omitempty"`
	WhatsApp      *WhatsAppConfig      `json:"whatsapp,omitempty" yaml:"whatsapp,omitempty"`
}

NotificationsServicesConfig - Available notification services.

type PagerDutyConfig added in v1.6.9

type PagerDutyConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	Token                     string   `json:"token" yaml:"token"`
	FromAddress               string   `json:"from_address" yaml:"from_address"`
	Receivers                 []string `json:"receivers" yaml:"receivers"`
	NotificationType          string   `json:"notification_type,omitempty" yaml:"notification_type,omitempty"`
	Urgency                   string   `json:"urgency,omitempty" yaml:"urgency,omitempty"`
	PriorityID                string   `json:"priority_id,omitempty" yaml:"priority_id,omitempty"`
}

PagerDutyConfig - PagerDuty notifications.

type PlivoConfig added in v1.6.9

type PlivoConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	AuthID                    string   `json:"auth_id" yaml:"auth_id"`
	AuthToken                 string   `json:"auth_token" yaml:"auth_token"`
	Source                    string   `json:"source" yaml:"source"`
	CallbackURL               string   `json:"callback_url,omitempty" yaml:"callback_url,omitempty"`
	CallbackMethod            string   `json:"callback_method,omitempty" yaml:"callback_method,omitempty"`
	Receivers                 []string `json:"receivers" yaml:"receivers"`
}

PlivoConfig - Plivo notifications.

type PushbulletConfig added in v1.6.9

type PushbulletConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	APIToken                  string   `json:"api_token" yaml:"api_token"`
	DeviceNicknames           []string `json:"device_nicknames" yaml:"device_nicknames"`
}

PushbulletConfig - Pushbullet notifications.

type PushbulletSMSConfig added in v1.6.9

type PushbulletSMSConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	APIToken                  string   `json:"api_token" yaml:"api_token"`
	DeviceNickname            string   `json:"device_nickname" yaml:"device_nickname"`
	PhoneNumbers              []string `json:"phone_numbers" yaml:"phone_numbers"`
}

PushbulletSMSConfig - Pushbullet SMS notifications.

type PushoverConfig added in v1.6.9

type PushoverConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	AppToken                  string   `json:"app_token" yaml:"app_token"`
	Recipients                []string `json:"recipients" yaml:"recipients"`
}

PushoverConfig - Pushover notifications.

type RedditConfig added in v1.6.9

type RedditConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	ClientID                  string   `json:"client_id" yaml:"client_id"`
	ClientSecret              string   `json:"client_secret" yaml:"client_secret"`
	Username                  string   `json:"username" yaml:"username"`
	Password                  string   `json:"password" yaml:"password"`
	Recipients                []string `json:"recipients" yaml:"recipients"`
}

RedditConfig - Reddit notifications.

type RocketChatConfig added in v1.6.9

type RocketChatConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	ServerURL                 string   `json:"server_url" yaml:"server_url"`
	Scheme                    string   `json:"scheme" yaml:"scheme"`
	UserID                    string   `json:"user_id" yaml:"user_id"`
	Token                     string   `json:"token" yaml:"token"`
	Channels                  []string `json:"channels" yaml:"channels"`
}

RocketChatConfig - Rocket.Chat notifications.

type SendGridConfig added in v1.6.9

type SendGridConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	APIKey                    string   `json:"api_key" yaml:"api_key"`
	SenderAddress             string   `json:"sender_address" yaml:"sender_address"`
	SenderName                string   `json:"sender_name" yaml:"sender_name"`
	Receivers                 []string `json:"receivers" yaml:"receivers"`
}

SendGridConfig - SendGrid notifications.

type ServerConfig

type ServerConfig struct {
	DaemonMode    bool                 `json:"daemon_mode" yaml:"daemon_mode"`
	DaemonConfig  *DaemonConfig        `json:"daemon" yaml:"daemon"`
	Logs          *LogConfig           `json:"logs" yaml:"logs"`
	GRPC          *GRPCConfig          `json:"grpc" yaml:"grpc"`
	Watchtower    *WatchTowerConfig    `json:"watch_tower" yaml:"watch_tower"`
	GoProxy       string               `json:"go_proxy" yaml:"go_proxy"`
	HTTPDefaults  *HttpDefaultConfig   `json:"http_default" yaml:"http_default"`
	Notifications *NotificationsConfig `json:"notifications" yaml:"notifications"`

	// 'GOOS/GOARCH' -> CC path
	CC  map[string]string `json:"cc" yaml:"cc"`
	CXX map[string]string `json:"cxx" yaml:"cxx"`
}

ServerConfig - Server config

func GetServerConfig

func GetServerConfig() *ServerConfig

GetServerConfig - Get config value

func (*ServerConfig) Save

func (c *ServerConfig) Save() error

Save - Save config file to disk

type SlackConfig added in v1.6.9

type SlackConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	APIToken                  string   `json:"api_token" yaml:"api_token"`
	Channels                  []string `json:"channels" yaml:"channels"`
}

SlackConfig - Slack notifications.

type SyslogConfig added in v1.6.9

type SyslogConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	Priority                  string `json:"priority,omitempty" yaml:"priority,omitempty"`
	Network                   string `json:"network,omitempty" yaml:"network,omitempty"`
	Address                   string `json:"address,omitempty" yaml:"address,omitempty"`
	Tag                       string `json:"tag,omitempty" yaml:"tag,omitempty"`
}

SyslogConfig - Syslog notifications.

type TelegramConfig added in v1.6.9

type TelegramConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	APIToken                  string   `json:"api_token" yaml:"api_token"`
	ChatIDs                   []string `json:"chat_ids" yaml:"chat_ids"`
	ParseMode                 string   `json:"parse_mode,omitempty" yaml:"parse_mode,omitempty"`
}

TelegramConfig - Telegram notifications.

type TextMagicConfig added in v1.6.9

type TextMagicConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	Username                  string   `json:"username" yaml:"username"`
	APIKey                    string   `json:"api_key" yaml:"api_key"`
	PhoneNumbers              []string `json:"phone_numbers" yaml:"phone_numbers"`
}

TextMagicConfig - TextMagic notifications.

type TwilioConfig added in v1.6.9

type TwilioConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	AccountSID                string   `json:"account_sid" yaml:"account_sid"`
	AuthToken                 string   `json:"auth_token" yaml:"auth_token"`
	FromNumber                string   `json:"from_number" yaml:"from_number"`
	PhoneNumbers              []string `json:"phone_numbers" yaml:"phone_numbers"`
}

TwilioConfig - Twilio notifications.

type TwitterConfig added in v1.6.9

type TwitterConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	ConsumerKey               string   `json:"consumer_key" yaml:"consumer_key"`
	ConsumerSecret            string   `json:"consumer_secret" yaml:"consumer_secret"`
	AccessToken               string   `json:"access_token" yaml:"access_token"`
	AccessTokenSecret         string   `json:"access_token_secret" yaml:"access_token_secret"`
	Recipients                []string `json:"recipients" yaml:"recipients"`
}

TwitterConfig - Twitter notifications.

type ViberConfig added in v1.6.9

type ViberConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	AppKey                    string   `json:"app_key" yaml:"app_key"`
	SenderName                string   `json:"sender_name" yaml:"sender_name"`
	SenderAvatar              string   `json:"sender_avatar,omitempty" yaml:"sender_avatar,omitempty"`
	Receivers                 []string `json:"receivers" yaml:"receivers"`
	WebhookURL                string   `json:"webhook_url,omitempty" yaml:"webhook_url,omitempty"`
}

ViberConfig - Viber notifications.

type WGJobConfig added in v1.4.9

type WGJobConfig struct {
	Port    uint16 `json:"port" yaml:"port"`
	NPort   uint16 `json:"nport" yaml:"nport"`
	KeyPort uint16 `json:"key_port" yaml:"key_port"`
	JobID   string `json:"job_id" yaml:"job_id"`
}

WGJobConfig - Per-type job configs

type WatchTowerConfig added in v1.4.17

type WatchTowerConfig struct {
	VTApiKey          string `json:"vt_api_key" yaml:"vt_api_key"`
	XForceApiKey      string `json:"xforce_api_key" yaml:"xforce_api_key"`
	XForceApiPassword string `json:"xforce_api_password" yaml:"xforce_api_password"`
}

WatchTowerConfig - Watch Tower job config

type WeChatConfig added in v1.6.9

type WeChatConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	AppID                     string   `json:"app_id" yaml:"app_id"`
	AppSecret                 string   `json:"app_secret" yaml:"app_secret"`
	Token                     string   `json:"token" yaml:"token"`
	EncodingAESKey            string   `json:"encoding_aes_key" yaml:"encoding_aes_key"`
	Receivers                 []string `json:"receivers" yaml:"receivers"`
}

WeChatConfig - WeChat notifications.

type WebPushConfig added in v1.6.9

type WebPushConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	VAPIDPublicKey            string                      `json:"vapid_public_key" yaml:"vapid_public_key"`
	VAPIDPrivateKey           string                      `json:"vapid_private_key" yaml:"vapid_private_key"`
	Subscriptions             []WebPushSubscriptionConfig `json:"subscriptions" yaml:"subscriptions"`
}

WebPushConfig - Webpush notifications.

type WebPushKeysConfig added in v1.6.9

type WebPushKeysConfig struct {
	Auth   string `json:"auth" yaml:"auth"`
	P256DH string `json:"p256dh" yaml:"p256dh"`
}

WebPushKeysConfig - Webpush subscription keys.

type WebPushSubscriptionConfig added in v1.6.9

type WebPushSubscriptionConfig struct {
	Endpoint string            `json:"endpoint" yaml:"endpoint"`
	Keys     WebPushKeysConfig `json:"keys" yaml:"keys"`
}

WebPushSubscriptionConfig - Webpush subscription data.

type WhatsAppConfig added in v1.6.9

type WhatsAppConfig struct {
	NotificationServiceConfig `json:",inline" yaml:",inline"`
	Receivers                 []string `json:"receivers,omitempty" yaml:"receivers,omitempty"`
}

WhatsAppConfig - WhatsApp notifications.

Jump to

Keyboard shortcuts

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