Русифицировать README и интерфейс HY2XS admin

This commit is contained in:
2026-04-25 23:51:21 +05:00
parent 84a4e94567
commit 2b4a45ad23
167 changed files with 632 additions and 699 deletions
+1
View File
@@ -156,3 +156,4 @@ func GetAccountInfo(c *gin.Context) (vo.AccountInfoVo, error) {
Roles: myClaims.AccountBo.Roles,
}, nil
}
+3 -2
View File
@@ -25,7 +25,7 @@ func UpdateConfig(key string, value string) error {
logrus.Errorf("hysteria2 config is empty")
return errors.New("hysteria2 config is empty")
}
// 启动Hysteria2
// Запуск Hysteria2
if err = StartHysteria2(); err != nil {
return err
}
@@ -73,7 +73,7 @@ func GetHysteria2Config() (bo.Hysteria2ServerConfig, error) {
}
func UpdateHysteria2Config(hysteria2ServerConfig bo.Hysteria2ServerConfig) error {
// 默认值
// Значения по умолчанию
config, err := dao.ListConfig("key in ?", []string{constant.HUIWebPort, constant.JwtSecret})
if err != nil {
return err
@@ -195,3 +195,4 @@ func GetAuthHttpUrl() (string, error) {
}
return fmt.Sprintf("%s://127.0.0.1:%d%s/hui/hysteria2/auth", protocol, port, webContext), nil
}
+3 -2
View File
@@ -32,10 +32,10 @@ func CronHandleAccount() {
return
}
// 保存流量数据
// Сохранение данных трафика
go saveAccountTraffic(apiPort, *jwtSecretConfig.Value)
// 踢下线
// Принудительное отключение
go kickAccount(apiPort, *jwtSecretConfig.Value)
}
}()
@@ -138,3 +138,4 @@ func kickAccount(apiPort int64, jwtSecret string) {
wg.Wait()
}
}
+4 -3
View File
@@ -113,9 +113,9 @@ func nftForward(rules string, target string, option string) error {
return fmt.Errorf("no network interface detected")
}
// nft list ruleset
// 创建表:nft add table inet hui_hysteria_porthopping
// 创建链:nft add chain inet hui_hysteria_porthopping prerouting { type nat hook prerouting priority dstnat\; policy accept\; }
// 添加规则:nft add rule inet hui_hysteria_porthopping prerouting iifname enp1s0 udp dport {30000-40000} counter redirect to :444 comment hui_hysteria_porthopping
// Создать таблицу: nft add table inet hui_hysteria_porthopping
// Создать chain: nft add chain inet hui_hysteria_porthopping prerouting { type nat hook prerouting priority dstnat\; policy accept\; }
// Добавить rule: nft add rule inet hui_hysteria_porthopping prerouting iifname enp1s0 udp dport {30000-40000} counter redirect to :444 comment hui_hysteria_porthopping
_, err := util.Exec(fmt.Sprintf("nft %s rule inet %s prerouting iifname %s udp dport {%s} counter redirect to :%s comment %s", option, Table, ingressInterface, rules, target, Comment))
if err != nil {
return err
@@ -232,3 +232,4 @@ func iptablesRules(protocol string) ([]string, error) {
rules := strings.Split(output, "\n")
return rules, nil
}
+1
View File
@@ -147,3 +147,4 @@ func Hysteria2AcmePath() (vo.Hysteria2AcmePathVo, error) {
}
return vo.Hysteria2AcmePathVo{}, errors.New("cert not found")
}
+2 -1
View File
@@ -24,7 +24,7 @@ func Hysteria2Auth(conPass string) (int64, string, error) {
return 0, "", err
}
// 限制设备数
// Ограничение количества устройств
onlineUsers, err := Hysteria2Online()
if err != nil {
return 0, "", err
@@ -280,3 +280,4 @@ func Hysteria2Url(accountId int64, hostname string) (string, error) {
}
return fmt.Sprintf("hysteria2://%s@%s%s", *account.ConPass, hostname, *hysteria2Config.Listen) + urlConfig, nil
}
+1
View File
@@ -58,3 +58,4 @@ func GetToken(c *gin.Context) string {
}
return strings.SplitN(tokenStr, " ", 2)[1]
}
+1
View File
@@ -62,3 +62,4 @@ func MonitorHysteria2() (vo.Hysteria2MonitorVo, error) {
hysteria2MonitorVo.Running = running
return hysteria2MonitorVo, nil
}
+1
View File
@@ -67,3 +67,4 @@ func GetServerPortAndCert() (int64, string, string, error) {
return port, crtPath, keyPath, nil
}