diff options
Diffstat (limited to 'internal/config/config.go')
-rw-r--r-- | internal/config/config.go | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index d2eabf0..578390e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -5,7 +5,6 @@ import ( "log/slog" "net/url" "os" - "strconv" "github.com/BurntSushi/toml" "github.com/pkg/errors" @@ -31,18 +30,17 @@ func (u *URL) UnmarshalText(text []byte) (err error) { } type Config struct { - DefaultLanguage string `toml:"default_language"` - BaseURL URL `toml:"base_url"` - RedirectOtherHostnames bool `toml:"redirect_other_hostnames"` - Port uint64 - Production bool - Title string - Email string - Description string - DomainStartDate string `toml:"domain_start_date"` - OriginalDomain string `toml:"original_domain"` - Taxonomies []Taxonomy - Extra struct { + DefaultLanguage string `toml:"default_language"` + BaseURL URL `toml:"base_url"` + InjectLiveReload bool + Title string + Email string + Description string + DomainStartDate string `toml:"domain_start_date"` + OriginalDomain string `toml:"original_domain"` + Taxonomies []Taxonomy + CSP *CSP `toml:"content-security-policy"` + Extra struct { Headers map[string]string } Menus map[string][]MenuItem @@ -71,10 +69,5 @@ func GetConfig() (*Config, error) { return nil, errors.Wrap(err, "config error") } } - port, err := strconv.ParseUint(getEnvFallback("PORT", "3000"), 10, 16) - if err != nil { - return nil, err - } - config.Port = port return &config, nil } |