mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-07 00:46:58 +03:00
Fixes security issue & Adds support to sent configuration via email (#83)
This commit is contained in:
parent
7edcd1b80c
commit
1711530dda
13 changed files with 335 additions and 76 deletions
|
@ -6,7 +6,7 @@ import (
|
|||
"reflect"
|
||||
"text/template"
|
||||
|
||||
"github.com/GeertJohan/go.rice"
|
||||
rice "github.com/GeertJohan/go.rice"
|
||||
"github.com/gorilla/sessions"
|
||||
"github.com/labstack/echo-contrib/session"
|
||||
"github.com/labstack/echo/v4"
|
||||
|
@ -44,9 +44,9 @@ func (t *TemplateRegistry) Render(w io.Writer, name string, data interface{}, c
|
|||
}
|
||||
|
||||
// New function
|
||||
func New(tmplBox *rice.Box, extraData map[string]string) *echo.Echo {
|
||||
func New(tmplBox *rice.Box, extraData map[string]string, secret []byte) *echo.Echo {
|
||||
e := echo.New()
|
||||
e.Use(session.Middleware(sessions.NewCookieStore([]byte("secret"))))
|
||||
e.Use(session.Middleware(sessions.NewCookieStore(secret)))
|
||||
|
||||
// read html template file to string
|
||||
tmplBaseString, err := tmplBox.String("base.html")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue