Полный продовый фикс fix22: DNS preflight, inet firewall, idempotent bootstrap, auth-semantics и redact-config

This commit is contained in:
2026-05-08 09:41:57 +05:00
parent 06540087fd
commit 97e679f69f
15 changed files with 268 additions and 47 deletions
+8 -3
View File
@@ -11,11 +11,16 @@ import (
)
func Hysteria2Auth(c *gin.Context) {
hysteria2AuthDto, err := validateField(c, dto.Hysteria2AuthDto{})
if err != nil {
var req dto.Hysteria2AuthDto
if err := c.ShouldBindJSON(&req); err != nil {
vo.Hysteria2AuthBadRequest(c)
return
}
id, username, err := service.Hysteria2Auth(*hysteria2AuthDto.Auth)
if req.Addr == nil || req.Auth == nil || req.Tx == nil {
vo.Hysteria2AuthBadRequest(c)
return
}
id, username, err := service.Hysteria2Auth(*req.Auth)
if err != nil || username == "" {
vo.Hysteria2AuthFail("", c)
return
+7
View File
@@ -24,6 +24,13 @@ func Hysteria2AuthFail(id string, c *gin.Context) {
})
}
func Hysteria2AuthBadRequest(c *gin.Context) {
c.JSON(http.StatusBadRequest, hysteria2Result{
Ok: false,
Id: "",
})
}
type Hysteria2SubscribeVo struct {
Url string `json:"url"`
QrCode []byte `json:"qrCode"`