Documentation ¶
Index ¶
- Constants
- func DecodeKey(s string) (*[32]byte, error)
- func DoesExist(name string) bool
- func GenerateSecureKey() string
- func IsAdminSetup(db *storm.DB) bool
- func Reindex(db *storm.DB) error
- func SensorCfgFile(dir string) string
- func ServerCfgFile(dir string) string
- func Strip(s string) string
- func Wd() string
- type ARecord
- type CanDooer
- type Clone
- type Domain
- type EnvVars
- type FQDN
- func (fqdn *FQDN) BuildExternalIP()
- func (fqdn *FQDN) GetOutboundIP() (net.IP, error)
- func (fqdn *FQDN) Test(domain string)
- func (fqdn *FQDN) TestARecord(domain string) (bool, error)
- func (fqdn *FQDN) TestIP() (bool, error)
- func (fqdn *FQDN) TestPort443() (bool, error)
- func (fqdn *FQDN) TestPort80() (bool, error)
- type Https
- type IPMatch
- type LE
- type LETest
- type Port443
- type Port80
- type ProxyQueue
- type Sensor
- type SensorAuth
- type Service
- type ServiceCfg
- type Settings
- type Smtp
- type State
- type Team
- type Token
- type User
- func (u *User) Authenticate(password string) error
- func (user *User) Create(db *storm.DB) error
- func (user *User) CreateAdmin(db *storm.DB) error
- func (user *User) Delete(db *storm.DB) error
- func (u *User) HashPassword() error
- func (u User) ValidateCreateUser() error
- func (u User) ValidateLogin() error
- func (u User) ValidateSetup() error
- func (u *User) Wash()
Constants ¶
View Source
const ( ServerConfig = "server.json" SensorConfig = "sensor.json" DataDir = "data" StateProduction = "production" StateTest = "test" StateDevelopment = "development" )
View Source
const DefaultTeam = "Default"
View Source
const LEFailed = "fail"
View Source
const LEPending = "pending"
View Source
const LESuccess = "success"
View Source
const ZeroUUID = "00000000-0000-0000-0000-000000000000"
Variables ¶
This section is empty.
Functions ¶
func GenerateSecureKey ¶
func GenerateSecureKey() string
func IsAdminSetup ¶
func Reindex ¶
On startup reindex is called, though a bit dangerous, this is required should we change our datastructures, we want that change reflected in our data storage
func SensorCfgFile ¶
func ServerCfgFile ¶
Types ¶
type Clone ¶
type FQDN ¶
type FQDN struct { Port80 *Port80 Port443 *Port443 ARecord *ARecord IPMatch *IPMatch ExternalIP net.IP }
func (*FQDN) BuildExternalIP ¶
func (fqdn *FQDN) BuildExternalIP()
func (*FQDN) GetOutboundIP ¶
Get preferred outbound ip of this machine
func (*FQDN) TestPort443 ¶
func (*FQDN) TestPort80 ¶
type ProxyQueue ¶
type Sensor ¶
type Sensor struct { ID int64 `storm:"id,increment,index"` TeamID int64 `storm:"id,index" json:"team_id"` Name string `storm:"index,unique" json:"name"` Note string `storm:"index" json:"note"` ApiKey string `storm:"index,unique" json:"api_key"` Cfgs []ServiceCfg `storm:"index" json:"service_configs` Updated time.Time `storm:"index" json:"updated"` Created time.Time `storm:"index" json:"created"` }
func (*Sensor) ValidateCreate ¶
type SensorAuth ¶
type ServiceCfg ¶
type ServiceCfg struct { UUID uuid.UUID `storm:"index,unique" json:"uuid"` SensorID int64 `storm:"index" json:"sensor_id"` Port int `storm:"index" json:"port"` Type string `storm:"index" json:"type"` Service interface{} }
func NewServiceCfg ¶
func NewServiceCfg() (ServiceCfg, error)
type Settings ¶
type Settings struct { SessionHash []byte `json:"session_hash"` SessionBlock []byte `json:"session_block"` CsrfHash []byte `json:"csrf_hash"` BindAddr string `json:"bind_addr"` URI string `json:"base_uri"` LeEnabled bool `json:"lets_encrypt"` Host string `json:"-"` Port string `json:"-"` Scheme string `json:"-"` FQDN string `json:"-"` }
func InitSettings ¶
func NewSettings ¶
func (*Settings) BuildBaseURI ¶
func (*Settings) BuildBindAddr ¶
func (s *Settings) BuildBindAddr()
func (*Settings) CreateIfNew ¶
func (s *Settings) CreateIfNew()
func (*Settings) WriteSettings ¶
type Smtp ¶
type Smtp struct { ID int64 `storm:"id,increment,index"` Sender string Email string Host string Port string Username string Password string }
func (Smtp) ValidateSmtp ¶
type State ¶
type Team ¶
type Team struct { ID int64 `storm:"id,increment,index"` Name string `storm:"index,unique" json:"name"` IsDeleted bool `storm:"index" json:"is_deleted"` Members []string MemberToAdd string }
func (*Team) ValidateAddMember ¶
func (*Team) ValidateCreate ¶
type Token ¶
type Token struct { ID int64 `storm:"id,increment,index"` Name string `storm:"index,unique" json:"name"` TeamID int64 `storm:"index" json:"team_id"` Key string `storm:"unique" json:"key"` URL string `storm:"unique" json:"url"` Note string `storm:"index" json:"note"` Type string `storm:"index" json:"type"` // Weblink, Pdf, Docx TokenContext interface{} }
func (*Token) ValidateCreate ¶
type User ¶
type User struct { ID int64 `storm:"id,increment,index"` Email string `storm:"index,unique" json:"email"` Password string `json:"-"` PasswordConfirm string `json:"-"` IsDisabled bool `storm:"index" json:"is_disabled"` Hash string }
func (*User) Authenticate ¶
func (*User) HashPassword ¶
func (User) ValidateCreateUser ¶
func (User) ValidateLogin ¶
func (User) ValidateSetup ¶
Click to show internal directories.
Click to hide internal directories.