email kinda working
This commit is contained in:
@@ -46,6 +46,7 @@ type DatabaseConfig struct {
|
||||
type ServerConfig struct {
|
||||
BindAddress string `yaml:"bind_address"`
|
||||
PublicURL string `yaml:"public_url"`
|
||||
EmailDomain string `yaml:"email_domain"`
|
||||
Redaction string `yaml:"redaction_text"`
|
||||
DefaultClass string `yaml:"default_class"`
|
||||
}
|
||||
@@ -58,9 +59,17 @@ func (s ServerConfig) BasePath() string {
|
||||
return strings.TrimSuffix(u.Path, "/")
|
||||
}
|
||||
|
||||
type SMTPConfig struct {
|
||||
Host string `yaml:"host"`
|
||||
Port int `yaml:"port"`
|
||||
User string `yaml:"user"`
|
||||
Password string `yaml:"password"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Server ServerConfig `yaml:"server"`
|
||||
Database DatabaseConfig `yaml:"database"`
|
||||
SMTP SMTPConfig `yaml:"smtp"`
|
||||
Users []User `yaml:"users"`
|
||||
Calendars []Calendar `yaml:"calendars"`
|
||||
Aggregates []Aggregate `yaml:"aggregates"`
|
||||
@@ -100,7 +109,16 @@ func (c *Config) setDefaults() {
|
||||
if c.Server.DefaultClass == "" {
|
||||
c.Server.DefaultClass = "CONFIDENTIAL"
|
||||
}
|
||||
if c.Server.EmailDomain == "" {
|
||||
c.Server.EmailDomain = "nx2.site"
|
||||
}
|
||||
if c.Database.URL == "" {
|
||||
c.Database.URL = "postgres://nxcaldav@localhost:5432/nxcaldav?sslmode=disable"
|
||||
}
|
||||
if c.SMTP.Host == "" {
|
||||
c.SMTP.Host = "localhost"
|
||||
}
|
||||
if c.SMTP.Port == 0 {
|
||||
c.SMTP.Port = 25
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user