Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
166f25508c | ||
|
08f0c25dfc | ||
|
6cca88f027 | ||
|
f62934440d |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
||||
- uses: robinraju/release-downloader@v1
|
||||
with:
|
||||
repository: nezhahq/admin-frontend
|
||||
tag: v1.0.6
|
||||
tag: v1.0.11
|
||||
fileName: dist.zip
|
||||
latest: true
|
||||
extract: true
|
||||
|
@ -62,6 +62,7 @@ func updateProfile(c *gin.Context) (any, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
user.Username = pf.NewUsername
|
||||
user.Password = string(hash)
|
||||
if err := singleton.DB.Save(&user).Error; err != nil {
|
||||
return nil, newGormError("%v", err)
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
// @Description List server
|
||||
// @Tags auth required
|
||||
// @Produce json
|
||||
// @Success 200 {object} model.CommonResponse[[]model.WAF]
|
||||
// @Success 200 {object} model.CommonResponse[[]model.WAFApiMock]
|
||||
// @Router /waf [get]
|
||||
func listBlockedAddress(c *gin.Context) ([]*model.WAF, error) {
|
||||
var waf []*model.WAF
|
||||
|
@ -3,6 +3,7 @@ package rpc
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
"time"
|
||||
@ -63,6 +64,10 @@ func getRealIp(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo,
|
||||
}
|
||||
}
|
||||
|
||||
if singleton.Conf.Debug {
|
||||
log.Printf("NEZHA>> gRPC Real IP: %s", ip)
|
||||
}
|
||||
|
||||
ctx = context.WithValue(ctx, model.CtxKeyRealIP{}, ip)
|
||||
return handler(ctx, req)
|
||||
}
|
||||
|
@ -7,5 +7,6 @@ type UserForm struct {
|
||||
|
||||
type ProfileForm struct {
|
||||
OriginalPassword string `json:"original_password,omitempty"`
|
||||
NewUsername string `json:"new_username,omitempty"`
|
||||
NewPassword string `json:"new_password,omitempty"`
|
||||
}
|
||||
|
@ -16,6 +16,13 @@ const (
|
||||
WAFBlockReasonTypeAgentAuthFail
|
||||
)
|
||||
|
||||
type WAFApiMock struct {
|
||||
IP string `json:"ip,omitempty"`
|
||||
Count uint64 `json:"count,omitempty"`
|
||||
LastBlockReason uint8 `json:"last_block_reason,omitempty"`
|
||||
LastBlockTimestamp uint64 `json:"last_block_timestamp,omitempty"`
|
||||
}
|
||||
|
||||
type WAF struct {
|
||||
IP []byte `gorm:"type:binary(16);primaryKey" json:"ip,omitempty"`
|
||||
Count uint64 `json:"count,omitempty"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user