mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-20 16:07:47 +08:00
fix docker defaults to writable /data config path and align docs
This commit is contained in:
@@ -30,6 +30,11 @@ func ResolvePath(envKey, defaultRel string) string {
|
||||
}
|
||||
|
||||
func ConfigPath() string {
|
||||
if strings.TrimSpace(os.Getenv("DS2API_CONFIG_PATH")) == "" && BaseDir() == "/app" {
|
||||
// Official container images commonly run from /app where filesystem may be read-only.
|
||||
// Prefer /data default so deployments can persist config/token state by mounting a volume.
|
||||
return "/data/config.json"
|
||||
}
|
||||
return ResolvePath("DS2API_CONFIG_PATH", "config.json")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user