mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: HMAC auth and check
This commit is contained in:
7
main.go
7
main.go
@@ -2,25 +2,22 @@ package main
|
||||
|
||||
import (
|
||||
"github.com/HFO4/cloudreve/models"
|
||||
"github.com/HFO4/cloudreve/pkg/auth"
|
||||
"github.com/HFO4/cloudreve/pkg/authn"
|
||||
"github.com/HFO4/cloudreve/pkg/conf"
|
||||
"github.com/HFO4/cloudreve/routers"
|
||||
"github.com/gin-gonic/gin"
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
conf.Init("conf/conf.ini")
|
||||
model.Init()
|
||||
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
|
||||
// Debug 关闭时,切换为生产模式
|
||||
if !conf.SystemConfig.Debug {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
}
|
||||
|
||||
auth.Init()
|
||||
authn.Init()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user