From 946744a654ed5b9e3d905400f5e7f6cced8759d0 Mon Sep 17 00:00:00 2001 From: Peter Sanchez Date: Mon, 17 Oct 2022 11:12:54 -0600 Subject: [PATCH] Adding StaticURL to config --- config/config.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index fa07864..cd307ba 100644 --- a/config/config.go +++ b/config/config.go @@ -22,7 +22,9 @@ type Config struct { EmailSvc string StorageSvc string - MediaURL string + + StaticURL string + MediaURL string AdminEmail string EmailAdminErrors bool @@ -56,7 +58,8 @@ func LoadConfig(fname string) (*Config, error) { Timeout: 30, EmailSvc: "console", StorageSvc: "fs", - MediaURL: "/static/", + StaticURL: "/static", + MediaURL: "/media", AdminEmail: "admin@localhost", EmailAdminErrors: true, DefaultFromEmail: "gobwebs@localhost", @@ -111,6 +114,9 @@ func LoadConfig(fname string) (*Config, error) { } } + if val, ok := file.Get("gobwebs", "static-url"); ok { + conf.StaticURL = val + } if val, ok := file.Get("gobwebs", "media-url"); ok { conf.MediaURL = val } -- 2.45.2