Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorHamidreza Ghavami <hamid.r.gh.1998@gmail.com>2023-04-13 22:33:46 +0300
committerHamidreza Ghavami <hamid.r.gh.1998@gmail.com>2023-04-13 22:33:46 +0300
commit4548755375b1a0d87812a1e32c0a2f63d9f0e5e2 (patch)
tree76071451ec983cd1efad6314ee529157d6bb38c6 /config
parent0c047cf1245411394d77c3d7880bfc7466716856 (diff)
update db config path
Diffstat (limited to 'config')
-rw-r--r--config/config.go18
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())
}