1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-12 21:35:30 +00:00

Allow comment sybols # and ; inside values (#615)

Co-authored-by: heran yang <heran.yang@seafile.com>
This commit is contained in:
feiniks
2023-05-31 15:11:44 +08:00
committed by GitHub
parent 4d02cb14a3
commit 29e48dafa9
3 changed files with 12 additions and 4 deletions

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}