diff --git a/fileserver/fileserver.go b/fileserver/fileserver.go index f869fba..43066f1 100644 --- a/fileserver/fileserver.go +++ b/fileserver/fileserver.go @@ -72,7 +72,9 @@ func (f *LogFormatter) Format(entry *log.Entry) ([]byte, error) { func loadCcnetDB() { ccnetConfPath := filepath.Join(centralDir, "ccnet.conf") - config, err := ini.Load(ccnetConfPath) + opts := ini.LoadOptions{} + opts.SpaceBeforeInlineComment = true + config, err := ini.LoadSources(opts, ccnetConfPath) if err != nil { log.Fatalf("Failed to load ccnet.conf: %v", err) } @@ -171,7 +173,9 @@ func registerCA(capath string) { func loadSeafileDB() { seafileConfPath := filepath.Join(centralDir, "seafile.conf") - config, err := ini.Load(seafileConfPath) + opts := ini.LoadOptions{} + opts.SpaceBeforeInlineComment = true + config, err := ini.LoadSources(opts, seafileConfPath) if err != nil { log.Fatalf("Failed to load seafile.conf: %v", err) } diff --git a/fileserver/option/option.go b/fileserver/option/option.go index 2a04827..b73f647 100644 --- a/fileserver/option/option.go +++ b/fileserver/option/option.go @@ -80,7 +80,9 @@ func LoadFileServerOptions(centralDir string) { seafileConfPath := filepath.Join(centralDir, "seafile.conf") - config, err := ini.Load(seafileConfPath) + opts := ini.LoadOptions{} + opts.SpaceBeforeInlineComment = true + config, err := ini.LoadSources(opts, seafileConfPath) if err != nil { log.Fatalf("Failed to load seafile.conf: %v", err) } diff --git a/notification-server/server.go b/notification-server/server.go index a9f88d5..6d59e72 100644 --- a/notification-server/server.go +++ b/notification-server/server.go @@ -39,7 +39,9 @@ func init() { func loadNotifConfig() { notifyConfPath := filepath.Join(configDir, "seafile.conf") - config, err := ini.Load(notifyConfPath) + opts := ini.LoadOptions{} + opts.SpaceBeforeInlineComment = true + config, err := ini.LoadSources(opts, notifyConfPath) if err != nil { log.Fatalf("Failed to load notification.conf: %v", err) }