diff options
| author | Hamidreza Ghavami <hamid.r.gh.1998@gmail.com> | 2023-04-13 22:33:46 +0300 |
|---|---|---|
| committer | Hamidreza Ghavami <hamid.r.gh.1998@gmail.com> | 2023-04-13 22:33:46 +0300 |
| commit | 4548755375b1a0d87812a1e32c0a2f63d9f0e5e2 (patch) | |
| tree | 76071451ec983cd1efad6314ee529157d6bb38c6 | |
| parent | 0c047cf1245411394d77c3d7880bfc7466716856 (diff) | |
update db config path
| -rw-r--r-- | config/config.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/config/config.go b/config/config.go index e1c7f911..e3fe1709 100644 --- a/config/config.go +++ b/config/config.go @@ -45,6 +45,22 @@ func IsDebug() bool { return os.Getenv("XUI_DEBUG") == "true" } +func GetBinFolderPath() string { + binFolderPath := os.Getenv("XUI_BIN_FOLDER") + if binFolderPath == "" { + binFolderPath = "bin" + } + return binFolderPath +} + +func GetDBFolderPath() string { + dbFolderPath := os.Getenv("XUI_DB_FOLDER") + if dbFolderPath == "" { + dbFolderPath = "/etc/x-ui" + } + return dbFolderPath +} + func GetDBPath() string { - return fmt.Sprintf("/etc/%s/%s.db", GetName(), GetName()) + return fmt.Sprintf("%s/%s.db", GetDBFolderPath(), GetName()) } |
