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:
authorMHSanaei <ho3ein.sanaei@gmail.com>2026-04-27 16:31:32 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2026-04-27 16:31:32 +0300
commit0b5c239f98fd112df10ed4846377563a391ebf60 (patch)
tree6ace1372b4f081ad4ba183db7f13187983c5cf45
parent03393c9f527b62c124ea72120a62c92f3d269d30 (diff)
v2.9.3v2.9.3
-rw-r--r--config/version2
-rw-r--r--main.go20
-rw-r--r--web/assets/js/model/inbound.js6
3 files changed, 18 insertions, 10 deletions
diff --git a/config/version b/config/version
index 391e9856..eafef0d4 100644
--- a/config/version
+++ b/config/version
@@ -1 +1 @@
-2.9.2 \ No newline at end of file
+2.9.3 \ No newline at end of file
diff --git a/main.go b/main.go
index f8d3357b..20724169 100644
--- a/main.go
+++ b/main.go
@@ -130,20 +130,22 @@ func runWebServer() {
}
// resetSetting resets all panel settings to their default values.
-func resetSetting() {
+func resetSetting() error {
err := database.InitDB(config.GetDBPath())
if err != nil {
fmt.Println("Failed to initialize database:", err)
- return
+ return err
}
settingService := service.SettingService{}
err = settingService.ResetSettings()
if err != nil {
fmt.Println("Failed to reset settings:", err)
+ return err
} else {
fmt.Println("Settings successfully reset.")
}
+ return nil
}
// showSetting displays the current panel settings if show is true.
@@ -255,11 +257,11 @@ func updateTgbotSetting(tgBotToken string, tgBotChatid string, tgBotRuntime stri
}
// updateSetting updates various panel settings including port, credentials, base path, listen IP, and two-factor authentication.
-func updateSetting(port int, username string, password string, webBasePath string, listenIP string, resetTwoFactor bool) {
+func updateSetting(port int, username string, password string, webBasePath string, listenIP string, resetTwoFactor bool) error {
err := database.InitDB(config.GetDBPath())
if err != nil {
fmt.Println("Database initialization failed:", err)
- return
+ return err
}
settingService := service.SettingService{}
@@ -311,6 +313,8 @@ func updateSetting(port int, username string, password string, webBasePath strin
fmt.Printf("listen %v set successfully", listenIP)
}
}
+
+ return nil
}
// updateCert updates the SSL certificate files for the panel.
@@ -481,9 +485,13 @@ func main() {
return
}
if reset {
- resetSetting()
+ if err = resetSetting(); err != nil {
+ return
+ }
} else {
- updateSetting(port, username, password, webBasePath, listenIP, resetTwoFactor)
+ if err = updateSetting(port, username, password, webBasePath, listenIP, resetTwoFactor); err != nil {
+ return
+ }
}
if show {
showSetting(show)
diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js
index e002ac91..f695d251 100644
--- a/web/assets/js/model/inbound.js
+++ b/web/assets/js/model/inbound.js
@@ -3,12 +3,12 @@ const Protocols = {
VLESS: 'vless',
TROJAN: 'trojan',
SHADOWSOCKS: 'shadowsocks',
- TUNNEL: 'tunnel',
+ WIREGUARD: 'wireguard',
+ HYSTERIA: 'hysteria',
MIXED: 'mixed',
HTTP: 'http',
- WIREGUARD: 'wireguard',
+ TUNNEL: 'tunnel',
TUN: 'tun',
- HYSTERIA: 'hysteria',
};
const SSMethods = {