diff options
author | FChannel <> | 2022-05-05 10:05:40 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | af542e339e5a611d2a1b5876450bee841b577640 (patch) | |
tree | 987f4fce83d49605a0a81d68fcfac9b2d57cf8a7 /main.go | |
parent | 493fc8e025fd613d9faf0b573d610e4a0e0c0228 (diff) |
removed redis dependency
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -4,6 +4,7 @@ import ( "fmt" "html/template" "io/ioutil" + "log" "math/rand" "path" "regexp" @@ -18,6 +19,7 @@ import ( "github.com/FChannel0/FChannel-Server/util" "github.com/FChannel0/FChannel-Server/webfinger" "github.com/gofiber/fiber/v2" + "github.com/gofiber/fiber/v2/middleware/encryptcookie" "github.com/gofiber/fiber/v2/middleware/logger" "github.com/gofiber/template/html" @@ -29,7 +31,6 @@ func main() { Init() defer db.Close() - defer db.CloseCache() // Routing and templates template := html.New("./views", ".html") @@ -44,6 +45,16 @@ func main() { app.Use(logger.New()) + cookieKey, err := util.GetCookieKey() + + if err != nil { + log.Println(err) + } + + app.Use(encryptcookie.New(encryptcookie.Config{ + Key: cookieKey, + })) + app.Static("/static", "./views") app.Static("/static", "./static") app.Static("/public", "./public") @@ -111,8 +122,6 @@ func Init() { db.ConnectDB() - db.InitCache() - db.RunDatabaseSchema() go db.MakeCaptchas(100) |