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
diff options
context:
space:
mode:
authorAli Golzar <57574919+aliglzr@users.noreply.github.com>2025-05-17 13:33:22 +0300
committerGitHub <noreply@github.com>2025-05-17 13:33:22 +0300
commit1b1cbfff422e6de58a6f524336b19ec809eb45f0 (patch)
treee0637ad401b23fa151e9e7d68bf48f57d03668aa /main.go
parentc93467b85290a15b55c7fa3dde99e2c383a4829e (diff)
feat: support .env file (#3013)
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.go b/main.go
index a94a899b..dcbd3c9e 100644
--- a/main.go
+++ b/main.go
@@ -13,11 +13,12 @@ import (
"x-ui/database"
"x-ui/logger"
"x-ui/sub"
+ "x-ui/util/crypto"
"x-ui/web"
"x-ui/web/global"
"x-ui/web/service"
- "x-ui/util/crypto"
+ "github.com/joho/godotenv"
"github.com/op/go-logging"
)
@@ -39,6 +40,8 @@ func runWebServer() {
log.Fatalf("Unknown log level: %v", config.GetLogLevel())
}
+ godotenv.Load()
+
err := database.InitDB(config.GetDBPath())
if err != nil {
log.Fatalf("Error initializing database: %v", err)