config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckConfig

func CheckConfig(config *Config) error

Types

type Config

type Config struct {
	Meta           MetaConfig        `json:"Meta,omitempty"`
	Keys           KeyConfig         `json:"Keys,omitempty"`
	Sec            SecurityConfig    `json:"Security,omitempty"`
	ReverseProxy   map[string]string `json:"ReverseProxy"`
	Webhook        map[string]string `json:"Webhook"`
	ConfigFilePath string            `json:"-"` // empty if stdin ($PWD used)
	DoMongo        bool              `json:"use-mongo"`
	Telegram       struct {
		AdminUsername string `json:"adminUser"`
		AdminChatID   int64  `json:"adminChat"`
		AuditChatID   int64  `json:"auditChat"`
	} `json:"Telegram"`
	Diamond struct {
		Kicks      bool `json:"Kicks"`
		SocketPath string
	} `json:"Diamond"`
}

type KeyConfig

type KeyConfig struct {
	GoogleClientID    string `json:"GoogleClientID"`
	GoogleSecretKey   string `json:"GoogleSecretKey"`
	GithubClientID    string `json:"GithubClientID"`
	GithubSecretKey   string `json:"GithubSecretKey"`
	TwitterClientID   string `json:"TwitterClientID"`
	TwitterSecretKey  string `json:"TwitterSecretKey"`
	LinkedInClientID  string `json:"LinkedInClientID"`
	LinkedInSecretKey string `json:"LinkedInSecretKey"`
	PayPalClientID    string `json:"PayPalClientID"`
	PayPalSecretKey   string `json:"PayPalSecretKey"`
	SendgridUser      string `json:"SendgridUser"`
	SendgridPassword  string `json:"SendgridPassword"`
	MailgunUser       string `json:"MailgunUser"`
	MailgunPassword   string `json:"MailgunPassword"`
	TwilioSID         string `json:"TwilioSID"`
	TwilioAuthToken   string `json:"TwilioAuthToken"`
	TelegramBot       string `json:"TelegramBot"`
}

type MetaConfig

type MetaConfig struct {
	Version         string                 `json:"-"`
	ListenAddr      string                 `json:"listen"`
	ListenAddrTLS   string                 `json:"listentls"`
	SiteName        string                 `json:"sitename"`
	SiteURL         string                 `json:"siteurl"`
	DevelopmentMode bool                   `json:"devmode"`
	CopyrightName   string                 `json:"copyright-name"`
	TemplateData    map[string]interface{} `json:"templatedata"`
	LiveTemplate    bool                   `json:"livetemplate"`
	PathTemplates   string                 `json:"templatedir"`
	PathPublic      string                 `json:"publicdir"`
}

type SecurityConfig

type SecurityConfig struct {
	HashKey     string `json:"hash-key"`
	BlockKey    string `json:"block-key"`
	CSRFKey     string `json:"csrf-key"`
	CookieName  string `json:"cookie-name"`
	Whitelist   string `json:"whitelist"`
	Blacklist   string `json:"blacklist"`
	ServePublic bool   `json:"servepublic"` // Serve All Unhandled URL in ./public
	BoltDB      string `json:"database"`
	OpenSignups bool   `json:"open-signups"`
	EnableShell bool   `json:"EnableShell"`
}

Jump to

Keyboard shortcuts

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