mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
feat(wip): site category
This commit is contained in:
parent
ed3c02fc6f
commit
7ad5cac3b8
73 changed files with 713 additions and 235 deletions
|
@ -42,7 +42,7 @@ type Node struct {
|
|||
|
||||
var mutex sync.Mutex
|
||||
|
||||
type TNodeMap map[int]*Node
|
||||
type TNodeMap map[uint64]*Node
|
||||
|
||||
var NodeMap TNodeMap
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@ import (
|
|||
)
|
||||
|
||||
type ConfigPayload struct {
|
||||
CertID int `json:"cert_id"`
|
||||
CertID uint64 `json:"cert_id"`
|
||||
ServerName []string `json:"server_name"`
|
||||
ChallengeMethod string `json:"challenge_method"`
|
||||
DNSCredentialID int `json:"dns_credential_id"`
|
||||
ACMEUserID int `json:"acme_user_id"`
|
||||
DNSCredentialID uint64 `json:"dns_credential_id"`
|
||||
ACMEUserID uint64 `json:"acme_user_id"`
|
||||
KeyType certcrypto.KeyType `json:"key_type"`
|
||||
Resource *model.CertificateResource `json:"resource,omitempty"`
|
||||
MustStaple bool `json:"must_staple"`
|
||||
|
|
|
@ -80,7 +80,7 @@ func SyncToRemoteServer(c *model.Config, newFilepath string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func SyncRenameOnRemoteServer(origPath, newPath string, syncNodeIds []int) (err error) {
|
||||
func SyncRenameOnRemoteServer(origPath, newPath string, syncNodeIds []uint64) (err error) {
|
||||
if origPath == "" || newPath == "" || len(syncNodeIds) == 0 {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ func Proxy() gin.HandlerFunc {
|
|||
c.Next()
|
||||
return
|
||||
}
|
||||
id := cast.ToInt(nodeID)
|
||||
id := cast.ToUint64(nodeID)
|
||||
if id == 0 {
|
||||
c.Next()
|
||||
return
|
||||
|
|
|
@ -16,7 +16,7 @@ func ProxyWs() gin.HandlerFunc {
|
|||
c.Next()
|
||||
return
|
||||
}
|
||||
id := cast.ToInt(nodeID)
|
||||
id := cast.ToUint64(nodeID)
|
||||
if id == 0 {
|
||||
c.Next()
|
||||
return
|
||||
|
|
|
@ -46,16 +46,16 @@ func secureSessionIDCacheKey(sessionId string) string {
|
|||
return fmt.Sprintf("2fa_secure_session:_%s", sessionId)
|
||||
}
|
||||
|
||||
func SetSecureSessionID(userId int) (sessionId string) {
|
||||
func SetSecureSessionID(userId uint64) (sessionId string) {
|
||||
sessionId = uuid.NewString()
|
||||
cache.Set(secureSessionIDCacheKey(sessionId), userId, 5*time.Minute)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func VerifySecureSessionID(sessionId string, userId int) bool {
|
||||
func VerifySecureSessionID(sessionId string, userId uint64) bool {
|
||||
if v, ok := cache.Get(secureSessionIDCacheKey(sessionId)); ok {
|
||||
if v.(int) == userId {
|
||||
if v.(uint64) == userId {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ const ExpiredTime = 24 * time.Hour
|
|||
|
||||
type JWTClaims struct {
|
||||
Name string `json:"name"`
|
||||
UserID int `json:"user_id"`
|
||||
UserID uint64 `json:"user_id"`
|
||||
jwt.RegisteredClaims
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue