mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-09 19:29:03 +00:00
compatible with httpserver (#470)
This commit is contained in:
@@ -220,6 +220,25 @@ func loadFileServerOptions() {
|
|||||||
|
|
||||||
initDefaultOptions()
|
initDefaultOptions()
|
||||||
if section, err := config.GetSection("fileserver"); err == nil {
|
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 {
|
if key, err := section.GetKey("host"); err == nil {
|
||||||
options.host = key.String()
|
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() {
|
func initDefaultOptions() {
|
||||||
options.host = "0.0.0.0"
|
options.host = "0.0.0.0"
|
||||||
options.port = 8082
|
options.port = 8082
|
||||||
|
Reference in New Issue
Block a user