~netlandish/gobwebs

9f3b9589c74d59456829652a08267e734f46bd55 — Peter Sanchez 2 years ago 7922e44
Adding MediaURL to config
1 files changed, 5 insertions(+), 0 deletions(-)

M config/config.go
M config/config.go => config/config.go +5 -0
@@ 22,6 22,7 @@ type Config struct {

	EmailSvc   string
	StorageSvc string
	MediaURL   string

	AdminEmail       string
	EmailAdminErrors bool


@@ 55,6 56,7 @@ func LoadConfig(fname string) (*Config, error) {
		Timeout:          30,
		EmailSvc:         "console",
		StorageSvc:       "fs",
		MediaURL:         "/static/",
		AdminEmail:       "admin@localhost",
		EmailAdminErrors: true,
		DefaultFromEmail: "gobwebs@localhost",


@@ 109,6 111,9 @@ func LoadConfig(fname string) (*Config, error) {
		}
	}

	if val, ok := file.Get("gobwebs", "media-url"); ok {
		conf.MediaURL = val
	}
	if val, ok := file.Get("gobwebs", "admin-email"); ok {
		conf.AdminEmail = val
	}