mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-09 11:18:54 +00:00
compatible with httpserver (#470)
This commit is contained in:
@@ -220,6 +220,25 @@ func loadFileServerOptions() {
|
||||
|
||||
initDefaultOptions()
|
||||
if section, err := config.GetSection("fileserver"); err == nil {
|
||||
parseFileServerSection(section)
|
||||
} else if section, err := config.GetSection("httpserver"); err == nil {
|
||||
parseFileServerSection(section)
|
||||
}
|
||||
|
||||
ccnetConfPath := filepath.Join(centralDir, "ccnet.conf")
|
||||
config, err = ini.Load(ccnetConfPath)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to load ccnet.conf: %v", err)
|
||||
}
|
||||
groupTableName = "Group"
|
||||
if section, err := config.GetSection("GROUP"); err == nil {
|
||||
if key, err := section.GetKey("TABLE_NAME"); err == nil {
|
||||
groupTableName = key.String()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func parseFileServerSection(section *ini.Section) {
|
||||
if key, err := section.GetKey("host"); err == nil {
|
||||
options.host = key.String()
|
||||
}
|
||||
@@ -255,19 +274,6 @@ func loadFileServerOptions() {
|
||||
}
|
||||
}
|
||||
|
||||
ccnetConfPath := filepath.Join(centralDir, "ccnet.conf")
|
||||
config, err = ini.Load(ccnetConfPath)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to load ccnet.conf: %v", err)
|
||||
}
|
||||
groupTableName = "Group"
|
||||
if section, err := config.GetSection("GROUP"); err == nil {
|
||||
if key, err := section.GetKey("TABLE_NAME"); err == nil {
|
||||
groupTableName = key.String()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func initDefaultOptions() {
|
||||
options.host = "0.0.0.0"
|
||||
options.port = 8082
|
||||
|
Reference in New Issue
Block a user